////////////////////////////////////////////////////////// // This class has been automatically generated on // Wed Oct 6 11:08:21 2004 by ROOT version 4.01/02 // from TChain LED/LumiChain ////////////////////////////////////////////////////////// #ifndef LEDAnal_h #define LEDAnal_h #include #include #include #include #include class LEDAnal { public : TTree *fChain; //!pointer to the analyzed TTree or TChain Int_t fCurrent; //!current Tree number in a TChain // Declaration of leave types UChar_t raw_info_bunch; UChar_t raw_info_pipeline; Short_t PD_X_Odd_PD_X_Odd_pedestal[10]; Short_t PD_X_Odd_PD_X_Odd_response[10]; Short_t PD_X_Even_PD_X_Even_pedestal[10]; Short_t PD_X_Even_PD_X_Even_response[10]; Short_t PD_Y_Odd_PD_Y_Odd_pedestal[10]; Short_t PD_Y_Odd_PD_Y_Odd_response[10]; Short_t PD_Y_Even_PD_Y_Even_pedestal[10]; Short_t PD_Y_Even_PD_Y_Even_response[10]; Short_t PD_X_Plate_PD_X_Plate_pedestal[16]; Short_t PD_X_Plate_PD_X_Plate_response[16]; Short_t PD_Y_Plate_PD_Y_Plate_pedestal[16]; Short_t PD_Y_Plate_PD_Y_Plate_response[16]; Short_t ET1_ET1_pedestal[15]; Short_t ET1_ET1_response[15]; Short_t ET2_ET2_pedestal[21]; Short_t ET2_ET2_response[21]; // List of branches TBranch *b_raw_info; //! TBranch *b_PD_X_Odd; //! TBranch *b_PD_X_Even; //! TBranch *b_PD_Y_Odd; //! TBranch *b_PD_Y_Even; //! TBranch *b_PD_X_Plate; //! TBranch *b_PD_Y_Plate; //! TBranch *b_ET1; //! TBranch *b_ET2; //! UInt_t fNentries; Int_t fDebug; static const UInt_t grouping; // Number of LED events per dot. static const UInt_t NbinsY; // Number of Y bins for 2D's static const Float_t Ped; // Offset for Pedestal static const Float_t CutPed; // Cut of pedestal // static const NGroups = 4; // Number of LED groups X|Y * Odd|Even enum Groups { XOdd, XEven, YOdd, YEven, NGroups }; static const char * GroupName[NGroups]; // = {"XOdd" , "XEven", "YOdd", "YEven"; }; // Lumi parameters Double_t * fTimeStamps; TH2F * Dist[4][7]; // TProfile * Resp[4][6]; LEDAnal(TTree *tree=0); virtual ~LEDAnal(); virtual Int_t Cut(Long64_t entry); virtual Int_t GetEntry(Long64_t entry); virtual Long64_t LoadTree(Long64_t entry); virtual void Init(TTree *tree); virtual void Loop(); virtual Bool_t Notify(); virtual void Show(Long64_t entry = -1); }; #endif #ifdef LEDAnal_cxx LEDAnal::LEDAnal(TTree *tree) { // if parameter tree is not specified (or zero), connect the file // used to generate this class and read the Tree. if (tree == 0) { #ifdef SINGLE_TREE // The following code should be used if you want this class to access // a single tree instead of a chain TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("../LumiRuns/Root/040301/00h.root"); if (!f) { f = new TFile("../LumiRuns/Root/040301/00h.root"); f->cd("Rint:/"); } tree = (TTree*)gDirectory->Get("LED"); #else // SINGLE_TREE // The following code should be used if you want this class to access a chain // of trees. TChain * chain = new TChain("LED","LumiChain"); chain->Add("../LumiRuns/Root/040301/00h.root/LED"); chain->Add("../LumiRuns/Root/040301/01h.root/LED"); chain->Add("../LumiRuns/Root/040301/02h.root/LED"); chain->Add("../LumiRuns/Root/040301/03h.root/LED"); chain->Add("../LumiRuns/Root/040301/04h.root/LED"); chain->Add("../LumiRuns/Root/040301/05h.root/LED"); chain->Add("../LumiRuns/Root/040301/06h.root/LED"); chain->Add("../LumiRuns/Root/040301/07h.root/LED"); chain->Add("../LumiRuns/Root/040301/08h.root/LED"); chain->Add("../LumiRuns/Root/040301/09h.root/LED"); chain->Add("../LumiRuns/Root/040301/10h.root/LED"); chain->Add("../LumiRuns/Root/040301/11h.root/LED"); chain->Add("../LumiRuns/Root/040301/12h.root/LED"); chain->Add("../LumiRuns/Root/040301/13h.root/LED"); chain->Add("../LumiRuns/Root/040301/14h.root/LED"); chain->Add("../LumiRuns/Root/040301/15h.root/LED"); chain->Add("../LumiRuns/Root/040301/16h.root/LED"); chain->Add("../LumiRuns/Root/040301/17h.root/LED"); chain->Add("../LumiRuns/Root/040301/18h.root/LED"); chain->Add("../LumiRuns/Root/040301/19h.root/LED"); chain->Add("../LumiRuns/Root/040301/20h.root/LED"); chain->Add("../LumiRuns/Root/040301/21h.root/LED"); chain->Add("../LumiRuns/Root/040301/22h.root/LED"); chain->Add("../LumiRuns/Root/040301/23h.root/LED"); chain->Add("../LumiRuns/Root/040302/00h.root/LED"); chain->Add("../LumiRuns/Root/040302/01h.root/LED"); chain->Add("../LumiRuns/Root/040302/02h.root/LED"); chain->Add("../LumiRuns/Root/040302/03h.root/LED"); chain->Add("../LumiRuns/Root/040302/04h.root/LED"); chain->Add("../LumiRuns/Root/040302/05h.root/LED"); chain->Add("../LumiRuns/Root/040302/06h.root/LED"); chain->Add("../LumiRuns/Root/040302/07h.root/LED"); chain->Add("../LumiRuns/Root/040302/08h.root/LED"); chain->Add("../LumiRuns/Root/040302/09h.root/LED"); chain->Add("../LumiRuns/Root/040302/10h.root/LED"); chain->Add("../LumiRuns/Root/040302/11h.root/LED"); chain->Add("../LumiRuns/Root/040302/12h.root/LED"); chain->Add("../LumiRuns/Root/040302/13h.root/LED"); chain->Add("../LumiRuns/Root/040302/14h.root/LED"); chain->Add("../LumiRuns/Root/040302/15h.root/LED"); chain->Add("../LumiRuns/Root/040302/16h.root/LED"); chain->Add("../LumiRuns/Root/040302/17h.root/LED"); chain->Add("../LumiRuns/Root/040302/18h.root/LED"); chain->Add("../LumiRuns/Root/040302/19h.root/LED"); chain->Add("../LumiRuns/Root/040302/20h.root/LED"); chain->Add("../LumiRuns/Root/040302/21h.root/LED"); chain->Add("../LumiRuns/Root/040302/22h.root/LED"); chain->Add("../LumiRuns/Root/040302/23h.root/LED"); chain->Add("../LumiRuns/Root/040303/00h.root/LED"); chain->Add("../LumiRuns/Root/040303/01h.root/LED"); chain->Add("../LumiRuns/Root/040303/02h.root/LED"); chain->Add("../LumiRuns/Root/040303/03h.root/LED"); chain->Add("../LumiRuns/Root/040303/04h.root/LED"); chain->Add("../LumiRuns/Root/040303/05h.root/LED"); chain->Add("../LumiRuns/Root/040303/06h.root/LED"); chain->Add("../LumiRuns/Root/040303/07h.root/LED"); chain->Add("../LumiRuns/Root/040303/08h.root/LED"); chain->Add("../LumiRuns/Root/040303/09h.root/LED"); chain->Add("../LumiRuns/Root/040303/10h.root/LED"); chain->Add("../LumiRuns/Root/040303/11h.root/LED"); chain->Add("../LumiRuns/Root/040303/12h.root/LED"); chain->Add("../LumiRuns/Root/040303/13h.root/LED"); chain->Add("../LumiRuns/Root/040303/14h.root/LED"); chain->Add("../LumiRuns/Root/040303/15h.root/LED"); chain->Add("../LumiRuns/Root/040303/16h.root/LED"); chain->Add("../LumiRuns/Root/040303/17h.root/LED"); chain->Add("../LumiRuns/Root/040303/18h.root/LED"); chain->Add("../LumiRuns/Root/040303/19h.root/LED"); chain->Add("../LumiRuns/Root/040303/20h.root/LED"); chain->Add("../LumiRuns/Root/040303/21h.root/LED"); chain->Add("../LumiRuns/Root/040303/22h.root/LED"); chain->Add("../LumiRuns/Root/040303/23h.root/LED"); chain->Add("../LumiRuns/Root/040304/00h.root/LED"); chain->Add("../LumiRuns/Root/040304/01h.root/LED"); chain->Add("../LumiRuns/Root/040304/02h.root/LED"); chain->Add("../LumiRuns/Root/040304/03h.root/LED"); chain->Add("../LumiRuns/Root/040304/04h.root/LED"); chain->Add("../LumiRuns/Root/040304/05h.root/LED"); chain->Add("../LumiRuns/Root/040304/06h.root/LED"); chain->Add("../LumiRuns/Root/040304/07h.root/LED"); chain->Add("../LumiRuns/Root/040304/08h.root/LED"); chain->Add("../LumiRuns/Root/040304/09h.root/LED"); chain->Add("../LumiRuns/Root/040304/10h.root/LED"); chain->Add("../LumiRuns/Root/040304/11h.root/LED"); chain->Add("../LumiRuns/Root/040304/12h.root/LED"); chain->Add("../LumiRuns/Root/040304/13h.root/LED"); chain->Add("../LumiRuns/Root/040304/14h.root/LED"); chain->Add("../LumiRuns/Root/040304/15h.root/LED"); chain->Add("../LumiRuns/Root/040304/16h.root/LED"); chain->Add("../LumiRuns/Root/040304/17h.root/LED"); chain->Add("../LumiRuns/Root/040304/18h.root/LED"); chain->Add("../LumiRuns/Root/040304/19h.root/LED"); chain->Add("../LumiRuns/Root/040304/20h.root/LED"); chain->Add("../LumiRuns/Root/040304/21h.root/LED"); chain->Add("../LumiRuns/Root/040304/22h.root/LED"); chain->Add("../LumiRuns/Root/040304/23h.root/LED"); tree = chain; #endif // SINGLE_TREE } Init(tree); fDebug = 0; fNentries = 0; // memset(Dist, 0, sizeof(Dist)); // memset(Resp, 0, sizeof(Resp)); for(int ig=0; igGetCurrentFile(); } Int_t LEDAnal::GetEntry(Long64_t entry) { // Read contents of entry. if (!fChain) return 0; return fChain->GetEntry(entry); } Long64_t LEDAnal::LoadTree(Long64_t entry) { // Set the environment to read one entry if (!fChain) return -5; Long64_t centry = fChain->LoadTree(entry); if (centry < 0) return centry; if (fChain->IsA() != TChain::Class()) return centry; TChain *chain = (TChain*)fChain; if (chain->GetTreeNumber() != fCurrent) { fCurrent = chain->GetTreeNumber(); Notify(); } return centry; } void LEDAnal::Init(TTree *tree) { // The Init() function is called when the selector needs to initialize // a new tree or chain. Typically here the branch addresses of the tree // will be set. It is normaly not necessary to make changes to the // generated code, but the routine can be extended by the user if needed. // Init() will be called many times when running with PROOF. // Set branch addresses if (tree == 0) return; fChain = tree; fCurrent = -1; fChain->SetMakeClass(1); fChain->SetBranchAddress("raw_info",&raw_info_bunch); fChain->SetBranchAddress("PD_X_Odd",PD_X_Odd_PD_X_Odd_pedestal); fChain->SetBranchAddress("PD_X_Even",PD_X_Even_PD_X_Even_pedestal); fChain->SetBranchAddress("PD_Y_Odd",PD_Y_Odd_PD_Y_Odd_pedestal); fChain->SetBranchAddress("PD_Y_Even",PD_Y_Even_PD_Y_Even_pedestal); fChain->SetBranchAddress("PD_X_Plate",PD_X_Plate_PD_X_Plate_pedestal); fChain->SetBranchAddress("PD_Y_Plate",PD_Y_Plate_PD_Y_Plate_pedestal); fChain->SetBranchAddress("ET1",ET1_ET1_pedestal); fChain->SetBranchAddress("ET2",ET2_ET2_pedestal); Notify(); } Bool_t LEDAnal::Notify() { // The Notify() function is called when a new file is opened. This // can be either for a new TTree in a TChain or when when a new TTree // is started when using PROOF. Typically here the branch pointers // will be retrieved. It is normaly not necessary to make changes // to the generated code, but the routine can be extended by the // user if needed. // Get branch pointers b_raw_info = fChain->GetBranch("raw_info"); b_PD_X_Odd = fChain->GetBranch("PD_X_Odd"); b_PD_X_Even = fChain->GetBranch("PD_X_Even"); b_PD_Y_Odd = fChain->GetBranch("PD_Y_Odd"); b_PD_Y_Even = fChain->GetBranch("PD_Y_Even"); b_PD_X_Plate = fChain->GetBranch("PD_X_Plate"); b_PD_Y_Plate = fChain->GetBranch("PD_Y_Plate"); b_ET1 = fChain->GetBranch("ET1"); b_ET2 = fChain->GetBranch("ET2"); return kTRUE; } const char * LEDAnal::GroupName[LEDAnal::NGroups] = {"XOdd" , "XEven", "YOdd", "YEven" }; const UInt_t LEDAnal::grouping = 1250; // Number of LED events per dot. const UInt_t LEDAnal::NbinsY = 128; // Number of Y bins for 2D's const Float_t LEDAnal::Ped = 100; // Offset for Pedestal const Float_t LEDAnal::CutPed = 200; // Cut of pedestal void LEDAnal::Show(Long64_t entry) { // Print contents of entry. // If entry is not specified, print current entry if (!fChain) return; fChain->Show(entry); } Int_t LEDAnal::Cut(Long64_t entry) { // This function may be called from Loop. // returns 1 if entry is accepted. // returns -1 otherwise. return 1; } #endif // #ifdef LEDAnal_cxx