Print

Print


Hi, Kyle.

Using the HPS conditions system "from scratch" requires some setup, as the default LCSim conditions manager knows nothing about any of our classes or the database.
So we have our own conditions manager implementation that needs to be installed first.

Do this first in your main method...

DatabaseConditionsManager conditionsManager = DatabaseConditionsManager.getInstance();

That will bootstrap the HPS conditions system.

Then you will also need to set a valid detector and run number so it knows what conditions to load, for instance...

conditionsManager.setDetector("HPS-Proposal2014-v7-2pt2", 2000);

Run number would probably be 2000 if you want Eng Run conditions.

After setDetector is called you should see a bunch of printouts about the conditions that it loaded.

After this, you can then use the API normally.

BTW, there are a bunch of tests in the conditions module in src/test/java where you can see how this all works.

--Jeremy

-----Original Message-----
From: Kyle McCarty [mailto:[log in to unmask]] 
Sent: Tuesday, December 09, 2014 5:34 PM
To: McCormick, Jeremy I.
Subject: Accessing Ecal Conditions

Hello Jeremy,

I am trying to access the calorimeter conditions in the conditions database. I wrote a method as follows:



	    public static void main(String[] args) {
	        // Get ECAL conditions.
	        EcalConditions ecalConditions = ConditionsManager.defaultInstance().getCachedConditions(EcalConditions.class, TableConstants.ECAL_CONDITIONS).getCachedData();
	         
	        // Get the list of EcalChannel objects.
	        EcalChannelCollection channels = ecalConditions.getChannelCollection();
	        
	        for(EcalChannel channel : channels) {
	            System.out.printf("Channel ID      :: %d%n", channel.getChannelId());
	            System.out.printf("Channel Number  :: %d%n", channel.getChannel());
	            System.out.printf("Crate Number    :: %d%n", channel.getCrate());
	            System.out.printf("Slot Number     :: %d%n", channel.getSlot());
	            System.out.printf("Crystal x-Index :: %d%n", channel.getX());
	            System.out.printf("Crystal y-Index :: %d%n", channel.getY());
	            System.out.println();
	        }
	    }
	


When run it gives the following error:



	Exception in thread "main" org.lcsim.conditions.ConditionsManager$ConditionsSetNotFoundException: No converter registered for type: org.hps.conditions.ecal.EcalConditions
	    at org.lcsim.conditions.ConditionsManagerImplementation.getCachedConditions(ConditionsManagerImplementation.java:93)
	    at org.hps.users.kmccarty.DatabaseCheck.main(DatabaseCheck.java:13)


What did I do incorrectly? I tried to follow the instructions on your linked web page. Did I miss something?

Thanks,


Kyle 


########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the HPS-SOFTWARE list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=HPS-SOFTWARE&A=1