LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
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 49 of file MultiEMShowers_module.cc.

Constructor & Destructor Documentation

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

Definition at line 105 of file MultiEMShowers_module.cc.

References Findtpcborders(), and Info().

105  :
106 fFidVolCut(2.0)
107 {
108  Info(evt);
109  Findtpcborders(evt);
110 }
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 112 of file MultiEMShowers_module.cc.

References fMaxx, fMaxy, fMaxz, fMinx, fMiny, fMinz, and geo::GeometryCore::IterateTPCs().

Referenced by MCinfo().

113 {
115 
116  fMinx = geom->IterateTPCs().begin()->MinX();
117  fMiny = geom->IterateTPCs().begin()->MinY();
118  fMinz = geom->IterateTPCs().begin()->MinZ();
119  fMaxx = geom->IterateTPCs().begin()->MaxX();
120  fMaxy = geom->IterateTPCs().begin()->MaxY();
121  fMaxz = geom->IterateTPCs().begin()->MaxZ();
122 
123  for (const geo::TPCGeo& tpcg: geom->IterateTPCs())
124  {
125  if (tpcg.MinX() < fMinx) fMinx = tpcg.MinX();
126  if (tpcg.MaxX() > fMaxx) fMaxx = tpcg.MaxX();
127  if (tpcg.MinY() < fMiny) fMiny = tpcg.MinY();
128  if (tpcg.MaxY() > fMaxy) fMaxy = tpcg.MaxY();
129  if (tpcg.MinZ() < fMinz) fMinz = tpcg.MinZ();
130  if (tpcg.MaxZ() > fMaxz) fMaxz = tpcg.MaxZ();
131  }
132 }
Geometry information for a single TPC.
Definition: TPCGeo.h:37
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 62 of file MultiEMShowers_module.cc.

References fCosine.

Referenced by ems::MultiEMShowers::analyze().

62 { return fCosine; }
TVector3 const& ems::MCinfo::GetDirgamma1 ( ) const
inline

Definition at line 69 of file MultiEMShowers_module.cc.

References fDirgamma1.

Referenced by ems::MultiEMShowers::analyze().

69 { return fDirgamma1; }
TVector3 const& ems::MCinfo::GetDirgamma2 ( ) const
inline

Definition at line 70 of file MultiEMShowers_module.cc.

References fDirgamma2.

Referenced by ems::MultiEMShowers::analyze().

70 { return fDirgamma2; }
double ems::MCinfo::GetMomGamma1 ( ) const
inline

Definition at line 59 of file MultiEMShowers_module.cc.

References fGammamom1.

Referenced by ems::MultiEMShowers::analyze().

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

Definition at line 60 of file MultiEMShowers_module.cc.

References fGammamom2.

Referenced by ems::MultiEMShowers::analyze().

60 { return fGammamom2; }
double ems::MCinfo::GetMompi0 ( ) const
inline

Definition at line 58 of file MultiEMShowers_module.cc.

References fMompi0.

Referenced by ems::MultiEMShowers::analyze().

58 { return fMompi0; }
int ems::MCinfo::GetNgammas ( ) const
inline

Definition at line 56 of file MultiEMShowers_module.cc.

References fNgammas.

Referenced by ems::MultiEMShowers::analyze().

56 { return fNgammas; }
TVector3 const& ems::MCinfo::GetPosgamma1 ( ) const
inline

Definition at line 66 of file MultiEMShowers_module.cc.

References fConvgamma1.

Referenced by ems::MultiEMShowers::analyze(), and ems::MultiEMShowers::convCluster().

66 { return fConvgamma1; }
TVector3 const& ems::MCinfo::GetPosgamma2 ( ) const
inline

Definition at line 67 of file MultiEMShowers_module.cc.

References fConvgamma2.

Referenced by ems::MultiEMShowers::analyze(), and ems::MultiEMShowers::convCluster().

67 { return fConvgamma2; }
TVector3 const& ems::MCinfo::GetPospi0 ( ) const
inline

Definition at line 65 of file MultiEMShowers_module.cc.

References fPi0pos.

Referenced by ems::MultiEMShowers::analyze().

65 { return fPi0pos; }
TVector3 const& ems::MCinfo::GetPrimary ( ) const
inline

Definition at line 64 of file MultiEMShowers_module.cc.

References fPrimary.

Referenced by ems::MultiEMShowers::analyze().

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

Definition at line 134 of file MultiEMShowers_module.cc.

References sim::ParticleList::begin(), simb::MCParticle::Daughter(), sim::ParticleList::end(), simb::MCParticle::EndProcess(), fCompton, fConvgamma1, fConvgamma2, fCosine, fDirgamma1, fDirgamma2, fGammamom1, fGammamom2, fInside1, fInside2, fMompi0, fNgammas, fPi0pos, fPrimary, insideFidVol(), simb::MCParticle::NumberDaughters(), simb::MCParticle::P(), cheat::ParticleInventoryService::ParticleList(), simb::MCParticle::PdgCode(), simb::MCParticle::Position(), simb::MCParticle::Process(), and cheat::ParticleInventoryService::TrackIdToParticle_P().

