Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:12:30

0001 //////////////////////////////////////////////////////////
0002 // This class has been automatically generated on
0003 // Sat Oct 28 06:25:34 2023 by ROOT version 6.26/06
0004 // from TTree tree_clu/clustering info.
0005 // found on file: beam_inttall-00020869-0000_event_base_ana_cluster_full_survey_3.32_excludeR40000_200kEvent_3HotCut.root
0006 //////////////////////////////////////////////////////////
0007 
0008 #ifndef PrivateCluReader_h
0009 #define PrivateCluReader_h
0010 
0011 #include <TROOT.h>
0012 #include <TChain.h>
0013 #include <TFile.h>
0014 
0015 // note : Header file for the classes stored in the TTree if any.
0016 #include "vector"
0017 
0018 class PrivateCluReader {
0019 public :
0020    TTree          *fChain;   //!pointer to the analyzed TTree or TChain
0021    Int_t           fCurrent; //!current Tree number in a TChain
0022 
0023    // note :  Fixed size dimensions of array or collections stored in the TTree if any.
0024 
0025    // note : Declaration of leaf types
0026    Int_t           nhits;
0027    Int_t           nclu_inner;
0028    Int_t           nclu_outer;
0029    Long64_t        bco_full;
0030    vector<int>     *column;
0031    vector<double>  *avg_chan;
0032    vector<int>     *sum_adc;
0033    vector<int>     *sum_adc_conv;
0034    vector<int>     *size;
0035    vector<double>  *x;
0036    vector<double>  *y;
0037    vector<double>  *z;
0038    vector<int>     *layer;
0039    vector<double>  *phi;
0040    // vector<vector<double> > *bco_diff_vec;
0041    vector<int>     *server;
0042    vector<int>     *module;
0043 
0044    // note : List of branches
0045    TBranch        *b_nhits;   //!
0046    TBranch        *b_nclu_inner;   //!
0047    TBranch        *b_nclu_outer;   //!
0048    TBranch        *b_bco_full;   //!
0049    TBranch        *b_column;   //!
0050    TBranch        *b_avg_chan;   //!
0051    TBranch        *b_sum_adc;   //!
0052    TBranch        *b_sum_adc_conv;   //!
0053    TBranch        *b_size;   //!
0054    TBranch        *b_x;   //!
0055    TBranch        *b_y;   //!
0056    TBranch        *b_z;   //!
0057    TBranch        *b_layer;   //!
0058    TBranch        *b_phi;   //!
0059    // TBranch        *b_bco_diff_vec;   //!
0060    TBranch        *b_server;   //!
0061    TBranch        *b_module;   //!
0062 
0063    PrivateCluReader(TTree *tree=0);
0064    virtual ~PrivateCluReader();
0065    virtual Int_t    Cut(Long64_t entry);
0066    virtual Int_t    GetEntry(Long64_t entry);
0067    virtual Long64_t LoadTree(Long64_t entry);
0068    virtual void     Init(TTree *tree);
0069    virtual void     Loop();
0070    virtual Bool_t   Notify();
0071    virtual void     Show(Long64_t entry = -1);
0072 };
0073 
0074 #endif
0075 
0076 #ifdef PrivateCluReader_cxx
0077 PrivateCluReader::PrivateCluReader(TTree *tree) : fChain(0) 
0078 {
0079    // note : if parameter tree is not specified (or zero), connect the file
0080    // note : used to generate this class and read the Tree.
0081    if (tree == 0) {
0082       // TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("beam_inttall-00020869-0000_event_base_ana_cluster_full_survey_3.32_excludeR40000_200kEvent_3HotCut.root");
0083       // if (!f || !f->IsOpen()) {
0084       //    f = new TFile("beam_inttall-00020869-0000_event_base_ana_cluster_full_survey_3.32_excludeR40000_200kEvent_3HotCut.root");
0085       // }
0086       // f->GetObject("tree_clu",tree);
0087 
0088       cout<<"Class PrivateCluReader, No tree input, exit "<<endl;
0089       exit(1);
0090    }
0091 
0092 
0093    Init(tree);
0094 }
0095 
0096 PrivateCluReader::~PrivateCluReader()
0097 {
0098    if (!fChain) return;
0099    delete fChain->GetCurrentFile();
0100 }
0101 
0102 Int_t PrivateCluReader::GetEntry(Long64_t entry)
0103 {
0104    // note : Read contents of entry.
0105    if (!fChain) return 0;
0106    return fChain->GetEntry(entry);
0107 }
0108 Long64_t PrivateCluReader::LoadTree(Long64_t entry)
0109 {
0110    // note : Set the environment to read one entry
0111    if (!fChain) return -5;
0112    Long64_t centry = fChain->LoadTree(entry);
0113    if (centry < 0) return centry;
0114    if (fChain->GetTreeNumber() != fCurrent) {
0115       fCurrent = fChain->GetTreeNumber();
0116       Notify();
0117    }
0118    return centry;
0119 }
0120 
0121 void PrivateCluReader::Init(TTree *tree)
0122 {
0123    // note : The Init() function is called when the selector needs to initialize
0124    // note : a new tree or chain. Typically here the branch addresses and branch
0125    // note : pointers of the tree will be set.
0126    // note : It is normally not necessary to make changes to the generated
0127    // note : code, but the routine can be extended by the user if needed.
0128    // note : Init() will be called many times when running on PROOF
0129    // note : (once per file to be processed).
0130 
0131    // note : Set object pointer
0132    column = 0;
0133    avg_chan = 0;
0134    sum_adc = 0;
0135    sum_adc_conv = 0;
0136    size = 0;
0137    x = 0;
0138    y = 0;
0139    z = 0;
0140    layer = 0;
0141    phi = 0;
0142    // bco_diff_vec = 0;
0143    server = 0;
0144    module = 0;
0145    // note : Set branch addresses and branch pointers
0146    if (!tree) return;
0147    fChain = tree;
0148    fCurrent = -1;
0149    fChain->SetMakeClass(1);
0150 
0151    fChain -> SetBranchStatus("*",0);
0152    fChain -> SetBranchStatus("nhits",1);
0153    fChain -> SetBranchStatus("nclu_inner",1);
0154    fChain -> SetBranchStatus("nclu_outer",1);
0155    fChain -> SetBranchStatus("bco_full",1);
0156    fChain -> SetBranchStatus("column",1);
0157    fChain -> SetBranchStatus("avg_chan",1);
0158    fChain -> SetBranchStatus("sum_adc",1);
0159    fChain -> SetBranchStatus("sum_adc_conv",1);
0160    fChain -> SetBranchStatus("size",1);
0161    fChain -> SetBranchStatus("x",1);
0162    fChain -> SetBranchStatus("y",1);
0163    fChain -> SetBranchStatus("z",1);
0164    fChain -> SetBranchStatus("layer",1);
0165    fChain -> SetBranchStatus("phi",1);
0166    fChain -> SetBranchStatus("server", 1);
0167    fChain -> SetBranchStatus("module", 1);
0168 
0169    fChain->SetBranchAddress("nhits", &nhits, &b_nhits);
0170    fChain->SetBranchAddress("nclu_inner", &nclu_inner, &b_nclu_inner);
0171    fChain->SetBranchAddress("nclu_outer", &nclu_outer, &b_nclu_outer);
0172    fChain->SetBranchAddress("bco_full", &bco_full, &b_bco_full);
0173    fChain->SetBranchAddress("column", &column, &b_column);
0174    fChain->SetBranchAddress("avg_chan", &avg_chan, &b_avg_chan);
0175    fChain->SetBranchAddress("sum_adc", &sum_adc, &b_sum_adc);
0176    fChain->SetBranchAddress("sum_adc_conv", &sum_adc_conv, &b_sum_adc_conv);
0177    fChain->SetBranchAddress("size", &size, &b_size);
0178    fChain->SetBranchAddress("x", &x, &b_x);
0179    fChain->SetBranchAddress("y", &y, &b_y);
0180    fChain->SetBranchAddress("z", &z, &b_z);
0181    fChain->SetBranchAddress("layer", &layer, &b_layer);
0182    fChain->SetBranchAddress("phi", &phi, &b_phi);
0183    // fChain->SetBranchAddress("bco_diff_vec", &bco_diff_vec, &b_bco_diff_vec);
0184    fChain->SetBranchAddress("server", &server, &b_server);
0185    fChain->SetBranchAddress("module", &module, &b_module);
0186    Notify();
0187 }
0188 
0189 Bool_t PrivateCluReader::Notify()
0190 {
0191    // note : The Notify() function is called when a new file is opened. This
0192    // note : can be either for a new TTree in a TChain or when when a new TTree
0193    // note : is started when using PROOF. It is normally not necessary to make changes
0194    // note : to the generated code, but the routine can be extended by the
0195    // note : user if needed. The return value is currently not used.
0196 
0197    return kTRUE;
0198 }
0199 
0200 void PrivateCluReader::Show(Long64_t entry)
0201 {
0202    // note : Print contents of entry.
0203    // note : If entry is not specified, print current entry
0204    if (!fChain) return;
0205    fChain->Show(entry);
0206 }
0207 Int_t PrivateCluReader::Cut(Long64_t entry)
0208 {
0209    // note : This function may be called from Loop.
0210    // note : returns  1 if entry is accepted.
0211    // note : returns -1 otherwise.
0212    return 1;
0213 }
0214 #endif // note :  #ifdef PrivateCluReader_cxx