Public Member Functions | Private Member Functions | Private Attributes | List of all members
ems::MCinfo Class Reference

Public Member Functions

 MCinfo (const art::Event &evt)
 
void Info (const art::Event &evt)
 
void Findtpcborders (const art::Event &evt)
 
int GetNgammas () const
 
double GetMompi0 () const
 
double GetMomGamma1 () const
 
double GetMomGamma2 () const
 
double GetCosine ()
 
TVector3 const & GetPrimary () const
 
TVector3 const & GetPospi0 () const
 
TVector3 const & GetPosgamma1 () const
 
TVector3 const & GetPosgamma2 () const
 
TVector3 const & GetDirgamma1 () const
 
TVector3 const & GetDirgamma2 () const
 
bool const & IsInside1 () const
 
bool const & IsInside2 () const
 
bool const & IsCompton () const
 

Private Member Functions

bool insideFidVol (const TLorentzVector &pvtx) const
 

Private Attributes

double fMinx
 
double fMaxx
 
double fMiny
 
double fMaxy
 
double fMinz
 
double fMaxz
 
double fFidVolCut
 
int fNgammas
 
double fMompi0
 
double fGammamom1
 
bool fInside1
 
double fGammamom2
 
bool fInside2
 
double fCosine
 
bool fCompton
 
TVector3 fPrimary
 
TVector3 fPi0pos
 
TVector3 fConvgamma1
 
TVector3 fConvgamma2
 
TVector3 fDirgamma1
 
TVector3 fDirgamma2
 

Detailed Description

Definition at line 40 of file MultiEMShowers_module.cc.

Constructor & Destructor Documentation

ems::MCinfo::MCinfo ( const art::Event evt)

Definition at line 154 of file MultiEMShowers_module.cc.

154  : fFidVolCut(2.0)
155 {
156  Info(evt);
157  Findtpcborders(evt);
158 }
void Findtpcborders(const art::Event &evt)
void Info(const art::Event &evt)

Member Function Documentation

void ems::MCinfo::Findtpcborders ( const art::Event evt)

Definition at line 161 of file MultiEMShowers_module.cc.

162 {
164 
165  fMinx = geom->IterateTPCs().begin()->MinX();
166  fMiny = geom->IterateTPCs().begin()->MinY();
167  fMinz = geom->IterateTPCs().begin()->MinZ();
168  fMaxx = geom->IterateTPCs().begin()->MaxX();
169  fMaxy = geom->IterateTPCs().begin()->MaxY();
170  fMaxz = geom->IterateTPCs().begin()->MaxZ();
171 
172  for (const geo::TPCGeo& tpcg : geom->IterateTPCs()) {
173  if (tpcg.MinX() < fMinx) fMinx = tpcg.MinX();
174  if (tpcg.MaxX() > fMaxx) fMaxx = tpcg.MaxX();
175  if (tpcg.MinY() < fMiny) fMiny = tpcg.MinY();
176  if (tpcg.MaxY() > fMaxy) fMaxy = tpcg.MaxY();
177  if (tpcg.MinZ() < fMinz) fMinz = tpcg.MinZ();
178  if (tpcg.MaxZ() > fMaxz) fMaxz = tpcg.MaxZ();
179  }
180 }
Geometry information for a single TPC.
Definition: TPCGeo.h:38
IteratorBox< TPC_iterator,&GeometryCore::begin_TPC,&GeometryCore::end_TPC > IterateTPCs() const
Enables ranged-for loops on all TPCs of the detector.
double ems::MCinfo::GetCosine ( )
inline

Definition at line 69 of file MultiEMShowers_module.cc.

70  {
71  return fCosine;
72  }
TVector3 const& ems::MCinfo::GetDirgamma1 ( ) const
inline

Definition at line 96 of file MultiEMShowers_module.cc.

97  {
98  return fDirgamma1;
99  }
TVector3 const& ems::MCinfo::GetDirgamma2 ( ) const
inline

Definition at line 101 of file MultiEMShowers_module.cc.

102  {
103  return fDirgamma2;
104  }
double ems::MCinfo::GetMomGamma1 ( ) const
inline

Definition at line 58 of file MultiEMShowers_module.cc.

59  {
60  return fGammamom1;
61  }
double ems::MCinfo::GetMomGamma2 ( ) const
inline

Definition at line 63 of file MultiEMShowers_module.cc.

64  {
65  return fGammamom2;
66  }
double ems::MCinfo::GetMompi0 ( ) const
inline

Definition at line 53 of file MultiEMShowers_module.cc.

54  {
55  return fMompi0;
56  }
int ems::MCinfo::GetNgammas ( ) const
inline

Definition at line 47 of file MultiEMShowers_module.cc.

