DQA_TOF Class Reference

#include <DQA_TOF.h>

List of all members.

Public Member Functions

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

Private Attributes

ITHistSvc * m_thsvc
TH1F * h_path
TH1F * h_Bzrhit
TH1F * h_Ezrhit
TH1F * h_ph
TH2F * W_delT
TH2F * E_delT
TH2F * counter
TH2F * cluster
TH2F * EC_delT
TH1F * Bt_delT
TH1F * Et_delT
TH2F * B_path
TH2F * E_path
TH2F * delT_z1
TH2F * delT_z2
TH2F * delT_z3
TH2F * delT_z4
TH2F * W_delT_Q
TH2F * E_delT_Q
TH1F * delT_pp
TH1F * delT_pm
TH1F * delT_pi
TH1F * delT_k


Detailed Description

Definition at line 8 of file DQA_TOF.h.


Constructor & Destructor Documentation

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

Definition at line 25 of file DQA_TOF.cxx.

00025                                                                 :
00026         Algorithm(name, pSvcLocator) {
00027 
00028                 //Declare the properties  
00029         }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 


Member Function Documentation

StatusCode DQA_TOF::execute (  ) 

Definition at line 100 of file DQA_TOF.cxx.

References B_path, Bt_delT, DstMdcTrack::charge(), cluster, counter, Bes_Common::DEBUG, delT_k, delT_pi, delT_pm, delT_pp, delT_z1, delT_z2, delT_z3, delT_z4, E_delT, E_delT_Q, E_path, EC_delT, calibUtil::ERROR, Et_delT, EventModel::EvtRec::EvtRecEvent, EventModel::EvtRec::EvtRecTrackCol, h_Bzrhit, h_Ezrhit, h_path, h_ph, genRecEmupikp::i, Bes_Common::INFO, msgSvc(), runNo, W_delT, and W_delT_Q.

