////////////////////////////////////////////////////////// // This class has been automatically generated on // Fri May 7 13:57:06 2004 by ROOT version 4.00/03 // from TTree t1/a simple Tree with simple variables // found on file: tree1.root ////////////////////////////////////////////////////////// #ifndef myselector_h #define myselector_h #include #include #include #include #include class myselector : public TSelector { public : TH1F *fHist; TTree *fChain; //!pointer to the analyzed TTree or TChain // Declaration of leave types Float_t px; Float_t py; Float_t pz; Double_t random; Int_t ev; // List of branches TBranch *b_px; //! TBranch *b_py; //! TBranch *b_pz; //! TBranch *b_random; //! TBranch *b_ev; //! myselector(TTree *tree=0) { } ~myselector() { } Int_t Version() const {return 1;} void Begin(TTree *tree); void SlaveBegin(TTree *tree); void Init(TTree *tree); Bool_t Notify(); Bool_t Process(Int_t entry); void SetOption(const char *option) { fOption = option; } void SetObject(TObject *obj) { fObject = obj; } void SetInputList(TList *input) {fInput = input;} TList *GetOutputList() const { return fOutput; } void SlaveTerminate(); void Terminate(); Bool_t ProcessCut(Int_t entry); void ProcessFill(Int_t entry); ClassDef(myselector,0); }; #endif #ifdef myselector_cxx void myselector::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; fChain->SetMakeClass(1); fChain->SetBranchAddress("px",&px); fChain->SetBranchAddress("py",&py); fChain->SetBranchAddress("pz",&pz); fChain->SetBranchAddress("random",&random); fChain->SetBranchAddress("ev",&ev); } Bool_t myselector::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_px = fChain->GetBranch("px"); b_py = fChain->GetBranch("py"); b_pz = fChain->GetBranch("pz"); b_random = fChain->GetBranch("random"); b_ev = fChain->GetBranch("ev"); return kTRUE; } #endif // #ifdef myselector_cxx