#ifndef MySel_h #define MySel_h #include "headers.h" class MySel: public TSelector { private : TTree *outTree; Float_t outVariable; public : TTree *fChain; Long64_t nbytes, nb; Int_t fCurrent; Float_t hdig_Epluspc2; TBranch *b_event_branch_hdig_Epluspc2; MySel(TTree * /*tree*/ =0) : fChain(0){cout << "***class instance created*** " << endl; } virtual ~MySel() {cout << "~~~class instance destroyed~~~ " << endl; } virtual Int_t Version() const { return 2; } virtual void Begin(TTree *tree); virtual void SlaveBegin(TTree *tree); virtual void Init(TTree *intree); virtual Bool_t Notify(); virtual Bool_t Process(Long64_t entry); virtual Int_t GetEntry(Long64_t entry, Int_t getall = 0) { return fChain ? fChain->GetTree()->GetEntry(entry, getall) : 0; } 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(MySel,2) }; #endif #ifdef MySel_cxx void MySel::Init(TTree *intree) { // Set branch addresses and branch pointers fCurrent=-1; if (!intree) return; fChain=intree; fChain->SetMakeClass(1); fChain->SetBranchAddress("hdig.Epluspc2", &hdig_Epluspc2, &b_event_branch_hdig_Epluspc2); cout << "--->fChain initialized." << endl; } Bool_t MySel::Notify() { return kTRUE; } #endif