/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

ValidationTree.cc
Go to the documentation of this file.
00001 
00008 #include "ValidationTree.h"
00009 
00010 using namespace std;
00011 
00012 ValidationTree::ValidationTree()
00013 {}
00014 
00015 ValidationTree::~ValidationTree()
00016 {}
00017 
00018 int ValidationTree::create()
00019 {
00020   m_file=new TFile("monitor.root","recreate");
00021   m_tree=new TTree("t","Analysis Tree");    
00022 
00024   m_tree->Branch("nhits",&SimHitsEntries,"SimHitsEntries/I");
00025   m_tree->Branch("hitTime",hitTime,"hitTime[SimHitsEntries]/D");
00026   m_tree->Branch("hitx",hitx,"hitx[SimHitsEntries]/D");
00027   m_tree->Branch("hity",hity,"hity[SimHitsEntries]/D");
00028   m_tree->Branch("hitz",hitz,"hitz[SimHitsEntries]/D");
00029   m_tree->Branch("sensID",sensID,"sensID[SimHitsEntries]/I");
00030   m_tree->Branch("ancestor",ancestorPdg,"ancestor[SimHitsEntries]/I");
00031   m_tree->Branch("wavelength",wavelength,"wavelength[SimHitsEntries]/D");
00032   m_tree->Branch("polx",polx,"polx[SimHitsEntries]/D");
00033   m_tree->Branch("poly",poly,"poly[SimHitsEntries]/D");
00034   m_tree->Branch("polz",polz,"polz[SimHitsEntries]/D");
00035   m_tree->Branch("px",px,"px[SimHitsEntries]/D");
00036   m_tree->Branch("py",py,"py[SimHitsEntries]/D");
00037   m_tree->Branch("pz",pz,"pz[SimHitsEntries]/D");
00038   m_tree->Branch("weight",weight,"weight[SimHitsEntries]/F");
00039 
00040   //Muon vertex Info
00041   m_tree->Branch("MuonE",&MuonE,"MuonE/D");
00042   m_tree->Branch("MuonX",&MuonX,"MuonX/D");
00043   m_tree->Branch("MuonY",&MuonY,"MuonY/D");
00044   m_tree->Branch("MuonZ",&MuonZ,"MuonZ/D");
00045   m_tree->Branch("MuonPx",&MuonPx,"MuonPx/D");
00046   m_tree->Branch("MuonPy",&MuonPy,"MuonPy/D");
00047   m_tree->Branch("MuonPz",&MuonPz,"MuonPz/D");
00048   m_tree->Branch("MuonTime",&MuonTime,"MuonTime/D");
00049   m_tree->Branch("StopFlag",&StopFlag,"StopFlag/I");
00050 
00051 
00053   m_tree->Branch("MuonTrkLengthInOws",&MuonTrkLengthInOws,"MuonTrkLengthInOws/D");
00054   m_tree->Branch("MuonTrkLengthInIws",&MuonTrkLengthInIws,"MuonTrkLengthInIws/D");
00055   m_tree->Branch("MuonTrkLengthInLS",&MuonTrkLengthInLS,"MuonTrkLengthInLS/D");
00056   m_tree->Branch("MuonTrkLengthInGdLS",&MuonTrkLengthInGdLS,"MuonTrkLengthInGdLS/D");
00057   m_tree->Branch("dEInn",&dEInn,"dEInn/D");
00058   m_tree->Branch("dEOut",&dEOut,"dEOut/D");
00059 
00061   m_tree->Branch("trk1_pdgId",  &trk1_pdgId, "trk1_pdgId/I");  
00062                                                                               
00063   m_tree->Branch("trk1_t",   &trk1_t,  "trk1_t/D");   
00064   m_tree->Branch("trk1_x",   &trk1_x,  "trk1_x/D");   
00065   m_tree->Branch("trk1_y",   &trk1_y,  "trk1_y/D");   
00066   m_tree->Branch("trk1_z",   &trk1_z,  "trk1_z/D");   
00067                                                                               
00068   m_tree->Branch("trk1_e",   &trk1_e,  "trk1_e/D");   
00069   m_tree->Branch("trk1_px",  &trk1_px, "trk1_px/D");  
00070   m_tree->Branch("trk1_py",  &trk1_py, "trk1_py/D");  
00071   m_tree->Branch("trk1_pz",  &trk1_pz, "trk1_pz/D");  
00072                                                                               
00073   m_tree->Branch("trk1_ke",  &trk1_ke, "trk1_ke/D");   // kinematic energy
00074   m_tree->Branch("trk1_ve",  &trk1_ve, "trk1_ve/D");   // visible energy
00075                                                                               
00076   m_tree->Branch("trk1_TrkLength_GD", &trk1_TrkLength_GD, "trk1_TrkLength_GD/D");  // pathlength in GDLS
00077   m_tree->Branch("trk1_TrkLength_iAV",&trk1_TrkLength_iAV,"trk1_TrkLength_iAV/D"); // pathlength in inner AV
00078   m_tree->Branch("trk1_TrkLength_LS", &trk1_TrkLength_LS, "trk1_TrkLength_LS/D");  // pathlength in LS
00079   m_tree->Branch("trk1_TrkLength_oAV",&trk1_TrkLength_oAV,"trk1_TrkLength_oAV/D"); // pathlength in outer AV
00080   m_tree->Branch("trk1_TrkLength_Oil",&trk1_TrkLength_Oil,"trk1_TrkLength_Oil/D"); // pathlength in oil
00081 
00083   m_tree->Branch("trk2_pdgId",  &trk2_pdgId,  "trk2_pdgId/I");
00084 
00085   m_tree->Branch("trk2_t",   &trk2_t,   "trk2_t/D");
00086   m_tree->Branch("trk2_x",   &trk2_x,   "trk2_x/D");
00087   m_tree->Branch("trk2_y",   &trk2_y,   "trk2_y/D");
00088   m_tree->Branch("trk2_z",   &trk2_z,   "trk2_z/D");
00089 
00090   m_tree->Branch("trk2_e",   &trk2_e,   "trk2_e/D");
00091   m_tree->Branch("trk2_px",  &trk2_px,  "trk2_px/D");
00092   m_tree->Branch("trk2_py",  &trk2_py,  "trk2_py/D");
00093   m_tree->Branch("trk2_pz",  &trk2_pz,  "trk2_pz/D");
00094 
00095   m_tree->Branch("trk2_ke",  &trk2_ke,  "trk2_ke/D");   // kinematic energy
00096   m_tree->Branch("trk2_ve",  &trk2_ve,  "trk2_ve/D");   // visible energy
00097 
00098   m_tree->Branch("trk2_TrkLength_GD", &trk2_TrkLength_GD, "trk2_TrkLength_GD/D");  // pathlength in GDLS
00099   m_tree->Branch("trk2_TrkLength_iAV",&trk2_TrkLength_iAV,"trk2_TrkLength_iAV/D"); // pathlength in inner AV
00100   m_tree->Branch("trk2_TrkLength_LS", &trk2_TrkLength_LS, "trk2_TrkLength_LS/D");  // pathlength in LS
00101   m_tree->Branch("trk2_TrkLength_oAV",&trk2_TrkLength_oAV,"trk2_TrkLength_oAV/D"); // pathlength in outer AV
00102   m_tree->Branch("trk2_TrkLength_Oil",&trk2_TrkLength_Oil,"trk2_TrkLength_Oil/D"); // pathlength in oil
00103 
00104   // initial optical photons
00105   m_tree->Branch("number_opti_pho", &number_opti_pho, "number_opti_pho/I");
00106   m_tree->Branch("wavelength_opti_pho",wavelength_opti_pho,",wavelength_opti_pho[number_opti_pho]/D");
00107 
00108   //
00109   m_tree->Branch("n",       &n,       "n/I");
00110   m_tree->Branch("execKine",&execKine,"execKine/I");   // execution number in kinematic
00111   m_tree->Branch("execDets",&execDets,"execDets/I");   // in DetSim                    
00112   m_tree->Branch("execElec",&execElec,"execElec/I");   // in ElecSim                   
00113   m_tree->Branch("execTrig",&execTrig,"execTrig/I");   // in TrigRead                  
00114   m_tree->Branch("execSing",&execSing,"execSing/I");   // in SingleLoader              
00115 
00116   m_tree->Branch("time",&time,"time/D"); // arrival time in second
00117 
00118   // readout 
00119   m_tree->Branch("adc",adc,"adc[8][24]/I");   // adc
00120   m_tree->Branch("tdc",tdc,"tdc[8][24]/I");   // tdc
00121 
00122   m_tree->Branch("adc_sum",&adc_sum,"adc_sum/D");   // adc_sum
00123 
00124 
00125   return  1; // 1 for SUCCESS;
00126 }
00127 
00128 int ValidationTree::reset()
00129 {
00131   SimHitsEntries=0;
00132 
00133   //muon vertex information.
00134   MuonE=0;
00135   MuonX=0;
00136   MuonY=0;
00137   MuonZ=0;
00138   MuonPx=0;
00139   MuonPy=0;
00140   MuonPz=0;
00141   MuonTime=0;
00142   StopFlag=0;
00143   
00145   MuonTrkLengthInOws=0;
00146   MuonTrkLengthInIws=0;
00147   MuonTrkLengthInLS=0;
00148   MuonTrkLengthInGdLS=0;
00149   dEInn=0;
00150   dEOut=0;
00151   
00152 
00154   trk1_pdgId=0;
00155 
00156   trk1_t=0;
00157   trk1_x=0;
00158   trk1_y=0;
00159   trk1_z=0;
00160 
00161   trk1_e=0;
00162   trk1_px=0;
00163   trk1_py=0;
00164   trk1_pz=0;
00165 
00166   trk1_ke=0;  // kinematic energy
00167   trk1_ve=0;  // visible energy
00168 
00169   trk1_TrkLength_GD=0;  // pathlength in GDLS
00170   trk1_TrkLength_iAV=0; //            in inner AV
00171   trk1_TrkLength_LS=0;  //            in LS
00172   trk1_TrkLength_oAV=0; //            in outer AV
00173   trk1_TrkLength_Oil=0; //            in oil
00174 
00175   // MC truth for the second primary track ///////////
00176   trk2_pdgId=0;
00177 
00178   trk2_t=0;
00179   trk2_x=0;
00180   trk2_y=0;
00181   trk2_z=0;
00182 
00183   trk2_e=0;
00184   trk2_px=0;
00185   trk2_py=0;
00186   trk2_pz=0;
00187 
00188   trk2_ke=0;  // kinematic energy
00189   trk2_ve=0;  // visible energy
00190 
00191   trk2_TrkLength_GD=0;  // pathlength in GDLS
00192   trk2_TrkLength_iAV=0; //            in inner AV
00193   trk2_TrkLength_LS=0;  //            in LS
00194   trk2_TrkLength_oAV=0; //            in outer AV
00195   trk2_TrkLength_Oil=0; //            in oil
00196 
00197 
00198   number_opti_pho=0;
00199 
00200   n=0;
00201   execKine=0;
00202   execDets=0;
00203   execElec=0;
00204   execTrig=0;
00205   execSing=0;
00206 
00207   time =0;
00208 
00209   adc_sum=0;
00210 
00211   return 1;  // 1 for SUCCESS;
00212 }
00213 
00214 int ValidationTree::fill()
00215 {
00216   m_tree->Fill();
00217 
00218   return  1; // 1 for SUCCESS;
00219 }
00220 
00221 int ValidationTree::close()
00222 {
00223   m_file->Write();
00224   return  1; // 1 for SUCCESS;
00225 }
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:07:33 for Stage by doxygen 1.7.4