BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
DsReconstruction Class Reference

#include <DsReconstruction.h>

+ Inheritance diagram for DsReconstruction:

Public Member Functions

 DsReconstruction (const std::string &name, ISvcLocator *pSvcLocator)
 
StatusCode initialize ()
 
StatusCode execute ()
 
StatusCode finalize ()
 
void saveDsInfo (CDDecayList::iterator, double, int, EvtRecDTag *)
 
void savetrack (vector< int >, vector< int >, EvtRecTrackIterator, EvtRecTrackIterator, EvtRecTrackIterator, EvtRecTrackIterator, EvtRecDTag *)
 
vector< string > getlist (string &filename)
 
void pidtag (vector< int >, vector< int >, CDChargedKaonList &, CDChargedPionList &, EvtRecDTag *)
 

Detailed Description

Definition at line 21 of file DsReconstruction.h.

Constructor & Destructor Documentation

◆ DsReconstruction()

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

Definition at line 54 of file DsReconstruction.cxx.

54 :
55Algorithm(name, pSvcLocator) {
56 //Declare the properties
57 declareProperty( "debug", m_debug = false );
58 declareProperty( "ReadBeamEFromDB", m_ReadBeamEFromDB = false );
59 declareProperty( "UseCalibBeamE", m_usecalibBeamE = false );
60 declareProperty( "BeamE", m_beamE=2.015 );
61 declareProperty( "DsList", m_decaylist = "test.txt" );
62}

Member Function Documentation

◆ execute()

StatusCode DsReconstruction::execute ( )

Definition at line 99 of file DsReconstruction.cxx.

