Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:11:23

0001 //////////////////////////////////////////////////////////
0002 // This class has been automatically generated on
0003 // Thu Jan 18 00:52:36 2024 by ROOT version 6.26/06
0004 // from TTree tree/tree
0005 // found on file: beam_intt2-00020869-0000_event_base.root
0006 //////////////////////////////////////////////////////////
0007 
0008 #ifndef ReadEventBase_h
0009 #define ReadEventBase_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 "TObject.h"
0017 
0018 class ReadEventBase {
0019 public :
0020    TTree          *fChain;   //!pointer to the analyzed TTree or TChain
0021    Int_t           fCurrent; //!current Tree number in a TChain
0022 
0023    static constexpr Int_t kMaxfhitArray = 5955;
0024 
0025    // Declaration of leaf types
0026  //InttEvent       *event;
0027    UInt_t          fUniqueID;
0028    UInt_t          fBits;
0029    Int_t           evtSeq;
0030    Long64_t        bco;
0031    Int_t           fNhits;
0032    Int_t           fhitArray_;
0033    UInt_t          fhitArray_fUniqueID[kMaxfhitArray];   //[fhitArray_]
0034    UInt_t          fhitArray_fBits[kMaxfhitArray];   //[fhitArray_]
0035    Int_t           fhitArray_pid[kMaxfhitArray];   //[fhitArray_]
0036    Int_t           fhitArray_adc[kMaxfhitArray];   //[fhitArray_]
0037    Int_t           fhitArray_ampl[kMaxfhitArray];   //[fhitArray_]
0038    Int_t           fhitArray_chip_id[kMaxfhitArray];   //[fhitArray_]
0039    Int_t           fhitArray_module[kMaxfhitArray];   //[fhitArray_]
0040    Int_t           fhitArray_chan_id[kMaxfhitArray];   //[fhitArray_]
0041    Int_t           fhitArray_bco[kMaxfhitArray];   //[fhitArray_]
0042    Long64_t        fhitArray_bco_full[kMaxfhitArray];   //[fhitArray_]
0043    Int_t           fhitArray_evt[kMaxfhitArray];   //[fhitArray_]
0044    Int_t           fhitArray_roc[kMaxfhitArray];   //[fhitArray_]
0045    Int_t           fhitArray_barrel[kMaxfhitArray];   //[fhitArray_]
0046    Int_t           fhitArray_layer[kMaxfhitArray];   //[fhitArray_]
0047    Int_t           fhitArray_ladder[kMaxfhitArray];   //[fhitArray_]
0048    Int_t           fhitArray_arm[kMaxfhitArray];   //[fhitArray_]
0049    Int_t           fhitArray_full_fphx[kMaxfhitArray];   //[fhitArray_]
0050    Int_t           fhitArray_full_roc[kMaxfhitArray];   //[fhitArray_]
0051 
0052    // List of branches
0053    TBranch        *b_event_fUniqueID;   //!
0054    TBranch        *b_event_fBits;   //!
0055    TBranch        *b_event_evtSeq;   //!
0056    TBranch        *b_event_bco;   //!
0057    TBranch        *b_event_fNhits;   //!
0058    TBranch        *b_event_fhitArray_;   //!
0059    TBranch        *b_fhitArray_fUniqueID;   //!
0060    TBranch        *b_fhitArray_fBits;   //!
0061    TBranch        *b_fhitArray_pid;   //!
0062    TBranch        *b_fhitArray_adc;   //!
0063    TBranch        *b_fhitArray_ampl;   //!
0064    TBranch        *b_fhitArray_chip_id;   //!
0065    TBranch        *b_fhitArray_module;   //!
0066    TBranch        *b_fhitArray_chan_id;   //!
0067    TBranch        *b_fhitArray_bco;   //!
0068    TBranch        *b_fhitArray_bco_full;   //!
0069    TBranch        *b_fhitArray_evt;   //!
0070    TBranch        *b_fhitArray_roc;   //!
0071    TBranch        *b_fhitArray_barrel;   //!
0072    TBranch        *b_fhitArray_layer;   //!
0073    TBranch        *b_fhitArray_ladder;   //!
0074    TBranch        *b_fhitArray_arm;   //!
0075    TBranch        *b_fhitArray_full_fphx;   //!
0076    TBranch        *b_fhitArray_full_roc;   //!
0077 
0078    ReadEventBase(TTree *tree=0);
0079    virtual ~ReadEventBase();
0080    virtual Int_t    Cut(Long64_t entry);
0081    virtual Int_t    GetEntry(Long64_t entry);
0082    virtual Long64_t LoadTree(Long64_t entry);
0083    virtual void     Init(TTree *tree);
0084    virtual void     Loop();
0085    virtual Bool_t   Notify();
0086    virtual void     Show(Long64_t entry = -1);
0087 };
0088 
0089 #endif
0090 
0091 #ifdef ReadEventBase_cxx
0092 ReadEventBase::ReadEventBase(TTree *tree) : fChain(0) 
0093 {
0094 // if parameter tree is not specified (or zero), connect the file
0095 // used to generate this class and read the Tree.
0096    if (tree == 0) {
0097       TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("beam_intt2-00020869-0000_event_base.root");
0098       if (!f || !f->IsOpen()) {
0099          f = new TFile("beam_intt2-00020869-0000_event_base.root");
0100       }
0101       f->GetObject("tree",tree);
0102 
0103    }
0104    Init(tree);
0105 }
0106 
0107 ReadEventBase::~ReadEventBase()
0108 {
0109    if (!fChain) return;
0110    delete fChain->GetCurrentFile();
0111 }
0112 
0113 Int_t ReadEventBase::GetEntry(Long64_t entry)
0114 {
0115 // Read contents of entry.
0116    if (!fChain) return 0;
0117    return fChain->GetEntry(entry);
0118 }
0119 Long64_t ReadEventBase::LoadTree(Long64_t entry)
0120 {
0121 // Set the environment to read one entry
0122    if (!fChain) return -5;
0123    Long64_t centry = fChain->LoadTree(entry);
0124    if (centry < 0) return centry;
0125    if (fChain->GetTreeNumber() != fCurrent) {
0126       fCurrent = fChain->GetTreeNumber();
0127       Notify();
0128    }
0129    return centry;
0130 }
0131 
0132 void ReadEventBase::Init(TTree *tree)
0133 {
0134    // The Init() function is called when the selector needs to initialize
0135    // a new tree or chain. Typically here the branch addresses and branch
0136    // pointers of the tree will be set.
0137    // It is normally not necessary to make changes to the generated
0138    // code, but the routine can be extended by the user if needed.
0139    // Init() will be called many times when running on PROOF
0140    // (once per file to be processed).
0141 
0142    // Set branch addresses and branch pointers
0143    if (!tree) return;
0144    fChain = tree;
0145    fCurrent = -1;
0146    fChain->SetMakeClass(1);
0147 
0148    fChain -> SetBranchStatus("*",0);
0149    fChain -> SetBranchStatus("fNhits",1);
0150    fChain -> SetBranchStatus("fhitArray.chan_id",1);
0151 
0152    // fChain->SetBranchAddress("fUniqueID", &fUniqueID, &b_event_fUniqueID);
0153    // fChain->SetBranchAddress("fBits", &fBits, &b_event_fBits);
0154    // fChain->SetBranchAddress("evtSeq", &evtSeq, &b_event_evtSeq);
0155    // fChain->SetBranchAddress("bco", &bco, &b_event_bco);
0156    fChain->SetBranchAddress("fNhits", &fNhits, &b_event_fNhits);
0157    fChain->GetEntry(0);
0158    // fChain->SetBranchAddress("fhitArray", &fhitArray_, &b_event_fhitArray_);
0159    // fChain->SetBranchAddress("fhitArray.fUniqueID", fhitArray_fUniqueID, &b_fhitArray_fUniqueID);
0160    // fChain->SetBranchAddress("fhitArray.fBits", fhitArray_fBits, &b_fhitArray_fBits);
0161    // fChain->SetBranchAddress("fhitArray.pid", fhitArray_pid, &b_fhitArray_pid);
0162    // fChain->SetBranchAddress("fhitArray.adc", fhitArray_adc, &b_fhitArray_adc);
0163    // fChain->SetBranchAddress("fhitArray.ampl", fhitArray_ampl, &b_fhitArray_ampl);
0164    // fChain->SetBranchAddress("fhitArray.chip_id", fhitArray_chip_id, &b_fhitArray_chip_id);
0165    // fChain->SetBranchAddress("fhitArray.module", fhitArray_module, &b_fhitArray_module);
0166    fChain->SetBranchAddress("fhitArray.chan_id", &fhitArray_chan_id[0], &b_fhitArray_chan_id);
0167    // fChain->SetBranchAddress("fhitArray.bco", fhitArray_bco, &b_fhitArray_bco);
0168    // fChain->SetBranchAddress("fhitArray.bco_full", fhitArray_bco_full, &b_fhitArray_bco_full);
0169    // fChain->SetBranchAddress("fhitArray.evt", fhitArray_evt, &b_fhitArray_evt);
0170    // fChain->SetBranchAddress("fhitArray.roc", fhitArray_roc, &b_fhitArray_roc);
0171    // fChain->SetBranchAddress("fhitArray.barrel", fhitArray_barrel, &b_fhitArray_barrel);
0172    // fChain->SetBranchAddress("fhitArray.layer", fhitArray_layer, &b_fhitArray_layer);
0173    // fChain->SetBranchAddress("fhitArray.ladder", fhitArray_ladder, &b_fhitArray_ladder);
0174    // fChain->SetBranchAddress("fhitArray.arm", fhitArray_arm, &b_fhitArray_arm);
0175    // fChain->SetBranchAddress("fhitArray.full_fphx", fhitArray_full_fphx, &b_fhitArray_full_fphx);
0176    // fChain->SetBranchAddress("fhitArray.full_roc", fhitArray_full_roc, &b_fhitArray_full_roc);
0177    Notify();
0178 }
0179 
0180 Bool_t ReadEventBase::Notify()
0181 {
0182    // The Notify() function is called when a new file is opened. This
0183    // can be either for a new TTree in a TChain or when when a new TTree
0184    // is started when using PROOF. It is normally not necessary to make changes
0185    // to the generated code, but the routine can be extended by the
0186    // user if needed. The return value is currently not used.
0187 
0188    return kTRUE;
0189 }
0190 
0191 void ReadEventBase::Show(Long64_t entry)
0192 {
0193 // Print contents of entry.
0194 // If entry is not specified, print current entry
0195    if (!fChain) return;
0196    fChain->Show(entry);
0197 }
0198 Int_t ReadEventBase::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 ReadEventBase_cxx