Referenced by MCinfo().

135 {
136  fMompi0 = 0.0; fPi0pos.SetXYZ(0,0,0);
137  fNgammas = 0;
138  fCosine = 0.0;
139  fInside1 = false; fInside2 = false;
140  fCompton = false;
141 
142  fGammamom1 = 0.0; fGammamom2 = 0.0;
143  fConvgamma1.SetXYZ(0,0,0); fConvgamma2.SetXYZ(0,0,0);
144  fDirgamma1.SetXYZ(0,0,0); fDirgamma2.SetXYZ(0,0,0);
145 
147  const sim::ParticleList& plist = pi_serv->ParticleList();
148  for (sim::ParticleList::const_iterator ipar = plist.begin(); ipar != plist.end(); ++ipar)
149  {
150  const simb::MCParticle* particle = ipar->second;
151 
152  if (particle->Process() != "primary") continue;
153 
154  TLorentzVector posvec = particle->Position();
155  TVector3 pose(posvec.X(), posvec.Y(), posvec.Z());
156  fPrimary = pose;
157 
158 
159  if (particle->PdgCode() == 111)
160  {
161  fMompi0 = particle->P();
162 
163  TLorentzVector posvec3 = particle->Position();
164  TVector3 pospi0(posvec3.X(), posvec3.Y(), posvec3.Z());
165  fPi0pos = pospi0;
166 
167  if (particle->NumberDaughters() != 2) continue;
168 
169  const simb::MCParticle* daughter1 = pi_serv->TrackIdToParticle_P(particle->Daughter(0));
170  if (daughter1->PdgCode() != 22) continue;
171 
172  const simb::MCParticle* daughter2 = pi_serv->TrackIdToParticle_P(particle->Daughter(1));
173  if (daughter2->PdgCode() != 22) continue;
174 
175  fNgammas = particle->NumberDaughters();
176  TLorentzVector mom1 = pi_serv->TrackIdToParticle_P(particle->Daughter(0))->Momentum();
177  TLorentzVector mom2 = pi_serv->TrackIdToParticle_P(particle->Daughter(1))->Momentum();
178 
179  // compton process
180  if (daughter1->EndProcess() == "phot") fCompton = true;
181  if (daughter2->EndProcess() == "phot") fCompton = true;
182 
183  TVector3 mom1vec3(mom1.Px(), mom1.Py(), mom1.Pz());
184  fGammamom1 = pi_serv->TrackIdToParticle_P(particle->Daughter(0))->P();
185  TVector3 mom2vec3(mom2.Px(), mom2.Py(), mom2.Pz());
186  fGammamom2 = pi_serv->TrackIdToParticle_P(particle->Daughter(1))->P();
187 
188  TLorentzVector pos1 = pi_serv->TrackIdToParticle_P(particle->Daughter(0))->EndPosition();
189  TLorentzVector pos2 = pi_serv->TrackIdToParticle_P(particle->Daughter(1))->EndPosition();
190 
191  if (insideFidVol(pos1)) fInside1 = true;
192  if (insideFidVol(pos2)) fInside2 = true;
193 
194 
195  fConvgamma1.SetXYZ(pos1.X(), pos1.Y(), pos1.Z());
196  fConvgamma2.SetXYZ(pos2.X(), pos2.Y(), pos2.Z());
197 
198  TVector3 vecnorm1 = mom1vec3.Unit();
199  fDirgamma1 = vecnorm1;
200  TVector3 vecnorm2 = mom2vec3.Unit();
201  fDirgamma2 = vecnorm2;
202 
204  }
205  else
206  {
207  fNgammas = particle->NumberDaughters();
208  }
209  }
210 }
const simb::MCParticle * TrackIdToParticle_P(int const &id)
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:223
int PdgCode() const
Definition: MCParticle.h:216
list_type::const_iterator const_iterator
Definition: ParticleList.h:132
std::string Process() const
Definition: MCParticle.h:219
int NumberDaughters() const
Definition: MCParticle.h:221
int Daughter(const int i) const
Definition: MCParticle.cxx:112
std::string EndProcess() const
Definition: MCParticle.h:220
double P(const int i=0) const
Definition: MCParticle.h:238
iterator begin()
Definition: ParticleList.h:305
bool insideFidVol(const TLorentzVector &pvtx) const
bool ems::MCinfo::insideFidVol ( const TLorentzVector &  pvtx) const
private

Definition at line 212 of file MultiEMShowers_module.cc.

References fFidVolCut, fMaxx, fMaxy, fMaxz, fMinx, fMiny, and fMinz.

Referenced by Info(), and IsCompton().

