////////////////////////////////////////////////////////// // This class has been automatically generated on // Wed Jan 18 16:33:04 2012 by ROOT version 5.26/00 // from TChain T/ ////////////////////////////////////////////////////////// #ifndef KxKy_base_h #define KxKy_base_h #include #include #include class KxKy_base { public : TTree *fChain; //!pointer to the analyzed TTree or TChain Int_t fCurrent; //!current Tree number in a TChain // Declaration of leaf types Int_t Event; Int_t slotNumber; Int_t padNumber; Double_t time; Double_t energy; Double_t trackLength; Int_t trackID; Double_t position[3]; Double_t originalMomentum[3]; Double_t finalMomentum[3]; Double_t oilTime; Double_t oilPath; Double_t barTime; Double_t barPath; Double_t windowTime; Double_t windowPath; Double_t quartzTime; Double_t quartzPath; Int_t numberOfBounces; Double_t pmtTimeDelay; Int_t ParticleType; Double_t Gun_Energy; Double_t Gun_Position[3]; Double_t Gun_Direction[3]; Int_t flag; // List of branches TBranch *b_Event; //! TBranch *b_slotNumber; //! TBranch *b_padNumber; //! TBranch *b_time; //! TBranch *b_energy; //! TBranch *b_trackLength; //! TBranch *b_trackID; //! TBranch *b_position; //! TBranch *b_originalMomentum; //! TBranch *b_finalMomentum; //! TBranch *b_oilTime; //! TBranch *b_oilPath; //! TBranch *b_barTime; //! TBranch *b_barPath; //! TBranch *b_windowTime; //! TBranch *b_windowPath; //! TBranch *b_quartzTime; //! TBranch *b_quartzPath; //! TBranch *b_numberOfBounces; //! TBranch *b_pmtTimeDelay; //! TBranch *b_ParticleType; //! TBranch *b_Gun_Energy; //! TBranch *b_Gun_Position; //! TBranch *b_Gun_Direction; //! TBranch *b_flag; //! KxKy_base(TTree *tree=0); virtual ~KxKy_base(); 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 KxKy_base_cxx KxKy_base::KxKy_base(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("Memory Directory"); if (!f) { f = new TFile("Memory Directory"); f->cd("Rint:/"); } tree = (TTree*)gDirectory->Get("T"); #else // SINGLE_TREE // The following code should be used if you want this class to access a chain // of trees. TChain * chain = new TChain("T",""); chain->Add("../dirc/workdir/data1/DircData.root/T"); tree = chain; #endif // SINGLE_TREE } Init(tree); } KxKy_base::~KxKy_base() { if (!fChain) return; delete fChain->GetCurrentFile(); } Int_t KxKy_base::GetEntry(Long64_t entry) { // Read contents of entry. if (!fChain) return 0; return fChain->GetEntry(entry); } Long64_t KxKy_base::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->InheritsFrom(TChain::Class())) return centry; TChain *chain = (TChain*)fChain; if (chain->GetTreeNumber() != fCurrent) { fCurrent = chain->GetTreeNumber(); Notify(); } return centry; } void KxKy_base::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("Event", &Event, &b_Event); fChain->SetBranchAddress("slotNumber", &slotNumber, &b_slotNumber); fChain->SetBranchAddress("padNumber", &padNumber, &b_padNumber); fChain->SetBranchAddress("time", &time, &b_time); fChain->SetBranchAddress("energy", &energy, &b_energy); fChain->SetBranchAddress("trackLength", &trackLength, &b_trackLength); fChain->SetBranchAddress("trackID", &trackID, &b_trackID); fChain->SetBranchAddress("position", position, &b_position); fChain->SetBranchAddress("originalMomentum", originalMomentum, &b_originalMomentum); fChain->SetBranchAddress("finalMomentum", finalMomentum, &b_finalMomentum); fChain->SetBranchAddress("oilTime", &oilTime, &b_oilTime); fChain->SetBranchAddress("oilPath", &oilPath, &b_oilPath); fChain->SetBranchAddress("barTime", &barTime, &b_barTime); fChain->SetBranchAddress("barPath", &barPath, &b_barPath); fChain->SetBranchAddress("windowTime", &windowTime, &b_windowTime); fChain->SetBranchAddress("windowPath", &windowPath, &b_windowPath); fChain->SetBranchAddress("quartzTime", &quartzTime, &b_quartzTime); fChain->SetBranchAddress("quartzPath", &quartzPath, &b_quartzPath); fChain->SetBranchAddress("numberOfBounces", &numberOfBounces, &b_numberOfBounces); fChain->SetBranchAddress("pmtTimeDelay", &pmtTimeDelay, &b_pmtTimeDelay); fChain->SetBranchAddress("ParticleType", &ParticleType, &b_ParticleType); fChain->SetBranchAddress("Gun_Energy", &Gun_Energy, &b_Gun_Energy); fChain->SetBranchAddress("Gun_Position", Gun_Position, &b_Gun_Position); fChain->SetBranchAddress("Gun_Direction", Gun_Direction, &b_Gun_Direction); fChain->SetBranchAddress("flag", &flag, &b_flag); Notify(); } Bool_t KxKy_base::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 KxKy_base::Show(Long64_t entry) { // Print contents of entry. // If entry is not specified, print current entry if (!fChain) return; fChain->Show(entry); } Int_t KxKy_base::Cut(Long64_t entry) { // This function may be called from Loop. // returns 1 if entry is accepted. // returns -1 otherwise. return 1; } #endif // #ifdef KxKy_base_cxx