44 {
45
46 MsgStream log(
msgSvc(), name());
47 log << MSG::INFO << "in execute()" <<endreq;
48
49
50 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
53
54 bool save2TDS = false;
56 if ( !recPi0Col ) {
58 save2TDS = true;
59 }
60
62
63
64
65
66 for(int i1 = recEvt->totalCharged(); i1 < (recEvt->totalTracks()-1); i1++) {
68 if ( !validPhoton(g1Trk,recEvt,recTrkCol) ) continue;
70 HepLorentzVector g1P4 = getP4(g1Shower);
71
72 for(int i2 = i1+1; i2 < recEvt->totalTracks(); i2++) {
74 if ( !validPhoton(g2Trk,recEvt,recTrkCol) ) continue;
76 HepLorentzVector g2P4 = getP4(g2Shower);
77
78 HepLorentzVector p2g = g1P4 + g2P4;
79 if ( p2g.m() < m_minmass_cut ) continue;
80 if ( p2g.m() > m_maxmass_cut ) continue;
81
82
88 if ( !kmfit->
Fit(0) )
continue;
90
91 double pi0_chisq = kmfit->
chisq(0);
92 if ( pi0_chisq > m_chisq_cut ) continue;
93
94 double e1 = (kmfit->
pfit(0)).e();
95 double e2 = (kmfit->
pfit(1)).e();
96 HepLorentzVector ppi0 = kmfit->
pfit(0) + kmfit->
pfit(1);
97
99 recPi0->setRawMass(p2g.restMass());
101 recPi0->setFcos((
e1-
e2)/ppi0.rho());
102
103 if ( g1P4.e() >= g2P4.e() ) {
108 }
109 else {
114 }
115
116 std::cout << "p(g1) = " << g1P4 << std::endl;
117 std::cout << "p(g2) = " << g2P4 << std::endl;
118 std::cout << "chi2(pi0) = " << pi0_chisq << std::endl;
119 std::cout << "m(gg) before fill = " << p2g.restMass() << std::endl << std::endl;
120
121 recPi0Col->push_back(recPi0);
122 }
123 }
124
125
126 recEvt->setNumberOfPi0(recPi0Col->size());
127
128 if ( save2TDS ) {
130 if ( sc.isFailure() ) {
131 log << MSG::ERROR << "could not register EvtRecPi0Col in TDS" <<endreq;
132 return StatusCode::FAILURE;
133 }
134 }
135
136 return StatusCode::SUCCESS;
137}
ObjectVector< EvtRecPi0 > EvtRecPi0Col
***************************************************************************************Pseudo Class RRes *****************************************************************************************Parameters and physical constants **Maarten sept ************************************************************************DOUBLE PRECISION xsmu **************************************************************************PARTICLE DATA all others are from PDG *Only resonances with known widths into electron pairs are sept ************************************************************************C Declarations xmb DOUBLE PRECISION xcb DOUBLE PRECISION xmpi0
void setChisq(const double chisq)
void setLoPfit(const HepLorentzVector &loPfit)
void setLoEnGamma(const EvtRecTrack *trk)
void setHiPfit(const HepLorentzVector &hiPfit)
void setHiEnGamma(const EvtRecTrack *trk)
RecEmcShower * emcShower()
static KinematicFit * instance()
void BuildVirtualParticle(int number)
void AddResonance(int number, double mres, std::vector< int > tlis)
void setIterNumber(const int niter=5)
HepLorentzVector pfit(int n) const
void AddTrack(const int number, const double mass, const RecMdcTrack *trk)
_EXTERN_ std::string EvtRecPi0Col
_EXTERN_ std::string EvtRecEvent
_EXTERN_ std::string EvtRecTrackCol