StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StJetSkimEventMaker.cxx
1 //StJetSkimEventMaker.cxx
2 //M.L. Miller (MIT)
3 //12/06
4 
5 //root
6 #include "TFile.h"
7 #include "TTree.h"
8 #include "TChain.h"
9 
10 //StEmc
11 #include "StEmcClusterCollection.h"
12 #include "StEmcPoint.h"
13 #include "StEmcUtil/geometry/StEmcGeom.h"
14 #include "StEmcUtil/others/emcDetectorName.h"
15 #include "StEmcADCtoEMaker/StBemcData.h"
16 #include "StEmcADCtoEMaker/StEmcADCtoEMaker.h"
17 #include "StEmcTriggerMaker/StEmcTriggerMaker.h"
18 
19 //St_base
20 #include "StDetectorDbMaker/StDetectorDbTriggerID.h"
21 
22 //StEvent
23 #include "StEvent.h"
24 
25 //
26 #include "St_db_Maker/St_db_Maker.h"
27 
28 //StMuDstMaker
29 #include "StMuDSTMaker/COMMON/StMuDst.h"
30 #include "StMuDSTMaker/COMMON/StMuEvent.h"
31 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
32 #include "StMuDSTMaker/COMMON/StMuPrimaryVertex.h"
33 #include "StMuDSTMaker/COMMON/StMuTrack.h"
34 
35 //StSpinDb
36 #include "StSpinPool/StSpinDbMaker/StSpinDbMaker.h"
37 
38 //StJetMaker
39 #include "StJetMaker/StJetSkimEventMaker.h"
40 
41 //StSpinPool
42 #include "StSpinPool/StJetSkimEvent/StJetSkimEvent.h"
43 
44 //StMCAsymMaker
45 #include "StSpinPool/StMCAsymMaker/StPythiaEvent.h"
46 #include "StSpinPool/StMCAsymMaker/StMCAsymMaker.h"
47 
48 //StTriggerUtilities
49 #include "StTriggerUtilities/StTriggerSimuMaker.h"
50 #include "StTriggerUtilities/StTriggerSimuResult.h"
51 #include "StTriggerUtilities/Bemc/StBemcTriggerSimu.h"
52 #include "StTriggerUtilities/Eemc/StEemcTriggerSimu.h"
53 #include "StTriggerUtilities/Emc/StEmcTriggerSimu.h"
54 
55 // StBtofHeader
56 #include "StBTofHeader.h"
57 #include "StEnumerations.h"
58 
59 void copyVertex(StMuPrimaryVertex& v, StJetSkimVert& sv);
60 
61 ClassImp(StJetSkimEventMaker)
62 
63  StJetSkimEventMaker::StJetSkimEventMaker(const Char_t *name, StMuDstMaker* uDstMaker, const char *outputName)
64 : StMaker(name), muDstMaker(uDstMaker), outName(outputName), mOutfile(0), mTree(0), mEvent(0), isRealData(true)
65 {
66 
67 }
68 
69 StJetSkimEventMaker::~StJetSkimEventMaker()
70 {
71 }
72 
73 Int_t StJetSkimEventMaker::Init()
74 {
75  //open file, book tree
76  assert(outName!=0);
77  printf("StJetSkimEventMaker::Init(): open file:\t%s\t for writing\n",outName);
78  mOutfile = new TFile(outName,"RECREATE");
79 
80  //here's the object that will be stored in the tree
81  mEvent = new StJetSkimEvent();
82 
83  //skipping TObject data members if possible can save significant space
84  StJetSkimTrig::Class()->IgnoreTObjectStreamer();
85  StPythiaEvent::Class()->IgnoreTObjectStreamer();
86 
87  //now we build the tree
88  mTree = new TTree("jetSkimTree","StJetSkimEvent Tree",99);
89 
90  //and add a branch for our event objects
91  mTree->Branch ("skimEventBranch", "StJetSkimEvent", &mEvent, 64000, 99);
92 
93  //if this is a simulation we'll pick up all the info we need right here
94  mcAsymMaker = dynamic_cast<StMCAsymMaker*>(GetMaker("MCAsym"));
95  if(mcAsymMaker != NULL) {
96  mEvent->setMcEvent(mcAsymMaker->pythiaEvent());
97  isRealData = false;
98  }
99 
100  return kStOk;
101 }
102 
103 Int_t StJetSkimEventMaker::InitRun(int runnumber) {
104  //store prescale and threshold info for all active triggers in this run in a TClonesArray
105  //TClonesArray has unique ID == runnumber and is stored in the UserInfo of the tree
106  //each event has a TRef pointing to its trigger header array
107 
108  TList *headerList = mTree->GetUserInfo();
109  bool insertHeader = true;
110 
111  //look for an existing trigger header array for this run
112  for(int i=0; i<headerList->GetEntries(); i++) {
113  TClonesArray *tmp = (TClonesArray*)headerList->At(i);
114  StJetSkimTrigHeader *h = (StJetSkimTrigHeader*)tmp->At(0);
115  if(h->runId == runnumber){
116  insertHeader = false;
117  mCurrentHeaderRef = tmp;
118  }
119  }
120 
121  if(insertHeader) {
122  TClonesArray *trigHeaderArray = new TClonesArray("StJetSkimTrigHeader",50);
124 
125  if(isRealData) {
126  StDetectorDbTriggerID *v = StDetectorDbTriggerID::instance();
127  map<int,float> prescaleMap = v->getTotalPrescales();
128  for(map<int,float>::const_iterator it=prescaleMap.begin(); it!=prescaleMap.end(); it++) {
129  header->runId = runnumber;
130  header->trigId = it->first;
131  header->prescale = it->second;
132  fillThresholds(*header);
133  new( (*trigHeaderArray)[trigHeaderArray->GetLast()+1] ) StJetSkimTrigHeader(*header);
134  }
135  }
136  else {
137  for(unsigned i=0; i<mSimuTrigIds.size(); i++) {
138  header->runId = runnumber;
139  header->trigId = mSimuTrigIds[i];
140  header->prescale = 1.0;
141  fillThresholds(*header);
142  new( (*trigHeaderArray)[trigHeaderArray->GetLast()+1] ) StJetSkimTrigHeader(*header);
143  }
144  }
145 
146  headerList->Add(trigHeaderArray);
147  mCurrentHeaderRef = headerList->Last();
148  }
149 
150  return StMaker::InitRun(runnumber);
151 }
152 
154 {
155  //clear info
156  mEvent->clear();
157 
158  //useful pointers
159  assert(muDstMaker);
160  StMuDst* muDst = muDstMaker->muDst();
161  assert(muDst);
162  StMuEvent* muEvent = muDst->event();
163  assert(muEvent);
164 
165  StBbcTriggerDetector* bbc = &(muEvent->bbcTriggerDetector());
166  assert(bbc);
167  StRunInfo* runInfo = &(muEvent->runInfo()); assert(runInfo);
168  assert(runInfo);
169  StDetectorDbTriggerID* v = StDetectorDbTriggerID::instance();
170  assert(v);
171 
172  //first cycle through triggers:
173  mEvent->setTrigHeaderArray(mCurrentHeaderRef);
174  if(isRealData) {
175  map<int,float> prescaleMap = v->getTotalPrescales();
176  StJetSkimTrig skimTrig;
177  for (map<int,float>::iterator it=prescaleMap.begin(); it!=prescaleMap.end(); ++it) {
178  skimTrig.setTrigId((*it).first);
179  if (muEvent->triggerIdCollection().nominal().isTrigger(skimTrig.trigId())) {
180  skimTrig.setDidFire(true);
181  }
182  else {
183  skimTrig.setDidFire(false);
184  }
185  fillTriggerSimulationInfo(skimTrig);
186  if(skimTrig.didFire() || (skimTrig.shouldFire() > 0)) mEvent->setTrig(skimTrig);
187  skimTrig.clear();
188  }
189 
190  St_db_Maker* mydb = (St_db_Maker*) StMaker::GetChain()->GetMaker("StarDb");
191  assert(mydb);
192  int theYear=mydb->GetDateTime().GetYear();
193 
194  if(theYear >= 2006)
195  {
196  if(muEvent->L2Result().GetSize() > 0) mEvent->setL2Result(muEvent->L2Result().GetArray());
197  }
198  }
199  else {
200  StJetSkimTrig skimTrig;
201  for(unsigned i=0; i<mSimuTrigIds.size(); i++) {
202  skimTrig.setTrigId(mSimuTrigIds[i]);
203  skimTrig.setDidFire(false);
204  fillTriggerSimulationInfo(skimTrig);
205  if(skimTrig.shouldFire() > 0) mEvent->setTrig(skimTrig);
206  skimTrig.clear();
207  }
208  }
209 
210  //basic event/run info
211  mEvent->setFill( runInfo->beamFillNumber(blue));
212  mEvent->setRunId( muEvent->runId() );
213  mEvent->setEventId( muEvent->eventId() );
214  TChain* chain = muDstMaker->chain();
215  assert(chain);
216  TObjString inputfile(chain->GetFile()->GetName());
217  mEvent->setMudstFileName(inputfile);
218  mEvent->setDateTime(GetDateTime());
219 
220  //bbc info:
221  mEvent->setBbcTimeBin( muEvent->bbcTriggerDetector().onlineTimeDifference() );
222  int Npmt=bbc->numberOfPMTs();
223  for (int pmt=0;pmt<Npmt;pmt++){
224  if(bbc->adc(pmt) > 5) {
225  if(pmt<16) mEvent->setEbbc(1);
226  if(pmt>23 && pmt<40) mEvent->setWbbc(1);
227  }
228  }
229 
230  //ZDC and BBC rates:
231  mEvent->setZdcWestRate(muEvent->runInfo().zdcWestRate());
232  mEvent->setZdcEastRate(muEvent->runInfo().zdcEastRate());
233  mEvent->setZdcCoincidenceRate(muEvent->runInfo().zdcCoincidenceRate());
234  mEvent->setBbcWestRate(muEvent->runInfo().bbcWestRate());
235  mEvent->setBbcEastRate(muEvent->runInfo().bbcEastRate());
236  mEvent->setBbcCoincidenceRate(muEvent->runInfo().bbcCoincidenceRate());
237 
238  // VPD Stuff:
239  if (muDst->btofHeader()){
240  mEvent->setVpdTdiff(muDst->btofHeader()->tDiff());
241  mEvent->setVpdZvertex(muDst->btofHeader()->vpdVz());
242  mEvent->setVpdEastHits(muDst->btofHeader()->numberOfVpdHits(east));
243  mEvent->setVpdWestHits(muDst->btofHeader()->numberOfVpdHits(west));
244  // filling in pile-up information from the VPD
245  mEvent->setNVpdEGoodHits(muDst->btofHeader()->vpdEGoodHits());
246  mEvent->setNVpdWGoodHits(muDst->btofHeader()->vpdWGoodHits());
247  mEvent->setEarliestVpdEHit(muDst->btofHeader()->earliestVpdEHit());
248  mEvent->setEarliestVpdWHit(muDst->btofHeader()->earliestVpdWHit());
249  mEvent->setClosestVpdEHit(muDst->btofHeader()->closestVpdEHit());
250  mEvent->setClosestVpdWHit(muDst->btofHeader()->closestVpdWHit());
251  mEvent->setLatestVpdEHit(muDst->btofHeader()->latestVpdEHit());
252  mEvent->setLatestVpdWHit(muDst->btofHeader()->latestVpdWHit());
253  //the start time could be from either VPD or start-less TOF
254  mEvent->setTstart(muDst->btofHeader()->tStart());
255  mEvent->setNTzero(muDst->btofHeader()->nTzero());
256  mEvent->setNTzeroCan(muDst->btofHeader()->nTzeroCan());
257  mEvent->setTCanFirst(muDst->btofHeader()->tCanFirst());
258  mEvent->setTCanLast(muDst->btofHeader()->tCanLast());
259  }
260  else { // No StBTofHeader
261  LOG_INFO << "BAD BTOFHEADER" << endm;
262  mEvent->setVpdTdiff(-999.);
263  mEvent->setVpdZvertex(-999.);
264  mEvent->setVpdEastHits(-1);
265  mEvent->setVpdWestHits(-1);
266  mEvent->setNVpdEGoodHits(0);
267  mEvent->setNVpdWGoodHits(0);
268 
269  mEvent->setEarliestVpdEHit(99999.);
270  mEvent->setEarliestVpdWHit(99999.);
271  mEvent->setClosestVpdEHit(99999.);
272  mEvent->setClosestVpdWHit(99999.);
273  mEvent->setLatestVpdEHit(-99999.);
274  mEvent->setLatestVpdWHit(-99999.);
275 
276  mEvent->setTstart(-999.);
277  mEvent->setNTzero(0);
278  mEvent->setNTzeroCan(0);
279  mEvent->setTCanFirst(99999.);
280  mEvent->setTCanLast(-99999.);
281  }
282 
283  //spin specific info from Mudst:
284  int bx7 = muEvent->l0Trigger().bunchCrossingId7bit(muEvent->runId());
285  int bx48 = muEvent->l0Trigger().bunchCrossingId();
286  mEvent->setBx7( bx7 );
287  mEvent->setBx48( bx48 );
288  mEvent->setSpinBits( muEvent->l0Trigger().spinBits( muEvent->runId() ) );
289 
290  //get spin info (Yellow,Blue): Up,Up = 5; Down,Up = 6; Up,Down = 9; Down,Down = 10;
291  if(isRealData) {
292  StSpinDbMaker* spDbMaker = dynamic_cast<StSpinDbMaker*>(GetMakerInheritsFrom("StSpinDbMaker"));
293  assert(spDbMaker);
294  mEvent->setIsValid( spDbMaker->isValid() );
295  mEvent->setIsPolLong( spDbMaker->isPolDirLong() );
296  mEvent->setIsPolTrans( spDbMaker->isPolDirTrans() );
297  int isMasked = (spDbMaker->isMaskedUsingBX48(bx48)) ? 1 : 0;
298  mEvent->setIsMaskedUsingBx48( isMasked );
299  mEvent->setOffsetBx48minusBX7( spDbMaker->offsetBX48minusBX7(bx48, bx7) );
300  mEvent->setSpin4UsingBx48( spDbMaker->spin4usingBX48(bx48) );
301  }
302  //cout <<"sdb:\t"<<mEvent->isValid()<<"\t"<<mEvent->isPolLong()<<"\t"<<mEvent->isPolTrans()<<"\t"<<mEvent->isMaskedUsingBx48()<<"\t"<<mEvent->offsetBx48minusBX7()<<endl;
303 
304  //vertex information:
305  int nVertices = muDst->numberOfPrimaryVertices();
306  for(int i=0; i<nVertices; ++i){
307  assert(muDst->primaryVertex(i));
308  StMuPrimaryVertex* muVert = muDst->primaryVertex(i);
309  assert(muVert);
310 
311  StJetSkimVert skimVert;
312  copyVertex(*muVert, skimVert);
313  mEvent->setVert(skimVert);
314  }
315 
316  //highest ranking vertex is always in position 0
317  mEvent->setBestVert(0);
318 
319  // Changes to account for the 4th threshold for di-jet triggers
320  // Modified by Danny
321 
322  // EMC info
323  if (StTriggerSimuMaker* trigSimu = dynamic_cast<StTriggerSimuMaker*>(GetMakerInheritsFrom("StTriggerSimuMaker"))) {
324  if (trigSimu->bemc) {
325  //for (int i = 0; i < 3; ++i) mEvent->setBarrelJetPatchTh(i,trigSimu->bemc->barrelJetPatchTh(i));
326  // Setting the 4th threshold for BEMC
327  // i = 0 (JP0)
328  // i = 1 (JP1)
329  // i = 2 (JP2)
330  // i = 4 (dijet)
331  for (int i = 0; i < 4; ++i)
332  {
333  mEvent->setBarrelJetPatchTh(i,trigSimu->bemc->barrelJetPatchTh(i));
334  if(i == 3) mEvent->setBarrelJetPatchTh(i,trigSimu->bemc->barrelJetPatchTh(i+1));
335  }
336  for (int i = 0; i < 4; ++i) mEvent->setBarrelHighTowerTh(i,trigSimu->bemc->barrelHighTowerTh(i));
337  for (int jp = 0; jp < 18; ++jp) mEvent->setBarrelJetPatchAdc(jp,trigSimu->bemc->barrelJetPatchAdc(jp));
338  }
339 
340  if (trigSimu->eemc) {
341  //for (int i = 0; i < 3; ++i) mEvent->setEndcapJetPatchTh(i,trigSimu->eemc->endcapJetPatchTh(i));
342  // Setting the 4th threshold for EEMC
343  // i = 0 (JP0)
344  // i = 1 (JP1)
345  // i = 2 (JP2)
346  // i = 3 (dijet)
347  for (int i = 0; i < 4; ++i)
348  {
349  mEvent->setEndcapJetPatchTh(i,trigSimu->eemc->endcapJetPatchTh(i));
350  }
351  for (int i = 0; i < 2; ++i) mEvent->setEndcapHighTowerTh(i,trigSimu->eemc->endcapHighTowerTh(i));
352  for (int jp = 0; jp < 6; ++jp) mEvent->setEndcapJetPatchAdc(jp,trigSimu->eemc->endcapJetPatchAdc(jp));
353  }
354 
355  if (trigSimu->emc) {
356  for (int i = 0; i < 3; ++i) mEvent->setOverlapJetPatchTh(i,trigSimu->emc->overlapJetPatchTh(i));
357  for (int jp = 0; jp < 6; ++jp) mEvent->setOverlapJetPatchAdc(jp, trigSimu->emc->overlapJetPatchAdc(jp));
358  }
359 
360  mEvent->setEmcLayer2(trigSimu->emc->EM201output());
361  }
362 
363  //fill tree
364  mTree->Fill();
365 
366  return kStOk;
367 }
368 
369 void copyVertex(StMuPrimaryVertex& v, StJetSkimVert& sv)
370 {
371  float pos[3];
372  float err[3];
373  StThreeVectorF pos3 = v.position();
374  StThreeVectorF err3 = v.posError();
375  pos[0] = pos3.x();
376  pos[1] = pos3.y();
377  pos[2] = pos3.z();
378  err[0] = err3.x();
379  err[1] = err3.y();
380  err[2] = err3.z();
381  sv.setPosition(pos);
382  sv.setError(err);
383 
384  //then a brute force copy:
385  sv.setVertexFinderId( v.vertexFinderId());
386  sv.setRanking( v.ranking() );
387  sv.setNTracksUsed( v.nTracksUsed());
388  sv.setNBTOFMatch( v.nBTOFMatch());
389  sv.setNCTBMatch( v.nCTBMatch());
390  sv.setNBEMCMatch( v.nBEMCMatch());
391  sv.setNEEMCMatch( v.nEEMCMatch());
392  sv.setNCrossingCentralMembrane( v.nCrossCentralMembrane() );
393  sv.setSumTrackPt( v.sumTrackPt());
394  sv.setMeanDip( v.meanDip() );
395  sv.setChiSquared( v.chiSquared() );
396  sv.setRefMultNeg( v.refMultNeg() );
397  sv.setRefMultPos( v.refMultPos() );
398  sv.setRefMultFtpcWest( v.refMultFtpcWest() );
399  sv.setRefMultFtpcEast( v.refMultFtpcEast() );
400 
401 }
402 
403 void StJetSkimEventMaker::fillTriggerSimulationInfo(StJetSkimTrig &skimTrig)
404 {
405 
406  StTriggerSimuMaker* trigSimu = dynamic_cast<StTriggerSimuMaker*>(GetMaker("StarTrigSimu"));
407  StEmcTriggerMaker *emcTrigMaker = dynamic_cast<StEmcTriggerMaker*>(GetMaker("bemctrigger"));
408 
409  if (trigSimu) {
410  const StTriggerSimuResult& trigResult = trigSimu->detailedResult(skimTrig.trigId());
411  skimTrig.setShouldFire(trigSimu->isTrigger(skimTrig.trigId()));
412  skimTrig.setShouldFireBBC(trigResult.bbcDecision());
413  skimTrig.setShouldFireBemc(trigResult.bemcDecision());
414  skimTrig.setShouldFireEemc(trigResult.eemcDecision());
415  skimTrig.setShouldFireL2(trigResult.l2Decision());
416 
417  if (trigResult.bemcDecision()==1){
418  vector<short> towerId = trigResult.highTowerIds();
419  for (unsigned i=0; i<towerId.size(); i++) {
420  skimTrig.addTowerAboveThreshold(0,towerId[i],trigResult.highTowerAdc(towerId[i]));
421  }
422 
423  vector<short> tpId = trigResult.triggerPatchIds();
424  for (unsigned i=0; i<tpId.size(); i++) {
425  skimTrig.addTriggerPatchAboveThreshold(0,tpId[i],trigResult.triggerPatchAdc(tpId[i]));
426  }
427 
428  vector<short> jpId = trigResult.jetPatchIds();
429  for (unsigned i=0; i<jpId.size(); i++) {
430  skimTrig.addJetPatchAboveThreshold(0,jpId[i],trigResult.jetPatchAdc(jpId[i]));
431  }
432  }
433 
434  if (trigResult.l2Decision()==1) {
435  // Needs to be able to handle more than just jet triggers...
436  int year = GetDBTime().GetYear();
437  const int* L2ResultEmulated = (int*)trigResult.l2Result(kJet,year);
438  if (L2ResultEmulated) {
439  skimTrig.setL2ResultEmulated(L2ResultEmulated);
440  }
441  else {
442  LOG_WARN << "No emulated L2 result for trigger ID = " << skimTrig.trigId() << " of year = " << year << endm;
443  }
444  }
445  } else if (emcTrigMaker) {
446  skimTrig.setShouldFire(emcTrigMaker->isTrigger(skimTrig.trigId()));
447 
448  map<int,int> towerMap = emcTrigMaker->barrelTowersAboveThreshold(skimTrig.trigId());
449  for(map<int,int>::const_iterator it=towerMap.begin(); it!=towerMap.end(); it++) {
450  skimTrig.addTowerAboveThreshold(0,it->first, it->second);
451  }
452 
453  towerMap = emcTrigMaker->endcapTowersAboveThreshold(skimTrig.trigId());
454  for(map<int,int>::const_iterator it=towerMap.begin(); it!=towerMap.end(); it++) {
455  skimTrig.addTowerAboveThreshold(1,it->first, it->second);
456  }
457 
458  map<int,int> triggerPatchMap = emcTrigMaker->barrelTriggerPatchesAboveThreshold(skimTrig.trigId());
459  for(map<int,int>::const_iterator it=triggerPatchMap.begin(); it!=triggerPatchMap.end(); it++) {
460  skimTrig.addTriggerPatchAboveThreshold(0,it->first, it->second);
461  }
462 
463  triggerPatchMap = emcTrigMaker->endcapTriggerPatchesAboveThreshold(skimTrig.trigId());
464  for(map<int,int>::const_iterator it=triggerPatchMap.begin(); it!=triggerPatchMap.end(); it++) {
465  skimTrig.addTriggerPatchAboveThreshold(1,it->first, it->second);
466  }
467 
468  map<int,int> jetPatchMap = emcTrigMaker->barrelJetPatchesAboveThreshold(skimTrig.trigId());
469  for(map<int,int>::const_iterator it=jetPatchMap.begin(); it!=jetPatchMap.end(); it++) {
470  skimTrig.addJetPatchAboveThreshold(0,it->first, it->second);
471  }
472 
473  jetPatchMap = emcTrigMaker->endcapJetPatchesAboveThreshold(skimTrig.trigId());
474  for(map<int,int>::const_iterator it=jetPatchMap.begin(); it!=jetPatchMap.end(); it++) {
475  skimTrig.addJetPatchAboveThreshold(1,it->first, it->second);
476  }
477 
478  skimTrig.setTotalEnergy(emcTrigMaker->totalEnergy());
479 
480  } else {
481  LOG_WARN << "StJetSkimEventMaker::fillTriggerSimulationInfo --- no StTriggerSimuMaker or StEmcTriggerMaker" << endm;
482  }
483 
484 }
485 
486 void StJetSkimEventMaker::fillThresholds(StJetSkimTrigHeader &header) {
487 
488  StTriggerSimuMaker* trigSimu = dynamic_cast<StTriggerSimuMaker*>(GetMaker("StarTrigSimu"));
489  StEmcTriggerMaker *emcTrigMaker = dynamic_cast<StEmcTriggerMaker*>(GetMaker("bemctrigger"));
490 
491  if (trigSimu && trigSimu->bemc) {
492  header.eastBarrelTowerThreshold = (trigSimu->bemc)->getTowerThreshold(header.trigId,15);
493  header.eastBarrelTriggerPatchThreshold = (trigSimu->bemc)->getTriggerPatchThreshold(header.trigId,15);
494  header.eastBarrelJetPatchThreshold = (trigSimu->bemc)->getJetPatchThreshold(header.trigId,15);
495  header.westBarrelTowerThreshold = (trigSimu->bemc)->getTowerThreshold(header.trigId,0);
496  header.westBarrelTriggerPatchThreshold = (trigSimu->bemc)->getTriggerPatchThreshold(header.trigId,0);
497  header.westBarrelJetPatchThreshold = (trigSimu->bemc)->getJetPatchThreshold(header.trigId,0);
498  } else if (emcTrigMaker) {
499  header.eastBarrelTowerThreshold = emcTrigMaker->barrelTowerThreshold(header.trigId,2401);
500  header.eastBarrelTriggerPatchThreshold = emcTrigMaker->barrelTriggerPatchThreshold(header.trigId,150);
501  header.eastBarrelJetPatchThreshold = emcTrigMaker->barrelJetPatchThreshold(header.trigId,6);
502  header.westBarrelTowerThreshold = emcTrigMaker->barrelTowerThreshold(header.trigId);
503  header.westBarrelTriggerPatchThreshold = emcTrigMaker->barrelTriggerPatchThreshold(header.trigId);
504  header.westBarrelJetPatchThreshold = emcTrigMaker->barrelJetPatchThreshold(header.trigId);
505  header.endcapTowerThreshold = emcTrigMaker->endcapTowerThreshold(header.trigId);
506  header.endcapTriggerPatchThreshold = emcTrigMaker->endcapTriggerPatchThreshold(header.trigId);
507  header.endcapJetPatchThreshold = emcTrigMaker->endcapJetPatchThreshold(header.trigId);
508  header.totalEnergyThreshold = emcTrigMaker->totalEnergyThreshold(header.trigId);
509  } else {
510  LOG_WARN << "StTriggerSimuMaker/StEmcTriggMaker not in Chain..." << endm;
511  }
512 
513 }
514 
516 {
517  assert(mOutfile);
518  mOutfile->Write();
519  mOutfile->Close();
520 
521  return kStOK;
522 }
523 
524 void StJetSkimEventMaker::Clear(const Option_t* c)
525 {
526 }
map< Int_t, Float_t > getTotalPrescales()
static StMuPrimaryVertex * primaryVertex()
return pointer to current primary vertex
Definition: StMuDst.h:322
bool isPolDirTrans()
true if all needed DB tables were found
Definition: StSpinDbMaker.h:54
bool isValid()
dump spinDb content for current time stamp
Definition: StSpinDbMaker.h:53
StMuDst * muDst()
Definition: StMuDstMaker.h:425
int jetPatchAdc(short jetPatchId) const
returns DSM ADC if above trigger threshold, otherwise -1
int highTowerAdc(short towerId) const
returns DSM ADC if above trigger threshold, otherwise -1
int totalEnergyThreshold(int trigId)
DSM ADC threshold for ETOT trigger. ADC &gt; threshold required to fire trigger.
int spin4usingBX48(int bx48)
8bit spin information
map< int, int > barrelTriggerPatchesAboveThreshold(int trigId)
map contains (key,value) = (patchId,ADC) of all TP above DSM threshold. map is empty if threshold = 0...
int barrelJetPatchThreshold(int trigId, int patchId=1)
Jet Patch ADC &gt; threshold required to fire trigger.
Accessor to the database for trigger id information.
int totalEnergy()
ADC calculated for ETOT trigger.
int barrelTowerThreshold(int trigId, int softId=1)
Tower ADC &gt; threshold required to fire trigger.
int barrelTriggerPatchThreshold(int trigId, int patchId=1)
Trigger Patch ADC &gt; threshold required to fire trigger.
map< int, int > barrelJetPatchesAboveThreshold(int trigId)
map contains (key,value) = (patchId,ADC) of all JP above DSM threshold. map is empty if threshold = 0...
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320
Definition: Stypes.h:40
TChain * chain()
In read mode, returns pointer to the chain of .MuDst.root files that where selected.
Definition: StMuDstMaker.h:426
map< int, int > barrelTowersAboveThreshold(int trigId)
map contains (key,value) = (softId,ADC) of all towers above DSM threshold. map is empty if threshold ...
static StBTofHeader * btofHeader()
returns pointer to the btofHeader - dongx
Definition: StMuDst.h:423
const StTriggerSimuResult & detailedResult(int trigId)
returns object containing detailed information about simulation of given trigger
int triggerPatchAdc(short patchId) const
returns DSM ADC if above trigger threshold, otherwise -1
const unsigned int * l2Result(L2ResultType algo, int year=2006) const
returns address of specific L2 result struct – cast it yourself
int isTrigger(int trigId)
1==Yes,0==No,-1==Don&#39;t Know. Same convention holds for other methods where appropriate.
Definition: Stypes.h:41
bool isPolDirLong()
Returns true if beams are transversely polarized, false otherwise.
Definition: StSpinDbMaker.h:55