StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPeCMaker.h
1 // $Id: StPeCMaker.h,v 1.22 2015/07/23 11:52:27 ramdebbe Exp $
2 //
3 // $Log: StPeCMaker.h,v $
4 // Revision 1.22 2015/07/23 11:52:27 ramdebbe
5 // added flag to suppress tree to output and includes summary histograms
6 //
7 // Revision 1.21 2015/02/25 01:19:45 ramdebbe
8 // added a setter to select writing Roman Pot Collection to output tree
9 //
10 // Revision 1.20 2014/08/06 11:43:32 jeromel
11 // Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
12 //
13 // Revision 1.19 2013/12/27 16:45:16 ramdebbe
14 // added extrapolation of tracks to TOF, StBTofGeometry and St_geant_Maker with //!
15 //
16 // Revision 1.18 2013/01/24 15:43:14 ramdebbe
17 // added more flags to choose input or output tracks tof etc.
18 //
19 // Revision 1.17 2012/07/03 19:38:09 ramdebbe
20 // raised ClassDef from 1 to 2
21 //
22 // Revision 1.16 2012/06/13 15:45:46 ramdebbe
23 // Added flags to include TOF and Vertex branches in tree
24 //
25 // Revision 1.15 2003/11/25 01:54:32 meissner
26 // correct several bugs: eta cut for tracks, charge sorting, add counting of FTPC and TPC primary tracks, Add bbc information
27 //
28 // Revision 1.14 2003/09/10 19:47:25 perev
29 // ansi corrs
30 //
31 // Revision 1.13 2002/12/19 18:09:53 yepes
32 // MuDST input added
33 //
34 // Revision 1.12 2002/04/18 19:02:12 meissner
35 // Change Init to InitRun
36 //
37 // Revision 1.11 2001/09/14 18:00:22 perev
38 // Removed references to StRun.
39 //
40 // Revision 1.10 2001/02/12 21:15:57 yepes
41 // New version of StPeCMaker, lots of changes
42 //
43 // Revision 1.7 2000/04/21 19:09:42 nystrand
44 // Update StPeCPair class, new histograms
45 //
46 // Revision 1.6 2000/03/24 22:36:16 nystrand
47 // First version with StPeCEvent
48 //
49 // Revision 1.5 2000/01/20 23:03:15 nystrand
50 // First Version of StPeCMaker with new StEvent
51 //
52 // Revision 1.3 1999/07/15 13:57:21 perev
53 // cleanup
54 //
55 // Revision 1.2 1999/04/08 16:37:27 nystrand
56 // MakeBranch,SetBranch removed
57 //
58 // Revision 1.1 1999/04/06 20:47:35 akio
59 // The first version
60 //
61 // Revision 1.0 1999/03/05 11:00:00 Nystrand
62 // First Version
63 //
65 //
66 // StPeCMaker
67 //
68 // Description:
69 // Sample maker to access and analyze Peripheral Collisions through StEvent
70 //
71 // Environment:
72 // Software developed for the STAR Detector at Brookhaven National Laboratory
73 //
74 // Author List:
75 // Joakim Nystrand, LBNL
76 //
77 // History:
78 //
80 #ifndef StPeCMaker_HH
81 #define StPeCMaker_HH
82 #include "StMaker.h"
83 #include "StPeCEvent.h"
84 #include "StPeCTrigger.h"
85 #include "StPeCGeant.h"
86 #include "TH1.h"
87 #include "TH2.h"
88 #include "TNtuple.h"
89 #include "TFile.h"
90 #include "TTree.h"
91 #include "TString.h"
92 #include "StBTofUtil/StBTofGeometry.h"
93 #include "St_geant_Maker/St_geant_Maker.h"
94 
95 
96 class StEvent;
97 class StPeCEvent;
98 class StPeCPair;
99 class TH1F;
100 class TH2F;
101 class StMuDst;
102 
103 
104 
105 class StPeCMaker : public StMaker
106 {
107 public:
108  StPeCMaker(const Char_t *name = "analysis");
109  virtual ~StPeCMaker();
110  virtual Int_t Init();
111  virtual Int_t InitRun(Int_t runnr);
112  virtual Int_t Make();
113  virtual Int_t Finish();
114 
115  void setInfoLevel(Int_t in) {infoLevel = in ;};
116  void setFilter(Int_t fi) {filter = fi;};
117  void setMuDst(StMuDst* mu) {muDst = mu;}; //Accessor for muDst pointer
118  void setFileName ( TString name ) { treeFileName = name ; } ;
119  void setUseBemc ( Bool_t includeBemc = kFALSE ) { useBemc = includeBemc ; } ;
120  void setUseTOF ( Bool_t includeTOF = kFALSE ) { useTOF = includeTOF ; } ;
121  void setUseVertex ( Bool_t includeVertex = kFALSE ) { useVertex = includeVertex ; } ;
122  void setUseTracks ( Bool_t includeTracks = kFALSE ) { useTracks = includeTracks ; } ;
123  void setRomanPots ( Bool_t includeRP = kFALSE ) { useRP = includeRP ; } ;
124 
125  void setReadStMuDst ( Bool_t includeStMuDst = kFALSE ) { readStMuDst = includeStMuDst ; } ;
126  void setReadStEvent ( Bool_t includeStEvent = kFALSE ) { readStEvent = includeStEvent ; } ;
127  void setReadBothInputs ( Bool_t includeBoth = kFALSE ) { readStMuDst_and_StEvent = includeBoth ; } ;
128  void setSuppressTreeOut ( Bool_t suppressTree = kFALSE ) { treeOff = suppressTree ; } ;
129 
130  void setOutputPerRun ( Int_t in = 1 ) { outputPerRun = in ; } ;
131 
132  void setStarHall ( TVolume * pointer ) { mstarHall = pointer ; } ;
133 
134  TString treeFileName ;
135  Bool_t useBemc; //if TRUE BEMC information is written to ntuple
136  Bool_t useTOF; //if TRUE TOF information is written to ntuple
137  Bool_t useVertex; //if TRUE Vertex information is written to ntuple
138  Bool_t useTracks; //if TRUE track information is written to ntuple
139  Bool_t useRP; //if TRUE Roman Pot information is written to ntuple
140 
141  Bool_t readStMuDst; //if TRUE will work with information passed in StMuDst format
142  Bool_t readStEvent; //if TRUE will work with information passed in StEvent format
143  Bool_t readStMuDst_and_StEvent; //if TRUE will work with information passed in both StMuDst and StEvent format
144  Bool_t treeOff; //if TRUE the pico dst TTree will not be present in output files
145 
146  void setTriggerOfInterest ( const char * selectTrigger = "UPC_Main" ) { triggerChoice = selectTrigger ; } ;
147 
148  int countAcceptedVtx ;
149  TH1F * hNumVtx, * hNumAccVtx, * hNumAccWithTOF, * hNumRejecWithTOF, * hNumTrkRejecVtx, * hzVertexAccTOF, * hzVertexRejectTOF;
150  friend class StPeCPair;
151 
152 
153 protected:
154  TFile* m_outfile;
155 
156  TTree* uDstTree;
157  TTree* geantTree;
158 
159  StPeCEvent* pevent;
160  StPeCTrigger* trigger;
161  StBTofGeometry * mBTofGeom;
162  St_geant_Maker * geantU;
163  TVolume * mstarHall;
164  StPeCGeant* geant;
165 
166 
167 
168  Int_t infoLevel;
169  Int_t filter; //1 == two prong, 2 == four prong
170  Int_t outputPerRun ; // 1=output per run 0(default)=one output file
171  TList * fSnapShots;
172 
173 
174 
175 private:
176  StMuDst* muDst;
177  string triggerChoice; // default is UPC_Main, it will recognize UPC_Topo, ZDC_Main
178 
179 
180  Int_t Cuts(StEvent* event, StPeCEvent* pevent);
181  Int_t Cuts4Prong(StEvent* event, StPeCEvent* pevent);
182  Int_t triggerSim(StEvent*);
183 
184  virtual const char *GetCVS() const
185  {static const char cvs[]="Tag $Name: $ $Id: StPeCMaker.h,v 1.22 2015/07/23 11:52:27 ramdebbe Exp $ built " __DATE__ " " __TIME__ ; return cvs;}
186 
187  ClassDef(StPeCMaker,2)
188 };
189 
190 #endif
191 
192 
193 
virtual Int_t Finish()
Definition: StPeCMaker.cxx:483
virtual Int_t Make()
Definition: StPeCMaker.cxx:295
#include "StEventTypes.h"
Definition: StPeCEvent.h:83