BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcNavigation Class Reference

#include <MdcNavigation.h>

+ Inheritance diagram for MdcNavigation:

Public Member Functions

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

Detailed Description

Constructor & Destructor Documentation

◆ MdcNavigation() [1/2]

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

Definition at line 44 of file MdcNavigation.cxx.

44 :
45 Algorithm(name, pSvcLocator) {
46 declareProperty("hist", m_hist = 0);
47 declareProperty("nMcHit", m_nMcHit= 5);
48 declareProperty("mc", m_mc = 1);
49
50 declareProperty("maxMdcDigi", m_maxMdcDigi= 0);
51 declareProperty("keepBadTdc", m_keepBadTdc= 0);
52 declareProperty("dropHot", m_dropHot= 0);
53 declareProperty("keepUnmatch", m_keepUnmatch= 0);
54
55 declareProperty("poca", m_poca = false);
56 declareProperty("doSag", m_doSag = false);
57
58 declareProperty("d0Cut", m_d0Cut= 1.);
59 declareProperty("z0Cut", m_z0Cut= 10.);
60 declareProperty("debug", m_debug = 0);
61
62 }

◆ MdcNavigation() [2/2]

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

Member Function Documentation

◆ beginRun() [1/2]

StatusCode MdcNavigation::beginRun ( )

Definition at line 114 of file MdcNavigation.cxx.

114 {
115 MsgStream log(msgSvc(), name());
116 log << MSG::INFO << "in beginRun()" << endreq;
117
118 m_gm = MdcDetector::instance(m_doSag);
119 if(NULL == m_gm) return StatusCode::FAILURE;
120
121 return StatusCode::SUCCESS;
122}
static MdcDetector * instance()
Definition: MdcDetector.cxx:21

◆ beginRun() [2/2]

StatusCode MdcNavigation::beginRun ( )

◆ execute() [1/2]

StatusCode MdcNavigation::execute ( )

Definition at line 126 of file MdcNavigation.cxx.

126 {
127 setFilterPassed(false);
128 MsgStream log(msgSvc(), name());
129 StatusCode sc = StatusCode::SUCCESS;
130
131 // Get EventNavigator from the TDS
132 SmartDataPtr<EventNavigator> navigator (eventSvc(),"/Event/Navigator");
133 if( ! navigator ) {
134 log << MSG::WARNING<< " Unable to retrieve EventNavigator" << endreq;
135 m_rawData = true;
136 }
137 SmartDataPtr<RecMdcTrackCol> recMdcTrackCol(eventSvc(), "/Event/Recon/RecMdcTrackCol");
138 SmartDataPtr<RecMdcHitCol> recMdcHitCol(eventSvc(), "/Event/Recon/RecMdcHitCol");
139
140 // get eventNo, t0 and MdcDigi
141 if(m_hist){
142 sc = fillInit();
143 if ( sc!=StatusCode::SUCCESS ) {
144 return StatusCode::FAILURE;
145 }
146 }
147 if (m_mc){
148 // Get McParticleCol
149 SmartDataPtr<Event::McParticleCol> mcParticles(eventSvc(),"/Event/MC/McParticleCol");
150 SmartDataPtr<Event::MdcMcHitCol> mcHit(eventSvc(),"/Event/MC/MdcMcHitCol");
151 if( ! mcParticles ) {
152 log << MSG::WARNING<< " Unable to retrieve McParticleCol" << endreq;
153 }else{
154 // For each McParticle ...
155 t_mcTkNum = 0;
156 McParticleCol::iterator it= mcParticles->begin();
157 log <<MSG::INFO << "mcParticles size = "<<mcParticles->size() << endreq;//yzhang debug
158 for(; it!= mcParticles->end(); it++ ) {
159 //int tkId = (*it)->trackIndex();
160 t_mcTkNum++;
161 }
162 }
163 }
164 t_mcTkNum = 0;
165 t_recTkNum = 0;
166 //for each rec track
167
168 if (!recMdcTrackCol){
169 log << MSG::WARNING<< " Unable to retrieve recMdcTrackCol" << endreq;
170 return StatusCode::SUCCESS;
171 }
172 t_recTkNum = recMdcTrackCol->size();
173
174 //=============loop over tracks==============
175 RecMdcTrackCol::iterator it = recMdcTrackCol->begin();
176 for(;it != recMdcTrackCol->end(); it++ ) {
177 if ( m_mc && navigator ) {
178 McParticleVector particles = navigator->getMcParticles(*it);
179 t_mcTkNum = particles.size();
180 RecMdcTrackVector tracks = navigator->getMdcTracks(particles[0]);
181 // for FIRST parent particle
182 if ( sc!=StatusCode::SUCCESS ) return StatusCode::FAILURE;
183 }
184 sc = fillRecTrack(*it, t_mcTkNum, t_recTkNum);
185 t_nTk++;
186 if ( sc!=StatusCode::SUCCESS ) return StatusCode::FAILURE;
187 }//end of loop over tracks
188
189 //=============loop over hits==============
190 fillRecHits(*recMdcHitCol);
191
192
193 if(m_hist){fillEvent();}
194
195 return StatusCode::SUCCESS;
196}
std::vector< const RecMdcTrack * > RecMdcTrackVector
std::vector< const Event::McParticle * > McParticleVector