48  {
49  return fNgammas;
50  }
TVector3 const& ems::MCinfo::GetPosgamma1 ( ) const
inline

Definition at line 85 of file MultiEMShowers_module.cc.

86  {
87  return fConvgamma1;
88  }
TVector3 const& ems::MCinfo::GetPosgamma2 ( ) const
inline

Definition at line 90 of file MultiEMShowers_module.cc.

91  {
92  return fConvgamma2;
93  }
TVector3 const& ems::MCinfo::GetPospi0 ( ) const
inline

Definition at line 80 of file MultiEMShowers_module.cc.

81  {
82  return fPi0pos;
83  }
TVector3 const& ems::MCinfo::GetPrimary ( ) const
inline

Definition at line 75 of file MultiEMShowers_module.cc.

76  {
77  return fPrimary;
78  }
void ems::MCinfo::Info ( const art::Event evt)

Definition at line 183 of file MultiEMShowers_module.cc.

184 {
185  fMompi0 = 0.0;
186  fPi0pos.SetXYZ(0, 0, 0);
187  fNgammas = 0;
188  fCosine = 0.0;
189  fInside1 = false;
190  fInside2 = false;
191  fCompton = false;
192 
193  fGammamom1 = 0.0;
194  fGammamom2 = 0.0;
195  fConvgamma1.SetXYZ(0, 0, 0);
196  fConvgamma2.SetXYZ(0, 0, 0);
197  fDirgamma1.SetXYZ(0, 0, 0);
198  fDirgamma2.SetXYZ(0, 0, 0);
199 
201  const sim::ParticleList& plist = pi_serv->ParticleList();
202  for (sim::ParticleList::const_iterator ipar = plist.begin(); ipar != plist.end(); ++ipar) {
203  const simb::MCParticle* particle = ipar->second;
204 
205  if (particle->Process() != "primary") continue;
206 
207  TLorentzVector posvec = particle->Position();
208  TVector3 pose(posvec.X(), posvec.Y(), posvec.Z());
209  fPrimary = pose;
210 
211  if (particle->PdgCode() == 111) {
212  fMompi0 = particle->P();
213 
214  TLorentzVector posvec3 = particle->Position();
215  TVector3 pospi0(posvec3.X(), posvec3.Y(), posvec3.Z());
216  fPi0pos = pospi0;
217 
218  if (particle->NumberDaughters() != 2) continue;
219 
220  const simb::MCParticle* daughter1 = pi_serv->TrackIdToParticle_P(particle->Daughter(0));
221  if (daughter1->PdgCode() != 22) continue;
222 
223  const simb::MCParticle* daughter2 = pi_serv->TrackIdToParticle_P(particle->Daughter(1));
224  if (daughter2->PdgCode() != 22) continue;
225 
226  fNgammas = particle->NumberDaughters();
227  TLorentzVector mom1 = pi_serv->TrackIdToParticle_P(particle->Daughter(0))->Momentum();
228  TLorentzVector mom2 = pi_serv->TrackIdToParticle_P(particle->Daughter(1))->Momentum();
229 
230  // compton process
231  if (daughter1->EndProcess() == "phot") fCompton = true;
232  if (daughter2->EndProcess() == "phot") fCompton = true;
233 
234  TVector3 mom1vec3(mom1.Px(), mom1.Py(), mom1.Pz());
235  fGammamom1 = pi_serv->TrackIdToParticle_P(particle->Daughter(0))->P();
236  TVector3 mom2vec3(mom2.Px(), mom2.Py(), mom2.Pz());
237  fGammamom2 = pi_serv->TrackIdToParticle_P(particle->Daughter(1))->P();
238 
239  TLorentzVector pos1 = pi_serv->TrackIdToParticle_P(particle->Daughter(0))->EndPosition();
240  TLorentzVector pos2 = pi_serv->TrackIdToParticle_P(particle->Daughter(1))->EndPosition();
241 
242  if (insideFidVol(pos1)) fInside1 = true;
243  if (insideFidVol(pos2)) fInside2 = true;
244 
245  fConvgamma1.SetXYZ(pos1.X(), pos1.Y(), pos1.Z());
246  fConvgamma2.SetXYZ(pos2.X(), pos2.Y(), pos2.Z());
247 
248  TVector3 vecnorm1 = mom1vec3.Unit();
249  fDirgamma1 = vecnorm1;
250  TVector3 vecnorm2 = mom2vec3.Unit();
251  fDirgamma2 = vecnorm2;
252 
254  }
255  else {
256  fNgammas = particle->NumberDaughters();
257  }
258  }
259 }
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:219
int PdgCode() const
Definition: MCParticle.h:212
const simb::MCParticle * TrackIdToParticle_P(int id) const
std::pair< float, std::string > P
intermediate_table::const_iterator const_iterator
std::string Process() const
Definition: MCParticle.h:215
int NumberDaughters() const
Definition: MCParticle.h:217
int Daughter(const int i) const
Definition: MCParticle.cxx:112
std::string EndProcess() const
Definition: MCParticle.h:216
double P(const int i=0) const
Definition: MCParticle.h:234
const sim::ParticleList & ParticleList() const
bool insideFidVol(const TLorentzVector &pvtx) const
bool ems::MCinfo::insideFidVol ( const TLorentzVector &  pvtx) const
private

