//================================================================== // // TSiPed.hh // // Calculates the pedestal for every channel. Expects to see read- // all data. You can choose to supress the common mode yourself with // CalcDPS() or with EventPed. // // Default pedestal calculation is the median of the ADC distribution // for that channel. // // Aaron Dominguez (LBNL) Nov 2, 2001 // //================================================================== #if !defined (__CINT__) || defined (__MAKECINT__) #include "TTree.h" #include "TFile.h" #include "TProfile.h" #include "TClonesArray.h" #include "Stntuple/loop/TStnModule.hh" #include "Stntuple/obj/TSiStripBlock.hh" #include "SiEventPedCalculator.hh" #include #include #endif class TSiPed: public TStnModule { public: TSiPed(const char* name="SiPed", const char* title="Silicon Pedestals", const char* filename=""); ~TSiPed(); TTree *fPed; struct myPed { int stp; float ped; float pedH; float pedI; float noiseH0,noiseH1; float noiseI; }; TH1F* fPedDist; TProfile *fProf; // ****** Setters ******* void SetDigiCode(int digi) {fDigiCode=digi;} void SetNChan(int nChan) {fNChan=nChan;} void CalcDPS(bool dps=false) {fDPS=dps;} void FitL00Ped(bool l00ped=false) {fL00Ped=l00ped;} // ****** overloaded methods of TStnModule ****** int BeginJob(); int BeginRun(); int Event (int ientry); int EndJob (); // ****** other methods ****** void BookHistograms(); Float_t median(TH1F *h); Float_t DPS(std::vector &h); Float_t noise(TH1F *h, int flag=0); void L00Fit(const std::vector &adc, std::vector &ped); // ****** private data ****** private: TSiStripBlock *fSi; int fDigiCode; std::vector > fEvtPed; std::vector fPedIgor, fNoiseIgor; int fNevt; std::string fFilename; TFile *fFile; TObjArray *fHlist; int fNChan; bool fDPS; bool fL00Ped; myPed fp; SiEventPedCalculator fSiPed; };