StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTriggerDataMother.cxx
1 /*******************************************************
2  *
3  * $Id: StTriggerDataMother.cxx,v 1.2 2006/09/15 02:45:13 mvl Exp $
4  *
5  * Author: Jan Balewski
6  *******************************************************
7  *
8  * Description: abstract class for trigger data from all years
9  *
10  *******************************************************/
11 #include <TArrayC.h>
12 
13 #include "StTriggerDataMother.h"
14 #include "StMuDSTMaker/EZTREE/EztTrigBlob.h"
15 #include "StEvent/StTriggerData2003.h"
16 #include "StEvent/StTriggerData2004.h"
17 #include "StEvent/StTriggerData2005.h"
18 
19 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
20 #include "StMuDSTMaker/COMMON/StMuEvent.h"
21 #include "StMuDSTMaker/COMMON/StMuDst.h"
22 ClassImp(StTriggerDataMother)
23 //--------------------------------------------------------
24 //--------------------------------------------------------
25 
27  delete fCurrent;
28 }
29 
30 //--------------------------------------------------------
31 //--------------------------------------------------------
32 StTriggerDataMother::StTriggerDataMother(EztTrigBlob*trigBlob) {
33  fCurrent=0;
34  if(trigBlob==0) {
35  gMessMgr->Message("","F") <<GetName()<<"(0) - no input trig data, NULL returned"<<endm;
36  return;
37  }
38 
39  gMessMgr->Message("","D") <<GetName()<<"-trig data ver/dec="<<trigBlob->getVersion()<<endm;
40  // trigBlob->print(0);
41 
42  int runId=-99;
43  if (StMuDst::array(0) && StMuDst::array(0)->GetEntriesFast() > 0) {
44  StMuEvent *muEve = StMuDst::event();
45  runId=muEve->eventInfo().runId();
46  }
47  else {
48  cout << "ERROR in " << __PRETTY_FUNCTION__ << ": cannot get event, run numberi. Exiting" << endl;
49  exit(255);
50  }
51  void *blob=trigBlob->trgd->GetArray();
52  switch(trigBlob->getVersion()) {
53  case 0x20:
54  fCurrent = new StTriggerData2003( (const TrgDataType2003 *)blob, runId);
55  break;
56  case 0x21:
57  fCurrent = new StTriggerData2004( (const TrgDataType2004 *)blob, runId);
58  break;
59  case 0x22:
60  fCurrent = new StTriggerData2005( (const TrgDataType2005 *)blob, runId);
61  break;
62  default:
63  gMessMgr->Message("","F") <<GetName()<<"-trig data ver/dec="<<trigBlob->getVersion()<<" not supported"<<endm;
64  }
65 }
66 
67 
68 
69 /*
70  * $Log: StTriggerDataMother.cxx,v $
71  * Revision 1.2 2006/09/15 02:45:13 mvl
72  * Modification to pass run number when unpacking triger data (StTriggerDataxxx). From Jan Balewski.
73  *
74  * Revision 1.1 2004/11/29 17:28:31 mvl
75  * New class for trigger versioning (by Jan)
76  *
77  *
78  ****************************************/
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320
static TClonesArray * array(int type)
returns pointer to the n-th TClonesArray
Definition: StMuDst.h:262