StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EEmcTTMMaker.h
1 // Hey Emacs this is -*-c++-*-
2 // $Id: EEmcTTMMaker.h,v 1.20 2014/08/06 11:43:02 jeromel Exp $
3 #ifndef STAR_EEmcTTMMaker
4 #define STAR_EEmcTTMMaker
5 
6 #ifndef StMaker_H
7 #include "StMaker.h"
8 #endif
9 
10 #include <ostream>
11 #include <map>
12 
13 #include "TString.h"
14 
15 #if !defined(ST_NO_NAMESPACES)
16 using std::map;
17 using std::ostream;
18 #endif
19 
20 class TH1F;
21 class TTree;
22 class TFile;
23 class TString;
24 class TList;
25 
26 class StChain;
27 class StMuTrack;
28 class EEmcGeomSimple;
29 
30 class StEventInfo;
31 class StEventSummary;
33 
34 class StMuDstMaker;
35 class StEEmcDb;
36 
37 class EEmcTower;
38 
40 class EEmcTTMMaker : public StMaker {
41 public:
43  static const Int_t kDefMaxCTBsum ;
45  static const Int_t kDefMinTrackHits ;
47  static const Double_t kDefMinTrackLength ;
49  static const Double_t kDefMinTrackPt ;
51  static const Double_t kDefMinTrackEta ;
53  static const Double_t kDefMaxTrackEta ;
55  static const Double_t kDefDeltaPhiCut ;
57  static const Double_t kDefDeltaEtaCut ;
58 
62  EEmcTTMMaker(const char *self = "ttmmk",
63  class StMuDstMaker *mumaker = NULL);
64 
66  virtual ~EEmcTTMMaker();
67 
69  virtual Int_t Init();
71  virtual Int_t Make();
74  virtual void Clear(Option_t *option = "");
76  virtual Int_t Finish();
77 
79  void ResetZPositionsArray() { mZ.clear(); }
83  void AddZPosition(const TString name, const double zpos) { mZ[zpos]=name; }
84 
85 
87  Int_t GetMaxCTBSum () const { return mMaxCTBsum ; }
89  void SetMaxCTBSum (Int_t v) { mMaxCTBsum=v ; }
90 
91 
93  Int_t GetMinTrackHits () const { return mMinTrackHits; }
95  void SetMinTrackHits (Int_t v) { mMinTrackHits=v ; }
96 
97 
99  Double_t GetMinTrackLength() const { return mMinTrackLength ; }
101  void SetMinTrackLength(Double_t v) { mMinTrackLength=v ; }
102 
104  Double_t GetMinTrackPt () const { return mMinTrackPt ; }
106  void SetMinTrackPt (Double_t v) { mMinTrackPt=v ; }
107 
109  Double_t GetMinTrackEta () const { return mMinTrackEta ; }
111  void SetMinTrackEta (Double_t v) { mMinTrackEta=v ; }
112 
114  Double_t GetMaxTrackEta () const { return mMaxTrackEta ; }
116  void SetMaxTrackEta (Double_t v) { mMaxTrackEta=v ; }
117 
118 
120  Double_t GetDeltaPhiCut() const { return mPhiFac; }
122  void SetDeltaPhiCut(Double_t v=1.0) { mPhiFac=v; }
123 
125  Double_t GetDeltaEtaCut() const { return mEtaFac; }
127  void SetDeltaEtaCut(Double_t v=1.0) { mEtaFac=v; }
128 
130  void SetFileName( const char *string) { mFileName=TString(string); mTreeOut=true; }
132  void WriteTree( const bool f ) { mTreeOut = f ; }
133 
135  ULong_t GetNMatched() const { return mNMatched; };
136 
138  TList *GetTracks() { return mTrackList; };
140  TList *GetTowers() { return mTowerList; };
141 
143  TList *GetMatchList() { return mMatchList ; };
144 
145 
147  ostream& Summary ( ostream &out ) const ;
148 
149 protected:
151  void ResetStats() { mNMatched=mNEvents=0L; };
153  Bool_t AcceptTrack( const StMuTrack *track);
155  Bool_t MatchTrack ( const double dphi, const double deta, const double phihw, const double etahw);
156 
157 
158 private:
159  Int_t mMaxCTBsum ;
160  Int_t mMinTrackHits ;
161  Double_t mMinTrackLength ;
162  Double_t mMinTrackPt ;
163  Double_t mMinTrackEta ;
164  Double_t mMaxTrackEta ;
166  Double_t mPhiFac;
167  Double_t mEtaFac;
170  // control histograms for tracks
172  TH1F *hTrackNHits;
173  TH1F *hTrackLen;
174  TH1F *hTrackPt ;
175  TH1F *hTrackPtot;
177  TH1F *hTrackDCA[3];
178  TH1F *hVertex[3] ;
180  StMuDstMaker *mMuDstMaker; // toplevel muDST maker
181  StEEmcDb *mEEmcDb; // EEMC database maker
182  //
183  EEmcGeomSimple& mGeom; // tower geometry
184 
185  TString mFileName; // output file name
186  TFile *mFile; // output file
187  TTree *mTree; // output tree
188 
189  map<double,TString> mZ; // a map that hold z positions
190 
191  // stats
192  ULong_t mNMatched; // number of matched tracks
193  ULong_t mNEvents; // total number of events
194 
195  //
196  TList *mTrackList;
197  TList *mTowerList;
198  TList *mMatchList;
199  //
200  StEventInfo *mEvInfo;
201  StEventSummary *mEvSumm;
202  StMuTriggerIdCollection *mEvTrig;
203 
204  bool mTreeOut;
205 
206  public:
207  // StMaker jumbo mumbo
209  virtual const char *GetCVS() const {
210  static const char cvs[]=
211  "Tag $Name: $ $Id: EEmcTTMMaker.h,v 1.20 2014/08/06 11:43:02 jeromel Exp $ built " __DATE__ " " __TIME__ ;
212  return cvs;
213  }
214 
215  ClassDef(EEmcTTMMaker, 1) //
216 };
217 
219 ostream& operator<<(ostream &out, const EEmcTTMMaker &ttm);
220 #endif
221 
222 // $Log: EEmcTTMMaker.h,v $
223 // Revision 1.20 2014/08/06 11:43:02 jeromel
224 // Suffix on literals need to be space (later gcc compiler makes it an error) - first wave of fixes
225 //
226 // Revision 1.19 2009/02/04 20:33:24 ogrebeny
227 // Moved the EEMC database functionality from StEEmcDbMaker to StEEmcUtil/database. See ticket http://www.star.bnl.gov/rt2/Ticket/Display.html?id=1388
228 //
229 // Revision 1.18 2004/06/03 21:02:29 zolnie
230 // fixed subtle bug: when e.g. dphi = +180.(tower center) - -180.0(track)
231 // the match would be rejected - in practice it never happen
232 //
233 // Revision 1.17 2004/05/10 23:02:53 zolnie
234 // EEmcTTMMaker produces now nanoDST
235 //
236 // Revision 1.16 2004/05/07 22:02:56 zolnie
237 // fixed a nasty memory leak in EEmcTTMMaker
238 //
239 // Revision 1.15 2004/05/06 16:02:49 zolnie
240 // more docs
241 //
242 // Revision 1.14 2004/05/05 23:00:57 zolnie
243 // more docs
244 //
245 // Revision 1.13 2004/05/05 22:04:16 zolnie
246 // forgor about EEmcTower
247 //
248 // Revision 1.12 2004/05/05 21:37:37 zolnie
249 // ver 2.0 released
250 //
251 // Revision 1.11 2004/05/04 18:28:56 zolnie
252 // version after split
253 //
254 // Revision 1.10 2004/04/14 16:40:34 zolnie
255 // *** empty log message ***
256 //
257 // Revision 1.9 2004/04/14 16:20:25 zolnie
258 // added static method Run for faster analysis under root4star
259 //
260 // Revision 1.8 2004/04/13 17:26:09 zolnie
261 // more adaptation needed
262 //
263 // Revision 1.7 2004/01/26 21:51:54 zolnie
264 // shorter names
265 //
266 // Revision 1.6 2004/01/26 21:08:32 zolnie
267 // working track/tower display (before big farewell cleanup)
268 //
269 // Revision 1.5 2004/01/19 22:07:51 zolnie
270 // toward track/tower display
271 //
272 // Revision 1.4 2004/01/14 22:59:02 zolnie
273 // use doxygen for documentation
274 //
275 // Revision 1.3 2004/01/06 22:42:56 zolnie
276 // provide summary/statistics info
277 //
278 // Revision 1.2 2004/01/06 21:33:51 zolnie
279 // release
280 //
281 // Revision 1.1 2004/01/06 17:45:11 zolnie
282 // close to release
283 //
void ResetZPositionsArray()
clears z positions array
Definition: EEmcTTMMaker.h:79
TList * GetTowers()
returns a list of accepted EEmcTower objects
Definition: EEmcTTMMaker.h:140
void SetDeltaEtaCut(Double_t v=1.0)
sets delta eta cut see matchparams
Definition: EEmcTTMMaker.h:127
void SetMinTrackPt(Double_t v)
sets minimum track pT required
Definition: EEmcTTMMaker.h:106
static const Double_t kDefDeltaPhiCut
default value for the maximum distance in phi from the tower center
Definition: EEmcTTMMaker.h:55
class EEmcTTMMaker
Definition: EEmcTTMMaker.h:40
Double_t GetDeltaPhiCut() const
gets delta phi cut see matchparams
Definition: EEmcTTMMaker.h:120
void SetMinTrackEta(Double_t v)
sets minimum pseudorapidity at the origin required
Definition: EEmcTTMMaker.h:111
static const Double_t kDefMinTrackPt
default value for the minimum track pT allowed
Definition: EEmcTTMMaker.h:49
Double_t GetMinTrackPt() const
gets minimum track pT required
Definition: EEmcTTMMaker.h:104
Double_t GetMinTrackLength() const
gets minimum track length required
Definition: EEmcTTMMaker.h:99
EEmcTTMMaker(const char *self="ttmmk", class StMuDstMaker *mumaker=NULL)
virtual const char * GetCVS() const
Displayed on session exit, leave it as-is please ...
Definition: EEmcTTMMaker.h:209
ostream & Summary(ostream &out) const
prints matching cuts and statistics summary
void ResetStats()
resets the collected statistics
Definition: EEmcTTMMaker.h:151
void AddZPosition(const TString name, const double zpos)
Definition: EEmcTTMMaker.h:83
TList * GetMatchList()
returns a list of matches (EEmcTTMatch objects)
Definition: EEmcTTMMaker.h:143
virtual void Clear(Option_t *option="")
static const Double_t kDefMaxTrackEta
default value for the maximum track pseudorapidity at origin allowed
Definition: EEmcTTMMaker.h:53
void SetMaxTrackEta(Double_t v)
sets minimum pseudorapidity at the origin required
Definition: EEmcTTMMaker.h:116
void SetMinTrackLength(Double_t v)
sets minimum track length required
Definition: EEmcTTMMaker.h:101
virtual Int_t Make()
process one event
void SetDeltaPhiCut(Double_t v=1.0)
sets delta phi cut see matchparams
Definition: EEmcTTMMaker.h:122
Double_t GetMaxTrackEta() const
gets minimum pseudorapidity at the origin required
Definition: EEmcTTMMaker.h:114
void SetMaxCTBSum(Int_t v)
sets maximum CTB sum allowed
Definition: EEmcTTMMaker.h:89
Bool_t AcceptTrack(const StMuTrack *track)
whether accept the track or not
virtual ~EEmcTTMMaker()
the destructor
Double_t GetMinTrackEta() const
gets minimum pseudorapidity at the origin required
Definition: EEmcTTMMaker.h:109
Bool_t MatchTrack(const double dphi, const double deta, const double phihw, const double etahw)
whether track matches or not
Double_t GetDeltaEtaCut() const
gets delta eta cut see matchparams
Definition: EEmcTTMMaker.h:125
EEMC simple geometry.
Int_t GetMinTrackHits() const
gets minimum number of hits/track required
Definition: EEmcTTMMaker.h:93
void WriteTree(const bool f)
decide whether write out matches to a tree
Definition: EEmcTTMMaker.h:132
static const Int_t kDefMaxCTBsum
default value for the maximum CTB sum allowed
Definition: EEmcTTMMaker.h:43
ULong_t GetNMatched() const
returns number of matched tracks
Definition: EEmcTTMMaker.h:135
void SetMinTrackHits(Int_t v)
sets minimum number of hits/track required
Definition: EEmcTTMMaker.h:95
void SetFileName(const char *string)
set output file name
Definition: EEmcTTMMaker.h:130
Int_t GetMaxCTBSum() const
gets maximum CTB sum allowed
Definition: EEmcTTMMaker.h:87
static const Double_t kDefDeltaEtaCut
default value for the maximum distance in eta from the tower center
Definition: EEmcTTMMaker.h:57
static const Double_t kDefMinTrackEta
default value for the minimum track pseudorapidity at origin allowed
Definition: EEmcTTMMaker.h:51
Collection of trigger ids as stored in MuDst.
EEmcTower holds information about an EEMC tower &#39;hit&#39;.
Definition: EEmcTower.h:17
virtual Int_t Finish()
cleans up at the end
TList * GetTracks()
returns a list of accepted StMuTracks objects
Definition: EEmcTTMMaker.h:138
virtual Int_t Init()
initialize maker
static const Double_t kDefMinTrackLength
default value for the minimum track length allowed
Definition: EEmcTTMMaker.h:47
static const Int_t kDefMinTrackHits
default value for the minimum TPC hits/track allowed
Definition: EEmcTTMMaker.h:45