213 {
214 
215  bool inside = false;
216  //x
217  double dista = fabs(fMinx - pvtx.X());
218  double distb = fabs(pvtx.X() - fMaxx);
219  if ((pvtx.X() > fMinx) && (pvtx.X() < fMaxx) &&
220  (dista > fFidVolCut) && (distb > fFidVolCut)) inside = true;
221  //y
222  dista = fabs(fMaxy - pvtx.Y());
223  distb = fabs(pvtx.Y() - fMiny);
224  if (inside && (pvtx.Y() > fMiny) && (pvtx.Y() < fMaxy) &&
225  (dista > fFidVolCut) && (distb > fFidVolCut)) inside = true;
226  else inside = false;
227 
228  //z
229  dista = fabs(fMaxz - pvtx.Z());
230  distb = fabs(pvtx.Z() - fMinz);
231  if (inside && (pvtx.Z() > fMinz) && (pvtx.Z() < fMaxz) &&
232  (dista > fFidVolCut) && (distb > fFidVolCut)) inside = true;
233  else inside = false;
234 
235  return inside;
236 }
bool const& ems::MCinfo::IsCompton ( ) const
inline

Definition at line 75 of file MultiEMShowers_module.cc.

References fCompton, and insideFidVol().

Referenced by ems::MultiEMShowers::analyze().

75 { return fCompton; }
bool const& ems::MCinfo::IsInside1 ( ) const
inline

Definition at line 72 of file MultiEMShowers_module.cc.

References fInside1.

Referenced by ems::MultiEMShowers::analyze().

72 { return fInside1; }
bool const& ems::MCinfo::IsInside2 ( ) const
inline

Definition at line 73 of file MultiEMShowers_module.cc.

References fInside2.

Referenced by ems::MultiEMShowers::analyze().

73 { return fInside2; }

Member Data Documentation

bool ems::MCinfo::fCompton
private

Definition at line 95 of file MultiEMShowers_module.cc.

Referenced by Info(), and IsCompton().

TVector3 ems::MCinfo::fConvgamma1
private

Definition at line 99 of file MultiEMShowers_module.cc.

Referenced by GetPosgamma1(), and Info().

TVector3 ems::MCinfo::fConvgamma2
private

Definition at line 100 of file MultiEMShowers_module.cc.

Referenced by GetPosgamma2(), and Info().

double ems::MCinfo::fCosine
private

Definition at line 93 of file MultiEMShowers_module.cc.

Referenced by GetCosine(), and Info().

TVector3 ems::MCinfo::fDirgamma1
private

Definition at line 101 of file MultiEMShowers_module.cc.

Referenced by GetDirgamma1(), and Info().

TVector3 ems::MCinfo::fDirgamma2
private

Definition at line 102 of file MultiEMShowers_module.cc.

Referenced by GetDirgamma2(), and Info().

double ems::MCinfo::fFidVolCut
private

Definition at line 83 of file MultiEMShowers_module.cc.

Referenced by insideFidVol().

double ems::MCinfo::fGammamom1
private

Definition at line 88 of file MultiEMShowers_module.cc.

Referenced by GetMomGamma1(), and Info().

double ems::MCinfo::fGammamom2
private

Definition at line 90 of file MultiEMShowers_module.cc.

Referenced by GetMomGamma2(), and Info().

bool ems::MCinfo::fInside1
private

Definition at line 89 of file MultiEMShowers_module.cc.

Referenced by Info(), and IsInside1().

bool ems::MCinfo::fInside2
private

Definition at line 91 of file MultiEMShowers_module.cc.

Referenced by Info(), and IsInside2().

double ems::MCinfo::fMaxx
private

Definition at line 79 of file MultiEMShowers_module.cc.

Referenced by Findtpcborders(), and insideFidVol().

double ems::MCinfo::fMaxy
private

Definition at line 80 of file MultiEMShowers_module.cc.

Referenced by Findtpcborders(), and insideFidVol().

double ems::MCinfo::fMaxz
private

Definition at line 81 of file MultiEMShowers_module.cc.

Referenced by Findtpcborders(), and insideFidVol().

double ems::MCinfo::fMinx
private

Definition at line 79 of file MultiEMShowers_module.cc.

Referenced by Findtpcborders(), and insideFidVol().

double ems::MCinfo::fMiny
private

Definition at line 80 of file MultiEMShowers_module.cc.

Referenced by Findtpcborders(), and insideFidVol().

double ems::MCinfo::fMinz
private

Definition at line 81 of file MultiEMShowers_module.cc.

Referenced by Findtpcborders(), and insideFidVol().

double ems::MCinfo::fMompi0
private

Definition at line 87 of file MultiEMShowers_module.cc.

Referenced by GetMompi0(), and Info().

int ems::MCinfo::fNgammas
private

Definition at line 85 of file MultiEMShowers_module.cc.

Referenced by GetNgammas(), and Info().

TVector3 ems::MCinfo::fPi0pos
private

Definition at line 98 of file MultiEMShowers_module.cc.

Referenced by GetPospi0(), and Info().

TVector3 ems::MCinfo::fPrimary
private

Definition at line 97 of file MultiEMShowers_module.cc.

Referenced by GetPrimary(), and Info().


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