CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/GeneratorInterface/CosmicMuonGenerator/interface/sim.h

Go to the documentation of this file.
00001 
00002 // This class has been automatically generated on
00003 // Fri Apr 27 12:47:47 2007 by ROOT version 5.12/00
00004 // from TTree sim/simulated showers
00005 // found on file: protons_150gev.root
00007 
00008 #ifndef sim_h
00009 #define sim_h
00010 
00011 #include <TROOT.h>
00012 #include <TChain.h>
00013 #include <TFile.h>
00014    const Int_t kMaxshower = 1;
00015    const Int_t kMaxparticle_ = 100000;
00016    const Int_t kMaxlong = 10000;
00017    const Int_t kMaxcerenkov = 1;
00018 
00019 class sim {
00020 public :
00021    TTree          *fChain;   
00022    Int_t           fCurrent; 
00023 
00024    // Declaration of leave types
00025  //crsIO::TShower  *shower.;
00026    UInt_t          shower_TObject_fUniqueID;
00027    UInt_t          shower_TObject_fBits;
00028    Int_t           shower_EventID;
00029    Float_t         shower_Energy;
00030    Float_t         shower_StartingAltitude;
00031    Int_t           shower_FirstTarget;
00032    Float_t         shower_FirstHeight;
00033    Float_t         shower_Theta;
00034    Float_t         shower_Phi;
00035    Int_t           shower_RandomSeed[10];
00036    Int_t           shower_RandomOffset[10];
00037    Float_t         shower_nPhotons;
00038    Float_t         shower_nElectrons;
00039    Float_t         shower_nHadrons;
00040    Float_t         shower_nMuons;
00041    Int_t           shower_nParticlesWritten;
00042    Int_t           shower_nPhotonsWritten;
00043    Int_t           shower_nElectronsWritten;
00044    Int_t           shower_nHadronsWritten;
00045    Int_t           shower_nMuonsWritten;
00046    Float_t         shower_GH_Nmax;
00047    Float_t         shower_GH_t0;
00048    Float_t         shower_GH_tmax;
00049    Float_t         shower_GH_a;
00050    Float_t         shower_GH_b;
00051    Float_t         shower_GH_c;
00052    Float_t         shower_GH_Chi2;
00053    Int_t           shower_nPreshower;
00054    Int_t           shower_CPUtime;
00055    Int_t           particle__;
00056    UInt_t          particle__fUniqueID[kMaxparticle_];   //[particle._]
00057    UInt_t          particle__fBits[kMaxparticle_];   //[particle._]
00058    Int_t         particle__ParticleID[kMaxparticle_];   //[particle._]
00059    Int_t         particle__ObservationLevel[kMaxparticle_];   //[particle._]
00060    Int_t         particle__HadronicGeneration[kMaxparticle_];   //[particle._]
00061    Double_t         particle__Px[kMaxparticle_];   //[particle._]
00062    Double_t         particle__Py[kMaxparticle_];   //[particle._]
00063    Double_t         particle__Pz[kMaxparticle_];   //[particle._]
00064    Double_t         particle__x[kMaxparticle_];   //[particle._]
00065    Double_t         particle__y[kMaxparticle_];   //[particle._]
00066    Double_t         particle__Time[kMaxparticle_];   //[particle._]
00067    Double_t         particle__Weight[kMaxparticle_];   //[particle._]
00068    Int_t           long_;
00069    UInt_t          long_fUniqueID[kMaxlong];   //[long_]
00070    UInt_t          long_fBits[kMaxlong];   //[long_]
00071    Float_t         long_Depth[kMaxlong];   //[long_]
00072    ULong64_t        long_nGammas[kMaxlong];   //[long_]
00073    ULong64_t        long_nElectrons[kMaxlong];   //[long_]
00074    ULong64_t        long_nPositrons[kMaxlong];   //[long_]
00075    ULong64_t        long_nMuons[kMaxlong];   //[long_]
00076    ULong64_t        long_nAntiMuons[kMaxlong];   //[long_]
00077    ULong64_t        long_nHadrons[kMaxlong];   //[long_]
00078    ULong64_t        long_nCharged[kMaxlong];   //[long_]
00079    ULong64_t        long_nNuclei[kMaxlong];   //[long_]
00080    ULong64_t        long_nCerenkov[kMaxlong];   //[long_]
00081    Int_t           cerenkov_;
00082    UInt_t          cerenkov_fUniqueID[kMaxcerenkov];   //[cerenkov_]
00083    UInt_t          cerenkov_fBits[kMaxcerenkov];   //[cerenkov_]
00084    Float_t         cerenkov_nPhotons[kMaxcerenkov];   //[cerenkov_]
00085    Float_t         cerenkov_x[kMaxcerenkov];   //[cerenkov_]
00086    Float_t         cerenkov_y[kMaxcerenkov];   //[cerenkov_]
00087    Float_t         cerenkov_u[kMaxcerenkov];   //[cerenkov_]
00088    Float_t         cerenkov_v[kMaxcerenkov];   //[cerenkov_]
00089    Float_t         cerenkov_Time[kMaxcerenkov];   //[cerenkov_]
00090    Float_t         cerenkov_ProductionHeight[kMaxcerenkov];   //[cerenkov_]
00091    Float_t         cerenkov_Weight[kMaxcerenkov];   //[cerenkov_]
00092 
00093    // List of branches
00094    TBranch        *b_shower_TObject_fUniqueID;   
00095    TBranch        *b_shower_TObject_fBits;   
00096    TBranch        *b_shower_EventID;   
00097    TBranch        *b_shower_Energy;   
00098    TBranch        *b_shower_StartingAltitude;   
00099    TBranch        *b_shower_FirstTarget;   
00100    TBranch        *b_shower_FirstHeight;   
00101    TBranch        *b_shower_Theta;   
00102    TBranch        *b_shower_Phi;   
00103    TBranch        *b_shower_RandomSeed;   
00104    TBranch        *b_shower_RandomOffset;   
00105    TBranch        *b_shower_nPhotons;   
00106    TBranch        *b_shower_nElectrons;   
00107    TBranch        *b_shower_nHadrons;   
00108    TBranch        *b_shower_nMuons;   
00109    TBranch        *b_shower_nParticlesWritten;   
00110    TBranch        *b_shower_nPhotonsWritten;   
00111    TBranch        *b_shower_nElectronsWritten;   
00112    TBranch        *b_shower_nHadronsWritten;   
00113    TBranch        *b_shower_nMuonsWritten;   
00114    TBranch        *b_shower_GH_Nmax;   
00115    TBranch        *b_shower_GH_t0;   
00116    TBranch        *b_shower_GH_tmax;   
00117    TBranch        *b_shower_GH_a;   
00118    TBranch        *b_shower_GH_b;   
00119    TBranch        *b_shower_GH_c;   
00120    TBranch        *b_shower_GH_Chi2;   
00121    TBranch        *b_shower_nPreshower;   
00122    TBranch        *b_shower_CPUtime;   
00123    TBranch        *b_particle__;   
00124    TBranch        *b_particle__fUniqueID;   
00125    TBranch        *b_particle__fBits;   
00126    TBranch        *b_particle__ParticleID;   
00127    TBranch        *b_particle__ObservationLevel;   
00128    TBranch        *b_particle__HadronicGeneration;   
00129    TBranch        *b_particle__Px;   
00130    TBranch        *b_particle__Py;   
00131    TBranch        *b_particle__Pz;   
00132    TBranch        *b_particle__x;   
00133    TBranch        *b_particle__y;   
00134    TBranch        *b_particle__Time;   
00135    TBranch        *b_particle__Weight;   
00136    TBranch        *b_long_;   
00137    TBranch        *b_long_fUniqueID;   
00138    TBranch        *b_long_fBits;   
00139    TBranch        *b_long_Depth;   
00140    TBranch        *b_long_nGammas;   
00141    TBranch        *b_long_nElectrons;   
00142    TBranch        *b_long_nPositrons;   
00143    TBranch        *b_long_nMuons;   
00144    TBranch        *b_long_nAntiMuons;   
00145    TBranch        *b_long_nHadrons;   
00146    TBranch        *b_long_nCharged;   
00147    TBranch        *b_long_nNuclei;   
00148    TBranch        *b_long_nCerenkov;   
00149    TBranch        *b_cerenkov_;   
00150    TBranch        *b_cerenkov_fUniqueID;   
00151    TBranch        *b_cerenkov_fBits;   
00152    TBranch        *b_cerenkov_nPhotons;   
00153    TBranch        *b_cerenkov_x;   
00154    TBranch        *b_cerenkov_y;   
00155    TBranch        *b_cerenkov_u;   
00156    TBranch        *b_cerenkov_v;   
00157    TBranch        *b_cerenkov_Time;   
00158    TBranch        *b_cerenkov_ProductionHeight;   
00159    TBranch        *b_cerenkov_Weight;   
00160 
00161    sim(TTree *tree=0);
00162    virtual ~sim();
00163    virtual Int_t    Cut(Long64_t entry);
00164    virtual Int_t    GetEntry(Long64_t entry);
00165    virtual Long64_t LoadTree(Long64_t entry);
00166    virtual void     Init(TTree *tree);
00167    //virtual void     Loop();
00168    virtual Bool_t   Notify();
00169    virtual void     Show(Long64_t entry = -1);
00170 };
00171 
00172 #endif
00173 
00174 #ifdef sim_cxx
00175 sim::sim(TTree *tree)
00176 {
00177 // if parameter tree is not specified (or zero), connect the file
00178 // used to generate this class and read the Tree.
00179    if (tree == 0) {
00180      std::cout << "sim::sim: tree = 0" << std::endl;
00181      TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("protons_150gev.root");
00182       if (!f) {
00183          f = new TFile("protons_150gev.root");
00184       }
00185       tree = (TTree*)gDirectory->Get("sim");
00186 
00187    }
00188    //else std::cout << "sim::sim: tree != 0 => Alright!" << std::endl;
00189    Init(tree);
00190 }
00191 
00192 sim::~sim()
00193 {
00194    if (!fChain) return;
00195    delete fChain->GetCurrentFile();
00196 }
00197 
00198 Int_t sim::GetEntry(Long64_t entry)
00199 {
00200 // Read contents of entry.
00201    if (!fChain) return 0;
00202    return fChain->GetEntry(entry);
00203 }
00204 Long64_t sim::LoadTree(Long64_t entry)
00205 {
00206 // Set the environment to read one entry
00207   std::cout << "sim::LoadTree: " << std::endl;
00208   if (fChain) std::cout << " fChain<>0" << std::endl;
00209   else std::cout << " fChain=0" << std::endl;
00210    if (!fChain) return -5;
00211    Long64_t centry = fChain->LoadTree(entry);
00212    if (centry < 0) return centry;
00213    if (fChain->IsA() != TChain::Class()) return centry;
00214    TChain *chain = (TChain*)fChain;
00215    if (chain->GetTreeNumber() != fCurrent) {
00216       fCurrent = chain->GetTreeNumber();
00217       Notify();
00218    }
00219    return centry;
00220 }
00221 
00222 void sim::Init(TTree *tree)
00223 {
00224    // The Init() function is called when the selector needs to initialize
00225    // a new tree or chain. Typically here the branch addresses and branch
00226    // pointers of the tree will be set.
00227    // It is normaly not necessary to make changes to the generated
00228    // code, but the routine can be extended by the user if needed.
00229    // Init() will be called many times when running on PROOF
00230    // (once per file to be processed).
00231 
00232    // Set branch addresses and branch pointers
00233    if (!tree) return;
00234    fChain = tree;
00235    fCurrent = -1;
00236    fChain->SetMakeClass(1);
00237 
00238    fChain->SetBranchAddress("shower.TObject.fUniqueID", &shower_TObject_fUniqueID, &b_shower_TObject_fUniqueID);
00239    fChain->SetBranchAddress("shower.TObject.fBits", &shower_TObject_fBits, &b_shower_TObject_fBits);
00240    fChain->SetBranchAddress("shower.EventID", &shower_EventID, &b_shower_EventID);
00241    fChain->SetBranchAddress("shower.Energy", &shower_Energy, &b_shower_Energy);
00242    fChain->SetBranchAddress("shower.StartingAltitude", &shower_StartingAltitude, &b_shower_StartingAltitude);
00243    fChain->SetBranchAddress("shower.FirstTarget", &shower_FirstTarget, &b_shower_FirstTarget);
00244    fChain->SetBranchAddress("shower.FirstHeight", &shower_FirstHeight, &b_shower_FirstHeight);
00245    fChain->SetBranchAddress("shower.Theta", &shower_Theta, &b_shower_Theta);
00246    fChain->SetBranchAddress("shower.Phi", &shower_Phi, &b_shower_Phi);
00247    fChain->SetBranchAddress("shower.RandomSeed[10]", shower_RandomSeed, &b_shower_RandomSeed);
00248    fChain->SetBranchAddress("shower.RandomOffset[10]", shower_RandomOffset, &b_shower_RandomOffset);
00249    fChain->SetBranchAddress("shower.nPhotons", &shower_nPhotons, &b_shower_nPhotons);
00250    fChain->SetBranchAddress("shower.nElectrons", &shower_nElectrons, &b_shower_nElectrons);
00251    fChain->SetBranchAddress("shower.nHadrons", &shower_nHadrons, &b_shower_nHadrons);
00252    fChain->SetBranchAddress("shower.nMuons", &shower_nMuons, &b_shower_nMuons);
00253    fChain->SetBranchAddress("shower.nParticlesWritten", &shower_nParticlesWritten, &b_shower_nParticlesWritten);
00254    fChain->SetBranchAddress("shower.nPhotonsWritten", &shower_nPhotonsWritten, &b_shower_nPhotonsWritten);
00255    fChain->SetBranchAddress("shower.nElectronsWritten", &shower_nElectronsWritten, &b_shower_nElectronsWritten);
00256    fChain->SetBranchAddress("shower.nHadronsWritten", &shower_nHadronsWritten, &b_shower_nHadronsWritten);
00257    fChain->SetBranchAddress("shower.nMuonsWritten", &shower_nMuonsWritten, &b_shower_nMuonsWritten);
00258    fChain->SetBranchAddress("shower.GH_Nmax", &shower_GH_Nmax, &b_shower_GH_Nmax);
00259    fChain->SetBranchAddress("shower.GH_t0", &shower_GH_t0, &b_shower_GH_t0);
00260    fChain->SetBranchAddress("shower.GH_tmax", &shower_GH_tmax, &b_shower_GH_tmax);
00261    fChain->SetBranchAddress("shower.GH_a", &shower_GH_a, &b_shower_GH_a);
00262    fChain->SetBranchAddress("shower.GH_b", &shower_GH_b, &b_shower_GH_b);
00263    fChain->SetBranchAddress("shower.GH_c", &shower_GH_c, &b_shower_GH_c);
00264    fChain->SetBranchAddress("shower.GH_Chi2", &shower_GH_Chi2, &b_shower_GH_Chi2);
00265    fChain->SetBranchAddress("shower.nPreshower", &shower_nPreshower, &b_shower_nPreshower);
00266    fChain->SetBranchAddress("shower.CPUtime", &shower_CPUtime, &b_shower_CPUtime);
00267    fChain->SetBranchAddress("particle.", &particle__, &b_particle__);
00268    fChain->SetBranchAddress("particle..fUniqueID", particle__fUniqueID, &b_particle__fUniqueID);
00269    fChain->SetBranchAddress("particle..fBits", particle__fBits, &b_particle__fBits);
00270    fChain->SetBranchAddress("particle..ParticleID", particle__ParticleID, &b_particle__ParticleID);
00271    fChain->SetBranchAddress("particle..ObservationLevel", particle__ObservationLevel, &b_particle__ObservationLevel);
00272    fChain->SetBranchAddress("particle..HadronicGeneration", particle__HadronicGeneration, &b_particle__HadronicGeneration);
00273    fChain->SetBranchAddress("particle..Px", particle__Px, &b_particle__Px);
00274    fChain->SetBranchAddress("particle..Py", particle__Py, &b_particle__Py);
00275    fChain->SetBranchAddress("particle..Pz", particle__Pz, &b_particle__Pz);
00276    fChain->SetBranchAddress("particle..x", particle__x, &b_particle__x);
00277    fChain->SetBranchAddress("particle..y", particle__y, &b_particle__y);
00278    fChain->SetBranchAddress("particle..Time", particle__Time, &b_particle__Time);
00279    fChain->SetBranchAddress("particle..Weight", particle__Weight, &b_particle__Weight);
00280    fChain->SetBranchAddress("long", &long_, &b_long_);
00281    fChain->SetBranchAddress("long.fUniqueID", long_fUniqueID, &b_long_fUniqueID);
00282    fChain->SetBranchAddress("long.fBits", long_fBits, &b_long_fBits);
00283    fChain->SetBranchAddress("long.Depth", long_Depth, &b_long_Depth);
00284    fChain->SetBranchAddress("long.nGammas", long_nGammas, &b_long_nGammas);
00285    fChain->SetBranchAddress("long.nElectrons", long_nElectrons, &b_long_nElectrons);
00286    fChain->SetBranchAddress("long.nPositrons", long_nPositrons, &b_long_nPositrons);
00287    fChain->SetBranchAddress("long.nMuons", long_nMuons, &b_long_nMuons);
00288    fChain->SetBranchAddress("long.nAntiMuons", long_nAntiMuons, &b_long_nAntiMuons);
00289    fChain->SetBranchAddress("long.nHadrons", long_nHadrons, &b_long_nHadrons);
00290    fChain->SetBranchAddress("long.nCharged", long_nCharged, &b_long_nCharged);
00291    fChain->SetBranchAddress("long.nNuclei", long_nNuclei, &b_long_nNuclei);
00292    fChain->SetBranchAddress("long.nCerenkov", long_nCerenkov, &b_long_nCerenkov);
00293    fChain->SetBranchAddress("cerenkov", &cerenkov_, &b_cerenkov_);
00294    fChain->SetBranchAddress("cerenkov.fUniqueID", &cerenkov_fUniqueID, &b_cerenkov_fUniqueID);
00295    fChain->SetBranchAddress("cerenkov.fBits", &cerenkov_fBits, &b_cerenkov_fBits);
00296    fChain->SetBranchAddress("cerenkov.nPhotons", &cerenkov_nPhotons, &b_cerenkov_nPhotons);
00297    fChain->SetBranchAddress("cerenkov.x", &cerenkov_x, &b_cerenkov_x);
00298    fChain->SetBranchAddress("cerenkov.y", &cerenkov_y, &b_cerenkov_y);
00299    fChain->SetBranchAddress("cerenkov.u", &cerenkov_u, &b_cerenkov_u);
00300    fChain->SetBranchAddress("cerenkov.v", &cerenkov_v, &b_cerenkov_v);
00301    fChain->SetBranchAddress("cerenkov.Time", &cerenkov_Time, &b_cerenkov_Time);
00302    fChain->SetBranchAddress("cerenkov.ProductionHeight", &cerenkov_ProductionHeight, &b_cerenkov_ProductionHeight);
00303    fChain->SetBranchAddress("cerenkov.Weight", &cerenkov_Weight, &b_cerenkov_Weight);
00304    Notify();
00305 }
00306 
00307 Bool_t sim::Notify()
00308 {
00309    // The Notify() function is called when a new file is opened. This
00310    // can be either for a new TTree in a TChain or when when a new TTree
00311    // is started when using PROOF. It is normaly not necessary to make changes
00312    // to the generated code, but the routine can be extended by the
00313    // user if needed. The return value is currently not used.
00314 
00315    return kTRUE;
00316 }
00317 
00318 void sim::Show(Long64_t entry)
00319 {
00320 // Print contents of entry.
00321 // If entry is not specified, print current entry
00322    if (!fChain) return;
00323    fChain->Show(entry);
00324 }
00325 Int_t sim::Cut(Long64_t entry)
00326 {
00327 // This function may be called from Loop.
00328 // returns  1 if entry is accepted.
00329 // returns -1 otherwise.
00330    return 1;
00331 }
00332 #endif // #ifdef sim_cxx