00100                             {
00101         MsgStream log(msgSvc(), name());
00102         log << MSG::INFO << "in execute()" << endreq;
00103 
00104         SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
00105         int runNo=eventHeader->runNumber();
00106         int event=eventHeader->eventNumber();
00107         log<<MSG::DEBUG<<"run,evtnum="<<runNo<<","<<event<<endreq;
00108 
00109         SmartDataPtr<DQAEvent::DQAEvent> dqaevt(eventSvc(), "/Event/DQATag");
00110         if ( !dqaevt ) {
00111                 log << MSG::ERROR << "Error accessing DQAEvent" << endreq;
00112                 return StatusCode::FAILURE;
00113         }
00114 
00115         log << MSG::DEBUG << "event tag = " << dqaevt->EventTag() << endreq;
00116 
00117         //if ( !dqaevt->Bhabha() )return StatusCode::SUCCESS; 
00118         SmartDataPtr<EvtRecEvent> evtRecEvent(eventSvc(), EventModel::EvtRec::EvtRecEvent);     
00119         SmartDataPtr<EvtRecTrackCol> evtRecTrkCol(eventSvc(),  EventModel::EvtRec::EvtRecTrackCol);
00120         if(dqaevt->Bhabha()){
00121                 for(int i = 0; i < evtRecEvent->totalCharged(); i++){
00122                         EvtRecTrackIterator itTrk=evtRecTrkCol->begin() + i;
00123                         //if ( (*itTrk)->partId() != 1 ) continue; // only e+, e-
00124                         if(!(*itTrk)->isElectron())continue;
00125                         if(!(*itTrk)->isTofTrackValid())continue;
00126                         SmartRefVector<RecTofTrack> tofTrkCol = (*itTrk)->tofTrack();
00127                         SmartRefVector<RecTofTrack>::iterator iter_tof = tofTrkCol.begin();
00128                         for(;iter_tof != tofTrkCol.end(); iter_tof++ ) {
00129                                 TofHitStatus *status = new TofHitStatus;
00130                                 status->setStatus((*iter_tof)->status());
00131                                 int tofid=(*iter_tof)->tofID();
00132                                 double tof=(*iter_tof)->tof();
00133                                 double texpE=(*iter_tof)->texpElectron();
00134                                 double path=(*iter_tof)->path();
00135                                 double Q=(*iter_tof)->ph();
00136                                 double zrhit=(*iter_tof)->zrhit();
00137 
00138                                 if(status->is_barrel()){
00139                                         h_Bzrhit->Fill(zrhit);
00140                                         h_path->Fill(path);
00141                                         //h_ph->Fill(Q);
00142                                         if(status->is_readout()){
00143                                                 h_ph->Fill(Q);
00144                                                 B_path->Fill(zrhit,path);
00145                                                 if(status->is_east()){                    //barrel readout east
00146                                                         E_delT->Fill(tofid,tof-texpE);
00147                                                         delT_z1->Fill(zrhit,tof-texpE);
00148                                                         E_delT_Q->Fill(Q,tof-texpE);
00149                                                 }
00150                                                 else {                                    //barrel readout west
00151                                                         W_delT->Fill(tofid,tof-texpE);
00152                                                         delT_z2->Fill(zrhit,tof-texpE);
00153                                                         W_delT_Q->Fill(Q,tof-texpE);
00154                                                 }
00155                                         }                                                 //end readout
00156                                         if(!status->is_readout()&&status->is_counter()){  //barrel counter
00157                                                 counter->Fill(tofid,tof-texpE);
00158                                                 delT_z3->Fill(zrhit,tof-texpE);
00159                                         }
00160                                         if(!status->is_counter()&&status->is_cluster()){  //barrel cluster
00161                                                 cluster->Fill(tofid,tof-texpE);
00162                                                 Bt_delT->Fill(tof-texpE);
00163                                                 delT_z4->Fill(zrhit,tof-texpE);
00164                                         }
00165                                 }
00166                                 else{                                                     //endcap
00167                                         E_path->Fill(zrhit,path);
00168                                         h_Ezrhit->Fill(zrhit);
00169                                         EC_delT->Fill(tofid,tof-texpE);
00170                                         Et_delT->Fill(tof-texpE);
00171                                 }
00172                         }                                                                 // loop 7 info fo tof
00173                 }                                                                         // loop every track
00174         }
00175         else{
00176                 for(int i = 0; i < evtRecEvent->totalCharged(); i++){
00177                         EvtRecTrackIterator itTrk=evtRecTrkCol->begin() + i;
00178                         //if ( (*itTrk)->partId() != 1 ) continue; // only e+, e-
00179                         if(!(*itTrk)->isTofTrackValid())continue;
00180                         SmartRefVector<RecTofTrack> tofTrkCol = (*itTrk)->tofTrack();
00181                         SmartRefVector<RecTofTrack>::iterator iter_tof = tofTrkCol.begin();
00182                         for(;iter_tof != tofTrkCol.end(); iter_tof++ ) {
00183                                 TofHitStatus *status = new TofHitStatus;
00184                                 status->setStatus((*iter_tof)->status());
00185                                 if(!status->is_cluster())continue;
00186                                 double tof=(*iter_tof)->tof();
00187                                 double texpPi=(*iter_tof)->texpPion();
00188                                 double texpK=(*iter_tof)->texpKaon();
00189                                 double texpP=(*iter_tof)->texpProton();
00190                                 //if((*itTrk)->partId()==3){  //pi
00191                                 if((*itTrk)->isPion()){
00192                                         double texpPi=(*iter_tof)->texpPion();
00193                                         delT_pi->Fill(tof-texpPi);
00194                                 }
00195                                 //else if((*itTrk)->partId()==4){ //k
00196                                 else if((*itTrk)->isKaon()){
00197                                         double texpK=(*iter_tof)->texpKaon();
00198                                         delT_k->Fill(tof-texpK);
00199                                 }
00200                                 //else if((*itTrk)->partId()==5){ //p
00201                                 else if((*itTrk)->isProton()){
00202                                         double texpP=(*iter_tof)->texpProton();
00203                                         if(!(*itTrk)->isMdcTrackValid())continue;
00204                                         RecMdcTrack *mdcTrk = (*itTrk)->mdcTrack();
00205                                         if(mdcTrk->charge()>0)delT_pp->Fill(tof-texpP);
00206                                         else delT_pm->Fill(tof-texpP);
00207                                 }
00208                         }
00209                 }
00210         }
00211         return StatusCode::SUCCESS;
00212 
00213 }

StatusCode DQA_TOF::finalize (  ) 

