LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lcio_performance.cc
Go to the documentation of this file.
1 #include "lcio.h"
2 
3 #include "IO/LCWriter.h"
4 #include "IO/LCReader.h"
5 #include "IO/LCEventListener.h"
6 #include "MT/LCReader.h"
7 #include "MT/LCReaderListener.h"
8 
9 #include "EVENT/LCIO.h"
10 #include "DATA/LCFloatVec.h"
11 #include "DATA/LCIntVec.h"
12 
13 #include "IMPL/LCEventImpl.h"
14 #include "IMPL/LCRunHeaderImpl.h"
15 #include "IMPL/LCCollectionVec.h"
17 #include "IMPL/SimTrackerHitImpl.h"
18 #include "IMPL/MCParticleImpl.h"
19 //#include "IMPL/LCFlagImpl.h"
20 #include "IMPL/LCTOOLS.h"
21 
23 #include "IMPL/TrackerDataImpl.h"
24 #include "IMPL/TrackerPulseImpl.h"
25 
27 #include "UTIL/LCTime.h"
28 //#include "UTIL/BitField64.h"
29 #include "UTIL/CellIDEncoder.h"
30 #include "UTIL/LCTypedVector.h"
31 #include "UTIL/LCSplitWriter.h"
32 #include "UTIL/BitSet32.h"
33 
34 // #include "UTIL/LCIOTypeInfo.h"
35 
36 
37 #include <cstdlib>
38 #include <iostream>
39 #include <sstream>
40 
41 
42 using namespace std ;
43 using namespace lcio ;
44 
45 static const int NRUN = 50 ;
46 static const int NEVENT = 100 ; // events
47 static const int NMCPART = 100 ; // mc particles per event
48 static const int NHITS = 50 ; // calorimeter hits per event
49 
50 static string FILEN = "lcioperf.slcio" ;
51 
52 
54 
55 public:
57  ReadPerformanceProcessorMT& operator=(const ReadPerformanceProcessorMT &) = delete ;
58 
60  _lcReader(reader) {
61 
62  }
63 
65  clock_t endTime = clock() ;
66  _totalReadTime += (endTime - _startTime) / static_cast<double>( CLOCKS_PER_SEC ) ;
67  _nEvents ++;
68  _startTime = clock() ;
69  }
70 
72 
73  void readStream() {
74  _startTime = clock() ;
75  _lcReader->readStream( this ) ;
76  std::cout << "Read " << _nEvents << " events" << std::endl ;
77  std::cout << "Total read time: " << _totalReadTime << " secs" << std::endl ;
78  std::cout << "Mean read time: " << _totalReadTime / _nEvents << " secs / event" << std::endl ;
79  }
80 
81 private:
82  clock_t _startTime {0} ;
83  double _totalReadTime {0.} ;
84  unsigned int _nEvents {0} ;
85  MT::LCReader *_lcReader {nullptr} ;
86 };
87 
88 
89 
91 
92 public:
94  ReadPerformanceProcessor& operator=(const ReadPerformanceProcessor &) = delete ;
95 
96  ReadPerformanceProcessor( LCReader *reader ) :
97  _lcReader(reader) {
98 
99  }
100 
101  void processEvent( LCEvent* ) {
102  clock_t endTime = clock() ;
103  _totalReadTime += (endTime - _startTime) / static_cast<double>( CLOCKS_PER_SEC ) ;
104  _nEvents ++;
105  _startTime = clock() ;
106  }
107 
108  void modifyEvent( LCEvent* ) {}
109 
110  void readStream() {
111  _startTime = clock() ;
112  _lcReader->readStream() ;
113  std::cout << "Read " << _nEvents << " events" << std::endl ;
114  std::cout << "Total read time: " << _totalReadTime << " secs" << std::endl ;
115  std::cout << "Mean read time: " << _totalReadTime / _nEvents << " secs / event" << std::endl ;
116  }
117 
118 private:
119  clock_t _startTime {0} ;
120  double _totalReadTime {0.} ;
121  unsigned int _nEvents {0} ;
122  LCReader *_lcReader {nullptr} ;
123 };
124 
125 //struct MyTrackLink : public LCObjectLinkTraits< SimTrackerHit, MyTrackLink > {} ;
126 
130 int main(int argc, char** argv ){
131 
132  double totalWritingTime = 0. ;
133 
134  if( argc > 1 ) { FILEN = argv[1] ; }
135 
136  try {
137 
138  // create sio writer
139  LCWriter* lcWrt = LCFactory::getInstance()->createLCWriter() ;
140  lcWrt->setCompressionLevel( 1 ) ;
141  lcWrt->open( FILEN , LCIO::WRITE_NEW ) ;
142 
143  // loop over runs
144  for(int rn=0;rn<NRUN;rn++){
145 
146  LCRunHeaderImpl* runHdr = new LCRunHeaderImpl ;
147  runHdr->setRunNumber( rn ) ;
148 
149  string detName("D09TileHcal") ;
150  runHdr->setDetectorName( detName ) ;
151 
152  stringstream description ;
153  description << " run: " << rn <<" just for testing lcio - no physics !" ;
154  runHdr->setDescription( description.str() ) ;
155 
156  string ecalName("ECAL007") ;
157  runHdr->addActiveSubdetector( ecalName ) ;
158 
159  string tpcName("TPC4711") ;
160  runHdr->addActiveSubdetector( tpcName ) ;
161 
162 
163  // add some parameters to the run header
164 // StringVec sv1 ;
165 // sv1.push_back("simjob.cc") ;
166 // runHdr->parameters().setValues( "SimulationProgram" , sv1 ) ;
167  runHdr->parameters().setValue( "SimulationProgram" , "simjob.cc" ) ;
168  IntVec iv(3) ;
169  iv[0] = 1 ;
170  iv[1] = 2 ;
171  iv[2] = 3 ;
172  runHdr->parameters().setValues( "SomeIndices" , iv ) ;
173 
174  lcWrt->writeRunHeader( runHdr ) ;
175 
176  // EventLoop - create some events and write them to the file
177  for(int i=0;i<NEVENT;i++){
178 
179  // we need to use the implementation classes here
180  LCEventImpl* evt = new LCEventImpl() ;
181 
182 
183  evt->setRunNumber( rn ) ;
184  evt->setEventNumber( i ) ;
185  LCTime now ;
186  evt->setTimeStamp( now.timeStamp() ) ;
187  evt->setDetectorName( detName ) ;
188 
189  evt->setWeight( 1.*rand()/RAND_MAX ) ;
190 
191  evt->parameters().setValue("Description"," event can have it's own set of parameters" ) ;
192  evt->parameters().setValue("Thrust", (float) 0.671 ) ;
193 
194  FloatVec fv ;
195  fv.push_back( 1.1 ) ;
196  fv.push_back( 2.2 ) ;
197  fv.push_back( 3.3 ) ;
198  evt->parameters().setValues( "SomeNumbers" , fv ) ;
199 
200  // create and add some mc particles
201  LCCollectionVec* mcVec = new LCCollectionVec( LCIO::MCPARTICLE ) ;
202 
203  // debug only - don't write MCParticles to output file:
204  // mcVec->setTransient() ;
205 
206  // debug only - add the same particle to more than one collection
207  //LCCollectionVec* mcVec2 = new LCCollectionVec( LCIO::MCPARTICLE ) ;
208 
209  MCParticleImpl* mom = new MCParticleImpl ;
210  mom->setPDG( 1 ) ;
211  float p0[3] = { 0. , 0. , 1000. } ;
212  mom->setMomentum( p0 ) ;
213  mom->setMass( 3.01 ) ;
214 
215 
216  for(int j=0;j<NMCPART;j++){
217 
218  MCParticleImpl* mcp = new MCParticleImpl ;
219 
220  mcp->setPDG( 1000 * (j+1) ) ;
221  float p[3] = { float(j*1.) , float(4./1024.) , float(8./1024.) } ;
222  mcp->setMomentum( p ) ;
223  mcp->setMass( .135 ) ;
224 
225  // create and add some daughters
226  for(int k=0;k<3;k++){
227  MCParticleImpl* d1 = new MCParticleImpl ;
228 
229  d1->setPDG( 1000 * (j+1) + 100 * (k+1) ) ;
230  float pd1[3] = { float(k*1.) , float(4.1) , float(8.1) } ;
231  d1->setMomentum( pd1 ) ;
232  d1->setMass( .135 ) ;
233 
234  for(int l=0;l<2;l++){
235  MCParticleImpl* d2 = new MCParticleImpl ;
236 
237  d2->setPDG( 1000 * (j+1) + 100 * (k+1) + 10 * (l+1) ) ;
238  float pd2[3] = { float(l*1.) , float(0.41) , float(4.1) } ;
239  d2->setMomentum( pd2 ) ;
240  d2->setMass( .135 ) ;
241 
242  double ep[3] = { 1.111111 , 2.2222222, 3.3333333 } ;
243  d2->setEndpoint( ep ) ;
244  // d2->setSimulatorStatus( 1234 ) ;
245  d2->setCreatedInSimulation(true) ;
246  d2->setBackscatter(true) ;
247  d2->setDecayedInTracker(true) ;
248  d2->setDecayedInCalorimeter(false);
249  d2->setHasLeftDetector(false) ;
250  d2->setStopped(true) ;
251 
252  d2->addParent( d1 );
253  mcVec->push_back( d2 ) ;
254 
255  // debug only - add the same particle to more than one collection
256  //mcVec2->push_back( d2 ) ;
257  }
258  d1->addParent( mcp );
259  mcVec->push_back( d1 ) ;
260  }
261 
262  mcp->addParent( mom );
263  mcVec->push_back( mcp ) ;
264  }
265  mcVec->push_back( mom ) ;
266 
267  // now add some calorimeter hits
268  LCCollectionVec* calVec = new LCCollectionVec( LCIO::SIMCALORIMETERHIT ) ;
269 
270  // set flag for long format (including position )
271  // and PDG and cellid1
272  // LCFlagImpl chFlag(0) ;
273  // chFlag.setBit( LCIO::CHBIT_LONG ) ;
274  // chFlag.setBit( LCIO::CHBIT_STEP ) ;
275  // calVec->setFlag( chFlag.getFlag() ) ;
276 
277  calVec->setFlag( UTIL::make_bitset32( LCIO::CHBIT_LONG, LCIO::CHBIT_STEP ) );
278 
279 
280 
281  std::string cellIDEncoding( "M:3,S-1:3,I:9,J:9,K-1:6") ;// old Mokka convention
282 
283 // std::string cellIDEncoding( "M:3,S-1:3,I:9,J:9,K-1:6,Bla:34:6") ;// for testing cellid1
284 
285  CellIDEncoder<SimCalorimeterHitImpl> b( cellIDEncoding , calVec ) ;
286 
287  for(int j=0;j<NHITS;j++){
288 
289  SimCalorimeterHitImpl* hit = new SimCalorimeterHitImpl ;
290 
291  hit->setEnergy( 3.1415 * rand()/RAND_MAX ) ;
292 
293  float pos[3] = { float(1.1* rand()/RAND_MAX) , float(2.2* rand()/RAND_MAX) , float(3.3* rand()/RAND_MAX) } ;
294 
295  // cell indices
296  b["M"] = j % 8 ;
297  b["S-1"] = (j+2) % 8 ;
298  b["I"] = j % 512 ;
299  b["J"] = (j+128) % 512 ;
300  b["K-1"] = (j+32) % 64 ;
301 
302  b.setCellID( hit ) ;
303 
304 // hit->setCellID0( b.lowWord() ) ;
305 // hit->setCellID1( b.highWord() ) ;
306 
307  hit->setPosition( pos ) ;
308 
309  calVec->push_back( hit ) ;
310 
311  // assign the hits randomly to MC particles
312  double rnd = .99999*rand()/RAND_MAX ;
313  int mcIndx = static_cast<int>( NMCPART * rnd ) ;
314 
315  // in order to access a MCParticle, we need a dynamic cast as the
316  // LCCollection returns an LCIOObject - this is like vectors in Java
317  hit->addMCParticleContribution( dynamic_cast<MCParticle*>(mcVec->getElementAt( mcIndx )) ,
318  0.314159, 0.1155, 42., 1, pos ) ;
319 
320  }
321 
322  // -------- data can be modified as long as is not not made persistent --------
323 
324  for(int j=0;j<NHITS;j++){
325  SimCalorimeterHitImpl* existingHit
326  = dynamic_cast<SimCalorimeterHitImpl*>( calVec->getElementAt(j) ) ; // << Ok now
327 
328  existingHit->addMCParticleContribution( dynamic_cast<MCParticle*>
329  (mcVec->getElementAt(0)),
330  0.1, 0. ) ;
331  }
332 
333 
334  // and finally some tracker hits
335  // with some user extensions (4 floats and 2 ints) per track:
336  // we just need to create parallel collections of float and int vectors
337  LCCollectionVec* trkVec = new LCCollectionVec( LCIO::SIMTRACKERHIT ) ;
338  LCCollectionVec* extFVec = new LCCollectionVec( LCIO::LCFLOATVEC ) ;
339  LCCollectionVec* extIVec = new LCCollectionVec( LCIO::LCINTVEC ) ;
340 
341  // LCFlagImpl thFlag(0) ;
342  // thFlag.setBit( LCIO::THBIT_MOMENTUM ) ;
343  // trkVec->setFlag( thFlag.getFlag() ) ;
344  trkVec->setFlag( UTIL::make_bitset32( LCIO::THBIT_MOMENTUM ) ) ;
345 
346  LCTypedVector<MCParticle> mcpTV( mcVec ) ;
347 
348  CellIDEncoder<SimTrackerHitImpl> cd( "i:8,j:8,k:8" ,trkVec ) ;
349 
350  for(int j=0;j<NHITS;j++){
351 
352  SimTrackerHitImpl* hit = new SimTrackerHitImpl ;
353 
354  cd["i"] = j ;
355  cd["j"] = j + 100 ;
356  cd["k"] = j + 200 ;
357 
358  cd.setCellID( hit ) ;
359 
360  LCFloatVec* extF = new LCFloatVec ;
361  LCIntVec* extI = new LCIntVec ;
362 
363  //hit->setdEdx( 30e-9 ) ;
364  hit->setEDep( 30e-9 ) ;
365 
366  double pos[3] = { 1.1* rand()/RAND_MAX , 2.2* rand()/RAND_MAX , 3.3* rand()/RAND_MAX } ;
367 
368  hit->setPosition( pos ) ;
369 
370  // assign the hits randomly to MC particles
371  float rnd = .99999*rand()/RAND_MAX ;
372  int mcIndx = static_cast<int>( NMCPART * rnd ) ;
373 
374 
375 // hit->setMCParticle( dynamic_cast<MCParticle*>(mcVec->getElementAt( mcIndx ) ) ) ;
376  hit->setMCParticle( mcpTV[ mcIndx ] ) ;
377 
378  hit->setMomentum( 1. , 2. , 3. ) ;
379  hit->setPathLength( .042 ) ;
380 
381  // fill the extension vectors (4 floats, 2 ints)
382  extF->push_back( 3.14159 ) ;
383  for(int k=0;k<3;k++) extF->push_back( pos[k] * 0.1 ) ;
384 
385  extI->push_back( 123456789 ) ;
386  extI->push_back( mcIndx ) ;
387 
388  // add the hit and the extensions to their corresponding collections
389  trkVec->push_back( hit ) ;
390  extFVec->push_back( extF ) ;
391  extIVec->push_back( extI ) ;
392  }
393 
394 
395  // add all collections to the event
396  evt->addCollection( mcVec , "MCParticle" ) ;
397 
398  //deubg only
399  //evt->addCollection( mcVec2, "MCParticle2" ) ;
400 
401  evt->addCollection( calVec , ecalName ) ;
402  evt->addCollection( trkVec , tpcName ) ;
403  evt->addCollection( extFVec , tpcName+"UserFloatExtension" ) ;
404  evt->addCollection( extIVec , tpcName+"UserIntExtension" ) ;
405 
406  // test: add a collection for one event only:
407 // if( rn == NRUN-1 && i == 0 ) { // first event o last run
408  if( rn == 1 && i == 0 ) { // first event o last run
409  LCCollectionVec* addExtVec = new LCCollectionVec( LCIO::LCFLOATVEC ) ;
410  LCFloatVec* addExt = new LCFloatVec ;
411  addExt->push_back( 1. );
412  addExt->push_back( 2. );
413  addExt->push_back( 3. );
414  addExt->push_back( 4. );
415  addExtVec->push_back( addExt ) ;
416  evt->addCollection( addExtVec , "AdditionalExtension" ) ;
417  }
418  //---- write a subset of MCParticle to the event ------
419  LCCollectionVec* mcSubVec = new LCCollectionVec( LCIO::MCPARTICLE ) ;
420  mcSubVec->setSubset(true) ;
421 
422  for(int j=0;j< mcVec->getNumberOfElements() ; j++ ){
423 
424  MCParticle* p = dynamic_cast< MCParticle*>( mcVec->getElementAt(j) ) ;
425  if( p->getDaughters().size() == 0 )
426  mcSubVec->addElement( p ) ;
427  }
428  evt->addCollection( mcSubVec , "FinalMCParticles" ) ;
429  //-----------------------------------------------------
430 
431 
432 
433  // even though this is a simjob we can store 'real data' objects :)
434 
435 #define WRITE_TRACKERRAWDATA 1
436 #ifdef WRITE_TRACKERRAWDATA
437  //--- write some new TPC raw data collections to the file
438  LCCollectionVec* tpcRawVec = new LCCollectionVec( LCIO::TRACKERRAWDATA ) ;
439 
440  for(int j=0;j<NHITS;j++){
441 
442  TrackerRawDataImpl* tpcRaw = new TrackerRawDataImpl ;
443 
444  tpcRaw->setCellID0( j ) ;
445  tpcRaw->setTime( -j ) ;
446 
447  if( j % 2 ) { // test two ways of setting the charge
448  ShortVec adcValues ;
449  adcValues.push_back( 42 ) ;
450  adcValues.push_back( 43 ) ;
451  adcValues.push_back( 44 ) ;
452  adcValues.push_back( 45 ) ;
453  tpcRaw->setADCValues( adcValues ) ;
454  } else {
455  tpcRaw->adcValues().push_back( 42 ) ;
456  tpcRaw->adcValues().push_back( 43 ) ;
457  tpcRaw->adcValues().push_back( 44 ) ;
458  tpcRaw->adcValues().push_back( 45 ) ;
459  }
460  tpcRawVec->addElement( tpcRaw ) ;
461  }
462  evt->addCollection( tpcRawVec , "TrackerRawDataExample" ) ;
463 
464  //---- test new relation navigator object
465  LCRelationNavigator relNav( LCIO::TRACKERRAWDATA, LCIO::SIMTRACKERHIT ) ;
466 
467  for(int j=0;j<NHITS;j++){
468  relNav.addRelation( tpcRawVec->getElementAt(j) , trkVec->getElementAt(j) , 0.42 ) ;
469 
470 // tpcRawVec->getElementAt(j)->link<MyTrackLink>() =
471 // (*tpcRawVec)[j]->link< MyTrackLink >() =
472 // dynamic_cast<SimTrackerHit*>( (*trkVec)[j] );
473 
474  }
475  evt->addCollection( relNav.createLCCollection() , "TPCRawFADCMCTruth" ) ;
476 
477 
478  //------ corrected data
479 
480  LCCollectionVec* tpcCorrectedVec = new LCCollectionVec( LCIO::TRACKERDATA ) ;
481 
482  for(int j=0;j<NHITS;j++){
483 
484  TrackerDataImpl* tpcCorrected = new TrackerDataImpl ;
485 
486  tpcCorrected->setCellID0( j ) ;
487  tpcCorrected->setTime( -j ) ;
488 
489  tpcCorrected->chargeValues().push_back( 42.12345 ) ;
490  tpcCorrected->chargeValues().push_back( 43.09876 ) ;
491  tpcCorrected->chargeValues().push_back( 44.12345 ) ;
492  tpcCorrected->chargeValues().push_back( 45.09876 ) ;
493 
494  tpcCorrectedVec->addElement( tpcCorrected ) ;
495  }
496  evt->addCollection( tpcCorrectedVec , "TrackerDataExample" ) ;
497 
498  // ------ pulses
499 
500  LCCollectionVec* tpcPulseVec = new LCCollectionVec( LCIO::TRACKERPULSE ) ;
501 
502  IntVec qualityBits ;
503  qualityBits.push_back(0) ;
504  qualityBits.push_back(1) ;
505 
506  StringVec bitNames ;
507  bitNames.push_back("GOOD") ;
508  bitNames.push_back("BAD") ;
509 
510  tpcPulseVec->parameters().setValues("TrackerPulseQualityNames", bitNames );
511  tpcPulseVec->parameters().setValues("TrackerPulseQualityValues", qualityBits );
512 
513  for(int j=0;j<NHITS;j++){
514 
515  TrackerPulseImpl* tpcPulse = new TrackerPulseImpl ;
516 
517  tpcPulse->setCellID0( j ) ;
518  tpcPulse->setTime( 3.1415 + 0.1 * j ) ;
519  tpcPulse->setCharge( 3.1415 - 0.1 * j ) ;
520 
521  if( j % 2 ) {
522  tpcPulse->setQualityBit( qualityBits[0] ) ;
523  } else {
524 
525  tpcPulse->setQualityBit( qualityBits[1] ) ;
526 
527  TrackerData* corr =
528  dynamic_cast<TrackerData*> ( tpcCorrectedVec->getElementAt(j) ) ;
529  tpcPulse->setTrackerData( corr ) ;
530  }
531 
532  tpcPulseVec->addElement( tpcPulse ) ;
533  }
534  evt->addCollection( tpcPulseVec , "TrackerPulseExample" ) ;
535 
536  //-----------------------------------------------------
537 #endif // WRITE_TRACKERRAWDATA
538 
539 #define WRITE_VTXRAWHITS 1
540 #ifdef WRITE_VTXRAWHITS
541 
542  //--- write some VTX raw hits to the file - using the TrackerPulse
543  LCCollectionVec* vtxRawVec = new LCCollectionVec( LCIO::TRACKERPULSE ) ;
544 
545  for(int j=0;j<NHITS;j++){
546 
547  TrackerPulseImpl* vtxRaw = new TrackerPulseImpl ;
548 
549  vtxRaw->setCellID0( 0xBebaFeca ) ;
550  vtxRaw->setCellID1( 0xCafeBabe ) ;
551  vtxRaw->setTime( j ) ;
552  vtxRaw->setCharge( 42 + j ) ;
553 
554  vtxRawVec->addElement( vtxRaw ) ;
555  }
556  evt->addCollection( vtxRawVec , "SiliconRawHitExample" ) ;
557 
558  //-----------------------------------------------------
559 #endif // WRITE_VTXRAWHITS
560 
561 
562 
563  // write the event to the file
564  clock_t start = clock() ;
565  lcWrt->writeEvent( evt ) ;
566  clock_t end = clock() ;
567 
568  totalWritingTime += (end - start) / static_cast<double>( CLOCKS_PER_SEC ) ;
569 
570  // ------------ IMPORTANT ------------- !
571  // we created the event so we need to delete it ...
572  delete evt ;
573  // -------------------------------------
574 
575  } // evt loop
576 
577  delete runHdr ;
578 
579  } // run loop
580 
581  lcWrt->close() ;
582  delete lcWrt ;
583 
584  std::cout << "Written " << NRUN << " runs and " << NRUN*NEVENT << " events" << std::endl ;
585  std::cout << "Total writing time: " << totalWritingTime << " secs" << std::endl ;
586  std::cout << "Mean writing time: " << totalWritingTime / (NRUN*NEVENT) << " secs / event" << std::endl ;
587 
588  {
589  // create reader and writer for input and output streams
590  LCReader* lcReader = LCFactory::getInstance()->createLCReader() ;
591  lcReader->open( FILEN ) ;
592  ReadPerformanceProcessor listener( lcReader ) ;
593  lcReader->registerLCEventListener( &listener ) ;
594  std::cout << "With standard LCReader: " << std::endl ;
595  listener.readStream() ;
596  delete lcReader ;
597  }
598 
599 
600  {
602  mtReader.open( FILEN ) ;
603  ReadPerformanceProcessorMT listener( &mtReader ) ;
604  std::cout << "With MT LCReader: " << std::endl ;
605  listener.readStream() ;
606  }
607 
608  {
610  mtReader.open( FILEN ) ;
611  ReadPerformanceProcessorMT listener( &mtReader ) ;
612  std::cout << "With Lazy MT LCReader: " << std::endl ;
613  listener.readStream() ;
614  }
615 
616 
617  } catch( Exception& ex){
618 
619  cout << " an excpetion occured: " << endl ;
620  cout << " " << ex.what() << endl ;
621  return 1 ;
622  }
623 
624  return 0 ;
625 }
626 
void processEvent(MT::LCEventPtr)
process an event
std::vector< std::string > StringVec
Vector of strings.
Definition: LCIOSTLTypes.h:16
void open(const std::string &filename)
Opens a file for reading (read-only).
Definition: LCReader.cc:43
T rand(T...args)
ReadPerformanceProcessor(LCReader *reader)
std::vector< float > FloatVec
Vector of floats.
Definition: LCIOSTLTypes.h:18
T endl(T...args)
T clock(T...args)
static const int NRUN
T end(T...args)
STL class.
static const int NHITS
static constexpr int directAccess
Bit for direct access.
Definition: LCReader.h:45
T push_back(T...args)
static const int NMCPART
int main(int argc, char **argv)
Simple program that opens existing LCIO files and appends the records needed for direct access - if t...
ReadPerformanceProcessorMT(MT::LCReader *reader)
T str(T...args)
static const int NEVENT
Implementation of a LCReader for parallel processing use.
Definition: LCReader.h:37
static string FILEN
std::vector< int > IntVec
Vector of ints.
Definition: LCIOSTLTypes.h:22
LCRunHeader * runHdr
Definition: lsh.cc:79
LCReader * lcReader
Definition: lsh.cc:78
void processRunHeader(MT::LCRunHeaderPtr)
process a run header
LCReaderListener class Interface for MT::LCReader::readStream() callbacks.
BitSet32 make_bitset32(int bit0)
Convenient helper that creates a BitSet32 with bit0 set.
Definition: BitSet32.h:49
std::vector< short > ShortVec
Vector of shorts.
Definition: LCIOSTLTypes.h:24
static constexpr int lazyUnpack
Bit for lazy unpacking of event records.
Definition: LCReader.h:47