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:09 2024 by ROOT version 6.26/06
0004 // from TTree track_tree/track_tree
0005 // found on file: tracking_1K_reverse_3sigma_cut.root
0006 //////////////////////////////////////////////////////////
0007 
0008 #ifndef tracktree_h
0009 #define tracktree_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 tracktree
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> *phi_track;
0028    vector<double> *theta_track;
0029    Int_t ntrack;
0030    int evt_track;
0031    vector<double> *dca_2d;
0032    vector<double> *dca_z;
0033    vector<double> *phi_tracklets;
0034    vector<double> *theta_tracklets;
0035    vector<int> *is_deleted;
0036    vector<int> *dca_range_out;
0037    vector<int> *dca2d_range_out;
0038    vector<int> *dcaz_range_out;
0039    vector<double> *z_tracklets_out;
0040    vector<double> *pT;
0041    vector<double> *pT_truth;
0042 
0043    Double_t x_vertex;
0044    Double_t y_vertex;
0045    Double_t z_vertex;
0046 
0047    // List of branches
0048    TBranch *b_phi_track;           //!
0049    TBranch *b_theta_track;         //!
0050    TBranch *b_ntrack;              //!
0051    TBranch *b_evt_track;           //!
0052    TBranch *b_dca_2d;              //!
0053    TBranch *b_dca_z;               //!
0054    TBranch *b_phi_tracklets;       //!
0055    TBranch *b_theta_tracklets;     //!
0056    TBranch *b_is_deleted;          //!
0057    TBranch *b_dca_range_out;       //!
0058    TBranch *b_dca2d_range_out;     //!
0059    TBranch *b_dcaz_range_out;      //!
0060    TBranch *b_z_tracklets_out;     //!
0061    TBranch *b_pT;     //!
0062    TBranch *b_pT_truth;     //!
0063    TBranch *b_x_vertex;            //!
0064    TBranch *b_y_vertex;            //!
0065    TBranch *b_z_vertex;            //!
0066 
0067    tracktree(TTree *tree = 0);
0068    virtual ~tracktree();
0069    virtual Int_t Cut(Long64_t entry);
0070    virtual Int_t GetEntry(Long64_t entry);
0071    virtual Long64_t LoadTree(Long64_t entry);
0072    virtual void Init(TTree *tree);
0073    virtual void Loop();
0074    virtual Bool_t Notify();
0075    virtual void Show(Long64_t entry = -1);
0076 };
0077 
0078 #endif
0079 
0080 #ifdef tracktree_cxx
0081 tracktree::tracktree(TTree *tree) : fChain(0)
0082 {
0083    // if parameter tree is not specified (or zero), connect the file
0084    // used to generate this class and read the Tree.
0085    if (tree == 0)
0086    {
0087       TFile *f = (TFile *)gROOT->GetListOfFiles()->FindObject("tracking_1K_reverse_3sigma_cut.root");
0088       if (!f || !f->IsOpen())
0089       {
0090          f = new TFile("tracking_1K_reverse_3sigma_cut.root");
0091       }
0092       f->GetObject("track_tree", tree);
0093    }
0094    Init(tree);
0095 }
0096 
0097 tracktree::~tracktree()
0098 {
0099    if (!fChain)
0100       return;
0101    delete fChain->GetCurrentFile();
0102 }
0103 
0104 Int_t tracktree::GetEntry(Long64_t entry)
0105 {
0106    // Read contents of entry.
0107    if (!fChain)
0108       return 0;
0109    return fChain->GetEntry(entry);
0110 }
0111 Long64_t tracktree::LoadTree(Long64_t entry)
0112 {
0113    // Set the environment to read one entry
0114    if (!fChain)
0115       return -5;
0116    Long64_t centry = fChain->LoadTree(entry);
0117    if (centry < 0)
0118       return centry;
0119    if (fChain->GetTreeNumber() != fCurrent)
0120    {
0121       fCurrent = fChain->GetTreeNumber();
0122       Notify();
0123    }
0124    return centry;
0125 }
0126 
0127 void tracktree::Init(TTree *tree)
0128 {
0129    // The Init() function is called when the selector needs to initialize
0130    // a new tree or chain. Typically here the branch addresses and branch
0131    // pointers of the tree will be set.
0132    // It is normally not necessary to make changes to the generated
0133    // code, but the routine can be extended by the user if needed.
0134    // Init() will be called many times when running on PROOF
0135    // (once per file to be processed).
0136 
0137    // Set object pointer
0138    phi_track = 0;
0139    theta_track = 0;
0140    dca_2d = 0;
0141    dca_z = 0;
0142    phi_tracklets = 0;
0143    theta_tracklets = 0;
0144    is_deleted = 0;
0145    dca_range_out = 0;
0146    dca2d_range_out = 0;
0147    dcaz_range_out = 0;
0148    z_tracklets_out = 0;
0149    pT = 0;
0150    pT_truth = 0;
0151    // Set branch addresses and branch pointers
0152    if (!tree)
0153       return;
0154    fChain = tree;
0155    fCurrent = -1;
0156    fChain->SetMakeClass(1);
0157 
0158    fChain->SetBranchAddress("phi_track", &phi_track, &b_phi_track);
0159    fChain->SetBranchAddress("theta_track", &theta_track, &b_theta_track);
0160    fChain->SetBranchAddress("ntrack", &ntrack, &b_ntrack);
0161    fChain->SetBranchAddress("evt_track", &evt_track, &b_evt_track);
0162    fChain->SetBranchAddress("dca_2d", &dca_2d, &b_dca_2d);
0163    fChain->SetBranchAddress("dca_z", &dca_z, &b_dca_z);
0164    fChain->SetBranchAddress("phi_tracklets", &phi_tracklets, &b_phi_tracklets);
0165    fChain->SetBranchAddress("theta_tracklets", &theta_tracklets, &b_theta_tracklets);
0166    fChain->SetBranchAddress("is_deleted", &is_deleted, &b_is_deleted);
0167    fChain->SetBranchAddress("dca_range_out", &dca_range_out, &b_dca_range_out);
0168    fChain->SetBranchAddress("dca2d_range_out", &dca2d_range_out, &b_dca2d_range_out);
0169    fChain->SetBranchAddress("dcaz_range_out", &dcaz_range_out, &b_dcaz_range_out);
0170    fChain->SetBranchAddress("z_tracklets_out", &z_tracklets_out, &b_z_tracklets_out);
0171    fChain->SetBranchAddress("pT", &pT, &b_pT);
0172    fChain->SetBranchAddress("pT_truth", &pT_truth, &b_pT_truth);
0173    fChain->SetBranchAddress("x_vertex", &x_vertex, &b_x_vertex);
0174    fChain->SetBranchAddress("y_vertex", &y_vertex, &b_y_vertex);
0175    fChain->SetBranchAddress("z_vertex", &z_vertex, &b_z_vertex);
0176    Notify();
0177 }
0178 
0179 Bool_t tracktree::Notify()
0180 {
0181    // The Notify() function is called when a new file is opened. This
0182    // can be either for a new TTree in a TChain or when when a new TTree
0183    // is started when using PROOF. It is normally not necessary to make changes
0184    // to the generated code, but the routine can be extended by the
0185    // user if needed. The return value is currently not used.
0186 
0187    return kTRUE;
0188 }
0189 
0190 void tracktree::Show(Long64_t entry)
0191 {
0192    // Print contents of entry.
0193    // If entry is not specified, print current entry
0194    if (!fChain)
0195       return;
0196    fChain->Show(entry);
0197 }
0198 Int_t tracktree::Cut(Long64_t entry)
0199 {
0200    // This function may be called from Loop.
0201    // returns  1 if entry is accepted.
0202    // returns -1 otherwise.
0203    return 1;
0204 }
0205 #endif // #ifdef tracktree_cxx