BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
ChargedDReconstruction.cxx
Go to the documentation of this file.
1//
2// All D+ decay modes Reconstruction
3//
4#include <fstream>
5#include "GaudiKernel/MsgStream.h"
6#include "GaudiKernel/AlgFactory.h"
7#include "GaudiKernel/ISvcLocator.h"
8#include "GaudiKernel/SmartDataPtr.h"
9#include "GaudiKernel/IDataProviderSvc.h"
10
11
12#include "EventModel/EventHeader.h"
13#include "EventModel/Event.h"
14#include "EventModel/EventModel.h"
15
16#include "EvtRecEvent/EvtRecEvent.h"
17#include "EvtRecEvent/EvtRecTrack.h"
18#include "EvtRecEvent/EvtRecDTag.h"
19#include "EvtRecEvent/EvtRecPi0.h"
20#include "EvtRecEvent/EvtRecEtaToGG.h"
21#include "EvtRecEvent/EvtRecVeeVertex.h"
22
23#include "BesDChain/CDChargedPionList.h"
24#include "BesDChain/CDChargedKaonList.h"
25#include "BesDChain/CDPhotonList.h"
26#include "BesDChain/CDPi0List.h"
27#include "BesDChain/CDEtaList.h"
28#include "BesDChain/CDKsList.h"
29#include "BesDChain/CDDecayList.h"
30
31#include "McTruth/McParticle.h"
32#include "ParticleID/ParticleID.h"
33#include "VertexFit/VertexFit.h"
34#include "VertexFit/SecondVertexFit.h"
35#include "VertexFit/IVertexDbSvc.h"
36
37#include "DTagAlg/ChargedDReconstruction.h"
38#include "DTagAlg/LocalKaonSelector.h"
39#include "DTagAlg/LocalPionSelector.h"
40#include "DTagAlg/LocalPhotonSelector.h"
41#include "DTagAlg/LocalKsSelector.h"
42#include "DTagAlg/LocalPi0Selector.h"
43#include "DTagAlg/LocalEtatoGGSelector.h"
44#include "DTagAlg/LocalEptoPiPiEtaSelector.h"
45#include "DTagAlg/LocalEptoRhoGamSelector.h"
46#include "DTagAlg/LocalRhotoPiPiSelector.h"
47#include "DTagAlg/ChargedDSelector.h"
48
49
50#include "DTagAlg/utility.h"
51
52using namespace Event;
53
54//*******************************************************************************************
55ChargedDReconstruction::ChargedDReconstruction(const std::string& name, ISvcLocator* pSvcLocator):
56Algorithm(name, pSvcLocator) {
57 //Declare the properties
58 declareProperty( "debug", m_debug = false );
59 declareProperty( "ReadBeamEFromDB", m_ReadBeamEFromDB = false );
60 declareProperty( "UseCalibBeamE", m_usecalibBeamE = false );
61 declareProperty( "UseVertexfit", m_usevertexfit = false );
62 declareProperty( "BeamE", m_beamE = 1.8865 );
63 declareProperty( "DpList", m_decaylist = "test.txt" );
64}
65
66//******************************************************************************************
68 MsgStream log(msgSvc(), name());
69 log << MSG::INFO << "in initialize()" <<endreq;
70
71 m_irun=-100;
72 m_beta.setX(0.011);
73 m_beta.setY(0);
74 m_beta.setZ(0);
75 chanlist=getlist(m_decaylist);
76
77 return StatusCode::SUCCESS;
78}
79
80//********************************************************************************************
82 MsgStream log(msgSvc(), name());
83 log << MSG::INFO << "in finalize()" << endreq;
84
85 chanlist.clear();
86
87 return StatusCode::SUCCESS;
88}
89
90StatusCode ChargedDReconstruction::registerEvtRecDTagCol(
91 EvtRecDTagCol* aNewEvtRecDTagCol, MsgStream& log) {
92 StatusCode sc = eventSvc()->registerObject("/Event/EvtRec/EvtRecDTagCol",
93 aNewEvtRecDTagCol);
94 if (sc != StatusCode::SUCCESS) {
95 log << MSG::FATAL << "Could not register EvtRecDTagCol in TDS!" << endreq;
96 }
97 return sc;
98}
99
100//*********************************************************************************************
102 MsgStream log(msgSvc(), name());
103 log << MSG::INFO << "in execute()" << endreq;
104
105 StatusCode sc;
106
107 //////////////////
108 // Read REC data
109 /////////////////
110 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
111 int event= eventHeader->eventNumber();
112 // if ( m_debug || ( (event & 0x3FF) == 0 ) )
113 //std::cout << "event: " << event << std::endl;
114
115 SmartDataPtr<EvtRecEvent> recEvent(eventSvc(), EventModel::EvtRec::EvtRecEvent);
116 SmartDataPtr<EvtRecTrackCol> recTrackCol(eventSvc(), EventModel::EvtRec::EvtRecTrackCol);
117 log << MSG::DEBUG << "run and event = " << eventHeader->runNumber()
118 << " " << eventHeader->eventNumber() << endreq;
119 log << MSG::DEBUG <<"ncharg, nneu, tottks = "
120 << recEvent->totalCharged() << " , "
121 << recEvent->totalNeutral() << " , "
122 << recEvent->totalTracks() <<endreq;
123
124 EvtRecTrackIterator charged_begin = recTrackCol->begin();
125 EvtRecTrackIterator charged_end = charged_begin + recEvent->totalCharged();
126
127 EvtRecTrackIterator neutral_begin = recTrackCol->begin()+recEvent->totalCharged();
128 EvtRecTrackIterator neutral_end = recTrackCol->begin()+recEvent->totalTracks();
129
130
131 SmartDataPtr<EvtRecPi0Col> recPi0Col(eventSvc(), "/Event/EvtRec/EvtRecPi0Col");
132 if ( ! recPi0Col ) {
133 log << MSG::FATAL << "Could not find EvtRecPi0Col" << endreq;
134 return StatusCode::FAILURE;
135 }
136
137
138 SmartDataPtr<EvtRecEtaToGGCol> recEtaToGGCol(eventSvc(), "/Event/EvtRec/EvtRecEtaToGGCol");
139 if ( ! recEtaToGGCol ) {
140 log << MSG::FATAL << "Could not find EvtRecEtaToGGCol" << endreq;
141 return StatusCode::FAILURE;
142 }
143
144
145 SmartDataPtr<EvtRecVeeVertexCol> recVeeVertexCol(eventSvc(), "/Event/EvtRec/EvtRecVeeVertexCol");
146 if ( ! recVeeVertexCol ) {
147 log << MSG::FATAL << "Could not find EvtRecVeeVertexCol" << endreq;
148 return StatusCode::FAILURE;
149 }
150
151
152 SmartDataPtr<EvtRecDTagCol> recDTagCol(eventSvc(), EventModel::EvtRec::EvtRecDTagCol);
153 if (!recDTagCol) {
154 log << MSG::FATAL << "EvtRecDTagCol is not registered yet" << endreq;
155 return StatusCode::FAILURE;
156 }
157
158
159
160 //get primary vertex from db
161 Hep3Vector xorigin(0,0,0);
162
163 IVertexDbSvc* vtxsvc;
164 Gaudi::svcLocator()->service("VertexDbSvc", vtxsvc);
165 if (vtxsvc->isVertexValid()) {
166
167 //vertex[0] = vx; vertex[1]= vy; vertex[2] = vz;
168 double* vertex = vtxsvc->PrimaryVertex();
169 xorigin.setX(vertex[0]);
170 xorigin.setY(vertex[1]);
171 xorigin.setZ(vertex[2]);
172 }
173
174 utility util;
175
176
177 //registered in DTag.cxx
178 /*
179 if (!recDTagCol) {
180 recDTagCol = new EvtRecDTagCol;
181 sc = registerEvtRecDTagCol(recDTagCol, log);
182 if (sc != StatusCode::SUCCESS) {
183 return sc;
184 }
185 }
186 */
187
188 /////////////////////////////
189 //reconstruct particle lists
190 /////////////////////////////
193 CDChargedPionList pionList(charged_begin, charged_end, pionSelector);
194 CDChargedKaonList kaonList(charged_begin, charged_end, kaonSelector);
195
196 CDKsList ksList(ksSelector);
197 dc_fill(ksList, recVeeVertexCol->begin(), recVeeVertexCol->end());
198
199 // do a secondary vertex fit and cut on the results
200 map<EvtRecVeeVertex*, vector< double > > fitinfo;
201 for( CDKsList::iterator ksit = ksList.particle_begin(); ksit != ksList.particle_end(); ++ksit ){
202 EvtRecVeeVertex* ks = const_cast<EvtRecVeeVertex*>( (*ksit).particle().navKshort() );
203 fitinfo[ks] = util.SecondaryVFit(ks, vtxsvc);
204 }
205
206 CDPi0List pi0List(pi0Selector);
207 dc_fill(pi0List, recPi0Col->begin(), recPi0Col->end());
208
209 CDEtaList etaList(etatoGGSelector);
210 dc_fill(etaList, recEtaToGGCol->begin(), recEtaToGGCol->end());
211
212 //pion/kaon list with PID
215 CDChargedPionList pionList_tight(charged_begin, charged_end, pionSelector);
216 CDChargedKaonList kaonList_tight(charged_begin, charged_end, kaonSelector);
217
218
219
220 int run = eventHeader->runNumber();
221 m_ievt = eventHeader->eventNumber();
222 m_nChrg = recEvent->totalCharged();
223 m_nNeu = recEvent->totalNeutral();
224 m_nPion = pionList.size();
225 m_nKaon = kaonList.size();
226 m_nPi0 = pi0List.size();
227 m_nKs = ksList.size();
228
229
230 ///////////////////////
231 // get beam energy and beta
232 ///////////////////////
233
234
235 if(m_ReadBeamEFromDB && m_irun!=run){
236 m_irun=run;
237 if(m_usecalibBeamE)
238 m_readDb.setcalib(true);
239 m_beamE=m_readDb.getbeamE(m_irun,m_beamE);
240 if(run>0)
241 m_beta=m_readDb.getbeta();
242 // cout<<"use beam E from data base:"<<m_beamE<<endl;
243 }
244 double ebeam=m_beamE;
245
246
247 //////////////////////////////
248 //reconstruct decay lists
249 /////////////////////////////
250
251
252 for(int list=0;list<chanlist.size();list++){
253
254 string channel=chanlist[list];
255 vector<int> numchan;
258 CDDecayList decaylist(chargedDSelector);
259
260 //K+/-: 1, Pi+/-:2, Pi0:3, Eta: 4, Ks:5
261 //the fist element of the vector stands for decay mode,
262 //the rest will be particles, and size of the vector minus 1 will be number of daughers.
263
264 if(channel=="DptoKPiPi") {
265 numchan.push_back( EvtRecDTag::kDptoKPiPi );
266 numchan.push_back(1);
267 numchan.push_back(2);
268 numchan.push_back(2);
269 decaylist=kaonList.minus()* pionList.plus()* pionList.plus();
270 }
271 else if(channel=="DptoKPiPiPi0") {
272 numchan.push_back( EvtRecDTag::kDptoKPiPiPi0 );
273 numchan.push_back(1);
274 numchan.push_back(2);
275 numchan.push_back(2);
276 numchan.push_back(3);
277 decaylist=kaonList.minus()* pionList.plus()* pionList.plus()* pi0List;
278 }
279 else if(channel=="DptoKsPi") {
280 numchan.push_back( EvtRecDTag::kDptoKsPi );
281 numchan.push_back(5);
282 numchan.push_back(2);
283 decaylist=ksList* pionList.plus();
284 }
285 else if(channel=="DptoKsPiPi0") {
286 numchan.push_back( EvtRecDTag::kDptoKsPiPi0 );
287 numchan.push_back(5);
288 numchan.push_back(2);
289 numchan.push_back(3);
290 decaylist=ksList* pionList.plus()* pi0List;
291 }
292 else if(channel=="DptoKsPiPiPi") {
293 numchan.push_back( EvtRecDTag::kDptoKsPiPiPi );
294 numchan.push_back(5);
295 numchan.push_back(2);
296 numchan.push_back(2);
297 numchan.push_back(2);
298 decaylist=ksList* pionList.plus()* pionList.plus()* pionList.minus();
299 }
300 else if(channel=="DptoKKPi") {
301 numchan.push_back( EvtRecDTag::kDptoKKPi );
302 numchan.push_back(1);
303 numchan.push_back(1);
304 numchan.push_back(2);
305 decaylist=kaonList.minus()* kaonList.plus()* pionList.plus();
306 }
307 else if(channel=="DptoPiPi0") {
308 numchan.push_back( EvtRecDTag::kDptoPiPi0 );
309 numchan.push_back(2);
310 numchan.push_back(3);
311 decaylist=pionList.plus()* pi0List;
312 }
313 else if(channel=="DptoKPi0") {
314 numchan.push_back( EvtRecDTag::kDptoKPi0 );
315 numchan.push_back(1);
316 numchan.push_back(3);
317 decaylist=kaonList.plus()* pi0List;
318 }
319 else if(channel=="DptoKsK") {
320 numchan.push_back( EvtRecDTag::kDptoKsK );
321 numchan.push_back(5);
322 numchan.push_back(1);
323 decaylist=ksList* kaonList.plus();
324 }
325 else if(channel=="DptoPiPiPi") {
326 numchan.push_back( EvtRecDTag::kDptoPiPiPi );
327 numchan.push_back(2);
328 numchan.push_back(2);
329 numchan.push_back(2);
330 decaylist=pionList.plus()* pionList.plus()* pionList.minus() ;
331 }
332 else if(channel=="DptoPiPi0Pi0") {
333 numchan.push_back( EvtRecDTag::kDptoPiPi0Pi0 );
334 numchan.push_back(2);
335 numchan.push_back(3);
336 numchan.push_back(3);
337 decaylist=pionList.plus()* pi0List* pi0List;
338 }
339 else if(channel=="DptoKsKsPi") {
340 numchan.push_back( EvtRecDTag::kDptoKsKsPi );
341 numchan.push_back(5);
342 numchan.push_back(5);
343 numchan.push_back(2);
344 decaylist=ksList* ksList* pionList.plus();
345 }
346 else if(channel=="DptoKsKPi0") {
347 numchan.push_back( EvtRecDTag::kDptoKsKPi0 );
348 numchan.push_back(5);
349 numchan.push_back(1);
350 numchan.push_back(3);
351 decaylist=ksList* kaonList.plus()* pi0List;
352 }
353 else if(channel=="DptoKsKsK") {
354 numchan.push_back( EvtRecDTag::kDptoKsKsK );
355 numchan.push_back(5);
356 numchan.push_back(5);
357 numchan.push_back(1);
358 decaylist=ksList* ksList* kaonList.plus();
359 }
360 else if(channel=="DptoPiPiPiPi0") {
361 numchan.push_back( EvtRecDTag::kDptoPiPiPiPi0 );
362 numchan.push_back(2);
363 numchan.push_back(2);
364 numchan.push_back(2);
365 numchan.push_back(3);
366 decaylist=pionList.plus()* pionList.plus()* pionList.minus()* pi0List;
367 }
368 else if(channel=="DptoKsPiPi0Pi0") {
369 numchan.push_back( EvtRecDTag::kDptoKsPiPi0Pi0 );
370 numchan.push_back(5);
371 numchan.push_back(2);
372 numchan.push_back(3);
373 numchan.push_back(3);
374 decaylist=ksList* pionList.plus()* pi0List* pi0List;
375 }
376 else if(channel=="DptoKsKplusPiPi") {
377 numchan.push_back( EvtRecDTag::kDptoKsKplusPiPi );
378 numchan.push_back(5);
379 numchan.push_back(1);
380 numchan.push_back(2);
381 numchan.push_back(2);
382 decaylist=ksList* kaonList.plus()* pionList.plus()* pionList.minus();
383 }
384 else if(channel=="DptoKsKminusPiPi") {
385 numchan.push_back( EvtRecDTag::kDptoKsKminusPiPi );
386 numchan.push_back(5);
387 numchan.push_back(1);
388 numchan.push_back(2);
389 numchan.push_back(2);
390 decaylist=ksList* kaonList.minus()* pionList.plus()* pionList.plus();
391 }
392 else if(channel=="DptoKKPiPi0") {
393 numchan.push_back( EvtRecDTag::kDptoKKPiPi0 );
394 numchan.push_back(1);
395 numchan.push_back(1);
396 numchan.push_back(2);
397 numchan.push_back(3);
398 decaylist=kaonList.minus()* kaonList.plus()* pionList.plus()* pi0List;
399 }
400 else if(channel=="DptoPiPiPiPiPi") {
401 numchan.push_back( EvtRecDTag::kDptoPiPiPiPiPi );
402 numchan.push_back(2);
403 numchan.push_back(2);
404 numchan.push_back(2);
405 numchan.push_back(2);
406 numchan.push_back(2);
407 decaylist=pionList.plus()* pionList.plus()* pionList.plus()* pionList.minus()* pionList.minus();
408 }
409 else if(channel=="DptoKPiPiPiPi") {
410 numchan.push_back( EvtRecDTag::kDptoKPiPiPiPi );
411 numchan.push_back(1);
412 numchan.push_back(2);
413 numchan.push_back(2);
414 numchan.push_back(2);
415 numchan.push_back(2);
416 decaylist=kaonList.minus()* pionList.plus()* pionList.plus()* pionList.plus()* pionList.minus();
417 }
418 else if(channel=="DptoPiEta") {
419 numchan.push_back( EvtRecDTag::kDptoPiEta );
420 numchan.push_back(2);
421 numchan.push_back(4);
422 decaylist=pionList.plus()* etaList;
423 }
424 else if(channel=="DptoKsPiEta") {
425 numchan.push_back( EvtRecDTag::kDptoKsPiEta );
426 numchan.push_back(5);
427 numchan.push_back(2);
428 numchan.push_back(4);
429 decaylist=ksList* pionList.plus()* etaList;
430 }
431
432 CDDecayList::iterator D_begin =decaylist.particle_begin();
433 CDDecayList::iterator D_end =decaylist.particle_end();
434
435 for ( CDDecayList::iterator it = D_begin; it != D_end; it++ ) {
436
437 EvtRecDTag* recDTag = new EvtRecDTag;
438 recDTag->setdecayMode( (EvtRecDTag::DecayMode)numchan[0] );
439
440 vector<int> trackid, showerid;
441 vector<int> kaonid, pionid;
442 int numofchildren=numchan.size()-1;
443
444 for(int i=0; i< numofchildren;i++){
445
446 const CDCandidate& daughter=(*it).particle().child(i);
447
448 if(numchan[i+1]==1){
449 const EvtRecTrack* track=daughter.track();
450 trackid.push_back(track->trackId());
451 kaonid.push_back(track->trackId());
452 }
453 else if(numchan[i+1]==2){
454 const EvtRecTrack* track=daughter.track();
455 trackid.push_back(track->trackId());
456 pionid.push_back(track->trackId());
457 }
458 else if ( numchan[i+1]==3){
459 const EvtRecTrack* hiEnGamma=daughter.navPi0()->hiEnGamma();
460 const EvtRecTrack* loEnGamma=daughter.navPi0()->loEnGamma();
461 showerid.push_back(hiEnGamma->trackId());
462 showerid.push_back(loEnGamma->trackId());
463 }
464 else if ( numchan[i+1]==4){
465 const EvtRecTrack* hiEnGamma=daughter.navEta()->hiEnGamma();
466 const EvtRecTrack* loEnGamma=daughter.navEta()->loEnGamma();
467 showerid.push_back(hiEnGamma->trackId());
468 showerid.push_back(loEnGamma->trackId());
469 }
470 else if ( numchan[i+1]==5){
471 EvtRecVeeVertex* aKsCand = const_cast<EvtRecVeeVertex*>( daughter.navKshort() );
472 // fill fit info
473 recDTag->addToFitInfo(aKsCand->mass(),fitinfo[aKsCand][0],fitinfo[aKsCand][1],fitinfo[aKsCand][2]);
474 // fill tracks
475 EvtRecTrack* pion1Trk = aKsCand->daughter(0);
476 EvtRecTrack* pion2Trk = aKsCand->daughter(1);
477 trackid.push_back(pion1Trk->trackId());
478 trackid.push_back(pion2Trk->trackId());
479 }
480
481 }//end of filling track and shower ids
482
483
484 saveDpInfo(it, ebeam, numofchildren, recDTag);
485 savetrack(trackid,showerid,charged_begin,charged_end,neutral_begin,neutral_end,recDTag);
486 pidtag(kaonid,pionid,kaonList_tight, pionList_tight,recDTag);
487
488 if(m_usevertexfit){
489 HepLorentzVector p4change_vfit=util.vfit(channel, kaonid, pionid, xorigin, charged_begin);
490 recDTag->setp4(recDTag->p4()+p4change_vfit);
491 }
492
493
494 trackid.clear();
495 showerid.clear();
496 kaonid.clear();
497 pionid.clear();
498
499 //write dtag object out
500 recDTagCol->push_back(recDTag);
501
502 }//end of decaylist iterator
503
504 numchan.clear();
505
506 }//end of reconstrucing all D+ decay lists
507
508 return StatusCode::SUCCESS;
509}
510
511
512void ChargedDReconstruction::saveDpInfo(CDDecayList::iterator it, double ebeam, int numofchildren, EvtRecDTag* recDTag){
513
514 double mass = (*it).particle().mass();
515 int charge= (*it).particle().charge();
516 HepLorentzVector p4((*it).particle().momentum(), (*it).particle().energy());
517 recDTag->setp4(p4);
518
519 p4.boost(-m_beta);
520 double mbc2_CMS = ebeam*ebeam - p4.v().mag2();
521 double mbc_CMS = mbc2_CMS > 0 ? sqrt( mbc2_CMS ) : -10;
522 double deltaE_CMS = p4.t() - ebeam;
523
524 if((*it).particle().userTag()==1)
525 recDTag->settype( EvtRecDTag::Tight );
526 else
527 recDTag->settype( EvtRecDTag::Loose );
528 recDTag->setcharge(charge);
529 recDTag->setcharm(charge);
530 recDTag->setnumOfChildren(numofchildren);
531 recDTag->setmass(mass);
532 recDTag->setmBC(mbc_CMS);
533 recDTag->setbeamE(ebeam);
534 recDTag->setdeltaE(deltaE_CMS);
535
536}
537
538void ChargedDReconstruction::savetrack(vector<int> trackid, vector<int> showerid, EvtRecTrackIterator charged_begin, EvtRecTrackIterator charged_end,
539 EvtRecTrackIterator neutral_begin, EvtRecTrackIterator neutral_end,EvtRecDTag* recDTag){
540
541 vector<EvtRecTrackIterator> trktemp;
542 vector<EvtRecTrackIterator> shrtemp;
543
544 //fill tracks
545 for(EvtRecTrackIterator trk=charged_begin; trk<charged_end;trk++){
546
547 bool isothertrack=true;
548 for(int i=0; i<trackid.size(); i++){
549 if( (*trk)->trackId()==trackid[i] ){
550 trktemp.push_back(trk);
551 isothertrack=false;
552 break;
553 }
554 }
555 if(isothertrack)
556 recDTag->addOtherTrack(*trk);
557 }
558 for(int i=0; i<trackid.size();i++){
559 for(int j=0; j<trktemp.size(); j++){
560 EvtRecTrackIterator trk=trktemp[j];
561 if( (*trk)->trackId()==trackid[i])
562 recDTag->addTrack(*trktemp[j]);
563 }
564 }
565
566
567 //fill showers
568 for(EvtRecTrackIterator shr=neutral_begin; shr<neutral_end;shr++){
569 bool isothershower=true;
570 for(int i=0; i<showerid.size(); i++){
571 if( (*shr)->trackId()==showerid[i] ){
572 shrtemp.push_back(shr);
573 isothershower=false;
574 break;
575 }
576 }
577 if(isothershower)
578 recDTag->addOtherShower(*shr);
579 }
580
581 for(int i=0; i<showerid.size();i++){
582 for(int j=0; j<shrtemp.size(); j++){
583 EvtRecTrackIterator shr=shrtemp[j];
584 if( (*shr)->trackId()==showerid[i])
585 recDTag->addShower(*shrtemp[j]);
586 }
587 }
588
589
590}
591
592void ChargedDReconstruction::pidtag(vector<int> kaonid, vector<int> pionid, CDChargedKaonList& kaonList, CDChargedPionList& pionList,EvtRecDTag* recDTag){
593
594 bool iskaon=false,ispion=false;
595
596
597 // save track ids which passed pion/kaon cuts
598
599 for (CDChargedKaonList::iterator kit = kaonList.particle_begin(); kit != kaonList.particle_end(); kit++) {
600 recDTag->addKaonId( (*kit).particle().track() );
601 }
602
603 for (CDChargedPionList::iterator pit = pionList.particle_begin(); pit != pionList.particle_end(); pit++) {
604 recDTag->addPionId( (*pit).particle().track() );
605 }
606
607
608 /*
609 for(int i=0; i<kaonid.size(); i++){
610 bool ithkaon=false;
611 for (CDChargedKaonList::iterator kit = kaonList.particle_begin(); kit != kaonList.particle_end(); kit++) {
612 if((*kit).particle().track()->trackId()==kaonid[i]){
613 ithkaon=true;
614 break;
615 }
616 }
617 if(!ithkaon) break;
618 if(i==kaonid.size()-1)
619 iskaon=true;
620 }
621
622 for(int i=0; i<pionid.size(); i++){
623 bool ithpion=false;
624 for (CDChargedPionList::iterator pit = pionList.particle_begin(); pit != pionList.particle_end(); pit++) {
625 if((*pit).particle().track()->trackId()==pionid[i]){
626 ithpion=true;
627 break;
628 }
629 }
630 if(!ithpion) break;
631 if(i==pionid.size()-1)
632 ispion=true;
633 }
634
635
636 if( iskaon && ispion)
637 recDTag->settype( EvtRecDTag::Tight );
638 else if( (kaonid.size()==0 && ispion) || (pionid.size()==0 && iskaon))
639 recDTag->settype( EvtRecDTag::Tight );
640 else if( kaonid.size()==0 && pionid.size()==0 )
641 recDTag->settype( EvtRecDTag::Tight );
642 */
643
644}
645
646
647
648vector<string> ChargedDReconstruction::getlist(string& filename ){
649
650 string channel;
651 vector<string> temp;
652
653 ifstream inFile;
654
655 inFile.open(filename.c_str());
656 if (!inFile) {
657 cout << "Unable to open decay list file";
658 exit(1); // terminate with error
659 }
660
661 while (inFile >> channel) {
662 temp.push_back(channel);
663 }
664
665 inFile.close();
666
667 return temp;
668
669}
double mass
void dc_fill(DCFillableChargedList< Charged > &aFillableList, WitnessIterator first, WitnessIterator last)
double ebeam
ChargedDSelector chargedDSelector
LocalEtatoGGSelector etatoGGSelector
LocalKaonSelector kaonSelector
LocalKsSelector ksSelector
LocalPi0Selector pi0Selector
LocalPionSelector pionSelector
virtual const EvtRecTrack * track() const
virtual const EvtRecVeeVertex * navKshort() const
virtual const EvtRecPi0 * navPi0() const
virtual const EvtRecEtaToGG * navEta() const
void saveDpInfo(CDDecayList::iterator, double, int, EvtRecDTag *)
vector< string > getlist(string &filename)
void pidtag(vector< int >, vector< int >, CDChargedKaonList &, CDChargedPionList &, EvtRecDTag *)
void savetrack(vector< int >, vector< int >, EvtRecTrackIterator, EvtRecTrackIterator, EvtRecTrackIterator, EvtRecTrackIterator, EvtRecDTag *)
ChargedDReconstruction(const std::string &name, ISvcLocator *pSvcLocator)
void addOtherTrack(const SmartRef< EvtRecTrack > track)
void addToFitInfo(double ksmass, double chi2, double length, double error)
void addOtherShower(const SmartRef< EvtRecTrack > shower)
void addKaonId(const SmartRef< EvtRecTrack > kaonId)
void addPionId(const SmartRef< EvtRecTrack > pionId)
void addShower(const SmartRef< EvtRecTrack > shower)
void addTrack(const SmartRef< EvtRecTrack > track)
virtual bool isVertexValid()=0
virtual double * PrimaryVertex()=0
HepLorentzVector vfit(string channel, vector< int > kaonid, vector< int > pionid, HepPoint3D vx, EvtRecTrackIterator charged_begin)
Definition: utility.cxx:57
vector< double > SecondaryVFit(EvtRecVeeVertex *ks, IVertexDbSvc *vtxsvc)
Definition: utility.cxx:120