99 {
100 MsgStream log(msgSvc(), name());
101 log << MSG::INFO << "in execute()" << endreq;
102
103 StatusCode sc;
104
105 //////////////////
106 // Read REC data
107 /////////////////
108 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
109 int event= eventHeader->eventNumber();
110 // if ( m_debug || ( (event & 0x3FF) == 0 ) )
111 //std::cout << "event: " << event << std::endl;
112
113 SmartDataPtr<EvtRecEvent> recEvent(eventSvc(), EventModel::EvtRec::EvtRecEvent);
114 SmartDataPtr<EvtRecTrackCol> recTrackCol(eventSvc(), EventModel::EvtRec::EvtRecTrackCol);
115 log << MSG::DEBUG << "run and event = " << eventHeader->runNumber()
116 << " " << eventHeader->eventNumber() << endreq;
117 log << MSG::DEBUG <<"ncharg, nneu, tottks = "
118 << recEvent->totalCharged() << " , "
119 << recEvent->totalNeutral() << " , "
120 << recEvent->totalTracks() <<endreq;
121
122 EvtRecTrackIterator charged_begin = recTrackCol->begin();
123 EvtRecTrackIterator charged_end = charged_begin + recEvent->totalCharged();
124
125 EvtRecTrackIterator neutral_begin = recTrackCol->begin()+recEvent->totalCharged();
126 EvtRecTrackIterator neutral_end = recTrackCol->begin()+recEvent->totalTracks();
127
128
129 SmartDataPtr<EvtRecPi0Col> recPi0Col(eventSvc(), "/Event/EvtRec/EvtRecPi0Col");
130 if ( ! recPi0Col ) {
131 log << MSG::FATAL << "Could not find EvtRecPi0Col" << endreq;
132 return StatusCode::FAILURE;
133 }
134
135 SmartDataPtr<EvtRecEtaToGGCol> recEtaToGGCol(eventSvc(), "/Event/EvtRec/EvtRecEtaToGGCol");
136 if ( ! recEtaToGGCol ) {
137 log << MSG::FATAL << "Could not find EvtRecEtaToGGCol" << endreq;
138 return StatusCode::FAILURE;
139 }
140
141
142 SmartDataPtr<EvtRecVeeVertexCol> recVeeVertexCol(eventSvc(), "/Event/EvtRec/EvtRecVeeVertexCol");
143 if ( ! recVeeVertexCol ) {
144 log << MSG::FATAL << "Could not find EvtRecVeeVertexCol" << endreq;
145 return StatusCode::FAILURE;
146 }
147
148
149 SmartDataPtr<EvtRecDTagCol> recDTagCol(eventSvc(), EventModel::EvtRec::EvtRecDTagCol);
150 if (!recDTagCol) {
151 log << MSG::FATAL << "EvtRecDTagCol is not registered yet" << endreq;
152 return StatusCode::FAILURE;
153 }
154 //registered in DTag.cxx
155 /*
156 if (!recDTagCol) {
157 recDTagCol = new EvtRecDTagCol;
158 sc = registerEvtRecDTagCol(recDTagCol, log);
159 if (sc != StatusCode::SUCCESS) {
160 return sc;
161 }
162 }
163 */
164
165
166 /////////////////////////////
167 //reconstruct particle lists
168 /////////////////////////////
169
172 CDChargedPionList pionList(charged_begin, charged_end, pionSelector);
173 CDChargedKaonList kaonList(charged_begin, charged_end, kaonSelector);
174 CDPhotonList photonList(neutral_begin, neutral_end, photonSelector);
175 CDKsList ksList(ksSelector);
176 dc_fill(ksList, recVeeVertexCol->begin(), recVeeVertexCol->end());
177
178 CDPi0List pi0List(pi0Selector);
179 dc_fill(pi0List, recPi0Col->begin(), recPi0Col->end());
180
181 CDEtaList etaList(etatoGGSelector);
182 dc_fill(etaList, recEtaToGGCol->begin(), recEtaToGGCol->end());
183
184 //pion/kaon list with PID
187 CDChargedPionList pionList_tight(charged_begin, charged_end, pionSelector);
188 CDChargedKaonList kaonList_tight(charged_begin, charged_end, kaonSelector);
189
190
191 int run = eventHeader->runNumber();
192 m_ievt = eventHeader->eventNumber();
193 m_nChrg = recEvent->totalCharged();
194 m_nNeu = recEvent->totalNeutral();
195 m_nPion = pionList.size();
196 m_nKaon = kaonList.size();
197 m_nPi0 = pi0List.size();
198 m_nKs = ksList.size();
199
200
201 ///////////////////////
202 // get beam energy and beta
203 ///////////////////////
204
205 if(m_ReadBeamEFromDB && m_irun!=run){
206 m_irun=run;
207 if(m_usecalibBeamE)
208 m_readDb.setcalib(true);
209 m_beamE=m_readDb.getbeamE(m_irun,m_beamE);
210 if(run>0)
211 m_beta=m_readDb.getbeta();
212 //cout<<"use beam E from data base:"<<m_beamE<<endl;
213 }
214 double ebeam=m_beamE;
215
216 //////////////////////////////
217 //reconstruct decay lists
218 /////////////////////////////
219
220
221 for(int list=0;list<chanlist.size();list++){
222
223 string channel=chanlist[list];
224 vector<int> numchan;
225 dsSelector.setebeam(ebeam);
226 dsSelector.setbeta(m_beta);
227 CDDecayList decaylist(dsSelector);
228
229 //K+/-: 1, Pi+/-:2, Pi0:3, Eta: 4, Ks:5, eta'(pipieta):6, eta'(rhogamma):7
230 //the fist element of the vector stands for decay mode,
231 //the rest will be particles, and size of the vector minus 1 will be number of daughers.
232
233 if(channel=="DstoKsK") {
234 numchan.push_back( EvtRecDTag::kDstoKsK );
235 numchan.push_back(5);
236 numchan.push_back(1);
237 decaylist=ksList* kaonList.plus();
238 }
239 else if(channel=="DstoKKPi") {
240 numchan.push_back( EvtRecDTag::kDstoKKPi );
241 numchan.push_back(1);
242 numchan.push_back(1);
243 numchan.push_back(2);
244 decaylist=kaonList.minus()* kaonList.plus()* pionList.plus();
245 }
246 else if(channel=="DstoKsKPi0") {
247 numchan.push_back( EvtRecDTag::kDstoKsKPi0 );
248 numchan.push_back(5);
249 numchan.push_back(1);
250 numchan.push_back(3);
251 decaylist=ksList* kaonList.plus()* pi0List;
252 }
253 else if(channel=="DstoKsKsPi") {
254 numchan.push_back( EvtRecDTag::kDstoKsKsPi );
255 numchan.push_back(5);
256 numchan.push_back(5);
257 numchan.push_back(2);
258 decaylist=ksList* ksList* pionList.plus();
259 }
260 else if(channel=="DstoKKPiPi0") {
261 numchan.push_back( EvtRecDTag::kDstoKKPiPi0 );
262 numchan.push_back(1);
263 numchan.push_back(1);
264 numchan.push_back(2);
265 numchan.push_back(3);
266 decaylist=kaonList.minus()* kaonList.plus()* pionList.plus()* pi0List;
267 }
268 else if(channel=="DstoKsKplusPiPi") {
269 numchan.push_back( EvtRecDTag::kDstoKsKplusPiPi );
270 numchan.push_back(5);
271 numchan.push_back(1);
272 numchan.push_back(2);
273 numchan.push_back(2);
274 decaylist=ksList* kaonList.plus()* pionList.plus()* pionList.minus();
275 }
276 else if(channel=="DstoKsKminusPiPi") {
277 numchan.push_back( EvtRecDTag::kDstoKsKminusPiPi );
278 numchan.push_back(5);
279 numchan.push_back(1);
280 numchan.push_back(2);
281 numchan.push_back(2);
282 decaylist=ksList* kaonList.minus()* pionList.plus()* pionList.plus();
283 }
284 else if(channel=="DstoKKPiPiPi") {
285 numchan.push_back( EvtRecDTag::kDstoKKPiPiPi );
286 numchan.push_back(1);
287 numchan.push_back(1);
288 numchan.push_back(2);
289 numchan.push_back(2);
290 numchan.push_back(2);
291 decaylist=kaonList.minus()* kaonList.plus()* pionList.plus()* pionList.plus()* pionList.minus();
292 }
293 else if(channel=="DstoPiPi0") {
294 numchan.push_back( EvtRecDTag::kDstoPiPi0 );
295 numchan.push_back(2);
296 numchan.push_back(3);
297 decaylist=pionList.plus()* pi0List;
298 }
299 else if(channel=="DstoPiPiPi") {
300 numchan.push_back( EvtRecDTag::kDstoPiPiPi );
301 numchan.push_back(2);
302 numchan.push_back(2);
303 numchan.push_back(2);
304 decaylist=pionList.plus()* pionList.plus()* pionList.minus();
305 }
306 else if(channel=="DstoPiPiPiPi0") {
307 numchan.push_back( EvtRecDTag::kDstoPiPiPiPi0 );
308 numchan.push_back(2);
309 numchan.push_back(2);
310 numchan.push_back(2);
311 numchan.push_back(3);
312 decaylist=pionList.plus()* pionList.plus()* pionList.minus()* pi0List;
313 }
314 else if(channel=="DstoPiPiPiPiPi") {
315 numchan.push_back( EvtRecDTag::kDstoPiPiPiPiPi );
316 numchan.push_back(2);
317 numchan.push_back(2);
318 numchan.push_back(2);
319 numchan.push_back(2);
320 numchan.push_back(2);
321 decaylist=pionList.plus()* pionList.plus()* pionList.plus()* pionList.minus()* pionList.minus();
322 }
323 else if(channel=="DstoPiPiPiPiPiPi0") {
324 numchan.push_back( EvtRecDTag::kDstoPiPiPiPiPiPi0 );
325 numchan.push_back(2);
326 numchan.push_back(2);
327 numchan.push_back(2);
328 numchan.push_back(2);
329 numchan.push_back(2);
330 numchan.push_back(3);
331 decaylist=pionList.plus()* pionList.plus()* pionList.plus()* pionList.minus()* pionList.minus()* pi0List;
332 }
333 else if(channel=="DstoPiEta") {
334 numchan.push_back( EvtRecDTag::kDstoPiEta );
335 numchan.push_back(2);
336 numchan.push_back(4);
337 decaylist=pionList.plus()* etaList;
338 }
339 else if(channel=="DstoPiPi0Eta") {
340 numchan.push_back( EvtRecDTag::kDstoPiPi0Eta );
341 numchan.push_back(2);
342 numchan.push_back(3);
343 numchan.push_back(4);
344 decaylist=pionList.plus()* pi0List* etaList;
345 }
346 else if(channel=="DstoPiPiPiEta") {
347 numchan.push_back( EvtRecDTag::kDstoPiPiPiEta );
348 numchan.push_back(2);
349 numchan.push_back(2);
350 numchan.push_back(2);
351 numchan.push_back(4);
352 decaylist=pionList.plus()* pionList.plus()* pionList.minus()* etaList;
353 }
354 else if(channel=="DstoPiEPPiPiEta") {
355 numchan.push_back( EvtRecDTag::kDstoPiEPPiPiEta );
356 numchan.push_back(2);
357 numchan.push_back(6);
359 epList=pionList.plus()* pionList.minus()* etaList;
360 decaylist=pionList.plus()* epList;
361 }
362 else if(channel=="DstoPiPi0EPPiPiEta") {
363 numchan.push_back( EvtRecDTag::kDstoPiPi0EPPiPiEta );
364 numchan.push_back(2);
365 numchan.push_back(3);
366 numchan.push_back(6);
368 epList=pionList.plus()* pionList.minus()* etaList;
369 decaylist=pionList.plus()* pi0List* epList;
370 }
371 else if(channel=="DstoPiEPRhoGam") {
372 numchan.push_back( EvtRecDTag::kDstoPiEPRhoGam );
373 numchan.push_back(2);
374 numchan.push_back(7);
376 rhoList=pionList.plus()* pionList.minus();
378 epList=rhoList* photonList;
379 decaylist=pionList.plus()* epList;
380 }
381 else if(channel=="DstoPiPi0EPRhoGam") {
382 numchan.push_back( EvtRecDTag::kDstoPiPi0EPRhoGam );
383 numchan.push_back(2);
384 numchan.push_back(3);
385 numchan.push_back(7);
387 rhoList=pionList.plus()* pionList.minus();
389 epList=rhoList* photonList;
390 decaylist=pionList.plus()* pi0List* epList;
391 }
392 else if(channel=="DstoKsPi") {
393 numchan.push_back( EvtRecDTag::kDstoKsPi );
394 numchan.push_back(5);
395 numchan.push_back(2);
396 decaylist=ksList* pionList.plus();
397 }
398 else if(channel=="DstoKsPiPi0") {
399 numchan.push_back( EvtRecDTag::kDstoKsPiPi0 );
400 numchan.push_back(5);
401 numchan.push_back(2);
402 numchan.push_back(3);
403 decaylist=ksList* pionList.plus()* pi0List;
404 }
405 else if(channel=="DstoKPiPi") {
406 numchan.push_back( EvtRecDTag::kDstoKPiPi );
407 numchan.push_back(1);
408 numchan.push_back(2);
409 numchan.push_back(2);
410 decaylist=kaonList.plus()* pionList.plus()* pionList.minus();
411 }
412 else if(channel=="DstoKPiPiPi0") {
413 numchan.push_back( EvtRecDTag::kDstoKPiPiPi0 );
414 numchan.push_back(1);
415 numchan.push_back(2);
416 numchan.push_back(2);
417 numchan.push_back(3);
418 decaylist=kaonList.plus()* pionList.plus()* pionList.minus()* pi0List;
419 }
420 else if(channel=="DstoKKK") {
421 numchan.push_back( EvtRecDTag::kDstoKKK );
422 numchan.push_back(1);
423 numchan.push_back(1);
424 numchan.push_back(1);
425 decaylist=kaonList.minus()* kaonList.plus()* kaonList.plus();
426 }
427
428 CDDecayList::iterator D_begin =decaylist.particle_begin();
429 CDDecayList::iterator D_end =decaylist.particle_end();
430
431 for ( CDDecayList::iterator it = D_begin; it != D_end; it++ ) {
432
433 EvtRecDTag* recDTag = new EvtRecDTag;
434 recDTag->setdecayMode( (EvtRecDTag::DecayMode)numchan[0] );
435
436 vector<int> trackid, showerid;
437 vector<int> kaonid, pionid;
438 int numofchildren=numchan.size()-1;
439
440 for(int i=0; i< numofchildren;i++){
441
442 const CDCandidate& daughter=(*it).particle().child(i);
443
444 if(numchan[i+1]==1){
445 const EvtRecTrack* track=daughter.track();
446 trackid.push_back(track->trackId());
447 kaonid.push_back(track->trackId());
448 }
449 else if(numchan[i+1]==2){
450 const EvtRecTrack* track=daughter.track();
451 trackid.push_back(track->trackId());
452 pionid.push_back(track->trackId());
453 }
454 else if ( numchan[i+1]==3){
455 const EvtRecTrack* hiEnGamma=daughter.navPi0()->hiEnGamma();
456 const EvtRecTrack* loEnGamma=daughter.navPi0()->loEnGamma();
457 showerid.push_back(hiEnGamma->trackId());
458 showerid.push_back(loEnGamma->trackId());
459 }
460 else if ( numchan[i+1]==4){
461 const EvtRecTrack* hiEnGamma=daughter.navEta()->hiEnGamma();
462 const EvtRecTrack* loEnGamma=daughter.navEta()->loEnGamma();
463 showerid.push_back(hiEnGamma->trackId());
464 showerid.push_back(loEnGamma->trackId());
465 }
466 else if ( numchan[i+1]==5){
467 EvtRecVeeVertex* aKsCand = const_cast<EvtRecVeeVertex*>( daughter.navKshort() );
468 EvtRecTrack* pion1Trk = aKsCand->daughter(0);
469 EvtRecTrack* pion2Trk = aKsCand->daughter(1);
470 trackid.push_back(pion1Trk->trackId());
471 trackid.push_back(pion2Trk->trackId());
472 }
473 else if (numchan[i+1]==6){
474 const CDCandidate& apion = daughter.decay().child(0);
475 const CDCandidate& spion = daughter.decay().child(1);
476 const CDCandidate& eta = daughter.decay().child(2);
477 const EvtRecTrack* apiontrk = apion.track();
478 const EvtRecTrack* spiontrk = spion.track();
479 const EvtRecTrack* hiEnGamma=eta.navEta()->hiEnGamma();
480 const EvtRecTrack* loEnGamma=eta.navEta()->loEnGamma();
481
482 trackid.push_back(apiontrk->trackId());
483 trackid.push_back(spiontrk->trackId());
484 showerid.push_back(hiEnGamma->trackId());
485 showerid.push_back(loEnGamma->trackId());
486
487 }
488 else if (numchan[i+1]==7){
489 const CDCandidate& rho = daughter.decay().child(0);
490 const CDCandidate& apion = rho.decay().child(0);
491 const CDCandidate& spion = rho.decay().child(1);
492 const CDCandidate& gamma = daughter.decay().child(1);
493
494 const EvtRecTrack* apiontrk = apion.track();
495 const EvtRecTrack* spiontrk = spion.track();
496 const EvtRecTrack* gammatrk = gamma.photon();
497
498
499 trackid.push_back(apiontrk->trackId());
500 trackid.push_back(spiontrk->trackId());
501 showerid.push_back(gammatrk->trackId());
502
503 }
504
505
506 }//end of filling track and shower ids
507
508
509 saveDsInfo(it, ebeam, numofchildren, recDTag);
510 savetrack(trackid,showerid,charged_begin,charged_end,neutral_begin,neutral_end,recDTag);
511 pidtag(kaonid,pionid,kaonList_tight, pionList_tight,recDTag);
512
513 trackid.clear();
514 showerid.clear();
515 kaonid.clear();
516 pionid.clear();
517
518
519
520 //write dtag object out
521 recDTagCol->push_back(recDTag);
522
523 }//end of decaylist iterator
524
525 numchan.clear();
526
527 }//end of reconstrucing all D+ decay lists
528
529
530
531 return StatusCode::SUCCESS;
532}
void dc_fill(DCFillableChargedList< Charged > &aFillableList, WitnessIterator first, WitnessIterator last)
DsSelector dsSelector
Definition: DsSelector.cxx:55
EvtRecTrackCol::iterator EvtRecTrackIterator
Definition: EvtRecTrack.h:111
LocalEptoPiPiEtaSelector eptoPiPiEtaSelector
LocalEptoRhoGamSelector eptoRhoGamSelector
LocalEtatoGGSelector etatoGGSelector
LocalKaonSelector kaonSelector
LocalKsSelector ksSelector
LocalPhotonSelector photonSelector
LocalPi0Selector pi0Selector
LocalPionSelector pionSelector
LocalRhotoPiPiSelector rhotoPiPiSelector
IMessageSvc * msgSvc()
virtual const DecayEvidence & decay() const
virtual const EvtRecTrack * photon() const
virtual const EvtRecTrack * track() const
virtual const EvtRecVeeVertex * navKshort() const
virtual const EvtRecPi0 * navPi0() const
virtual const EvtRecEtaToGG * navEta() const
const CDCandidate & child(unsigned int aPosition) const
Definition: CDDecay.cxx:247
void savetrack(vector< int >, vector< int >, EvtRecTrackIterator, EvtRecTrackIterator, EvtRecTrackIterator, EvtRecTrackIterator, EvtRecDTag *)
void pidtag(vector< int >, vector< int >, CDChargedKaonList &, CDChargedPionList &, EvtRecDTag *)
void saveDsInfo(CDDecayList::iterator, double, int, EvtRecDTag *)
void setbeta(Hep3Vector beta)
Definition: DsSelector.h:14
void setebeam(double ebeam)
Definition: DsSelector.h:13
@ kDstoPiPi0EPPiPiEta
Definition: EvtRecDTag.h:135
@ kDstoKsKplusPiPi
Definition: EvtRecDTag.h:120
@ kDstoPiPiPiEta
Definition: EvtRecDTag.h:132
@ kDstoPiEPRhoGam
Definition: EvtRecDTag.h:137
@ kDstoKsKminusPiPi
Definition: EvtRecDTag.h:121
@ kDstoPiPiPiPi0
Definition: EvtRecDTag.h:126
@ kDstoPiPiPiPiPi
Definition: EvtRecDTag.h:127
@ kDstoPiPiPiPiPiPi0
Definition: EvtRecDTag.h:128
@ kDstoPiPi0EPRhoGam
Definition: EvtRecDTag.h:138
@ kDstoPiEPPiPiEta
Definition: EvtRecDTag.h:134
void setdecayMode(DecayMode decayMode)
Definition: EvtRecDTag.h:171
const EvtRecTrack * hiEnGamma() const
Definition: EvtRecEtaToGG.h:30
const EvtRecTrack * loEnGamma() const
Definition: EvtRecEtaToGG.h:31
const EvtRecTrack * loEnGamma() const
Definition: EvtRecPi0.h:31
const EvtRecTrack * hiEnGamma() const
Definition: EvtRecPi0.h:30
int trackId() const
Definition: EvtRecTrack.h:32
SmartRef< EvtRecTrack > & daughter(int i)
void setpidtype(int type)
void setpidtype(int type)
_EXTERN_ std::string EvtRecEvent
Definition: EventModel.h:111
_EXTERN_ std::string EvtRecDTagCol
Definition: EventModel.h:117
_EXTERN_ std::string EvtRecTrackCol
Definition: EventModel.h:112

