GammaJetAnalysis.h
GammaJetAnalysis.h
GammaJetAnalysis.h
—
C header,
4Kb
Dateiinhalt
////////////////////////////////////////////////////////// // This class has been automatically generated on // Tue Jun 3 10:55:22 2014 by ROOT version 5.34/02 // from TTree Ntuple/Ntuple // found on file: PythiaGammaJet.root ////////////////////////////////////////////////////////// #ifndef GammaJetAnalysis_h #define GammaJetAnalysis_h #include <TROOT.h> #include <TChain.h> #include <TFile.h> // Header file for the classes stored in the TTree if any. #include <vector> // Fixed size dimensions of array or collections stored in the TTree if any. class GammaJetAnalysis { public : TTree *fChain; //!pointer to the analyzed TTree or TChain Int_t fCurrent; //!current Tree number in a TChain // Declaration of leaf types vector<double> *photon_pt; vector<double> *photon_eta; vector<double> *photon_phi; vector<double> *photon_E; vector<double> *jet_pt; vector<double> *jet_y; vector<double> *jet_phi; vector<double> *jet_M; // List of branches TBranch *b_photon_pt; //! TBranch *b_photon_eta; //! TBranch *b_photon_phi; //! TBranch *b_photon_E; //! TBranch *b_jet_pt; //! TBranch *b_jet_y; //! TBranch *b_jet_phi; //! TBranch *b_jet_M; //! GammaJetAnalysis(TTree *tree=0); virtual ~GammaJetAnalysis(); 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 GammaJetAnalysis_cxx GammaJetAnalysis::GammaJetAnalysis(TTree *tree) : 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("PythiaGammaJet.root"); if (!f || !f->IsOpen()) { f = new TFile("PythiaGammaJet.root"); } f->GetObject("Ntuple",tree); } Init(tree); } GammaJetAnalysis::~GammaJetAnalysis() { if (!fChain) return; delete fChain->GetCurrentFile(); } Int_t GammaJetAnalysis::GetEntry(Long64_t entry) { // Read contents of entry. if (!fChain) return 0; return fChain->GetEntry(entry); } Long64_t GammaJetAnalysis::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 GammaJetAnalysis::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 object pointer photon_pt = 0; photon_eta = 0; photon_phi = 0; photon_E = 0; jet_pt = 0; jet_y = 0; jet_phi = 0; jet_M = 0; // Set branch addresses and branch pointers if (!tree) return; fChain = tree; fCurrent = -1; fChain->SetMakeClass(1); fChain->SetBranchAddress("photon_pt", &photon_pt, &b_photon_pt); fChain->SetBranchAddress("photon_eta", &photon_eta, &b_photon_eta); fChain->SetBranchAddress("photon_phi", &photon_phi, &b_photon_phi); fChain->SetBranchAddress("photon_E", &photon_E, &b_photon_E); fChain->SetBranchAddress("jet_pt", &jet_pt, &b_jet_pt); fChain->SetBranchAddress("jet_y", &jet_y, &b_jet_y); fChain->SetBranchAddress("jet_phi", &jet_phi, &b_jet_phi); fChain->SetBranchAddress("jet_M", &jet_M, &b_jet_M); Notify(); } Bool_t GammaJetAnalysis::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 GammaJetAnalysis::Show(Long64_t entry) { // Print contents of entry. // If entry is not specified, print current entry if (!fChain) return; fChain->Show(entry); } Int_t GammaJetAnalysis::Cut(Long64_t entry) { // This function may be called from Loop. // returns 1 if entry is accepted. // returns -1 otherwise. return 1; } #endif // #ifdef GammaJetAnalysis_cxx