McTestAlg Class Reference

#include <McTestAlg.h>

List of all members.

Public Member Functions

 McTestAlg (const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize ()
StatusCode execute ()
StatusCode finalize ()
void RetrieveMcParticle ()
void RetrieveMdc ()
void MdcInit ()
void RetrieveTof ()
void TofInit ()
void RetrieveEmc ()
void RetrieveMuc ()

Private Attributes

IDataProviderSvc * m_evtSvc
bool m_particleRootFlag
NTuple::Tuple * tupleParticle
NTuple::Item< double > me
bool m_mdcRootFlag
NTuple::Tuple * tupleMdc1
NTuple::Tuple * tupleMdc2
NTuple::Item< long > truthMdcIndex
NTuple::Item< long > truthMdcParId
NTuple::Item< long > truthMdcLayer
NTuple::Item< long > truthMdcWire
NTuple::Item< double > truthMdcEdep
NTuple::Item< double > truthMdcDriftD
NTuple::Item< double > truthMdcX
NTuple::Item< double > truthMdcY
NTuple::Item< double > truthMdcZ
NTuple::Item< double > ntruthMdc
NTuple::Item< double > m_layer
NTuple::Item< double > m_cell
NTuple::Item< double > m_charge
NTuple::Item< double > m_time
bool m_tofRootFlag
NTuple::Tuple * tupleTof
NTuple::Item< double > truthIndex
NTuple::Item< double > truthPartId
NTuple::Item< double > truthLayer
NTuple::Item< double > truthScinNb
NTuple::Item< double > truthX
NTuple::Item< double > truthY
NTuple::Item< double > truthZ
NTuple::Item< double > ntruth
NTuple::Item< double > tleft
NTuple::Item< double > tright
NTuple::Item< double > qleft
NTuple::Item< double > qright


Detailed Description

Definition at line 10 of file McTestAlg.h.


Constructor & Destructor Documentation

McTestAlg::McTestAlg ( const std::string name,
ISvcLocator *  pSvcLocator 
)

Definition at line 43 of file McTestAlg.cxx.

References m_mdcRootFlag, m_particleRootFlag, and m_tofRootFlag.

00043                                                                     :
00044 Algorithm(name, pSvcLocator)
00045 {
00046   declareProperty("ParticleRootFlag",m_particleRootFlag=false);
00047   declareProperty("MdcRootFlag",m_mdcRootFlag=false);
00048   declareProperty("TofRootFlag",m_tofRootFlag=false);
00049 }


Member Function Documentation

StatusCode McTestAlg::execute (  ) 

Definition at line 148 of file McTestAlg.cxx.

References m_evtSvc, RetrieveEmc(), RetrieveMcParticle(), RetrieveMdc(), RetrieveMuc(), and RetrieveTof().

00149 {
00150   //interface to event data service
00151   ISvcLocator* svcLocator = Gaudi::svcLocator();
00152   StatusCode sc=svcLocator->service("EventDataSvc", m_evtSvc);
00153   if (sc.isFailure())
00154     std::cout<<"Could not accesss EventDataSvc!"<<std::endl;
00155 
00156   SmartDataPtr<Event::EventHeader> eventHeader(m_evtSvc,"/Event/EventHeader");
00157   if(!eventHeader)
00158     std::cout<<"Could not retrieve EventHeader"<<std::endl;
00159 
00160   int event=eventHeader->eventNumber();
00161   std::cout<<"event: "<<event<<std::endl;
00162 
00163   RetrieveMcParticle();
00164   RetrieveMdc();
00165   RetrieveTof();
00166   RetrieveEmc();
00167   RetrieveMuc();
00168 
00169   return StatusCode::SUCCESS;
00170 
00171 }

StatusCode McTestAlg::finalize (  ) 

Definition at line 138 of file McTestAlg.cxx.

References Bes_Common::INFO, and msgSvc().

00139 {
00140   MsgStream log(msgSvc(), name());
00141   log << MSG::INFO << "McTestAlg finalize()" << endreq;
00142       
00143   return StatusCode::SUCCESS;
00144   
00145 }

StatusCode McTestAlg::initialize (  ) 

Definition at line 51 of file McTestAlg.cxx.

References calibUtil::ERROR, Bes_Common::INFO, m_cell, m_charge, m_layer, m_mdcRootFlag, m_particleRootFlag, m_time, m_tofRootFlag, me, msgSvc(), ntruth, ntruthMdc, ntupleSvc(), qleft, qright, tleft, tright, truthIndex, truthLayer, truthMdcDriftD, truthMdcEdep, truthMdcIndex, truthMdcLayer, truthMdcWire, truthMdcX, truthMdcY, truthMdcZ, truthPartId, truthScinNb, truthX, truthY, truthZ, tupleMdc1, tupleMdc2, tupleParticle, and tupleTof.

00052 {
00053   MsgStream log(msgSvc(), name());
00054   log << MSG::INFO << " McTestAlg initialize()" << endreq;
00055  
00056   if(m_particleRootFlag)
00057   {
00058     StatusCode sc;
00059     NTuplePtr ntp(ntupleSvc(), "FILE900/particle");
00060     if(ntp) tupleParticle = ntp;
00061     else {
00062       tupleParticle = ntupleSvc()->book("FILE900/particle",CLID_ColumnWiseTuple,"McTestAlg");
00063       if(tupleParticle)
00064         sc = tupleParticle->addItem("me",me);
00065     }
00066   }
00067     
00068   if(m_mdcRootFlag) 
00069   { 
00070     StatusCode sc;
00071     NTuplePtr nt1(ntupleSvc(), "FILE901/n1");  //for Mdc McTruth
00072     if(nt1) tupleMdc1 = nt1;
00073     else {
00074       tupleMdc1 = ntupleSvc()->book("FILE901/n1",CLID_ColumnWiseTuple,"McTestAlg");
00075       if(tupleMdc1)
00076       {
00077         sc = tupleMdc1->addItem("truthIndex",truthMdcIndex);
00078         sc = tupleMdc1->addItem("truthLayer",truthMdcLayer);
00079         sc = tupleMdc1->addItem("truthWire",truthMdcWire);
00080         sc = tupleMdc1->addItem("truthEdep",truthMdcEdep);
00081         sc = tupleMdc1->addItem("truthDriftD",truthMdcDriftD);
00082         sc = tupleMdc1->addItem("truthX",truthMdcX);
00083         sc = tupleMdc1->addItem("truthY",truthMdcY);
00084         sc = tupleMdc1->addItem("truthZ",truthMdcZ);
00085         sc = tupleMdc1->addItem("ntruth",ntruthMdc);
00086       }
00087       else    {   // did not manage to book the N tuple....
00088         log << MSG::ERROR <<"Cannot book MDC N-tuple:" << long(tupleMdc1) << endmsg;
00089         return StatusCode::FAILURE;
00090       }
00091     }
00092   
00093     NTuplePtr nt2(ntupleSvc(), "FILE901/n2");  //for Mdc digit
00094     if(nt2) tupleMdc2 = nt2;
00095     else {
00096       tupleMdc2 = ntupleSvc()->book("FILE901/n2",CLID_ColumnWiseTuple,"McTestAlg");
00097       if(tupleMdc2)
00098       {
00099         sc = tupleMdc2->addItem("layer",m_layer);
00100         sc = tupleMdc2->addItem("cell",m_cell);
00101         sc = tupleMdc2->addItem("ADC",m_charge);
00102         sc = tupleMdc2->addItem("TDC",m_time);
00103       }
00104     }
00105   }
00106   
00107   if(m_tofRootFlag)
00108   {
00109     StatusCode sc;
00110     NTuplePtr nt(ntupleSvc(), "FILE902/lr");
00111     if(nt) tupleTof = nt;
00112     else {
00113       tupleTof=ntupleSvc()->book("FILE902/lr",CLID_ColumnWiseTuple,"McTestAlg");
00114       if(tupleTof)
00115       {
00116         sc = tupleTof->addItem("truthIndex",truthIndex);
00117         sc = tupleTof->addItem("truthPartId",truthPartId);
00118         sc = tupleTof->addItem("truthLayer",truthLayer);
00119         sc = tupleTof->addItem("truthScinNb",truthScinNb);
00120         sc = tupleTof->addItem("truthX",truthX);
00121         sc = tupleTof->addItem("truthY",truthY);
00122         sc = tupleTof->addItem("truthZ",truthZ);
00123         sc = tupleTof->addItem("ntruth",ntruth);
00124         sc = tupleTof->addItem("tleft",tleft);
00125         sc = tupleTof->addItem("tright",tright);
00126         sc = tupleTof->addItem("qleft",qleft);
00127         sc = tupleTof->addItem("qright",qright);
00128       }
00129       else    {   // did not manage to book the N tuple....
00130         log << MSG::ERROR <<"Cannot book N-tuple:" << long(tupleTof) << endmsg;
00131         return StatusCode::FAILURE;
00132       }
00133     }
00134   }  
00135   return StatusCode::SUCCESS;
00136 }

void McTestAlg::MdcInit (  ) 

Definition at line 213 of file McTestAlg.cxx.

References m_cell, m_charge, m_layer, m_time, ntruthMdc, truthMdcDriftD, truthMdcEdep, truthMdcIndex, truthMdcLayer, truthMdcWire, truthMdcX, truthMdcY, and truthMdcZ.

Referenced by RetrieveMdc().

00214 {
00215   truthMdcIndex = -9;
00216   truthMdcLayer = -9;
00217   truthMdcWire = -9; 
00218   truthMdcEdep = -9;
00219   truthMdcDriftD = -9;
00220   truthMdcX = -9;
00221   truthMdcY = -9;
00222   truthMdcZ = -9;
00223   ntruthMdc = 0;
00224   
00225   m_layer = -9;
00226   m_cell = -9;
00227   m_charge = -9;
00228   m_time = -9;
00229 }     

void McTestAlg::RetrieveEmc (  ) 

Definition at line 414 of file McTestAlg.cxx.

References m_evtSvc.

Referenced by execute().

00415 {
00416   //retrieve EMC McTruth from TDS
00417   SmartDataPtr<Event::EmcMcHitCol> aMcHitCol(m_evtSvc,"/Event/MC/EmcMcHitCol");
00418   if(!aMcHitCol)
00419     std::cout<<"Could not retrieve EMC McTruth collection"<<std::endl;
00420   else
00421   {
00422     Event::EmcMcHitCol::iterator iMcHitCol;
00423     for(iMcHitCol=aMcHitCol->begin(); iMcHitCol!=aMcHitCol->end(); iMcHitCol++)
00424     {
00425       const Identifier ident = (*iMcHitCol)->identify();
00426       //std::cout<<(*iMcHitCol)->getTrackIndex();
00427       //std::cout<<" "<<EmcID::barrel_ec(ident);
00428       //std::cout<<" "<<EmcID::theta_module(ident);
00429       //std::cout<<" "<<EmcID::phi_module(ident);
00430       //std::cout<<" "<<(*iMcHitCol)->getPositionX();
00431       //std::cout<<" "<<(*iMcHitCol)->getPositionY();
00432       //std::cout<<" "<<(*iMcHitCol)->getPositionZ();
00433       //std::cout<<" "<<(*iMcHitCol)->getPx();
00434       //std::cout<<" "<<(*iMcHitCol)->getPy();
00435       //std::cout<<" "<<(*iMcHitCol)->getPz();
00436       //std::cout<<" "<<(*iMcHitCol)->getDepositEnergy();
00437       //std::cout<<std::endl;
00438     }
00439     //std::cout<<"end of retrieve EMC McTruth"<<std::endl;
00440   }
00441 
00442   //retrieve EMC digits from TDS
00443   SmartDataPtr<EmcDigiCol> aDigiCol(m_evtSvc,"/Event/Digi/EmcDigiCol");
00444   if(!aDigiCol)
00445     std::cout<<"Could not retrieve EMC digi collection"<<std::endl;
00446 
00447   else
00448   {
00449     EmcDigiCol::iterator iDigiCol;
00450     for(iDigiCol=aDigiCol->begin(); iDigiCol!=aDigiCol->end(); iDigiCol++)
00451     {
00452       const Identifier ident = (*iDigiCol)->identify();
00453       //std::cout<<"barrel_ec: "<<EmcID::barrel_ec(ident);
00454       //std::cout<<"  theta: "<<EmcID::theta_module(ident);
00455       //std::cout<<"  phi: "<<EmcID::phi_module(ident);
00456       //std::cout<<"  charge: "<<(*iDigiCol)->getChargeChannel();
00457       //std::cout<<"  time: "<<(*iDigiCol)->getTimeChannel()<<std::endl;
00458     }
00459     //std::cout<<"end of retrieve EMC digits"<<std::endl;
00460   }
00461 }

void McTestAlg::RetrieveMcParticle (  ) 

Definition at line 173 of file McTestAlg.cxx.

References abs, m_evtSvc, m_particleRootFlag, mass, me, and tupleParticle.

Referenced by execute().

00174 {
00175   SmartDataPtr<Event::McParticleCol> mcParticleCol(m_evtSvc,"/Event/MC/McParticleCol");
00176   if(!mcParticleCol)
00177     std::cout<<"Could not retrieve McParticelCol"<<std::endl;
00178   else
00179   {
00180     int pdgcode;
00181     double px,py,pz,E,mass;
00182     int nflag=0;
00183     Event::McParticleCol::iterator iter_mc = mcParticleCol->begin();
00184     for (;iter_mc != mcParticleCol->end(); iter_mc++)
00185     {
00186       //Event::McParticle mp = (*iter_mc)->mother();
00187       pdgcode = (*iter_mc)->particleProperty();
00188       if((*iter_mc)->trackIndex()<0)
00189         std::cout<<"ERROR! trackIndex<0"<<std::endl;
00190       px=(*iter_mc)->initialFourMomentum().x();
00191       py=(*iter_mc)->initialFourMomentum().y();
00192       pz=(*iter_mc)->initialFourMomentum().z();
00193       E=(*iter_mc)->initialFourMomentum().t();
00194       if(E*E-px*px-py*py-pz*pz>=0)
00195         mass=sqrt(E*E-px*px-py*py-pz*pz);
00196       else
00197         mass=0;
00198 
00199       if(m_particleRootFlag)
00200       {
00201         if(abs(pdgcode)==11)
00202           me=mass;
00203         tupleParticle->write();
00204       }
00205       if(abs(pdgcode)==2212||abs(pdgcode)==211)
00206         nflag++;
00207     }
00208     if(nflag!=4)
00209       std::cout<<"nflag!=4"<<std::endl;
00210   }
00211 }

void McTestAlg::RetrieveMdc (  ) 

Definition at line 232 of file McTestAlg.cxx.

References MdcID::layer(), m_cell, m_charge, m_evtSvc, m_layer, m_mdcRootFlag, m_time, MdcInit(), ntruthMdc, truthMdcDriftD, truthMdcEdep, truthMdcIndex, truthMdcLayer, truthMdcWire, truthMdcX, truthMdcY, truthMdcZ, tupleMdc1, tupleMdc2, and MdcID::wire().

Referenced by execute().

00233 {
00234   if(m_mdcRootFlag)  
00235      MdcInit();
00236 
00237   //retrieve MDC McTruth from TDS
00238   SmartDataPtr<Event::MdcMcHitCol> aMcHitCol(m_evtSvc,"/Event/MC/MdcMcHitCol");
00239   if(!aMcHitCol)
00240     std::cout<<"Could not retrieve MDC McTruth collection"<<std::endl;
00241   else
00242   {
00243     Event::MdcMcHitCol::iterator iMcHitCol;
00244     for(iMcHitCol=aMcHitCol->begin(); iMcHitCol!=aMcHitCol->end(); iMcHitCol++)
00245     {
00246       const Identifier ident = (*iMcHitCol)->identify();
00247       //std::cout<<(*iMcHitCol)->getTrackIndex();
00248       //std::cout<<" "<<MdcID::layer(ident);
00249       //std::cout<<" "<<MdcID::wire(ident);
00250       //std::cout<<" "<<(*iMcHitCol)->getDepositEnergy();
00251       //std::cout<<" "<<(*iMcHitCol)->getDriftDistance();
00252       //std::cout<<" "<<(*iMcHitCol)->getPositionX();
00253       //std::cout<<" "<<(*iMcHitCol)->getPositionY();
00254       //std::cout<<" "<<(*iMcHitCol)->getPositionZ();
00255       //std::cout<<std::endl;
00256 
00257      if(m_mdcRootFlag)
00258      {
00259       truthMdcIndex = (*iMcHitCol)->getTrackIndex();
00260       truthMdcLayer = MdcID::layer(ident);
00261       truthMdcWire = MdcID::wire(ident);
00262       truthMdcEdep = (*iMcHitCol)->getDepositEnergy();
00263       truthMdcDriftD = (*iMcHitCol)->getDriftDistance();
00264       truthMdcX = (*iMcHitCol)->getPositionX();
00265       truthMdcY = (*iMcHitCol)->getPositionY();
00266       truthMdcZ = (*iMcHitCol)->getPositionZ();
00267       ntruthMdc++; 
00268       tupleMdc1->write();
00269      }   
00270     }
00271     //std::cout<<"end of retrieve MDC McTruth collection"<<std::endl;
00272   }
00273   
00274   //retrieve MDC digits from TDS
00275   SmartDataPtr<MdcDigiCol> aDigiCol(m_evtSvc,"/Event/Digi/MdcDigiCol");
00276   if(!aDigiCol)
00277     std::cout<<"Could not retrieve MDC digi collection"<<std::endl;
00278 
00279   else
00280   {
00281     MdcDigiCol::iterator iDigiCol;
00282     for(iDigiCol=aDigiCol->begin(); iDigiCol!=aDigiCol->end(); iDigiCol++)
00283     {
00284       const Identifier ident = (*iDigiCol)->identify();
00285       //std::cout<<"layer: "<<MdcID::layer(ident);
00286       //std::cout<<"  cell: "<<MdcID::wire(ident);
00287       //std::cout<<"  charge: "<<(*iDigiCol)->getChargeChannel();
00288       //std::cout<<"  time: "<<(*iDigiCol)->getTimeChannel()<<std::endl;
00289       
00290      if(m_mdcRootFlag){     
00291       m_layer = MdcID::layer(ident);
00292       m_cell = MdcID::wire(ident);
00293       m_charge = (*iDigiCol)->getChargeChannel()/1.0e6;
00294       m_time = (*iDigiCol)->getTimeChannel()/1.0e5;
00295       tupleMdc2->write();
00296       }
00297     }
00298     //std::cout<<"end of retrieve MDC digi collection"<<std::endl;
00299   }
00300 }

void McTestAlg::RetrieveMuc (  ) 

Definition at line 463 of file McTestAlg.cxx.

References m_evtSvc.

Referenced by execute().

00464 {
00465   //retrieve MUC McTruth from TDS
00466   SmartDataPtr<Event::MucMcHitCol> aMcHitCol(m_evtSvc,"/Event/MC/MucMcHitCol");
00467   if(!aMcHitCol)
00468     std::cout<<"Could not retrieve MUC McTruth collection"<<std::endl;
00469   else
00470   {
00471     Event::MucMcHitCol::iterator iMcHitCol;
00472     for(iMcHitCol=aMcHitCol->begin(); iMcHitCol!=aMcHitCol->end(); iMcHitCol++)
00473     {
00474       const Identifier ident = (*iMcHitCol)->identify();
00475       //std::cout<<(*iMcHitCol)->getTrackIndex();
00476       //std::cout<<" "<<MucID::part(ident);
00477       //std::cout<<" "<<MucID::seg(ident);
00478       //std::cout<<" "<<MucID::gap(ident);
00479       //std::cout<<" "<<MucID::strip(ident);
00480       //std::cout<<" "<<(*iMcHitCol)->getPositionX();
00481       //std::cout<<" "<<(*iMcHitCol)->getPositionY();
00482       //std::cout<<" "<<(*iMcHitCol)->getPositionZ();
00483       //std::cout<<" "<<(*iMcHitCol)->getPx();
00484       //std::cout<<" "<<(*iMcHitCol)->getPy();
00485       //std::cout<<" "<<(*iMcHitCol)->getPz();
00486       //std::cout<<std::endl;
00487     }
00488     //std::cout<<"end of retrieve MUC McTruth"<<std::endl;
00489   }
00490 
00491   //retrieve MUC digits from TDS
00492   SmartDataPtr<MucDigiCol> aDigiCol(m_evtSvc,"/Event/Digi/MucDigiCol");
00493   if(!aDigiCol)
00494     std::cout<<"Could not retrieve MUC digi collection"<<std::endl;
00495 
00496   else
00497   {
00498     MucDigiCol::iterator iDigiCol;
00499     for(iDigiCol=aDigiCol->begin(); iDigiCol!=aDigiCol->end(); iDigiCol++)
00500     {
00501       const Identifier ident = (*iDigiCol)->identify();
00502       //std::cout<<"Part: "<<MucID::part(ident);
00503       //std::cout<<"  Seg: "<<MucID::seg(ident);
00504       //std::cout<<"  Gap: "<<MucID::gap(ident);
00505       //std::cout<<"  Strip: "<<MucID::strip(ident)<<std::endl;
00506     }
00507     //std::cout<<"end of retrieve MUC digits"<<std::endl;
00508   }
00509 }

void McTestAlg::RetrieveTof (  ) 

Definition at line 319 of file McTestAlg.cxx.

References TofID::barrel_ec(), TofID::end(), deljobs::end, TofID::layer(), m_evtSvc, m_tofRootFlag, ntruth, TofID::phi_module(), qleft, qright, tleft, TofInit(), tright, truthIndex, truthLayer, truthPartId, truthScinNb, truthX, truthY, truthZ, and tupleTof.

Referenced by execute().

00320 { 
00321   int partId,layer,scinNb,end;
00322   double charge,time; 
00323   partId = layer = scinNb = end = -9;
00324   charge = time = -9;
00325   if(m_tofRootFlag)
00326     TofInit();
00327 
00328   //retrieve TOF McTruth from TDS
00329   SmartDataPtr<Event::TofMcHitCol> aMcHitCol(m_evtSvc,"/Event/MC/TofMcHitCol");
00330   if(!aMcHitCol)
00331     std::cout<<"Could not retrieve TOF McTruth collection"<<std::endl;
00332   else
00333   {
00334     Event::TofMcHitCol::iterator iMcHitCol;
00335     for(iMcHitCol=aMcHitCol->begin(); iMcHitCol!=aMcHitCol->end(); iMcHitCol++)  
00336     {
00337       const Identifier ident = (*iMcHitCol)->identify();
00338       /*std::cout<<(*iMcHitCol)->getTrackIndex();
00339       std::cout<<" "<<TofID::barrel_ec(ident);
00340       std::cout<<" "<<TofID::layer(ident);
00341       std::cout<<" "<<TofID::phi_module(ident);
00342       std::cout<<" "<<(*iMcHitCol)->getPositionX();
00343       std::cout<<" "<<(*iMcHitCol)->getPositionY();
00344       std::cout<<" "<<(*iMcHitCol)->getPositionZ();
00345       std::cout<<" "<<(*iMcHitCol)->getPx();
00346       std::cout<<" "<<(*iMcHitCol)->getPy();
00347       std::cout<<" "<<(*iMcHitCol)->getPz();
00348       std::cout<<" "<<(*iMcHitCol)->getTrackLength();
00349       std::cout<<" "<<(*iMcHitCol)->getFlightTime();
00350       std::cout<<std::endl;*/
00351       if(m_tofRootFlag)
00352       {
00353         truthIndex = (*iMcHitCol)->getTrackIndex();
00354         truthPartId = TofID::barrel_ec(ident);
00355         truthLayer = TofID::layer(ident);
00356         truthScinNb = TofID::phi_module(ident);
00357         truthX = (*iMcHitCol)->getPositionX();
00358         truthY = (*iMcHitCol)->getPositionY();
00359         truthZ = (*iMcHitCol)->getPositionZ();
00360         ntruth++;
00361       } 
00362     }
00363   }
00364 
00365   //retrieve TOF digits from TDS
00366   SmartDataPtr<TofDigiCol> aDigiCol(m_evtSvc,"/Event/Digi/TofDigiCol");
00367   if(!aDigiCol)
00368     std::cout<<"Could not retrieve TOF digi collection"<<std::endl;
00369   else
00370   { 
00371     TofDigiCol::iterator iDigiCol;
00372     for(iDigiCol=aDigiCol->begin(); iDigiCol!=aDigiCol->end(); iDigiCol++)
00373     {
00374       const Identifier ident = (*iDigiCol)->identify();
00375       //std::cout<<"partId: "<<TofID::barrel_ec(ident);
00376       //std::cout<<"  layer: "<<TofID::layer(ident);
00377       //std::cout<<"  scinNb: "<<TofID::phi_module(ident);
00378       //std::cout<<"  end: "<<TofID::end(ident);
00379       //std::cout<<std::endl;
00380       //std::cout<<"  charge: "<<(*iDigiCol)->getChargeChannel();
00381       //std::cout<<"  time: "<<(*iDigiCol)->getTimeChannel()<<std::endl;
00382       //if(TofID::barrel_ec(ident)==barrel_ec && layer == TofID::layer(ident) && 
00383       //   phi_module == TofID::phi_module(ident) )
00384       partId=TofID::barrel_ec(ident);
00385       layer=TofID::layer(ident);
00386       scinNb=TofID::phi_module(ident);
00387       end=TofID::end(ident);
00388       charge = (*iDigiCol)->getChargeChannel()/1.0e6;
00389       time = (*iDigiCol)->getTimeChannel()/1.0e6;
00390       if(m_tofRootFlag)
00391       {
00392         if(truthPartId==partId && truthLayer==layer && truthScinNb==scinNb)
00393         {
00394           if(end==0) {qright = charge; tright=time;}
00395           else  {qleft = charge; tleft = time;}
00396          //std::cout<<partId<<" "<<scinNb<<" "<<charge<<" "<<time<<std::endl; 
00397         }
00398         else
00399           std::cout<<"digi doesn't match"<<std::endl;
00400        }
00401      }
00402      if(m_tofRootFlag)
00403      {
00404        if(tleft>0&&tright>0&&qleft>0&&qright>0)
00405          tupleTof->write();
00406        else
00407          std::cout<<"no digi match MCtruth"<<std::endl;
00408      }
00409    
00410     //std::cout<<"end of retrieve TOF digits"<<std::endl;
00411   }
00412 }  

void McTestAlg::TofInit (  ) 

Definition at line 302 of file McTestAlg.cxx.

References ntruth, qleft, qright, tleft, tright, truthIndex, truthLayer, truthPartId, truthScinNb, truthX, truthY, and truthZ.

Referenced by RetrieveTof().

00303 { 
00304   truthIndex = -9;
00305   truthPartId = -9;
00306   truthLayer = -9;
00307   truthScinNb = -9;
00308   truthX = -9;
00309   truthY = -9;
00310   truthZ = -9;
00311   ntruth = 0;
00312   tleft = -9;
00313   tright = -9;
00314   qleft = -9;
00315   qright = -9;
00316 }


Member Data Documentation

NTuple::Item<double> McTestAlg::m_cell [private]

Definition at line 49 of file McTestAlg.h.

Referenced by initialize(), MdcInit(), and RetrieveMdc().

NTuple::Item<double> McTestAlg::m_charge [private]

Definition at line 50 of file McTestAlg.h.

Referenced by initialize(), MdcInit(), and RetrieveMdc().

IDataProviderSvc* McTestAlg::m_evtSvc [private]

Definition at line 28 of file McTestAlg.h.

Referenced by execute(), RetrieveEmc(), RetrieveMcParticle(), RetrieveMdc(), RetrieveMuc(), and RetrieveTof().

NTuple::Item<double> McTestAlg::m_layer [private]

Definition at line 48 of file McTestAlg.h.

Referenced by initialize(), MdcInit(), and RetrieveMdc().

bool McTestAlg::m_mdcRootFlag [private]

Definition at line 34 of file McTestAlg.h.

Referenced by initialize(), McTestAlg(), and RetrieveMdc().

bool McTestAlg::m_particleRootFlag [private]

Definition at line 30 of file McTestAlg.h.

Referenced by initialize(), McTestAlg(), and RetrieveMcParticle().

NTuple::Item<double> McTestAlg::m_time [private]

Definition at line 51 of file McTestAlg.h.

Referenced by initialize(), MdcInit(), and RetrieveMdc().

bool McTestAlg::m_tofRootFlag [private]

Definition at line 53 of file McTestAlg.h.

Referenced by initialize(), McTestAlg(), and RetrieveTof().

NTuple::Item<double> McTestAlg::me [private]

Definition at line 32 of file McTestAlg.h.

Referenced by initialize(), and RetrieveMcParticle().

NTuple::Item<double> McTestAlg::ntruth [private]

Definition at line 62 of file McTestAlg.h.

Referenced by initialize(), RetrieveTof(), and TofInit().

NTuple::Item<double> McTestAlg::ntruthMdc [private]

Definition at line 47 of file McTestAlg.h.

Referenced by initialize(), MdcInit(), and RetrieveMdc().

NTuple::Item<double> McTestAlg::qleft [private]

Definition at line 65 of file McTestAlg.h.

Referenced by initialize(), RetrieveTof(), and TofInit().

NTuple::Item<double> McTestAlg::qright [private]

Definition at line 66 of file McTestAlg.h.

Referenced by initialize(), RetrieveTof(), and TofInit().

NTuple::Item<double> McTestAlg::tleft [private]

Definition at line 63 of file McTestAlg.h.

Referenced by initialize(), RetrieveTof(), and TofInit().

NTuple::Item<double> McTestAlg::tright [private]

Definition at line 64 of file McTestAlg.h.

Referenced by initialize(), RetrieveTof(), and TofInit().

NTuple::Item<double> McTestAlg::truthIndex [private]

Definition at line 55 of file McTestAlg.h.

Referenced by initialize(), RetrieveTof(), and TofInit().

NTuple::Item<double> McTestAlg::truthLayer [private]

Definition at line 57 of file McTestAlg.h.

Referenced by initialize(), RetrieveTof(), and TofInit().

NTuple::Item<double> McTestAlg::truthMdcDriftD [private]

Definition at line 43 of file McTestAlg.h.

Referenced by initialize(), MdcInit(), and RetrieveMdc().

NTuple::Item<double> McTestAlg::truthMdcEdep [private]

Definition at line 42 of file McTestAlg.h.

Referenced by initialize(), MdcInit(), and RetrieveMdc().

NTuple::Item<long> McTestAlg::truthMdcIndex [private]

Definition at line 38 of file McTestAlg.h.

Referenced by initialize(), MdcInit(), and RetrieveMdc().

NTuple::Item<long> McTestAlg::truthMdcLayer [private]

Definition at line 40 of file McTestAlg.h.

Referenced by initialize(), MdcInit(), and RetrieveMdc().

NTuple::Item<long> McTestAlg::truthMdcParId [private]

Definition at line 39 of file McTestAlg.h.

NTuple::Item<long> McTestAlg::truthMdcWire [private]

Definition at line 41 of file McTestAlg.h.

Referenced by initialize(), MdcInit(), and RetrieveMdc().

NTuple::Item<double> McTestAlg::truthMdcX [private]

Definition at line 44 of file McTestAlg.h.

Referenced by initialize(), MdcInit(), and RetrieveMdc().

NTuple::Item<double> McTestAlg::truthMdcY [private]

Definition at line 45 of file McTestAlg.h.

Referenced by initialize(), MdcInit(), and RetrieveMdc().

NTuple::Item<double> McTestAlg::truthMdcZ [private]

Definition at line 46 of file McTestAlg.h.

Referenced by initialize(), MdcInit(), and RetrieveMdc().

NTuple::Item<double> McTestAlg::truthPartId [private]

Definition at line 56 of file McTestAlg.h.

Referenced by initialize(), RetrieveTof(), and TofInit().

NTuple::Item<double> McTestAlg::truthScinNb [private]

Definition at line 58 of file McTestAlg.h.

Referenced by initialize(), RetrieveTof(), and TofInit().

NTuple::Item<double> McTestAlg::truthX [private]

Definition at line 59 of file McTestAlg.h.

Referenced by initialize(), RetrieveTof(), and TofInit().

NTuple::Item<double> McTestAlg::truthY [private]

Definition at line 60 of file McTestAlg.h.

Referenced by initialize(), RetrieveTof(), and TofInit().

NTuple::Item<double> McTestAlg::truthZ [private]

Definition at line 61 of file McTestAlg.h.

Referenced by initialize(), RetrieveTof(), and TofInit().

NTuple::Tuple* McTestAlg::tupleMdc1 [private]

Definition at line 35 of file McTestAlg.h.

Referenced by initialize(), and RetrieveMdc().

NTuple::Tuple* McTestAlg::tupleMdc2 [private]

Definition at line 36 of file McTestAlg.h.

Referenced by initialize(), and RetrieveMdc().

NTuple::Tuple* McTestAlg::tupleParticle [private]

Definition at line 31 of file McTestAlg.h.

Referenced by initialize(), and RetrieveMcParticle().

NTuple::Tuple* McTestAlg::tupleTof [private]

Definition at line 54 of file McTestAlg.h.

Referenced by initialize(), and RetrieveTof().


Generated on Tue Nov 29 23:20:07 2016 for BOSS_7.0.2 by  doxygen 1.4.7