////////////////////////////////////////////////////////// // This class has been automatically generated on // Fri Jul 4 07:28:59 2008 by ROOT version 5.12/00e // from TChain TruthTree/ ////////////////////////////////////////////////////////// #ifndef TruthTree_h #define TruthTree_h #include #include #include class TruthTree { public : TTree *fChain; //!pointer to the analyzed TTree or TChain Int_t fCurrent; //!current Tree number in a TChain // Declaration of leave types Int_t RunNumber; Int_t EventNumber; Char_t Token[153]; Int_t truth_Z_num; Double_t truth_Z1_pt; Double_t truth_Z1_eta; Double_t truth_Z1_phi; Double_t truth_Z1_m; Int_t truth_Z1_pdgid; Double_t truth_Z2_pt; Double_t truth_Z2_eta; Double_t truth_Z2_phi; Double_t truth_Z2_m; Int_t truth_Z2_pdgid; Int_t truth_H_num; Double_t truth_H_pt; Double_t truth_H_eta; Double_t truth_H_phi; Double_t truth_H_m; Int_t truth_H_pdgid; vector *truth_daughter1_pt; vector *truth_daughter1_eta; vector *truth_daughter1_phi; vector *truth_daughter1_m; vector *truth_daughter1_pdgid; vector *truth_daughter2_pt; vector *truth_daughter2_eta; vector *truth_daughter2_phi; vector *truth_daughter2_m; vector *truth_daughter2_pdgid; vector *truth_electron_pt; vector *truth_electron_eta; vector *truth_electron_phi; vector *truth_electron_m; vector *truth_electron_pdgid; vector *truth_muon_pt; vector *truth_muon_eta; vector *truth_muon_phi; vector *truth_muon_m; vector *truth_muon_pdgid; // List of branches TBranch *b_RunNumber; //! TBranch *b_EventNumber; //! TBranch *b_Token; //! TBranch *b_truth_Z_num; //! TBranch *b_truth_Z1_pt; //! TBranch *b_truth_Z1_eta; //! TBranch *b_truth_Z1_phi; //! TBranch *b_truth_Z1_m; //! TBranch *b_truth_Z1_pdgid; //! TBranch *b_truth_Z2_pt; //! TBranch *b_truth_Z2_eta; //! TBranch *b_truth_Z2_phi; //! TBranch *b_truth_Z2_m; //! TBranch *b_truth_Z2_pdgid; //! TBranch *b_truth_H_num; //! TBranch *b_truth_H_pt; //! TBranch *b_truth_H_eta; //! TBranch *b_truth_H_phi; //! TBranch *b_truth_H_m; //! TBranch *b_truth_H_pdgid; //! TBranch *b_truth_daughter1_pt; //! TBranch *b_truth_daughter1_eta; //! TBranch *b_truth_daughter1_phi; //! TBranch *b_truth_daughter1_m; //! TBranch *b_truth_daughter1_pdgid; //! TBranch *b_truth_daughter2_pt; //! TBranch *b_truth_daughter2_eta; //! TBranch *b_truth_daughter2_phi; //! TBranch *b_truth_daughter2_m; //! TBranch *b_truth_daughter2_pdgid; //! TBranch *b_truth_electron_pt; //! TBranch *b_truth_electron_eta; //! TBranch *b_truth_electron_phi; //! TBranch *b_truth_electron_m; //! TBranch *b_truth_electron_pdgid; //! TBranch *b_truth_muon_pt; //! TBranch *b_truth_muon_eta; //! TBranch *b_truth_muon_phi; //! TBranch *b_truth_muon_m; //! TBranch *b_truth_muon_pdgid; //! TruthTree(TTree *tree=0); virtual ~TruthTree(); 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 TruthTree_cxx TruthTree::TruthTree(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("TestNtupleOutput_300GeV_Higgs.root"); if (!f) { f = new TFile("TestNtupleOutput_300GeV_Higgs.root"); } tree = (TTree*)gDirectory->Get("TruthTree"); #else // SINGLE_TREE // The following code should be used if you want this class to access a chain // of trees. TChain * chain = new TChain("TruthTree",""); chain->Add("TestNtupleOutput_130GeV_Higgs.root/TruthTree"); chain->Add("TestNtupleOutput_300GeV_Higgs.root/TruthTree"); tree = chain; #endif // SINGLE_TREE } Init(tree); } TruthTree::~TruthTree() { if (!fChain) return; delete fChain->GetCurrentFile(); } Int_t TruthTree::GetEntry(Long64_t entry) { // Read contents of entry. if (!fChain) return 0; return fChain->GetEntry(entry); } Long64_t TruthTree::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->IsA() != TChain::Class()) return centry; TChain *chain = (TChain*)fChain; if (chain->GetTreeNumber() != fCurrent) { fCurrent = chain->GetTreeNumber(); Notify(); } return centry; } void TruthTree::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 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 on PROOF // (once per file to be processed). // Set object pointer truth_daughter1_pt = 0; truth_daughter1_eta = 0; truth_daughter1_phi = 0; truth_daughter1_m = 0; truth_daughter1_pdgid = 0; truth_daughter2_pt = 0; truth_daughter2_eta = 0; truth_daughter2_phi = 0; truth_daughter2_m = 0; truth_daughter2_pdgid = 0; truth_electron_pt = 0; truth_electron_eta = 0; truth_electron_phi = 0; truth_electron_m = 0; truth_electron_pdgid = 0; truth_muon_pt = 0; truth_muon_eta = 0; truth_muon_phi = 0; truth_muon_m = 0; truth_muon_pdgid = 0; // Set branch addresses and branch pointers if (!tree) return; fChain = tree; fCurrent = -1; fChain->SetMakeClass(1); fChain->SetBranchAddress("RunNumber", &RunNumber, &b_RunNumber); fChain->SetBranchAddress("EventNumber", &EventNumber, &b_EventNumber); fChain->SetBranchAddress("Token", Token, &b_Token); fChain->SetBranchAddress("truth_Z_num", &truth_Z_num, &b_truth_Z_num); fChain->SetBranchAddress("truth_Z1_pt", &truth_Z1_pt, &b_truth_Z1_pt); fChain->SetBranchAddress("truth_Z1_eta", &truth_Z1_eta, &b_truth_Z1_eta); fChain->SetBranchAddress("truth_Z1_phi", &truth_Z1_phi, &b_truth_Z1_phi); fChain->SetBranchAddress("truth_Z1_m", &truth_Z1_m, &b_truth_Z1_m); fChain->SetBranchAddress("truth_Z1_pdgid", &truth_Z1_pdgid, &b_truth_Z1_pdgid); fChain->SetBranchAddress("truth_Z2_pt", &truth_Z2_pt, &b_truth_Z2_pt); fChain->SetBranchAddress("truth_Z2_eta", &truth_Z2_eta, &b_truth_Z2_eta); fChain->SetBranchAddress("truth_Z2_phi", &truth_Z2_phi, &b_truth_Z2_phi); fChain->SetBranchAddress("truth_Z2_m", &truth_Z2_m, &b_truth_Z2_m); fChain->SetBranchAddress("truth_Z2_pdgid", &truth_Z2_pdgid, &b_truth_Z2_pdgid); fChain->SetBranchAddress("truth_H_num", &truth_H_num, &b_truth_H_num); fChain->SetBranchAddress("truth_H_pt", &truth_H_pt, &b_truth_H_pt); fChain->SetBranchAddress("truth_H_eta", &truth_H_eta, &b_truth_H_eta); fChain->SetBranchAddress("truth_H_phi", &truth_H_phi, &b_truth_H_phi); fChain->SetBranchAddress("truth_H_m", &truth_H_m, &b_truth_H_m); fChain->SetBranchAddress("truth_H_pdgid", &truth_H_pdgid, &b_truth_H_pdgid); fChain->SetBranchAddress("truth_daughter1_pt", &truth_daughter1_pt, &b_truth_daughter1_pt); fChain->SetBranchAddress("truth_daughter1_eta", &truth_daughter1_eta, &b_truth_daughter1_eta); fChain->SetBranchAddress("truth_daughter1_phi", &truth_daughter1_phi, &b_truth_daughter1_phi); fChain->SetBranchAddress("truth_daughter1_m", &truth_daughter1_m, &b_truth_daughter1_m); fChain->SetBranchAddress("truth_daughter1_pdgid", &truth_daughter1_pdgid, &b_truth_daughter1_pdgid); fChain->SetBranchAddress("truth_daughter2_pt", &truth_daughter2_pt, &b_truth_daughter2_pt); fChain->SetBranchAddress("truth_daughter2_eta", &truth_daughter2_eta, &b_truth_daughter2_eta); fChain->SetBranchAddress("truth_daughter2_phi", &truth_daughter2_phi, &b_truth_daughter2_phi); fChain->SetBranchAddress("truth_daughter2_m", &truth_daughter2_m, &b_truth_daughter2_m); fChain->SetBranchAddress("truth_daughter2_pdgid", &truth_daughter2_pdgid, &b_truth_daughter2_pdgid); fChain->SetBranchAddress("truth_electron_pt", &truth_electron_pt, &b_truth_electron_pt); fChain->SetBranchAddress("truth_electron_eta", &truth_electron_eta, &b_truth_electron_eta); fChain->SetBranchAddress("truth_electron_phi", &truth_electron_phi, &b_truth_electron_phi); fChain->SetBranchAddress("truth_electron_m", &truth_electron_m, &b_truth_electron_m); fChain->SetBranchAddress("truth_electron_pdgid", &truth_electron_pdgid, &b_truth_electron_pdgid); fChain->SetBranchAddress("truth_muon_pt", &truth_muon_pt, &b_truth_muon_pt); fChain->SetBranchAddress("truth_muon_eta", &truth_muon_eta, &b_truth_muon_eta); fChain->SetBranchAddress("truth_muon_phi", &truth_muon_phi, &b_truth_muon_phi); fChain->SetBranchAddress("truth_muon_m", &truth_muon_m, &b_truth_muon_m); fChain->SetBranchAddress("truth_muon_pdgid", &truth_muon_pdgid, &b_truth_muon_pdgid); Notify(); } Bool_t TruthTree::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 normaly 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 TruthTree::Show(Long64_t entry) { // Print contents of entry. // If entry is not specified, print current entry if (!fChain) return; fChain->Show(entry); } Int_t TruthTree::Cut(Long64_t entry) { // This function may be called from Loop. // returns 1 if entry is accepted. // returns -1 otherwise. return 1; } #endif // #ifdef TruthTree_cxx