◆ execute() [2/2]

StatusCode MdcNavigation::execute ( )

◆ finalize() [1/2]

StatusCode MdcNavigation::finalize ( )

Definition at line 200 of file MdcNavigation.cxx.

200 {
201 MsgStream log(msgSvc(), name());
202 log << MSG::INFO << "in finalize()" << endreq;
203 std::cout<< "nTk == "<<t_nTk << std::endl;//yzhang debug
204 delete keepedParticles; //FIXME
205 return StatusCode::SUCCESS;
206}

◆ finalize() [2/2]

StatusCode MdcNavigation::finalize ( )

◆ initialize() [1/2]

StatusCode MdcNavigation::initialize ( )

Definition at line 67 of file MdcNavigation.cxx.

67 {
68 MsgStream log(msgSvc(), name());
69 StatusCode sc = StatusCode::SUCCESS;
70
71 t_nTk = 0;
72 //Initailize magnetic filed
73 sc = service ("MagneticFieldSvc",m_pIMF);
74 if(sc!=StatusCode::SUCCESS) {
75 log << MSG::ERROR << "Unable to open Magnetic field service"<<endreq;
76 return StatusCode::FAILURE;
77 }
78
79
80 // Get the Particle Properties Service
81 IPartPropSvc* p_PartPropSvc;
82 static const bool CREATEIFNOTTHERE(true);
83 sc = service("PartPropSvc", p_PartPropSvc, CREATEIFNOTTHERE);
84 if (!sc.isSuccess() || 0 == p_PartPropSvc) {
85 log << MSG::ERROR << " Could not initialize PartPropSvc" << endreq;
86 return sc;
87 }
88
89 m_particleTable = p_PartPropSvc->PDT();
90
91 IRawDataProviderSvc* irawDataProviderSvc;
92 sc = service ("RawDataProviderSvc", irawDataProviderSvc);
93 m_rawDataProviderSvc = dynamic_cast<RawDataProviderSvc*> (irawDataProviderSvc);
94 if ( sc.isFailure() ){
95 log << MSG::FATAL << "Could not load RawDataProviderSvc!" << endreq;
96 return StatusCode::FAILURE;
97 }
98
99
100 if (m_hist){
101 sc = bookNTuple();
102 if (!sc.isSuccess()) {
103 log << MSG::WARNING << " Could not book NTuple" << endreq;
104 m_hist = 0;
105 }
106 }
107
108 keepedParticles = new int(211);
109
110
111 return StatusCode::SUCCESS;
112}

◆ initialize() [2/2]

StatusCode MdcNavigation::initialize ( )

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