DQA_Dedx Class Reference

#include <DQA_Dedx.h>

List of all members.

Public Member Functions

 DQA_Dedx (const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize ()
StatusCode execute ()
StatusCode finalize ()

Private Attributes

ITHistSvc * m_thsvc
NTuple::Tuple * m_bb_tuple
NTuple::Item< double > m_bb_runNo
NTuple::Item< double > m_bb_event
NTuple::Item< double > m_bb_p
NTuple::Item< double > m_bb_costh
NTuple::Item< double > m_bb_t0
NTuple::Item< double > m_bb_chiE
NTuple::Item< double > m_bb_chiMu
NTuple::Item< double > m_bb_chiPi
NTuple::Item< double > m_bb_chiK
NTuple::Item< double > m_bb_chiP
NTuple::Item< double > m_bb_nhit
NTuple::Item< double > m_bb_ndedxhit
NTuple::Item< double > m_bb_dEdx
NTuple::Tuple * m_du_tuple
NTuple::Item< double > m_du_runNo
NTuple::Item< double > m_du_event
NTuple::Item< double > m_du_p
NTuple::Item< double > m_du_costh
NTuple::Item< double > m_du_t0
NTuple::Item< double > m_du_chiE
NTuple::Item< double > m_du_chiMu
NTuple::Item< double > m_du_chiPi
NTuple::Item< double > m_du_chiK
NTuple::Item< double > m_du_chiP
NTuple::Item< double > m_du_nhit
NTuple::Item< double > m_du_ndedxhit
NTuple::Item< double > m_du_dEdx


Detailed Description

Definition at line 23 of file DQA_Dedx.h.


Constructor & Destructor Documentation

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

Definition at line 40 of file DQA_Dedx.cxx.

00040                                                                   :
00041   Algorithm(name, pSvcLocator) {
00042   
00043   //Declare the properties  
00044 }


Member Function Documentation

StatusCode DQA_Dedx::execute (  ) 

Definition at line 190 of file DQA_Dedx.cxx.

References cos(), Bes_Common::DEBUG, DstMdcKalTrack::electron, calibUtil::ERROR, EventModel::EvtRec::EvtRecEvent, EventModel::EvtRec::EvtRecTrackCol, genRecEmupikp::i, Bes_Common::INFO, m_bb_chiE, m_bb_chiK, m_bb_chiMu, m_bb_chiP, m_bb_chiPi, m_bb_costh, m_bb_dEdx, m_bb_event, m_bb_ndedxhit, m_bb_nhit, m_bb_p, m_bb_runNo, m_bb_t0, m_bb_tuple, m_du_chiE, m_du_chiK, m_du_chiMu, m_du_chiP, m_du_chiPi, m_du_costh, m_du_dEdx, m_du_event, m_du_ndedxhit, m_du_nhit, m_du_p, m_du_runNo, m_du_t0, m_du_tuple, m_thsvc, msgSvc(), and DstMdcKalTrack::muon.

00190                              {
00191   
00192   MsgStream log(msgSvc(), name());
00193   log << MSG::INFO << "in execute()" << endreq;
00194 
00195   SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
00196   m_bb_runNo=eventHeader->runNumber();
00197   m_bb_event=eventHeader->eventNumber();
00198   
00199   m_du_runNo=eventHeader->runNumber();
00200   m_du_event=eventHeader->eventNumber();
00201   
00202   log << MSG::DEBUG <<"run, evt num = "
00203       << m_bb_runNo << " , "
00204       << m_bb_event <<endreq;
00205 
00206 
00207   SmartDataPtr<EvtRecEvent> evtRecEvent(eventSvc(), EventModel::EvtRec::EvtRecEvent);
00208 
00209   SmartDataPtr<DQAEvent::DQAEvent> dqaevt(eventSvc(), "/Event/DQATag");
00210   if ( dqaevt ) {
00211       log << MSG::INFO << "success get DQAEvent" << endreq;
00212   } else {
00213       log << MSG::ERROR << "Error accessing DQAEvent" << endreq;
00214       return StatusCode::FAILURE;
00215   }
00216 
00217   log << MSG::DEBUG << "event tag = " << dqaevt->EventTag() << endreq;
00218 
00219   // get the required control sample with DQA tag
00220   if ( dqaevt->Bhabha() ) {
00221     log << MSG::INFO << "Bhabha event" << endreq;
00222     SmartDataPtr<EvtRecTrackCol> evtRecTrkCol(eventSvc(), EventModel::EvtRec::EvtRecTrackCol);
00223     for(int i = 0; i < evtRecEvent->totalCharged(); i++){
00224       EvtRecTrackIterator itTrk=evtRecTrkCol->begin() + i;
00225       log << MSG::DEBUG << i << " " << (*itTrk)->partId() << " "
00226           << (*itTrk)->quality() << endreq;
00227       // get the: required particle through the track's PID
00228       // Pid: 1 - electron, 2 - muon, 3 - pion, 4 - kaon, 5 - proton
00229       if ( (*itTrk)->partId() != 1 ) continue; // only e+, e-
00230       // if you want to do dE/dx or TOF study, select track with no bias
00231       // Quality: defined by whether dE/dx or TOF is used to identify particle
00232       // 0 - no dE/dx, no TOF (can be used for dE/dx and TOF calibration)
00233       // 1 - only dE/dx (can be used for TOF calibration)
00234       // 2 - only TOF (can be used for dE/dx calibration)
00235       // 3 - Both dE/dx and TOF          
00236       int qual = (*itTrk)->quality();
00237       if ( qual != 0 && qual != 2) continue; // no dE/dx PID is used in selection
00238       //          if ( qual != 0 && qual != 1) continue; // no TOF PID is used in the selection
00239       
00240       
00241       TH1 *h(0);
00242       TH2 *h2(0);
00243       //initinalize all values
00244       m_bb_runNo=-999;
00245       m_bb_event=-999;
00246       m_bb_p=-999;
00247       m_bb_costh=-999;
00248       m_bb_t0=-999;
00249       m_bb_chiE=-999;
00250       m_bb_chiMu=-999;
00251       m_bb_chiPi=-999;
00252       m_bb_chiK=-999;
00253       m_bb_chiP=-999;
00254       m_bb_nhit=-999;
00255       m_bb_ndedxhit=-999;
00256       m_bb_dEdx=-999; 
00257       
00258       
00259       if((*itTrk)->isMdcKalTrackValid()){
00260         RecMdcKalTrack *mdcTrk = (*itTrk)->mdcKalTrack();
00261         mdcTrk->setPidType(RecMdcKalTrack::electron);
00262         if ( mdcTrk->charge() > 0 ) {
00263           log << MSG::DEBUG << "is electron" << endreq;
00264         } else {
00265           log << MSG::DEBUG << "is positron" << endreq;
00266         }
00267         double x0  =mdcTrk->x(); 
00268         double y0  =mdcTrk->y(); 
00269         double z0  =mdcTrk->z(); 
00270         double Rxy=sqrt(x0*x0+y0*y0);
00271         
00272         m_bb_p=mdcTrk->p()*mdcTrk->charge();
00273         m_bb_costh=cos(mdcTrk->theta());
00274         
00275         
00276         double tes=-999;
00277         
00278         //get event start time
00279         SmartDataPtr<RecEsTimeCol> aevtimeCol(eventSvc(),"/Event/Recon/RecEsTimeCol");
00280         if( aevtimeCol &&  aevtimeCol->size()>0 ){
00281           RecEsTimeCol::iterator iter_evt = aevtimeCol->begin();
00282           for(; iter_evt!=aevtimeCol->end(); iter_evt++){
00283             tes = (*iter_evt)->getTest();
00284             //esTimeflag = (*iter_evt)->getStat();
00285           }
00286         }
00287         m_bb_t0=tes;
00288 
00289         //get dedx information
00290         if((*itTrk)->isMdcDedxValid()){
00291           RecMdcDedx* dedxTrk = (*itTrk)->mdcDedx();
00292           m_bb_chiE   = dedxTrk->chi(0);
00293           m_bb_chiMu  = dedxTrk->chi(1);
00294           m_bb_chiPi  = dedxTrk->chi(2);
00295           m_bb_chiK   = dedxTrk->chi(3);
00296           m_bb_chiP   = dedxTrk->chi(4);
00297           m_bb_ndedxhit   = dedxTrk->numGoodHits();
00298           m_bb_nhit   = dedxTrk->numTotalHits();
00299           m_bb_dEdx = dedxTrk->probPH();
00300           
00301           //fill histograms
00302           if (m_thsvc->getHist("/DQAHist/Dedx/Bhabha/dedx", h).isSuccess()) {
00303             h->Fill(dedxTrk->probPH());
00304           } 
00305           else {
00306             log << MSG::ERROR << "Couldn't retrieve dedx" << endreq;
00307           }
00308           if(fabs(cos(mdcTrk->theta()))<0.83){
00309             if (m_thsvc->getHist("/DQAHist/Dedx/Bhabha/dedx_barrel", h).isSuccess()) {
00310               h->Fill(dedxTrk->probPH());
00311             } 
00312             else {
00313               log << MSG::ERROR << "Couldn't retrieve dedx_barrel" << endreq;
00314             }
00315           }
00316           if (m_thsvc->getHist("/DQAHist/Dedx/Bhabha/chiE", h).isSuccess()) {
00317             h->Fill(dedxTrk->chiE());
00318           } 
00319           else {
00320             log << MSG::ERROR << "Couldn't retrieve chiE" << endreq;
00321           }
00322           if (m_thsvc->getHist("/DQAHist/Dedx/Bhabha/nhitdedx", h).isSuccess()) {
00323             h->Fill( dedxTrk->numGoodHits());
00324           } 
00325           else {
00326             log << MSG::ERROR << "Couldn't retrieve nhitdedx" << endreq;
00327           }
00328           if (m_thsvc->getHist("/DQAHist/Dedx/Bhabha/nhit", h).isSuccess()) {
00329             h->Fill( dedxTrk->numTotalHits());
00330           } 
00331           else {
00332             log << MSG::ERROR << "Couldn't retrieve nhit" << endreq;
00333           }
00334           if (m_thsvc->getHist("/DQAHist/Dedx/Bhabha/dedx_p", h2).isSuccess()) {
00335             h2->Fill(mdcTrk->p(), dedxTrk->probPH());
00336           } 
00337           else {
00338             log << MSG::ERROR << "Couldn't retrieve dedx_p" << endreq;
00339           } 
00340           if (m_thsvc->getHist("/DQAHist/Dedx/Bhabha/dedx_costh", h2).isSuccess()) {
00341             h2->Fill(cos(mdcTrk->theta()), dedxTrk->probPH());
00342           } 
00343           else {
00344             log << MSG::ERROR << "Couldn't retrieve dedx_costh" << endreq;
00345           } 
00346           if (m_thsvc->getHist("/DQAHist/Dedx/Bhabha/dedx_t0", h2).isSuccess()) {
00347             h2->Fill(tes, dedxTrk->probPH());
00348           } 
00349           else {
00350             log << MSG::ERROR << "Couldn't retrieve dedx_t0" << endreq;
00351           } 
00352 
00353         }//end of valid dedx track
00354       }//end of valid mdc track
00355       }//end of looping track
00356   }//end of bhabha tag event
00357   
00358   
00359   if ( dqaevt->Dimu() ) {
00360     log << MSG::INFO << "Dimu event" << endreq;
00361     SmartDataPtr<EvtRecTrackCol> evtRecTrkCol(eventSvc(), EventModel::EvtRec::EvtRecTrackCol);
00362     for(int i = 0; i < evtRecEvent->totalCharged(); i++){
00363       EvtRecTrackIterator itTrk=evtRecTrkCol->begin() + i;
00364       log << MSG::DEBUG << i << " " << (*itTrk)->partId() << " "
00365           << (*itTrk)->quality() << endreq;
00366       // get the: required particle through the track's PID
00367       // Pid: 1 - electron, 2 - muon, 3 - pion, 4 - kaon, 5 - proton
00368       if ( (*itTrk)->partId() != 2 ) continue; // only e+, e-
00369       // if you want to do dE/dx or TOF study, select track with no bias
00370       // Quality: defined by whether dE/dx or TOF is used to identify particle
00371       // 0 - no dE/dx, no TOF (can be used for dE/dx and TOF calibration)
00372       // 1 - only dE/dx (can be used for TOF calibration)
00373       // 2 - only TOF (can be used for dE/dx calibration)
00374       // 3 - Both dE/dx and TOF          
00375       int qual = (*itTrk)->quality();
00376       if ( qual != 0 && qual != 2) continue; // no dE/dx PID is used in selection
00377       //          if ( qual != 0 && qual != 1) continue; // no TOF PID is used in the selection
00378       
00379       TH1 *h(0);
00380       TH2 *h2(0);
00381       //initinalize all values
00382       m_du_runNo=-999;
00383       m_du_event=-999;
00384       m_du_p=-999;
00385       m_du_costh=-999;
00386       m_du_t0=-999;
00387       m_du_chiE=-999;
00388       m_du_chiMu=-999;
00389       m_du_chiPi=-999;
00390       m_du_chiK=-999;
00391       m_du_chiP=-999;
00392       m_du_nhit=-999;
00393       m_du_ndedxhit=-999;
00394       m_du_dEdx=-999; 
00395       
00396       
00397       if((*itTrk)->isMdcKalTrackValid()){
00398         RecMdcKalTrack *mdcTrk = (*itTrk)->mdcKalTrack();
00399         mdcTrk->setPidType(RecMdcKalTrack::muon);
00400         if ( mdcTrk->charge() > 0 ) {
00401           log << MSG::DEBUG << "is muon+" << endreq;
00402         } else {
00403           log << MSG::DEBUG << "is muon-" << endreq;
00404         }
00405         double x0  =mdcTrk->x(); 
00406         double y0  =mdcTrk->y(); 
00407         double z0  =mdcTrk->z(); 
00408         double Rxy=sqrt(x0*x0+y0*y0);
00409         
00410         m_du_p=mdcTrk->p()*mdcTrk->charge();
00411         m_du_costh=cos(mdcTrk->theta());
00412         
00413         
00414         double tes=-999;
00415         //get event start time
00416         SmartDataPtr<RecEsTimeCol> aevtimeCol(eventSvc(),"/Event/Recon/RecEsTimeCol");
00417         if( aevtimeCol &&  aevtimeCol->size()>0 ){
00418           RecEsTimeCol::iterator iter_evt = aevtimeCol->begin();
00419           for(; iter_evt!=aevtimeCol->end(); iter_evt++){
00420             tes = (*iter_evt)->getTest();
00421             //esTimeflag = (*iter_evt)->getStat();
00422           }
00423         }
00424         m_du_t0=tes;
00425         
00426         //get dedx information
00427         if((*itTrk)->isMdcDedxValid()){
00428           RecMdcDedx* dedxTrk = (*itTrk)->mdcDedx();
00429           m_du_chiE   = dedxTrk->chi(0);
00430           m_du_chiMu  = dedxTrk->chi(1);
00431           m_du_chiPi  = dedxTrk->chi(2);
00432           m_du_chiK   = dedxTrk->chi(3);
00433           m_du_chiP   = dedxTrk->chi(4);
00434           m_du_ndedxhit   = dedxTrk->numGoodHits();
00435           m_du_nhit   = dedxTrk->numTotalHits();
00436           m_du_dEdx = dedxTrk->probPH();
00437           
00438           //fill histograms
00439           if (m_thsvc->getHist("/DQAHist/Dedx/Dimu/dedx", h).isSuccess()) {
00440             h->Fill(dedxTrk->probPH());
00441           } 
00442           else {
00443             log << MSG::ERROR << "Couldn't retrieve dedx" << endreq;
00444           }
00445           if(fabs(cos(mdcTrk->theta()))<0.83){
00446             if (m_thsvc->getHist("/DQAHist/Dedx/Dimu/dedx_barrel", h).isSuccess()) {
00447               h->Fill(dedxTrk->probPH());
00448             } 
00449             else {
00450               log << MSG::ERROR << "Couldn't retrieve dedx_barrel" << endreq;
00451             }
00452           }
00453           if (m_thsvc->getHist("/DQAHist/Dedx/Dimu/chiMu", h).isSuccess()) {
00454             h->Fill(dedxTrk->chiE());
00455           } 
00456           else {
00457             log << MSG::ERROR << "Couldn't retrieve chiMu" << endreq;
00458           }
00459           if (m_thsvc->getHist("/DQAHist/Dedx/Dimu/nhitdedx", h).isSuccess()) {
00460             h->Fill( dedxTrk->numGoodHits());
00461           } 
00462           else {
00463             log << MSG::ERROR << "Couldn't retrieve nhitdedx" << endreq;
00464           }
00465           if (m_thsvc->getHist("/DQAHist/Dedx/Dimu/nhit", h).isSuccess()) {
00466             h->Fill( dedxTrk->numTotalHits());
00467           } 
00468           else {
00469             log << MSG::ERROR << "Couldn't retrieve nhit" << endreq;
00470           }
00471           if (m_thsvc->getHist("/DQAHist/Dedx/Dimu/dedx_p", h2).isSuccess()) {
00472             h2->Fill(mdcTrk->p(), dedxTrk->probPH());
00473           } 
00474           else {
00475             log << MSG::ERROR << "Couldn't retrieve dedx_p" << endreq;
00476           } 
00477           if (m_thsvc->getHist("/DQAHist/Dedx/Dimu/dedx_costh", h2).isSuccess()) {
00478             h2->Fill(cos(mdcTrk->theta()), dedxTrk->probPH());
00479           } 
00480           else {
00481             log << MSG::ERROR << "Couldn't retrieve dedx_costh" << endreq;
00482           } 
00483           if (m_thsvc->getHist("/DQAHist/Dedx/Dimu/dedx_t0", h2).isSuccess()) {
00484             h2->Fill(tes, dedxTrk->probPH());
00485           } 
00486           else {
00487             log << MSG::ERROR << "Couldn't retrieve dedx_t0" << endreq;
00488           } 
00489 
00490         }//end of valide dedx track
00491       }//end of valide mdc track
00492     }//end of looping track
00493   }//end of dimu tag event
00494   
00495   
00496   m_bb_tuple->write();
00497   m_du_tuple->write();
00498   
00499   return StatusCode::SUCCESS;
00500 
00501 }

StatusCode DQA_Dedx::finalize (  ) 

Definition at line 504 of file DQA_Dedx.cxx.

References Bes_Common::INFO, and msgSvc().

00504                               {
00505 
00506   MsgStream log(msgSvc(), name());
00507   log << MSG::INFO << "in finalize()" << endmsg;
00508   return StatusCode::SUCCESS;
00509 }

StatusCode DQA_Dedx::initialize (  ) 

Definition at line 47 of file DQA_Dedx.cxx.

References calibUtil::ERROR, Bes_Common::INFO, m_bb_chiE, m_bb_chiK, m_bb_chiMu, m_bb_chiP, m_bb_chiPi, m_bb_costh, m_bb_dEdx, m_bb_event, m_bb_ndedxhit, m_bb_nhit, m_bb_p, m_bb_runNo, m_bb_t0, m_bb_tuple, m_du_chiE, m_du_chiK, m_du_chiMu, m_du_chiP, m_du_chiPi, m_du_costh, m_du_dEdx, m_du_event, m_du_ndedxhit, m_du_nhit, m_du_p, m_du_runNo, m_du_t0, m_du_tuple, m_thsvc, msgSvc(), and ntupleSvc().

00047                                {
00048   MsgStream log(msgSvc(), name());
00049 
00050   log << MSG::INFO << "in initialize()" << endmsg;
00051   StatusCode status;
00052 
00053   // DQA
00054   // The first directory specifier must be "DQAFILE"
00055   // The second is the sub-system name: MDC, DEDX, TOF, EMC, MUC, TRG
00056   // user can define more directory, such as DAQFILE/MDC/Bhabha.
00057   
00058   
00059   if(service("THistSvc", m_thsvc).isFailure()) {
00060     log << MSG::ERROR << "Couldn't get THistSvc" << endreq;
00061     return StatusCode::FAILURE;
00062   }
00063 
00064 
00065 
00066   NTuplePtr nt_bb(ntupleSvc(), "DQAFILE/DEDX");
00067   if ( nt_bb ) m_bb_tuple = nt_bb;
00068   else {
00069     m_bb_tuple = ntupleSvc()->book("DQAFILE/DEDX/Bhabha", CLID_ColumnWiseTuple, "Dedx ntuple");
00070     if( m_bb_tuple ) {
00071       status = m_bb_tuple->addItem("runNo", m_bb_runNo);
00072       status = m_bb_tuple->addItem("event", m_bb_event);
00073       status = m_bb_tuple->addItem("p", m_bb_p);
00074       status = m_bb_tuple->addItem("costh", m_bb_costh);
00075       status = m_bb_tuple->addItem("t0", m_bb_t0);
00076       status = m_bb_tuple->addItem("chiE",m_bb_chiE);
00077       status = m_bb_tuple->addItem("chiMu",m_bb_chiMu);
00078       status = m_bb_tuple->addItem("chiPi",m_bb_chiPi);
00079       status = m_bb_tuple->addItem("chiK",m_bb_chiK);
00080       status = m_bb_tuple->addItem("chiP",m_bb_chiP);
00081       status = m_bb_tuple->addItem("nhit", m_bb_nhit);
00082       status = m_bb_tuple->addItem("ndedxhit", m_bb_ndedxhit);
00083       status = m_bb_tuple->addItem("dEdx", m_bb_dEdx); 
00084     } else {
00085       log << MSG::ERROR << "Can not book N-tuple:" << long(m_bb_tuple) << endreq;
00086     }
00087   }
00088   
00089   TH1F* h_dedx_bb = new TH1F("Dedx_bhabha", "dEdx distribution of bhabha samples", 150, 0., 1500.);
00090   if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/dedx", h_dedx_bb).isFailure()) {
00091       log << MSG::ERROR << "Couldn't register Dedx_bhabha" << endreq;
00092   }
00093   TH1F* h_dedxbarrel_bb = new TH1F("Dedx_Barrel_bhabha", "dEdx distribution of barrel bhabha samples", 150, 0., 1500.);
00094   if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/dedx_barrel", h_dedxbarrel_bb).isFailure()) {
00095       log << MSG::ERROR << "Couldn't register Dedx_Barrel_bhabha" << endreq;
00096   }
00097   TH1F* h_chie_bb = new TH1F("ChiE_bhabha", "ChiE distribution of bhabha samples", 200, -20., 20.);
00098   if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/chiE", h_chie_bb).isFailure()) {
00099       log << MSG::ERROR << "Couldn't register chiE_bhabha" << endreq;
00100   }
00101   TH1F* h_nhitdedx_bb = new TH1F("Nhitdedx", "dEdx used hits", 40, 0., 60.);
00102   if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/nhitdedx", h_nhitdedx_bb).isFailure()) {
00103       log << MSG::ERROR << "Couldn't register Nhitdedx" << endreq;
00104   }
00105   TH1F* h_nhit_bb = new TH1F("Nhit", "Total hits", 40, 0., 60.);
00106   if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/nhit", h_nhit_bb).isFailure()) {
00107       log << MSG::ERROR << "Couldn't register Nhit" << endreq;
00108   }
00109   TH2F* h_dedxvsp_bb=new TH2F("dEdx vs momentume","dEdx vs momentume", 200,0,2.5,200,0,2000);
00110   if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/dedx_p", h_dedxvsp_bb).isFailure()) {
00111     log << MSG::ERROR << "Couldn't register dedx vs p" << endreq;
00112   }
00113   TH2F* h_dedxvscos_bb=new TH2F("dEdx vs costheta","dEdx vs costheta", 100,-1,1,150,0,1500);
00114   if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/dedx_costh", h_dedxvscos_bb).isFailure()) {
00115     log << MSG::ERROR << "Couldn't register dedx vs costh" << endreq;
00116   }
00117   TH2F* h_dedxvst0_bb=new TH2F("dEdx vs t0","dEdx vs t0", 250,0,2500,150,0,1500);
00118   if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/dedx_t0", h_dedxvst0_bb).isFailure()) {
00119     log << MSG::ERROR << "Couldn't register dedx vs t0" << endreq;
00120   }
00121   
00122 
00123   NTuplePtr nt_du(ntupleSvc(), "DQAFILE/DEDX");
00124   if ( nt_du ) m_bb_tuple = nt_du;
00125   else {
00126     m_du_tuple = ntupleSvc()->book("DQAFILE/DEDX/Dimu", CLID_ColumnWiseTuple, "Dedx ntuple");
00127     if( m_du_tuple ) {
00128       status = m_du_tuple->addItem("runNo", m_du_runNo);
00129       status = m_du_tuple->addItem("event", m_du_event);
00130       status = m_du_tuple->addItem("p", m_du_p);
00131       status = m_du_tuple->addItem("costh", m_du_costh);
00132       status = m_du_tuple->addItem("t0", m_du_t0);
00133       status = m_du_tuple->addItem("chiE",m_du_chiE);
00134       status = m_du_tuple->addItem("chiMu",m_du_chiMu);
00135       status = m_du_tuple->addItem("chiPi",m_du_chiPi);
00136       status = m_du_tuple->addItem("chiK",m_du_chiK);
00137       status = m_du_tuple->addItem("chiP",m_du_chiP);
00138       status = m_du_tuple->addItem("nhit", m_du_nhit);
00139       status = m_du_tuple->addItem("ndedxhit", m_du_ndedxhit);
00140       status = m_du_tuple->addItem("dEdx", m_du_dEdx); 
00141     } else {
00142       log << MSG::ERROR << "Can not book N-tuple:" << long(m_du_tuple) << endreq;
00143       }
00144   }
00145   
00146   
00147   TH1F* h_dedx_du = new TH1F("Dedx_dimu", "dEdx distribution of bhabha samples", 150, 0., 1500.);
00148   if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/dedx", h_dedx_du).isFailure()) {
00149       log << MSG::ERROR << "Couldn't register Dedx_dimu" << endreq;
00150   }
00151   TH1F* h_dedxbarrel_du = new TH1F("Dedx_Barrel_dimu", "dEdx distribution of barrel bhabha samples", 150, 0., 1500.);
00152   if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/dedx_barrel", h_dedxbarrel_du).isFailure()) {
00153       log << MSG::ERROR << "Couldn't register Dedx_Barrel_dimu" << endreq;
00154   }
00155   TH1F* h_chimu_du = new TH1F("ChiE_dimu", "ChiE distribution of bhabha samples", 200, -20., 20.);
00156   if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/chiMu", h_chimu_du).isFailure()) {
00157       log << MSG::ERROR << "Couldn't register chiMu_dimu" << endreq;
00158   }
00159   TH1F* h_nhitdedx_du = new TH1F("Nhitdedx", "dEdx used hits", 40, 0., 60.);
00160   if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/nhitdedx", h_nhitdedx_du).isFailure()) {
00161       log << MSG::ERROR << "Couldn't register Nhitdedx" << endreq;
00162   }
00163   TH1F* h_nhit_du = new TH1F("Nhit", "Total hits", 40, 0., 60.);
00164   if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/nhit", h_nhit_du).isFailure()) {
00165       log << MSG::ERROR << "Couldn't register Nhit" << endreq;
00166   }
00167   TH2F* h_dedxvsp_du=new TH2F("dEdx vs momentume","dEdx vs momentume", 200,0,2.5,200,0,2000);
00168   if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/dedx_p", h_dedxvsp_du).isFailure()) {
00169     log << MSG::ERROR << "Couldn't register dedx vs p" << endreq;
00170   }
00171   TH2F* h_dedxvscos_du=new TH2F("dEdx vs costheta","dEdx vs costheta", 100,-1,1,150,0,1500);
00172   if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/dedx_costh", h_dedxvscos_du).isFailure()) {
00173     log << MSG::ERROR << "Couldn't register dedx vs costh" << endreq;
00174   }
00175   TH2F* h_dedxvst0_du=new TH2F("dEdx vs t0","dEdx vs t0", 200,0,2500,150,0,1500);
00176   if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/dedx_t0", h_dedxvst0_du).isFailure()) {
00177     log << MSG::ERROR << "Couldn't register dedx vs t0" << endreq;
00178   }
00179   
00180 
00181   
00182 
00183   log << MSG::INFO << "successfully return from initialize()" <<endmsg;
00184   return StatusCode::SUCCESS;
00185 
00186 
00187 }


