////////////////////////////////////////////////////////// // This class has been automatically generated on // Tue Jun 9 15:56:11 2020 by ROOT version 6.18/04 // from TTree bhgen/BHgen sample listing // found on file: samples.root ////////////////////////////////////////////////////////// #ifndef BHgen_h #define BHgen_h #include #include #include #include #include // Headers needed by this particular selector class BHgen : public TSelector { public : TTree *fChain; //!pointer to the analyzed TTree or TChain Int_t fCurrent; //!current Tree number in a TChain TH1D *h0; TH1D *h1; // Fixed size dimensions of array or collections stored in the TTree if any. // Declaration of leaf types Int_t run; // List of branches TBranch *b_run; //! BHgen(TTree *tree=0) : fChain(0) { // if parameter tree is not specified (or zero), connect the file // used to generate this class and read the Tree. if (tree == 0) { TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("samples.root"); if (!f || !f->IsOpen()) { f = new TFile("samples.root"); } f->GetObject("bhgen",tree); } Init(tree); } virtual ~BHgen() {} virtual Int_t Version() const { return 2; } virtual Int_t GetEnt(Long64_t entry); virtual Long64_t LoadTree(Long64_t entry); virtual void Show(Long64_t entry = -1); virtual void Begin(TTree *tree); virtual void SlaveBegin(TTree *tree); virtual void Init(TTree *tree); virtual Bool_t Notify(); virtual Bool_t Process(Long64_t entry); virtual void SetOption(const char *option) { fOption = option; } virtual void SetObject(TObject *obj) { fObject = obj; } virtual void SetInputList(TList *input) { fInput = input; } virtual TList *GetOutputList() const { return fOutput; } virtual void SlaveTerminate(); virtual void Terminate(); ClassDef(BHgen,0); }; #endif #ifdef BHgen_cxx Int_t BHgen::GetEnt(Long64_t entry) { // Read contents of entry. if (!fChain) return 0; return fChain->GetEntry(entry); } Long64_t BHgen::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->GetTreeNumber() != fCurrent) { fCurrent = fChain->GetTreeNumber(); Notify(); } return centry; } void BHgen::Init(TTree *tree) { // The Init() function is called when the selector needs to initialize // a new tree or chain. Typically here the branch addresses and branch // pointers of the tree will be set. // It is normally 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 on PROOF // (once per file to be processed). // Set branch addresses and branch pointers if (!tree) return; fChain = tree; fCurrent = -1; fChain->SetMakeClass(1); fChain->SetBranchAddress("runs", &run, &b_run); Notify(); } Bool_t BHgen::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. It is normally not necessary to make changes // to the generated code, but the routine can be extended by the // user if needed. The return value is currently not used. return kTRUE; } void BHgen::Show(Long64_t entry) { // Print contents of entry. // If entry is not specified, print current entry if (!fChain) return; fChain->Show(entry); } #endif // #ifdef BHgen_cxx