BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
Pi0EtaToGGRecAlg Class Reference

#include <Pi0EtaToGGRecAlg.h>

+ Inheritance diagram for Pi0EtaToGGRecAlg:

Public Member Functions

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

Detailed Description

Constructor & Destructor Documentation

◆ Pi0EtaToGGRecAlg() [1/2]

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

Individual photons

Definition at line 15 of file misc/Pi0EtaToGGRecAlg.cxx.

15 :
16 Algorithm(name, pSvcLocator)
17{
18 //Declare the properties
19 declareProperty("Pi0MinMass", m_minmass_cut = 0.07);
20 declareProperty("Pi0MaxMass", m_maxmass_cut = 0.18);
21 declareProperty("Pi0ChisqCut", m_chisq_cut = 20.0);
22
23 /// Individual photons
24 declareProperty("PhotonUseBarrelEmc", m_useBarrel = true);
25 declareProperty("PhotonUseEndcapEmc", m_useEndcap = true);
26 declareProperty("PhotonMinEnergy", m_minEnergy = 0.02);
27 declareProperty("PhotonDeltaAngleCut", m_angled_cut = 20.0);
28 declareProperty("PhotonDeltaThetaCut", m_thed_cut = 20.0);
29 declareProperty("PhotonDeltaPhiCut", m_phid_cut = 20.0);
30
31}

◆ Pi0EtaToGGRecAlg() [2/2]

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

Member Function Documentation

◆ execute() [1/2]

StatusCode Pi0EtaToGGRecAlg::execute ( )

Perform pi0 1C kinfit

Fill number of pi0s in EvtRecEvent

Definition at line 44 of file misc/Pi0EtaToGGRecAlg.cxx.

44 {
45
46 MsgStream log(msgSvc(), name());
47 log << MSG::INFO << "in execute()" <<endreq;
48
49 // get event header, eventlist and tracklist from TDS
50 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
51 SmartDataPtr<EvtRecEvent> recEvt(eventSvc(), EventModel::EvtRec::EvtRecEvent);
52 SmartDataPtr<EvtRecTrackCol> recTrkCol(eventSvc(), EventModel::EvtRec::EvtRecTrackCol);
53
54 bool save2TDS = false;
55 SmartDataPtr<EvtRecPi0Col> recPi0Col(eventSvc(), EventModel::EvtRec::EvtRecPi0Col);
56 if ( !recPi0Col ) {
57 recPi0Col = new EvtRecPi0Col;
58 save2TDS = true;
59 }
60
62
63 //
64 // Set up the pi0's list
65 //
66 for(int i1 = recEvt->totalCharged(); i1 < (recEvt->totalTracks()-1); i1++) {
67 EvtRecTrack* g1Trk = *(recTrkCol->begin() + i1);
68 if ( !validPhoton(g1Trk,recEvt,recTrkCol) ) continue;
69 RecEmcShower* g1Shower = g1Trk->emcShower();
70 HepLorentzVector g1P4 = getP4(g1Shower);
71
72 for(int i2 = i1+1; i2 < recEvt->totalTracks(); i2++) {
73 EvtRecTrack* g2Trk = *(recTrkCol->begin() + i2);
74 if ( !validPhoton(g2Trk,recEvt,recTrkCol) ) continue;
75 RecEmcShower* g2Shower = g2Trk->emcShower();
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 /// Perform pi0 1C kinfit
83 kmfit->init();
84 kmfit->setIterNumber(1);
85 kmfit->AddTrack(0, 0.0, g1Shower);
86 kmfit->AddTrack(1, 0.0, g2Shower);
87 kmfit->AddResonance(0, xmpi0, 0, 1);
88 if ( !kmfit->Fit(0) ) continue;
89 kmfit->BuildVirtualParticle(0);
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
98 EvtRecPi0* recPi0 = new EvtRecPi0();
99 recPi0->setRawMass(p2g.restMass());
100 recPi0->setChisq(pi0_chisq);
101 recPi0->setFcos((e1-e2)/ppi0.rho());
102
103 if ( g1P4.e() >= g2P4.e() ) {
104 recPi0->setHiPfit(kmfit->pfit(0));
105 recPi0->setLoPfit(kmfit->pfit(1));
106 recPi0->setHiEnGamma(g1Trk);
107 recPi0->setLoEnGamma(g2Trk);
108 }
109 else {
110 recPi0->setHiPfit(kmfit->pfit(1));
111 recPi0->setLoPfit(kmfit->pfit(0));
112 recPi0->setHiEnGamma(g2Trk);
113 recPi0->setLoEnGamma(g1Trk);
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 /// Fill number of pi0s in EvtRecEvent
126 recEvt->setNumberOfPi0(recPi0Col->size());
127
128 if ( save2TDS ) {
129 StatusCode sc = eventSvc()->registerObject(EventModel::EvtRec::EvtRecPi0Col, recPi0Col);
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}
Double_t e1
Double_t e2
***************************************************************************************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
Definition: RRes.h:32
void setLoPfit(const HepLorentzVector &loPfit)
void setHiPfit(const HepLorentzVector &hiPfit)
static KinematicFit * instance()
void BuildVirtualParticle(int number)
void AddResonance(int number, double mres, std::vector< int > tlis)
void AddTrack(const int number, const double mass, const RecMdcTrack *trk)
Definition: TrackPool.cxx:22

◆ execute() [2/2]

StatusCode Pi0EtaToGGRecAlg::execute ( )

◆ finalize() [1/2]

StatusCode Pi0EtaToGGRecAlg::finalize ( )

Definition at line 141 of file misc/Pi0EtaToGGRecAlg.cxx.

141 {
142
143 MsgStream log(msgSvc(), name());
144 log << MSG::INFO << "in finalize()" << endreq;
145
146 return StatusCode::SUCCESS;
147}

◆ finalize() [2/2]

StatusCode Pi0EtaToGGRecAlg::finalize ( )

◆ initialize() [1/2]

StatusCode Pi0EtaToGGRecAlg::initialize ( )

Definition at line 34 of file misc/Pi0EtaToGGRecAlg.cxx.

34 {
35
36 MsgStream log(msgSvc(), name());
37 log << MSG::INFO << "in initialize()" <<endreq;
38
39 return StatusCode::SUCCESS;
40}

◆ initialize() [2/2]

StatusCode Pi0EtaToGGRecAlg::initialize ( )

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