◆ finalize()

StatusCode DsReconstruction::finalize ( )

Definition at line 79 of file DsReconstruction.cxx.

79 {
80 MsgStream log(msgSvc(), name());
81 log << MSG::INFO << "in finalize()" << endreq;
82
83 chanlist.clear();
84
85 return StatusCode::SUCCESS;
86}

◆ getlist()

vector< string > DsReconstruction::getlist ( string &  filename)

Definition at line 670 of file DsReconstruction.cxx.

670 {
671
672 string channel;
673 vector<string> temp;
674
675 ifstream inFile;
676
677 inFile.open(filename.c_str());
678 if (!inFile) {
679 cout << "Unable to open decay list file";
680 exit(1); // terminate with error
681 }
682
683 while (inFile >> channel) {
684 temp.push_back(channel);
685 }
686
687 inFile.close();
688
689 return temp;
690
691}
std::ifstream ifstream
Definition: bpkt_streams.h:44

Referenced by initialize().

◆ initialize()

StatusCode DsReconstruction::initialize ( )

Definition at line 65 of file DsReconstruction.cxx.

65 {
66 MsgStream log(msgSvc(), name());
67 log << MSG::INFO << "in initialize()" <<endreq;
68
69 m_irun=-100;
70 m_beta.setX(0.011);
71 m_beta.setY(0);
72 m_beta.setZ(0);
73 chanlist=getlist(m_decaylist);
74
75 return StatusCode::SUCCESS;
76}
vector< string > getlist(string &filename)