Definition at line 215 of file DQA_TOF.cxx.

References Bes_Common::INFO, and msgSvc().

00215                              {
00216         MsgStream log(msgSvc(), name());
00217         log << MSG::INFO << "in finalize()" << endmsg;
00218 
00219         return StatusCode::SUCCESS;
00220 }

StatusCode DQA_TOF::initialize (  ) 

Definition at line 31 of file DQA_TOF.cxx.

References B_path, Bt_delT, cluster, counter, delT_k, delT_pi, delT_pm, delT_pp, delT_z1, delT_z2, delT_z3, delT_z4, E_delT, E_delT_Q, E_path, EC_delT, calibUtil::ERROR, Et_delT, h_Bzrhit, h_Ezrhit, h_path, h_ph, Bes_Common::INFO, m_thsvc, msgSvc(), W_delT, and W_delT_Q.

00031                               {
00032         MsgStream log(msgSvc(), name());
00033 
00034         log << MSG::INFO << "in initialize()" << endmsg;
00035         StatusCode status;
00036 
00037         StatusCode sc=service("THistSvc", m_thsvc);
00038         if(sc.isFailure()) {
00039                 log << MSG::ERROR << "Couldn't get THistSvc" << endreq;
00040                 return StatusCode::FAILURE;
00041         }
00042           
00043         h_path=new TH1F("h_path","barrel ",200,0,200);
00044         if(m_thsvc->regHist("/DQAHist/TOF/h_path",h_path).isFailure()){
00045             log << MSG::ERROR << "Couldn't register h_path" << endreq;
00046         }
00047         h_Bzrhit=new TH1F("h_Bzrhit","barrel z hitmap",240,-120,120);
00048         m_thsvc->regHist("/DQAHist/TOF/h_Bzrhit", h_Bzrhit);
00049         h_Ezrhit=new TH1F("h_Ezrhit","endcap z hitmap",50,40,90);
00050         m_thsvc->regHist("/DQAHist/TOF/h_Ezrhit", h_Ezrhit);
00051         h_ph=new TH1F("h_ph","barrel Q",900,0,9000);
00052         m_thsvc->regHist("/DQAHist/TOF/h_ph", h_ph);
00053         
00054         W_delT=new TH2F("W_delT","barrel west PMT delT",176,0,176,300,-1.5,1.5);
00055         m_thsvc->regHist("/DQAHist/TOF/W_delT", W_delT);
00056         E_delT=new TH2F("E_delT","barrel east PMT delT",176,0,176,300,-1.5,1.5);
00057         m_thsvc->regHist("/DQAHist/TOF/E_delT", E_delT);
00058         counter=new TH2F("counter","barrel counter delT",176,0,176,300,-1.5,1.5);
00059         m_thsvc->regHist("/DQAHist/TOF/counter", counter);
00060         cluster=new TH2F("cluster","barrel cluster delT",88,0,88,300,-1.5,1.5);
00061         m_thsvc->regHist("/DQAHist/TOF/cluster", cluster);
00062         EC_delT=new TH2F("EC_delT","endcap delT",96,0,96,300,-1.5,1.5);
00063         m_thsvc->regHist("/DQAHist/TOF/EC_delT", EC_delT);
00064         Bt_delT=new TH1F("Bt_delT","barrel delT",300,-1.5,1.5);
00065         m_thsvc->regHist("/DQAHist/TOF/Bt_delT", Bt_delT);
00066         Et_delT=new TH1F("Et_delT","endcap delT",300,-1.5,1.5);
00067         m_thsvc->regHist("/DQAHist/TOF/Et_delT", Et_delT);
00068         
00069         B_path=new TH2F("B_path","barrel flight distance vs z",240,-120,120,200,0.0,200.0);
00070         m_thsvc->regHist("/DQAHist/TOF/B_path", B_path);
00071         E_path=new TH2F("E_path","endcap path distance vs z",50,40,90,200,0.0,200.0);
00072         m_thsvc->regHist("/DQAHist/TOF/E_path", E_path);
00073         
00074         delT_z1=new TH2F("delT_z1","barrel east delT vs Z",240,-120,120,300,-1.5,1.5);
00075         m_thsvc->regHist("/DQAHist/TOF/delT_z1", delT_z1);
00076         delT_z2=new TH2F("delT_z2","barrel west delT vs Z",240,-120,120,300,-1.5,1.5);
00077         m_thsvc->regHist("/DQAHist/TOF/delT_z2", delT_z2);
00078         delT_z3=new TH2F("delT_z3","barrel counter delT vs Z",240,-120,120,300,-1.5,1.5);
00079         m_thsvc->regHist("/DQAHist/TOF/delT_z3", delT_z3);
00080         delT_z4=new TH2F("delT_z4","barrel cluster delT vs Z",240,-120,120,300,-1.5,1.5);
00081         m_thsvc->regHist("/DQAHist/TOF/delT_z4", delT_z4);
00082         
00083         W_delT_Q=new TH2F("W_delT_Q","west barrel delT vs Q",900,0,9000,300,-1.5,1.5);
00084         m_thsvc->regHist("/DQAHist/TOF/W_delT_Q", W_delT_Q);
00085         E_delT_Q=new TH2F("E_delT_Q","east barrel delT vs Q",900,0,9000,300,-1.5,1.5);
00086         m_thsvc->regHist("/DQAHist/TOF/E_delT_Q", E_delT_Q);
00087         
00088         delT_pp=new TH1F("delT_pp","proton delT",300,-1.5,1.5);
00089         m_thsvc->regHist("/DQAHist/TOF/delT_pp", delT_pp);
00090         delT_pm=new TH1F("delT_Pm","anti-proton delT",300,-1.5,1.5);
00091         m_thsvc->regHist("/DQAHist/TOF/delT_pm", delT_pm);
00092         delT_pi=new TH1F("delT_pi","pi delT",300,-1.5,1.5);
00093         m_thsvc->regHist("/DQAHist/TOF/delT_pi", delT_pi);
00094         delT_k=new TH1F("delT_k","k delT",300,-1.5,1.5);
00095         m_thsvc->regHist("/DQAHist/TOF/delT_k", delT_k);
00096         log << MSG::INFO << "DQA_TOF successfully return from initialize()" <<endmsg;
00097         return StatusCode::SUCCESS;
00098 }


