StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHltMaker.cxx
1 /***************************************************************************
2  *
3  * $Id: StHltMaker.cxx,v 1.2 2012/12/12 22:10:35 fisyak Exp $
4  *
5  * Author: L. Xue, H. Qiu, A. Tang, Jan 2011
6  ***************************************************************************
7  *
8  * Description: Hlt Maker to propaganda online Hlt tracking and selection
9  * information.
10  *
11  ***************************************************************************
12  *
13  * $Log: StHltMaker.cxx,v $
14  * Revision 1.2 2012/12/12 22:10:35 fisyak
15  * add sys/types.h include for APPLE
16  *
17  * Revision 1.1 2011/02/01 18:24:02 xueliang
18  * *** empty log message ***
19  *
20  **************************************************************************/
21 
22 #include <iostream>
23 #include <fstream>
24 #include <stdlib.h>
25 
26 #include <Stiostream.h>
27 #include "StHltMaker.h"
28 #include "StRtsTable.h"
29 #include "HLTFormats.h"
30 #include "RTS/src/DAQ_HLT/hlt_gl3.h"
31 #include "StThreeVectorF.hh"
32 
33 #include "StEvent/StEvent.h"
34 #include "StEvent/StHltEvent.h"
35 #include "StEvent/StHltTrackNode.h"
36 #include "StEvent/StHltTrack.h"
37 #include "StEvent/StHltBTofHit.h"
38 #include "StEvent/StHltVpdHit.h"
39 #include "StEvent/StHltBEmcTowerHit.h"
40 #include "StEvent/StHltTriggerReason.h"
41 #include "StEvent/StHltHighPt.h"
42 #include "StEvent/StHltHeavyFragment.h"
43 #include "StEvent/StHltDiElectron.h"
44 
45 using namespace std;
46 using namespace star;
47 using namespace star::rts;
48 using namespace star::rts::hlt;
49 
50 //__________________________________________________________________________________________
51 namespace {
52 #define HTLPAIRATTR(bank) pair<string, EHLTBANKS>(_QUOTE_(HLT_##bank),_NAME2_(kHLT_,bank))
53 #define SELECTBANK(bank) case _NAME2_(kHLT_,bank): { processBank((_NAME2_(HLT_,bank) *)(&(hlt.data))); break;}
54  class HltBanks {
55  map<string, EHLTBANKS> fHltBanks;
56  public:
57  HltBanks() {
58  fHltBanks.insert(HTLPAIRATTR(EVE));
59  fHltBanks.insert(HTLPAIRATTR(TOF));
60  fHltBanks.insert(HTLPAIRATTR(PVPD));
61  fHltBanks.insert(HTLPAIRATTR(EMC));
62  fHltBanks.insert(HTLPAIRATTR(GT));
63  fHltBanks.insert(HTLPAIRATTR(PT));
64  fHltBanks.insert(HTLPAIRATTR(NODE));
65  fHltBanks.insert(HTLPAIRATTR(HIPT));
66  fHltBanks.insert(HTLPAIRATTR(DIEP));
67  fHltBanks.insert(HTLPAIRATTR(HF));
68  fHltBanks.insert(HTLPAIRATTR(NONE));
69  }
70  EHLTBANKS BankId(const char *bankName) {
71  map<string,EHLTBANKS>::iterator it=
72  fHltBanks.find(string(bankName));
73  return (it == fHltBanks.end()) ? kHLT_NONE : it->second;
74  }
75  };
76  HltBanks gHltBanks;
77  EHLTBANKS BankId(const char *bankName) {
78  EHLTBANKS j= gHltBanks.BankId(bankName) ;
79  return j;
80  }
81 }
82 
83 ClassImp(StHltMaker)
84 
85 //__________________________________________________________________________________________
87 StHltMaker::StHltMaker(const char *name) : StRTSBaseMaker("hlt",name)
88 {
89 
90  mStEvent = 0;
91  mStHltEvent = 0;
92 
93  mNumHighPt = 0;
94  mNumHeavyFragment = 0;
95  mNumDielectron = 0;
96 
97  SetAttr("hltMode",1); // 1 is default value for full model production
98 
99  for(uint32_t i=0; i<NMax; i++){
100  mHighPtNodeSN[i] = -1;
101  mHeavyFragmentNodeSN[i] = -1;
102  mDaughter1NodeSN[i] = -1;
103  mDaughter2NodeSN[i] = -1;
104  }
105 
106  LOG_DEBUG << "StHltMaker::ctor" << endm;
107 
108 }
109 
110 //__________________________________________________________________________________________
111 StHltMaker::~StHltMaker()
112 {
114 }
115 
116 //__________________________________________________________________________________________
119 {
120  return StMaker::Init();
121 }
122 
123 //__________________________________________________________________________________________
124 Int_t StHltMaker::InitRun(int runumber)
125 {
126  return StMaker::Init();
127 }
128 
129 //__________________________________________________________________________________________
131 
137 //_____________________________________________________________
139 {
142  return GetNext("gl3");
143 }
144 
145 //_____________________________________________________________________________
147 void StHltMaker::Clear(Option_t *)
148 {
149 
150  StMaker::Clear();
151 
152 }
153 
154 //_____________________________________________________________________________
157 {
158  // Get StHltEvent
159  StHltEvent *HltEvent = 0;
160  mStEvent = dynamic_cast<StEvent *> (GetInputDS("StEvent"));
161 
162  if (mStEvent) {
163  HltEvent = mStEvent->hltEvent();
164 
165  if ( !HltEvent ) {
166  LOG_DEBUG << "Create StHltEvent !" << endm;
167 
168  HltEvent = new StHltEvent();
169  mStEvent->setHltEvent(HltEvent);
170  }
171  }
172  else {LOG_WARN << "No StEvent found" << endm; }
173 
174  return HltEvent;
175 }
176 
177 //_____________________________________________________________________________
180 {
181 
182  if ( Token() == 0 ) return kStOK ;
183  mStHltEvent = GetHltEvent();
184  if(!mStHltEvent) {
185  LOG_WARN << "No hlt event found in this data !" << endm;
186  return kStOK;
187  }
188 
189  mNumHighPt = 0;
190  mNumHeavyFragment = 0;
191  mNumDielectron = 0;
193  for(uint32_t i=0; i<NMax; i++){
194  mHighPtNodeSN[i] = -1;
195  mHeavyFragmentNodeSN[i] = -1;
196  mDaughter1NodeSN[i] = -1;
197  mDaughter2NodeSN[i] = -1;
198  }
199 
200  int counter = 0;
202  while ( GetNextGl3() ) {
203  counter++;
204  TGenericTable::iterator iword = DaqDta()->begin();
205  hlt_gl3_t &hlt = *(hlt_gl3_t*)*iword;
206 
207  switch (BankId(hlt.name)) {
208  SELECTBANK(EVE)
209  SELECTBANK(TOF)
210  SELECTBANK(PVPD)
211  SELECTBANK(EMC)
212  SELECTBANK(GT)
213  SELECTBANK(PT)
214  SELECTBANK(NODE)
215  SELECTBANK(HIPT)
216  SELECTBANK(DIEP)
217  SELECTBANK(HF)
218  default: case kHLT_NONE:{
219  LOG_ERROR << "Unknown bank name was delivered: <" << hlt.name << ">" << endm;
220  return kStERR; break;
221  }
222  }
223 
224  }
225 
226  fillNodePointer(mStHltEvent);
227  fillHighPt(mStHltEvent);
228  fillHeavyFragment(mStHltEvent);
229  fillDielectron(mStHltEvent);
230  fillTriggerReason(mStHltEvent);
231 
232 
233 
235  Int_t hltMode = IAttr("hltMode");
236 
237  if(!hltMode){
238 
239  StSPtrVecHltTrack& VecgTrack = mStHltEvent->globalTrack();
240  VecgTrack.resize(0);
241  StSPtrVecHltTrack& VecpTrack = mStHltEvent->primaryTrack();
242  VecpTrack.resize(0);
243  StSPtrVecHltTrackNode& VecTrackNode = mStHltEvent->trackNode();
244  VecTrackNode.resize(0);
245  StSPtrVecHltBTofHit& VecbTofHit = mStHltEvent->bTofHit();
246  VecbTofHit.resize(0);
247  StSPtrVecHltBEmcTowerHit& VecbEmcHit = mStHltEvent->bEmcTowerHits();
248  VecbEmcHit.resize(0);
249  StSPtrVecHltVpdHit& VecpVpdHit = mStHltEvent->vpdHit();
250  VecpVpdHit.resize(0);
251 
252  LOG_INFO << "Clear The Vector Of HLT Tracks, TrackNodes, BTofHit, BEmcTowerHit, VpdHit in <<Triggered Tracks Only>> model " << endm;
253 
254  }
255 
256  if (counter <= 0) {
257  LOG_DEBUG << "There was no hlt data for this event. " << endm;
258  } else {
259  LOG_DEBUG << "End of hlt data for this event : " << GetEventNumber() << ", Total = " << counter+1
260  << " records were found" << endm;
261  }
262  return kStOK;
263 
264 }
265 
266 //_____________________________________________________________________________
268 void StHltMaker::processBank(const HLT_EVE *hlt_eve)
269 {
270 
271  LOG_DEBUG << "Begin to fill HLT_EVE bank " << endm;
272 
273  mStHltEvent->setVersion((unsigned int) hlt_eve->version) ;
275  mStHltEvent->setTriggerReasonBitOred((unsigned int) hlt_eve->hltDecision) ;
277 
278  mStHltEvent->setT0(hlt_eve->T0) ;
279  mStHltEvent->setVpdVertexZ(hlt_eve->vpdVertexZ);
280 
281  if( hlt_eve->version >= 0x20100216){
282  mStHltEvent->setInnerSecGain(hlt_eve->innerSectorGain) ;
283  mStHltEvent->setOuterSecGain(hlt_eve->outerSectorGain) ;
284  } else {
285  mStHltEvent->setInnerSecGain(-999.) ;
286  mStHltEvent->setOuterSecGain(-999.) ;
287  }
288 
289  float vertX = hlt_eve->vertexX ;
290  float vertY = hlt_eve->vertexY ;
291  float vertZ = hlt_eve->vertexZ ;
292  StThreeVectorF vertex(vertX,vertY,vertZ);
293  mStHltEvent->setVertex(vertex) ;
294 
295  float lmvertX = hlt_eve->lmVertexX ;
296  float lmvertY = hlt_eve->lmVertexY ;
297  float lmvertZ = hlt_eve->lmVertexZ ;
298  StThreeVectorF lmvertex(lmvertX,lmvertY,lmvertZ);
299  mStHltEvent->setLowMultVertex(lmvertex) ;
300 
301  LOG_DEBUG << "Finish to fill HLT_EVE bank " << endm;
302 
303 }
304 
305 //_____________________________________________________________________________
307 void StHltMaker::processBank(const HLT_TOF *hlt_tof)
308 {
309 
310  LOG_DEBUG << "Begin to fill HLT_TOF bank " << endm;
311 
312  for(uint32_t i=0 ; i < hlt_tof->nTofHits ; i++){
313 
314  // create StHltBTofHit
315  StHltBTofHit *aHit = new StHltBTofHit();
316 
317  aHit->setTrayId(hlt_tof->tofHit[i].trayId);
318  aHit->setChannel(hlt_tof->tofHit[i].channel);
319  aHit->setTdc(hlt_tof->tofHit[i].tdc);
320  aHit->setTot(hlt_tof->tofHit[i].tot);
321  aHit->setTof(hlt_tof->tofHit[i].tof);
322  aHit->setTriggerTime(hlt_tof->tofHit[i].triggertime);
323 
324  // save pointer to the vector
325  mStHltEvent->addBTofHit(aHit);
326 
327  }
328 
329  LOG_DEBUG << "Finish to fill HLT_TOF bank " << endm;
330 
331 }
332 
333 //_____________________________________________________________________________
335 void StHltMaker::processBank(const HLT_PVPD *hlt_pvpd)
336 {
337 
338  LOG_DEBUG << "Begin to fill HLT_PVPD bank " << endm;
339 
340  for(uint32_t i=0 ; i < hlt_pvpd->nPvpdHits ; i++){
341 
342  // create StHltVpdHit
343  StHltVpdHit *aHit = new StHltVpdHit();
344 
345  int trayID = hlt_pvpd->pvpdHit[i].trayId;
346  if(trayID==120) aHit->setDirection(west);
347  else aHit->setDirection(east);
348  aHit->setChannel(hlt_pvpd->pvpdHit[i].channel);
349  aHit->setTdc(hlt_pvpd->pvpdHit[i].tdc);
350  aHit->setTot(hlt_pvpd->pvpdHit[i].tot);
351  aHit->setTof(hlt_pvpd->pvpdHit[i].tof);
352  aHit->setTriggerTime(hlt_pvpd->pvpdHit[i].triggertime);
353 
354  // save pointer to a vector
355  mStHltEvent->addVpdHit(aHit);
356 
357  }
358 
359  LOG_DEBUG << "Finish to fill HLT_PVPD bank " << endm;
360 
361 }
362 
363 //_____________________________________________________________________________
365 void StHltMaker::processBank(const HLT_EMC *hlt_emc)
366 {
367 
368  LOG_DEBUG << "Begin to fill HLT_EMC bank " << endm;
369 
370  for(uint32_t i=0 ; i< hlt_emc->nEmcTowers ; i++){
371 
372  // create StHltBEmcTowerHit
373  StHltBEmcTowerHit *aHit = new StHltBEmcTowerHit();
374 
375  aHit->setAdc(hlt_emc->emcTower[i].adc);
376  aHit->setEnergy(hlt_emc->emcTower[i].energy);
377  aHit->setPhi(hlt_emc->emcTower[i].phi);
378  aHit->setEta(hlt_emc->emcTower[i].eta);
379  aHit->setZ(hlt_emc->emcTower[i].z);
380  aHit->setSoftId(hlt_emc->emcTower[i].softId);
381  aHit->setDaqId(hlt_emc->emcTower[i].daqId);
382 
383  // save pointer to a vector
384  mStHltEvent->addBEmcTowerHit(aHit);
385 
386  }
387 
388  LOG_DEBUG << "Finish to fill HLT_EMC bank " << endm;
389 
390 }
391 
392 //_____________________________________________________________________________
394 void StHltMaker::processBank(const HLT_GT *hlt_gt)
395 {
396 
397  LOG_DEBUG << "Begin to fill HLT_GT bank " << endm;
398 
399  for(uint32_t i=0 ; i < hlt_gt->nGlobalTracks; i++){
400 
401  // create StHltTrack
402  StHltTrack *aTrack = new StHltTrack();
403 
404  aTrack->setType(global);
405  aTrack->setId(hlt_gt->globalTrack[i].id);
406  aTrack->setFlag(hlt_gt->globalTrack[i].flag);
407  aTrack->setInnerMostRow(hlt_gt->globalTrack[i].innerMostRow);
408  aTrack->setOuterMostRow(hlt_gt->globalTrack[i].outerMostRow);
409  aTrack->setNHits(hlt_gt->globalTrack[i].nHits);
410  aTrack->setNDedx(hlt_gt->globalTrack[i].ndedx);
411  aTrack->setQ(hlt_gt->globalTrack[i].q);
412  aTrack->setChi2(0,hlt_gt->globalTrack[i].chi2[0]);
413  aTrack->setChi2(1,hlt_gt->globalTrack[i].chi2[1]);
414  aTrack->setDedx(hlt_gt->globalTrack[i].dedx);
415  aTrack->setPt(hlt_gt->globalTrack[i].pt);
416  aTrack->setPhi0(hlt_gt->globalTrack[i].phi0);
417  aTrack->setPsi(hlt_gt->globalTrack[i].psi);
418  aTrack->setR0(hlt_gt->globalTrack[i].r0);
419  aTrack->setTanl(hlt_gt->globalTrack[i].tanl);
420  aTrack->setZ0(hlt_gt->globalTrack[i].z0);
421  aTrack->setLength(hlt_gt->globalTrack[i].length);
422  aTrack->setDpt(hlt_gt->globalTrack[i].dpt);
423  aTrack->setDpsi(hlt_gt->globalTrack[i].dpsi);
424  aTrack->setDz0(hlt_gt->globalTrack[i].dz0);
425  aTrack->setDtanl(hlt_gt->globalTrack[i].dtanl);
426 
427  // save pointer to a vector
428  mStHltEvent->addGlobalTrack(aTrack);
429 
430  }
431 
432 
433  LOG_DEBUG << "Finish to fill HLT_GT bank " << endm;
434 
435 }
436 
437 //_____________________________________________________________________________
439 void StHltMaker::processBank(const HLT_PT *hlt_pt)
440 {
441 
442  LOG_DEBUG << "Begin to fill HLT_PT bank " << endm;
443 
444  for(uint32_t i=0;i<hlt_pt->nPrimaryTracks;i++){
445 
446  // create StHltTrack
447  StHltTrack *aTrack = new StHltTrack();
448 
449  aTrack->setType(primary);
450  aTrack->setId(hlt_pt->primaryTrack[i].id);
451  aTrack->setFlag(hlt_pt->primaryTrack[i].flag);
452  aTrack->setInnerMostRow(hlt_pt->primaryTrack[i].innerMostRow);
453  aTrack->setOuterMostRow(hlt_pt->primaryTrack[i].outerMostRow);
454  aTrack->setNHits(hlt_pt->primaryTrack[i].nHits);
455  aTrack->setNDedx(hlt_pt->primaryTrack[i].ndedx);
456  aTrack->setQ(hlt_pt->primaryTrack[i].q) ;
457  aTrack->setChi2(0,hlt_pt->primaryTrack[i].chi2[0]);
458  aTrack->setChi2(1,hlt_pt->primaryTrack[i].chi2[1]);
459  aTrack->setDedx(hlt_pt->primaryTrack[i].dedx);
460  aTrack->setPt(hlt_pt->primaryTrack[i].pt);
461  aTrack->setPhi0(hlt_pt->primaryTrack[i].phi0);
462  aTrack->setPsi(hlt_pt->primaryTrack[i].psi);
463  aTrack->setR0(hlt_pt->primaryTrack[i].r0);
464  aTrack->setTanl(hlt_pt->primaryTrack[i].tanl);
465  aTrack->setZ0(hlt_pt->primaryTrack[i].z0);
466  aTrack->setLength(hlt_pt->primaryTrack[i].length);
467  aTrack->setDpt(hlt_pt->primaryTrack[i].dpt);
468  aTrack->setDpsi(hlt_pt->primaryTrack[i].dpsi);
469  aTrack->setDz0(hlt_pt->primaryTrack[i].dz0);
470  aTrack->setDtanl(hlt_pt->primaryTrack[i].dtanl);
471 
472  // save pointer to a vector
473  mStHltEvent->addPrimaryTrack(aTrack);
474  }
475 
476 
477  LOG_DEBUG << "Finish to fill HLT_PT bank " << endm;
478 
479 }
480 
481 //_____________________________________________________________________________
484 {
485  LOG_DEBUG << "Begin to fill HLT_NODE bank " << endm;
486 
487  for(uint32_t i=0 ; i< hlt_node->nNodes ; i++){
488 
489  // create StHltTrackNode
490  StHltTrackNode *aNode = new StHltTrackNode();
491 
492  aNode->setBEmcMatchPhiDiff(hlt_node->node[i].emcMatchPhiDiff);
493  aNode->setBEmcMatchZEdge(hlt_node->node[i].emcMatchZEdge);
494  aNode->setBTofProjChannel(hlt_node->node[i].projChannel);
495  aNode->setBTofCellLocalY(hlt_node->node[i].localY);
496  aNode->setBTofCellLocalZ(hlt_node->node[i].localZ);
497  aNode->setBTofPathLength(hlt_node->node[i].pathlength);
498  aNode->setBeta(hlt_node->node[i].beta);
499  aNode->setTof(hlt_node->node[i].tof);
500 
501  aNode->setGlobalTrackSN(hlt_node->node[i].globalTrackSN);
502  aNode->setPrimaryTrackSN(hlt_node->node[i].primaryTrackSN);
503  aNode->setTofHitSN(hlt_node->node[i].tofHitSN);
504  aNode->setEmcTowerSN(hlt_node->node[i].emcTowerSN);
505 
506  // save pointer to a vector
507  mStHltEvent->addTrackNode(aNode);
508 
509  }
510 
511  LOG_DEBUG << "Finish to fill HLT_NODE bank " << endm;
512 
513 }
514 
515 //_____________________________________________________________________________
517 void StHltMaker::processBank(const HLT_HIPT *hlt_hipt)
518 {
519 
520  LOG_DEBUG << "Begin to fill HLT_HTPT bank " << endm;
521 
522  mNumHighPt = hlt_hipt->nHighPt;
523  for(uint32_t i=0; i<hlt_hipt->nHighPt; i++){
524  mHighPtNodeSN[i] = hlt_hipt->highPtNodeSN[i];
525  }
526 
527  LOG_DEBUG << "Finish to fill HLT_HTPT bank " << endm;
528 
529 }
530 
531 //_____________________________________________________________________________
533 void StHltMaker::processBank(const HLT_DIEP *hlt_diep)
534 {
535 
536  LOG_DEBUG << "Begin to fill HLT_DIEP bank " << endm;
537 
538  mNumDielectron = hlt_diep->nEPairs;
539  for(uint32_t i=0; i<hlt_diep->nEPairs; i++){
540 
541  // create StHltDiElectron
542  StHltDiElectron *aDielectron = new StHltDiElectron();
543 
544  mDaughter1NodeSN[i] = hlt_diep->ePair[i].dau1NodeSN;
545  mDaughter2NodeSN[i] = hlt_diep->ePair[i].dau2NodeSN;
546  aDielectron->setPt(hlt_diep->ePair[i].pt);
547  aDielectron->setPsi(hlt_diep->ePair[i].psi);
548  aDielectron->setTanl(hlt_diep->ePair[i].tanl);
549  aDielectron->setInvariantMass(hlt_diep->ePair[i].invariantMass);
550 
551  aDielectron->setDaughter1SelectionBit(hlt_diep->ePair[i].dau1SelectionBit);
552  aDielectron->setDaughter2SelectionBit(hlt_diep->ePair[i].dau2SelectionBit);
553 
554  // save pointer to a vector
555  mStHltEvent->addDiElectron(aDielectron);
556 
557  }
558 
559  LOG_DEBUG << "Finish to fill HLT_DIEP bank " << endm;
560 
561 }
562 
563 //_____________________________________________________________________________
565 void StHltMaker::processBank(const HLT_HF *hlt_hf)
566 {
567 
568  LOG_DEBUG << "Begin to fill HLT_HF bank " << endm;
569 
570  mNumHeavyFragment = hlt_hf->nHeavyFragments;
571  for(uint32_t i=0 ; i < hlt_hf->nHeavyFragments ; i++){
572  mHeavyFragmentNodeSN[i] = hlt_hf->heavyFragmentSN[i];
573  }
574 
575  LOG_DEBUG << "Finish to fill HLT_HF bank " << endm;
576 
577 }
578 
579 //_____________________________________________________________________________
582 {
583 
584  LOG_DEBUG << "Begin to create pointers in tracknode" << endm;
585 
586  StSPtrVecHltTrackNode& VecTrackNode = event->trackNode();
587  StSPtrVecHltTrack& VecgTrack = event->globalTrack();
588  StSPtrVecHltTrack& VecpTrack = event->primaryTrack();
589  StSPtrVecHltBTofHit& VecbTofHit = event->bTofHit();
590  StSPtrVecHltBEmcTowerHit& VecbEmcHit = event->bEmcTowerHits();
591 
592  // create pointer in StHltTrackNode
593  for(uint32_t i=0 ; i<VecTrackNode.size() ; i++){
594 
595  StHltTrackNode *trackNode = (StHltTrackNode*)VecTrackNode.at(i);
596  int globalTrackSN = trackNode->globalTrackSN();
597  int primaryTrackSN = trackNode->primaryTrackSN();
598  int tofHitSN = trackNode->tofHitSN();
599  int emcTowerSN = trackNode->emcTowerSN();
600 
601  StHltTrack *gTrack = 0;
602  StHltTrack *pTrack = 0;
603  StHltBTofHit *TofHit = 0;
604  StHltBEmcTowerHit *BEmcHit = 0;
605  if(globalTrackSN >= 0) gTrack = (StHltTrack*)VecgTrack.at(globalTrackSN);
606  if(primaryTrackSN >= 0) pTrack = (StHltTrack*)VecpTrack.at(primaryTrackSN);
607  if(tofHitSN >= 0) TofHit = (StHltBTofHit*)VecbTofHit.at(tofHitSN);
608  if(emcTowerSN >= 0) BEmcHit = (StHltBEmcTowerHit*)VecbEmcHit.at(emcTowerSN);
609 
610  trackNode->setGlobalTrack(gTrack);
611  trackNode->setPrimaryTrack(pTrack);
612  trackNode->setBTofHit(TofHit);
613  trackNode->setBEmcTowerHit(BEmcHit);
614 
615  if(globalTrackSN >= 0) gTrack->setTrackNode(trackNode);
616  if(primaryTrackSN >= 0) pTrack->setTrackNode(trackNode);
617  if(tofHitSN >= 0) TofHit->setTrackNode(trackNode);
618  if(emcTowerSN >= 0) BEmcHit->setTrackNode(trackNode);
619 
620  }
621 
622  LOG_DEBUG << "Finish to create pointers in tracknode" << endm;
623 
624 }
625 
626 //_____________________________________________________________________________
629 {
630 
631  LOG_DEBUG << "Begin to fill high pt to StHltEvent" << endm;
632 
633  StSPtrVecHltTrackNode& VecTrackNode = event->trackNode();
634 
635  for(uint32_t i=0 ; i<mNumHighPt ; i++){
636 
637  // create StHltHighPt
638  StHltHighPt *highPt = new StHltHighPt();
639  StHltTrackNode* node = (StHltTrackNode*)VecTrackNode.at(mHighPtNodeSN[i]);
640 
642  if(node->globalTrack()) globalTrack = *node->globalTrack();
643  StHltTrack primaryTrack ;
644  if(node->primaryTrack()) primaryTrack = *node->primaryTrack();
645  StHltBTofHit bTofHit ;
646  if(node->bTofHit()) bTofHit = *node->bTofHit();
647  StHltBEmcTowerHit bEmcHit ;
648  if(node->bEmcTowerHit()) bEmcHit = *node->bEmcTowerHit();
649 
650  highPt->setGlobalTrack(globalTrack);
651  highPt->setPrimaryTrack(primaryTrack);
652  highPt->setBTofHit(bTofHit);
653  highPt->setBEmcTowerHit(bEmcHit);
654  highPt->setGlobalTrackSN(node->globalTrackSN());
655  highPt->setPrimaryTrackSN(node->primaryTrackSN());
656  highPt->setTofHitSN(node->tofHitSN());
657  highPt->setEmcTowerSN(node->emcTowerSN());
658  highPt->setBEmcMatchPhiDiff(node->bEmcMatchPhiDiff());
659  highPt->setBEmcMatchZEdge(node->bEmcMatchZEdge());
660  highPt->setBTofProjChannel(node->bTofProjChannel());
661  highPt->setBTofCellLocalY(node->bTofCellLocalY());
662  highPt->setBTofCellLocalZ(node->bTofCellLocalZ());
663  highPt->setBTofPathLength(node->bTofPathLength());
664  highPt->setBeta(node->beta());
665  highPt->setTof(node->tof());
666 
667  // save pointer to a vector
668  mStHltEvent->addHighPt(highPt);
669 
670  }
671 
672  LOG_DEBUG << "Finish to fill high pt to StHltEvent" << endm;
673 
674 }
675 
676 
677 //_____________________________________________________________________________
680 {
681 
682  LOG_DEBUG << "Begin to fill heavy fragment to StHltEvent" << endm;
683 
684  StSPtrVecHltTrackNode& VecTrackNode = event->trackNode();
685 
686  for(uint32_t i=0 ; i<mNumHeavyFragment ; i++){
687 
688  // create StHltHeavyFragment
689  StHltHeavyFragment *heavyFragment = new StHltHeavyFragment();
690  StHltTrackNode* node = (StHltTrackNode*)VecTrackNode.at(mHeavyFragmentNodeSN[i]);
691 
693  if(node->globalTrack()) globalTrack = *node->globalTrack();
694  StHltTrack primaryTrack ;
695  if(node->primaryTrack()) primaryTrack = *node->primaryTrack();
696  StHltBTofHit bTofHit ;
697  if(node->bTofHit()) bTofHit = *node->bTofHit();
698  StHltBEmcTowerHit bEmcHit;
699  if(node->bEmcTowerHit()) bEmcHit = *node->bEmcTowerHit();
700 
701  heavyFragment->setGlobalTrack(globalTrack);
702  heavyFragment->setPrimaryTrack(primaryTrack);
703  heavyFragment->setBTofHit(bTofHit);
704  heavyFragment->setBEmcTowerHit(bEmcHit);
705  heavyFragment->setGlobalTrackSN(node->globalTrackSN());
706  heavyFragment->setPrimaryTrackSN(node->primaryTrackSN());
707  heavyFragment->setTofHitSN(node->tofHitSN());
708  heavyFragment->setEmcTowerSN(node->emcTowerSN());
709  heavyFragment->setBEmcMatchPhiDiff(node->bEmcMatchPhiDiff());
710  heavyFragment->setBEmcMatchZEdge(node->bEmcMatchZEdge());
711  heavyFragment->setBTofProjChannel(node->bTofProjChannel());
712  heavyFragment->setBTofCellLocalY(node->bTofCellLocalY());
713  heavyFragment->setBTofCellLocalZ(node->bTofCellLocalZ());
714  heavyFragment->setBTofPathLength(node->bTofPathLength());
715  heavyFragment->setBeta(node->beta());
716  heavyFragment->setTof(node->tof());
717 
718  // save pointer to a vector
719  mStHltEvent->addHeavyFragment(heavyFragment);
720  }
721 
722  LOG_DEBUG << "Finish to fill heavy fragment to StHltEvent" << endm;
723 
724 }
725 
726 //_____________________________________________________________________________
729 {
730 
731  LOG_DEBUG << "Begin to fill di-electron to StHltEvent" << endm;
732 
733  StSPtrVecHltTrackNode& VecTrackNode = event->trackNode();
734  StSPtrVecHltDiElectron& VecDiElectron = event->diElectron();
735 
736  for(uint32_t i=0 ; i<mNumDielectron ; i++){
737 
738  StHltDiElectron *diElectron = (StHltDiElectron*)VecDiElectron.at(i);
739  StHltTrackNode* daughter1node = (StHltTrackNode*)VecTrackNode.at(mDaughter1NodeSN[i]);
740  StHltTrackNode* daughter2node = (StHltTrackNode*)VecTrackNode.at(mDaughter2NodeSN[i]);
741 
742  StHltTrack daughter1globalTrack ;
743  if(daughter1node->globalTrack()) daughter1globalTrack = *daughter1node->globalTrack();
744  StHltTrack daughter1primaryTrack ;
745  if(daughter1node->primaryTrack()) daughter1primaryTrack = *daughter1node->primaryTrack();
746  StHltBTofHit daughter1bTofHit ;
747  if(daughter1node->bTofHit()) daughter1bTofHit = *daughter1node->bTofHit();
748  StHltBEmcTowerHit daughter1bEmcHit ;
749  if(daughter1node->bEmcTowerHit()) daughter1bEmcHit = *daughter1node->bEmcTowerHit();
750 
751  diElectron->setDaughter1GlobalTrack(daughter1globalTrack);
752  diElectron->setDaughter1PrimaryTrack(daughter1primaryTrack);
753  diElectron->setDaughter1BTofHit(daughter1bTofHit);
754  diElectron->setDaughter1BEmcTowerHit(daughter1bEmcHit);
755  diElectron->setDaughter1GlobalTrackSN(daughter1node->globalTrackSN());
756  diElectron->setDaughter1PrimaryTrackSN(daughter1node->primaryTrackSN());
757  diElectron->setDaughter1TofHitSN(daughter1node->tofHitSN());
758  diElectron->setDaughter1EmcTowerSN(daughter1node->emcTowerSN());
759  diElectron->setDaughter1BEmcMatchPhiDiff(daughter1node->bEmcMatchPhiDiff());
760  diElectron->setDaughter1BEmcMatchZEdge(daughter1node->bEmcMatchZEdge());
761  diElectron->setDaughter1BTofProjChannel(daughter1node->bTofProjChannel());
762  diElectron->setDaughter1BTofCellLocalY(daughter1node->bTofCellLocalY());
763  diElectron->setDaughter1BTofCellLocalZ(daughter1node->bTofCellLocalZ());
764  diElectron->setDaughter1BTofPathLength(daughter1node->bTofPathLength());
765  diElectron->setDaughter1Beta(daughter1node->beta());
766  diElectron->setDaughter1Tof(daughter1node->tof());
767 
768  StHltTrack daughter2globalTrack ;
769  if(daughter2node->globalTrack()) daughter2globalTrack = *daughter2node->globalTrack();
770  StHltTrack daughter2primaryTrack ;
771  if(daughter2node->primaryTrack()) daughter2primaryTrack = *daughter2node->primaryTrack();
772  StHltBTofHit daughter2bTofHit ;
773  if(daughter2node->bTofHit()) daughter2bTofHit = *daughter2node->bTofHit();
774  StHltBEmcTowerHit daughter2bEmcHit ;
775  if(daughter2node->bEmcTowerHit()) daughter2bEmcHit = *daughter2node->bEmcTowerHit();
776 
777  diElectron->setDaughter2GlobalTrack(daughter2globalTrack);
778  diElectron->setDaughter2PrimaryTrack(daughter2primaryTrack);
779  diElectron->setDaughter2BTofHit(daughter2bTofHit);
780  diElectron->setDaughter2BEmcTowerHit(daughter2bEmcHit);
781  diElectron->setDaughter2GlobalTrackSN(daughter2node->globalTrackSN());
782  diElectron->setDaughter2PrimaryTrackSN(daughter2node->primaryTrackSN());
783  diElectron->setDaughter2TofHitSN(daughter2node->tofHitSN());
784  diElectron->setDaughter2EmcTowerSN(daughter2node->emcTowerSN());
785  diElectron->setDaughter2BEmcMatchPhiDiff(daughter2node->bEmcMatchPhiDiff());
786  diElectron->setDaughter2BEmcMatchZEdge(daughter2node->bEmcMatchZEdge());
787  diElectron->setDaughter2BTofProjChannel(daughter2node->bTofProjChannel());
788  diElectron->setDaughter2BTofCellLocalY(daughter2node->bTofCellLocalY());
789  diElectron->setDaughter2BTofCellLocalZ(daughter2node->bTofCellLocalZ());
790  diElectron->setDaughter2BTofPathLength(daughter2node->bTofPathLength());
791  diElectron->setDaughter2Beta(daughter2node->beta());
792  diElectron->setDaughter2Tof(daughter2node->tof());
793 
794  }
795 
796  LOG_DEBUG << "Finish to fill di-electron to StHltEvent" << endm;
797 
798 }
799 
800 //_____________________________________________________________________________
803 {
804 
805  LOG_DEBUG << "Begin to fill trigger reason to StHltEvent" << endm;
806 
807  // create StHltTriggerReason
808  StSPtrVecHltDiElectron& VecDiElectron = event->diElectron();
809  for(uint32_t i=0 ; i<VecDiElectron.size() ; i++){
810 
811  StHltDiElectron *diElectron = (StHltDiElectron*)VecDiElectron.at(i);
812  StHltTriggerReason *aTriggerReason = new StHltTriggerReason();
813  aTriggerReason->setReasonBit(kDiElectron);
814  aTriggerReason->setReason(diElectron);
815  mStHltEvent->addTriggerReason(aTriggerReason);
816 
817  }
818 
819  StSPtrVecHltHighPt& VecHighPt = event->highPt();
820  for(uint32_t i=0 ; i<VecHighPt.size() ; i++){
821 
822  StHltHighPt *highPt = (StHltHighPt*)VecHighPt.at(i);
823  StHltTriggerReason *aTriggerReason = new StHltTriggerReason();
824  aTriggerReason->setReasonBit(kHighPt);
825  aTriggerReason->setReason(highPt);
826  mStHltEvent->addTriggerReason(aTriggerReason);
827 
828  }
829 
830  StSPtrVecHltHeavyFragment& VecHeavyFragment = event->heavyFragment();
831  for(uint32_t i=0 ; i<VecHeavyFragment.size() ; i++){
832 
833  StHltHeavyFragment *heavyFragment = (StHltHeavyFragment*)VecHeavyFragment.at(i);
834  StHltTriggerReason *aTriggerReason = new StHltTriggerReason();
835  aTriggerReason->setReasonBit(kHeavyFragment);
836  aTriggerReason->setReason(heavyFragment);
837  mStHltEvent->addTriggerReason(aTriggerReason);
838 
839  }
840 
841  LOG_DEBUG << "Finish to fill trigger reason to StHltEvent" << endm;
842 
843 }
844 
845 //_____________________________________________________________________________
848 {
849 
850  return StMaker::Finish();
851 
852 }
int globalTrackSN
serial number in HLT_GT
Definition: HLTFormats.h:119
float psi
azimuthal angle of the momentum at (r,..
Definition: HLTFormats.h:55
virtual StRtsTable * GetNextGl3()
This is an overloaded member function, provided for convenience.
Definition: StHltMaker.cxx:138
unsigned char nHits
Number of points assigned to that track.
Definition: HLTFormats.h:47
float dedx
dE/dx information
Definition: HLTFormats.h:52
Class StRTSBaseMaker - is an abstract StMaker to define the interface to access the DAQ data from the...
int primaryTrackSN
serial number in HLT_PT
Definition: HLTFormats.h:120
float chi2[2]
chi squared of the momentum fit
Definition: HLTFormats.h:51
float r0
r (in cyl. coord.) for the first point
Definition: HLTFormats.h:56
virtual Int_t InitRun(int runumber)
Overload empty StMaker::InitRun.
Definition: StHltMaker.cxx:124
float z0
z coordinate of the first point
Definition: HLTFormats.h:58
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StMaker.cxx:634
Bank of nodes.
Definition: HLTFormats.h:118
virtual Int_t Finish()
&lt; Finish ...
Definition: StHltMaker.cxx:847
void fillHighPt(StHltEvent *)
fill high pt information
Definition: StHltMaker.cxx:628
virtual Int_t Make()
&lt; Make - this method is called in loop for each event
Definition: StHltMaker.cxx:179
virtual void Clear(Option_t *option="")
&lt; Clear - this method is called in loop for prepare the maker for the next event
Definition: StHltMaker.cxx:147
int id
primary key
Definition: HLTFormats.h:43
virtual void processBank(const HLT_EVE *bank)
&lt; Fill StHltEvent at event level
Definition: StHltMaker.cxx:268
int emcTowerSN
serial number in HLT_EMC
Definition: HLTFormats.h:122
float tanl
tg of the dip angle at (r,phi,z)
Definition: HLTFormats.h:57
unsigned short flag
Primaries flag=1, Secondaries flag=0.
Definition: HLTFormats.h:44
heavy fragment bank
Definition: HLTFormats.h:177
Bank with event level qualities.
Definition: HLTFormats.h:141
void fillTriggerReason(StHltEvent *)
fill triggered prticles (highpt heavyfragment di-electron) to trigger reason
Definition: StHltMaker.cxx:802
Definition: Stypes.h:40
short channel
= nModule*6+nCell
Definition: HLTFormats.h:82
unsigned int hltDecision
HLT trigger bits.
Definition: HLTFormats.h:143
void fillHeavyFragment(StHltEvent *)
fill heavy fragment information
Definition: StHltMaker.cxx:679
float phi0
azimuthal angle of the first point
Definition: HLTFormats.h:54
virtual Int_t Finish()
Definition: StMaker.cxx:776
float pt
pt (transverse momentum) at (r,phi,z)
Definition: HLTFormats.h:53
virtual Int_t Init()
&lt; Init - is a first method the top level StChain calls to initialize all its makers ...
Definition: StHltMaker.cxx:118
void fillNodePointer(StHltEvent *)
create pointers in track node
Definition: StHltMaker.cxx:581
int tofHitSN
serial number in HLT_TOF
Definition: HLTFormats.h:121
unsigned char ndedx
nr of clusters contributing to the dedx value
Definition: HLTFormats.h:49
Definition: Stypes.h:45
void fillDielectron(StHltEvent *)
fill di-electron information
Definition: StHltMaker.cxx:728
StHltEvent * GetHltEvent()
create StHltEvent point
Definition: StHltMaker.cxx:156