StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTriggerSimuPlayMaker.cxx
1 //
3 // StTriggerSimuPlayMaker R.Fatemi, Adam Kocoloski , Jan Balewski (Fall, 2007)
4 //
5 // Goal: exercise L0,L2 trigger simulator, lot of examples, change as needed
6 //
7 //
9 
10 
11 //get L2
12 #include "StTriggerSimuMaker.h"
13 
14 //get HEAD Maker
15 #include "StTriggerSimuMaker.h"
16 #include "StBbcTriggerSimu.h"
17 #include "StBemcTriggerSimu.h"
18 #include "StL2TriggerSimu.h"
19 #include "StTriggerSimuPlayMaker.h"
20 
21 ClassImp(StTriggerSimuPlayMaker)
22 
23 StTriggerSimuPlayMaker::StTriggerSimuPlayMaker(const char *name):StMaker(name) {
24  mConfig=0;
25  mHList=0;
26 
27 }
28 
29 //========================================
30 StTriggerSimuPlayMaker::~StTriggerSimuPlayMaker(){
31 }
32 
33 
34 //_____________________________________________________________________________
35 void
36 StTriggerSimuPlayMaker::initHistoA(TString core) {
37  LOG_INFO <<Form("initHistoA(), mConfig=%d",mConfig)<<endm;
38  assert(mHList);
39 
40  assert(mHList);
41  memset(hA,0,sizeof(hA));
42 
43  hA[0]=0;
44  hA[1]=new TH1F(core+"trgID", "event counter for Jan",10,1,11);
45 
46 
47  //.... add histos to the list
48  int i;
49  for(i=0;i<mxAH;i++) {
50  if( hA[i]==0) continue;
51  mHList->Add( hA[i]);
52  }
53 }
54 
55 //_____________________________________________________________________________
56 Int_t
57 StTriggerSimuPlayMaker::Init() {
58  LOG_INFO <<Form("Init(), mConfig=%d",mConfig)<<endm;
59  initHistoA("spj_");
60 
61  return StMaker::Init();
62 }
63 
64 //========================================
65 void
66 StTriggerSimuPlayMaker::Clear(const Option_t*){
67  LOG_DEBUG<<"StTriggerSimuPlayMaker::Clear()"<<endm;
68 }
69 
70 
71 //========================================
72 Int_t
74 
75  if(mConfig==100) janTest100();
76 
77  return kStOK;
78 }
79 
80 //========================================
81 Int_t
83 
84  return kStOK;
85 }
86 
87 
88 //========================================
89 //========================================
90 //========================================
91 void
92 StTriggerSimuPlayMaker::janTest100(){
93 
94  int trigID=137611;
95  printf("%s:JanTest100()\n", GetName());
96 
97 
98  hA[1]->Fill(2);
99  StTriggerSimuMaker *trgSimMk= (StTriggerSimuMaker*) StMaker::GetChain()->GetMaker("StarTrigSimu");
100  assert(trgSimMk);
101  int dec=trgSimMk->isTrigger(trigID);
102  printf("trigID=%d final decision=%d ,",trigID,dec);
103  if(trgSimMk->bbc) printf("L0-BBC decision==%d ,",trgSimMk->bbc->triggerDecision(trigID));
104  if(trgSimMk->bemc) printf("L0-BEMC decision=%d ,",trgSimMk->bemc->triggerDecision(trigID));
105  if(trgSimMk->lTwo) printf("L2 decision=%d ",trgSimMk->lTwo->triggerDecision(trigID));
106  printf("\n");
107 }
108 
109 
110 // $Id: StTriggerSimuPlayMaker.cxx,v 1.3 2007/11/18 21:58:50 balewski Exp $
111 //
StTriggerSimuDecision triggerDecision(int trigId)
like isTrigger(), but returns kDoNotCare if detector isn&#39;t a part of the given trigId ...
StTriggerSimuDecision triggerDecision(int trigId)
like isTrigger(), but returns kDoNotCare if detector isn&#39;t a part of the given trigId ...
virtual const char * GetName() const
special overload
Definition: StMaker.cxx:237
Definition: Stypes.h:40
StTriggerSimuDecision triggerDecision(int trigId)
like isTrigger(), but returns kDoNotCare if detector isn&#39;t a part of the given trigId ...