1 #include "BEMC_DSM_decoder.h"
2 #include "StBemcTriggerSimu.h"
8 #include "StTriggerSimuMaker.h"
11 #include "StEmcUtil/database/StEmcDecoder.h"
12 #include "StEmcUtil/geometry/StEmcGeom.h"
13 #include "StEmcUtil/database/StBemcTables.h"
14 #include "StEmcRawMaker/defines.h"
15 #include "StEmcSimulatorMaker/StEmcSimulatorMaker.h"
16 #include "StEmcADCtoEMaker/StEmcADCtoEMaker.h"
17 #include "StEmcRawMaker/StEmcRawMaker.h"
18 #include "StBemcTriggerDbThresholds.h"
21 #include "St_DataSetIter.h"
22 #include "StEvent/StEventTypes.h"
25 #include "St_db_Maker/St_db_Maker.h"
28 #include "StMuDSTMaker/COMMON/StMuTypes.hh"
31 #include "StTriggerUtilities/StDSMUtilities/StDSM2009Utilities.hh"
41 mGeo = StEmcGeom::getEmcGeom(
"bemc");
51 StBemcTriggerSimu::~StBemcTriggerSimu(){
59 void StBemcTriggerSimu::Init(){
61 LOG_INFO <<Form(
"Bemc::Init() MC_flag=%d, config: flag=%d",mMCflag, mConfig)<<endm;
62 assert(mConfig>=kOnline);
63 assert(mConfig<=kExpert);
66 starDb =
static_cast<St_db_Maker*
> ( mHeadMaker->GetMakerInheritsFrom(
"St_db_Maker") );
68 LOG_WARN <<
"StBemcTriggerSimu couldn't get a pointer to St_db_maker -- this means trouble" << endm;
74 LOG_FATAL <<
"StBemcTriggerSimu couldn't find StEmcSimulatorMaker in chain" << endm;
80 mAdc2e =
static_cast<StEmcADCtoEMaker*
> ( mHeadMaker->GetMakerInheritsFrom(
"StEmcADCtoEMaker") );
85 LOG_FATAL <<
"StBemcTriggerSimu couldn't find StEmcADCtoEMaker and StEmcRawMaker in chain" << endm;
90 mDbThres->LoadTimeStamps();
93 mAllTriggers.insert(96201);
94 mAllTriggers.insert(96211);
95 mAllTriggers.insert(96221);
96 mAllTriggers.insert(96233);
99 mAllTriggers.insert(117201);
100 mAllTriggers.insert(117211);
101 mAllTriggers.insert(117212);
102 mAllTriggers.insert(127212);
103 mAllTriggers.insert(127213);
104 mAllTriggers.insert(137213);
105 mAllTriggers.insert(117221);
106 mAllTriggers.insert(127221);
107 mAllTriggers.insert(137221);
108 mAllTriggers.insert(137222);
109 mAllTriggers.insert(117501);
110 mAllTriggers.insert(127501);
111 mAllTriggers.insert(137501);
112 mAllTriggers.insert(117571);
113 mAllTriggers.insert(127571);
114 mAllTriggers.insert(137571);
115 mAllTriggers.insert(117575);
116 mAllTriggers.insert(127575);
117 mAllTriggers.insert(137575);
118 mAllTriggers.insert(117585);
119 mAllTriggers.insert(127585);
120 mAllTriggers.insert(137585);
121 mAllTriggers.insert(117601);
122 mAllTriggers.insert(117602);
123 mAllTriggers.insert(137602);
124 mAllTriggers.insert(137603);
125 mAllTriggers.insert(117611);
126 mAllTriggers.insert(127611);
127 mAllTriggers.insert(5);
128 mAllTriggers.insert(137611);
129 mAllTriggers.insert(117621);
130 mAllTriggers.insert(117622);
131 mAllTriggers.insert(127622);
132 mAllTriggers.insert(137622);
133 mAllTriggers.insert(117705);
134 mAllTriggers.insert(137705);
135 mAllTriggers.insert(117821);
136 mAllTriggers.insert(127821);
137 mAllTriggers.insert(137821);
138 mAllTriggers.insert(137822);
139 mAllTriggers.insert(147570);
140 mAllTriggers.insert(147585);
141 mAllTriggers.insert(147611);
142 mAllTriggers.insert(147621);
143 mAllTriggers.insert(147705);
146 mAllTriggers.insert(200211);
147 mAllTriggers.insert(200212);
148 mAllTriggers.insert(200220);
149 mAllTriggers.insert(200221);
150 mAllTriggers.insert(200222);
151 mAllTriggers.insert(200213);
152 mAllTriggers.insert(200214);
153 mAllTriggers.insert(200585);
154 mAllTriggers.insert(200586);
155 mAllTriggers.insert(200601);
156 mAllTriggers.insert(200602);
157 mAllTriggers.insert(200620);
158 mAllTriggers.insert(200621);
160 mAllTriggers.insert(200400);
161 mAllTriggers.insert(200401);
162 mAllTriggers.insert(200402);
163 mAllTriggers.insert(200410);
164 mAllTriggers.insert(200411);
168 mAllTriggers.insert(210500);
169 mAllTriggers.insert(210510);
170 mAllTriggers.insert(210520);
171 mAllTriggers.insert(210501);
172 mAllTriggers.insert(210511);
173 mAllTriggers.insert(210521);
174 mAllTriggers.insert(210541);
176 mAllTriggers.insert(210601);
177 mAllTriggers.insert(210710);
178 mAllTriggers.insert(210800);
181 mAllTriggers.insert(220500);
182 mAllTriggers.insert(220510);
183 mAllTriggers.insert(220520);
206 mBEMCLayer0HT6bitDiff=
new TH2F(
"BEMCLayer0HT6bitDiff",
"BEMC Layer 0 HT6bit Difference",kNPatches,0,kNPatches,128,-64,64);
207 mBEMCLayer0TP6bitDiff=
new TH2F(
"BEMCLayer0TP6bitDiff",
"BEMC Layer 0 TP6bit Difference",kNPatches,0,kNPatches,128,-64,64);
208 mBEMCLayer0HT6bit=
new TH2F(
"BEMCLayer0HT6bit",
"BEMC Layer 0 HT6bit",kNPatches,0,kNPatches,32,0,32);
209 mBEMCLayer0TP6bit=
new TH2F(
"BEMCLayer0TP6bit",
"BEMC Layer 0 TP6bit",kNPatches,0,kNPatches,32,0,32);
210 mBEMCLayer1HTBits =
new TH2F(
"BEMCLayer1HTBits",
"BEMC Layer1 HT Threshold Bits", 36, 0, 36, 10, 0, 10);
211 mBEMCLayer1HTBitsDiff =
new TH2F(
"BEMCLayer1HTBitsDiff",
"BEMC Layer1 HT Threshold Bits - Simulated",36, 0, 36, 20, -10, 10);
212 mBEMCLayer1TPBits =
new TH2F(
"BEMCLayer1TPBits",
"BEMC Layer1 TP Threshold Bits", 36, 0, 36, 10, 0, 10);
213 mBEMCLayer1TPBitsDiff =
new TH2F(
"BEMCLayer1TPBitsDiff",
"BEMC Layer1 TP Threshold Bits - Simulated",36, 0, 36, 20, -10, 10);
214 mBEMCLayer1HTTPBits =
new TH2F(
"BEMCLayer1HTTPBits",
"BEMC Layer1 HT.TP Threshold Bits", 36, 0, 36, 10, 0, 10);
215 mBEMCLayer1HTTPBitsDiff =
new TH2F(
"BEMCLayer1HTTPBitsDiff",
"BEMC Layer1 HT.TP Threshold Bits - Simulated",36, 0, 36, 20, -10, 10);
216 mBEMCLayer1PatchSum =
new TH2F(
"BEMCLayer1PatchSum",
"BEMC Layer1 Patch Sum", 36, 0, 36, 100, 0, 100);
217 mBEMCLayer1PatchSumDiff =
new TH2F(
"BEMCLayer1PatchSumDiff",
"BEMC Layer1 Patch Sum Diff", 36, 0, 36, 200, -100, 100);
218 mBEMCLayer1HTmaskBits =
new TH2F(
"BEMCLayer1HTmaskBits",
"BEMC Layer1 HT Mask Bits", 36, 0, 36, 8, -4, 4);
219 mBEMCLayer1HTmaskDiff =
new TH2F(
"BEMCLayer1HTmaskDiff",
"BEMC Layer1 HT Mask Diff", 36, 0, 36, 8, -4, 4);
220 mBEMCLayer1HTthr3Bits =
new TH2F(
"BEMCLayer1HTthr3Bits",
"BEMC Layer1 HT Thr3 Bits", 36, 0, 36, 8, -4, 4);
221 mBEMCLayer1HTthr3Diff =
new TH2F(
"BEMCLayer1HTthr3Diff",
"BEMC Layer1 HT Thr3 Diff", 36, 0, 36, 8, -4, 4);
222 mBEMCLayer2PatchSum =
new TH2F(
"BEMCLayer2PatchSum",
"BEMC Layer2 Patch Sum", 6, 0, 6, 100, 0, 100);
223 mBEMCLayer2PatchSumDiff =
new TH2F(
"BEMCLayer2PatchSumDiff",
"BEMC Layer2 Patch Sum Diff", 6, 0, 6, 200, -100, 100);
224 mBEMCLayer2HT3Bits =
new TH2F(
"BEMCLayer2HT3Bits",
"BEMC Layer2 HT3 Bits", 6, 0, 6, 4, 0, 4);
225 mBEMCLayer2HT3BitsDiff =
new TH2F(
"BEMCLayer2HT3BitsDiff",
"BEMC Layer2 HT3 Bits", 6, 0, 6, 8, -4, 4);
226 mBEMCLayer2HTTPBits =
new TH2F(
"BEMCLayer2HTTPBits",
"BEMC Layer2 HTTP Bits", 6, 0, 6, 4, 0, 4);
227 mBEMCLayer2HTTPBitsDiff =
new TH2F(
"BEMCLayer2HTTPBitsDiff",
"BEMC Layer2 HTTP Bits", 6, 0, 6, 8, -4, 4);
228 mBEMCLayer2TPBits =
new TH2F(
"BEMCLayer2TPBits",
"BEMC Layer2 TP Bits", 6, 0, 6, 4, 0, 4);
229 mBEMCLayer2TPBitsDiff =
new TH2F(
"BEMCLayer2TPBitsDiff",
"BEMC Layer2 TP Bits", 6, 0, 6, 8, -4, 4);
230 mBEMCLayer2JPBits =
new TH2F(
"BEMCLayer2JPBits",
"BEMC Layer2 JP Bits", 6, 0, 6, 4, 0, 4);
231 mBEMCLayer2JPBitsDiff =
new TH2F(
"BEMCLayer2JPBitsDiff",
"BEMC Layer2 JP Bits", 6, 0, 6, 8, -4, 4);
232 mBEMCLayer2HTj0Bits =
new TH2F(
"BEMCLayer2HTj0Bits",
"BEMC Layer2 HT_j0 Bits", 6, 0, 6, 4, 0, 4);
233 mBEMCLayer2HTj0BitsDiff =
new TH2F(
"BEMCLayer2HTj0BitsDiff",
"BEMC Layer2 HT_j0 Patch Bits", 6, 0, 6, 8, -4, 4);
234 mBEMCLayer2HTj1Bits =
new TH2F(
"BEMCLayer2HTj1Bits",
"BEMC Layer2 HT_j1 Bits", 6, 0, 6, 4, 0, 4);
235 mBEMCLayer2HTj1BitsDiff =
new TH2F(
"BEMCLayer2HTj1BitsDiff",
"BEMC Layer2 HT_j1 Bits", 6, 0, 6, 8, -4, 4);
237 mHList->Add(mBEMCLayer0HT6bit);
238 mHList->Add(mBEMCLayer0TP6bit);
239 mHList->Add(mBEMCLayer0HT6bitDiff);
240 mHList->Add(mBEMCLayer0TP6bitDiff);
241 mHList->Add(mBEMCLayer1HTBits);
242 mHList->Add(mBEMCLayer1HTBitsDiff);
243 mHList->Add(mBEMCLayer1TPBits);
244 mHList->Add(mBEMCLayer1TPBitsDiff);
245 mHList->Add(mBEMCLayer1HTTPBits);
246 mHList->Add(mBEMCLayer1HTTPBitsDiff);
247 mHList->Add(mBEMCLayer1PatchSum);
248 mHList->Add(mBEMCLayer2PatchSum);
249 mHList->Add(mBEMCLayer2HTTPBits);
250 mHList->Add(mBEMCLayer2TPBits);
251 mHList->Add(mBEMCLayer2HT3Bits);
252 mHList->Add(mBEMCLayer2JPBits);
253 mHList->Add(mBEMCLayer2HTj0Bits);
254 mHList->Add(mBEMCLayer2HTj1Bits);
255 mHList->Add(mBEMCLayer1PatchSumDiff);
256 mHList->Add(mBEMCLayer1HTthr3Bits);
257 mHList->Add(mBEMCLayer1HTthr3Diff);
258 mHList->Add(mBEMCLayer1HTmaskBits);
259 mHList->Add(mBEMCLayer1HTmaskDiff);
260 mHList->Add(mBEMCLayer2PatchSumDiff);
261 mHList->Add(mBEMCLayer2HTTPBitsDiff);
262 mHList->Add(mBEMCLayer2TPBitsDiff);
263 mHList->Add(mBEMCLayer2HT3BitsDiff);
264 mHList->Add(mBEMCLayer2JPBitsDiff);
265 mHList->Add(mBEMCLayer2HTj0BitsDiff);
266 mHList->Add(mBEMCLayer2HTj1BitsDiff);
273 void StBemcTriggerSimu::InitRun(
int runnumber){
274 LOG_DEBUG<<
"StBemcTriggerSimu::InitRun() -- " << runnumber <<
'\t' << mHeadMaker->GetDate() <<
'\t' << mHeadMaker->GetTime() << endm;
278 const TDatime& dbTime = starDb->GetDBTime();
280 timestamp = dbTime.Get();
281 year = dbTime.GetYear();
282 yyyymmdd = dbTime.GetDate();
283 hhmmss = dbTime.GetTime();
285 mDecoder->SetDateTime(dbTime);
296 HT_FEE_Offset=mDbThres->GetHtFEEbitOffset(year);
301 if(year == 2009 || year == 2010 || year == 2011 || year == 2012 || year == 2014){
304 }
else if(year==2013){
306 if(runnumber >= 14081067){
310 }
else if(year == 2015){
313 }
else if(year == 2016){
316 }
else if(year == 2017){
324 if (mBemcStatus !=
"") {
328 FEEini2009(runnumber);
330 mAllTriggers.clear();
335 void StBemcTriggerSimu::Clear(){
338 for (
int did=1; did<=kNTowers; did++){
342 HT6bit_adc_holder[did-1]=0;
345 for (
int tpid=0;tpid<kNPatches; tpid++){
350 TP6bit_adc_holder[tpid]=0;
353 mFiredTriggers.clear();
354 mJpsiCandidates.clear();
358 bool StBemcTriggerSimu::isCorrupted()
const {
365 for(
unsigned i=0; i<mFiredTriggers.size(); i++) {
366 if(trigId == mFiredTriggers[i])
return kYes;
370 if(mAllTriggers.find(trigId) == mAllTriggers.end()) {
379 void StBemcTriggerSimu::getTowerStatus(){
381 fill(TowerStatus,TowerStatus+kNTowers,1);
382 fill(numMaskTow,numMaskTow+kNPatches,0);
384 if (mConfig==kOnline) {
385 for (Int_t cr=1; cr <= kNCrates; cr++){
386 for (Int_t ch=0; ch < kNChannels; ch++){
389 TowerStatus[did-1]=mTables->triggerTowerStatus(cr,ch);
391 if (TowerStatus[did-1]!=1) numMaskTow[tpid]++;
397 if (mConfig==kOffline){
398 for (
int did=1; did<=kNTowers; did++){
400 mTables->
getStatus(BTOW, did, TowerStatus[did-1]);
401 if (mTables->
status(BTOW,did,
"calib")!=1) TowerStatus[did-1]=0;
403 if (TowerStatus[did-1]!=1) numMaskTow[tpid]++;
407 if (mConfig==kExpert){
408 for (
int did=1; did<=kNTowers; did++){
410 TowerStatus[did-1]=1;
412 if (TowerStatus[did-1]!=1) numMaskTow[tpid]++;
418 void StBemcTriggerSimu::getDSM_TPStatus(){
420 for (
int tpid=0;tpid<kNPatches;tpid++) DSM_TPStatus[tpid]=1;
423 if (mConfig==kOnline){
424 for (
int tpid=0;tpid<kNPatches;tpid++){
425 DSM_TPStatus[tpid]=mTables->triggerPatchStatus(tpid);
430 if (mConfig==kOffline) {
431 for (
int tpid=0;tpid<kNPatches;tpid++){
432 DSM_TPStatus[tpid]=1;
437 if (mConfig==kExpert){
438 for (
int tpid=0;tpid<kNPatches;tpid++){
439 DSM_TPStatus[tpid]=1;
446 void StBemcTriggerSimu::getDSM_HTStatus(){
448 for (
int tpid=0;tpid<kNPatches;tpid++) DSM_HTStatus[tpid]=1;
451 if (mConfig==kOnline){
452 for (
int tpid=0;tpid<kNPatches;tpid++){
453 DSM_HTStatus[tpid]=mTables->triggerHighTowerStatus(tpid);
458 if (mConfig==kOffline){
459 for (
int tpid=0; tpid<kNPatches; tpid++){
460 DSM_HTStatus[tpid]=1;
464 if (mConfig==kExpert){
465 for (
int tpid=0;tpid<kNPatches;tpid++){
466 DSM_HTStatus[tpid]=1;
472 void StBemcTriggerSimu::getPed() {
474 for (
int i=1;i<=kNTowers;i++) {ped12[i-1]=0;}
476 for (
int did=1;did<=kNTowers;did++){
477 bitConvValue[did-1]=mTables->triggerBitConversionByID(did);
481 pedTargetValue=mTables->triggerPedestalShift();
484 if (mConfig==kOnline){
485 for (
int cr=1; cr <= kNCrates; cr++){
486 for (
int ch=0; ch < kNChannels; ch++){
489 ped12[did-1] = mTables->triggerPedestal(cr,ch);
495 if (mConfig==kOffline){
496 for (
int did=1; did<=kNTowers; did++){
497 ped12[did-1]=mTables->pedestal(BTOW,did);
502 if (mConfig==kExpert){
503 for (
int did=1; did<=kNTowers; did++){
510 void StBemcTriggerSimu::getLUT(){
521 for (
int cr=1;cr<=kNCrates;cr++){
522 for (
int seq=0; seq<kNSeq; seq++){
525 formula[cr-1][seq]=f;
526 LUTscale[cr-1][seq]=param[0];
527 LUTped[cr-1][seq]=param[1];
528 LUTsig[cr-1][seq]=param[2];
529 LUTpow[cr-1][seq]=param[3];
535 void StBemcTriggerSimu::Make(){
537 mEvent =
static_cast<StEvent*
> ( mHeadMaker->GetDataSet(
"StEvent") );
540 if(!mMCflag && mTestMode){
542 for(
int ip = 0; ip < 300; ip++){
543 int ht = emc.highTower(ip);
544 int pa = emc.patch(ip);
553 simulateFEEfailure();
565 if ((year==2007)&&(yyyymmdd<20071205)){
572 if ((yyyymmdd>20071205)&&(yyyymmdd<20080129)){
573 get2008dAu_DSMLayer0();
574 get2008dAu_DSMLayer1();
575 get2008dAu_DSMLayer2();
579 if ((year==2008)&&(yyyymmdd>20080129)){
580 get2008pp_DSMLayer0();
581 get2008pp_DSMLayer1();
582 get2008pp_DSMLayer2();
586 if ((year>=2009)&&(yyyymmdd>20090101)) {
591 if (mMCflag) fillStEmcTriggerDetector();
595 void StBemcTriggerSimu::FEEout() {
602 static int commonLUT[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9,
603 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
604 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
605 60, 61, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
606 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62,
607 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62};
609 if(!mEvent) {LOG_WARN <<
"StBemcTriggerSimu -- no StEvent!" << endm;}
612 if(!emc) {LOG_WARN <<
"StBemcTriggerSimu -- no StEmcCollection!" << endm;}
615 if(!detector) {LOG_WARN <<
"StBemcTriggerSimu -- no StEmcDetector!" << endm;}
624 for(Int_t m = 1; m <= 120; ++m) {
627 StSPtrVecEmcRawHit& rawHit=module->hits();
628 for(UInt_t k = 0; k < rawHit.size(); ++k) {
632 Int_t m=rawHit[k]->module();
633 Int_t e=rawHit[k]->eta();
634 Int_t s=abs(rawHit[k]->sub());
635 Int_t adc=rawHit[k]->adc();
639 mGeo->getId(m,e,s,did);
643 if (TowerStatus[did-1]==1) {
647 ped12Diff=ped12[did-1]-pedTargetValue;
651 adc10[did-1]=adc12[did-1] >> 2;
656 ped12Diff = -ped12Diff;
659 ped10Diff = ped12Diff/4;
662 sprintf(buffer,
"%3.0f",ped10Diff);
663 ped10DiffI=atoi(buffer);
667 if (ped12Diff - ped10DiffI*4 > 2) {
669 sprintf(buffer,
"%3.0f",ped10Diff);
670 ped10DiffI=atoi(buffer);
674 if(ped10DiffI > 15) {
675 sprintf(buffer,
"%3.0f",
double(ped10DiffI - 11)/4);
676 int holder = atoi(buffer);
677 ped10Diff = ped10DiffI - 4*holder;
678 sprintf(buffer,
"%3.0f",ped10Diff);
679 ped10DiffI = atoi(buffer);
683 if (operation==1) adc10[did-1] -= ped10DiffI;
684 if (operation==0) adc10[did-1] += ped10DiffI;
687 if ((mConfig==kOffline)&&(adc10[did-1] < 0)) adc10[did-1]=0;
690 adc08[did-1]=adc10[did-1] >> 2;
695 if (mConfig==kOnline) HTholder = adc10[did-1] >> bitConvValue[did-1];
696 if (mConfig==kOffline) HTholder = adc10[did-1] >> HT_FEE_Offset;
698 int HTL = HTholder & 0x1F;
699 int HTH = HTholder >> 5;
702 HTadc06[did-1] = HTL+(B5<<5);
705 HT6bit_adc_holder[did-1]=HTadc06[did-1];
706 if (DSM_HTStatus[tpid]==1){
707 if (HTadc06[did-1]>L0_HT_ADC[tpid]) L0_HT_ADC[tpid]=HTadc06[did-1];
709 if (DSM_TPStatus[tpid]==1) {
710 L0_TP_ADC[tpid]+=adc08[did-1];
711 TP6bit_adc_holder[tpid]+=adc08[did-1];
717 if (DSM_HTStatus[tpid]==0) L0_HT_ADC[tpid]=0;
718 if (DSM_TPStatus[tpid]==0) L0_TP_ADC[tpid]=0;
719 if (DSM_TPStatus[tpid]==0) TP6bit_adc_holder[tpid]=0;
723 cout<<
"Tow#="<<did<<
" TP#="<<tpid<<
" adc12="<<adc12[did-1]<<
" adc10="<<adc10[did-1]<<
" adc08="<<adc08[did-1]
724 <<
" HTadc06="<<HTadc06[did-1]<<
" ped12="<<ped12[did-1]<<
" ped12diff="<<ped12Diff<<
" ped10Diff="
725 <<ped10Diff<<
"HTholder="<<HTholder<<
" HTL="<<HTL<<
" HTH="<<HTH<<
" B5="<<B5<<
" BitConverValue="<<bitConvValue[did-1]
726 <<
" HT_FEE_Offset="<<HT_FEE_Offset<<
" L0_TP_ADC="<<L0_TP_ADC[tpid]<<
" PedTargetValue="<<pedTargetValue<<endl;
736 for (
int tpid=0;tpid<kNPatches;tpid++){
739 Int_t cr, seq, chan, LUTindex;
743 if (mConfig==kOnline)
746 if ( ((L0_TP_ADC[tpid]+LUTped[cr-1][chan]+2)>=0) && (formula[cr-1][chan]==2) && (LUTscale[cr-1][chan]==1) &&
747 (LUTpow[cr-1][chan]!=0) && (LUTsig[cr-1][chan]==0) && (pedTargetValue==24))
749 LUTindex=L0_TP_ADC[tpid] + LUTped[cr-1][chan] + numMaskTow[tpid];
750 LUT[tpid] = commonLUT[LUTindex];
761 L0_TP_ADC[tpid]=LUT[tpid];
762 TP6bit_adc_holder[tpid]=LUT[tpid];
766 if (mConfig==kOffline) {
768 if ((L0_TP_PED[tpid]-1)>=L0_TP_ADC[tpid]) {
770 TP6bit_adc_holder[tpid]=1;
772 if ((L0_TP_PED[tpid]-1)< L0_TP_ADC[tpid]) {
773 L0_TP_ADC[tpid]-=(L0_TP_PED[tpid]-1);
774 TP6bit_adc_holder[tpid]-=(L0_TP_PED[tpid]-1);
776 if (L0_TP_ADC[tpid] > 62) {
778 TP6bit_adc_holder[tpid]=62;
785 cout<<
" tpid="<<tpid<<
" cr="<<cr<<
" ch="<<chan<<
" formula="<<formula[cr-1][chan]<<
786 " TPadc="<<L0_TP_ADC[tpid]<<
" OfflinePed="<<L0_TP_PED[tpid]<<
" LUTped="<<LUTped[cr-1][chan]<<
787 " numMaskTow="<<numMaskTow[tpid]<<
" LUTindex="<<LUTindex<<
" OnlineLUT="<<LUT[tpid]<<
788 " diff="<<(L0_TP_ADC[tpid] - (L0_TP_PED[tpid]-1)) - (LUT[tpid])<<endl;
793 LOG_DEBUG <<
"BEMC trigger patch format is HT/TPsum" << endm;
794 for (
int dsm = 0; dsm < 30; ++dsm) {
795 TString line = Form(
"TP%d-%d: ",dsm*10,dsm*10+9);
796 for (
int ch = 0; ch < 10; ++ch) {
797 int triggerPatch = dsm*10+ch;
798 line += Form(
"%d/%d ",L0_HT_ADC[triggerPatch],L0_TP_ADC[triggerPatch]);
800 LOG_DEBUG << line << endm;
804 void StBemcTriggerSimu::GetTriggerPatchFromCrate(
int crate,
int seq,
int& triggerPatch)
const
806 triggerPatch = (340-10*crate)%150+seq;
807 if (crate <= 15) triggerPatch += 150;
810 void StBemcTriggerSimu::FEEini2009()
812 const bool debug =
false;
814 fill(numMaskTow,numMaskTow+kNPatches,0);
816 ifstream bemcStatus(mBemcStatus);
820 LOG_INFO << mBemcStatus << endm;
824 while (line.ReadLine(bemcStatus)) {
825 if (line.BeginsWith(
"#")) {
826 LOG_INFO << line << endm;
829 else if (line.BeginsWith(
"SoftId")) {
830 int towerId, crate, crateSeq, towerStatus, highTowerStatus, patchSumStatus, triggerPatch;
832 sscanf(line,
"SoftId %d %d %d %d %d %d %f %d",&towerId,&crate,&crateSeq,&towerStatus,&highTowerStatus,&patchSumStatus,&pedestal,&triggerPatch);
833 LOG_INFO <<
"SoftId " << towerId <<
'\t' << crate <<
'\t' << crateSeq <<
'\t' << towerStatus <<
'\t' << highTowerStatus <<
'\t' << patchSumStatus <<
'\t' << pedestal <<
'\t' << triggerPatch << endm;
834 TriggerPatchFromTowerId[towerId-1] = triggerPatch;
835 TowerStatus[towerId-1] = towerStatus;
836 ped12[towerId-1] = pedestal;
837 if (towerStatus == 0) ++numMaskTow[triggerPatch];
839 else if (line.BeginsWith(
"TriggerPedestalShift")) {
840 sscanf(line,
"TriggerPedestalShift %lu",&pedTargetValue);
841 LOG_INFO <<
"TriggerPedestalShift " << pedTargetValue << endm;
843 else if (line.BeginsWith(
"triggerPatch")) {
844 int triggerPatch, crate, cratePatch, highTowerStatus, patchSumStatus, bitConvMode, LUTformula;
845 int p0, p1, p2, p3, p4, p5;
846 sscanf(line,
"triggerPatch %d %d %d %d %d %d %d %d %d %d %d %d %d",&triggerPatch,&crate,&cratePatch,&highTowerStatus,&patchSumStatus,&bitConvMode,&LUTformula,&p0,&p1,&p2,&p3,&p4,&p5);
847 LOG_INFO <<
"triggerPatch " << triggerPatch <<
'\t' << crate <<
'\t' << cratePatch <<
'\t' << highTowerStatus <<
'\t' << patchSumStatus <<
'\t' << bitConvMode <<
'\t' << LUTformula <<
'\t' << p0 <<
'\t' << p1 <<
'\t' << p2 <<
'\t' << p3 <<
'\t' << p4 <<
'\t' << p5 << endm;
848 TriggerPatchFromCrate[crate-1][cratePatch] = triggerPatch;
849 DSM_HTStatus[triggerPatch] = highTowerStatus;
850 DSM_TPStatus[triggerPatch] = patchSumStatus;
851 bitConvValue[triggerPatch] = bitConvMode;
852 formula[crate-1][cratePatch] = LUTformula;
853 LUTscale[crate-1][cratePatch] = p0;
854 LUTped [crate-1][cratePatch] = p1;
855 LUTsig [crate-1][cratePatch] = p2;
856 LUTpow [crate-1][cratePatch] = p3;
862 for (
int towerId = 1; towerId <= kNTowers; ++towerId) {
863 FEEped[towerId-1] = getFEEpedestal(ped12[towerId-1],pedTargetValue,debug);
867 void StBemcTriggerSimu::FEEini2009(
int runNumber)
869 const bool debug =
false;
872 LOG_INFO <<
"pedTargetValue\t" << pedTargetValue << endm;
873 fill(numMaskTow,numMaskTow+kNPatches,0);
874 LOG_INFO <<
"towerId\ttriggerPatch\tcrate\tseq\tstatus\tpedestal\tFEEpedestal\tgain" << endm;
875 for (
int towerId = 1; towerId <= kNTowers; ++towerId) {
876 int crate, seq, status, triggerPatch;
880 TriggerPatchFromTowerId[towerId-1] = triggerPatch;
888 mTables->
getPedestal(BTOW,towerId,0,ped12[towerId-1],rms);
891 assert(mConfig == kOnline || mConfig == kOffline);
895 TowerStatus[towerId-1] = status == 1 || status == 18;
897 if(runNumber > 14000000 && runNumber < 15000000) TowerStatus[towerId-1] = status == 1;
899 if (!TowerStatus[towerId-1]) ++numMaskTow[triggerPatch];
900 FEEped[towerId-1] = getFEEpedestal(ped12[towerId-1],pedTargetValue,debug);
901 mTables->
getCalib(BTOW,towerId,1,TowerGain[towerId-1]);
902 LOG_INFO << Form(
"%d\t%d\t%d\t%d\t%d\t%.2f\t%d\t%.5f",towerId,triggerPatch,crate,seq,TowerStatus[towerId-1],ped12[towerId-1],FEEped[towerId-1],TowerGain[towerId-1]) << endm;
911 swap(TriggerPatchFromTowerId[4054-1],TriggerPatchFromTowerId[4014-1]);
912 swap(TriggerPatchFromTowerId[4055-1],TriggerPatchFromTowerId[4015-1]);
913 swap(TriggerPatchFromTowerId[4056-1],TriggerPatchFromTowerId[4016-1]);
914 swap(TriggerPatchFromTowerId[4057-1],TriggerPatchFromTowerId[4017-1]);
919 if (runNumber >= 10154060 && runNumber <= 10180034) TowerStatus[1907-1] = 0;
922 if (runNumber >= 10141025 && runNumber <= 10155022) TowerStatus[1233-1] = 0;
925 if (runNumber >= 10136035 && runNumber <= 10136070) TowerStatus[4355-1] = 0;
928 if (runNumber >= 10078075 && runNumber <= 10103042) TowerStatus[1433-1] = 0;
931 LOG_INFO <<
"LUT pedestal will be calculated by LUTped = LUTped (from database) + NumberOfMaskedOutTowers. --zchang"<<endm;
932 LOG_INFO <<
"will set all trigger patch formula and bit conversion to 2 --zchang"<<endm;
934 LOG_INFO <<
"triggerPatch\tcrate\tseq\tHTsta\tTPsta\tbitConv\tformula\tLUTscale\tLUTped\tLUTsig\tLUTpow\tpar4\tpar5\tnumMaskTow" << endm;
935 for (
int crate = 1; crate <= kNCrates; ++crate) {
936 for (
int seq = 0; seq < kNSeq; ++seq) {
938 GetTriggerPatchFromCrate(crate,seq,triggerPatch);
939 TriggerPatchFromCrate[crate-1][seq] = triggerPatch;
948 LUTscale[crate-1][seq] = parameters[0];
949 LUTped [crate-1][seq] = parameters[1];
950 LUTsig [crate-1][seq] = parameters[2];
951 LUTpow [crate-1][seq] = parameters[3];
955 if(runNumber > 13000000 && runNumber < 15000000){
957 bitConvValue[triggerPatch] = 2;
958 formula[crate-1][seq] = 2;
959 LUTped[crate-1][seq] += numMaskTow[triggerPatch];
962 LOG_INFO << Form(
"%d\t%d\t%d\t%d\t%d\t%ld\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d",triggerPatch,crate,seq,DSM_HTStatus[triggerPatch],DSM_TPStatus[triggerPatch],bitConvValue[triggerPatch],formula[crate-1][seq],LUTscale[crate-1][seq],LUTped[crate-1][seq],LUTsig[crate-1][seq],LUTpow[crate-1][seq],parameters[4],parameters[5],numMaskTow[triggerPatch]) << endm;
971 fill(bitConvValue+90,bitConvValue+100,2);
974 DSM_TPStatus[277] = 0;
978 if (runNumber >= 10128030 && runNumber <= 10129011) {
979 bitConvValue[50] = 2;
980 bitConvValue[51] = 2;
981 bitConvValue[52] = 3;
982 bitConvValue[53] = 3;
983 bitConvValue[54] = 2;
984 bitConvValue[55] = 2;
985 bitConvValue[56] = 2;
986 bitConvValue[57] = 2;
987 bitConvValue[58] = 3;
988 bitConvValue[59] = 3;
1001 if (runNumber >= 10120032 && runNumber <= 10121053) {
1002 DSM_HTStatus[228] = 0;
1003 DSM_TPStatus[228] = 0;
1004 DSM_HTStatus[229] = 0;
1005 DSM_TPStatus[229] = 0;
1008 if (runNumber >= 10150051 && runNumber <= 10156058) {
1009 DSM_HTStatus[122] = 0;
1010 DSM_TPStatus[122] = 0;
1011 DSM_HTStatus[123] = 0;
1012 DSM_TPStatus[123] = 0;
1015 if (runNumber >= 10156086 && runNumber <= 10160017) {
1016 DSM_HTStatus[22] = 0;
1017 DSM_TPStatus[22] = 0;
1018 DSM_HTStatus[23] = 0;
1019 DSM_TPStatus[23] = 0;
1022 if (runNumber >= 10163048 && runNumber <= 10180034) {
1023 DSM_HTStatus[220] = 0;
1024 DSM_TPStatus[220] = 0;
1025 DSM_HTStatus[221] = 0;
1026 DSM_TPStatus[221] = 0;
1030 void StBemcTriggerSimu::FEEout2009()
1032 const bool debug =
false;
1036 LOG_WARN <<
"No StEmcCollection" << endm;
1042 LOG_WARN <<
"No StEmcDetector" << endm;
1049 for (
size_t m = 1; m <= det->numberOfModules(); ++m) {
1050 const StSPtrVecEmcRawHit& hits = det->module(m)->hits();
1051 nhits += hits.size();
1052 for (
size_t i = 0; i < hits.size(); ++i) {
1054 int towerId = hit->softId(BTOW);
1055 if (TowerStatus[towerId-1]) {
1056 int triggerPatch = TriggerPatchFromTowerId[towerId-1];
1058 simulateFEEaction(hit->adc(),FEEped[towerId-1],bitConvValue[triggerPatch],ht,pa,debug);
1059 HT6bit_adc_holder[towerId-1] = ht;
1060 if (ht > L0_HT_ADC[triggerPatch]) L0_HT_ADC[triggerPatch] = ht;
1061 L0_TP_ADC[triggerPatch] += pa;
1078 assert(nhits == kNTowers);
1081 for (
int crate = 1; crate <= kNCrates; ++crate) {
1082 for (
int seq = 0; seq < kNSeq; ++seq) {
1083 int triggerPatch = TriggerPatchFromCrate[crate-1][seq];
1084 if (!DSM_HTStatus[triggerPatch]) L0_HT_ADC[triggerPatch] = 0;
1085 if (!DSM_TPStatus[triggerPatch]) L0_TP_ADC[triggerPatch] = 0;
1088 simulateFEELUT(L0_TP_ADC[triggerPatch],formula[crate-1][seq],LUTscale[crate-1][seq],LUTped[crate-1][seq],LUTsig[crate-1][seq],LUTpow[crate-1][seq],0,0,numMaskTow[triggerPatch],pedTargetValue,lut,debug);
1089 L0_TP_ADC[triggerPatch] = TP6bit_adc_holder[triggerPatch] = lut;
1095 void StBemcTriggerSimu::simulateFEEfailure()
1097 switchon(L0_HT_ADC[166],1);
1098 switchon(L0_HT_ADC[199],0);
1099 switchoff(++L0_HT_ADC[277],0);
1100 switchoff(L0_HT_ADC[292],1);
1104 if (runNumber >= 10169005 && runNumber <= 10180034) switchon(L0_HT_ADC[196],2);
1105 if (runNumber >= 10156086 && runNumber <= 10158021) switchoff(++L0_HT_ADC[288],0);
1107 if (runNumber >= 10131039 && runNumber <= 10139018) switchoff(L0_TP_ADC[239],0);
1108 if (runNumber >= 10160069 && runNumber <= 10162040) switchoff(L0_TP_ADC[161],1);
1109 if (runNumber >= 10121092 && runNumber <= 10136031) switchon (L0_TP_ADC[137],0);
1110 if (runNumber >= 10156031 && runNumber <= 10180034) switchon (L0_TP_ADC[137],0);
1111 if (runNumber >= 10154060 && runNumber <= 10155022) switchon (L0_TP_ADC[13 ],0);
1113 if(runNumber >= 13077001 && runNumber <= 14000000){
1115 LOG_INFO<<Form(
"patch 75 trigger patch output set to %d", L0_TP_ADC[75])<<endm;
1122 void StBemcTriggerSimu::get2006_DSMLayer0() {
1131 placeholder=L0_HT_ADC[291];
1132 L0_HT_ADC[291]=L0_HT_ADC[294];
1133 L0_HT_ADC[294]=placeholder;
1134 placeholder=L0_HT_ADC[250];
1135 L0_HT_ADC[250]=L0_HT_ADC[251];
1136 L0_HT_ADC[251]=placeholder;
1137 placeholder=L0_HT_ADC[263];
1138 L0_HT_ADC[263]=L0_HT_ADC[267];
1139 L0_HT_ADC[267]=placeholder;
1141 placeholder=L0_TP_ADC[291];
1142 L0_TP_ADC[291]=L0_TP_ADC[294];
1143 L0_TP_ADC[294]=placeholder;
1144 placeholder=L0_TP_ADC[250];
1145 L0_TP_ADC[250]=L0_TP_ADC[251];
1146 L0_TP_ADC[251]=placeholder;
1147 placeholder=L0_TP_ADC[263];
1148 L0_TP_ADC[263]=L0_TP_ADC[267];
1149 L0_TP_ADC[267]=placeholder;
1153 int DSM_TP[kL0DsmInputs];
1154 for (
int i=0;i<kL0DsmModule;i++){
1162 DSM0_TP_SUM_J1[i]=0;
1163 DSM0_HT_Bit_J1[i]=0;
1164 DSM0_TP_Bit_J1[i]=0;
1165 DSM0_HTTP_Bit_J1[i]=0;
1167 DSM0_TP_SUM_J3[i]=0;
1168 DSM0_HT_Bit_J3[i]=0;
1169 DSM0_TP_Bit_J3[i]=0;
1170 DSM0_HTTP_Bit_J3[i]=0;
1173 for (
int j=0;j<kL0DsmInputs;j++){
1174 DSM0_HT_tp_Bit[j]=0;
1175 DSM0_TP_tp_Bit[j]=0;
1176 DSM0_HTTP_tp_Bit[j]=0;
1177 DSM0_HT_tp_Bit_J1[j]=0;
1178 DSM0_TP_tp_Bit_J1[j]=0;
1179 DSM0_HTTP_tp_Bit_J1[j]=0;
1180 DSM0_HT_tp_Bit_J3[j]=0;
1181 DSM0_TP_tp_Bit_J3[j]=0;
1182 DSM0_HTTP_tp_Bit_J3[j]=0;
1192 if (mHeadMaker->GetDataSet(
"MuDst")) {
1194 for (
int triggerPatch = 0; triggerPatch < kNPatches; ++triggerPatch) {
1195 mBEMCLayer0HT6bit->Fill(triggerPatch,emcTrig.highTower(triggerPatch));
1196 mBEMCLayer0TP6bit->Fill(triggerPatch,emcTrig.patch(triggerPatch));
1197 mBEMCLayer0HT6bitDiff->Fill(triggerPatch,emcTrig.highTower(triggerPatch)-L0_HT_ADC[triggerPatch]);
1198 mBEMCLayer0TP6bitDiff->Fill(triggerPatch,emcTrig.patch(triggerPatch)-L0_TP_ADC[triggerPatch]);
1199 L0_HT_ADC[triggerPatch] = emcTrig.highTower(triggerPatch);
1200 L0_TP_ADC[triggerPatch] = emcTrig.patch(triggerPatch);
1207 for (
int j=0;j<kL0DsmInputs;j++){
1218 if ( L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,0)) DSM0_HT_tp_Bit[j]=0;
1219 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,1)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,0))) DSM0_HT_tp_Bit[j]=1;
1220 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,2)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,1))) DSM0_HT_tp_Bit[j]=2;
1221 if ( L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,2)) DSM0_HT_tp_Bit[j]=3;
1223 if ( L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,0)) DSM0_TP_tp_Bit[j]=0;
1224 if ((L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,1)) && (L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,0))) DSM0_TP_tp_Bit[j]=1;
1225 if ((L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,2)) && (L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,1))) DSM0_TP_tp_Bit[j]=2;
1226 if ( L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,2)) DSM0_TP_tp_Bit[j]=3;
1229 if (DSM0_TP_tp_Bit[j] >= DSM0_HT_tp_Bit[j]) DSM0_HTTP_tp_Bit[j]=DSM0_HT_tp_Bit[j];
1230 if (DSM0_HT_tp_Bit[j] >= DSM0_TP_tp_Bit[j]) DSM0_HTTP_tp_Bit[j]=DSM0_TP_tp_Bit[j];
1232 if (DSM0_HTTP_tp_Bit[j] > DSM0_HTTP_Bit[i]) DSM0_HTTP_Bit[i]=DSM0_HTTP_tp_Bit[j];
1235 DSM0_TP_SUM[i]+=L0_TP_ADC[tpid];
1237 if (DSM0_HT_Bit[i]< DSM0_HT_tp_Bit[j]) DSM0_HT_Bit[i]=DSM0_HT_tp_Bit[j];
1238 if (DSM0_TP_Bit[i]< DSM0_TP_tp_Bit[j]) DSM0_TP_Bit[i]=DSM0_TP_tp_Bit[j];
1239 if (DSM0_HTTP_Bit[i]< DSM0_HTTP_tp_Bit[j]) DSM0_HTTP_Bit[i]=DSM0_HTTP_tp_Bit[j];
1247 if ( L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,0)) DSM0_HT_tp_Bit_J3[j]=0;
1248 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,1)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,0))) DSM0_HT_tp_Bit_J3[j]=1;
1249 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,2)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,1))) DSM0_HT_tp_Bit_J3[j]=2;
1250 if ( L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,2)) DSM0_HT_tp_Bit_J3[j]=3;
1254 if ( L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,0)) DSM0_HT_tp_Bit_J1[j]=0;
1255 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,1)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,0))) DSM0_HT_tp_Bit_J1[j]=1;
1256 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,2)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,1))) DSM0_HT_tp_Bit_J1[j]=2;
1257 if ( L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,2)) DSM0_HT_tp_Bit_J1[j]=3;
1263 if ( L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,0)) DSM0_TP_tp_Bit_J3[j]=0;
1264 if ((L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,1)) && (L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,0))) DSM0_TP_tp_Bit_J3[j]=1;
1265 if ((L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,2)) && (L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,1))) DSM0_TP_tp_Bit_J3[j]=2;
1266 if ( L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,2)) DSM0_TP_tp_Bit_J3[j]=3;
1270 if ( L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,0)) DSM0_TP_tp_Bit_J1[j]=0;
1271 if ((L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,1)) && (L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,0))) DSM0_TP_tp_Bit_J1[j]=1;
1272 if ((L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,2)) && (L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,1))) DSM0_TP_tp_Bit_J1[j]=2;
1273 if ( L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,2)) DSM0_TP_tp_Bit_J1[j]=3;
1280 if (DSM0_TP_tp_Bit_J3[j] >= DSM0_HT_tp_Bit_J3[j]) DSM0_HTTP_tp_Bit_J3[j]=DSM0_HT_tp_Bit_J3[j];
1281 if (DSM0_HT_tp_Bit_J3[j] >= DSM0_TP_tp_Bit_J3[j]) DSM0_HTTP_tp_Bit_J3[j]=DSM0_TP_tp_Bit_J3[j];
1282 if (DSM0_HTTP_tp_Bit_J3[j] > DSM0_HTTP_Bit_J3[j]) DSM0_HTTP_Bit_J3[j]=DSM0_HTTP_tp_Bit_J3[j];
1286 if (DSM0_TP_tp_Bit_J1[j] >= DSM0_HT_tp_Bit_J1[j]) DSM0_HTTP_tp_Bit_J1[j]=DSM0_HT_tp_Bit_J1[j];
1287 if (DSM0_HT_tp_Bit_J1[j] >= DSM0_TP_tp_Bit_J1[j]) DSM0_HTTP_tp_Bit_J1[j]=DSM0_TP_tp_Bit_J1[j];
1288 if (DSM0_HTTP_tp_Bit_J1[j] > DSM0_HTTP_Bit_J1[j]) DSM0_HTTP_Bit_J1[j]=DSM0_HTTP_tp_Bit_J1[j];
1294 DSM0_TP_SUM_J3[i]+=L0_TP_ADC[tpid];
1296 DSM0_TP_SUM_J1[i]+=L0_TP_ADC[tpid];
1299 if (DSM0_HT_Bit_J1[i]< DSM0_HT_tp_Bit_J1[j]) DSM0_HT_Bit_J1[i]=DSM0_HT_tp_Bit_J1[j];
1300 if (DSM0_TP_Bit_J1[i]< DSM0_TP_tp_Bit_J1[j]) DSM0_TP_Bit_J1[i]=DSM0_TP_tp_Bit_J1[j];
1301 if (DSM0_HTTP_Bit_J1[i]< DSM0_HTTP_tp_Bit_J1[j]) DSM0_HTTP_Bit_J1[i]=DSM0_HTTP_tp_Bit_J1[j];
1302 if (DSM0_HT_Bit_J3[i]< DSM0_HT_tp_Bit_J3[j]) DSM0_HT_Bit_J3[i]=DSM0_HT_tp_Bit_J3[j];
1303 if (DSM0_TP_Bit_J3[i]< DSM0_TP_tp_Bit_J3[j]) DSM0_TP_Bit_J3[i]=DSM0_TP_tp_Bit_J3[j];
1304 if (DSM0_HTTP_Bit_J3[i]< DSM0_HTTP_tp_Bit_J3[j]) DSM0_HTTP_Bit_J3[i]=DSM0_HTTP_tp_Bit_J3[j];
1313 L0_16bit_Out[k++]=DSM0_TP_SUM[i]+(DSM0_HT_Bit[i]<<10)+(DSM0_TP_Bit[i]<<12)+(DSM0_HTTP_Bit[i]<<14);
1319 L0_16bit_Out[k++]=DSM0_TP_SUM_J3[i]+(DSM0_HT_Bit_J3[i]<<10)+(DSM0_TP_Bit_J3[i]<<12)+(DSM0_HTTP_Bit_J3[i]<<14);
1321 L0_16bit_Out[k++]=DSM0_TP_SUM_J1[i]+(DSM0_HT_Bit_J1[i]<<10)+(DSM0_TP_Bit_J1[i]<<12)+(DSM0_HTTP_Bit_J1[i]<<14);
1330 if (mHeadMaker->GetDataSet(
"MuDst")) {
1334 static const int dsm_read_map[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
1336 static const int TriggerBankToSimuMap[] = { 3, 4, 5, 0, 1, 2 };
1340 for (
int dsm = 0; dsm < kL1DsmModule; ++dsm) {
1342 for (
int ch = 0; ch < kL1DsmInputs; ++ch) {
1344 Int_t idx = dsm*8+dsm_read_map[ch];
1345 Int_t TrigBankOut = emcTrig.bemcLayer1(idx);
1346 Int_t TPSumout = (TrigBankOut & 0x3ff);
1347 Int_t TPSumbits = (L0_16bit_Out[TriggerBankToSimuMap[dsm]*6+ch] & 0x3ff);
1348 Int_t HTout = (TrigBankOut & 0xc00)/0x400;
1349 Int_t HTbits = (L0_16bit_Out[TriggerBankToSimuMap[dsm]*6+ch] & 0xc00)/0x400;
1350 Int_t TPout = (TrigBankOut & 0x3000)/0x1000;
1351 Int_t TPbits = (L0_16bit_Out[TriggerBankToSimuMap[dsm]*6+ch] & 0x3000)/0x1000;
1352 Int_t HTTPout = (TrigBankOut & 0xc000)/0x4000;
1353 Int_t HTTPbits = (L0_16bit_Out[TriggerBankToSimuMap[dsm]*6+ch] & 0xc000)/0x4000;
1354 int TPSumdiff = (TPSumbits)-(TPSumout);
1355 int HTdiff = (HTbits) - (HTout);
1356 int TPdiff = (TPbits) - (TPout);
1357 int HTTPdiff = (HTTPbits) - (HTTPout);
1358 mBEMCLayer1PatchSum->Fill(dsm*6+ch, TPSumout);
1359 mBEMCLayer1HTBits->Fill(dsm*6+ch, HTout);
1360 mBEMCLayer1TPBits->Fill(dsm*6+ch, TPout);
1361 mBEMCLayer1HTTPBits->Fill(dsm*6+ch, HTTPout);
1362 mBEMCLayer1PatchSumDiff->Fill(dsm*6+ch, TPSumdiff);
1363 mBEMCLayer1HTBitsDiff->Fill(dsm*6+ch, HTdiff);
1364 mBEMCLayer1TPBitsDiff->Fill(dsm*6+ch, TPdiff);
1365 mBEMCLayer1HTTPBitsDiff->Fill(dsm*6+ch, HTTPdiff);
1376 void StBemcTriggerSimu::get2006_DSMLayer1(){
1384 for (
int i=0;i<kL1DsmModule;i++){
1397 if (mHeadMaker->GetDataSet(
"MuDst")) {
1398 static const int dsm_read_map[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
1399 static const int TriggerBankToSimuMap[] = { 3, 4, 5, 0, 1, 2 };
1401 for (
int dsm = 0; dsm < 6; ++dsm) {
1402 int offset = TriggerBankToSimuMap[dsm]*5;
1403 DSM0_TP_SUM [offset+0] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[0]) & 0x3ff;
1404 DSM0_TP_SUM [offset+1] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[1]) & 0x3ff;
1405 DSM0_TP_SUM_J3[offset+2] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[2]) & 0x1ff;
1406 DSM0_TP_SUM_J1[offset+2] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[3]) & 0x1ff;
1407 DSM0_TP_SUM [offset+3] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[4]) & 0x3ff;
1408 DSM0_TP_SUM [offset+4] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[5]) & 0x3ff;
1415 DSM1_JP_ADC[0]=DSM0_TP_SUM[0]+DSM0_TP_SUM[1]+DSM0_TP_SUM_J3[2];
1416 DSM1_JP_ADC[1]=DSM0_TP_SUM[3]+DSM0_TP_SUM[4]+DSM0_TP_SUM_J1[2];
1417 DSM1_JP_ADC[2]=DSM0_TP_SUM[5]+DSM0_TP_SUM[6]+DSM0_TP_SUM_J3[7];
1418 DSM1_JP_ADC[3]=DSM0_TP_SUM[8]+DSM0_TP_SUM[9]+DSM0_TP_SUM_J1[7];
1419 DSM1_JP_ADC[4]=DSM0_TP_SUM[10]+DSM0_TP_SUM[11]+DSM0_TP_SUM_J3[12];
1420 DSM1_JP_ADC[5]=DSM0_TP_SUM[13]+DSM0_TP_SUM[14]+DSM0_TP_SUM_J1[12];
1423 DSM1_JP_ADC[6]=DSM0_TP_SUM[15]+DSM0_TP_SUM[16]+DSM0_TP_SUM_J1[17];
1424 DSM1_JP_ADC[7]=DSM0_TP_SUM[18]+DSM0_TP_SUM[19]+DSM0_TP_SUM_J3[17];
1425 DSM1_JP_ADC[8]=DSM0_TP_SUM[20]+DSM0_TP_SUM[21]+DSM0_TP_SUM_J1[22];
1426 DSM1_JP_ADC[9]=DSM0_TP_SUM[23]+DSM0_TP_SUM[24]+DSM0_TP_SUM_J3[22];
1427 DSM1_JP_ADC[10]=DSM0_TP_SUM[25]+DSM0_TP_SUM[26]+DSM0_TP_SUM_J1[27];
1428 DSM1_JP_ADC[11]=DSM0_TP_SUM[28]+DSM0_TP_SUM[29]+DSM0_TP_SUM_J3[27];
1430 for (
int hh=0;hh<12;hh++) JP_adc_holder[hh]=DSM1_JP_ADC[hh];
1433 for (
int i=0;i<kNJet;i++)
1435 DSM1_JP_jp_Bit[i]=0;
1436 if ( DSM1_JP_ADC[i] <= mDbThres->GetJP_DSM1_threshold(i,timestamp,0)) DSM1_JP_jp_Bit[i]=0;
1437 if ((DSM1_JP_ADC[i] <= mDbThres->GetJP_DSM1_threshold(i,timestamp,1)) && (DSM1_JP_ADC[i] > mDbThres->GetJP_DSM1_threshold(i,timestamp,0))) DSM1_JP_jp_Bit[i]=1;
1438 if ((DSM1_JP_ADC[i] <= mDbThres->GetJP_DSM1_threshold(i,timestamp,2)) && (DSM1_JP_ADC[i] > mDbThres->GetJP_DSM1_threshold(i,timestamp,1))) DSM1_JP_jp_Bit[i]=2;
1439 if ( DSM1_JP_ADC[i] > mDbThres->GetJP_DSM1_threshold(i,timestamp,2)) DSM1_JP_jp_Bit[i]=3;
1445 for (
int i=0;i<kNJet;i++){
1446 if (i < (kNJet/2)) mod = 0;
1448 DSM1_ETOT_ADC[mod]+=DSM1_JP_ADC[i];
1449 if ( DSM1_JP_Bit[i/2] < DSM1_JP_jp_Bit[i]) DSM1_JP_Bit[i/2]=DSM1_JP_jp_Bit[i];
1454 for (
int i=0; i<kL1DsmModule; i++){
1455 for (
int j=0; j<5; j++){
1458 if ( DSM1_HTTP_Bit[i] < DSM0_HTTP_Bit[k]) DSM1_HTTP_Bit[i]=DSM0_HTTP_Bit[k];
1459 if ( DSM1_HTTP_Bit[i] < DSM0_HTTP_Bit_J3[kk]) DSM1_HTTP_Bit[i]=DSM0_HTTP_Bit_J3[kk];
1460 if ( DSM1_HTTP_Bit[i] < DSM0_HTTP_Bit_J1[kk]) DSM1_HTTP_Bit[i]=DSM0_HTTP_Bit_J1[kk];
1461 if ( DSM1_TP_Bit[i] < DSM0_TP_Bit[k]) DSM1_TP_Bit[i]=DSM0_TP_Bit[k];
1462 if ( DSM1_TP_Bit[i] < DSM0_TP_Bit_J3[kk]) DSM1_TP_Bit[i]=DSM0_TP_Bit_J3[kk];
1463 if ( DSM1_TP_Bit[i] < DSM0_TP_Bit_J1[kk]) DSM1_TP_Bit[i]=DSM0_TP_Bit_J1[kk];
1466 if (DSM1_HTTP_Bit[i]>=2) DSM1_HTTP_Bit[i]=1;
1467 else if (DSM1_HTTP_Bit[i]<2) DSM1_HTTP_Bit[i]=0;
1469 if (DSM1_TP_Bit[i]>=2) DSM1_TP_Bit[i]=1;
1470 else if (DSM1_TP_Bit[i]<2) DSM1_TP_Bit[i]=0;
1475 if (DSM1_HTj0_Bit[0]<DSM0_HT_Bit[0]) DSM1_HTj0_Bit[0]=DSM0_HT_Bit[0];
1476 if (DSM1_HTj0_Bit[0]<DSM0_HT_Bit[1]) DSM1_HTj0_Bit[0]=DSM0_HT_Bit[1];
1477 if (DSM1_HTj0_Bit[0]<DSM0_HT_Bit_J3[2]) DSM1_HTj0_Bit[0]=DSM0_HT_Bit_J3[2];
1478 if (DSM1_HTj1_Bit[0]<DSM0_HT_Bit_J1[2]) DSM1_HTj1_Bit[0]=DSM0_HT_Bit_J1[2];
1479 if (DSM1_HTj1_Bit[0]<DSM0_HT_Bit[3]) DSM1_HTj1_Bit[0]=DSM0_HT_Bit[3];
1480 if (DSM1_HTj1_Bit[0]<DSM0_HT_Bit[4]) DSM1_HTj1_Bit[0]=DSM0_HT_Bit[4];
1482 if (DSM1_HTj0_Bit[1]<DSM0_HT_Bit[5]) DSM1_HTj0_Bit[1]=DSM0_HT_Bit[5];
1483 if (DSM1_HTj0_Bit[1]<DSM0_HT_Bit[6]) DSM1_HTj0_Bit[1]=DSM0_HT_Bit[6];
1484 if (DSM1_HTj0_Bit[1]<DSM0_HT_Bit_J3[7]) DSM1_HTj0_Bit[1]=DSM0_HT_Bit_J3[7];
1485 if (DSM1_HTj1_Bit[1]<DSM0_HT_Bit_J1[7]) DSM1_HTj1_Bit[1]=DSM0_HT_Bit_J1[7];
1486 if (DSM1_HTj1_Bit[1]<DSM0_HT_Bit[8]) DSM1_HTj1_Bit[1]=DSM0_HT_Bit[8];
1487 if (DSM1_HTj1_Bit[1]<DSM0_HT_Bit[9]) DSM1_HTj1_Bit[1]=DSM0_HT_Bit[9];
1489 if (DSM1_HTj0_Bit[2]<DSM0_HT_Bit[10]) DSM1_HTj0_Bit[2]=DSM0_HT_Bit[10];
1490 if (DSM1_HTj0_Bit[2]<DSM0_HT_Bit[11]) DSM1_HTj0_Bit[2]=DSM0_HT_Bit[11];
1491 if (DSM1_HTj0_Bit[2]<DSM0_HT_Bit_J3[12]) DSM1_HTj0_Bit[2]=DSM0_HT_Bit_J3[12];
1492 if (DSM1_HTj1_Bit[2]<DSM0_HT_Bit_J1[12]) DSM1_HTj1_Bit[2]=DSM0_HT_Bit_J1[12];
1493 if (DSM1_HTj1_Bit[2]<DSM0_HT_Bit[13]) DSM1_HTj1_Bit[2]=DSM0_HT_Bit[13];
1494 if (DSM1_HTj1_Bit[2]<DSM0_HT_Bit[14]) DSM1_HTj1_Bit[2]=DSM0_HT_Bit[14];
1497 if (DSM1_HTj0_Bit[3]<DSM0_HT_Bit[15]) DSM1_HTj0_Bit[3]=DSM0_HT_Bit[15];
1498 if (DSM1_HTj0_Bit[3]<DSM0_HT_Bit[16]) DSM1_HTj0_Bit[3]=DSM0_HT_Bit[16];
1499 if (DSM1_HTj0_Bit[3]<DSM0_HT_Bit_J1[17]) DSM1_HTj0_Bit[3]=DSM0_HT_Bit_J1[17];
1500 if (DSM1_HTj1_Bit[3]<DSM0_HT_Bit_J3[17]) DSM1_HTj1_Bit[3]=DSM0_HT_Bit_J3[17];
1501 if (DSM1_HTj1_Bit[3]<DSM0_HT_Bit[18]) DSM1_HTj1_Bit[3]=DSM0_HT_Bit[18];
1502 if (DSM1_HTj1_Bit[3]<DSM0_HT_Bit[19]) DSM1_HTj1_Bit[3]=DSM0_HT_Bit[19];
1504 if (DSM1_HTj0_Bit[4]<DSM0_HT_Bit[20]) DSM1_HTj0_Bit[4]=DSM0_HT_Bit[20];
1505 if (DSM1_HTj0_Bit[4]<DSM0_HT_Bit[21]) DSM1_HTj0_Bit[4]=DSM0_HT_Bit[21];
1506 if (DSM1_HTj0_Bit[4]<DSM0_HT_Bit_J1[22]) DSM1_HTj0_Bit[4]=DSM0_HT_Bit_J1[22];
1507 if (DSM1_HTj1_Bit[4]<DSM0_HT_Bit_J3[22]) DSM1_HTj1_Bit[4]=DSM0_HT_Bit_J3[22];
1508 if (DSM1_HTj1_Bit[4]<DSM0_HT_Bit[23]) DSM1_HTj1_Bit[4]=DSM0_HT_Bit[23];
1509 if (DSM1_HTj1_Bit[4]<DSM0_HT_Bit[24]) DSM1_HTj1_Bit[4]=DSM0_HT_Bit[24];
1511 if (DSM1_HTj0_Bit[5]<DSM0_HT_Bit[25]) DSM1_HTj0_Bit[5]=DSM0_HT_Bit[25];
1512 if (DSM1_HTj0_Bit[5]<DSM0_HT_Bit[26]) DSM1_HTj0_Bit[5]=DSM0_HT_Bit[26];
1513 if (DSM1_HTj0_Bit[5]<DSM0_HT_Bit_J1[27]) DSM1_HTj0_Bit[5]=DSM0_HT_Bit_J1[27];
1514 if (DSM1_HTj1_Bit[5]<DSM0_HT_Bit_J3[27]) DSM1_HTj1_Bit[5]=DSM0_HT_Bit_J3[27];
1515 if (DSM1_HTj1_Bit[5]<DSM0_HT_Bit[28]) DSM1_HTj1_Bit[5]=DSM0_HT_Bit[28];
1516 if (DSM1_HTj1_Bit[5]<DSM0_HT_Bit[29]) DSM1_HTj1_Bit[5]=DSM0_HT_Bit[29];
1523 for (
int i=0;i<kL1DsmModule;i++) {
1524 DSM1_ETOT_ADC[i]/=4;
1525 if (DSM1_ETOT_ADC[i]>31) DSM1_ETOT_ADC[i]=31;
1531 if (mHeadMaker->GetDataSet(
"MuDst")) {
1533 static const int dsm_read_map[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
1534 static const int TriggerBankToSimuMap[] = { 3, 4, 5, 0, 1, 2 };
1535 for (
int dsm = 0; dsm < kL2DsmModule; ++dsm) {
1536 for (
int ch = 0; ch < 6; ++ch) {
1537 int idx = dsm_read_map[ch];
1538 int TrigBankOut = emcTrig.emcLayer2(idx);
1539 int jetPatch = 2 * TriggerBankToSimuMap[ch];
1540 int sum = DSM1_JP_ADC[jetPatch] + DSM1_JP_ADC[jetPatch+1];
1541 sum = (sum >> 7) ? 31 : (sum >> 2 & 0x1f);
1542 int diff = (TrigBankOut & 0x1f) - (sum & 0x1f);
1543 mBEMCLayer2PatchSum->Fill(ch, TrigBankOut & 0x1f);
1544 mBEMCLayer2PatchSumDiff->Fill(ch, diff);
1545 diff = (TrigBankOut >> 7 & 0x1) - (DSM1_HTTP_Bit[TriggerBankToSimuMap[ch]]);
1546 mBEMCLayer2HTTPBits->Fill(ch, TrigBankOut >> 7 & 0x1);
1547 mBEMCLayer2HTTPBitsDiff->Fill(ch,diff);
1548 diff = (TrigBankOut >> 9 & 0x1) - (DSM1_TP_Bit[TriggerBankToSimuMap[ch]]);
1549 mBEMCLayer2TPBits->Fill(ch, TrigBankOut >> 9 & 0x1);
1550 mBEMCLayer2TPBitsDiff->Fill(ch,diff);
1551 diff = (TrigBankOut >> 10 & 0x3) - (DSM1_JP_Bit[TriggerBankToSimuMap[ch]]);
1552 mBEMCLayer2JPBits->Fill(ch, TrigBankOut >> 10 & 0x3);
1553 mBEMCLayer2JPBitsDiff->Fill(ch, diff);
1554 diff = (TrigBankOut >> 12 & 0x3) - (DSM1_HTj0_Bit[TriggerBankToSimuMap[ch]]);
1555 mBEMCLayer2HTj0Bits->Fill(ch, TrigBankOut >> 12 & 0x3);
1556 mBEMCLayer2HTj0BitsDiff->Fill(ch,diff);
1557 diff = (TrigBankOut >> 14 & 0x3) - (DSM1_HTj1_Bit[TriggerBankToSimuMap[ch]]);
1558 mBEMCLayer2HTj1Bits->Fill(ch, TrigBankOut >> 14 & 0x3);
1559 mBEMCLayer2HTj1BitsDiff->Fill(ch,diff);
1568 void StBemcTriggerSimu::get2006_DSMLayer2()
1576 Int_t DSM2_JP_Bit=0;
1577 Int_t DSM2_HT_Bit=0;
1580 Int_t DSM2_HTTP_Bit=0;
1581 Int_t DSM2_TP_Bit=0;
1584 for (
int dsm = 0; dsm < kL1DsmModule; ++dsm) {
1586 if (DSM2_JP_Bit<DSM1_JP_Bit[dsm]) DSM2_JP_Bit=DSM1_JP_Bit[dsm];
1587 if (DSM2_HTTP_Bit<DSM1_HTTP_Bit[dsm]) DSM2_HTTP_Bit=DSM1_HTTP_Bit[dsm];
1588 if (DSM2_HT_Bit<DSM1_HTj0_Bit[dsm]) DSM2_HT_Bit=DSM1_HTj0_Bit[dsm];
1589 if (DSM2_HT_Bit<DSM1_HTj1_Bit[dsm]) DSM2_HT_Bit=DSM1_HTj1_Bit[dsm];
1590 if (DSM2_TP_Bit<DSM1_TP_Bit[dsm]) DSM2_TP_Bit=DSM1_TP_Bit[dsm];
1594 if (DSM2_HT_Bit > 2){
1595 mFiredTriggers.push_back(127212);
1596 mFiredTriggers.push_back(137213);
1600 if (DSM2_HTTP_Bit==1) {
1601 mFiredTriggers.push_back(127611);
1602 mFiredTriggers.push_back(127821);
1603 mFiredTriggers.push_back(137821);
1604 mFiredTriggers.push_back(137822);
1605 mFiredTriggers.push_back(137611);
1606 mFiredTriggers.push_back(5);
1609 mFiredTriggers.push_back(117601);
1610 mFiredTriggers.push_back(117602);
1611 mFiredTriggers.push_back(137602);
1612 mFiredTriggers.push_back(137603);
1617 if (DSM2_JP_Bit >= 1) {
1618 mFiredTriggers.push_back(127501);
1619 mFiredTriggers.push_back(137501);
1620 mFiredTriggers.push_back(127622);
1621 mFiredTriggers.push_back(137622);
1624 if (DSM2_JP_Bit >= 2) {
1625 mFiredTriggers.push_back(127221);
1626 mFiredTriggers.push_back(137221);
1627 mFiredTriggers.push_back(137222);
1658 int barrel_east_ht_jpsi[6];
1660 barrel_east_ht_jpsi[0] = DSM1_HTj0_Bit[1] >= 1;
1661 barrel_east_ht_jpsi[1] = DSM1_HTj1_Bit[1] >= 1;
1662 barrel_east_ht_jpsi[2] = DSM1_HTj0_Bit[2] >= 1;
1663 barrel_east_ht_jpsi[3] = DSM1_HTj1_Bit[2] >= 1;
1664 barrel_east_ht_jpsi[4] = DSM1_HTj0_Bit[0] >= 1;
1665 barrel_east_ht_jpsi[5] = DSM1_HTj1_Bit[0] >= 1;
1667 int barrel_west_ht_jpsi[6];
1669 barrel_west_ht_jpsi[0] = DSM1_HTj0_Bit[4] >= 1;
1670 barrel_west_ht_jpsi[1] = DSM1_HTj1_Bit[4] >= 1;
1671 barrel_west_ht_jpsi[2] = DSM1_HTj0_Bit[5] >= 1;
1672 barrel_west_ht_jpsi[3] = DSM1_HTj1_Bit[5] >= 1;
1673 barrel_west_ht_jpsi[4] = DSM1_HTj0_Bit[3] >= 1;
1674 barrel_west_ht_jpsi[5] = DSM1_HTj1_Bit[3] >= 1;
1678 for (
int i = 0; i < 6; ++i) ht_jpsi[i] = barrel_east_ht_jpsi[i] || barrel_west_ht_jpsi[i];
1680 int jpsiTrigger = ((ht_jpsi[0] && (ht_jpsi[2] || ht_jpsi[3] || ht_jpsi[4])) ||
1681 (ht_jpsi[1] && (ht_jpsi[3] || ht_jpsi[4] || ht_jpsi[5])) ||
1682 (ht_jpsi[2] && (ht_jpsi[4] || ht_jpsi[5])) ||
1683 (ht_jpsi[3] && ht_jpsi[5]));
1687 mFiredTriggers.push_back(117705);
1688 mFiredTriggers.push_back(137705);
1692 const int phipos[] = { 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3 };
1693 vector<int> ht_jpsi_ids[6];
1695 for (
int towerId = 1; towerId <= kNTowers; ++towerId) {
1696 int triggerPatch, dsm;
1700 if (HT6bit_adc_holder[towerId-1] > mDbThres->GetHT_DSM0_threshold(dsm,timestamp,0)) {
1703 ht_jpsi_ids[phipos[jetPatch]].push_back(towerId);
1708 get2006_JpsiCandidates(ht_jpsi_ids[0],ht_jpsi_ids[2]);
1709 get2006_JpsiCandidates(ht_jpsi_ids[0],ht_jpsi_ids[3]);
1710 get2006_JpsiCandidates(ht_jpsi_ids[0],ht_jpsi_ids[4]);
1711 get2006_JpsiCandidates(ht_jpsi_ids[1],ht_jpsi_ids[3]);
1712 get2006_JpsiCandidates(ht_jpsi_ids[1],ht_jpsi_ids[4]);
1713 get2006_JpsiCandidates(ht_jpsi_ids[1],ht_jpsi_ids[5]);
1714 get2006_JpsiCandidates(ht_jpsi_ids[2],ht_jpsi_ids[4]);
1715 get2006_JpsiCandidates(ht_jpsi_ids[2],ht_jpsi_ids[5]);
1716 get2006_JpsiCandidates(ht_jpsi_ids[3],ht_jpsi_ids[5]);
1719 LOG_INFO <<
"nJpsiCandidates = " << mJpsiCandidates.size() << endm;
1721 for (
size_t i = 0; i < mJpsiCandidates.size(); ++i) {
1722 const pair<int,int>& towers = mJpsiCandidates[i];
1723 LOG_INFO << towers.first <<
" " << towers.second << endm;
1729 void StBemcTriggerSimu::get2006_JpsiCandidates(
const vector<int>& towerIds1,
const vector<int>& towerIds2)
1731 for (
size_t i = 0; i < towerIds1.size(); ++i)
1732 for (
size_t j = 0; j < towerIds2.size(); ++j)
1733 mJpsiCandidates.push_back(make_pair(towerIds1[i],towerIds2[j]));
1738 void StBemcTriggerSimu::get2007_DSMLayer0() {
1747 int DSM_TP[kL0DsmInputs];
1748 for (
int i=0;i<kL0DsmModule;i++){
1756 DSM0_TP_SUM_J1[i]=0;
1757 DSM0_HT_Bit_J1[i]=0;
1758 DSM0_TP_Bit_J1[i]=0;
1759 DSM0_HTTP_Bit_J1[i]=0;
1761 DSM0_TP_SUM_J3[i]=0;
1762 DSM0_HT_Bit_J3[i]=0;
1763 DSM0_TP_Bit_J3[i]=0;
1764 DSM0_HTTP_Bit_J3[i]=0;
1767 for (
int j=0;j<kL0DsmInputs;j++){
1768 DSM0_HT_tp_Bit[j]=0;
1769 DSM0_TP_tp_Bit[j]=0;
1770 DSM0_HTTP_tp_Bit[j]=0;
1771 DSM0_HT_tp_Bit_J1[j]=0;
1772 DSM0_TP_tp_Bit_J1[j]=0;
1773 DSM0_HTTP_tp_Bit_J1[j]=0;
1774 DSM0_HT_tp_Bit_J3[j]=0;
1775 DSM0_TP_tp_Bit_J3[j]=0;
1776 DSM0_HTTP_tp_Bit_J3[j]=0;
1786 if (mHeadMaker->GetDataSet(
"MuDst")) {
1788 for (
int triggerPatch = 0; triggerPatch < kNPatches; ++triggerPatch) {
1789 mBEMCLayer0HT6bit->Fill(triggerPatch,emcTrig.highTower(triggerPatch));
1790 mBEMCLayer0TP6bit->Fill(triggerPatch,emcTrig.patch(triggerPatch));
1791 mBEMCLayer0HT6bitDiff->Fill(triggerPatch,emcTrig.highTower(triggerPatch)-L0_HT_ADC[triggerPatch]);
1792 mBEMCLayer0TP6bitDiff->Fill(triggerPatch,emcTrig.patch(triggerPatch)-L0_TP_ADC[triggerPatch]);
1793 L0_HT_ADC[triggerPatch] = emcTrig.highTower(triggerPatch);
1794 L0_TP_ADC[triggerPatch] = emcTrig.patch(triggerPatch);
1801 for (
int j=0;j<kL0DsmInputs;j++){
1812 if ( L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,0)) DSM0_HT_tp_Bit[j]=0;
1813 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,1)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,0))) DSM0_HT_tp_Bit[j]=1;
1814 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,2)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,1))) DSM0_HT_tp_Bit[j]=2;
1815 if ( L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,2)) DSM0_HT_tp_Bit[j]=3;
1817 if ( L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,0)) DSM0_TP_tp_Bit[j]=0;
1818 if ((L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,1)) && (L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,0))) DSM0_TP_tp_Bit[j]=1;
1819 if ((L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,2)) && (L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,1))) DSM0_TP_tp_Bit[j]=2;
1820 if ( L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,2)) DSM0_TP_tp_Bit[j]=3;
1823 if (DSM0_TP_tp_Bit[j] >= DSM0_HT_tp_Bit[j]) DSM0_HTTP_tp_Bit[j]=DSM0_HT_tp_Bit[j];
1824 if (DSM0_HT_tp_Bit[j] >= DSM0_TP_tp_Bit[j]) DSM0_HTTP_tp_Bit[j]=DSM0_TP_tp_Bit[j];
1826 if (DSM0_HTTP_tp_Bit[j] > DSM0_HTTP_Bit[i]) DSM0_HTTP_Bit[i]=DSM0_HTTP_tp_Bit[j];
1829 DSM0_TP_SUM[i]+=L0_TP_ADC[tpid];
1831 if (DSM0_HT_Bit[i]< DSM0_HT_tp_Bit[j]) DSM0_HT_Bit[i]=DSM0_HT_tp_Bit[j];
1832 if (DSM0_TP_Bit[i]< DSM0_TP_tp_Bit[j]) DSM0_TP_Bit[i]=DSM0_TP_tp_Bit[j];
1833 if (DSM0_HTTP_Bit[i]< DSM0_HTTP_tp_Bit[j]) DSM0_HTTP_Bit[i]=DSM0_HTTP_tp_Bit[j];
1841 if ( L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,0)) DSM0_HT_tp_Bit_J3[j]=0;
1842 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,1)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,0))) DSM0_HT_tp_Bit_J3[j]=1;
1843 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,2)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,1))) DSM0_HT_tp_Bit_J3[j]=2;
1844 if ( L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,2)) DSM0_HT_tp_Bit_J3[j]=3;
1848 if ( L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,0)) DSM0_HT_tp_Bit_J1[j]=0;
1849 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,1)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,0))) DSM0_HT_tp_Bit_J1[j]=1;
1850 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,2)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,1))) DSM0_HT_tp_Bit_J1[j]=2;
1851 if ( L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,2)) DSM0_HT_tp_Bit_J1[j]=3;
1857 if ( L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,0)) DSM0_TP_tp_Bit_J3[j]=0;
1858 if ((L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,1)) && (L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,0))) DSM0_TP_tp_Bit_J3[j]=1;
1859 if ((L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,2)) && (L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,1))) DSM0_TP_tp_Bit_J3[j]=2;
1860 if ( L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,2)) DSM0_TP_tp_Bit_J3[j]=3;
1864 if ( L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,0)) DSM0_TP_tp_Bit_J1[j]=0;
1865 if ((L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,1)) && (L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,0))) DSM0_TP_tp_Bit_J1[j]=1;
1866 if ((L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,2)) && (L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,1))) DSM0_TP_tp_Bit_J1[j]=2;
1867 if ( L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,2)) DSM0_TP_tp_Bit_J1[j]=3;
1874 if (DSM0_TP_tp_Bit_J3[j] >= DSM0_HT_tp_Bit_J3[j]) DSM0_HTTP_tp_Bit_J3[j]=DSM0_HT_tp_Bit_J3[j];
1875 if (DSM0_HT_tp_Bit_J3[j] >= DSM0_TP_tp_Bit_J3[j]) DSM0_HTTP_tp_Bit_J3[j]=DSM0_TP_tp_Bit_J3[j];
1876 if (DSM0_HTTP_tp_Bit_J3[j] > DSM0_HTTP_Bit_J3[j]) DSM0_HTTP_Bit_J3[j]=DSM0_HTTP_tp_Bit_J3[j];
1880 if (DSM0_TP_tp_Bit_J1[j] >= DSM0_HT_tp_Bit_J1[j]) DSM0_HTTP_tp_Bit_J1[j]=DSM0_HT_tp_Bit_J1[j];
1881 if (DSM0_HT_tp_Bit_J1[j] >= DSM0_TP_tp_Bit_J1[j]) DSM0_HTTP_tp_Bit_J1[j]=DSM0_TP_tp_Bit_J1[j];
1882 if (DSM0_HTTP_tp_Bit_J1[j] > DSM0_HTTP_Bit_J1[j]) DSM0_HTTP_Bit_J1[j]=DSM0_HTTP_tp_Bit_J1[j];
1888 DSM0_TP_SUM_J3[i]+=L0_TP_ADC[tpid];
1890 DSM0_TP_SUM_J1[i]+=L0_TP_ADC[tpid];
1893 if (DSM0_HT_Bit_J1[i]< DSM0_HT_tp_Bit_J1[j]) DSM0_HT_Bit_J1[i]=DSM0_HT_tp_Bit_J1[j];
1894 if (DSM0_TP_Bit_J1[i]< DSM0_TP_tp_Bit_J1[j]) DSM0_TP_Bit_J1[i]=DSM0_TP_tp_Bit_J1[j];
1895 if (DSM0_HTTP_Bit_J1[i]< DSM0_HTTP_tp_Bit_J1[j]) DSM0_HTTP_Bit_J1[i]=DSM0_HTTP_tp_Bit_J1[j];
1896 if (DSM0_HT_Bit_J3[i]< DSM0_HT_tp_Bit_J3[j]) DSM0_HT_Bit_J3[i]=DSM0_HT_tp_Bit_J3[j];
1897 if (DSM0_TP_Bit_J3[i]< DSM0_TP_tp_Bit_J3[j]) DSM0_TP_Bit_J3[i]=DSM0_TP_tp_Bit_J3[j];
1898 if (DSM0_HTTP_Bit_J3[i]< DSM0_HTTP_tp_Bit_J3[j]) DSM0_HTTP_Bit_J3[i]=DSM0_HTTP_tp_Bit_J3[j];
1907 L0_16bit_Out[k++]=DSM0_TP_SUM[i]+(DSM0_HT_Bit[i]<<10)+(DSM0_TP_Bit[i]<<12)+(DSM0_HTTP_Bit[i]<<14);
1913 L0_16bit_Out[k++]=DSM0_TP_SUM_J3[i]+(DSM0_HT_Bit_J3[i]<<10)+(DSM0_TP_Bit_J3[i]<<12)+(DSM0_HTTP_Bit_J3[i]<<14);
1915 L0_16bit_Out[k++]=DSM0_TP_SUM_J1[i]+(DSM0_HT_Bit_J1[i]<<10)+(DSM0_TP_Bit_J1[i]<<12)+(DSM0_HTTP_Bit_J1[i]<<14);
1924 if (mHeadMaker->GetDataSet(
"MuDst")) {
1928 static const int dsm_read_map[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
1930 static const int TriggerBankToSimuMap[] = { 3, 4, 5, 0, 1, 2 };
1934 for (
int dsm = 0; dsm < kL1DsmModule; ++dsm) {
1936 for (
int ch = 0; ch < kL1DsmInputs; ++ch) {
1938 Int_t idx = dsm*8+dsm_read_map[ch];
1939 Int_t TrigBankOut = emcTrig.bemcLayer1(idx);
1940 Int_t TPSumout = (TrigBankOut & 0x3ff);
1941 Int_t TPSumbits = (L0_16bit_Out[TriggerBankToSimuMap[dsm]*6+ch] & 0x3ff);
1942 Int_t HTout = (TrigBankOut & 0xc00)/0x400;
1943 Int_t HTbits = (L0_16bit_Out[TriggerBankToSimuMap[dsm]*6+ch] & 0xc00)/0x400;
1944 Int_t TPout = (TrigBankOut & 0x3000)/0x1000;
1945 Int_t TPbits = (L0_16bit_Out[TriggerBankToSimuMap[dsm]*6+ch] & 0x3000)/0x1000;
1946 Int_t HTTPout = (TrigBankOut & 0xc000)/0x4000;
1947 Int_t HTTPbits = (L0_16bit_Out[TriggerBankToSimuMap[dsm]*6+ch] & 0xc000)/0x4000;
1948 int TPSumdiff = (TPSumbits)-(TPSumout);
1949 int HTdiff = (HTbits) - (HTout);
1950 int TPdiff = (TPbits) - (TPout);
1951 int HTTPdiff = (HTTPbits) - (HTTPout);
1952 mBEMCLayer1PatchSum->Fill(dsm*6+ch, TPSumout);
1953 mBEMCLayer1HTBits->Fill(dsm*6+ch, HTout);
1954 mBEMCLayer1TPBits->Fill(dsm*6+ch, TPout);
1955 mBEMCLayer1HTTPBits->Fill(dsm*6+ch, HTTPout);
1956 mBEMCLayer1PatchSumDiff->Fill(dsm*6+ch, TPSumdiff);
1957 mBEMCLayer1HTBitsDiff->Fill(dsm*6+ch, HTdiff);
1958 mBEMCLayer1TPBitsDiff->Fill(dsm*6+ch, TPdiff);
1959 mBEMCLayer1HTTPBitsDiff->Fill(dsm*6+ch, HTTPdiff);
1971 void StBemcTriggerSimu::get2007_DSMLayer1(){
1979 for (
int i=0;i<kL1DsmModule;i++){
1992 if (mHeadMaker->GetDataSet(
"MuDst")) {
1993 static const int dsm_read_map[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
1994 static const int TriggerBankToSimuMap[] = { 3, 4, 5, 0, 1, 2 };
1996 for (
int dsm = 0; dsm < 6; ++dsm) {
1997 int offset = TriggerBankToSimuMap[dsm]*5;
1998 DSM0_TP_SUM [offset+0] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[0]) & 0x3ff;
1999 DSM0_TP_SUM [offset+1] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[1]) & 0x3ff;
2000 DSM0_TP_SUM_J3[offset+2] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[2]) & 0x1ff;
2001 DSM0_TP_SUM_J1[offset+2] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[3]) & 0x1ff;
2002 DSM0_TP_SUM [offset+3] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[4]) & 0x3ff;
2003 DSM0_TP_SUM [offset+4] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[5]) & 0x3ff;
2010 DSM1_JP_ADC[0]=DSM0_TP_SUM[0]+DSM0_TP_SUM[1]+DSM0_TP_SUM_J3[2];
2011 DSM1_JP_ADC[1]=DSM0_TP_SUM[3]+DSM0_TP_SUM[4]+DSM0_TP_SUM_J1[2];
2012 DSM1_JP_ADC[2]=DSM0_TP_SUM[5]+DSM0_TP_SUM[6]+DSM0_TP_SUM_J3[7];
2013 DSM1_JP_ADC[3]=DSM0_TP_SUM[8]+DSM0_TP_SUM[9]+DSM0_TP_SUM_J1[7];
2014 DSM1_JP_ADC[4]=DSM0_TP_SUM[10]+DSM0_TP_SUM[11]+DSM0_TP_SUM_J3[12];
2015 DSM1_JP_ADC[5]=DSM0_TP_SUM[13]+DSM0_TP_SUM[14]+DSM0_TP_SUM_J1[12];
2018 DSM1_JP_ADC[6]=DSM0_TP_SUM[15]+DSM0_TP_SUM[16]+DSM0_TP_SUM_J1[17];
2019 DSM1_JP_ADC[7]=DSM0_TP_SUM[18]+DSM0_TP_SUM[19]+DSM0_TP_SUM_J3[17];
2020 DSM1_JP_ADC[8]=DSM0_TP_SUM[20]+DSM0_TP_SUM[21]+DSM0_TP_SUM_J1[22];
2021 DSM1_JP_ADC[9]=DSM0_TP_SUM[23]+DSM0_TP_SUM[24]+DSM0_TP_SUM_J3[22];
2022 DSM1_JP_ADC[10]=DSM0_TP_SUM[25]+DSM0_TP_SUM[26]+DSM0_TP_SUM_J1[27];
2023 DSM1_JP_ADC[11]=DSM0_TP_SUM[28]+DSM0_TP_SUM[29]+DSM0_TP_SUM_J3[27];
2025 for (
int hh=0;hh<12;hh++) JP_adc_holder[hh]=DSM1_JP_ADC[hh];
2028 for (
int i=0;i<kNJet;i++)
2030 DSM1_JP_jp_Bit[i]=0;
2031 if ( DSM1_JP_ADC[i] <= mDbThres->GetJP_DSM1_threshold(i,timestamp,0)) DSM1_JP_jp_Bit[i]=0;
2032 if ((DSM1_JP_ADC[i] <= mDbThres->GetJP_DSM1_threshold(i,timestamp,1)) && (DSM1_JP_ADC[i] > mDbThres->GetJP_DSM1_threshold(i,timestamp,0))) DSM1_JP_jp_Bit[i]=1;
2033 if ((DSM1_JP_ADC[i] <= mDbThres->GetJP_DSM1_threshold(i,timestamp,2)) && (DSM1_JP_ADC[i] > mDbThres->GetJP_DSM1_threshold(i,timestamp,1))) DSM1_JP_jp_Bit[i]=2;
2034 if ( DSM1_JP_ADC[i] > mDbThres->GetJP_DSM1_threshold(i,timestamp,2)) DSM1_JP_jp_Bit[i]=3;
2040 for (
int i=0;i<kNJet;i++){
2041 if (i < (kNJet/2)) mod = 0;
2043 DSM1_ETOT_ADC[mod]+=DSM1_JP_ADC[i];
2044 if ( DSM1_JP_Bit[i/2] < DSM1_JP_jp_Bit[i]) DSM1_JP_Bit[i/2]=DSM1_JP_jp_Bit[i];
2049 for (
int i=0; i<kL1DsmModule; i++){
2050 for (
int j=0; j<5; j++){
2053 if ( DSM1_HTTP_Bit[i] < DSM0_HTTP_Bit[k]) DSM1_HTTP_Bit[i]=DSM0_HTTP_Bit[k];
2054 if ( DSM1_HTTP_Bit[i] < DSM0_HTTP_Bit_J3[kk]) DSM1_HTTP_Bit[i]=DSM0_HTTP_Bit_J3[kk];
2055 if ( DSM1_HTTP_Bit[i] < DSM0_HTTP_Bit_J1[kk]) DSM1_HTTP_Bit[i]=DSM0_HTTP_Bit_J1[kk];
2056 if ( DSM1_TP_Bit[i] < DSM0_TP_Bit[k]) DSM1_TP_Bit[i]=DSM0_TP_Bit[k];
2057 if ( DSM1_TP_Bit[i] < DSM0_TP_Bit_J3[kk]) DSM1_TP_Bit[i]=DSM0_TP_Bit_J3[kk];
2058 if ( DSM1_TP_Bit[i] < DSM0_TP_Bit_J1[kk]) DSM1_TP_Bit[i]=DSM0_TP_Bit_J1[kk];
2061 if (DSM1_HTTP_Bit[i]>=2) DSM1_HTTP_Bit[i]=1;
2062 else if (DSM1_HTTP_Bit[i]<2) DSM1_HTTP_Bit[i]=0;
2064 if (DSM1_TP_Bit[i]>=2) DSM1_TP_Bit[i]=1;
2065 else if (DSM1_TP_Bit[i]<2) DSM1_TP_Bit[i]=0;
2070 if (DSM1_HTj0_Bit[0]<DSM0_HT_Bit[0]) DSM1_HTj0_Bit[0]=DSM0_HT_Bit[0];
2071 if (DSM1_HTj0_Bit[0]<DSM0_HT_Bit[1]) DSM1_HTj0_Bit[0]=DSM0_HT_Bit[1];
2072 if (DSM1_HTj0_Bit[0]<DSM0_HT_Bit_J3[2]) DSM1_HTj0_Bit[0]=DSM0_HT_Bit_J3[2];
2073 if (DSM1_HTj1_Bit[0]<DSM0_HT_Bit_J1[2]) DSM1_HTj1_Bit[0]=DSM0_HT_Bit_J1[2];
2074 if (DSM1_HTj1_Bit[0]<DSM0_HT_Bit[3]) DSM1_HTj1_Bit[0]=DSM0_HT_Bit[3];
2075 if (DSM1_HTj1_Bit[0]<DSM0_HT_Bit[4]) DSM1_HTj1_Bit[0]=DSM0_HT_Bit[4];
2077 if (DSM1_HTj0_Bit[1]<DSM0_HT_Bit[5]) DSM1_HTj0_Bit[1]=DSM0_HT_Bit[5];
2078 if (DSM1_HTj0_Bit[1]<DSM0_HT_Bit[6]) DSM1_HTj0_Bit[1]=DSM0_HT_Bit[6];
2079 if (DSM1_HTj0_Bit[1]<DSM0_HT_Bit_J3[7]) DSM1_HTj0_Bit[1]=DSM0_HT_Bit_J3[7];
2080 if (DSM1_HTj1_Bit[1]<DSM0_HT_Bit_J1[7]) DSM1_HTj1_Bit[1]=DSM0_HT_Bit_J1[7];
2081 if (DSM1_HTj1_Bit[1]<DSM0_HT_Bit[8]) DSM1_HTj1_Bit[1]=DSM0_HT_Bit[8];
2082 if (DSM1_HTj1_Bit[1]<DSM0_HT_Bit[9]) DSM1_HTj1_Bit[1]=DSM0_HT_Bit[9];
2084 if (DSM1_HTj0_Bit[2]<DSM0_HT_Bit[10]) DSM1_HTj0_Bit[2]=DSM0_HT_Bit[10];
2085 if (DSM1_HTj0_Bit[2]<DSM0_HT_Bit[11]) DSM1_HTj0_Bit[2]=DSM0_HT_Bit[11];
2086 if (DSM1_HTj0_Bit[2]<DSM0_HT_Bit_J3[12]) DSM1_HTj0_Bit[2]=DSM0_HT_Bit_J3[12];
2087 if (DSM1_HTj1_Bit[2]<DSM0_HT_Bit_J1[12]) DSM1_HTj1_Bit[2]=DSM0_HT_Bit_J1[12];
2088 if (DSM1_HTj1_Bit[2]<DSM0_HT_Bit[13]) DSM1_HTj1_Bit[2]=DSM0_HT_Bit[13];
2089 if (DSM1_HTj1_Bit[2]<DSM0_HT_Bit[14]) DSM1_HTj1_Bit[2]=DSM0_HT_Bit[14];
2092 if (DSM1_HTj0_Bit[3]<DSM0_HT_Bit[15]) DSM1_HTj0_Bit[3]=DSM0_HT_Bit[15];
2093 if (DSM1_HTj0_Bit[3]<DSM0_HT_Bit[16]) DSM1_HTj0_Bit[3]=DSM0_HT_Bit[16];
2094 if (DSM1_HTj0_Bit[3]<DSM0_HT_Bit_J1[17]) DSM1_HTj0_Bit[3]=DSM0_HT_Bit_J1[17];
2095 if (DSM1_HTj1_Bit[3]<DSM0_HT_Bit_J3[17]) DSM1_HTj1_Bit[3]=DSM0_HT_Bit_J3[17];
2096 if (DSM1_HTj1_Bit[3]<DSM0_HT_Bit[18]) DSM1_HTj1_Bit[3]=DSM0_HT_Bit[18];
2097 if (DSM1_HTj1_Bit[3]<DSM0_HT_Bit[19]) DSM1_HTj1_Bit[3]=DSM0_HT_Bit[19];
2099 if (DSM1_HTj0_Bit[4]<DSM0_HT_Bit[20]) DSM1_HTj0_Bit[4]=DSM0_HT_Bit[20];
2100 if (DSM1_HTj0_Bit[4]<DSM0_HT_Bit[21]) DSM1_HTj0_Bit[4]=DSM0_HT_Bit[21];
2101 if (DSM1_HTj0_Bit[4]<DSM0_HT_Bit_J1[22]) DSM1_HTj0_Bit[4]=DSM0_HT_Bit_J1[22];
2102 if (DSM1_HTj1_Bit[4]<DSM0_HT_Bit_J3[22]) DSM1_HTj1_Bit[4]=DSM0_HT_Bit_J3[22];
2103 if (DSM1_HTj1_Bit[4]<DSM0_HT_Bit[23]) DSM1_HTj1_Bit[4]=DSM0_HT_Bit[23];
2104 if (DSM1_HTj1_Bit[4]<DSM0_HT_Bit[24]) DSM1_HTj1_Bit[4]=DSM0_HT_Bit[24];
2106 if (DSM1_HTj0_Bit[5]<DSM0_HT_Bit[25]) DSM1_HTj0_Bit[5]=DSM0_HT_Bit[25];
2107 if (DSM1_HTj0_Bit[5]<DSM0_HT_Bit[26]) DSM1_HTj0_Bit[5]=DSM0_HT_Bit[26];
2108 if (DSM1_HTj0_Bit[5]<DSM0_HT_Bit_J1[27]) DSM1_HTj0_Bit[5]=DSM0_HT_Bit_J1[27];
2109 if (DSM1_HTj1_Bit[5]<DSM0_HT_Bit_J3[27]) DSM1_HTj1_Bit[5]=DSM0_HT_Bit_J3[27];
2110 if (DSM1_HTj1_Bit[5]<DSM0_HT_Bit[28]) DSM1_HTj1_Bit[5]=DSM0_HT_Bit[28];
2111 if (DSM1_HTj1_Bit[5]<DSM0_HT_Bit[29]) DSM1_HTj1_Bit[5]=DSM0_HT_Bit[29];
2118 for (
int i=0;i<kL1DsmModule;i++) {
2119 DSM1_ETOT_ADC[i]/=4;
2120 if (DSM1_ETOT_ADC[i]>31) DSM1_ETOT_ADC[i]=31;
2126 if (mHeadMaker->GetDataSet(
"MuDst")) {
2128 static const int dsm_read_map[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
2129 static const int TriggerBankToSimuMap[] = { 3, 4, 5, 0, 1, 2 };
2130 for (
int dsm = 0; dsm < kL2DsmModule; ++dsm) {
2131 for (
int ch = 0; ch < 6; ++ch) {
2132 int idx = dsm_read_map[ch];
2133 int TrigBankOut = emcTrig.emcLayer2(idx);
2134 int jetPatch = 2 * TriggerBankToSimuMap[ch];
2135 int sum = DSM1_JP_ADC[jetPatch] + DSM1_JP_ADC[jetPatch+1];
2136 sum = (sum >> 7) ? 31 : (sum >> 2 & 0x1f);
2137 int diff = (TrigBankOut & 0x1f) - (sum & 0x1f);
2138 mBEMCLayer2PatchSum->Fill(ch, TrigBankOut & 0x1f);
2139 mBEMCLayer2PatchSumDiff->Fill(ch, diff);
2140 diff = (TrigBankOut >> 7 & 0x1) - (DSM1_HTTP_Bit[TriggerBankToSimuMap[ch]]);
2141 mBEMCLayer2HTTPBits->Fill(ch, TrigBankOut >> 7 & 0x1);
2142 mBEMCLayer2HTTPBitsDiff->Fill(ch,diff);
2143 diff = (TrigBankOut >> 9 & 0x1) - (DSM1_TP_Bit[TriggerBankToSimuMap[ch]]);
2144 mBEMCLayer2TPBits->Fill(ch, TrigBankOut >> 9 & 0x1);
2145 mBEMCLayer2TPBitsDiff->Fill(ch,diff);
2146 diff = (TrigBankOut >> 10 & 0x3) - (DSM1_JP_Bit[TriggerBankToSimuMap[ch]]);
2147 mBEMCLayer2JPBits->Fill(ch, TrigBankOut >> 10 & 0x3);
2148 mBEMCLayer2JPBitsDiff->Fill(ch, diff);
2149 diff = (TrigBankOut >> 12 & 0x3) - (DSM1_HTj0_Bit[TriggerBankToSimuMap[ch]]);
2150 mBEMCLayer2HTj0Bits->Fill(ch, TrigBankOut >> 12 & 0x3);
2151 mBEMCLayer2HTj0BitsDiff->Fill(ch,diff);
2152 diff = (TrigBankOut >> 14 & 0x3) - (DSM1_HTj1_Bit[TriggerBankToSimuMap[ch]]);
2153 mBEMCLayer2HTj1Bits->Fill(ch, TrigBankOut >> 14 & 0x3);
2154 mBEMCLayer2HTj1BitsDiff->Fill(ch,diff);
2163 void StBemcTriggerSimu::get2007_DSMLayer2()
2171 Int_t DSM2_JP_Bit=0;
2172 Int_t DSM2_HT_Bit=0;
2173 Int_t DSM2_HTTP_Bit=0;
2174 Int_t DSM2_TP_Bit=0;
2177 for (
int dsm = 0; dsm < kL1DsmModule; ++dsm) {
2179 if (DSM2_JP_Bit<DSM1_JP_Bit[dsm]) DSM2_JP_Bit=DSM1_JP_Bit[dsm];
2180 if (DSM2_HTTP_Bit<DSM1_HTTP_Bit[dsm]) DSM2_HTTP_Bit=DSM1_HTTP_Bit[dsm];
2181 if (DSM2_HT_Bit<DSM1_HTj0_Bit[dsm]) DSM2_HT_Bit=DSM1_HTj0_Bit[dsm];
2182 if (DSM2_HT_Bit<DSM1_HTj1_Bit[dsm]) DSM2_HT_Bit=DSM1_HTj1_Bit[dsm];
2183 if (DSM2_TP_Bit<DSM1_TP_Bit[dsm]) DSM2_TP_Bit=DSM1_TP_Bit[dsm];
2187 if (DSM2_HT_Bit > 1){
2188 mFiredTriggers.push_back(200601);
2189 mFiredTriggers.push_back(200602);
2190 mFiredTriggers.push_back(200213);
2191 mFiredTriggers.push_back(200214);
2195 if (DSM2_HT_Bit > 2){
2196 mFiredTriggers.push_back(200211);
2197 mFiredTriggers.push_back(200212);
2198 mFiredTriggers.push_back(200220);
2199 mFiredTriggers.push_back(200221);
2200 mFiredTriggers.push_back(200222);
2201 mFiredTriggers.push_back(200620);
2202 mFiredTriggers.push_back(200621);
2211 void StBemcTriggerSimu::get2008dAu_DSMLayer0() {
2221 int DSM_TP[kL0DsmInputs];
2222 for (
int i=0;i<kL0DsmModule;i++){
2227 DSM0_HT_Thr3_Bit[i]=0;
2228 DSM0_HT_Masked_Bit[i]=0;
2229 DSM0_HT_Bit_J1[i]=0;
2230 DSM0_HT_2Bit_J1[i]=0;
2231 DSM0_HT_Thr3_Bit_J1[i]=0;
2232 DSM0_HT_Masked_Bit_J1[i]=0;
2233 DSM0_HT_Bit_J3[i]=0;
2234 DSM0_HT_2Bit_J3[i]=0;
2235 DSM0_HT_Thr3_Bit_J3[i]=0;
2236 DSM0_HT_Masked_Bit_J3[i]=0;
2239 for (
int j=0;j<kL0DsmInputs;j++){
2240 DSM0_HT_tp_Bit[j]=0;
2241 DSM0_HT_tp_Bit_J1[j]=0;
2242 DSM0_HT_tp_Bit_J3[j]=0;
2252 if (mHeadMaker->GetDataSet(
"MuDst")) {
2254 for (
int triggerPatch = 0; triggerPatch < kNPatches; ++triggerPatch) {
2255 mBEMCLayer0HT6bit->Fill(triggerPatch,emcTrig.highTower(triggerPatch));
2256 mBEMCLayer0TP6bit->Fill(triggerPatch,emcTrig.patch(triggerPatch));
2257 mBEMCLayer0HT6bitDiff->Fill(triggerPatch,emcTrig.highTower(triggerPatch)-L0_HT_ADC[triggerPatch]);
2258 mBEMCLayer0TP6bitDiff->Fill(triggerPatch,emcTrig.patch(triggerPatch)-L0_TP_ADC[triggerPatch]);
2259 L0_HT_ADC[triggerPatch] = emcTrig.highTower(triggerPatch);
2260 L0_TP_ADC[triggerPatch] = emcTrig.patch(triggerPatch);
2267 for (
int j=0;j<kL0DsmInputs;j++){
2278 if ( L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,0)) DSM0_HT_tp_Bit[j]=0;
2279 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,1)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,0))) DSM0_HT_tp_Bit[j]=1;
2280 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,2)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,1))) DSM0_HT_tp_Bit[j]=2;
2281 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,3)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,2))) DSM0_HT_tp_Bit[j]=3;
2282 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,4)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,3))) DSM0_HT_tp_Bit[j]=4;
2283 if ( L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,4)) DSM0_HT_tp_Bit[j]=5;
2286 if (L0_HT_ADC[tpid]==63) DSM0_HT_tp_Bit[j]=0;
2289 if (DSM0_HT_Bit[i]< DSM0_HT_tp_Bit[j]) DSM0_HT_Bit[i]=DSM0_HT_tp_Bit[j];
2298 if ( L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,0)) DSM0_HT_tp_Bit_J3[j]=0;
2299 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,1)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,0))) DSM0_HT_tp_Bit_J3[j]=1;
2300 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,2)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,1))) DSM0_HT_tp_Bit_J3[j]=2;
2301 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,3)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,2))) DSM0_HT_tp_Bit_J3[j]=3;
2302 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,4)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,3))) DSM0_HT_tp_Bit_J3[j]=4;
2303 if ( L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,4)) DSM0_HT_tp_Bit_J3[j]=5;
2307 if ( L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,0)) DSM0_HT_tp_Bit_J1[j]=0;
2308 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,1)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,0))) DSM0_HT_tp_Bit_J1[j]=1;
2309 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,2)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,1))) DSM0_HT_tp_Bit_J1[j]=2;
2310 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,3)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,2))) DSM0_HT_tp_Bit_J1[j]=3;
2311 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,4)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,3))) DSM0_HT_tp_Bit_J1[j]=4;
2312 if ( L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,4)) DSM0_HT_tp_Bit_J1[j]=5;
2316 if (L0_HT_ADC[tpid]==63) DSM0_HT_tp_Bit_J1[j]=0;
2317 if (L0_HT_ADC[tpid]==63) DSM0_HT_tp_Bit_J3[j]=0;
2320 if (DSM0_HT_Bit_J1[i]< DSM0_HT_tp_Bit_J1[j]) DSM0_HT_Bit_J1[i]=DSM0_HT_tp_Bit_J1[j];
2321 if (DSM0_HT_Bit_J3[i]< DSM0_HT_tp_Bit_J3[j]) DSM0_HT_Bit_J3[i]=DSM0_HT_tp_Bit_J3[j];
2327 DSM0_HT_2Bit[i]=DSM0_HT_Bit[i];
2328 DSM0_HT_2Bit_J1[i]=DSM0_HT_Bit_J1[i];
2329 DSM0_HT_2Bit_J3[i]=DSM0_HT_Bit_J3[i];
2330 if (DSM0_HT_Bit[i]>3) DSM0_HT_2Bit[i]=3;
2331 if (DSM0_HT_Bit_J1[i]>3) DSM0_HT_2Bit_J1[i]=3;
2332 if (DSM0_HT_Bit_J3[i]>3) DSM0_HT_2Bit_J3[i]=3;
2335 if (DSM0_HT_Bit[i]>=4) DSM0_HT_Thr3_Bit[i]=1;
2336 if (DSM0_HT_Bit_J1[i]>=4) DSM0_HT_Thr3_Bit_J1[i]=1;
2337 if (DSM0_HT_Bit_J3[i]>=4) DSM0_HT_Thr3_Bit_J3[i]=1;
2340 if (DSM0_HT_Bit[i]==5) DSM0_HT_Masked_Bit[i]=1;
2341 if (DSM0_HT_Bit_J1[i]==5) DSM0_HT_Masked_Bit_J1[i]=1;
2342 if (DSM0_HT_Bit_J3[i]==5) DSM0_HT_Masked_Bit_J3[i]=1;
2347 L0_16bit_Out[k++]=(DSM0_HT_2Bit[i]<<10)+(DSM0_HT_Thr3_Bit[i]<<12)+(DSM0_HT_Masked_Bit[i]<<13);
2352 L0_16bit_Out[k++]=(DSM0_HT_2Bit_J3[i]<<10)+(DSM0_HT_Thr3_Bit_J3[i]<<12)+(DSM0_HT_Masked_Bit_J3[i]<<13);
2353 L0_16bit_Out[k++]=(DSM0_HT_2Bit_J1[i]<<10)+(DSM0_HT_Thr3_Bit_J1[i]<<12)+(DSM0_HT_Masked_Bit_J1[i]<<13);
2361 if (mHeadMaker->GetDataSet(
"MuDst")) {
2365 static const int dsm_read_map[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
2367 static const int TriggerBankToSimuMap[] = { 3, 4, 5, 0, 1, 2 };
2371 for (
int dsm = 0; dsm < kL1DsmModule; ++dsm) {
2373 for (
int ch = 0; ch < kL1DsmInputs; ++ch) {
2375 Int_t idx = dsm*8+dsm_read_map[ch];
2376 Int_t TrigBankOut = emcTrig.bemcLayer1(idx);
2377 Int_t HTout = (TrigBankOut & 0xc00)/0x400;
2378 Int_t HTbits = (L0_16bit_Out[TriggerBankToSimuMap[dsm]*6+ch] & 0xc00)/0x400;
2379 Int_t HTthr3out = (TrigBankOut & 0x1000)/0x1000;
2380 Int_t HTthr3bit = (L0_16bit_Out[TriggerBankToSimuMap[dsm]*6+ch] & 0x1000)/0x1000;
2381 Int_t HTmaskout = (TrigBankOut & 0x2000)/0x2000;
2382 Int_t HTmaskbit = (L0_16bit_Out[TriggerBankToSimuMap[dsm]*6+ch] & 0x2000)/0x2000;
2383 int HTdiff = (HTbits) - (HTout);
2384 int HTthr3diff = (HTthr3out) - (HTthr3bit);
2385 int HTmaskdiff = (HTmaskout) - (HTmaskbit);
2386 mBEMCLayer1HTBits->Fill(dsm*6+ch, HTout);
2387 mBEMCLayer1HTthr3Bits->Fill(dsm*6+ch, HTthr3out);
2388 mBEMCLayer1HTmaskBits->Fill(dsm*6+ch, HTmaskout);
2389 mBEMCLayer1HTBitsDiff->Fill(dsm*6+ch, HTdiff);
2390 mBEMCLayer1HTthr3Diff->Fill(dsm*6+ch, HTthr3diff);
2391 mBEMCLayer1HTmaskDiff->Fill(dsm*6+ch, HTmaskdiff);
2403 void StBemcTriggerSimu::get2008dAu_DSMLayer1(){
2410 for (
int i=0;i<kL1DsmModule;i++){
2419 if (mHeadMaker->GetDataSet(
"MuDst")) {
2420 static const int dsm_read_map[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
2421 static const int TriggerBankToSimuMap[] = { 3, 4, 5, 0, 1, 2 };
2423 for (
int dsm = 0; dsm < 6; ++dsm) {
2424 int offset = TriggerBankToSimuMap[dsm]*5;
2425 DSM0_TP_SUM [offset+0] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[0]) & 0x3ff;
2426 DSM0_TP_SUM [offset+1] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[1]) & 0x3ff;
2427 DSM0_TP_SUM_J3[offset+2] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[2]) & 0x1ff;
2428 DSM0_TP_SUM_J1[offset+2] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[3]) & 0x1ff;
2429 DSM0_TP_SUM [offset+3] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[4]) & 0x3ff;
2430 DSM0_TP_SUM [offset+4] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[5]) & 0x3ff;
2437 if (DSM1_HTj0_Bit[0]<DSM0_HT_Bit[0]) DSM1_HTj0_Bit[0]=DSM0_HT_Bit[0];
2438 if (DSM1_HTj0_Bit[0]<DSM0_HT_Bit[1]) DSM1_HTj0_Bit[0]=DSM0_HT_Bit[1];
2439 if (DSM1_HTj0_Bit[0]<DSM0_HT_Bit_J3[2]) DSM1_HTj0_Bit[0]=DSM0_HT_Bit_J3[2];
2440 if (DSM1_HTj1_Bit[0]<DSM0_HT_Bit_J1[2]) DSM1_HTj1_Bit[0]=DSM0_HT_Bit_J1[2];
2441 if (DSM1_HTj1_Bit[0]<DSM0_HT_Bit[3]) DSM1_HTj1_Bit[0]=DSM0_HT_Bit[3];
2442 if (DSM1_HTj1_Bit[0]<DSM0_HT_Bit[4]) DSM1_HTj1_Bit[0]=DSM0_HT_Bit[4];
2444 if (DSM1_HTj0_Bit[1]<DSM0_HT_Bit[5]) DSM1_HTj0_Bit[1]=DSM0_HT_Bit[5];
2445 if (DSM1_HTj0_Bit[1]<DSM0_HT_Bit[6]) DSM1_HTj0_Bit[1]=DSM0_HT_Bit[6];
2446 if (DSM1_HTj0_Bit[1]<DSM0_HT_Bit_J3[7]) DSM1_HTj0_Bit[1]=DSM0_HT_Bit_J3[7];
2447 if (DSM1_HTj1_Bit[1]<DSM0_HT_Bit_J1[7]) DSM1_HTj1_Bit[1]=DSM0_HT_Bit_J1[7];
2448 if (DSM1_HTj1_Bit[1]<DSM0_HT_Bit[8]) DSM1_HTj1_Bit[1]=DSM0_HT_Bit[8];
2449 if (DSM1_HTj1_Bit[1]<DSM0_HT_Bit[9]) DSM1_HTj1_Bit[1]=DSM0_HT_Bit[9];
2451 if (DSM1_HTj0_Bit[2]<DSM0_HT_Bit[10]) DSM1_HTj0_Bit[2]=DSM0_HT_Bit[10];
2452 if (DSM1_HTj0_Bit[2]<DSM0_HT_Bit[11]) DSM1_HTj0_Bit[2]=DSM0_HT_Bit[11];
2453 if (DSM1_HTj0_Bit[2]<DSM0_HT_Bit_J3[12]) DSM1_HTj0_Bit[2]=DSM0_HT_Bit_J3[12];
2454 if (DSM1_HTj1_Bit[2]<DSM0_HT_Bit_J1[12]) DSM1_HTj1_Bit[2]=DSM0_HT_Bit_J1[12];
2455 if (DSM1_HTj1_Bit[2]<DSM0_HT_Bit[13]) DSM1_HTj1_Bit[2]=DSM0_HT_Bit[13];
2456 if (DSM1_HTj1_Bit[2]<DSM0_HT_Bit[14]) DSM1_HTj1_Bit[2]=DSM0_HT_Bit[14];
2459 if (DSM1_HTj0_Bit[3]<DSM0_HT_Bit[15]) DSM1_HTj0_Bit[3]=DSM0_HT_Bit[15];
2460 if (DSM1_HTj0_Bit[3]<DSM0_HT_Bit[16]) DSM1_HTj0_Bit[3]=DSM0_HT_Bit[16];
2461 if (DSM1_HTj0_Bit[3]<DSM0_HT_Bit_J1[17]) DSM1_HTj0_Bit[3]=DSM0_HT_Bit_J1[17];
2462 if (DSM1_HTj1_Bit[3]<DSM0_HT_Bit_J3[17]) DSM1_HTj1_Bit[3]=DSM0_HT_Bit_J3[17];
2463 if (DSM1_HTj1_Bit[3]<DSM0_HT_Bit[18]) DSM1_HTj1_Bit[3]=DSM0_HT_Bit[18];
2464 if (DSM1_HTj1_Bit[3]<DSM0_HT_Bit[19]) DSM1_HTj1_Bit[3]=DSM0_HT_Bit[19];
2466 if (DSM1_HTj0_Bit[4]<DSM0_HT_Bit[20]) DSM1_HTj0_Bit[4]=DSM0_HT_Bit[20];
2467 if (DSM1_HTj0_Bit[4]<DSM0_HT_Bit[21]) DSM1_HTj0_Bit[4]=DSM0_HT_Bit[21];
2468 if (DSM1_HTj0_Bit[4]<DSM0_HT_Bit_J1[22]) DSM1_HTj0_Bit[4]=DSM0_HT_Bit_J1[22];
2469 if (DSM1_HTj1_Bit[4]<DSM0_HT_Bit_J3[22]) DSM1_HTj1_Bit[4]=DSM0_HT_Bit_J3[22];
2470 if (DSM1_HTj1_Bit[4]<DSM0_HT_Bit[23]) DSM1_HTj1_Bit[4]=DSM0_HT_Bit[23];
2471 if (DSM1_HTj1_Bit[4]<DSM0_HT_Bit[24]) DSM1_HTj1_Bit[4]=DSM0_HT_Bit[24];
2473 if (DSM1_HTj0_Bit[5]<DSM0_HT_Bit[25]) DSM1_HTj0_Bit[5]=DSM0_HT_Bit[25];
2474 if (DSM1_HTj0_Bit[5]<DSM0_HT_Bit[26]) DSM1_HTj0_Bit[5]=DSM0_HT_Bit[26];
2475 if (DSM1_HTj0_Bit[5]<DSM0_HT_Bit_J1[27]) DSM1_HTj0_Bit[5]=DSM0_HT_Bit_J1[27];
2476 if (DSM1_HTj1_Bit[5]<DSM0_HT_Bit_J3[27]) DSM1_HTj1_Bit[5]=DSM0_HT_Bit_J3[27];
2477 if (DSM1_HTj1_Bit[5]<DSM0_HT_Bit[28]) DSM1_HTj1_Bit[5]=DSM0_HT_Bit[28];
2478 if (DSM1_HTj1_Bit[5]<DSM0_HT_Bit[29]) DSM1_HTj1_Bit[5]=DSM0_HT_Bit[29];
2483 if (mHeadMaker->GetDataSet(
"MuDst")) {
2485 static const int dsm_read_map[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
2486 static const int TriggerBankToSimuMap[] = { 3, 4, 5, 0, 1, 2 };
2487 for (
int dsm = 0; dsm < kL2DsmModule; ++dsm) {
2488 for (
int ch = 0; ch < 6; ++ch) {
2489 int idx = dsm_read_map[ch];
2490 int TrigBankOut = emcTrig.emcLayer2(idx);
2491 int jetPatch = 2 * TriggerBankToSimuMap[ch];
2492 int sum = DSM1_JP_ADC[jetPatch] + DSM1_JP_ADC[jetPatch+1];
2493 sum = (sum >> 7) ? 31 : (sum >> 2 & 0x1f);
2494 int diff = (TrigBankOut & 0x1f) - (sum & 0x1f);
2495 mBEMCLayer2PatchSum->Fill(ch, TrigBankOut & 0x1f);
2496 mBEMCLayer2PatchSumDiff->Fill(ch, diff);
2497 diff = (TrigBankOut >> 7 & 0x1) - (DSM1_HTTP_Bit[TriggerBankToSimuMap[ch]]);
2498 mBEMCLayer2HTTPBits->Fill(ch, TrigBankOut >> 7 & 0x1);
2499 mBEMCLayer2HTTPBitsDiff->Fill(ch,diff);
2500 diff = (TrigBankOut >> 9 & 0x1) - (DSM1_TP_Bit[TriggerBankToSimuMap[ch]]);
2501 mBEMCLayer2TPBits->Fill(ch, TrigBankOut >> 9 & 0x1);
2502 mBEMCLayer2TPBitsDiff->Fill(ch,diff);
2503 diff = (TrigBankOut >> 10 & 0x3) - (DSM1_JP_Bit[TriggerBankToSimuMap[ch]]);
2504 mBEMCLayer2JPBits->Fill(ch, TrigBankOut >> 10 & 0x3);
2505 mBEMCLayer2JPBitsDiff->Fill(ch, diff);
2506 diff = (TrigBankOut >> 12 & 0x3) - (DSM1_HTj0_Bit[TriggerBankToSimuMap[ch]]);
2507 mBEMCLayer2HTj0Bits->Fill(ch, TrigBankOut >> 12 & 0x3);
2508 mBEMCLayer2HTj0BitsDiff->Fill(ch,diff);
2509 diff = (TrigBankOut >> 14 & 0x3) - (DSM1_HTj1_Bit[TriggerBankToSimuMap[ch]]);
2510 mBEMCLayer2HTj1Bits->Fill(ch, TrigBankOut >> 14 & 0x3);
2511 mBEMCLayer2HTj1BitsDiff->Fill(ch,diff);
2522 void StBemcTriggerSimu::get2008dAu_DSMLayer2(){
2529 Int_t DSM2_HT_Bit=0;
2531 for (
int dsm = 0; dsm < kL1DsmModule; ++dsm) {
2532 if (DSM2_HT_Bit<DSM1_HTj0_Bit[dsm]) DSM2_HT_Bit=DSM1_HTj0_Bit[dsm];
2533 if (DSM2_HT_Bit<DSM1_HTj1_Bit[dsm]) DSM2_HT_Bit=DSM1_HTj1_Bit[dsm];
2537 if (DSM2_HT_Bit > 0){
2538 mFiredTriggers.push_back(210500);
2539 mFiredTriggers.push_back(210501);
2542 if (DSM2_HT_Bit > 1){
2543 mFiredTriggers.push_back(210510);
2544 mFiredTriggers.push_back(210511);
2547 if (DSM2_HT_Bit > 2){
2548 mFiredTriggers.push_back(210520);
2549 mFiredTriggers.push_back(210521);
2552 if (DSM2_HT_Bit > 4){
2553 mFiredTriggers.push_back(210541);
2561 void StBemcTriggerSimu::get2008pp_DSMLayer0() {
2570 int DSM_TP[kL0DsmInputs];
2571 for (
int i=0;i<kL0DsmModule;i++){
2575 DSM0_HT_Thr3_Bit[i]=0;
2580 DSM0_TP_SUM_J1[i]=0;
2581 DSM0_HT_Thr3_Bit_J1[i]=0;
2582 DSM0_HT_Bit_J1[i]=0;
2583 DSM0_TP_Bit_J1[i]=0;
2584 DSM0_HTTP_Bit_J1[i]=0;
2586 DSM0_TP_SUM_J3[i]=0;
2587 DSM0_HT_Thr3_Bit_J3[i]=0;
2588 DSM0_HT_Bit_J3[i]=0;
2589 DSM0_TP_Bit_J3[i]=0;
2590 DSM0_HTTP_Bit_J3[i]=0;
2594 for (
int j=0;j<kL0DsmInputs;j++){
2595 DSM0_HT_tp_Bit[j]=0;
2596 DSM0_HT_Thr3_tp_Bit[j]=0;
2597 DSM0_TP_tp_Bit[j]=0;
2598 DSM0_HTTP_tp_Bit[j]=0;
2599 DSM0_HT_tp_Bit_J1[j]=0;
2600 DSM0_HT_Thr3_tp_Bit_J1[j]=0;
2601 DSM0_TP_tp_Bit_J1[j]=0;
2602 DSM0_HTTP_tp_Bit_J1[j]=0;
2603 DSM0_HT_tp_Bit_J3[j]=0;
2604 DSM0_HT_Thr3_tp_Bit_J3[j]=0;
2605 DSM0_TP_tp_Bit_J3[j]=0;
2606 DSM0_HTTP_tp_Bit_J3[j]=0;
2616 if (mHeadMaker->GetDataSet(
"MuDst")) {
2618 for (
int triggerPatch = 0; triggerPatch < kNPatches; ++triggerPatch) {
2619 mBEMCLayer0HT6bit->Fill(triggerPatch,emcTrig.highTower(triggerPatch));
2620 mBEMCLayer0TP6bit->Fill(triggerPatch,emcTrig.patch(triggerPatch));
2621 mBEMCLayer0HT6bitDiff->Fill(triggerPatch,emcTrig.highTower(triggerPatch)-L0_HT_ADC[triggerPatch]);
2622 mBEMCLayer0TP6bitDiff->Fill(triggerPatch,emcTrig.patch(triggerPatch)-L0_TP_ADC[triggerPatch]);
2623 L0_HT_ADC[triggerPatch] = emcTrig.highTower(triggerPatch);
2624 L0_TP_ADC[triggerPatch] = emcTrig.patch(triggerPatch);
2631 for (
int j=0;j<kL0DsmInputs;j++){
2642 if ( L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,0)) DSM0_HT_tp_Bit[j]=0;
2643 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,1)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,0))) DSM0_HT_tp_Bit[j]=1;
2644 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,2)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,1))) DSM0_HT_tp_Bit[j]=2;
2645 if ((L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,2))) DSM0_HT_tp_Bit[j]=3;
2646 if ( L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,3)) DSM0_HT_Thr3_tp_Bit[j]=1;
2647 if ( L0_HT_ADC[tpid]==63 ) DSM0_HT_tp_Bit[j]=0;
2650 if ( L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,0)) DSM0_TP_tp_Bit[j]=0;
2651 if ( L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,0)) DSM0_TP_tp_Bit[j]=1;
2652 if ( L0_TP_ADC[tpid]==63 ) DSM0_TP_tp_Bit[j]=0;
2655 DSM0_TP_SUM[i]+=L0_TP_ADC[tpid];
2658 DSM0_HTTP_tp_Bit[j]=(DSM0_TP_tp_Bit[j]&&DSM0_HT_Thr3_tp_Bit[j]);
2660 if (DSM0_HT_Thr3_Bit[i]<DSM0_HT_Thr3_tp_Bit[j]) DSM0_HT_Thr3_Bit[i]=DSM0_HT_Thr3_tp_Bit[j];
2662 if (DSM0_HT_Bit[i]<DSM0_HT_tp_Bit[j]) DSM0_HT_Bit[i]=DSM0_HT_tp_Bit[j];
2664 if (DSM0_TP_Bit[i]<DSM0_TP_tp_Bit[j]) DSM0_TP_Bit[i]=DSM0_TP_tp_Bit[j];
2666 if (DSM0_HTTP_Bit[i]<DSM0_HTTP_tp_Bit[j]) DSM0_HTTP_Bit[i]=DSM0_HTTP_tp_Bit[j];
2674 if ( L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,0)) DSM0_HT_tp_Bit_J3[j]=0;
2675 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,1)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,0))) DSM0_HT_tp_Bit_J3[j]=1;
2676 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,2)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,1))) DSM0_HT_tp_Bit_J3[j]=2;
2677 if ((L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,2))) DSM0_HT_tp_Bit_J3[j]=3;
2678 if ( L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,3)) DSM0_HT_Thr3_tp_Bit_J3[j]=1;
2679 if ( L0_HT_ADC[tpid]==63 ) DSM0_HT_tp_Bit_J3[j]=0;
2683 if ( L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,0)) DSM0_HT_tp_Bit_J1[j]=0;
2684 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,1)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,0))) DSM0_HT_tp_Bit_J1[j]=1;
2685 if ((L0_HT_ADC[tpid] <= mDbThres->GetHT_DSM0_threshold(i,timestamp,2)) && (L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,1))) DSM0_HT_tp_Bit_J1[j]=2;
2686 if ((L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,2))) DSM0_HT_tp_Bit_J1[j]=3;
2687 if ( L0_HT_ADC[tpid] > mDbThres->GetHT_DSM0_threshold(i,timestamp,3)) DSM0_HT_Thr3_tp_Bit_J1[j]=1;
2688 if ( L0_HT_ADC[tpid]==63 ) DSM0_HT_tp_Bit_J1[j]=0;
2694 if ( L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,0)) DSM0_TP_tp_Bit_J3[j]=0;
2695 if ( L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,0)) DSM0_TP_tp_Bit_J3[j]=1;
2696 if ( L0_TP_ADC[tpid] == 63 ) DSM0_TP_tp_Bit_J3[j]=0;
2700 if ( L0_TP_ADC[tpid] <= mDbThres->GetTP_DSM0_threshold(i,timestamp,0)) DSM0_TP_tp_Bit_J1[j]=0;
2701 if ( L0_TP_ADC[tpid] > mDbThres->GetTP_DSM0_threshold(i,timestamp,0)) DSM0_TP_tp_Bit_J1[j]=1;
2702 if ( L0_TP_ADC[tpid] == 63 ) DSM0_TP_tp_Bit_J1[j]=0;
2707 DSM0_TP_SUM_J3[i]+=L0_TP_ADC[tpid];
2709 DSM0_TP_SUM_J1[i]+=L0_TP_ADC[tpid];
2715 DSM0_HTTP_tp_Bit_J3[j]=(DSM0_TP_tp_Bit_J3[j] && DSM0_HT_Thr3_tp_Bit_J3[j]);
2719 DSM0_HTTP_tp_Bit_J1[j]=(DSM0_TP_tp_Bit_J1[j] && DSM0_HT_Thr3_tp_Bit_J1[j]);
2723 if (DSM0_HT_Bit_J3[i]<DSM0_HT_tp_Bit_J3[j]) DSM0_HT_Bit_J3[i]=DSM0_HT_tp_Bit_J3[j];
2724 if (DSM0_TP_Bit_J3[i]<DSM0_TP_tp_Bit_J3[j]) DSM0_TP_Bit_J3[i]=DSM0_TP_tp_Bit_J3[j];
2725 if (DSM0_HTTP_Bit_J3[i]<DSM0_HTTP_tp_Bit_J3[j]) DSM0_HTTP_Bit_J3[i]=DSM0_HTTP_tp_Bit_J3[j];
2726 if (DSM0_HT_Thr3_Bit_J3[i]<DSM0_HT_Thr3_tp_Bit_J3[j]) DSM0_HT_Thr3_Bit_J3[i]=DSM0_HT_Thr3_tp_Bit_J3[j];
2728 if (DSM0_HT_Bit_J1[i]<DSM0_HT_tp_Bit_J1[j]) DSM0_HT_Bit_J1[i]=DSM0_HT_tp_Bit_J1[j];
2729 if (DSM0_TP_Bit_J1[i]<DSM0_TP_tp_Bit_J1[j]) DSM0_TP_Bit_J1[i]=DSM0_TP_tp_Bit_J1[j];
2730 if (DSM0_HTTP_Bit_J1[i]<DSM0_HTTP_tp_Bit_J1[j]) DSM0_HTTP_Bit_J1[i]=DSM0_HTTP_tp_Bit_J1[j];
2731 if (DSM0_HT_Thr3_Bit_J1[i]<DSM0_HT_Thr3_tp_Bit_J1[j]) DSM0_HT_Thr3_Bit_J1[i]=DSM0_HT_Thr3_tp_Bit_J1[j];
2740 L0_16bit_Out[k++]=DSM0_TP_SUM[i]+(DSM0_HT_Bit[i]<<10)+(DSM0_HT_Thr3_Bit[i]<<12)+(DSM0_TP_Bit[i]<<13)+(DSM0_HTTP_Bit[i]<<14);
2745 L0_16bit_Out[k++]=DSM0_TP_SUM_J3[i]+(DSM0_HT_Bit_J3[i]<<10)+(DSM0_HT_Thr3_Bit_J3[i]<<12)+(DSM0_TP_Bit_J3[i]<<13)+(DSM0_HTTP_Bit_J3[i]<<14);
2746 L0_16bit_Out[k++]=DSM0_TP_SUM_J1[i]+(DSM0_HT_Bit_J1[i]<<10)+(DSM0_HT_Thr3_Bit_J1[i]<<12)+(DSM0_TP_Bit_J1[i]<<13)+(DSM0_HTTP_Bit_J1[i]<<14);
2753 if (mHeadMaker->GetDataSet(
"MuDst")) {
2757 static const int dsm_read_map[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
2759 static const int TriggerBankToSimuMap[] = { 3, 4, 5, 0, 1, 2 };
2763 for (
int dsm = 0; dsm < kL1DsmModule; ++dsm) {
2765 for (
int ch = 0; ch < kL1DsmInputs; ++ch) {
2767 Int_t idx = dsm*8+dsm_read_map[ch];
2768 Int_t TrigBankOut = emcTrig.bemcLayer1(idx);
2770 Int_t TPSumout = (TrigBankOut & 0x3ff);
2771 Int_t TPSumbits = (L0_16bit_Out[TriggerBankToSimuMap[dsm]*6+ch] & 0x3ff);
2773 Int_t HTout = (TrigBankOut & 0xc00)/0x400;
2774 Int_t HTbits = (L0_16bit_Out[TriggerBankToSimuMap[dsm]*6+ch] & 0xc00)/0x400;
2776 Int_t HT3out = (TrigBankOut & 0x1000/0x800);
2777 Int_t HT3bits = (L0_16bit_Out[TriggerBankToSimuMap[dsm]*6+ch] & 0x1000/0x800);
2779 Int_t TPout = (TrigBankOut & 0x2000)/0x1000;
2780 Int_t TPbits = (L0_16bit_Out[TriggerBankToSimuMap[dsm]*6+ch] & 0x2000)/0x1000;
2782 Int_t HTTPout = (TrigBankOut & 0x4000)/0x2000;
2783 Int_t HTTPbits = (L0_16bit_Out[TriggerBankToSimuMap[dsm]*6+ch] & 0x4000)/0x2000;
2785 int TPSumdiff = (TPSumbits)-(TPSumout);
2786 int HTdiff = (HTbits) - (HTout);
2787 int HT3diff = (HT3bits) - (HT3out);
2788 int TPdiff = (TPbits) - (TPout);
2789 int HTTPdiff = (HTTPbits) - (HTTPout);
2790 mBEMCLayer1PatchSum->Fill(dsm*6+ch, TPSumout);
2791 mBEMCLayer1HTBits->Fill(dsm*6+ch, HTout);
2792 mBEMCLayer1HTthr3Bits->Fill(dsm*6+ch,HT3out);
2793 mBEMCLayer1TPBits->Fill(dsm*6+ch, TPout);
2794 mBEMCLayer1HTTPBits->Fill(dsm*6+ch, HTTPout);
2795 mBEMCLayer1PatchSumDiff->Fill(dsm*6+ch, TPSumdiff);
2796 mBEMCLayer1HTBitsDiff->Fill(dsm*6+ch, HTdiff);
2797 mBEMCLayer1HTthr3Diff->Fill(dsm*6+ch, HT3diff);
2798 mBEMCLayer1TPBitsDiff->Fill(dsm*6+ch, TPdiff);
2799 mBEMCLayer1HTTPBitsDiff->Fill(dsm*6+ch, HTTPdiff);
2810 void StBemcTriggerSimu::get2008pp_DSMLayer1(){
2818 for (
int i=0;i<kL1DsmModule;i++){
2832 if (mHeadMaker->GetDataSet(
"MuDst")) {
2833 static const int dsm_read_map[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
2834 static const int TriggerBankToSimuMap[] = { 3, 4, 5, 0, 1, 2 };
2836 for (
int dsm = 0; dsm < 6; ++dsm) {
2837 int offset = TriggerBankToSimuMap[dsm]*5;
2838 DSM0_TP_SUM [offset+0] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[0]) & 0x3ff;
2839 DSM0_TP_SUM [offset+1] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[1]) & 0x3ff;
2840 DSM0_TP_SUM_J3[offset+2] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[2]) & 0x1ff;
2841 DSM0_TP_SUM_J1[offset+2] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[3]) & 0x1ff;
2842 DSM0_TP_SUM [offset+3] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[4]) & 0x3ff;
2843 DSM0_TP_SUM [offset+4] = emcTrig.bemcLayer1(dsm*8+dsm_read_map[5]) & 0x3ff;
2850 DSM1_JP_ADC[0]=DSM0_TP_SUM[0]+DSM0_TP_SUM[1]+DSM0_TP_SUM_J3[2];
2851 DSM1_JP_ADC[1]=DSM0_TP_SUM[3]+DSM0_TP_SUM[4]+DSM0_TP_SUM_J1[2];
2852 DSM1_JP_ADC[2]=DSM0_TP_SUM[5]+DSM0_TP_SUM[6]+DSM0_TP_SUM_J3[7];
2853 DSM1_JP_ADC[3]=DSM0_TP_SUM[8]+DSM0_TP_SUM[9]+DSM0_TP_SUM_J1[7];
2854 DSM1_JP_ADC[4]=DSM0_TP_SUM[10]+DSM0_TP_SUM[11]+DSM0_TP_SUM_J3[12];
2855 DSM1_JP_ADC[5]=DSM0_TP_SUM[13]+DSM0_TP_SUM[14]+DSM0_TP_SUM_J1[12];
2858 DSM1_JP_ADC[6]=DSM0_TP_SUM[15]+DSM0_TP_SUM[16]+DSM0_TP_SUM_J1[17];
2859 DSM1_JP_ADC[7]=DSM0_TP_SUM[18]+DSM0_TP_SUM[19]+DSM0_TP_SUM_J3[17];
2860 DSM1_JP_ADC[8]=DSM0_TP_SUM[20]+DSM0_TP_SUM[21]+DSM0_TP_SUM_J1[22];
2861 DSM1_JP_ADC[9]=DSM0_TP_SUM[23]+DSM0_TP_SUM[24]+DSM0_TP_SUM_J3[22];
2862 DSM1_JP_ADC[10]=DSM0_TP_SUM[25]+DSM0_TP_SUM[26]+DSM0_TP_SUM_J1[27];
2863 DSM1_JP_ADC[11]=DSM0_TP_SUM[28]+DSM0_TP_SUM[29]+DSM0_TP_SUM_J3[27];
2865 for (
int hh=0;hh<12;hh++) JP_adc_holder[hh]=DSM1_JP_ADC[hh];
2868 for (
int i=0;i<kNJet;i++)
2870 DSM1_JP_jp_Bit[i]=0;
2871 if ( DSM1_JP_ADC[i] <= mDbThres->GetJP_DSM1_threshold(i,timestamp,0)) DSM1_JP_jp_Bit[i]=0;
2872 if ((DSM1_JP_ADC[i] <= mDbThres->GetJP_DSM1_threshold(i,timestamp,1)) && (DSM1_JP_ADC[i] > mDbThres->GetJP_DSM1_threshold(i,timestamp,0))) DSM1_JP_jp_Bit[i]=1;
2873 if ((DSM1_JP_ADC[i] <= mDbThres->GetJP_DSM1_threshold(i,timestamp,2)) && (DSM1_JP_ADC[i] > mDbThres->GetJP_DSM1_threshold(i,timestamp,1))) DSM1_JP_jp_Bit[i]=2;
2874 if ( DSM1_JP_ADC[i] > mDbThres->GetJP_DSM1_threshold(i,timestamp,2)) DSM1_JP_jp_Bit[i]=3;
2880 for (
int i=0;i<kNJet;i++){
2881 if (i < (kNJet/2)) mod = 0;
2883 DSM1_ETOT_ADC[mod]+=DSM1_JP_ADC[i];
2884 if ( DSM1_JP_Bit[i/2] < DSM1_JP_jp_Bit[i]) DSM1_JP_Bit[i/2]=DSM1_JP_jp_Bit[i];
2889 for (
int i=0; i<kL1DsmModule; i++){
2890 for (
int j=0; j<5; j++){
2894 if ( DSM1_HTTP_Bit[i] < DSM0_HTTP_Bit[k]) DSM1_HTTP_Bit[i]=DSM0_HTTP_Bit[k];
2895 if ( DSM1_HTTP_Bit[i] < DSM0_HTTP_Bit_J3[kk]) DSM1_HTTP_Bit[i]=DSM0_HTTP_Bit_J3[kk];
2896 if ( DSM1_HTTP_Bit[i] < DSM0_HTTP_Bit_J1[kk]) DSM1_HTTP_Bit[i]=DSM0_HTTP_Bit_J1[kk];
2898 if ( DSM1_TP_Bit[i] < DSM0_TP_Bit[k]) DSM1_TP_Bit[i]=DSM0_TP_Bit[k];
2899 if ( DSM1_TP_Bit[i] < DSM0_TP_Bit_J3[kk]) DSM1_TP_Bit[i]=DSM0_TP_Bit_J3[kk];
2900 if ( DSM1_TP_Bit[i] < DSM0_TP_Bit_J1[kk]) DSM1_TP_Bit[i]=DSM0_TP_Bit_J1[kk];
2902 if ( DSM1_HT3_Bit[i] < DSM0_HT_Thr3_Bit[k]) DSM1_HT3_Bit[i]=DSM0_HT_Thr3_Bit[k];
2903 if ( DSM1_HT3_Bit[i] < DSM0_HT_Thr3_Bit_J3[kk]) DSM1_HT3_Bit[i]=DSM0_HT_Thr3_Bit_J3[kk];
2904 if ( DSM1_HT3_Bit[i] < DSM0_HT_Thr3_Bit_J1[kk]) DSM1_HT3_Bit[i]=DSM0_HT_Thr3_Bit_J1[kk];
2911 if (DSM1_HTj0_Bit[0]<DSM0_HT_Bit[0]) DSM1_HTj0_Bit[0]=DSM0_HT_Bit[0];
2912 if (DSM1_HTj0_Bit[0]<DSM0_HT_Bit[1]) DSM1_HTj0_Bit[0]=DSM0_HT_Bit[1];
2913 if (DSM1_HTj0_Bit[0]<DSM0_HT_Bit_J3[2]) DSM1_HTj0_Bit[0]=DSM0_HT_Bit_J3[2];
2914 if (DSM1_HTj1_Bit[0]<DSM0_HT_Bit_J1[2]) DSM1_HTj1_Bit[0]=DSM0_HT_Bit_J1[2];
2915 if (DSM1_HTj1_Bit[0]<DSM0_HT_Bit[3]) DSM1_HTj1_Bit[0]=DSM0_HT_Bit[3];
2916 if (DSM1_HTj1_Bit[0]<DSM0_HT_Bit[4]) DSM1_HTj1_Bit[0]=DSM0_HT_Bit[4];
2918 if (DSM1_HTj0_Bit[1]<DSM0_HT_Bit[5]) DSM1_HTj0_Bit[1]=DSM0_HT_Bit[5];
2919 if (DSM1_HTj0_Bit[1]<DSM0_HT_Bit[6]) DSM1_HTj0_Bit[1]=DSM0_HT_Bit[6];
2920 if (DSM1_HTj0_Bit[1]<DSM0_HT_Bit_J3[7]) DSM1_HTj0_Bit[1]=DSM0_HT_Bit_J3[7];
2921 if (DSM1_HTj1_Bit[1]<DSM0_HT_Bit_J1[7]) DSM1_HTj1_Bit[1]=DSM0_HT_Bit_J1[7];
2922 if (DSM1_HTj1_Bit[1]<DSM0_HT_Bit[8]) DSM1_HTj1_Bit[1]=DSM0_HT_Bit[8];
2923 if (DSM1_HTj1_Bit[1]<DSM0_HT_Bit[9]) DSM1_HTj1_Bit[1]=DSM0_HT_Bit[9];
2925 if (DSM1_HTj0_Bit[2]<DSM0_HT_Bit[10]) DSM1_HTj0_Bit[2]=DSM0_HT_Bit[10];
2926 if (DSM1_HTj0_Bit[2]<DSM0_HT_Bit[11]) DSM1_HTj0_Bit[2]=DSM0_HT_Bit[11];
2927 if (DSM1_HTj0_Bit[2]<DSM0_HT_Bit_J3[12]) DSM1_HTj0_Bit[2]=DSM0_HT_Bit_J3[12];
2928 if (DSM1_HTj1_Bit[2]<DSM0_HT_Bit_J1[12]) DSM1_HTj1_Bit[2]=DSM0_HT_Bit_J1[12];
2929 if (DSM1_HTj1_Bit[2]<DSM0_HT_Bit[13]) DSM1_HTj1_Bit[2]=DSM0_HT_Bit[13];
2930 if (DSM1_HTj1_Bit[2]<DSM0_HT_Bit[14]) DSM1_HTj1_Bit[2]=DSM0_HT_Bit[14];
2933 if (DSM1_HTj0_Bit[3]<DSM0_HT_Bit[15]) DSM1_HTj0_Bit[3]=DSM0_HT_Bit[15];
2934 if (DSM1_HTj0_Bit[3]<DSM0_HT_Bit[16]) DSM1_HTj0_Bit[3]=DSM0_HT_Bit[16];
2935 if (DSM1_HTj0_Bit[3]<DSM0_HT_Bit_J1[17]) DSM1_HTj0_Bit[3]=DSM0_HT_Bit_J1[17];
2936 if (DSM1_HTj1_Bit[3]<DSM0_HT_Bit_J3[17]) DSM1_HTj1_Bit[3]=DSM0_HT_Bit_J3[17];
2937 if (DSM1_HTj1_Bit[3]<DSM0_HT_Bit[18]) DSM1_HTj1_Bit[3]=DSM0_HT_Bit[18];
2938 if (DSM1_HTj1_Bit[3]<DSM0_HT_Bit[19]) DSM1_HTj1_Bit[3]=DSM0_HT_Bit[19];
2940 if (DSM1_HTj0_Bit[4]<DSM0_HT_Bit[20]) DSM1_HTj0_Bit[4]=DSM0_HT_Bit[20];
2941 if (DSM1_HTj0_Bit[4]<DSM0_HT_Bit[21]) DSM1_HTj0_Bit[4]=DSM0_HT_Bit[21];
2942 if (DSM1_HTj0_Bit[4]<DSM0_HT_Bit_J1[22]) DSM1_HTj0_Bit[4]=DSM0_HT_Bit_J1[22];
2943 if (DSM1_HTj1_Bit[4]<DSM0_HT_Bit_J3[22]) DSM1_HTj1_Bit[4]=DSM0_HT_Bit_J3[22];
2944 if (DSM1_HTj1_Bit[4]<DSM0_HT_Bit[23]) DSM1_HTj1_Bit[4]=DSM0_HT_Bit[23];
2945 if (DSM1_HTj1_Bit[4]<DSM0_HT_Bit[24]) DSM1_HTj1_Bit[4]=DSM0_HT_Bit[24];
2947 if (DSM1_HTj0_Bit[5]<DSM0_HT_Bit[25]) DSM1_HTj0_Bit[5]=DSM0_HT_Bit[25];
2948 if (DSM1_HTj0_Bit[5]<DSM0_HT_Bit[26]) DSM1_HTj0_Bit[5]=DSM0_HT_Bit[26];
2949 if (DSM1_HTj0_Bit[5]<DSM0_HT_Bit_J1[27]) DSM1_HTj0_Bit[5]=DSM0_HT_Bit_J1[27];
2950 if (DSM1_HTj1_Bit[5]<DSM0_HT_Bit_J3[27]) DSM1_HTj1_Bit[5]=DSM0_HT_Bit_J3[27];
2951 if (DSM1_HTj1_Bit[5]<DSM0_HT_Bit[28]) DSM1_HTj1_Bit[5]=DSM0_HT_Bit[28];
2952 if (DSM1_HTj1_Bit[5]<DSM0_HT_Bit[29]) DSM1_HTj1_Bit[5]=DSM0_HT_Bit[29];
2956 for (
int i=0;i<kL1DsmModule;i++) {
2957 DSM1_ETOT_ADC[i]/=4;
2958 if (DSM1_ETOT_ADC[i]>31) DSM1_ETOT_ADC[i]=31;
2964 if (mHeadMaker->GetDataSet(
"MuDst")) {
2966 static const int dsm_read_map[] = { 3, 2, 1, 0, 7, 6, 5, 4 };
2967 static const int TriggerBankToSimuMap[] = { 3, 4, 5, 0, 1, 2 };
2968 for (
int dsm = 0; dsm < kL2DsmModule; ++dsm) {
2969 for (
int ch = 0; ch < 6; ++ch) {
2970 int idx = dsm_read_map[ch];
2971 int TrigBankOut = emcTrig.emcLayer2(idx);
2972 int jetPatch = 2 * TriggerBankToSimuMap[ch];
2973 int sum = DSM1_JP_ADC[jetPatch] + DSM1_JP_ADC[jetPatch+1];
2974 sum = (sum >> 7) ? 31 : (sum >> 2 & 0x1f);
2975 int diff = (TrigBankOut & 0x1f) - (sum & 0x1f);
2976 mBEMCLayer2PatchSum->Fill(ch, TrigBankOut & 0x1f);
2977 mBEMCLayer2PatchSumDiff->Fill(ch, diff);
2978 diff = (TrigBankOut >> 7 & 0x1) - (DSM1_HT3_Bit[TriggerBankToSimuMap[ch]]);
2979 mBEMCLayer2HT3Bits->Fill(ch, TrigBankOut >> 7 & 0x1);
2980 mBEMCLayer2HT3BitsDiff->Fill(ch,diff);
2981 diff = (TrigBankOut >> 8 & 0x1) - (DSM1_TP_Bit[TriggerBankToSimuMap[ch]]);
2982 mBEMCLayer2TPBits->Fill(ch, TrigBankOut >> 8 & 0x1);
2983 mBEMCLayer2TPBitsDiff->Fill(ch,diff);
2984 diff = (TrigBankOut >> 9 & 0x1) - (DSM1_HTTP_Bit[TriggerBankToSimuMap[ch]]);
2985 mBEMCLayer2HTTPBits->Fill(ch, TrigBankOut >> 9 & 0x1);
2986 mBEMCLayer2HTTPBitsDiff->Fill(ch,diff);
2987 diff = (TrigBankOut >> 10 & 0x3) - (DSM1_JP_Bit[TriggerBankToSimuMap[ch]]);
2988 mBEMCLayer2JPBits->Fill(ch, TrigBankOut >> 10 & 0x3);
2989 mBEMCLayer2JPBitsDiff->Fill(ch, diff);
2990 diff = (TrigBankOut >> 12 & 0x3) - (DSM1_HTj0_Bit[TriggerBankToSimuMap[ch]]);
2991 mBEMCLayer2HTj0Bits->Fill(ch, TrigBankOut >> 12 & 0x3);
2992 mBEMCLayer2HTj0BitsDiff->Fill(ch,diff);
2993 diff = (TrigBankOut >> 14 & 0x3) - (DSM1_HTj1_Bit[TriggerBankToSimuMap[ch]]);
2994 mBEMCLayer2HTj1Bits->Fill(ch, TrigBankOut >> 14 & 0x3);
2995 mBEMCLayer2HTj1BitsDiff->Fill(ch,diff);
3004 void StBemcTriggerSimu::get2008pp_DSMLayer2()
3012 Int_t DSM2_HT_Bit=0;
3014 for (
int dsm = 0; dsm < kL1DsmModule; ++dsm) {
3016 if (DSM2_HT_Bit<DSM1_HTj0_Bit[dsm]) DSM2_HT_Bit=DSM1_HTj0_Bit[dsm];
3017 if (DSM2_HT_Bit<DSM1_HTj1_Bit[dsm]) DSM2_HT_Bit=DSM1_HTj1_Bit[dsm];
3022 if (DSM2_HT_Bit > 0) mFiredTriggers.push_back(220500);
3024 if (DSM2_HT_Bit > 1) mFiredTriggers.push_back(220510);
3026 if (DSM2_HT_Bit > 2) mFiredTriggers.push_back(220520);
3033 void StBemcTriggerSimu::get2009_DSMLayer0()
3036 for (
int dsm = 0; dsm < kL0DsmModule; ++dsm) {
3037 TString line = (*mB001)[dsm].name +
": ";
3039 for (
int ch = 0 ; ch < kL0DsmInputs; ++ch) {
3040 int tpid = dsm*kL0DsmInputs+ch;
3041 (*mB001)[dsm].channels[ch] = L0_HT_ADC[tpid] | L0_TP_ADC[tpid] << 6;
3042 line += Form(
"%04x ",(*mB001)[dsm].channels[ch]);
3044 LOG_DEBUG << line << endm;
3053 void StBemcTriggerSimu::get2009_DSMLayer1()
3056 mB001->write(*mB101);
3059 for (
size_t dsm = 0; dsm < mB101->size(); ++dsm) {
3060 TString line = (*mB101)[dsm].name +
": ";
3061 for (
int ch = 0; ch < 8; ++ch) line += Form(
"%04x ",(*mB101)[dsm].channels[ch]);
3062 LOG_DEBUG << line << endm;
3072 const vector< pair<int,int> > StBemcTriggerSimu::getTowersAboveThreshold(
int trigId)
const {
3073 vector< pair<int,int> > towers;
3075 for (
int i=0;i<kNTowers;i++)
3083 if (trigId==210500 || trigId==210501 || trigId==220500) {
3084 if (HT6bit_adc_holder[i] > mDbThres->GetHT_DSM0_threshold(dsmid,timestamp,0)) {
3085 towers.push_back( make_pair(i+1,HT6bit_adc_holder[i]) );
3088 if (trigId==127611 || trigId==127821 || trigId==137821 || trigId==137822 || trigId==137611 || trigId==5 ||
3089 trigId==200601 || trigId==200602 || trigId==200213 || trigId==200214 || trigId==210510 || trigId==210511 ||
3091 if (HT6bit_adc_holder[i] > mDbThres->GetHT_DSM0_threshold(dsmid,timestamp,1)) {
3092 towers.push_back( make_pair(i+1,HT6bit_adc_holder[i]) );
3095 if (trigId==127212 || trigId==137213 || trigId==200211 || trigId==200212 || trigId==200220 || trigId==200221 ||
3096 trigId==200222 || trigId==200620 || trigId==200621 || trigId==210520 || trigId==210521 || trigId==220520) {
3097 if (HT6bit_adc_holder[i] > mDbThres->GetHT_DSM0_threshold(dsmid,timestamp,2)) {
3098 towers.push_back( make_pair(i+1,HT6bit_adc_holder[i]) );
3101 if (trigId==210541){
3102 if (HT6bit_adc_holder[i] > mDbThres->GetHT_DSM0_threshold(dsmid,timestamp,4)) {
3103 towers.push_back( make_pair(i+1,HT6bit_adc_holder[i]) );
3111 const vector< pair<int,int> > StBemcTriggerSimu::getTriggerPatchesAboveThreshold(
int trigId)
const {
3112 vector< pair<int,int> > patches;
3114 for (
int i=0;i<kNPatches;i++)
3119 if (trigId==127611 || trigId==127821 || trigId==137821 || trigId==137822 || trigId==137611 || trigId==5) {
3120 if (TP6bit_adc_holder[i] > mDbThres->GetTP_DSM0_threshold(dsmid,timestamp,1)) {
3122 patches.push_back( make_pair(i,TP6bit_adc_holder[i]) );
3130 const vector< pair<int,int> > StBemcTriggerSimu::getJetPatchesAboveThreshold(
int trigId)
const {
3131 vector< pair<int,int> > patches;
3133 for (
int i=0;i<kNJet;i++)
3135 if ((JP_adc_holder[i] <= mDbThres->GetJP_DSM1_threshold(i,timestamp,1)) && (JP_adc_holder[i] > mDbThres->GetJP_DSM1_threshold(i,timestamp,0))) {
3136 if (trigId==127501 || trigId==137501 || trigId==127622 || trigId==137622) {
3137 patches.push_back( make_pair(i,JP_adc_holder[i]) );
3140 if (JP_adc_holder[i] > mDbThres->GetJP_DSM1_threshold(i,timestamp,1)) {
3141 if (trigId==127221 || trigId==137221 || trigId==137222 || trigId==127501 || trigId==137501 || trigId==127622 || trigId==137622) {
3142 patches.push_back( make_pair(i,JP_adc_holder[i]) );
3150 int StBemcTriggerSimu::getTowerThreshold(
int trigId,
int dsmid)
const {
3153 if (trigId==127611 || trigId==127821 || trigId==137821 || trigId==137822 || trigId==137611 || trigId==5) {
3154 threshold = mDbThres->GetHT_DSM0_threshold(dsmid,timestamp,1);
3156 if (trigId==127212 || trigId==137213) {
3157 threshold = mDbThres->GetHT_DSM0_threshold(dsmid,timestamp,2);
3164 int StBemcTriggerSimu::getTriggerPatchThreshold(
int trigId,
int dsmid)
const {
3167 if (trigId==127611 || trigId==127821 || trigId==137821 || trigId==137822 || trigId==137611 || trigId==5) {
3168 threshold = mDbThres->GetTP_DSM0_threshold(dsmid,timestamp,1);
3174 int StBemcTriggerSimu::getJetPatchThreshold(
int trigId,
int dsmid)
const {
3177 if (trigId==127501 || trigId==137501 || trigId==127622 || trigId==137622) {
3178 threshold = mDbThres->GetJP_DSM1_threshold(dsmid,timestamp,0);
3180 if (trigId==127221 || trigId==137221 || trigId==137222) {
3181 threshold = mDbThres->GetJP_DSM1_threshold(dsmid,timestamp,1);
3188 int StBemcTriggerSimu::barrelJetPatchTh(
int i)
const {
return mB101->getRegister(i); }
3189 int StBemcTriggerSimu::barrelHighTowerTh(
int i)
const {
return mB001->getRegister(i); }
3190 int StBemcTriggerSimu::barrelJetPatchAdc(
int jp)
const {
return (*mB101)[jp%6].info[(jp/6+2)%3]; }
3191 int StBemcTriggerSimu::barrelPartialJetPatchAdc(
int jp)
const {
3192 return (*mB101)[jp%6].info[3]; }
3194 void StBemcTriggerSimu::fillStEmcTriggerDetector()
3196 if (mEvent && mEvent->triggerDetectorCollection()) {
3198 for (
int triggerPatch = 0; triggerPatch < kNPatches; ++triggerPatch) {
3199 emc.setHighTower(triggerPatch,getBEMC_FEE_HT_ADC()[triggerPatch]);
3200 emc.setPatch(triggerPatch,getBEMC_FEE_TP_ADC()[triggerPatch]);
3205 for (
int triggerPatch = 0; triggerPatch < kNPatches; ++triggerPatch) {
3206 emc.setHighTower(triggerPatch,getBEMC_FEE_HT_ADC()[triggerPatch]);
3207 emc.setPatch(triggerPatch,getBEMC_FEE_TP_ADC()[triggerPatch]);
int GetJetPatchFromTowerId(int softId, int &jetPatch) const
Get jet patch that contains software Id.
StBemcTables * getTables()
pointer to database tables
void getTriggerFormulaParameters(Int_t crate, Int_t index, Int_t *parameters) const
Return LUT formula parameters.
Bool_t isCorrupted()
Returns if BTOW is corrupted or not.
int status(int det, int softId, const char *option="") const
void getTriggerBitConv(Int_t crate, Int_t patch, Int_t &bit) const
Return 6 bits conversion mode.
void getTriggerTowerStatus(Int_t crate, Int_t index, Int_t &status) const
Return trigger single tower status.
StBemcData * getBemcData()
Return the StBemcData pointer.
StBemcRaw * getBemcRaw()
Return the StBemcRaw pointer.
StBemcTables * getTables()
Return the StBemcTable pointer.
void getPedestal(Int_t det, Int_t softId, Int_t cap, Float_t &ped, Float_t &rms) const
Return pedestal mean and rms.
void getTriggerPatchStatus(Int_t patch, Int_t &status) const
Return trigger patch status.
int GetTowerIdFromCrate(int crate, int sequence, int &softId) const
Get Software Id from Crate number and position in crate for towers.
int GetCrateAndSequenceFromTriggerPatch(int patchId, int &crate, int &sequence) const
returns the crate number and start point for a given trigger patch
void getTriggerFormulaTag(Int_t crate, Int_t index, Int_t &formula) const
Return LUT formula.
int GetCrateFromTowerId(int softId, int &crate, int &sequence) const
Get crate number and position in crate for Software Id.
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
void getCalib(Int_t det, Int_t softId, Int_t power, Float_t &calib) const
Return calibration constant.
int GetJetPatchAndSequenceFromTriggerPatch(int patchId, int &jetPatch, int &sequence) const
return the big jet patch and sequence number within it from the
void getTriggerHighTowerStatus(Int_t hightower, Int_t &status) const
Return trigger highTower status.
virtual Int_t GetRunNumber() const
Returns the current RunNumber.
void getTriggerPedestal(Int_t crate, Int_t index, Float_t &pedestal) const
Return tower pedestal loaded in trigger.
void getTriggerPedestalShift(Int_t &pedestalShift) const
Return target pedestal shift.
int GetTriggerPatchFromTowerId(int softId, int &patchId) const
Get trigger patch that contains software Id.
void getStatus(Int_t det, Int_t softId, Int_t &status, const char *option="") const
Return status.
StTriggerSimuDecision triggerDecision(int trigId)
like isTrigger(), but returns kDoNotCare if detector isn't a part of the given trigId ...
int GetDSMFromTriggerPatch(int patchId, int &dsmModule) const
dsmModule is set to the DSM module containing this trigger patch (0-299)
int GetTriggerPatchesFromDSM(int dsmModule, int *triggerPatches) const
triggerPatches is an int[10]; contents will be set to the TPs of the supplied DSM # ...