Definition at line 262 of file MultiEMShowers_module.cc.

263 {
264 
265  bool inside = false;
266  //x
267  double dista = fabs(fMinx - pvtx.X());
268  double distb = fabs(pvtx.X() - fMaxx);
269  if ((pvtx.X() > fMinx) && (pvtx.X() < fMaxx) && (dista > fFidVolCut) && (distb > fFidVolCut))
270  inside = true;
271  //y
272  dista = fabs(fMaxy - pvtx.Y());
273  distb = fabs(pvtx.Y() - fMiny);
274  if (inside && (pvtx.Y() > fMiny) && (pvtx.Y() < fMaxy) && (dista > fFidVolCut) &&
275  (distb > fFidVolCut))
276  inside = true;
277  else
278  inside = false;
279 
280  //z
281  dista = fabs(fMaxz - pvtx.Z());
282  distb = fabs(pvtx.Z() - fMinz);
283  if (inside && (pvtx.Z() > fMinz) && (pvtx.Z() < fMaxz) && (dista > fFidVolCut) &&
284  (distb > fFidVolCut))
285  inside = true;
286  else
287  inside = false;
288 
289  return inside;
290 }
bool const& ems::MCinfo::IsCompton ( ) const
inline

Definition at line 118 of file MultiEMShowers_module.cc.

119  {
120  return fCompton;
121  }
bool const& ems::MCinfo::IsInside1 ( ) const
inline

Definition at line 107 of file MultiEMShowers_module.cc.

108  {
109  return fInside1;
110  }
bool const& ems::MCinfo::IsInside2 ( ) const
inline

Definition at line 112 of file MultiEMShowers_module.cc.

113  {
114  return fInside2;
115  }

Member Data Documentation

bool ems::MCinfo::fCompton
private

Definition at line 144 of file MultiEMShowers_module.cc.

TVector3 ems::MCinfo::fConvgamma1
private

Definition at line 148 of file MultiEMShowers_module.cc.

TVector3 ems::MCinfo::fConvgamma2
private

Definition at line 149 of file MultiEMShowers_module.cc.

double ems::MCinfo::fCosine
private

Definition at line 142 of file MultiEMShowers_module.cc.

TVector3 ems::MCinfo::fDirgamma1
private

Definition at line 150 of file MultiEMShowers_module.cc.

TVector3 ems::MCinfo::fDirgamma2
private

Definition at line 151 of file MultiEMShowers_module.cc.

double ems::MCinfo::fFidVolCut
private

Definition at line 132 of file MultiEMShowers_module.cc.

double ems::MCinfo::fGammamom1
private

Definition at line 137 of file MultiEMShowers_module.cc.

double ems::MCinfo::fGammamom2
private

Definition at line 139 of file MultiEMShowers_module.cc.

bool ems::MCinfo::fInside1
private

Definition at line 138 of file MultiEMShowers_module.cc.

bool ems::MCinfo::fInside2
private

Definition at line 140 of file MultiEMShowers_module.cc.

double ems::MCinfo::fMaxx
private

Definition at line 126 of file MultiEMShowers_module.cc.

double ems::MCinfo::fMaxy
private

Definition at line 128 of file MultiEMShowers_module.cc.

double ems::MCinfo::fMaxz
private

Definition at line 130 of file MultiEMShowers_module.cc.

double ems::MCinfo::fMinx
private

Definition at line 125 of file MultiEMShowers_module.cc.

double ems::MCinfo::fMiny
private

Definition at line 127 of file MultiEMShowers_module.cc.

double ems::MCinfo::fMinz
private

Definition at line 129 of file MultiEMShowers_module.cc.

double ems::MCinfo::fMompi0
private

Definition at line 136 of file MultiEMShowers_module.cc.

int ems::MCinfo::fNgammas
private

Definition at line 134 of file MultiEMShowers_module.cc.

TVector3 ems::MCinfo::fPi0pos
private

Definition at line 147 of file MultiEMShowers_module.cc.

TVector3 ems::MCinfo::fPrimary
private

Definition at line 146 of file MultiEMShowers_module.cc.


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