Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-09 08:13:29

0001 //////////////////////////////////////////////////////////
0002 // This class has been automatically generated on
0003 // Fri Jan 26 00:22:48 2024 by ROOT version 6.26/06
0004 // from TTree clus_tree/clus_tree
0005 // found on file: tracking_1K_reverse_3sigma_cut.root
0006 //////////////////////////////////////////////////////////
0007 
0008 #ifndef clustree_h
0009 #define clustree_h
0010 
0011 #include <TROOT.h>
0012 #include <TChain.h>
0013 #include <TFile.h>
0014 
0015 // Header file for the classes stored in the TTree if any.
0016 #include "vector"
0017 
0018 class clustree
0019 {
0020 public:
0021    TTree *fChain;  //! pointer to the analyzed TTree or TChain
0022    Int_t fCurrent; //! current Tree number in a TChain
0023 
0024    // Fixed size dimensions of array or collections stored in the TTree if any.
0025 
0026    // Declaration of leaf types
0027    vector<double> *x_out;
0028    vector<double> *y_out;
0029    vector<double> *z_out;
0030    vector<double> *r_out;
0031    vector<double> *phi_out;
0032    vector<double> *theta_out;
0033 
0034    vector<double> *x_in;
0035    vector<double> *y_in;
0036    vector<double> *z_in;
0037    vector<double> *r_in;
0038    vector<double> *phi_in;
0039    vector<double> *theta_in;
0040 
0041    // List of branches
0042    TBranch *b_x_out;     //!
0043    TBranch *b_y_out;     //!
0044    TBranch *b_z_out;     //!
0045    TBranch *b_r_out;     //!
0046    TBranch *b_phi_out;   //!
0047    TBranch *b_theta_out; //!
0048    TBranch *b_x_in;     //!
0049    TBranch *b_y_in;     //!
0050    TBranch *b_z_in;     //!
0051    TBranch *b_r_in;     //!
0052    TBranch *b_phi_in;   //!
0053    TBranch *b_theta_in; //!
0054 
0055    clustree(TTree *tree = 0);
0056    virtual ~clustree();
0057    virtual Int_t Cut(Long64_t entry);
0058    virtual Int_t GetEntry(Long64_t entry);
0059    virtual Long64_t LoadTree(Long64_t entry);
0060    virtual void Init(TTree *tree);
0061    virtual void Loop();
0062    virtual Bool_t Notify();
0063    virtual void Show(Long64_t entry = -1);
0064 };
0065 
0066 #endif
0067 
0068 #ifdef clustree_cxx
0069 clustree::clustree(TTree *tree) : fChain(0)
0070 {
0071    // if parameter tree is not specified (or zero), connect the file
0072    // used to generate this class and read the Tree.
0073    if (tree == 0)
0074    {
0075       TFile *f = (TFile *)gROOT->GetListOfFiles()->FindObject("tracking_1K_reverse_3sigma_cut.root");
0076       if (!f || !f->IsOpen())
0077       {
0078          f = new TFile("tracking_1K_reverse_3sigma_cut.root");
0079       }
0080       f->GetObject("clus_tree", tree);
0081    }
0082    Init(tree);
0083 }
0084 
0085 clustree::~clustree()
0086 {
0087    if (!fChain)
0088       return;
0089    delete fChain->GetCurrentFile();
0090 }
0091 
0092 Int_t clustree::GetEntry(Long64_t entry)
0093 {
0094    // Read contents of entry.
0095    if (!fChain)
0096       return 0;
0097    return fChain->GetEntry(entry);
0098 }
0099 Long64_t clustree::LoadTree(Long64_t entry)
0100 {
0101    // Set the environment to read one entry
0102    if (!fChain)
0103       return -5;
0104    Long64_t centry = fChain->LoadTree(entry);
0105    if (centry < 0)
0106       return centry;
0107    if (fChain->GetTreeNumber() != fCurrent)
0108    {
0109       fCurrent = fChain->GetTreeNumber();
0110       Notify();
0111    }
0112    return centry;
0113 }
0114 
0115 void clustree::Init(TTree *tree)
0116 {
0117    // The Init() function is called when the selector needs to initialize
0118    // a new tree or chain. Typically here the branch addresses and branch
0119    // pointers of the tree will be set.
0120    // It is normally not necessary to make changes to the generated
0121    // code, but the routine can be extended by the user if needed.
0122    // Init() will be called many times when running on PROOF
0123    // (once per file to be processed).
0124 
0125    // Set object pointer
0126    x_out = 0;
0127    y_out = 0;
0128    z_out = 0;
0129    r_out = 0;
0130    phi_out = 0;
0131    theta_out = 0;
0132 
0133    x_in = 0;
0134    y_in = 0;
0135    z_in = 0;
0136    r_in = 0;
0137    phi_in = 0;
0138    theta_in = 0;
0139    // Set branch addresses and branch pointers
0140    if (!tree)
0141       return;
0142    fChain = tree;
0143    fCurrent = -1;
0144    fChain->SetMakeClass(1);
0145 
0146    fChain->SetBranchAddress("x_out", &x_out, &b_x_out);
0147    fChain->SetBranchAddress("y_out", &y_out, &b_y_out);
0148    fChain->SetBranchAddress("z_out", &z_out, &b_z_out);
0149    fChain->SetBranchAddress("r_out", &r_out, &b_r_out);
0150    fChain->SetBranchAddress("phi_out", &phi_out, &b_phi_out);
0151    fChain->SetBranchAddress("theta_out", &theta_out, &b_theta_out);
0152 
0153    fChain->SetBranchAddress("x_in", &x_in, &b_x_in);
0154    fChain->SetBranchAddress("y_in", &y_in, &b_y_in);
0155    fChain->SetBranchAddress("z_in", &z_in, &b_z_in);
0156    fChain->SetBranchAddress("r_in", &r_in, &b_r_in);
0157    fChain->SetBranchAddress("phi_in", &phi_in, &b_phi_in);
0158    fChain->SetBranchAddress("theta_in", &theta_in, &b_theta_in);
0159    Notify();
0160 }
0161 
0162 Bool_t clustree::Notify()
0163 {
0164    // The Notify() function is called when a new file is opened. This
0165    // can be either for a new TTree in a TChain or when when a new TTree
0166    // is started when using PROOF. It is normally not necessary to make changes
0167    // to the generated code, but the routine can be extended by the
0168    // user if needed. The return value is currently not used.
0169 
0170    return kTRUE;
0171 }
0172 
0173 void clustree::Show(Long64_t entry)
0174 {
0175    // Print contents of entry.
0176    // If entry is not specified, print current entry
0177    if (!fChain)
0178       return;
0179    fChain->Show(entry);
0180 }
0181 Int_t clustree::Cut(Long64_t entry)
0182 {
0183    // This function may be called from Loop.
0184    // returns  1 if entry is accepted.
0185    // returns -1 otherwise.
0186    return 1;
0187 }
0188 #endif // #ifdef clustree_cxx