◆ pidtag()

void DsReconstruction::pidtag ( vector< int >  kaonid,
vector< int >  pionid,
CDChargedKaonList kaonList,
CDChargedPionList pionList,
EvtRecDTag recDTag 
)

Definition at line 615 of file DsReconstruction.cxx.

615 {
616
617 bool iskaon=false,ispion=false;
618
619
620 // save track ids which passed pion/kaon cuts
621
622 for (CDChargedKaonList::iterator kit = kaonList.particle_begin(); kit != kaonList.particle_end(); kit++) {
623 recDTag->addKaonId( (*kit).particle().track() );
624 }
625
626 for (CDChargedPionList::iterator pit = pionList.particle_begin(); pit != pionList.particle_end(); pit++) {
627 recDTag->addPionId( (*pit).particle().track() );
628 }
629
630
631 /*
632 for(int i=0; i<kaonid.size(); i++){
633 bool ithkaon=false;
634 for (CDChargedKaonList::iterator kit = kaonList.particle_begin(); kit != kaonList.particle_end(); kit++) {
635 if((*kit).particle().track()->trackId()==kaonid[i]){
636 ithkaon=true;
637 break;
638 }
639 }
640 if(!ithkaon) break;
641 if(i==kaonid.size()-1)
642 iskaon=true;
643 }
644
645 for(int i=0; i<pionid.size(); i++){
646 bool ithpion=false;
647 for (CDChargedPionList::iterator pit = pionList.particle_begin(); pit != pionList.particle_end(); pit++) {
648 if((*pit).particle().track()->trackId()==pionid[i]){
649 ithpion=true;
650 break;
651 }
652 }
653 if(!ithpion) break;
654 if(i==pionid.size()-1)
655 ispion=true;
656 }
657
658
659 if( iskaon && ispion)
660 recDTag->settype( EvtRecDTag::Tight );
661 else if( (kaonid.size()==0 && ispion) || (pionid.size()==0 && iskaon))
662 recDTag->settype( EvtRecDTag::Tight );
663 else if( kaonid.size()==0 && pionid.size()==0 )
664 recDTag->settype( EvtRecDTag::Tight );
665 */
666
667}
void addKaonId(const SmartRef< EvtRecTrack > kaonId)
Definition: EvtRecDTag.h:192
void addPionId(const SmartRef< EvtRecTrack > pionId)
Definition: EvtRecDTag.h:190

