1 #ifndef StPhiEtaHitList_h
2 #define StPhiEtaHitList_h
9 typedef std::vector<Int_t> IntVec;
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) {
29 if (! active )
return Wdunno;
30 if ( matched )
return Wmatch;
31 if ( vetoed )
return Wveto;
34 Float_t getWeight(Int_t iBin) {
35 return getWeight(getActive(iBin) > 1, isMatched(iBin), isVetoed(iBin));
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);
50 static Double_t W(Double_t energy);
58 Float_t Wmatch, Wveto;
59 static const Char_t *names[3];
63 #include "StBTofUtil/StBTofGeometry.h"
67 enum {mxTray=120,mxModule=32,mxCell=6,mxHalfTray=mxTray/2,mxTrayCell=mxHalfTray*mxCell};
73 Double_t Phi(Int_t tray, Int_t , Int_t cell) {
return mxCell*((tray-1)%mxHalfTray) + cell + 0.5;}
74 Double_t Eta(Int_t tray, Int_t module , Int_t ) {
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);
81 Int_t tmc2bin[mxTray][mxModule][mxCell];
90 enum {mxPhi= 60, mxPhi1=61,mxEta1=5};
91 enum {mxSlat=2, mxTray=120};
96 void clear() { StPhiEtaHitList::clear(); mgeantE->Reset();}
97 void initRun(Float_t fac=1.);
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;}
104 Float_t mCtbThres_mev;
111 #include "StEmcRawMaker/StBemcTables.h"
112 #include "StEmcUtil/geometry/StEmcGeom.h"
116 enum {mxm=120,mxe=20,mxs=2};
131 #include "StEEmcUtil/EEfeeRaw/EEdims.h"