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