Referenced by execute().

◆ saveDsInfo()

void DsReconstruction::saveDsInfo ( CDDecayList::iterator  it,
double  ebeam,
int  numofchildren,
EvtRecDTag recDTag 
)

Definition at line 535 of file DsReconstruction.cxx.

535 {
536
537 double mass = (*it).particle().mass();
538 int charge= (*it).particle().charge();
539 HepLorentzVector p4((*it).particle().momentum(), (*it).particle().energy());
540 recDTag->setp4(p4);
541
542 p4.boost(-m_beta);
543 double mbc2_CMS = ebeam*ebeam - p4.v().mag2();
544 double mbc_CMS = mbc2_CMS > 0 ? sqrt( mbc2_CMS ) : -10;
545 double deltaE_CMS = p4.t() - ebeam;
546
547 if((*it).particle().userTag()==1)
548 recDTag->settype( EvtRecDTag::Tight );
549 else
550 recDTag->settype( EvtRecDTag::Loose );
551 recDTag->setcharge(charge);
552 recDTag->setcharm(charge);
553 recDTag->setnumOfChildren(numofchildren);
554 recDTag->setmass(mass);
555 recDTag->setmBC(mbc_CMS);
556 recDTag->setbeamE(ebeam);
557 recDTag->setdeltaE(deltaE_CMS);
558
559}
double mass
void settype(SelType type)
Definition: EvtRecDTag.h:172
void setp4(HepLorentzVector p4)
Definition: EvtRecDTag.h:180
void setmass(double mass)
Definition: EvtRecDTag.h:174
void setdeltaE(double deltaE)
Definition: EvtRecDTag.h:176
void setcharm(int charm)
Definition: EvtRecDTag.h:178
void setmBC(double mBC)
Definition: EvtRecDTag.h:175
void setcharge(int charge)
Definition: EvtRecDTag.h:177
void setbeamE(double beamE)
Definition: EvtRecDTag.h:173
void setnumOfChildren(int numOfChildren)
Definition: EvtRecDTag.h:179

