StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPhiEtaHitList.h
1 #ifndef StPhiEtaHitList_h
2 #define StPhiEtaHitList_h
3 #include "TMath.h"
4 #include "TString.h"
5 #include "TArrayC.h"
6 #include "TNamed.h"
7 #include <vector>
8 #include "TH2.h"
9 typedef std::vector<Int_t> IntVec;
10 //________________________________________________________________________________
12  public:
14  virtual ~StPhiEtaHitList();
15  void clear() {mFired->Reset(); mTrack->Reset();}
16  void initRun() {mActive->Reset(); clear();}
17  Int_t etaBin(Double_t eta) {return mActive->GetYaxis()->FindBin(eta);}
18  Int_t phiBin(Double_t phi) {return mActive->GetXaxis()->FindBin(phi);}
19  Int_t PhiEtaBin(Double_t phi, Double_t eta) {Int_t binx = phiBin(phi); Int_t biny = etaBin(eta);
20  return (binx < 0 || biny < 0) ? -1 : biny*(mActive->GetYaxis()->GetNbins()+2) + binx;}
21  Int_t addTrack(Float_t eta, Float_t phi);
22  Int_t getActive(Int_t iBin) { return mActive->GetBinContent(iBin);}
23  Int_t getFired(Int_t iBin) { return mFired->GetBinContent(iBin);}
24  Int_t getTrack(Int_t iBin) { return mTrack->GetBinContent(iBin);}
25  Bool_t isMatched(Int_t iBin);
26  Bool_t isVetoed(Int_t iBin);
27  Float_t getWeight(Bool_t active, Bool_t matched, Bool_t vetoed) {
28  Float_t Wdunno = 1;
29  if (! active ) return Wdunno;
30  if ( matched ) return Wmatch;
31  if ( vetoed ) return Wveto;
32  return Wdunno;
33  }
34  Float_t getWeight(Int_t iBin) {
35  return getWeight(getActive(iBin) > 1, isMatched(iBin), isVetoed(iBin));
36  }
37  Int_t getnFired(){ return mFired->GetEntries(); }
38  Int_t iPhiEta2bin(Int_t iPhi,Int_t iEta) {return mActive->GetBin(iPhi,iEta);}
39  void iBin2iPhiEta(Int_t iBin,Int_t &iPhi,Int_t &iEta) {Int_t binz; mActive->GetBinXYZ(iBin, iPhi, iEta, binz);}
40  void setActive(Int_t iBin) { mActive->AddBinContent(iBin); }
41  void setFired(Int_t iBin) { mFired->AddBinContent(iBin); }
42  void setTrack(Int_t iBin) { mTrack->AddBinContent(iBin); }
43  Double_t MinPhi() {return phiMin;}
44  Int_t NoHits() {return mFired ? mFired->GetEntries():0;}
45  TH2C *Active() {return mActive;}
46  TH2C *Fired() {return mFired;}
47  TH2C *Track() {return mTrack;}
48  static void SetDebug(Int_t k = 1);
49  static Int_t Debug();
50  static Double_t W(Double_t energy);
51  protected:
52  Char_t beg[1];
53  TH2C *mActive;
54  TH2C *mFired;
55  TH2C *mTrack;
56  Double_t phiMin;
57  Char_t end[1];
58  Float_t Wmatch, Wveto;
59  static const Char_t *names[3];
60  ClassDef(StPhiEtaHitList,0)
61 };
62 //________________________________________________________________________________
63 #include "StBTofUtil/StBTofGeometry.h"
64 class StBTofCollection;
66  public:
67  enum {mxTray=120,mxModule=32,mxCell=6,mxHalfTray=mxTray/2,mxTrayCell=mxHalfTray*mxCell};
68  StBtofHitList();
69  virtual ~StBtofHitList();
70  static StBtofHitList* instance() {return fgInstance;}
71  void initRun();
72  void build(StBTofCollection *btofColl);
73  Double_t Phi(Int_t tray, Int_t /* module */, Int_t cell) { return mxCell*((tray-1)%mxHalfTray) + cell + 0.5;}
74  Double_t Eta(Int_t tray, Int_t module , Int_t /* cell */) { return (tray <= mxHalfTray) ? module -0.5 : -module + 0.5;}
75  Int_t addBtofTrack(Int_t tray, Int_t module, Int_t cell);
76  Bool_t isMatched(IntVec ibinVec);
77  Bool_t isMatched(Int_t iBin) {return StPhiEtaHitList::isMatched(iBin);}
78  Bool_t isVetoed(IntVec ibinVec);
79  Float_t getWeight(IntVec ibinVec);
80  private:
81  Int_t tmc2bin[mxTray][mxModule][mxCell]; // map {t,m,c}--> my bin
82  static StBtofHitList* fgInstance;
83  ClassDef(StBtofHitList,0)
84 };
85 //________________________________________________________________________________
86 class StTriggerData;
87 class TDataSet;
88 class StCtbHitList : public StPhiEtaHitList {
89  public:
90  enum {mxPhi= 60, mxPhi1=61,mxEta1=5};
91  enum {mxSlat=2, mxTray=120};
92  StCtbHitList();
93  virtual ~StCtbHitList() {fgInstance = 0;}
94  static StCtbHitList* instance() {return fgInstance;}
95 
96  void clear() { StPhiEtaHitList::clear(); mgeantE->Reset();}
97  void initRun(Float_t fac=1.);
98  void buildFromMC(TDataSet *gds);
99  void buildFromData(StTriggerData *trgD);
100  static void ctb_get_slat_from_data(Int_t slat, Int_t tray, Float_t & phiRad, Float_t &eta);
101  static void ctb_get_slat_from_geant(Int_t volume, Int_t &i_phi, Int_t &i_eta, Float_t & phi, Float_t &eta);
102  TH2F *GeantE() {return mgeantE;}
103  private:
104  Float_t mCtbThres_mev; // M-C hits
105  Int_t mCtbThres_ch;// data hits
106  TH2F *mgeantE;
107  static StCtbHitList* fgInstance;
108  ClassDef(StCtbHitList,0)
109 };
110 class StEmcDetector;
111 #include "StEmcRawMaker/StBemcTables.h"
112 #include "StEmcUtil/geometry/StEmcGeom.h"
113 
115  public:
116  enum {mxm=120,mxe=20,mxs=2};
117  StBemcHitList();
118  virtual ~StBemcHitList() {fgInstance = 0;}
119  void initRun();
120  void build( StEmcDetector*det, Float_t adcMin);
121  static StBemcHitList* instance() {return fgInstance;}
122  StBemcTables *Table() {return myTable;}
123  private:
124  StBemcTables *myTable;
125  StEmcGeom *geomB;
126  // params:
127  Float_t kSigPed;
128  static StBemcHitList* fgInstance;
129  ClassDef(StBemcHitList,0)
130 };
131 #include "StEEmcUtil/EEfeeRaw/EEdims.h"
132 class StEmcDetector;
133 class StEEmcDb;
134 class EEmcGeomSimple;
135 
137  public:
138  StEemcHitList(StEEmcDb* x, UInt_t y, EEmcGeomSimple *z);
139  virtual ~StEemcHitList() {fgInstance = 0;}
140  void initRun();
141  void build( StEmcDetector*det, Float_t adcMin);
142  static StEemcHitList* instance() {return fgInstance;}
143  private:
144  StEEmcDb* eeDb;
145  EEmcGeomSimple *geomE;
146  UInt_t killStatEEmc;
147  static StEemcHitList* fgInstance;
148  ClassDef(StEemcHitList,0)
149 };
150 
151 #endif
EEMC simple geometry.
C++ STL includes.
Definition: AgUStep.h:47