Member Data Documentation

NTuple::Item<double> DQA_Dedx::m_bb_chiE [private]

Definition at line 41 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_bb_chiK [private]

Definition at line 44 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_bb_chiMu [private]

Definition at line 42 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_bb_chiP [private]

Definition at line 45 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_bb_chiPi [private]

Definition at line 43 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_bb_costh [private]

Definition at line 39 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_bb_dEdx [private]

Definition at line 48 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_bb_event [private]

Definition at line 37 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_bb_ndedxhit [private]

Definition at line 47 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_bb_nhit [private]

Definition at line 46 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_bb_p [private]

Definition at line 38 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_bb_runNo [private]

Definition at line 36 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_bb_t0 [private]

Definition at line 40 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Tuple* DQA_Dedx::m_bb_tuple [private]

Definition at line 35 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_du_chiE [private]

Definition at line 58 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_du_chiK [private]

Definition at line 61 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_du_chiMu [private]

Definition at line 59 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_du_chiP [private]

Definition at line 62 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_du_chiPi [private]

Definition at line 60 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_du_costh [private]

Definition at line 56 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_du_dEdx [private]

Definition at line 65 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_du_event [private]

Definition at line 54 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_du_ndedxhit [private]

Definition at line 64 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_du_nhit [private]

Definition at line 63 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_du_p [private]

Definition at line 55 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_du_runNo [private]

Definition at line 53 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Item<double> DQA_Dedx::m_du_t0 [private]

Definition at line 57 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

NTuple::Tuple* DQA_Dedx::m_du_tuple [private]

Definition at line 52 of file DQA_Dedx.h.

Referenced by execute(), and initialize().

ITHistSvc* DQA_Dedx::m_thsvc [private]

Definition at line 33 of file DQA_Dedx.h.

Referenced by execute(), and initialize().


Generated on Tue Nov 29 23:18:19 2016 for BOSS_7.0.2 by  doxygen 1.4.7