Referenced by execute().

◆ savetrack()

void DsReconstruction::savetrack ( vector< int >  trackid,
vector< int >  showerid,
EvtRecTrackIterator  charged_begin,
EvtRecTrackIterator  charged_end,
EvtRecTrackIterator  neutral_begin,
EvtRecTrackIterator  neutral_end,
EvtRecDTag recDTag 
)

Definition at line 561 of file DsReconstruction.cxx.

562 {
563
564 vector<EvtRecTrackIterator> trktemp;
565 vector<EvtRecTrackIterator> shrtemp;
566
567 //fill tracks
568 for(EvtRecTrackIterator trk=charged_begin; trk<charged_end;trk++){
569
570 bool isothertrack=true;
571 for(int i=0; i<trackid.size(); i++){
572 if( (*trk)->trackId()==trackid[i] ){
573 trktemp.push_back(trk);
574 isothertrack=false;
575 break;
576 }
577 }
578 if(isothertrack)
579 recDTag->addOtherTrack(*trk);
580 }
581 for(int i=0; i<trackid.size();i++){
582 for(int j=0; j<trktemp.size(); j++){
583 EvtRecTrackIterator trk=trktemp[j];
584 if( (*trk)->trackId()==trackid[i])
585 recDTag->addTrack(*trktemp[j]);
586 }
587 }
588
589
590 //fill showers
591 for(EvtRecTrackIterator shr=neutral_begin; shr<neutral_end;shr++){
592 bool isothershower=true;
593 for(int i=0; i<showerid.size(); i++){
594 if( (*shr)->trackId()==showerid[i] ){
595 shrtemp.push_back(shr);
596 isothershower=false;
597 break;
598 }
599 }
600 if(isothershower)
601 recDTag->addOtherShower(*shr);
602 }
603
604 for(int i=0; i<showerid.size();i++){
605 for(int j=0; j<shrtemp.size(); j++){
606 EvtRecTrackIterator shr=shrtemp[j];
607 if( (*shr)->trackId()==showerid[i])
608 recDTag->addShower(*shrtemp[j]);
609 }
610 }
611
612
613}
void addOtherTrack(const SmartRef< EvtRecTrack > track)
Definition: EvtRecDTag.h:186
void addOtherShower(const SmartRef< EvtRecTrack > shower)
Definition: EvtRecDTag.h:188
void addShower(const SmartRef< EvtRecTrack > shower)
Definition: EvtRecDTag.h:184
void addTrack(const SmartRef< EvtRecTrack > track)
Definition: EvtRecDTag.h:182

Referenced by execute().


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