StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StL2_2008EmulatorMaker.cxx
1 //
3 // StL2_2008EmulatorMaker Jan Balewski (Fall, 2007)
4 //
5 // Goal:
6 //
7 //
9 // StEvent
10 #include "StEventTypes.h"
11 #include "StEvent/StEvent.h"
12 
13 //MuDst
14 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
15 #include "StMuDSTMaker/COMMON/StMuDst.h"
16 #include "StMuDSTMaker/COMMON/StMuTriggerIdCollection.h"
17 #include "StMuDSTMaker/COMMON/StMuEvent.h"
18 
19 
20 //trg stuff
21 #include "StTriggerData2005.h"
22 #include "StDaqLib/TRG/trgStructures.h"
23 
24 //L2 stuff
25 #include "L2algoUtil/L2EmcDb.h"
26 #include "L2pedAlgo/L2pedAlgo.h"
27 
28 #include "StL2_2008EmulatorMaker.h"
29 
30 ClassImp(StL2_2008EmulatorMaker)
31 
32 StL2_2008EmulatorMaker::StL2_2008EmulatorMaker(const char *name):StMaker(name) {
33  mL2pedAlgo=0;
34 }
35 
36 //========================================
37 StL2_2008EmulatorMaker::~StL2_2008EmulatorMaker(){
38 }
39 
40 
41 //========================================
42 //========================================
43 Int_t
44 StL2_2008EmulatorMaker::InitRun(int runNo){
45  //WARN: do NOT use runNo for any setup - it would break for M-C
46  //WARN: do NOT use runNo to controll setup of L2-algos- it would break for M-C
47 
48  initRun1();
49  LOG_INFO << Form("::setupL2Algos2008(), dbDate=%d ", mYearMonthDay)<<endm;
50 
51 
52  mL2algoN=1; // total # of L2 algos (ped, jet, ...)
53  mL2algo =new L2VirtualAlgo *[mL2algoN]; // not cleared memeory leak
54  memset(mL2algo,0,mL2algoN*sizeof(void*));
55  //setup every algo one by one, params may be time dependent
56 
57 
58  mL2algo[0]=mL2pedAlgo=new L2pedAlgo("ped-algo",mL2EmcDb,mL2EmcDb->logPath,10); // tmp: offset=10
59  // add here more 2008 L2-algos
60 
61 
62  initRun2(runNo);
63 
64  LOG_INFO << "::InitRun() done, run=" <<runNo<<" isMC="<<mMCflag<<endm;
65  return kStOK;
66 }
67 
68 //_____________________________________________________________________________
69 Int_t
70 StL2_2008EmulatorMaker::Init() {
71  init();
72  LOG_INFO <<Form("Init()")<<endm;
73 
74  return StMaker::Init();
75 }
76 
77 //========================================
78 void
79 StL2_2008EmulatorMaker::Clear(const Option_t*){
80  clear();
81  //slows down code: LOG_DEBUG<<"StL2_2008EmulatorMaker::Clear()"<<endm;
82 }
83 
84 
85 //========================================
86 Int_t
88 
89  make();
90  return kStOK;
91 }
92 
93 //========================================
94 Int_t
96  finish();
97  return kStOK;
98 }
99 
100 
101 #if 0
102 //_____________________________________________________________________________
103 void
104 StL2_2008EmulatorMaker::initHistoA(TString core) {
105  LOG_INFO <<Form("initHistoA(),")<<endm;
106 
107  assert(mHList);
108  memset(hA,0,sizeof(hA));
109 
110  hA[0]=0;
111  hA[1]=new TH1F(core+"trgID", "event counter for Jan",10,1,11);
112 
113  //.... add histos to the list
114  int i;
115  for(i=0;i<mxAH;i++) {
116  if( hA[i]==0) continue;
117  mHList->Add( hA[i]);
118  }
119 }
120 #endif
Definition: Stypes.h:40