StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBTofNtupleMaker.h
1 /*******************************************************************
2  *
3  * $Id: StBTofNtupleMaker.h,v 1.2 2015/07/28 22:50:03 smirnovd Exp $
4  *
5  * Author: Xin Dong
6  *****************************************************************
7  *
8  * Description: example maker to get the matched TOFr cells and fill
9  * into TOFr tree.
10  *
11  *****************************************************************
12  *
13  * $Log: StBTofNtupleMaker.h,v $
14  * Revision 1.2 2015/07/28 22:50:03 smirnovd
15  * C++11 requires a space between literal and identifier
16  *
17  * Revision 1.1 2010/04/09 00:28:48 dongx
18  * First release
19  *
20  * Revision 1.1 2010/04/09 00:16:05 dongx
21  * first release
22  *
23  *
24  *******************************************************************/
25 #ifndef StBTofNtupleMaker_hh
26 #define StBTofNtupleMaker_hh
27 #include "StMaker.h"
28 #include "StThreeVectorD.hh"
29 #include "StPhysicalHelixD.hh"
30 #include "StBTofCellData.h"
31 
32 #define __SIGMA_SCALE__ 1000.
33 #include <string>
34 #include <vector>
35 #ifndef ST_NO_NAMESPACES
36 using std::string;
37 using std::vector;
38 #endif
39 
40 class StEvent;
41 class StTrack;
42 class StGlobalTrack;
43 class StHelix;
44 #include "StThreeVectorF.hh"
45 class StTrackGeometry;
46 class StBTofGeometry;
47 class StBTofCollection;
48 class StBTofHitCollection;
49 class StSPtrVecBTofHit;
50 class StMuDst;
51 
52 class TFile;
53 class TTree;
54 
55 class StBTofNtupleMaker : public StMaker {
56  public:
57  StBTofNtupleMaker(const Char_t *name, const Char_t *outname);
59 
60  Int_t Init();
61  Int_t InitRun(int runnumber);
62  Int_t Make();
63  Int_t FinishRun(int runnumber);
64  Int_t Finish();
65 
66  void SetNtupleFileName(Char_t*);
67  void setOuterTrackGeometry();
68  void setStandardTrackGeometry();
69  void setInitGeomFromOther(const Bool_t);
71  void setMuDstIn(const Bool_t muDstIn=kTRUE);
73  void setUseEventVertex(const Bool_t val=kTRUE);
74 
75 private:
77  void processStEvent();
79  void processMuDst();
80 
81  void bookNtuples();
82 
83 private:
84 
85  StPhysicalHelix* mBeamHelix;
86 
87  StEvent* mEvent;
88  StMuDst* mMuDst;
89  Bool_t mMuDstIn;
90  Bool_t mUseEventVertex;
91 
92  StBTofGeometry *mBTofGeom;
93  Bool_t mInitGeomFromOther;
94  Bool_t mOuterTrackGeometry;
95 
96  // ntuple related data members
97  Int_t mAcceptedEvents;
98  Int_t mPvpdEntries;
99  Int_t mBTofEvents;
100  Int_t mBTofEntries;
101 
102  string mTupleFileName;
103  TFile *mTupleFile;
104 
105  StBTofCellData mCellData;
106 
107  Bool_t doPrintMemoryInfo;
108  Bool_t doPrintCpuInfo;
109 
110  TTree *mCellTuple;
111 
112  virtual const char *GetCVS() const
113  {static const char cvs[]="Tag $Name: $ $Id: StBTofNtupleMaker.h,v 1.2 2015/07/28 22:50:03 smirnovd Exp $ built " __DATE__ " " __TIME__ ; return cvs;}
114 
115  ClassDef(StBTofNtupleMaker,1)
116 };
117 
118 inline void StBTofNtupleMaker::setOuterTrackGeometry(){mOuterTrackGeometry=false;}
119 inline void StBTofNtupleMaker::setStandardTrackGeometry(){mOuterTrackGeometry=false;}
120 inline void StBTofNtupleMaker::SetNtupleFileName(Char_t* filename){mTupleFileName=filename;}
121 inline void StBTofNtupleMaker::setInitGeomFromOther(const Bool_t init) { mInitGeomFromOther = init; }
122 inline void StBTofNtupleMaker::setMuDstIn(Bool_t val) { mMuDstIn = val; }
123 inline void StBTofNtupleMaker::setUseEventVertex(const bool val) { mUseEventVertex=val; }
124 
125 #endif
void setUseEventVertex(const Bool_t val=kTRUE)
switch to turn on the use of event vertex for dca
~StBTofNtupleMaker()
default empty destructor
void setMuDstIn(const Bool_t muDstIn=kTRUE)
switch to read in StEvent/MuDst
Int_t Init()
initialize ntuple and daqmap, and reset counters
Int_t Make()
get tofr slat, pvpd rawdata and global data from StEvent and store in flat TTrees (ntuples) ...
StBTofNtupleMaker(const Char_t *name, const Char_t *outname)
constructor sets default parameters
Int_t Finish()
write and close the ntuple file