00001
00002
00004
00005
00006
00007
00008
00009
00010
00011
00012
00014
00015 #ifndef STAR_StTriggerSimuMaker
00016 #define STAR_StTriggerSimuMaker
00017
00018 #include <vector>
00019 #include <map>
00020
00021 using namespace std;
00022
00023 #include "StTriggerSimuResult.h"
00024
00025 #ifndef StMaker_H
00026 #include "StMaker.h"
00027 #endif
00028
00029 class StEvent;
00030 class StBemcTables;
00031 class St_db_Maker;
00032
00033 class StVirtualTriggerSimu;
00034 class StBbcTriggerSimu;
00035 class StBemcTriggerSimu;
00036 class StEemcTriggerSimu;
00037 class StEmcTriggerSimu;
00038 class StL2TriggerSimu;
00039 class StGenericL2Emulator;
00040 class StGenericL2Emulator2009;
00041
00042 const int numSimulators=5;
00043
00044 class StTriggerSimuMaker : public StMaker {
00045 private:
00046 int mYear;
00047 int mMCflag;
00048
00050 St_db_Maker *mDbMk;
00051
00053
00054 StVirtualTriggerSimu* mSimulators[numSimulators];
00055
00057 int mBarrelJetPatchTh[3];
00058 int mBarrelHighTowerTh[4];
00059 int mEndcapJetPatchTh[3];
00060 int mEndcapHighTowerTh[2];
00061 int mOverlapJetPatchTh[3];
00062 void overwrite2009DsmRegisters();
00063
00064 int mChangeJPThresh;
00065 void changeJetPatchTh();
00066
00068 map<int,StTriggerSimuResult> mResults;
00069
00070 void buildDetailedResult(int trigId);
00071 bool get2009DsmRegistersFromOfflineDatabase(int runNumber);
00072 bool get2009DsmRegistersFromOnlineDatabase(int runNumber);
00073 bool getTriggerDefinitions(int runNumber);
00074 bool getTriggerThresholds(int runNumber);
00075
00076 public:
00077 StTriggerSimuMaker(const char *name="StarTrigSimu");
00078 virtual ~StTriggerSimuMaker();
00079
00080 void useEemc(int flag=0);
00081 void useBbc();
00082 void useBemc();
00083 void useEmc();
00084 void useL2(StGenericL2Emulator* );
00085 void useL2(StGenericL2Emulator2009* );
00086 void setMC(int x) {mMCflag=x;}
00087
00088 virtual Int_t Init();
00089 virtual Int_t Make();
00090 virtual Int_t Finish();
00091 virtual void Clear(const Option_t* = "");
00092 virtual Int_t InitRun (int runumber);
00093
00094 TObjArray *mHList;
00095 void setHList(TObjArray * x){mHList=x;}
00096 bool isTrigger(int trigId);
00097 bool isTriggerDefined(int trigId);
00098 vector<int> triggerIds() const;
00099
00101 const StTriggerSimuResult& detailedResult(int trigId) { return mResults[trigId]; }
00102
00103
00104 StBbcTriggerSimu *bbc;
00105 StBemcTriggerSimu *bemc;
00106 StEemcTriggerSimu *eemc;
00107 StEmcTriggerSimu *emc;
00108 StL2TriggerSimu *lTwo;
00109
00111 void setBarrelJetPatchTh(int i, int value) { mBarrelJetPatchTh[i] = value; }
00112 void setBarrelHighTowerTh(int i, int value) { mBarrelHighTowerTh[i] = value; }
00113
00114 void setEndcapJetPatchTh(int i, int value) { mEndcapJetPatchTh[i] = value; }
00115 void setEndcapHighTowerTh(int i, int value) { mEndcapHighTowerTh[i] = value; }
00116
00117 void setOverlapJetPatchTh(int i, int value) { mOverlapJetPatchTh[i] = value; }
00118
00119 void changeJPThresh(int value) { mChangeJPThresh = value; }
00120
00121 void setLastDsmRegister(int reg, int value);
00122
00123 ClassDef(StTriggerSimuMaker,0)
00124 };
00125
00126 #endif
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221