#if !defined (__CINT__) || defined (__MAKECINT__) #include "TH1.h" #include "TH2.h" #include "TTree.h" #include "TProfile.h" #include "Stntuple/loop/TStnModule.hh" #include "Stntuple/obj/TSvxDataBlock.hh" #include "Stntuple/obj/TStnTrackBlock.hh" #include "Stntuple/obj/TStnTrackLinkBlock.hh" #include "Stntuple/obj/TSiIsectBlock.hh" #endif class TSvxAnaModule: public TStnModule { //----------------------------------------------------------------------------- // histograms //----------------------------------------------------------------------------- public: struct Hist_t { // TH1F* fQtotal[3][3][36][8][2]; // barrel,seg,phi,layer,side // TH1F* fNstrip[3][3][36][8][2]; // TH1F* fQ_trk[3][3][36][8][2]; // Same with tracks matched TH1F* fEff_trk; TTree *fT; TTree *fA; TTree *fN; TTree *fR; }; struct MyHit_t { int run; int evt; int b; // barrel int h; // segment int p; // phi int l; // layer int s; // side float stp; // Strip number of cluster center int N; // Number of strips in cluster float Q; // Total cluster charge float f; // Fudge factor for dip angle correction, sin(theta) float x; // Global coords of hit float y; // Global coords of hit float z; // Global coords of hit float phi0; // Phi0 of track float z0; // z0 of track float d0; // d0 of track float eta; // eta of track float pt; // Pt of track }; struct NearHit_t { int run; int evt; int b; // barrel int h; // segment int p; // phi int l; // layer int s; // side int act; // In active region? float ix,iy,iz; // Intersection global coords float istp; // Strip number of intersection float ily,ilz; // Intersection local coords float f; // Fudge factor for dip angle correction, sin(theta) float phi0; // Phi0 of intersection float z0; // z0 of intersection float d0; // d0 of intersection float eta; // eta of intersection float pt; // Pt of intersection float stp[3]; // Strip number of cluster int N[3]; // Number of strips in cluster float Q[3]; // Total cluster charge float x[3]; // Global coords of hit float y[3]; // Global coords of hit float z[3]; // Global coords of hit }; struct Track_t { int run; int evt; int b; // barrel float C; float phi0; float d0; float tanl; float z0; float pt; // float sd0; }; //----------------------------------------------------------------------------- // data members //----------------------------------------------------------------------------- protected: // pointers to the data blocks used TSvxDataBlock* fSvxDataBlock; TStnTrackBlock* fTrackBlock; TStnTrackLinkBlock* fTrackLinkBlock; TSiIsectBlock* fSiIsectBlock; // histograms filled Hist_t fHist; MyHit_t fHit,fAll; NearHit_t fNear; // Three nearest hits to track intersection Track_t fTrack; //----------------------------------------------------------------------------- // functions //----------------------------------------------------------------------------- public: TSvxAnaModule(const char* name="SvxAna", const char* title="SvxAna"); ~TSvxAnaModule(); // ****** accessors Hist_t* GetHist () { return &fHist; } // ****** data blocks used by the // module TSvxDataBlock* GetSvxDataBlock () { return fSvxDataBlock; } TStnTrackBlock* GetTrackBlock () { return fTrackBlock; } TStnTrackLinkBlock* GetTrackLinkBlock () { return fTrackLinkBlock; } TSiIsectBlock* GetSiIsectBlock () { return fSiIsectBlock; } // ****** setters // ****** overloaded methods of // TStnModule int BeginJob(); int BeginRun(); int Event (int ientry); int EndJob (); // ****** other methods void BookHistograms(); void SetTrackAlgorithm(int alg=11); void SetAreSiHits(int areSiHits=1); void SetTreeA(bool makeTreeA=true); void SetTreeT(bool makeTreeT=true); void SetTreeN(bool makeTreeN=true); void SetTreeR(bool makeTreeR=true); bool PassTrackCuts(TStnTrack*); private: int fAlg; int fAreSiHits; bool fTreeA; bool fTreeT; bool fTreeN; bool fTreeR; TFile *fFile; ClassDef(TSvxAnaModule,0) };