BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
ValidRecMucTrackAlg Class Reference

#include <ValidRecMucTrackAlg.h>

+ Inheritance diagram for ValidRecMucTrackAlg:

Public Member Functions

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

Detailed Description

Definition at line 15 of file ValidRecMucTrackAlg.h.

Constructor & Destructor Documentation

◆ ValidRecMucTrackAlg()

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

Definition at line 9 of file ValidRecMucTrackAlg.cxx.

9 :
10 Algorithm(name, pSvcLocator) {
11
12 m_tuple1 = 0;
13}

Member Function Documentation

◆ execute()

StatusCode ValidRecMucTrackAlg::execute ( )

Definition at line 52 of file ValidRecMucTrackAlg.cxx.

52 {
53 MsgStream log(msgSvc(), name());
54 SmartDataPtr<RecMucTrackCol> mucTracks(eventSvc(),"/Event/Recon/RecMucTrackCol");
55 if( ! mucTracks )
56 {
57 log << MSG::ERROR << "Unable to retrieve RecMucTrackCol" << endreq;
58 return StatusCode::FAILURE;
59 } else {
60 log << MSG::DEBUG << "RecMucTrackCol retrieved of size "<< mucTracks->size() << endreq;
61 for(RecMucTrackCol::iterator it=mucTracks->begin(); it!=mucTracks->end(); it++)
62 {
63
64 m_depth = (*it)->depth();
65 m_distance = (*it)->distance();
66 m_deltaPhi = (*it)->deltaPhi();
67 m_maxHits = (*it)->maxHitsInLayer();
68 m_numLayers= (*it)->numLayers();
69 m_numHits = (*it)->numHits();
70 m_chi2 = (*it)->chi2();
71 m_xPos = (*it)->xPos();
72 m_yPos = (*it)->yPos();
73 m_zPos = (*it)->zPos();
74
75 StatusCode status1 = m_tuple1->write();
76 if ( status1.isFailure() ) {
77 log << MSG::ERROR << "Cannot fill Ntuple1" << endreq;
78 }
79 }
80 }
81 return StatusCode::SUCCESS;
82}
IMessageSvc * msgSvc()

◆ finalize()

StatusCode ValidRecMucTrackAlg::finalize ( )

Definition at line 85 of file ValidRecMucTrackAlg.cxx.

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

◆ initialize()

StatusCode ValidRecMucTrackAlg::initialize ( )

Definition at line 15 of file ValidRecMucTrackAlg.cxx.

15 {
16
17 StatusCode status;
18 MsgStream log( msgSvc(), name() );
19 log << MSG::INFO << "Booking Histograms" << endreq;
20
21 // Book N-tuple 1
22 NTuplePtr nt1(ntupleSvc(), "FILE105/T");
23 if ( nt1 ) m_tuple1 = nt1;
24 else {
25 m_tuple1 = ntupleSvc()->book ("FILE105/T", CLID_RowWiseTuple, "MucTrack parameter");
26 if ( m_tuple1 ) {
27 status = m_tuple1->addItem("depth",m_depth);
28 status = m_tuple1->addItem("distance",m_distance);
29 status = m_tuple1->addItem("deltaPhi",m_deltaPhi);
30 status = m_tuple1->addItem("maxHits",m_maxHits);
31 status = m_tuple1->addItem("numLayers",m_numLayers);
32 status = m_tuple1->addItem("numHits",m_numHits);
33 status = m_tuple1->addItem("chi2",m_chi2);
34 status = m_tuple1->addItem("xPos",m_xPos);
35 status = m_tuple1->addItem("yPos",m_yPos);
36 status = m_tuple1->addItem("zPos",m_zPos);
37 }
38 else { // did not manage to book the N tuple....
39 log << MSG::ERROR << " Cannot book N-tuple:" << long(m_tuple1) << endmsg;
40 //return StatusCode::FAILURE;
41 }
42 }
43 log << MSG::INFO << "Finished booking NTuples" << endmsg;
44
45
46 return StatusCode::SUCCESS;
47
48
49}
INTupleSvc * ntupleSvc()

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