BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
ValidRecMdcDedxAlg Class Reference

#include <ValidRecMdcDedxAlg.h>

+ Inheritance diagram for ValidRecMdcDedxAlg:

Public Member Functions

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

Detailed Description

Constructor & Destructor Documentation

◆ ValidRecMdcDedxAlg() [1/2]

ValidRecMdcDedxAlg::ValidRecMdcDedxAlg ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 11 of file ValidRecMdcDedxAlg.cxx.

11 :
12 Algorithm(name, pSvcLocator) {
13
14 m_tuple1 = 0;
15
16 }

◆ ValidRecMdcDedxAlg() [2/2]

ValidRecMdcDedxAlg::ValidRecMdcDedxAlg ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Member Function Documentation

◆ execute() [1/2]

StatusCode ValidRecMdcDedxAlg::execute ( )

Definition at line 49 of file ValidRecMdcDedxAlg.cxx.

49 {
50 MsgStream log(msgSvc(), name());
51 SmartDataPtr<RecMdcDedxCol> mdcDedx(eventSvc(),"/Event/Recon/RecMdcDedxCol");
52 if( ! mdcDedx )
53 {
54 log << MSG::ERROR << "Unable to retrieve RecMdcDedxCol" << endreq;
55 return StatusCode::FAILURE;
56 } else {
57 log << MSG::DEBUG << "RecMdcDedxCol retrieved of size "<< mdcDedx->size() << endreq;
58 int i = 0;
59 for(RecMdcDedxCol::iterator it=mdcDedx->begin(); it!=mdcDedx->end(); it++,i++)
60 { m_dedx = (*it)->probPH();
61 pid_dedx m_pid_dedx = (*it)->particleType();
62 m_parttype = (int)m_pid_dedx;
63 //cout<<"m_parttype is = "<<m_parttype<<endl;
64 if((m_pid_dedx != electron) && (m_pid_dedx != muon) && (m_pid_dedx != pion)&& (m_pid_dedx != kaon)&& (m_pid_dedx != proton) ) continue;
65 m_chidedx = (*it)->chi(m_parttype);
66 m_chidedxE = (*it)->chiE();
67 m_chidedxMu = (*it)->chiMu();
68 m_chidedxPi = (*it)->chiPi();
69 m_chidedxK = (*it)->chiK();
70 m_chidedxP = (*it)->chiP();
71
72 log << MSG::INFO << "particle chi="<< m_chidedx <<endreq;
73 log << MSG::INFO << "m_dedx="<<m_dedx<<endreq;
74 log << MSG::INFO << " m_parttype="<< m_parttype<<endreq;
75 StatusCode status1 = m_tuple1->write();
76 if ( status1.isFailure() ) {
77 log << MSG::ERROR << "Cannot fill Ntuple1" << endreq;
78 }
79
80 }
81 }
82 return StatusCode::SUCCESS;
83}

◆ execute() [2/2]

StatusCode ValidRecMdcDedxAlg::execute ( )

◆ finalize() [1/2]

StatusCode ValidRecMdcDedxAlg::finalize ( )

Definition at line 86 of file ValidRecMdcDedxAlg.cxx.

86 {
87
88 MsgStream log(msgSvc(), name());
89 log << MSG::INFO << "Finalizing..." << endreq;
90
91}

◆ finalize() [2/2]

StatusCode ValidRecMdcDedxAlg::finalize ( )

◆ initialize() [1/2]

StatusCode ValidRecMdcDedxAlg::initialize ( )

Definition at line 18 of file ValidRecMdcDedxAlg.cxx.

18 {
19 StatusCode status;
20 MsgStream log( msgSvc(), name() );
21
22 // Book N-tuple 1
23 NTuplePtr nt1(ntupleSvc(), "DedxTuples/Mdc_dedx");
24 if ( nt1 ) m_tuple1 = nt1;
25 else {
26 m_tuple1 = ntupleSvc()->book ("DedxTuples/Mdc_dedx", CLID_RowWiseTuple, "Dedx parameter");
27 if ( m_tuple1 ) {
28 status = m_tuple1->addItem("dedx",m_dedx);
29 status = m_tuple1->addItem("parttype",m_parttype);
30 status = m_tuple1->addItem("chidedx",m_chidedx);
31 status = m_tuple1->addItem("chidedxE",m_chidedxE);
32 status = m_tuple1->addItem("chidedxMu",m_chidedxMu);
33 status = m_tuple1->addItem("chidedxPi",m_chidedxPi);
34 status = m_tuple1->addItem("chidedxK",m_chidedxK);
35 status = m_tuple1->addItem("chidedxP",m_chidedxP);
36 }
37 else { // did not manage to book the N tuple....
38 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple1) << endmsg;
39 return StatusCode::FAILURE;
40 }
41 }
42 log << MSG::INFO << "Finished booking NTuples" << endmsg;
43 return StatusCode::SUCCESS;
44
45
46}

◆ initialize() [2/2]

StatusCode ValidRecMdcDedxAlg::initialize ( )

The documentation for this class was generated from the following files: