Print

Print


I have a java-for-dummies question:

> java -jar hps-distribution-bin.jar -i lcioFile.slcio steeringFile.xml

In what code in hps-java does this command start execution?
Or what is the main class here (is that the correct jargon?)?

(I'm only familiar with "java -cp hps.jar org.hps.evio.EvioToLcio".)

-Nathan



On Jul 24, 2015, at 8:27 PM, Sho Uemura <[log in to unmask]> wrote:

> Instead of writing a main() class and doing your analysis inside it, you would probably find it easier to write a Driver. Then the existing hps-java code will take care of reading events from the file and passing EventHeaders to your Driver.
> 
> Roughly:
> 
> 1. Follow the instructions to install and build hps-java (maybe you've done this already): https://confluence.slac.stanford.edu/display/hpsg/Installing+HPS+Java
> 
> 2. Make a class that extends Driver, much like what you already seem to have in trunk/users/src/main/java/org/hps/users/spaul/HitrateHistograms.java. You can put your analysis code in the method process(EventHeader event).
> 
> 3. Build hps-java to compile your Driver into an hps-distribution .jar file.
> 
> 4. Write a steering file that calls your Driver, much like what you have in trunk/steering-files/src/main/resources/org/hps/steering/users/spaul/HitrateHistograms.lcsim.
> 
> 5. Run the steering file on data:
> 
> java -jar hps-distribution-bin.jar -i lcioFile.slcio steeringFile.xml
> 
> 
> If there's a reason a Driver is not appropriate for what you're doing, maybe we can figure something out that works. What you're doing now seems really strange without some more explanation.
> 
> On Fri, 24 Jul 2015, Sebouh Paul wrote:
> 
>> this seems like a stupid question but how do I get an "EventHeader" from a
>> file?
>> 
>> I get this error:
>> 
>> ifarm1101> java -cp "lib/*:bin" hps.protonradius.GetCharge
>> /work/hallb/hps/data/engrun2015/pass1/recon/hps_005779.81_recon_R3321.slcio
>> 5779
>> 
>> blah
>> 
>> Exception in thread "main"
>> org.lcsim.conditions.ConditionsManager$ConditionsSetNotFoundException: No
>> converter registered for type: org.lcsim.geometry.Detector
>> 
>> at
>> org.lcsim.conditions.ConditionsManagerImplementation.getCachedConditions(ConditionsManagerImplementation.java:92)
>> 
>> at org.lcsim.event.base.BaseLCSimEvent.getDetector(BaseLCSimEvent.java:76)
>> 
>> at
>> org.lcsim.lcio.SIOTrackBlockHandler.addCollectionElements(SIOTrackBlockHandler.java:23)
>> 
>> at
>> org.lcsim.lcio.AbstractBlockHandler.readCollection(AbstractBlockHandler.java:39)
>> 
>> at
>> org.lcsim.lcio.AbstractBlockHandler.readBlock(AbstractBlockHandler.java:32)
>> 
>> at org.lcsim.lcio.LCIOReader.read(LCIOReader.java:77)
>> 
>> at hps.protonradius.GetCharge.main(GetCharge.java:22)
>> 
>> 
>> With this program:
>> 
>> public class GetCharge {
>> 
>> public static void main(String arg[]) throws IOException,
>> NumberFormatException, ConditionsNotFoundException{
>> 
>> LCIOReader reader = new LCIOReader(new File(arg[0]));
>> 
>> //ConditionsManagerImplementation.defaultInstance().setRun(Integer.parseInt(arg[1]));
>> 
>> //ConditionsManagerImplementation.defaultInstance().
>> 
>> System.out.println("blah");
>> 
>> EventHeader h = reader.read();
>> 
>> while(h != null){
>> 
>> process(h);
>> 
>> }
>> 
>> System.out.println("done");
>> 
>> }
>> 
>> ....
>> 
>> }
>> 
>> ########################################################################
>> 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
>> 
> 
> ########################################################################
> 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

########################################################################
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