StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StGenericL2Emulator2009.h
1 // -*- mode: c++ -*-
2 // Pibero Djawotho <pibero@tamu.edu>
3 // Texas A&M University
4 // 16 April 2010
5 // Original StGenericL2Emulator by Jan Balewski <balewski@mit.edu> and Renee Fatemi <rfatemi@pa.uky.edu>
6 // Interfaces L2 algos to the STAR ofl software
7 
8 #ifndef STAR_StGenericL2Emulator2009
9 #define STAR_StGenericL2Emulator2009
10 #include <vector>
11 #include <set>
12 
13 class StTriggerSimuMaker;
14 class StEEmcDb;
15 class StEmcGeom;
16 class StEmcDecoder;
17 class L2EmcDb;
18 class L2EmcGeom;
19 
20 #include "L2algoUtil/L2VirtualAlgo2009.h"
21 #include "StVirtualTriggerSimu.h"
22 
23 
25  private:
26  int mTotInpEve;
27  TString mOutPath;
28  TString mSetPath;
29 
30  void doBanksFromStRawData();
31  void doBanksFromMuDst();
32 
33  // needed to regenerate raw data banks
34  StEEmcDb *mDbE;
35  StEmcGeom *mGeomB;
36  StEmcDecoder *mMappB;
37  // StTriggerSimuMaker *mHeadMaker;
38  //void setHeadMaker(StTriggerSimuMaker *maker) { mHeadMaker = maker; }
39 
40 
41  protected:
42  int mMCflag; // set mcFlag=0 for real data
43  int mYear;
44  bool mUseMuDst;
45 
46  // holds all instantiated L2algos
47  vector<L2VirtualAlgo2009*> mL2algo; // actual algos
48 
49  L2EmcDb *mL2EmcDb;
50  L2EmcGeom *mL2EmcGeom;
51  int mYearMonthDay,mHourMinSec;
52  TString mSetupPath;
53 
54  //replicas of oryginal daq data containers, tmp open for export
55  unsigned short *mBTOW_BANK;
56  unsigned short *mETOW_BANK;
57  int mBTOW_in, mETOW_in;
58  unsigned int mL2Result[128];
59 
60  void init();
61  void make();
62  void addTriggerList();
63  void initRun1(); // before algos are initialized
64  void initRun2(int runNo); // after algos are initialized
65  void finish();
66  void clear();
67 
68  public:
70  virtual ~StGenericL2Emulator2009();
71  void printBEtowers();
72  void printBEblocks();
73 
74  unsigned short *getBtowBank(){return mBTOW_BANK;}
75  unsigned short *getEtowBank(){return mETOW_BANK;}
76  int getBtowIn(){return mBTOW_in;}
77  int getEtowIn(){return mETOW_in;}
78 
79  void useStEvent() {mUseMuDst=false;}
80  void setMC(int x=true) {mMCflag=x;}
81  void setSetupPath(char *x) { mSetupPath=x;}
82  void setOutPath(char *x) { mOutPath=x;}
83 
84  set<int> mAcceptTriggerList;
85  set<int> mVetoTriggerList;
86  StTriggerSimuDecision isTrigger(int trigId);
87 
89  const unsigned int* result() const { return mL2Result; }
90 
91  ClassDef(StGenericL2Emulator2009,0)
92 };
93 
94 #endif
const unsigned int * result() const
bag of 64 bytes whose interpretation changes year-by-year
void printBEtowers()
hits in StEvent
void printBEblocks()
regenerated banks