StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPeCLumiEntry.cxx
1 //
3 // Revision 1.0 2001/2/15 Pablo Yepes: yepes@rice.edu
4 //
6 #include <Stiostream.h>
7 #include "StPeCLumiEntry.h"
8 #include "StEventUtilities/StuRefMult.hh"
9 
10 ClassImp(StPeCLumiEntry)
11 
13  StPeCLumiEntry::Clear();
14 }
15 
16 void StPeCLumiEntry::Clear(const Option_t* t) {
17  runNr=0;
18  eventNr=0 ;
19  uTime=0;
20  triggerMask=0;
21  triggerWord=0;
22  triggerActionWord=0;
23  zdcEast=0;
24  zdcWest=0;
25  zdcSum=0;
26  zdcEastUA=0;
27  zdcWestUA=0;
28  zdcSumUA=0;
29 
30  ctbSum=0;
31  ctbSumMips=0;
32  nPrimary=0;
33  nGlobal=0;
34  nhminus=0;
35  xVtx=-9999;
36  yVtx=-9999;
37  zVtx=-9999;
38 }
39 
40 
41 
42 StPeCLumiEntry::~StPeCLumiEntry() {
43 }
44 
45 Int_t StPeCLumiEntry::fill ( StMuDst *muDst) {
46  StPeCLumiEntry::Clear();
47  StMuEvent *MuEvent = muDst->event();
48  if (MuEvent) {
49  eventNr = MuEvent->eventNumber();
50  runNr = MuEvent->runNumber();
51  uTime = (int ) MuEvent->runInfo().productionTime();
52  uTime-= 946681200; // 1 January 2000
53  // triggerMask =
54  triggerWord = MuEvent->l0Trigger().triggerWord();
55  triggerActionWord = MuEvent->l0Trigger().triggerActionWord();
56 
57  nhminus = MuEvent->refMultNeg();
58 
59  // trigger information
60  StZdcTriggerDetector* zdc=0;
61  StCtbTriggerDetector* ctb=0;
62 
63  zdc = & MuEvent->zdcTriggerDetector();
64  ctb = & MuEvent->ctbTriggerDetector();
65 
66  if(zdc){
67  // attenuated
68  zdcWest = zdc->adcSum(west) ;
69  zdcEast = zdc->adcSum(east) ;
70  zdcSum = zdc->adcSum() ;
71  // unattenuated see StEvent Manual
72  zdcWestUA = zdc->adc(0) ;
73  zdcEastUA = zdc->adc(4) ;
74  zdcSumUA = zdcEastUA+zdcWestUA;
75  }
76  // shorter but more risky
77  // zdcEast= event->triggerDetectorCollection()->zdc().adcSum(east);
78  // zdcWest= event->triggerDetectorCollection()->zdc().adcSum(west);
79  // zdcSum = event->triggerDetectorCollection()->zdc().adcSum();
80 
81  ctbSum=0;
82  ctbSumMips=0;
83  if(ctb){
84  for(UInt_t i=0; i < ctb->numberOfTrays(); i++){
85  for(UInt_t j=0; j < ctb->numberOfSlats(); j++){
86  ctbSum += ctb->mips(i,j,0);
87  ctbSumMips += int(ctb->mips(i,j,0)/5);
88  }
89  }
90  }
91 
92 
93  nGlobal = muDst->numberOfGlobalTracks ();
94  nPrimary = muDst->numberOfPrimaryTracks();
95 
96  StThreeVectorF vtx = MuEvent->primaryVertexPosition();
97 
98  xVtx = vtx.x();
99  yVtx = vtx.y();
100  zVtx = vtx.z();
101 
102  // Test Stuff
103  cout << "utime " << uTime<< endl;
104  // cout << "trigger mask" <<event->triggerMask() << endl;
105  cout << "tw " << triggerWord<< endl;
106  cout << "taw " << triggerActionWord<< endl;
107  cout << "Primaries: " << nPrimary << endl;
108  cout << "Globals : " << nGlobal << endl;
109  cout << "Uncorr hminus:" << nhminus << endl;
110  cout << "StPeCEvent : primary vertex " << xVtx << " "
111  << yVtx << " " << zVtx << endl;
112  cout << "LumiMaker: ZDC W:" <<zdcWest << " E: "<< zdcEast << " Sum " << zdcSum << endl;
113  }
114  return 0;
115 }
116 
117 
118 Int_t StPeCLumiEntry::fill ( StEvent *event) {
119 
120  StPeCLumiEntry::Clear();
121  // // eventP = event ;
122 
123 // Set Run and Event Number
124  eventNr = event->id() ;
125  // runNr = event->runId()*1000+filenumber;
126  runNr = event->runId();
127  uTime = event->time();
128  uTime-= 946681200; // 1 January 2000
129  triggerMask= event->triggerMask() ;
130  triggerWord=event->l0Trigger()->triggerWord() ;
131  triggerActionWord=event->l0Trigger()->triggerActionWord();
132 
133 
134  nhminus = uncorrectedNumberOfNegativePrimaries(*event);
135 
136  // trigger information
137  StZdcTriggerDetector* zdc=0;
138  StCtbTriggerDetector* ctb=0;
139  StTriggerDetectorCollection* trg = event->triggerDetectorCollection();
140 
141  if ( trg ) {
142  zdc = & trg->zdc();
143  ctb = & trg->ctb();
144  }
145  if(zdc){
146  // attenuated
147  zdcWest = zdc->adcSum(west) ;
148  zdcEast = zdc->adcSum(east) ;
149  zdcSum = zdc->adcSum() ;
150  // unattenuated see StEvent Manual
151  zdcWestUA = zdc->adc(0) ;
152  zdcEastUA = zdc->adc(4) ;
153  zdcSumUA = zdcEastUA+zdcWestUA;
154  }
155  // shorter but more risky
156  // zdcEast= event->triggerDetectorCollection()->zdc().adcSum(east);
157  // zdcWest= event->triggerDetectorCollection()->zdc().adcSum(west);
158  // zdcSum = event->triggerDetectorCollection()->zdc().adcSum();
159 
160  ctbSum=0;
161  ctbSumMips=0;
162  if(ctb){
163  for(UInt_t i=0; i < ctb->numberOfTrays(); i++){
164  for(UInt_t j=0; j < ctb->numberOfSlats(); j++){
165  ctbSum += ctb->mips(i,j,0);
166  ctbSumMips += int(ctb->mips(i,j,0)/5);
167  }
168  }
169  }
170 
171 
172  // Get the track nodes and count number of tracks
173  StSPtrVecTrackNode& exnode = event->trackNodes();
174  for( UInt_t in=0; in<exnode.size(); in++ ) {
175  nGlobal += exnode[in]->entries(global);
176  nPrimary += exnode[in]->entries(primary);
177  }
178 
179 
180  StPrimaryVertex* vtx = event->primaryVertex();
181  if(vtx) {
182  xVtx = vtx->position().x();
183  yVtx = vtx->position().y();
184  zVtx = vtx->position().z();
185  }
186 
187 
188  // Test Stuff
189  cout << "utime " << event->time() << endl;
190  cout << "trigger mask" <<event->triggerMask() << endl;
191  cout << "tw " << event->l0Trigger()->triggerWord() << endl;
192  cout << "taw " << event->l0Trigger()->triggerActionWord() << endl;
193  cout << "Primaries: " << nPrimary << endl;
194  cout << "Globals : " << nGlobal << endl;
195  cout << "Uncorr hminus:" << nhminus << endl;
196  cout << "StPeCEvent : primary vertex " << xVtx << " "
197  << yVtx << " " << zVtx << endl;
198  cout << "LumiMaker: ZDC W:" <<zdcWest << " E: "<< zdcEast << " Sum " << zdcSum << endl;
199 
200 
201  return 0 ;
202 }
203 
StThreeVectorF primaryVertexPosition(int vtx_id=-1) const
The StMuDst is supposed to be structured in &#39;physical events&#39;. Therefore there is only 1 primary vert...
Definition: StMuEvent.cxx:221
unsigned short refMultNeg(int vtx_id=-1)
Reference multiplicity of negative particles as defined in StEventUtilities/StuRefMult.hh for vertex vtx_id (-1 is default index from StMuDst)
Definition: StMuEvent.cxx:184
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320