Print

Print


Ok Omar, sorry,
I should have been first sent to hps-software list.
Anyway this modification was done locally in my computer just
to be able to have a look into new data files.

Thanks Jaeremy, I didn't realize that before.
Sure I will try to use that.

Rafo


On 12/19/2014 02:53 PM, McCormick, Jeremy I. wrote:
> Hi, Rafyel et al.
>
> There is an alternative way of getting the LCIO data into ROOT.
>
> https://confluence.slac.stanford.edu/display/hpsg/Loading+LCIO+Files+into+ROOT
>
> You can just load directly an LCIO file into a .C script using this setup.
>
> First you need to install the standalone LCIO C++ binding, which is easy to do (installation instructions in the above link).
>
> This way there isn't any requirement that certain collections be present.
>
> There is a standard LCIO example that was modified to histogram track information from LCIO using ROOT.
>
> https://confluence.slac.stanford.edu/download/attachments/127607696/anajob.C
>
> This could very easily be adapted for ECAL data.  All you need to do it replace the Track class with CalorimeterHit or Cluster and get the data from the event using the correct collection name.
>
> e.g. the line from that script
>
> tracks = evt->getCollection("MatchedTracks");
>
> becomes this to get clusters
>
> collection = evt->getCollection("EcalClustersIC");
>
> or this to get hits
>
> collection = evt->getCollection("EcalCalHits");
>
> The last part is getting object pointers, and of course you gotta do an on-the-fly cast because this is C++!
>
> e.g. to get a cluster
>
> EVENT::Cluster* cluster = (EVENT::Cluster*)collection->getElementAt(i);
>
> or to get a hit
>
> EVENT::CalorimeterHit* calHit = (EVENT::CalorimeterHit*)collection->getElementAt(i);
>
> The just fill your H1D or whatever from the object information using the LCIO API e.g.
>
> CalorimeterHit API
>
> http://lcio.desy.de/v02-04-03/doc/doxygen_api/html/classEVENT_1_1CalorimeterHit.html
>
> calHit->getEnergy();
> calHit->getTime();
> etc.
>
> Note that there is some ID magic that needs to happen for getting layer number etc. and that's a bit more advanced!  (Not in the example.)
>
> Cluster API
>
> http://lcio.desy.de/v02-04-03/doc/doxygen_api/html/classEVENT_1_1Cluster.html
>
> cluster->getEnergy();
> cluster->getPosition()[0]; // cluster X pos
> etc.
>
> If you know C++ I believe you should easily be able to modify this script to get at the LCIO collection you want to analyze.
>
> --Jeremy
>
> -----Original Message-----
> From: [log in to unmask] [mailto:[log in to unmask]] On Behalf Of Mathew Graham
> Sent: Friday, December 19, 2014 11:19 AM
> To: Omar Moreno; Rafayel Paremuzyan
> Cc: hps-software
> Subject: Re: DST files from Data
>
>
>
>
> 	On 12/19/2014 11:15:29 AM, Omar Moreno <[log in to unmask]> wrote:
>
>
>
> 	On Wed, Dec 17, 2014 at 7:08 PM, Rafayel Paremuzyan <[log in to unmask] <mailto:[log in to unmask]> > wrote:
>
> 		Hi,
> 		
> 		I tried to convert some recon files from data into dst root files.
> 		Since it only contains ecal information, in the
> 		HpsEventBuilder.cxx I only let ecal_writer-writeData(event, hps_event),
> 		and commented other writers (svt, particle etc)
> 		
>
>
> 	It's a terrible idea to start hacking up the DST maker.  There are some collections which are dependent on others and if you just comment out the writers, it will likely break things.  Furthermore, whatever DST files you generate will not be backwards compatible because the class versions will have likely changed.  If you want DST files and you see the DST maker isn't working correctly, please send an email to the software list first.
> 	
> 	
> 	That said, I was assuming that we were already making DST's as part of the recon chain.  Matt is this being done?
>
> Mathew Graham:
>
> No...there's no chain yet as we still haven't started "production".
>
>
>
> 	I'm going to begin cleaning up the DST writer so it makes it easier to run over recon files containing ECal data only.  Once it's done, I'll generate some DST's and put them in the volatile area under the appropriate folder.  It's probably going to take me a while due to the holiday, but I'll try to get it done ASAP.
> 	
> 	​
> 	
>
>
> 		With this I was able to convert 2 files from run 3258,
> 		and on the 3th file about in the middle I got an exception
> 		
> 		 A runtime error has occured : lcio::DataNotAvailableException: LCEventImpl::getCollection: collection not in event:EcalClusters
> 		 the program will have to be terminated - sorry.
> 		
> 		However when I tried to convert files from more recent run 3340,
> 		I got the same exception at the beginning.
> 		
> 		Looking into the slcio file through JAS, it shows that some portion of events have no any collection in it
> 		except "TriggerBank".
> 		
> 		The question is, is it possible to skip these events in the dst maker.
> 		From first sight I didn't find a way, but if there is a possibility please point me there,
> 		I will try to do it.
> 		
>
>
> 	​There is a way to skip events, but we shouldn't.  The DST writers were specifically designed to throw exceptions if expected collections aren't found.  The error you are seeing is indicating that either the collection name has changed or, as you mention above, the collection is missing in the recon file, so as far as I'm concerned, the DST maker did it's job.  This is a problem with the reconstruction that should be fixed in hps-java and not at the DST level.
> 	
> 	
> 	Can someone more familiar with the ECal recon take a look at why empty collections aren't being added for some events?​
> 	
>
>
> 		Rafo
> 		
>
> ________________________________
>
>
> 		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
>
>
> ########################################################################
> 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