# ifndef T_h # define T_h # include # include # include # include # include # include # include class T : public TSelector { public : TTree *fChain; // input variables TString input_HRS,input_target; float input_p; int bin_number; // Tree Branch variables Double_t R_gold_p, R_gold_ph, R_gold_th, ReactPt_R_z, R_tr_beta[18]; Double_t R_s1_time[6],R_s1_trpad[18],R_s2_time[16],R_s2_trpad[18]; Int_t Ndata_R_s1_time,Ndata_R_s1_trpad,Ndata_R_s2_time,Ndata_R_s2_trpad; Int_t fEvtHdr_fRun,fEvtHdr_fEvtType,Ndata_R_tr_beta; // Tree Branches TBranch *b_R_gold_p, *b_R_gold_ph, *b_R_gold_th, *b_ReactPt_R_z, *b_R_tr_beta; TBranch *b_R_s1_time,*b_R_s1_trpad,*b_R_s2_time,*b_R_s2_trpad; TBranch *b_Ndata_R_s1_time,*b_Ndata_R_s1_trpad,*b_Ndata_R_s2_time,*b_Ndata_R_s2_trpad; TBranch *b_Event_Branch_fEvtHdr_fRun,*b_Event_Branch_fEvtHdr_fEvtType,*b_Ndata_R_tr_beta; // prescale and charge tree and variables TTree *ps_Q_tree; int prescaleR,prescaleL; float Q,total_Q; TBranch *b_ps1,*b_ps3,*b_Q; // cut definition variables double tof_min,tof_max,th_min,th_max,ph_min,ph_max,p_min,p_max,zHe3_min,zHe3_max,zC12_min,zC12_max; // function declerations T(TTree * = 0) { } virtual ~T() { } virtual Int_t Version() const { return 2; } 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 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(T,0); }; #endif #ifdef T_cxx void T::Init(TTree *tree) { if (!tree) return; fChain = tree; fChain->SetMakeClass(1); fChain->SetBranchAddress("R.gold.p",&R_gold_p,&b_R_gold_p); fChain->SetBranchAddress("R.gold.ph",&R_gold_ph,&b_R_gold_ph); fChain->SetBranchAddress("R.gold.th",&R_gold_th,&b_R_gold_th); fChain->SetBranchAddress("ReactPt_R.z",&ReactPt_R_z,&b_ReactPt_R_z); fChain->SetBranchAddress("R.s1.time", R_s1_time, &b_R_s1_time); fChain->SetBranchAddress("R.s1.trpad", R_s1_trpad, &b_R_s1_trpad); fChain->SetBranchAddress("R.s2.time", R_s2_time, &b_R_s2_time); fChain->SetBranchAddress("R.s2.trpad", R_s2_trpad, &b_R_s2_trpad); fChain->SetBranchAddress("Ndata.R.s1.time", &Ndata_R_s1_time, &b_Ndata_R_s1_time); fChain->SetBranchAddress("Ndata.R.s1.trpad", &Ndata_R_s1_trpad, &b_Ndata_R_s1_trpad); fChain->SetBranchAddress("Ndata.R.s2.time", &Ndata_R_s2_time, &b_Ndata_R_s2_time); fChain->SetBranchAddress("Ndata.R.s2.trpad", &Ndata_R_s2_trpad, &b_Ndata_R_s2_trpad); fChain->SetBranchAddress("Ndata.R.tr.beta", &Ndata_R_tr_beta, &b_Ndata_R_tr_beta); fChain->SetBranchAddress("R.tr.beta", R_tr_beta, &b_R_tr_beta); fChain->SetBranchAddress("fEvtHdr.fRun", &fEvtHdr_fRun, &b_Event_Branch_fEvtHdr_fRun); fChain->SetBranchAddress("fEvtHdr.fEvtType", &fEvtHdr_fEvtType, &b_Event_Branch_fEvtHdr_fEvtType); // read prescales from prescale.root TFile *f = new TFile("/home/nbubis/run_data.root"); ps_Q_tree = (TTree*)f->Get("T"); ps_Q_tree->SetBranchAddress("ps1",&prescaleR,&b_ps1); ps_Q_tree->SetBranchAddress("ps3",&prescaleL,&b_ps3); ps_Q_tree->SetBranchAddress("Q",&Q,&b_Q); } Bool_t T::Notify() { return kTRUE; } #endif // #ifdef T_cxx