StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEventMaker.cxx
1 
11 #include <vector>
12 #include <algorithm>
13 #include <utility>
14 #include <cstdlib>
15 #include "TError.h"
16 #include "TString.h"
17 #include "StEventMaker/StEventMaker.h"
18 #include "StEventMaker/StRootEventManager.hh"
19 #include "PhysicalConstants.h"
20 #include "SystemOfUnits.h"
21 #include "StEventTypes.h"
22 #include "StMessMgr.h"
23 #include "StMemoryInfo.hh"
24 #include "StTimer.hh"
25 #include "StGlobals.hh"
26 #include "StEvtHddr.h"
27 #include "StTpcDb/StTpcDb.h"
28 #include "StDetectorDbMaker/StDetectorDbRichScalers.h"
29 #include "StDetectorDbMaker/StDetectorDbBeamInfo.h"
30 #include "StDetectorDbMaker/StDetectorDbTriggerID.h"
31 #include "StDetectorDbMaker/St_trigDetSumsC.h"
32 #include "tables/St_trgOfflineFilter_Table.h"
33 #include "StDAQMaker/StDAQReader.h"
34 #include "StPrompt.hh"
35 #include "StMath.hh"
36 #include <typeinfo>
37 #include <map>
38 #include "StarMagField.h"
39 #include "TUnixTime.h"
40 #if !defined(ST_NO_NAMESPACES)
41 using std::vector;
42 using std::max;
43 using std::pair;
44 using std::map;
45 #endif
46 
47 #if defined(ST_NO_TEMPLATE_DEF_ARGS)
48 #define StVector(T) vector<T, allocator<T> >
49 #else
50 #define StVector(T) vector<T>
51 #endif
52 
53 static const char rcsid[] = "$Id: StEventMaker.cxx,v 2.97 2014/01/08 21:10:22 fisyak Exp $";
54 //______________________________________________________________________________
55 ClassImp(StEventMaker)
56  //______________________________________________________________________________
57 
58  StEventMaker::StEventMaker(const char *name, const char *title) : StMaker(name)
59 {
60  if(title) SetTitle(title);
61  mEventManager = new StRootEventManager();
62  mEventManager->setMaker(this);
63  mCurrentEvent = 0;
64  doLoadTpcHits = kTRUE;
65  doLoadFtpcHits = kTRUE;
66  doLoadSvtHits = kTRUE;
67  doLoadSsdHits = kTRUE;
68  doLoadTptTracks = kFALSE;
69  doLoadEstTracks = kTRUE;
70  doPrintEventInfo = kFALSE;
71  doPrintMemoryInfo = kFALSE;
72  doPrintCpuInfo = kFALSE;
73  mCreateEmptyInstance = kFALSE;
74 }
75 
76 StEventMaker::~StEventMaker()
77 {
78  delete mEventManager;
79 }
80 
81 void
82 StEventMaker::Clear(const char*)
83 {
84  mCurrentEvent=0;
86 }
87 
89 StEventMaker::eventManager() {return mEventManager;};
90 StEvent*
91 StEventMaker::event() { return mCurrentEvent;};
92 
93 void
94 StEventMaker::setEventManager(StEventManager* mgr)
95 {
96  mEventManager = mgr;
97 }
98 Int_t
99 StEventMaker::Init()
100 {
101  return StMaker::Init();
102 }
103 
104 Int_t
106 {
107  //
108  // In this method we actually do not create anything but call
109  // other methods which do that for us:
110  // makeEvent() creates StEvent and all its dependent classes
111  //
112  // Since this Maker should also work without any 'dst' dataset
113  // we create *always* an instance of StEvent, even if it is empty.
114  //
115 
116  //
117  // Init timing and memory snapshots
118  //
119  StTimer timer;
120  if (doPrintCpuInfo) timer.start();
121  if (doPrintMemoryInfo) StMemoryInfo::instance()->snapshot();
122 
123  //
124  // The current event is deleted automatically before every
125  // new event. It is added by using AddData().
126  // We do not need to delete it ourself.
127  //
128  // If no DST dataset is available we cannot setup StEvent
129  // properly. Nevertheless we will create an empty instance.
130  //
131  if (TString(GetName()) == "0Event") mCreateEmptyInstance = kTRUE;
132  else mCreateEmptyInstance = kFALSE;
133  //
134  // Setup the event (StEvent and all subclasses)
135  //
136  Int_t status = makeEvent();
137  if (status != kStOK)
138  gMessMgr->Warning() << "StEventMaker::Make(): error in makeEvent(), no StEvent object created." << endm;
139 
140  mEventManager->closeEvent();
141  //
142  // Print out some timing, memory usage and StEvent
143  // info if requested
144  //
145  if (doPrintEventInfo) printEventInfo();
146  if (doPrintMemoryInfo) {
147  StMemoryInfo::instance()->snapshot();
148  StMemoryInfo::instance()->print();
149  }
150  if (doPrintCpuInfo) {
151  timer.stop();
152  LOG_DEBUG << "CPU time for StEventMaker::Make(): "
153  << timer.elapsedTime() << " sec\n" << endm;
154  }
155 
156  return status;
157 }
158 
159 StEvent*
160 StEventMaker::getStEventInstance()
161 {
162  StEvent* exist = (StEvent*) GetInputDS("StEvent");
163  if (exist) {
164  gMessMgr->Info() << "StEventMaker::getStEventInstance(): existing instance found, no new object created." << endm;
165  return exist;
166  }
167  else {
168  exist = new StEvent;
169  AddData(exist);
170  return exist;
171  }
172 }
173 
174 Int_t
175 StEventMaker::makeEvent()
176 {
177  //
178  // In case there's nothing to fill (no DST dataset) we
179  // create an empty instance only. This is OK in this
180  // case and therefore we do not return a warning or an
181  // error message.
182  //
183  if (! mCreateEmptyInstance && mCurrentEvent) return kStOK;
184  //
185  // Create AND setup/fill StEvent.
186  //
187  long nrows;
188  //
189  // Create instance of StEvent, using whatever we got so far.
190  //
191  mCurrentEvent = getStEventInstance();
192 
193  //
194  // Load trigger & trigger detector data
195  //
196  dst_TrgDet_st* dstTriggerDetectors = mEventManager->returnTable_dst_TrgDet(nrows);
197  dst_L0_Trigger_st* dstL0Trigger = mEventManager->returnTable_dst_L0_Trigger(nrows);
198  dst_L1_Trigger_st* dstL1Trigger = mEventManager->returnTable_dst_L1_Trigger(nrows);
199  StEventInfo *evinfo = new StEventInfo();
200  evinfo->setType("Collision");
201  evinfo->setRunId(GetRunNumber());
202  evinfo->setId(GetEventNumber());
203  evinfo->setTime(TUnixTime::Convert(GetDateTime(),1));
204  mCurrentEvent->setInfo(evinfo);
205 
206  Float_t xlocal[3] = {0,0,0}, bfield[3] = {0,0,0};
207  if (StarMagField::Instance()) StarMagField::Instance()->BField(xlocal,bfield);
208  StEventSummary *evsum = new StEventSummary();
209  evsum->setMagneticField(bfield[2]);
210  mCurrentEvent->setSummary(evsum);
211  //
212  // Get trgStructure structures from StTriggerDataMaker
213  // and store them in StEvent. Note that they are need
214  // pior to creating the old StTriggerDetectorCollection
215  // since the latter uses StTriggerData at construction.
216  //
217  if (!mCurrentEvent->triggerData()) {
218  TObjectSet *os = (TObjectSet*)GetDataSet("StTriggerData");
219  if (os) {
220  StTriggerData* pTrg = (StTriggerData*)os->GetObject();
221  assert(pTrg); // wrong, empty data
222  assert(os->IsOwner()); // wrong, data allready taken
223  os->DoOwner(0); //change ownership
224  mCurrentEvent->setTriggerData(pTrg);
225  StEventInfo *theInfo = mCurrentEvent->info();
226  if (theInfo) {
227  theInfo->setBunchCrossingNumber(pTrg->bunchCounterLow(),0);
228  theInfo->setBunchCrossingNumber(pTrg->bunchCounterHigh(),1);
229  }
230  StEvtHddr* header = dynamic_cast<StEvtHddr*>(GetInputDS("EvtHddr"));
231  if (header) {
232  header->SetBunchCrossingNumber(pTrg->bunchCounterLow(),pTrg->bunchCounterHigh());
233  }
234  }
235  }
236 
237  //
238  // year 2001, 2002: use TrgDet tables
239  // year >= 2003: use info from StTriggerData
240  // Long term: get rid of StTriggerDetectorCollection
241  // and use StTriggerData
242  //
243  if (!mCurrentEvent->triggerDetectorCollection()) {
244  if (mCurrentEvent->triggerData() && mCurrentEvent->triggerData()->year() >= 2003)
245  mCurrentEvent->setTriggerDetectorCollection(new StTriggerDetectorCollection(*(mCurrentEvent->triggerData())));
246  else if (dstTriggerDetectors)
247  mCurrentEvent->setTriggerDetectorCollection(new StTriggerDetectorCollection(*dstTriggerDetectors));
248  }
249 
250  StL0Trigger *l0t = mCurrentEvent->l0Trigger();
251  if (!l0t) mCurrentEvent->setL0Trigger((l0t = new StL0Trigger()));
252  if (mCurrentEvent->triggerData() && mCurrentEvent->triggerData()->year() >= 2003){
253  l0t->set(mCurrentEvent->triggerData());
254  }
255  else {
256  l0t->set(dstL0Trigger );
257  l0t->set(dstTriggerDetectors);
258  }
259 
260  if (dstL0Trigger && dstL1Trigger && !mCurrentEvent->l1Trigger())
261  mCurrentEvent->setL1Trigger(new StL1Trigger(*dstL0Trigger, *dstL1Trigger));
262  //
263  // Trigger ID summary
264  //
265  Int_t idx;
266  StTriggerIdCollection* triggerIdColl = mCurrentEvent->triggerIdCollection();
267  if (!triggerIdColl) {
268  mCurrentEvent->setTriggerIdCollection((triggerIdColl =
269  new StTriggerIdCollection()));
270  }
271  StTriggerId* trigId[3];
272  triggerIdColl->setL1((trigId[0] = new StTriggerId()));
273  triggerIdColl->setL2((trigId[1] = new StTriggerId()));
274  triggerIdColl->setL3((trigId[2] = new StTriggerId()));
275  // copy trigDetSums table to StEvent
276  St_trigDetSums *table = 0;
277  // reuse table from StDetectorDbMaker
278  if ( St_trigDetSumsC::GetInstance()) {
279  table = new St_trigDetSums(*((St_trigDetSums *)St_trigDetSumsC::GetInstance()->Table()));
280  table->Shunt(mCurrentEvent);
281  }
282  if (! table) {
283  TDataSet *set = GetDataSet("inputStream_DAQ");
284  if (set) table = (St_trigDetSums *) set->Find("trigDetSums");
285  if ( table) {
286  gMessMgr->Info("get trigDetSums from inputStream_DAQ");
287  St_trigDetSums *copytable = new St_trigDetSums(*table);
288  copytable->Shunt(mCurrentEvent); // keep table from daq in StEvent
289  table = copytable;
290  } else {
291  table = (St_trigDetSums *) GetDataBase("Calibrations/rich/trigDetSums");
292  if ( table) { gMessMgr->Info("get trigDetSums from Calibrations/rich/trigDetSums");}
293  }
294  if (table) {
295  StMaker::GetChain()->AddData(new St_trigDetSumsC(table));
296  }
297  }
298  St_DataSet *daqReaderSet=GetDataSet("StDAQReader");
299  if (daqReaderSet) {
300  StTrigSummary* trigSummary =
301  ((StDAQReader*) (daqReaderSet->GetObject()))->getTrigSummary();
302  if (!trigSummary) gMessMgr->Warning("StEventMaker: No StTrigSummary found");
303 
304  StDetectorDbTriggerID* dbTriggerId = StDetectorDbTriggerID::instance();
305  if (!dbTriggerId) gMessMgr->Warning("StEventMaker: No StDetectorDbTriggerID found");
306 
307  if (trigSummary && dbTriggerId) {
308 
309  // The nominal is a pointer to one of the above.
310  // 64 bits for Run 11 and beyond
311  if (mCurrentEvent->runId()> 12000000) {
312 
313  uint64_t mask = 0;
314  mask = (unsigned int) trigSummary->L1summary[1];
315  mask <<= 32;
316  mask += (unsigned int) trigSummary->L1summary[0];
317  trigId[0]->setMask(mask);
318 
319  mask = (unsigned int) trigSummary->L2summary[1];
320  mask <<= 32;
321  mask += (unsigned int) trigSummary->L2summary[0];
322  trigId[1]->setMask(mask);
323 
324  mask = (unsigned int) trigSummary->L3summary[1];
325  mask <<= 32;
326  mask += (unsigned int) trigSummary->L3summary[0];
327  trigId[2]->setMask(mask);
328 
329 
330  }
331  else {
332 
333  trigId[0]->setMask(trigSummary->L1summary[0]);
334  trigId[1]->setMask(trigSummary->L2summary[0]);
335  trigId[2]->setMask(trigSummary->L3summary[0]);
336  }
337 
338 
339  // Loop over trigger level
340  for(unsigned int trglevel=0 ; trglevel < 3 ; trglevel++){
341  StTriggerId* whichTrig = trigId[trglevel];
342 
343  // Loop over the triggers within this level
344  for (unsigned int iTrg = 0; iTrg < dbTriggerId->getIDNumRows() ; iTrg++){
345  // Shift the mask by daqTrigId bits to examine that bit
346  if ( whichTrig->mask() & ((uint64_t)1 << (dbTriggerId->getDaqTrgId(iTrg)) ) ) {
347 
348  //Check if StTriggerData found (partial) data corruption
349  //and if so, add 9000 to offline trigger Id
350  UInt_t offlineId = dbTriggerId->getOfflineTrgId(iTrg);
351  if (mCurrentEvent->triggerData()){
352  if (mCurrentEvent->triggerData()->errorFlag()>0) {
353  offlineId += 9000;
354  printf("StEventMaker: StTriggerData found partial corruption, thus adding 9000 to offline trigger id =%d\n",offlineId);
355  }
356  }
357 
358  whichTrig->addTrigger(
359  //dbTriggerId->getOfflineTrgId(iTrg),
360  offlineId,
361  dbTriggerId->getTrgVersion(iTrg),
362  dbTriggerId->getTrgNameVersion(iTrg),
363  dbTriggerId->getThreashVersion(iTrg),
364  dbTriggerId->getPsVersion(iTrg)
365  );
366  }
367  }
368 
369  // Add in additional trigger ids to all levels; hack to fix prescale problem in runs 3-6
370  for (unsigned int iTrg = 0; iTrg < dbTriggerId->getAdditionalTriggerIDNumRows() ; iTrg++){
371  // Shift the mask by daqTrigId bits to examine that bit
372  // Tweak for warnings; saved the run/event number as an unsigned int, but for some reason StEvent is int
373  int checkRun = dbTriggerId->getAdditionalTriggerIDRunNumber(iTrg);
374  int checkEvent = dbTriggerId->getAdditionalTriggerIDEventNumber(iTrg);
375 
376  if (mCurrentEvent->runId() == checkRun &&
377  mCurrentEvent->id() == checkEvent )
378  {
379  whichTrig->addTrigger(
380  dbTriggerId->getAdditionalTriggerIDOfflineTrgId(iTrg),
381  dbTriggerId->getAdditionalTriggerIDTrgVersion(iTrg),
382  dbTriggerId->getAdditionalTriggerIDTrgNameVersion(iTrg),
383  dbTriggerId->getAdditionalTriggerIDThreashVersion(iTrg),
384  dbTriggerId->getAdditionalTriggerIDPsVersion(iTrg)
385  );
386  }
387  }
388  }
389 
390  // This just puts the pointer, not a deep copy
391  if ( (idx=dbTriggerId->getDefaultTriggerLevel() ) != kDbTriggerBadID ){
392  triggerIdColl->setNominal(trigId[idx-1]);
393  }
394  // Now hack up the offline trigger ids for year 2006
395 
396 
397  if (mCurrentEvent->triggerData() && mCurrentEvent->runId()>7000000 && mCurrentEvent->runId()<8000000) {
398  gMessMgr->Info("StEventMaker::Run 6, expanding L3 trigger id");
399 
400  // Hack for mapping of StDetectorDb to StL2TriggerResultType
401  map<string,StL2TriggerResultType> mapDbToStL2TriggerResultType;
402 
403  mapDbToStL2TriggerResultType["l2Trg2006BEMCGammaPi"] = l2Trg2006BEMCGammaPi;
404  mapDbToStL2TriggerResultType["l2Trg2006BEMCGammaPiRandom"] = l2Trg2006BEMCGammaPiRandom;
405  mapDbToStL2TriggerResultType["l2Trg2006EEMCGammaPi"] = l2Trg2006EEMCGammaPi;
406  mapDbToStL2TriggerResultType["l2Trg2006EEMCGammaPiRandom"] = l2Trg2006EEMCGammaPiRandom;
407  mapDbToStL2TriggerResultType["l2Trg2006MonoJet"] = l2Trg2006MonoJet;
408  mapDbToStL2TriggerResultType["l2Trg2006DiJet"] = l2Trg2006DiJet;
409  mapDbToStL2TriggerResultType["l2Trg2006RandomJet"] = l2Trg2006RandomJet;
410 
411 
412  // Do a deep copy of the l3 into l3Expanded
413  StTriggerId *whichTrig = new StTriggerId(*triggerIdColl->l3());
414 
415  triggerIdColl->setL3Expanded(whichTrig);
416  // Reset the nominal pointer
417  triggerIdColl->setNominal(whichTrig);
418  // Expand up the l3Expanded.
419  for (unsigned int irow=0; irow<dbTriggerId->getTrigL3ExpandedNumRows(); ++irow) {
420  unsigned int oldtid = dbTriggerId->getTrigL3ExpandedL3TrgId(irow);
421  unsigned int newtid = dbTriggerId->getTrigL3ExpandedL3ExpandedTrgId(irow);
422 
423 
424  string testString = string(dbTriggerId->getTrigL3ExpandedL2TriggerResultType(irow));
425 
426 
427  map<string,StL2TriggerResultType>::const_iterator p =
428  mapDbToStL2TriggerResultType.find(
429  testString);
430 
431  if (p != mapDbToStL2TriggerResultType.end()) {
432  StL2TriggerResultType l2Test = (*p).second;
433  if (whichTrig->isTrigger(oldtid) &&
434  mCurrentEvent->triggerData()->isL2Triggered(l2Test)) {
435 
436  whichTrig->addTrigger(newtid,
437  whichTrig->version(oldtid),
438  whichTrig->nameVersion(oldtid),
439  whichTrig->thresholdVersion(oldtid),
440  whichTrig->prescaleVersion(oldtid)
441  );
442  }
443  }
444  }
445  }
446 // We need to make a copy of the nominal to avoid problems in delete??
447  if (triggerIdColl->nominal()) triggerIdColl->setNominal(new StTriggerId(*(triggerIdColl->nominal())));
448  if (StTpcDb::instance()) {
449  Int_t TriggerId = -1; // Unknown
450  if (triggerIdColl) {
451  static Int_t goodIds[5] = {9200,9201,310811,310812,310813};
452  const StTriggerId *nominal = triggerIdColl->nominal();
453  TriggerId = 0;
454  if (nominal) {
455  for (Int_t i = 0; i < 5; i++) {
456  if (nominal->isTrigger(goodIds[i])) {TriggerId = goodIds[i]; break;}
457  }
458  }
459  }
460  StTpcDb::instance()->SetTriggerId(TriggerId);
461  }
462 
463  // Allow trigger filtering to skip events
464  Int_t FiltTrg = IAttr("FiltTrg");
465  if (FiltTrg != 0) {
466  bool unmatched = true;
467  St_trgOfflineFilter* flaggedTrgs =
468  (St_trgOfflineFilter *) GetDataBase("Calibrations/trg/trgOfflineFilter");
469  if (!flaggedTrgs) {
470  LOG_ERROR << "Could not find Calibrations/trg/trgOfflineFilter in database" << endm;
471  return kStErr;
472  }
473  const StTriggerId* tr = triggerIdColl->nominal();
474  if (tr) {
475  vector<unsigned int> idVec = tr->triggerIds();
476  long nFlaggedTrgs = flaggedTrgs->GetNRows();
477  for (unsigned int iTrg = 0;
478  unmatched && (iTrg < idVec.size()) ; iTrg++) {
479  trgOfflineFilter_st* flaggedTrg = flaggedTrgs->GetTable();
480  for (long iFlaggedTrg = 0;
481  unmatched && iFlaggedTrg < nFlaggedTrgs; iFlaggedTrg++, flaggedTrg++) {
482  unmatched = (idVec[iTrg] != flaggedTrg->trigid);
483  }
484  }
485  }
486  if ((unmatched && FiltTrg>0) || // Include if trigger is matched
487  (!unmatched && FiltTrg<0)) { // Exclude if trigger is matched
488  LOG_INFO << "Event failed trigger filter...skipping" << endm;
489  return kStSkip;
490  }
491  }
492  }
493  }
494 
495 
496  else {
497  gMessMgr->Warning("StEventMaker: No StDAQReader found");
498  }
499 
500 
501 
502  //
503  // Complete information in StEventInfo
504  //
505  StEventInfo *theInfo = mCurrentEvent->info();
506  if (theInfo && dstTriggerDetectors) {
507  theInfo->setBunchCrossingNumber(dstTriggerDetectors->bunchXing_lo,0);
508  theInfo->setBunchCrossingNumber(dstTriggerDetectors->bunchXing_hi,1);
509  }
510  //
511  // Add data from StEvtHddr we cannot get elsewhere
512  //
513  StEvtHddr* header = dynamic_cast<StEvtHddr*>(GetInputDS("EvtHddr"));
514  if (header) {
515  mCurrentEvent->setTriggerMask(header->GetTriggerMask());
516  if (mCurrentEvent->info())
517  mCurrentEvent->info()->setEventSize(header->GetEventSize());
518  }
519 
520  //
521  // Fill StRunInfo
522  //
523  StRunInfo* mCurrentRunInfo = new StRunInfo;
524  StDetectorDbBeamInfo *dbBeamInfo = StDetectorDbBeamInfo::instance();
525  StDetectorDbRichScalers* richScalers = StDetectorDbRichScalers::instance();
526 
527  mCurrentRunInfo->setRunId(mCurrentEvent->runId());
528  mCurrentRunInfo->setProductionTime(time(0));
529  mCurrentRunInfo->setProductionVersion(getenv("STAR_VERSION"));
530  if (mCurrentEvent->summary())
531  mCurrentRunInfo->setMagneticField(mCurrentEvent->summary()->magneticField());
532  if (gStTpcDb) {
533  mCurrentRunInfo->setTpcDriftVelocity(east, gStTpcDb->DriftVelocity());
534  mCurrentRunInfo->setTpcDriftVelocity(west, gStTpcDb->DriftVelocity());
535  }
536  if (dbBeamInfo) {
537  mCurrentRunInfo->setCenterOfMassEnergy(dbBeamInfo->getBlueEnergy() + dbBeamInfo->getYellowEnergy());
538  mCurrentRunInfo->setBeamMassNumber(blue, dbBeamInfo->getBlueMassNumber());
539  mCurrentRunInfo->setBeamMassNumber(yellow, dbBeamInfo->getYellowMassNumber());
540  mCurrentRunInfo->setBeamEnergy(blue, dbBeamInfo->getBlueEnergy());
541  mCurrentRunInfo->setBeamEnergy(yellow, dbBeamInfo->getYellowEnergy());
542  mCurrentRunInfo->setInitialBeamIntensity(blue, dbBeamInfo->getBlueIntensity());
543  mCurrentRunInfo->setInitialBeamIntensity(yellow, dbBeamInfo->getYellowIntensity());
544  mCurrentRunInfo->setBeamLifeTime(blue, dbBeamInfo->getBlueLifeTime());
545  mCurrentRunInfo->setBeamLifeTime(yellow, dbBeamInfo->getYellowLifeTime());
546  mCurrentRunInfo->setBeamFillNumber(blue, dbBeamInfo->getBlueFillNumber());
547  mCurrentRunInfo->setBeamFillNumber(yellow, dbBeamInfo->getYellowFillNumber());
548  }
549  if (richScalers) {
550  mCurrentRunInfo->setZdcWestRate(richScalers->getZDCWest());
551  mCurrentRunInfo->setZdcEastRate(richScalers->getZDCEast());
552  mCurrentRunInfo->setZdcCoincidenceRate(richScalers->getZDCX());
553  mCurrentRunInfo->setBackgroundRate(richScalers->getMult());
554  mCurrentRunInfo->setL0RateToRich(richScalers->getL0());
555  mCurrentRunInfo->setBbcCoincidenceRate(richScalers->getBBCX());
556  mCurrentRunInfo->setBbcEastRate(richScalers->getBBCEast());
557  mCurrentRunInfo->setBbcWestRate(richScalers->getBBCWest());
558  mCurrentRunInfo->setBbcBlueBackgroundRate(richScalers->getBBCBlueBkg());
559  mCurrentRunInfo->setBbcYellowBackgroundRate(richScalers->getBBCYellowBkg());
560  }
561 
562  if (mCurrentRunInfo)
563  mCurrentEvent->setRunInfo(mCurrentRunInfo);
564 
565  //
566  // Detector States
567  //
568  if (richScalers)
569  mCurrentEvent->addDetectorState(new StDetectorState(kRichId, richScalers->getRichHVStatus()));
570 
571  return kStOK;
572 }
573 
574 void
575 StEventMaker::printEventInfo()
576 {
577  LOG_INFO << "*********************************************************" << endm;
578  LOG_INFO << "* StEvent Information *" << endm;
579  LOG_INFO << "*********************************************************" << endm;
580 
581  LOG_INFO << "---------------------------------------------------------" << endm;
582  LOG_INFO << "StEvent at " << (void*) mCurrentEvent << endm;
583  LOG_INFO << "---------------------------------------------------------" << endm;
584  if (mCurrentEvent)
585  mCurrentEvent->Dump();
586  else
587  return;
588 
589  LOG_INFO << "---------------------------------------------------------" << endm;
590  LOG_INFO << "StRunInfo at " << (void*) mCurrentEvent->runInfo() << endm;
591  LOG_INFO << "---------------------------------------------------------" << endm;
592  if (mCurrentEvent->runInfo())
593  mCurrentEvent->runInfo()->Dump();
594 
595  LOG_INFO << "---------------------------------------------------------" << endm;
596  LOG_INFO << "StEventInfo at " << (void*) mCurrentEvent->info() << endm;
597  LOG_INFO << "---------------------------------------------------------" << endm;
598  if (mCurrentEvent->info())
599  mCurrentEvent->info()->Dump();
600 
601  LOG_INFO << "---------------------------------------------------------" << endm;
602  LOG_INFO << "StEventSummary at " << (void*) (mCurrentEvent->summary()) << endm;
603  LOG_INFO << "---------------------------------------------------------" << endm;
604  if (mCurrentEvent->summary()) mCurrentEvent->summary()->Dump();
605  if (mCurrentEvent->summary()) {
606  unsigned int k;
607  StEventSummary *evtsum = mCurrentEvent->summary();
608  LOG_INFO << "--> StEventSummary quasi-histograms" << endm;
609  LOG_INFO << "--> StEventSummary quasi-histogram -> # of tracks vs. eta" << endm;
610  for (k=0; k<evtsum->numberOfBins(); k++) {
611  LOG_INFO << k << "\t[" << evtsum->lowerEdgeEtaBin(k)
612  << " - " << evtsum->upperEdgeEtaBin(k)
613  << "] : \t" << evtsum->tracksInEtaBin(k) << endm;
614  }
615  LOG_INFO << "--> StEventSummary quasi-histogram -> # of tracks vs. phi" << endm;
616  for (k=0; k<evtsum->numberOfBins(); k++) {
617  LOG_INFO << k << "\t[" << evtsum->lowerEdgePhiBin(k)
618  << " - " << evtsum->upperEdgePhiBin(k)
619  << "] : \t" << evtsum->tracksInPhiBin(k) << endm;
620  }
621  LOG_INFO << "--> StEventSummary quasi-histogram -> # of tracks vs. pt" << endm;
622  for (k=0; k<evtsum->numberOfBins(); k++) {
623  LOG_INFO << k << "\t[" << evtsum->lowerEdgePtBin(k)
624  << " - " << evtsum->upperEdgePtBin(k)
625  << "] : \t" << evtsum->tracksInPtBin(k) << endm;
626  }
627  LOG_INFO << "--> StEventSummary quasi-histogram -> energy vs. eta" << endm;
628  for (k=0; k<evtsum->numberOfBins(); k++) {
629  LOG_INFO << k << "\t[" << evtsum->lowerEdgeEtaBin(k)
630  << " - " << evtsum->upperEdgeEtaBin(k)
631  << "] : \t" << evtsum->energyInEtaBin(k) << endm;
632  }
633  LOG_INFO << "--> StEventSummary quasi-histogram -> energy vs. phi" << endm;
634  for (k=0; k<evtsum->numberOfBins(); k++) {
635  LOG_INFO << k << "\t[" << evtsum->lowerEdgePhiBin(k)
636  << " - " << evtsum->upperEdgePhiBin(k)
637  << "] : \t" << evtsum->energyInPhiBin(k) << endm;
638  }
639  }
640  LOG_INFO << "---------------------------------------------------------" << endm;
641  LOG_INFO << "StL0Trigger at "
642  << (void*) (mCurrentEvent->l0Trigger()) << endm;
643  LOG_INFO << "---------------------------------------------------------" << endm;
644  if (mCurrentEvent->l0Trigger()) mCurrentEvent->l0Trigger()->Dump();
645 
646  LOG_INFO << "---------------------------------------------------------" << endm;
647  LOG_INFO << "StTriggerDetectorCollection at "
648  << (void*) (mCurrentEvent->triggerDetectorCollection()) << endm;
649  LOG_INFO << "---------------------------------------------------------" << endm;
650  if (mCurrentEvent->triggerDetectorCollection())
651  mCurrentEvent->triggerDetectorCollection()->Dump();
652 
653  if (mCurrentEvent->triggerDetectorCollection()) {
654  LOG_INFO << "---------------------------------------------------------" << endm;
655  LOG_INFO << "StCtbTriggerDetector" << endm;
656  LOG_INFO << "---------------------------------------------------------" << endm;
657  mCurrentEvent->triggerDetectorCollection()->ctb().Dump();
658 
659  LOG_INFO << "---------------------------------------------------------" << endm;
660  LOG_INFO << "StMwcTriggerDetector" << endm;
661  LOG_INFO << "---------------------------------------------------------" << endm;
662  mCurrentEvent->triggerDetectorCollection()->mwc().Dump();
663 
664  LOG_INFO << "---------------------------------------------------------" << endm;
665  LOG_INFO << "StVpdTriggerDetector" << endm;
666  LOG_INFO << "---------------------------------------------------------" << endm;
667  mCurrentEvent->triggerDetectorCollection()->vpd().Dump();
668 
669  LOG_INFO << "---------------------------------------------------------" << endm;
670  LOG_INFO << "StZdcTriggerDetector" << endm;
671  LOG_INFO << "---------------------------------------------------------" << endm;
672  mCurrentEvent->triggerDetectorCollection()->zdc().Dump();
673  }
674 
675  LOG_INFO << "---------------------------------------------------------" << endm;
676  LOG_INFO << "StSPtrVecTrackDetectorInfo" << endm;
677  LOG_INFO << "Dumping first element in collection only (if available). " << endm;
678  LOG_INFO << "---------------------------------------------------------" << endm;
679  LOG_INFO << "collection size = "
680  << mCurrentEvent->trackDetectorInfo().size() << endm;
681 
682  if (mCurrentEvent->trackDetectorInfo().size()) {
683  LOG_INFO << "---------------------------------------------------------" << endm;
684  LOG_INFO << "StTrackDetectorInfo at "
685  << (void*) mCurrentEvent->trackDetectorInfo()[0] << endm;
686  LOG_INFO << "---------------------------------------------------------" << endm;
687  mCurrentEvent->trackDetectorInfo()[0]->Dump();
688  }
689 
690  LOG_INFO << "---------------------------------------------------------" << endm;
691  LOG_INFO << "StSPtrVecTrackNode" << endm;
692  LOG_INFO << "Dumping first element in collection only (if available). " << endm;
693  LOG_INFO << "All tracks in the first node are printed separately " << endm;
694  LOG_INFO << "after the node info. " << endm;
695  LOG_INFO << "---------------------------------------------------------" << endm;
696  LOG_INFO << "collection size = "
697  << mCurrentEvent->trackNodes().size() << endm;
698 
699  unsigned int i;
700  if (mCurrentEvent->trackNodes().size()) {
701  LOG_INFO << "# tracks in first element = "
702  << mCurrentEvent->trackNodes()[0]->entries() << endm;
703  LOG_INFO << "---------------------------------------------------------" << endm;
704  LOG_INFO << "StTrackNode at "
705  << (void*) mCurrentEvent->trackNodes()[0] << endm;
706  LOG_INFO << "---------------------------------------------------------" << endm;
707  mCurrentEvent->trackNodes()[0]->Dump();
708  for (i=0; i<mCurrentEvent->trackNodes()[0]->entries(); i++)
709  printTrackInfo(mCurrentEvent->trackNodes()[0]->track(i));
710  }
711 
712  LOG_INFO << "---------------------------------------------------------" << endm;
713  LOG_INFO << "StSPtrVecPrimaryVertex" << endm;
714  LOG_INFO << "Dumping first element in collection only (if available). " << endm;
715  LOG_INFO << "The first daughter track (primary track) in the first " << endm;
716  LOG_INFO << "vertex is printed separately after the vertex info. " << endm;
717  LOG_INFO << "---------------------------------------------------------" << endm;
718  LOG_INFO << "collection size = "
719  << mCurrentEvent->numberOfPrimaryVertices() << endm;
720 
721  if (mCurrentEvent->numberOfPrimaryVertices()) {
722  LOG_INFO << "# primary tracks in first element = "
723  << mCurrentEvent->primaryVertex()->numberOfDaughters() << endm;
724  LOG_INFO << "---------------------------------------------------------" << endm;
725  LOG_INFO << "StPrimaryVertex at "
726  << (void*) mCurrentEvent->primaryVertex() << endm;
727  LOG_INFO << "---------------------------------------------------------" << endm;
728  mCurrentEvent->primaryVertex()->Dump();
729  if (mCurrentEvent->primaryVertex()->numberOfDaughters())
730  printTrackInfo(mCurrentEvent->primaryVertex()->daughter(0));
731  }
732 
733  LOG_INFO << "---------------------------------------------------------" << endm;
734  LOG_INFO << "StSPtrVecCalibrationVertex" << endm;
735  LOG_INFO << "Dumping first element in collection only (if available). " << endm;
736  LOG_INFO << "---------------------------------------------------------" << endm;
737  LOG_INFO << "collection size = "
738  << mCurrentEvent->numberOfCalibrationVertices() << endm;
739 
740  if (mCurrentEvent->numberOfCalibrationVertices())
741  mCurrentEvent->calibrationVertex(0)->Dump();
742 
743  LOG_INFO << "---------------------------------------------------------" << endm;
744  LOG_INFO << "StSPtrVecV0Vertex" << endm;
745  LOG_INFO << "Dumping first element in collection only (if available). " << endm;
746  LOG_INFO << "---------------------------------------------------------" << endm;
747  LOG_INFO << "collection size = "
748  << mCurrentEvent->v0Vertices().size() << endm;
749 
750  if (mCurrentEvent->v0Vertices().size()) {
751  LOG_INFO << "---------------------------------------------------------" << endm;
752  LOG_INFO << "StV0Vertex at "
753  << (void*) mCurrentEvent->v0Vertices()[0] << endm;
754  LOG_INFO << "---------------------------------------------------------" << endm;
755  mCurrentEvent->v0Vertices()[0]->Dump();
756  }
757 
758  LOG_INFO << "---------------------------------------------------------" << endm;
759  LOG_INFO << "StSPtrVecXiVertex" << endm;
760  LOG_INFO << "Dumping first element in collection only (if available). " << endm;
761  LOG_INFO << "---------------------------------------------------------" << endm;
762  LOG_INFO << "collection size = "
763  << mCurrentEvent->xiVertices().size() << endm;
764 
765  if (mCurrentEvent->xiVertices().size()) {
766  LOG_INFO << "---------------------------------------------------------" << endm;
767  LOG_INFO << "StXiVertex at "
768  << (void*) mCurrentEvent->xiVertices()[0] << endm;
769  LOG_INFO << "---------------------------------------------------------" << endm;
770  mCurrentEvent->xiVertices()[0]->Dump();
771  }
772 
773  LOG_INFO << "---------------------------------------------------------" << endm;
774  LOG_INFO << "StSPtrVecKinkVertex" << endm;
775  LOG_INFO << "Dumping first element in collection only (if available). " << endm;
776  LOG_INFO << "---------------------------------------------------------" << endm;
777  LOG_INFO << "collection size = "
778  << mCurrentEvent->kinkVertices().size() << endm;
779 
780  if (mCurrentEvent->kinkVertices().size()) {
781  LOG_INFO << "---------------------------------------------------------" << endm;
782  LOG_INFO << "StKinkVertex at "
783  << (void*) mCurrentEvent->kinkVertices()[0] << endm;
784  LOG_INFO << "---------------------------------------------------------" << endm;
785  mCurrentEvent->kinkVertices()[0]->Dump();
786  }
787 
788  unsigned int j=0, k=0, nhits=0;
789  Bool_t gotOneHit;
790  StTpcHitCollection *tpcColl = mCurrentEvent->tpcHitCollection();
791  LOG_INFO << "---------------------------------------------------------" << endm;
792  LOG_INFO << "StTpcHitCollection at " << (void*) tpcColl << endm;
793  LOG_INFO << "Dumping collection size and one hit only." << endm;
794  LOG_INFO << "---------------------------------------------------------" << endm;
795  if (tpcColl) {
796  nhits = tpcColl->numberOfHits();
797  LOG_INFO << "# of hits in collection = " << nhits << endm;
798  gotOneHit = kFALSE;
799  for (k=0; !gotOneHit && k<tpcColl->numberOfSectors(); k++)
800  for (j=0; !gotOneHit && j<tpcColl->sector(k)->numberOfPadrows(); j++)
801  if (tpcColl->sector(k)->padrow(j)->hits().size()) {
802  tpcColl->sector(k)->padrow(j)->hits()[0]->Dump();
803  gotOneHit = kTRUE;
804  }
805  }
806 
807  StFtpcHitCollection *ftpcColl = mCurrentEvent->ftpcHitCollection();
808  LOG_INFO << "---------------------------------------------------------" << endm;
809  LOG_INFO << "StFtpcHitCollection at " << (void*) ftpcColl << endm;
810  LOG_INFO << "Dumping collection size and one hit only." << endm;
811  LOG_INFO << "---------------------------------------------------------" << endm;
812  if (ftpcColl) {
813  nhits = ftpcColl->numberOfHits();
814  LOG_INFO << "# of hits in collection = " << nhits << endm;
815  gotOneHit = kFALSE;
816  for (k=0; !gotOneHit && k<ftpcColl->numberOfPlanes(); k++)
817  for (j=0; !gotOneHit && j<ftpcColl->plane(k)->numberOfSectors(); j++)
818  if (ftpcColl->plane(k)->sector(j)->hits().size()) {
819  ftpcColl->plane(k)->sector(j)->hits()[0]->Dump();
820  gotOneHit = kTRUE;
821  }
822  }
823 
824  StSvtHitCollection *svtColl = mCurrentEvent->svtHitCollection();
825  LOG_INFO << "---------------------------------------------------------" << endm;
826  LOG_INFO << "StSvtHitCollection at " << (void*) svtColl << endm;
827  LOG_INFO << "Dumping collection size and one hit only." << endm;
828  LOG_INFO << "---------------------------------------------------------" << endm;
829  if (svtColl) {
830  nhits = svtColl->numberOfHits();
831  LOG_INFO << "# of hits in collection = " << nhits << endm;
832  gotOneHit = kFALSE;
833  for (k=0; !gotOneHit && k<svtColl->numberOfBarrels(); k++)
834  for (j=0; !gotOneHit && j<svtColl->barrel(k)->numberOfLadders(); j++)
835  for (i=0; !gotOneHit && i<svtColl->barrel(k)->ladder(j)->numberOfWafers(); i++)
836  if (svtColl->barrel(k)->ladder(j)->wafer(i)->hits().size()) {
837  svtColl->barrel(k)->ladder(j)->wafer(i)->hits()[0]->Dump();
838  gotOneHit = kTRUE;
839  }
840  }
841 
842  StSsdHitCollection *ssdColl = mCurrentEvent->ssdHitCollection();
843  LOG_INFO << "---------------------------------------------------------" << endm;
844  LOG_INFO << "StSsdHitCollection at " << (void*) ssdColl << endm;
845  LOG_INFO << "Dumping collection size and one hit only." << endm;
846  LOG_INFO << "---------------------------------------------------------" << endm;
847  if (ssdColl) {
848  nhits = ssdColl->numberOfHits();
849  LOG_INFO << "# of hits in collection = " << nhits << endm;
850  gotOneHit = kFALSE;
851  for (k=0; !gotOneHit && k<ssdColl->numberOfLadders(); k++)
852  for (i=0; !gotOneHit && i<ssdColl->ladder(j)->numberOfWafers(); i++)
853  if (ssdColl->ladder(j)->wafer(i)->hits().size()) {
854  ssdColl->ladder(j)->wafer(i)->hits()[0]->Dump();
855  gotOneHit = kTRUE;
856  }
857  }
858 
859  LOG_INFO << endm;
860 
861  //
862  // Info from some tables for comparisons.
863  // Only tables with varying # of rows are listed.
864  //
865  LOG_INFO << "*********************************************************" << endm;
866  LOG_INFO << "* Table Information *" << endm;
867  LOG_INFO << "*********************************************************" << endm;
868  LOG_INFO << endm;
869 }
870 
871 void
872 StEventMaker::printTrackInfo(StTrack* track)
873 {
874  LOG_INFO << "---------------------------------------------------------" << endm;
875  LOG_INFO << "StTrack (" << (track ? track->GetName() : "n/a")
876  << ") at " << (void*) track << endm;
877  LOG_INFO << "---------------------------------------------------------" << endm;
878  if (track) {
879  track->Dump();
880  LOG_INFO << "covariantMatrix():" << track->fitTraits().covariantMatrix() << endm;
881 
882  LOG_INFO << "---> StTrack -> StGeometry ("<< track->geometry()->GetName()
883  << ") at " << (void*) (track->geometry()) << endm;
884  if (track->geometry()) track->geometry()->Dump();
885 
886  LOG_INFO << "---> StTrack -> StGeometry (outer) ("<< track->outerGeometry()->GetName()
887  << ") at " << (void*) (track->outerGeometry()) << endm;
888  if (track->outerGeometry()) track->outerGeometry()->Dump();
889 
890  LOG_INFO << "---> StTrack -> StDetectorInfo at "
891  << (void*) (track->detectorInfo()) << endm;
892  if (track->detectorInfo()) track->detectorInfo()->Dump();
893 
894  LOG_INFO << "---> StTrack -> StTrackNode at "
895  << (void*) (track->node()) << endm;
896  if (track->node()) track->node()->Dump();
897 
898  LOG_INFO << "---> StTrack -> StPidTraits ("
899  << (track->pidTraits().size() ? 1 : 0 ) << " of "
900  << track->pidTraits().size() << " entries shown)" << endm;
901  if (track->pidTraits().size()) track->pidTraits()[0]->Dump();
902  }
903 }
904 
905 /**************************************************************************
906  * $Id: StEventMaker.cxx,v 2.97 2014/01/08 21:10:22 fisyak Exp $
907  * $Log: StEventMaker.cxx,v $
908  * Revision 2.97 2014/01/08 21:10:22 fisyak
909  * Move St_trigDetSumsC under top maker for consistency with StDetectorDbMaker
910  *
911  * Revision 2.96 2013/12/20 18:41:41 genevb
912  * Add event filtering by trigger (offline id)
913  *
914  * Revision 2.95 2013/12/17 15:48:19 fisyak
915  * Copy trigDetSums table to StEvent
916  *
917  * Revision 2.94 2013/04/11 18:57:36 jeromel
918  * cast to unsigned as mask is 2x32 in a unint64
919  *
920  * Revision 2.93 2012/05/07 14:44:50 fisyak
921  * Give StTpcDb hit about TriggerId
922  *
923  * Revision 2.92 2011/02/02 20:21:06 ullrich
924  * Changes die to modified StTriggerId (32 -> 64 bit) (Jamie)
925  *
926  * Revision 2.91 2009/11/23 16:37:08 fisyak
927  * Clean up, fix problem with bunch crossing information in StEventInfo and StHddr
928  *
929  * Revision 2.89 2009/11/19 16:54:09 fisyak
930  * Clean up
931  *
932  * Revision 2.88 2009/11/10 21:59:30 fisyak
933  * Fix
934  *
935  * Revision 2.87 2009/11/10 20:45:08 fisyak
936  * pams Cleanup
937  *
938  * Revision 2.86 2009/11/10 03:55:49 perev
939  * Remove redundant printing
940  *
941  * Revision 2.85 2009/08/24 23:06:11 ullrich
942  * Added checks for corruption in StTriggerData.
943  *
944  * Revision 2.84 2008/01/29 18:45:01 perev
945  * WarnOff
946  *
947  * Revision 2.83 2007/08/24 17:26:29 fine
948  * replace cout with LOG_INFO
949  *
950  * Revision 2.82 2007/08/24 15:07:43 perev
951  * No print mem info by default
952  *
953  * Revision 2.81 2007/05/11 23:17:11 jeromel
954  * Addition by J.Dunlop of random trigger (from db)
955  *
956  * Revision 2.80 2007/04/28 20:36:16 perev
957  * Redundant StChain.h removed
958  *
959  * Revision 2.79 2006/09/14 00:08:04 ullrich
960  * StTriggerDetectorCollection constructor changed and L2 \ninterface in StTriggerData (no run number needed.
961  *
962  * Revision 2.78 2006/08/21 20:58:20 ullrich
963  * Pass run number to constructor of StTriggerDetectorCollection (Akio).
964  *
965  * Revision 2.77 2006/08/10 03:32:47 perev
966  * Assert==>assert
967  *
968  * Revision 2.76 2006/05/04 19:15:40 ullrich
969  * Added L3 expanded (Jamie).
970  *
971  * Revision 2.75 2005/12/07 19:38:19 perev
972  * simplified logic if StEvent already exists
973  *
974  * Revision 2.74 2005/06/15 01:00:53 ullrich
975  * Use abs() for SVT hit track ID
976  *
977  * Revision 2.73 2004/10/20 21:18:41 ullrich
978  * Removed checks that prevented storage of calib. vertices.
979  *
980  * Revision 2.72 2004/08/28 18:52:02 fisyak
981  * Replace StEvent Hit containers if there are entries in the corrensponding tables
982  *
983  * Revision 2.71 2004/08/13 18:45:44 ullrich
984  * Set vertex-used-in-fit flag for primary tracks.
985  *
986  * Revision 2.70 2004/08/03 17:26:05 ullrich
987  * Update of trigger part by Akio.
988  *
989  * Revision 2.69 2004/07/07 20:58:51 ullrich
990  * Corrected way the SVT drift velocity scaler is obtained.
991  *
992  * Revision 2.68 2004/07/06 23:06:05 ullrich
993  * Fill SVT drift velocity scaler into StRunInfo.
994  *
995  * Revision 2.67 2004/04/12 16:48:21 ullrich
996  * Fixed bug in creating StTriggerDetectorCollection. StTriggerData
997  * needs to be instantiated and added before StTriggerDetectorCollection
998  * gets constructed.
999  *
1000  * Revision 2.66 2004/02/14 19:25:27 perev
1001  * More strong check for secondaries objects
1002  *
1003  * Revision 2.65 2004/02/11 02:20:27 ullrich
1004  * Load StTriggerDetectorCollection using StTriggerData for runs
1005  * in 2003 and later. For 2001 and 2002 stick to TrgDet table.
1006  *
1007  * Revision 2.64 2004/01/22 23:35:55 ullrich
1008  * Fill new member of StRunInfo (RICH scaler).
1009  *
1010  * Revision 2.63 2003/12/29 00:00:34 perev
1011  * More debug prints
1012  *
1013  * Revision 2.62 2003/12/04 03:54:13 perev
1014  * Set empty, instead of crazy outer geometry
1015  *
1016  * Revision 2.61 2003/12/01 18:22:31 perev
1017  * Fix bug in bad track filter. Thanks to Helen
1018  *
1019  * Revision 2.60 2003/11/25 04:13:25 perev
1020  * FPE protection
1021  *
1022  * Revision 2.59 2003/10/13 04:38:35 perev
1023  * Bug with different collection lenth fixed
1024  *
1025  * Revision 2.58 2003/07/16 19:58:32 perev
1026  * Cleanup of StTriggerData2003 at all
1027  *
1028  * Revision 2.57 2003/04/16 17:52:28 ullrich
1029  * Cleaned up section where trigger structures are added,
1030  * that us removed debud print-outs.
1031  *
1032  * Revision 2.56 2003/04/15 22:37:54 jeromel
1033  * StTriggerDataMaker added
1034  *
1035  * Revision 2.55 2003/04/13 23:07:01 jeromel
1036  * Use of access method on null already fixed. Additional dbTriggerId fix closes bug # 85
1037  *
1038  * Revision 2.54 2003/04/08 18:44:03 ullrich
1039  * Added protection for cases where StDetectorDbTriggerID and
1040  * StTrigSummary couldn't be obtained (see Trigger Id summary).
1041  *
1042  * Revision 2.53 2003/02/19 16:35:04 jeromel
1043  * $LINK mechanism removed
1044  *
1045  * Revision 2.52 2003/02/18 23:25:55 jeromel
1046  * Loop over trigger blabla corrected
1047  *
1048  * Revision 2.51 2003/02/15 20:19:31 genevb
1049  * Added Trigger ID Summary
1050  *
1051  * Revision 2.50 2002/11/26 02:19:48 perev
1052  * StEventMaker ITTF modif
1053  *
1054  * Revision 2.49 2002/05/02 03:07:18 ullrich
1055  * Changed mechanism to reject EST tracks without SVT hits.
1056  *
1057  * Revision 2.48 2002/05/01 01:08:31 ullrich
1058  * Add SVT dE/dx only to EST tracks.
1059  *
1060  * Revision 2.47 2002/04/18 23:29:34 jeromel
1061  * Implementation of the SVT 2 tables scheme ...
1062  *
1063  * Revision 2.46 2002/02/25 19:34:14 ullrich
1064  * Fill parts of StRunInfo from StDetectorDbBeamInfo.
1065  *
1066  * Revision 2.45 2002/02/15 23:06:58 ullrich
1067  * Fill detector state for RICH.
1068  *
1069  * Revision 2.44 2002/01/31 23:50:28 ullrich
1070  * More filling of StRunInfo (by J. Gans).
1071  *
1072  * Revision 2.43 2002/01/11 16:44:12 ullrich
1073  * Fill bunch crossing numbers in StEventInfo.
1074  *
1075  * Revision 2.42 2001/12/21 22:39:32 ullrich
1076  * Disabled filling parts of StRunInfo.
1077  *
1078  * Revision 2.41 2001/12/21 21:13:03 ullrich
1079  * Fixed bug: loading multiple primary vertices.
1080  *
1081  * Revision 2.40 2001/11/10 23:54:21 ullrich
1082  * Added calibration vertices.
1083  *
1084  * Revision 2.39 2001/11/07 21:20:46 ullrich
1085  * Added L1 trigger.
1086  *
1087  * Revision 2.38 2001/09/28 22:22:05 ullrich
1088  * Load helix geometry at last point of each track.
1089  *
1090  * Revision 2.37 2001/09/19 04:49:05 ullrich
1091  * Set event size in StEventInfo.
1092  *
1093  * Revision 2.36 2001/09/18 00:16:06 ullrich
1094  * Fill and add StRunInfo.
1095  *
1096  * Revision 2.35 2001/09/12 23:49:22 ullrich
1097  * Removed code to build StRun and StRunSummary.
1098  *
1099  * Revision 2.34 2001/07/19 00:05:28 ullrich
1100  * New StL0Trigger needs additional table in constructor.
1101  *
1102  * Revision 2.33 2001/07/17 22:21:50 ullrich
1103  * Use B from event summary to set helicity of tracks.
1104  *
1105  * Revision 2.32 2001/05/17 22:46:37 ullrich
1106  * Removed loading of event summary params.
1107  *
1108  * Revision 2.31 2001/02/22 05:02:40 ullrich
1109  * Added new protected method getStEventInstance().
1110  * Modified maker to allow multiple calls of Make() within
1111  * one event. If instance already it is re-used and the data
1112  * from existing tables gets added.
1113  *
1114  * Revision 2.30 2000/11/02 16:33:28 ullrich
1115  * Fixed tiny memory leak.
1116  *
1117  * Revision 2.29 2000/08/30 05:37:02 ullrich
1118  * Obtain trigger mask from StEvtHddr dataset.
1119  *
1120  * Revision 2.28 2000/08/17 00:38:48 ullrich
1121  * Allow loading of tpt tracks.
1122  *
1123  * Revision 2.27 2000/05/26 11:36:19 ullrich
1124  * Default is to NOT print event info (doPrintEventInfo = kFALSE).
1125  *
1126  * Revision 2.26 2000/05/26 11:34:08 ullrich
1127  * Skip the attempt of creating an instance of StRun in case
1128  * no dst dataset is available.
1129  *
1130  * Revision 2.25 2000/05/25 14:44:43 ullrich
1131  * Removed remaining pieces of the RICH pixel table.
1132  *
1133  * Revision 2.24 2000/05/24 15:48:15 ullrich
1134  * Instance of StEvent now also created if no DST dataset
1135  * is available.
1136  *
1137  * Revision 2.23 2000/05/22 21:53:41 ullrich
1138  * No more copying of RICH tables. RICH now writes directly
1139  * to StEvent. printEventInfo() and makeEvent() modified.
1140  *
1141  * Revision 2.22 2000/04/26 20:29:13 ullrich
1142  * Create instance of StEvent not StBrowsableEvent.
1143  *
1144  * Revision 2.21 2000/03/22 17:11:20 ullrich
1145  * Added further checks for case were tables exist but have
1146  * zero length. Added for primary and global tracks.
1147  *
1148  * Revision 2.20 2000/02/23 12:11:49 ullrich
1149  * Added printout of covariant matrix to printTrackInfo().
1150  *
1151  * Revision 2.19 2000/02/17 18:19:05 ullrich
1152  * Adapted new SVT hit storage layout. Barrels instead of layers.
1153  *
1154  * Revision 2.18 2000/02/11 16:12:33 ullrich
1155  * Modified check for valid primary vertices.
1156  *
1157  * Revision 2.17 2000/02/08 21:14:16 genevb
1158  * Handle cases with no tracks.
1159  *
1160  * Revision 2.16 2000/01/25 20:11:11 ullrich
1161  * Fixed bug in loading the Xi vertices.
1162  *
1163  * Revision 2.15 2000/01/14 18:51:06 ullrich
1164  * Added printout of quasi-histos in the event summary
1165  * to printEventInfo().
1166  *
1167  * Revision 2.14 2000/01/14 13:58:03 ullrich
1168  * Create and fill the RICH pixel collection. Added also
1169  * the debug output for the RICH to printEventInfo().
1170  *
1171  * Revision 2.13 2000/01/11 16:05:34 ullrich
1172  * With Victors help now possible to read the dst_summary_param
1173  * table from the runco branch and build StEventSummary objects.
1174  *
1175  * Revision 2.12 2000/01/10 18:20:32 ullrich
1176  * Create new StTrackDetectorInfo object for primary tracks if
1177  * first or last points differ from the referring global track.
1178  *
1179  * Revision 2.11 2000/01/05 16:07:44 ullrich
1180  * Added loading of SSD hits and handling of runco branch.
1181  *
1182  * Revision 2.10 1999/12/21 15:13:13 ullrich
1183  * Modified to cope with new compiler version on Sun (CC5.0).
1184  *
1185  * Revision 2.9 1999/12/07 18:58:39 ullrich
1186  * Modified to get rid of some warnings on Linux
1187  *
1188  * Revision 2.8 1999/11/23 17:14:19 ullrich
1189  * Forgot to fill PID traits. Fixed now.
1190  *
1191  * Revision 2.7 1999/11/17 14:10:27 ullrich
1192  * Added more checks to protect from corrupted table data.
1193  *
1194  * Revision 2.6 1999/11/11 17:46:30 ullrich
1195  * Added more checks and warning messages. Handling
1196  * of primary vertices made safer
1197  *
1198  * Revision 2.5 1999/11/11 10:02:58 ullrich
1199  * Added warning message in case some hits cannot be stored.
1200  *
1201  * Revision 2.4 1999/11/10 22:40:27 ullrich
1202  * Delete hit if it cannot be added to collection.
1203  *
1204  * Revision 2.3 1999/11/08 17:04:59 ullrich
1205  * Hits now allocated individually.
1206  *
1207  * Revision 2.2 1999/11/05 18:35:54 ullrich
1208  * Added methods and flags for debugging and monitoring.
1209  *
1210  * Revision 2.1 1999/11/04 19:55:37 ullrich
1211  * Corrected typo.
1212  *
1213  * Revision 2.0 1999/11/04 19:03:00 ullrich
1214  * Revised to build new StEvent version
1215  *
1216  **************************************************************************/
virtual void AddData(TDataSet *data, const char *dir=".data")
User methods.
Definition: StMaker.cxx:332
virtual Bool_t DoOwner(Bool_t done=kTRUE)
Definition: TObjectSet.cxx:85
virtual Int_t Make()
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StMaker.cxx:634
Accessor to the database for trigger id information.
Collection of trigger ids as stored in StEvent.
Definition: Stypes.h:49
virtual TObject * GetObject() const
The depricated method (left here for the sake of the backward compatibility)
Definition: TDataSet.cxx:428
virtual const char * GetName() const
special overload
Definition: StMaker.cxx:237
Definition: Stypes.h:40
virtual Int_t GetRunNumber() const
Returns the current RunNumber.
Definition: StMaker.cxx:1054
virtual TObject * GetObject() const
The depricated method (left here for the sake of the backward compatibility)
Definition: TObjectSet.h:56
Bool_t doPrintMemoryInfo
lots of screen output
Definition: StEventMaker.h:100
Definition: Stypes.h:44
virtual TDataSet * Find(const char *path) const
Definition: TDataSet.cxx:362