StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuEvent.h
1 /***************************************************************************
2  *
3  * $Id: StMuEvent.h,v 1.37 2019/02/21 14:00:02 jdb Exp $
4  * Author: Frank Laue, BNL, laue@bnl.gov
5  *
6  ***************************************************************************/
7 #ifndef StMuEvent_h
8 #define StMuEvent_h
9 
10 #include "TObject.h"
11 #include "TArrayI.h"
12 #include "StMuL3EventSummary.h"
13 #include "StMuEmcCollection.h"
14 #include "StMuFmsCollection.h"
15 #include "StMuTriggerIdCollection.h"
16 
17 #include "StEvent/StEventInfo.h"
18 #include "StEvent/StRunInfo.h"
19 #include "StEvent/StEventSummary.h"
20 #include "StEvent/StVpdTriggerDetector.h"
21 #include "StEvent/StMtdTriggerDetector.h"
22 #include "StEvent/StCtbTriggerDetector.h"
23 #include "StEvent/StZdcTriggerDetector.h"
24 #include "StEvent/StBbcTriggerDetector.h"
25 #include "StEvent/StEmcTriggerDetector.h"
26 #include "StEvent/StFpdTriggerDetector.h"
27 #include "StEvent/StFmsTriggerDetector.h"
28 #include "StEvent/StFpdCollection.h"
29 #include "StEvent/StL0Trigger.h"
30 #include "StEvent/StTriggerIdCollection.h"
31 #include "StEvent/StDetectorState.h"
32 
33 #ifndef __NO_STRANGE_MUDST__
34 #include "StStrangeMuDstMaker/StStrangeMuDst.hh"
35 #endif
36 //#include "StarClassLibrary/StThreeVectorD.hh"
37 
38 class StEvent;
39 class StMuCut;
40 class StTofCollection; // calibrated vpd for TOF
41 class StTriggerData;
42 
49 class StMuEvent : public TObject {
50  public:
51  StMuEvent();
52  StMuEvent(const StEvent*);
53  virtual ~StMuEvent();
54  virtual void Clear (Option_t * opt=""){
55  mL2Result.Set(0);
56  mEventSummary.Clear(opt);
57  }
58 
59  int eventId();
60  int eventNumber();
61  int runId();
62  int runNumber();
63  // classes taken straight from StEvent
64  StRunInfo& runInfo();
65  StEventInfo& eventInfo();
66  StEventSummary& eventSummary();
67  StVpdTriggerDetector& vpdTriggerDetector();
68  StMtdTriggerDetector& mtdTriggerDetector();
69  StCtbTriggerDetector& ctbTriggerDetector();
70  StZdcTriggerDetector& zdcTriggerDetector();
71  StBbcTriggerDetector& bbcTriggerDetector();
72  StEmcTriggerDetector& emcTriggerDetector();
73  StFpdTriggerDetector& fpdTriggerDetector();
74  StFmsTriggerDetector& fmsTriggerDetector();
75  StFpdCollection& fpdCollection();
76  StL0Trigger& l0Trigger();
77  // Special classes for the muDst
78  StMuL3EventSummary& l3EventSummary();
79  StMuTriggerIdCollection& triggerIdCollection();
80  const StTriggerData* triggerData() const;
81 
83  unsigned short refMultPos(int vtx_id = -1);
85  unsigned short refMultNeg(int vtx_id = -1);
87  unsigned short refMult(int vtx_id = -1);
89  unsigned short refMultFtpcEast(int vtx_id = -1);
91  unsigned short refMultFtpcWest(int vtx_id = -1);
93  unsigned short refMultFtpc(int vtx_id = -1);
94  unsigned short grefmult(int vtx_id=-1);
95  unsigned short btofTrayMultiplicity();
96  unsigned short etofHitMultiplicity();
97  unsigned short etofDigiMultiplicity();
98  float nearestVertexZ(int vtx_id=-1);
99 
101  double reactionPlane(unsigned short);
102  void setReactionPlane(unsigned short, double v);
104  double reactionPlanePtWgt(unsigned short);
105  void setReactionPlanePtWgt(unsigned short, double v);
106  double magneticField();
107  double zdcAdcAttentuatedSumWest();
108  double zdcAdcAttentuatedSumEast();
109  double ctbMultiplicity();
111  StThreeVectorF primaryVertexPosition(int vtx_id = -1) const;
112  StThreeVectorF primaryVertexErrors(int vtx_id = -1) const;
113  TArrayI& L2Result(); // Raw L2Result[] array
114 
115  // Calibrated VPD info from StTofCollection in StEvent
116  unsigned int numberOfVpdEastHits();
117  unsigned int numberOfVpdWestHits();
118  float vpdTstart();
119  float vpdTdiff();
120  float vpdVz();
121 
122  unsigned int numberOfPxlInnerHits();
123  unsigned int numberOfPxlOuterHits();
124  unsigned int numberOfIstHits();
125  unsigned int numberOfSsdHits();
126 
127  protected:
128  void clear();
129  void fill(const StEvent*);
130 
131  // classes that we just takes from StEvent
132  StRunInfo mRunInfo;
133  StEventInfo mEventInfo;
134  StEventSummary mEventSummary;
135  StVpdTriggerDetector mVpdTriggerDetector;
136  StMtdTriggerDetector mMtdTriggerDetector;
137  StCtbTriggerDetector mCtbTriggerDetector;
138  StZdcTriggerDetector mZdcTriggerDetector;
139  StBbcTriggerDetector mBbcTriggerDetector;
140  StEmcTriggerDetector mEmcTriggerDetector;
141  StFpdTriggerDetector mFpdTriggerDetector;
142  StFmsTriggerDetector mFmsTriggerDetector;
143  StFpdCollection mFpdCollection;
144  StL0Trigger mL0Trigger;
145  // special classes from MuDst
146  StMuL3EventSummary mL3EventSummary;
147  StMuTriggerIdCollection mTriggerIdCollection;
148  StTriggerData* mTriggerData;
149 
150  UShort_t mRefMultPos;
151  UShort_t mRefMultNeg;
152  UShort_t mRefMultFtpcEast;
153  UShort_t mRefMultFtpcWest;
154  Float_t mReactionPlane[2];
155  Float_t mReactionPlanePtWgt[2];
156 
157  UShort_t mNHitsHFT[4];
158 
159  StThreeVectorF mPrimaryVertexError;
160 
161  TArrayI mL2Result; // Raw L2 info
162 
163  UInt_t mVpdEast; // VPD East Hit pattern
164  UInt_t mVpdWest; // VPD West Hit pattern
165  Float_t mVpdTstart; // VPD start time (calibrated)
166  Float_t mVpdTdiff; // VPD time difference (calibrated)
167  Float_t mVpdVz; // VPD vertex z
168 
169  friend class StMuDst;
170  friend class StMuDstMaker;
171  friend class StMuMomentumShiftMaker;
172  friend class StMuL3EventSummary;
173  ClassDef(StMuEvent,15)
174 };
175 
176 inline int StMuEvent::eventId() { return mEventInfo.id();}
177 inline int StMuEvent::eventNumber() { return mEventInfo.id();}
178 inline int StMuEvent::runId() { return mEventInfo.runId();}
179 inline int StMuEvent::runNumber() { return mEventInfo.runId();}
180 inline StRunInfo& StMuEvent::runInfo() {return mRunInfo;}
181 inline StEventInfo& StMuEvent::eventInfo() {return mEventInfo;}
182 inline StEventSummary& StMuEvent::eventSummary() {return mEventSummary;}
183 inline StVpdTriggerDetector& StMuEvent::vpdTriggerDetector() {return mVpdTriggerDetector;}
184 inline StMtdTriggerDetector& StMuEvent::mtdTriggerDetector() {return mMtdTriggerDetector;}
185 inline StCtbTriggerDetector& StMuEvent::ctbTriggerDetector() {return mCtbTriggerDetector;}
186 inline StZdcTriggerDetector& StMuEvent::zdcTriggerDetector() {return mZdcTriggerDetector;}
187 inline StBbcTriggerDetector& StMuEvent::bbcTriggerDetector() {return mBbcTriggerDetector;}
188 inline StEmcTriggerDetector& StMuEvent::emcTriggerDetector() {return mEmcTriggerDetector;}
189 inline StFpdTriggerDetector& StMuEvent::fpdTriggerDetector() {return mFpdTriggerDetector;}
190 inline StFmsTriggerDetector& StMuEvent::fmsTriggerDetector() {return mFmsTriggerDetector;}
191 inline StFpdCollection& StMuEvent::fpdCollection() {return mFpdCollection;}
192 inline StL0Trigger& StMuEvent::l0Trigger() {return mL0Trigger;}
193 // special classes for muDst
194 inline StMuL3EventSummary& StMuEvent::l3EventSummary() {return mL3EventSummary;}
195 inline StMuTriggerIdCollection& StMuEvent::triggerIdCollection(){return mTriggerIdCollection;}
196 //inline const StTriggerData* StMuEvent::triggerData() const { if(mTriggerData!=0) {mTriggerData->setDebug(0); return mTriggerData; } else return 0; }
197 inline const StTriggerData* StMuEvent::triggerData() const { return mTriggerData; }
198 inline double StMuEvent::reactionPlane(unsigned short s) {return (s==0) ? mReactionPlane[0] : mReactionPlane[1];}
199 inline void StMuEvent::setReactionPlane(unsigned short s, double v) {(s==0) ? mReactionPlane[0]=v : mReactionPlane[1]=v;}
200 inline double StMuEvent::reactionPlanePtWgt(unsigned short s) {return (s==0) ? mReactionPlanePtWgt[0] : mReactionPlanePtWgt[1];}
201 inline void StMuEvent::setReactionPlanePtWgt(unsigned short s, double v) {(s==0) ? mReactionPlanePtWgt[0]=v : mReactionPlanePtWgt[1]=v;}
202 inline double StMuEvent::magneticField() { return mEventSummary.magneticField();}
203 inline double StMuEvent::zdcAdcAttentuatedSumWest() { return mZdcTriggerDetector.adc(10);}
204 inline double StMuEvent::zdcAdcAttentuatedSumEast() { return mZdcTriggerDetector.adc(13);}
205 inline double StMuEvent::ctbMultiplicity() {
206  double ctb=0;
207  for (unsigned int slat = 0; slat < mCtbTriggerDetector.numberOfSlats(); slat++) {
208  for (unsigned int tray = 0; tray < mCtbTriggerDetector.numberOfTrays(); tray++) {
209  ctb += mCtbTriggerDetector.mips(tray,slat,0);
210  }
211  }
212  return ctb;
213 }
214 inline TArrayI &StMuEvent::L2Result() { return mL2Result; }
215 inline unsigned int StMuEvent::numberOfVpdEastHits() {
216  unsigned int num = 0;
217  for(int i=0;i<32;i++) {
218  num += mVpdEast>>i & 1;
219  }
220  return num;
221 }
222 inline unsigned int StMuEvent::numberOfVpdWestHits() {
223  unsigned int num = 0;
224  for(int i=0;i<32;i++) {
225  num += mVpdWest>>i & 1;
226  }
227  return num;
228 }
229 inline float StMuEvent::vpdTstart() { return mVpdTstart; }
230 inline float StMuEvent::vpdTdiff() { return mVpdTdiff; }
231 inline float StMuEvent::vpdVz() { return mVpdVz; }
232 inline unsigned int StMuEvent::numberOfPxlInnerHits() { return mNHitsHFT[0]; }
233 inline unsigned int StMuEvent::numberOfPxlOuterHits() { return mNHitsHFT[1]; }
234 inline unsigned int StMuEvent::numberOfIstHits() { return mNHitsHFT[2]; }
235 inline unsigned int StMuEvent::numberOfSsdHits() { return mNHitsHFT[3]; }
236 
237 #endif
238 /***************************************************************************
239  *
240  * $Log: StMuEvent.h,v $
241  * Revision 1.37 2019/02/21 14:00:02 jdb
242  * Bumped the ClassDef versions in MuDst where eTOF was added. I also added the etofTypes to the LinkDef file
243  *
244  * Revision 1.36 2019/02/21 13:32:54 jdb
245  * Inclusion of ETOF MuDst code. This code adds support for the full set of ETOF data which includes EtofDigi, EtofHit, EtofHeader. The code essentially copies similar structures from StEvent and additionally rebuilds the maps between Digis and Hits. Accessor methods are added based on the pattern from BTOF to provide access to data at various levels. The code for accessing the PID traits provided by ETOF is also provided
246  *
247  * Revision 1.35 2017/04/17 20:40:56 smirnovd
248  * StMuEvent: Declare getters const. They don't modify anything
249  *
250  * Revision 1.34 2015/07/21 22:27:35 jeromel
251  * Direct use of -D and one misisng NO_STRANGE_MUDST added
252  *
253  * Revision 1.33 2015/07/21 20:47:46 jeromel
254  * Brute force removal of include file (this include is compiled in many package + rootcint)
255  *
256  * Revision 1.32 2015/05/05 18:32:12 jeromel
257  * mNHitsHFT added but class version not incremented - fixed
258  *
259  * Revision 1.31 2015/03/06 20:02:01 jdb
260  * Added 4 unsigned shorts to StMuEvent at request of Xin Dong. Change StMuEvent.{h, cxx}
261  *
262  * Revision 1.30 2010/05/28 19:47:51 tone421
263  * Removed a cout needed for test purposes in StMuDstMaker. Made sure StTriggerData objects copied into the MuDst have a debug value of 0..
264  *
265  * Revision 1.29 2010/05/26 17:34:59 tone421
266  * Added const protection to StTriggerData* StMuEvent::triggerData()
267  *
268  * Revision 1.27 2010/02/03 17:16:22 tone421
269  * Added function StMuEvent::nearestVertexZ(int vtx_id) which returns the z distance of the nearest vertex in relation to vertex vtx_id
270  *
271  * Revision 1.26 2010/02/03 04:54:45 tone421
272  * Added StMuEvent::btofTrayMultiplicity() to return only TOF hits from trays. Should be looked at instead of ctbSum for run 9 and beyond.
273  *
274  * Revision 1.25 2010/01/25 03:57:39 tone421
275  * Added FMS and Roman pot arrays
276  *
277  * Revision 1.24 2009/08/25 15:49:49 fine
278  * fix the compilation issues under SL5_64_bits gcc 4.3.2
279  *
280  * Revision 1.23 2009/01/09 19:43:47 tone421
281  * OAdded gremult in StMuEvent (globals tracks with DCA < 3cm, >= 10 TPC fit hits and |eta| < 0.5)
282  *
283  * Revision 1.22 2008/11/18 15:34:33 tone421
284  * 2 changes. The first ensures StMuEvent::primaryVertexPosition() returns the position of current vertex (set by StMuDst::setVertexIndex(Int_t vtx_id)): previously it returned the position of best ranked vertex. The second insures events with no vertex have a PVx=PYy=PYz=-999 rather than 0.
285  *
286  * Revision 1.21 2008/06/26 15:41:29 tone421
287  *
288  * Add getter and setter for vpd z vertex position
289  *
290  * Revision 1.20 2008/02/20 09:00:48 mvl
291  * Included FMS data (StFMSTriggerDetector) (code by Akio)
292  *
293  * Revision 1.19 2007/09/21 02:27:12 mvl
294  * Added calibrated VPD info from StTofCollection (run-8 prep)
295  *
296  * Revision 1.18 2007/09/05 23:21:21 mvl
297  * Added StMtdTriggerDetector
298  *
299  * Revision 1.17 2007/08/02 20:46:46 mvl
300  * Switch off Q-vector branhces in StMuDstMaker and increase version number in StMuEvent.
301  * This is to avoid wranings when reading P07ib data which has Q-vector information stored with more recent libraries.
302  *
303  * Revision 1.16 2007/04/20 06:25:21 mvl
304  * Removed Q-vectors (will implement utility class).
305  * Added Vpd info.
306  *
307  * Revision 1.14 2006/09/20 01:50:35 mvl
308  * Added data member and code for L2Result array (TArrayI).
309  *
310  * Revision 1.13 2005/08/19 19:46:05 mvl
311  * Further updates for multiple vertices. The main changes are:
312  * 1) StMudst::primaryTracks() now returns a list (TObjArray*) of tracks
313  * belonging to the 'current' primary vertex. The index number of the
314  * 'current' vertex can be set using StMuDst::setCurrentVertex().
315  * This also affects StMuDst::primaryTracks(int i) and
316  * StMuDst::numberOfprimaryTracks().
317  * 2) refMult is now stored for all vertices, in StMuPrimaryVertex. The
318  * obvious way to access these numbers is from the StMuprimaryVertex structures,
319  * but for ebakcward compatibility a function is provided in StMuEvent as well
320  * (this is the only function taht works for existing MuDst)
321  *
322  * As an aside, I've also changes the internals of StMuDst::createStEvent and
323  * StMuDst::fixTrackIndices() to be able to deal with a larger range of index numbers for tracks as generated by Ittf.
324  *
325  * BIG FAT WARNING: StMudst2StEventMaker and StMuDstFilterMaker
326  * do not fully support the multiple vertex functionality yet.
327  *
328  * Revision 1.12 2005/03/17 21:55:00 mvl
329  * Added StMuMomentumShiftMaker for applying a magnetic field scaling to the reconstructed MuDst. This class accesses StMuTrack, StMuEvent and StMuHelix and some Strangeness MuDst data members as 'friend'
330  *
331  * Revision 1.11 2004/12/02 00:19:52 mvl
332  * Added error on primary vertex
333  *
334  * Revision 1.10 2004/08/04 17:57:13 mvl
335  * Added EMC trigger information and fpd trigger (tower) information
336  *
337  * Revision 1.9 2004/05/02 04:10:14 perev
338  * private => protected
339  *
340  * Revision 1.8 2003/07/22 19:14:40 laue
341  * multiplicities for FTPC added
342  *
343  * Revision 1.7 2003/02/20 15:29:42 laue
344  * StMuTriggerIdCollection added
345  *
346  * Revision 1.6 2003/02/19 13:52:11 laue
347  * added the StTriggerIdCollection
348  *
349  * Revision 1.5 2003/01/09 18:59:46 laue
350  * initial check in of new EMC classes and the changes required
351  *
352  * Revision 1.4 2002/08/23 17:30:18 laue
353  * additional member functions added (Helen Caines' request)
354  *
355  * Revision 1.3 2002/08/20 19:55:49 laue
356  * Doxygen comments added
357  *
358  * Revision 1.2 2002/03/20 16:04:11 laue
359  * minor changes, mostly added access functions
360  *
361  * Revision 1.1 2002/03/08 17:04:17 laue
362  * initial revision
363  *
364  *
365  **************************************************************************/
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
void fill(const StEvent *)
Definition: StMuEvent.cxx:79
unsigned short refMultFtpcWest(int vtx_id=-1)
Reference multiplicity of particles in the west FTPC as defined in StEventUtilities/StuFtpcRefMult.hh for vertex vtx_id (-1 is default index from StMuDst)
Definition: StMuEvent.cxx:208
unsigned short refMultFtpc(int vtx_id=-1)
Reference multiplicity of particles in the east+west FTPC as defined in StEventUtilities/StuFtpcRefMu...
Definition: StMuEvent.cxx:219
unsigned short refMult(int vtx_id=-1)
Reference multiplicity of charged particles as defined in StEventUtilities/StuRefMult.hh for vertex vtx_id (-1 is default index from StMuDst)
Definition: StMuEvent.cxx:195
double reactionPlane(unsigned short)
Currently not filled properly.
Definition: StMuEvent.h:198
double reactionPlanePtWgt(unsigned short)
Currently not filled properly.
Definition: StMuEvent.h:200
Collection of trigger ids as stored in MuDst.
unsigned short refMultPos(int vtx_id=-1)
Reference multiplicity of positive particles as defined in StEventUtilities/StuRefMult.hh for vertex vtx_id (-1 is default index from StMuDst)
Definition: StMuEvent.cxx:173
unsigned short refMultFtpcEast(int vtx_id=-1)
Reference multiplicity of particles in the east FTPC as defined in StEventUtilities/StuFtpcRefMult.hh for vertex vtx_id (-1 is default index from StMuDst)
Definition: StMuEvent.cxx:197