Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:45

0001 //////////////////////////////////////////////////////////
0002 // This class has been automatically generated on
0003 // Wed May  3 14:00:55 2006 by ROOT version 5.10/00c
0004 // from TTree MuProp/MuProp
0005 // found on file: PropagatorDump.test_29.mup.root
0006 //////////////////////////////////////////////////////////
0007 
0008 #ifndef MuProp_h
0009 #define MuProp_h
0010 
0011 #include <TROOT.h>
0012 #include <TChain.h>
0013 #include <TFile.h>
0014 #include <TH2.h>
0015 #include <TH1.h>
0016 #include <TProfile.h>
0017 
0018 
0019 #include <map>
0020 
0021 
0022 class MuProp {
0023 public :
0024    TTree          *fChain;   //!pointer to the analyzed TTree or TChain
0025    Int_t           fCurrent; //!current Tree number in a TChain
0026 
0027    // Declaration of leave types
0028    Int_t           nPoints;
0029    Int_t           q[250];   //[nPoints]
0030    Int_t           pStatus[250][3];   //[nPoints]
0031    Float_t         p3[250][9];   //[nPoints]
0032    Float_t         r3[250][9];   //[nPoints]
0033    Int_t           id[250];   //[nPoints]
0034    Float_t         p3R[250][3];   //[nPoints]
0035    Float_t         r3R[250][3];   //[nPoints]
0036    Float_t         covFlat[250][21];   //[nPoints]
0037    Int_t           run;
0038    Int_t           event_;
0039 
0040    // List of branches
0041    TBranch        *b_nPoints;   //!
0042    TBranch        *b_q;   //!
0043    TBranch        *b_pStatus;   //!
0044    TBranch        *b_p3;   //!
0045    TBranch        *b_r3;   //!
0046    TBranch        *b_id;   //!
0047    TBranch        *b_p3R;   //!
0048    TBranch        *b_r3R;   //!
0049    TBranch        *b_covFlat;   //!
0050    TBranch        *b_run;   //!
0051    TBranch        *b_event;   //!
0052 
0053 
0054    std::map<Int_t,TH1F*> dX_mh1;
0055    TH1F* dX_fh1(Int_t i){ return dX_mh1[i];}
0056 
0057    std::map<Int_t,TH1F*> dXPull_mh1;
0058    TH1F* dXPull_fh1(Int_t i){ return dXPull_mh1[i];}
0059 
0060    Int_t idDT(){return idDT_WhSt(0,0);}
0061    Int_t idCSC(){return idCSC_EnStRi(0,0,0);}
0062 
0063    Int_t idDT_WhSt(Int_t wh, Int_t st) { 
0064      //new format
0065      return ((0x2<<28) | (0x1<<25) | ((wh&0x7)<<15) | ((st&0x7)<<22) );
0066      //old format
0067      //     return ((0x2<<28) | (0x1<<25) | ((wh&0x7)<<22) | ((st&0x7)<<19) );
0068    }
0069 
0070    Int_t idCSC_EnStRi(Int_t en, Int_t st, Int_t ri) { 
0071      return ((0x2<<28) | (0x2<<25) | ((en&0x3)<<16) | ((st&0x7)<<13) | ((ri&0x7)<<10) );
0072    }
0073      
0074    MuProp(TTree *tree=0);
0075    virtual ~MuProp();
0076    virtual Int_t    GetEntry(Long64_t entry);
0077    virtual Long64_t LoadTree(Long64_t entry);
0078    virtual void     Init(TTree *tree);
0079    virtual void     Loop(Double_t maxEloss = 1e12);
0080    virtual Bool_t   Notify();
0081    virtual void     Show(Long64_t entry = -1);
0082 };
0083 
0084 #endif
0085 
0086 #ifdef MuProp_cxx
0087 MuProp::MuProp(TTree *tree)
0088 {
0089 // if parameter tree is not specified (or zero), connect the file
0090 // used to generate this class and read the Tree.
0091    if (tree == 0) {
0092       TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("PropagatorDump.test_29.mup.root");
0093       if (!f) {
0094          f = new TFile("PropagatorDump.test_29.mup.root");
0095       }
0096       tree = (TTree*)gDirectory->Get("MuProp");
0097 
0098    }
0099    Init(tree);
0100 }
0101 
0102 MuProp::~MuProp()
0103 {
0104    if (!fChain) return;
0105    delete fChain->GetCurrentFile();
0106 }
0107 
0108 Int_t MuProp::GetEntry(Long64_t entry)
0109 {
0110 // Read contents of entry.
0111    if (!fChain) return 0;
0112    return fChain->GetEntry(entry);
0113 }
0114 Long64_t MuProp::LoadTree(Long64_t entry)
0115 {
0116 // Set the environment to read one entry
0117    if (!fChain) return -5;
0118    Long64_t centry = fChain->LoadTree(entry);
0119    if (centry < 0) return centry;
0120    if (fChain->IsA() != TChain::Class()) return centry;
0121    TChain *chain = (TChain*)fChain;
0122    if (chain->GetTreeNumber() != fCurrent) {
0123       fCurrent = chain->GetTreeNumber();
0124       Notify();
0125    }
0126    return centry;
0127 }
0128 
0129 void MuProp::Init(TTree *tree)
0130 {
0131    // The Init() function is called when the selector needs to initialize
0132    // a new tree or chain. Typically here the branch addresses of the tree
0133    // will be set. It is normaly not necessary to make changes to the
0134    // generated code, but the routine can be extended by the user if needed.
0135    // Init() will be called many times when running with PROOF.
0136 
0137    // Set branch addresses
0138    if (tree == 0) return;
0139    fChain = tree;
0140    fCurrent = -1;
0141    fChain->SetMakeClass(1);
0142 
0143    fChain->SetBranchAddress("nPoints",&nPoints);
0144    fChain->SetBranchAddress("q",q);
0145    fChain->SetBranchAddress("pStatus",pStatus);
0146    fChain->SetBranchAddress("p3",p3);
0147    fChain->SetBranchAddress("r3",r3);
0148    fChain->SetBranchAddress("id",id);
0149    fChain->SetBranchAddress("p3R",p3R);
0150    fChain->SetBranchAddress("r3R",r3R);
0151    fChain->SetBranchAddress("covFlat",covFlat);
0152    fChain->SetBranchAddress("run",&run);
0153    fChain->SetBranchAddress("event_",&event_);
0154    Notify();
0155 }
0156 
0157 Bool_t MuProp::Notify()
0158 {
0159    // The Notify() function is called when a new file is opened. This
0160    // can be either for a new TTree in a TChain or when when a new TTree
0161    // is started when using PROOF. Typically here the branch pointers
0162    // will be retrieved. It is normaly not necessary to make changes
0163    // to the generated code, but the routine can be extended by the
0164    // user if needed.
0165 
0166    // Get branch pointers
0167    b_nPoints = fChain->GetBranch("nPoints");
0168    b_q = fChain->GetBranch("q");
0169    b_pStatus = fChain->GetBranch("pStatus");
0170    b_p3 = fChain->GetBranch("p3");
0171    b_r3 = fChain->GetBranch("r3");
0172    b_id = fChain->GetBranch("id");
0173    b_p3R = fChain->GetBranch("p3R");
0174    b_r3R = fChain->GetBranch("r3R");
0175    b_covFlat = fChain->GetBranch("covFlat");
0176    b_run = fChain->GetBranch("run");
0177    b_event = fChain->GetBranch("event_");
0178 
0179    return kTRUE;
0180 }
0181 
0182 void MuProp::Show(Long64_t entry)
0183 {
0184 // Print contents of entry.
0185 // If entry is not specified, print current entry
0186    if (!fChain) return;
0187    fChain->Show(entry);
0188 }
0189 #endif // #ifdef MuProp_cxx