Member Data Documentation

TH2F* DQA_TOF::B_path [private]

Definition at line 32 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH1F* DQA_TOF::Bt_delT [private]

Definition at line 29 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH2F* DQA_TOF::cluster [private]

Definition at line 27 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH2F* DQA_TOF::counter [private]

Definition at line 26 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH1F* DQA_TOF::delT_k [private]

Definition at line 46 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH1F* DQA_TOF::delT_pi [private]

Definition at line 45 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH1F* DQA_TOF::delT_pm [private]

Definition at line 44 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH1F* DQA_TOF::delT_pp [private]

Definition at line 43 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH2F* DQA_TOF::delT_z1 [private]

Definition at line 35 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH2F* DQA_TOF::delT_z2 [private]

Definition at line 36 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH2F* DQA_TOF::delT_z3 [private]

Definition at line 37 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH2F* DQA_TOF::delT_z4 [private]

Definition at line 38 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH2F* DQA_TOF::E_delT [private]

Definition at line 25 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH2F* DQA_TOF::E_delT_Q [private]

Definition at line 41 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH2F* DQA_TOF::E_path [private]

Definition at line 33 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH2F* DQA_TOF::EC_delT [private]

Definition at line 28 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH1F* DQA_TOF::Et_delT [private]

Definition at line 30 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH1F* DQA_TOF::h_Bzrhit [private]

Definition at line 20 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH1F* DQA_TOF::h_Ezrhit [private]

Definition at line 21 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH1F* DQA_TOF::h_path [private]

Definition at line 19 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH1F* DQA_TOF::h_ph [private]

Definition at line 22 of file DQA_TOF.h.

Referenced by execute(), and initialize().

ITHistSvc* DQA_TOF::m_thsvc [private]

Definition at line 18 of file DQA_TOF.h.

Referenced by initialize().

TH2F* DQA_TOF::W_delT [private]

Definition at line 24 of file DQA_TOF.h.

Referenced by execute(), and initialize().

TH2F* DQA_TOF::W_delT_Q [private]

Definition at line 40 of file DQA_TOF.h.

Referenced by execute(), and initialize().


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