StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTofpNtupleMaker.h
1 
17 /* -------------------------------------------------------------------------
18  * $Log: StTofpNtupleMaker.h,v $
19  * Revision 1.3 2014/08/06 11:43:48 jeromel
20  * Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
21  *
22  * Revision 1.2 2004/04/01 19:19:00 dongx
23  * update for year4 run
24  *
25  * Revision 1.1 2003/08/07 23:55:47 geurts
26  * first release
27  *
28  *
29  * -------------------------------------------------------------------------
30  */
31 #ifndef StTofNtupleMaker_hh
32 #define StTofNtupleMaker_hh
33 #include "StMaker.h"
34 #include <string>
35 #ifndef ST_NO_NAMESPACES
36 using std::string;
37 #endif
38 #include "StTofpSlatData.h"
39 #include "StTofpMatchData.h"
40 
41 class StTofGeometry;
42 class StTofCollection;
43 class TFile;
44 class TNtuple;
45 class TTree;
46 
47 class StTofpNtupleMaker : public StMaker {
48  static const Int_t NTOFP = 41;
49  static const Int_t NPVPD = 6;
50 public:
51  StTofpNtupleMaker(const Char_t *name="tofpNtuple");
53 
54  Int_t Init();
55  Int_t Make();
56  Int_t Finish();
57 
58  void SetNtupleFileName(Char_t*);
59  void setOuterTrackGeometry();
60  void setStandardTrackGeometry();
61  void setValidAdcRange(Int_t, Int_t);
62  void setValidTdcRange(Int_t, Int_t);
63 
64  Bool_t doPrintMemoryInfo;
65  Bool_t doPrintCpuInfo;
66 
67 protected:
69  Float_t mTofpAdc[NTOFP];
70  Float_t mTofpTdc[NTOFP];
71  Float_t mPvpdAdc[NPVPD];
72  Float_t mPvpdAdcLoRes[NPVPD];
73  Float_t mPvpdTdc[NPVPD];
74 
75 private:
76  void bookNtuples();
77  Bool_t mYear2;
78  Bool_t mYear3;
79  Bool_t mYear4;
80  Bool_t mOuterTrackGeometry;
81 
82  Bool_t validAdc(float);
83  Bool_t validTdc(float);
84 
85  // various cut-offs and ranges
86  Float_t mMinValidTdc;
87  Float_t mMaxValidTdc;
88  Float_t mMinValidAdc;
89  Float_t mMaxValidAdc;
90 
91  // ntuple related data members
92  Int_t mAcceptedEvents;
93  Int_t mPvpdEntries;
94  Int_t mTofpEvents;
95  Int_t mTofpEntries;
96  StTofGeometry *mTofGeom;
97  string mTupleFileName;
98  TFile *mTupleFile;
99  StTofpSlatData mSlatData;
100  StTofpMatchData mMatchData;
101  TNtuple *mPvpdTuple;
102  TTree *mSlatTuple;
103  TTree *mMatchTuple;
104  TTree *mNoMatchTuple;
105  TNtuple *mHitPosTuple;
106 
107  virtual const char *GetCVS() const
108  {static const char cvs[]="Tag $Name: $ $Id: StTofpNtupleMaker.h,v 1.3 2014/08/06 11:43:48 jeromel Exp $ built " __DATE__ " " __TIME__ ; return cvs;}
109 
110  ClassDef(StTofpNtupleMaker,1)
111 };
112 
113 inline void StTofpNtupleMaker::setValidAdcRange(Int_t min, Int_t max){mMinValidAdc=min;mMaxValidAdc=max;}
114 inline void StTofpNtupleMaker::setValidTdcRange(Int_t min, Int_t max){mMinValidTdc=min;mMaxValidTdc=max;}
115 inline void StTofpNtupleMaker::setOuterTrackGeometry(){mOuterTrackGeometry=true;}
116 inline void StTofpNtupleMaker::setStandardTrackGeometry(){mOuterTrackGeometry=false;}
117 inline void StTofpNtupleMaker::SetNtupleFileName(Char_t* filename){mTupleFileName=filename;}
118 
119 inline Bool_t StTofpNtupleMaker::validAdc(float adc){return((adc>=mMinValidAdc) && (adc<=mMaxValidAdc));}
120 inline Bool_t StTofpNtupleMaker::validTdc(float tdc){return((tdc>=mMinValidTdc) && (tdc<=mMaxValidTdc));}
121 
122 #endif
Int_t Make()
get tofp slat, pvpd rawdata and global data from StEvent and store in flat TTrees (ntuples) ...
Structure for TOFp Match TTree.
Bool_t doPrintCpuInfo
control debug memory data
TOF Ntuple Maker.
Structure for TOFp Slat TTree.
Time-of-Flight Geometry Utilities.
Int_t getTofData(StTofCollection *)
control debug timing data
Int_t Init()
initialize ntuple and daqmap, and reset counters
Int_t Finish()
write and close the ntuple file
StTofpNtupleMaker(const Char_t *name="tofpNtuple")
constructor sets default parameters
~StTofpNtupleMaker()
default empty destructor