LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
ems::ShowersCollection Class Reference

Public Member Functions

 ShowersCollection (ShowerInfo const &part)
 
double MinAngle (ShowersCollection const &col2)
 
void Merge (ShowersCollection const &col2)
 
void Merge (ShowerInfo const &src)
 
double Angle (TVector3 p0, TVector3 test)
 
double Angle (TVector3 test)
 
size_t Size ()
 
std::vector< ShowerInfo > const & GetParts (void) const
 
bool IsClean ()
 
int PlaneId ()
 
TVector3 Front ()
 
TVector3 Dir ()
 
std::vector< double > DeDx (void)
 
std::vector< double > TotEn (void)
 

Public Attributes

ShowerInfo first
 

Private Attributes

bool Clean
 
int GId
 
std::vector< ShowerInfofParts
 

Detailed Description

Definition at line 169 of file MergeEMShower3D_module.cc.

Constructor & Destructor Documentation

ems::ShowersCollection::ShowersCollection ( ShowerInfo const &  part)

Definition at line 202 of file MergeEMShower3D_module.cc.

References Clean, fParts, ems::ShowerInfo::GetGid(), and GId.

202  :
203 first(part)
204 {
205  Clean = true;
206  GId = part.GetGid();
207  if (GId == 9999)
208  Clean = false;
209 
210  fParts.push_back(part);
211 }
TString part[npart]
Definition: Style.C:32
std::vector< ShowerInfo > fParts

Member Function Documentation

double ems::ShowersCollection::Angle ( TVector3  p0,
TVector3  test 
)

Definition at line 257 of file MergeEMShower3D_module.cc.

References Front(), and fhicl::has_insertion_operator_impl::test().

258 {
259  p0 = Front() - p0;
260  p0 *= 1.0 / p0.Mag();
261  test -= Front();
262  test *= 1.0 / test.Mag();
263  double c = p0 * test;
264  if (c > 1.0) c = 1.0;
265  return 180.0 * acos(c) / TMath::Pi();
266 }
double ems::ShowersCollection::Angle ( TVector3  test)

Definition at line 268 of file MergeEMShower3D_module.cc.

References Dir(), Front(), and fhicl::has_insertion_operator_impl::test().

269 {
270  test -= Front();
271  test *= 1.0 / test.Mag();
272  double c = Dir() * test;
273  if (c > 1.0) c = 1.0;
274  return 180.0 * acos(c) / TMath::Pi();
275 }
std::vector< double > ems::ShowersCollection::DeDx ( void  )

Definition at line 231 of file MergeEMShower3D_module.cc.

References fParts.

232 {
233  if (fParts.size()) return fParts.front().GetDedx();
234  else return std::vector<double>(0.0);
235 }
std::vector< ShowerInfo > fParts
TVector3 ems::ShowersCollection::Dir ( )

Definition at line 225 of file MergeEMShower3D_module.cc.

References fParts.

Referenced by Angle().

226 {
227  if (fParts.size()) return fParts.front().GetDir();
228  else return TVector3(0, 0, 0);
229 }
std::vector< ShowerInfo > fParts
TVector3 ems::ShowersCollection::Front ( )

Definition at line 219 of file MergeEMShower3D_module.cc.

References fParts.

Referenced by Angle().

220 {
221  if (fParts.size()) return fParts.front().GetFront();
222  else return TVector3(0, 0, 0);
223 }
std::vector< ShowerInfo > fParts
std::vector< ShowerInfo > const& ems::ShowersCollection::GetParts ( void  ) const
inline

Definition at line 184 of file MergeEMShower3D_module.cc.

184 { return fParts; }
std::vector< ShowerInfo > fParts
bool ems::ShowersCollection::IsClean ( )
inline

Definition at line 186 of file MergeEMShower3D_module.cc.

void ems::ShowersCollection::Merge ( ShowersCollection const &  col2)

Definition at line 290 of file MergeEMShower3D_module.cc.

References Clean, and fParts.

291 {
292  for (size_t i = 0; i < col2.fParts.size(); ++i)
293  for (size_t j = 0; j < fParts.size(); ++j)
294  if (fParts[j].GetGid() != col2.fParts[i].GetGid())
295  {
296  Clean = false;
297  break;
298  }
299 
300  for (size_t i = 0; i < col2.fParts.size(); ++i)
301  fParts.push_back(col2.fParts[i]);
302 
303 }
std::vector< ShowerInfo > fParts
void ems::ShowersCollection::Merge ( ShowerInfo const &  src)

Definition at line 305 of file MergeEMShower3D_module.cc.

References Clean, fParts, ems::ShowerInfo::GetGid(), and GId.

306 {
307  if (fParts.size())
308  {
309  for (auto const & p : fParts)
310  if (p.GetGid() != src.GetGid())
311  {
312  Clean = false;
313  break;
314  }
315  }
316  else
317  {
318  Clean = true;
319  GId = src.GetGid();
320  }
321  fParts.push_back(src);
322 }
std::vector< ShowerInfo > fParts
double ems::ShowersCollection::MinAngle ( ShowersCollection const &  col2)

Definition at line 278 of file MergeEMShower3D_module.cc.

References first, fParts, and ems::ShowerInfo::Pointsto().

279 {
280  double a, a_min = 360.0;
281  for (size_t i = 0; i < fParts.size(); ++i)
282  {
283  const ShowerInfo& temp = fParts[i];
284  a = col2.first.Pointsto(temp);
285  if (a < a_min) a_min = a;
286  }
287  return a_min;
288 }
std::vector< ShowerInfo > fParts
int ems::ShowersCollection::PlaneId ( )

Definition at line 213 of file MergeEMShower3D_module.cc.

References fParts.

214 {
215  if (fParts.size()) return fParts.front().GetPlaneId();
216  else return 0;
217 }
std::vector< ShowerInfo > fParts
size_t ems::ShowersCollection::Size ( )
inline

Definition at line 182 of file MergeEMShower3D_module.cc.

182 {return fParts.size();}
std::vector< ShowerInfo > fParts
std::vector< double > ems::ShowersCollection::TotEn ( void  )

Definition at line 237 of file MergeEMShower3D_module.cc.

References fParts.

238 {
239  std::vector<double> en;
240 
241  double enkU = 0.0; double enkV = 0.0; double enkZ = 0.0;
242  for (size_t i = 0; i < fParts.size(); ++i)
243  {
244  std::vector<double> showeren = fParts[i].GetEnTot();
245  enkU += showeren[0];
246  enkV += showeren[1];
247  enkZ += showeren[2];
248  }
249 
250  en.push_back(enkU);
251  en.push_back(enkV);
252  en.push_back(enkZ);
253 
254  return en;
255 }
std::vector< ShowerInfo > fParts

Member Data Documentation

bool ems::ShowersCollection::Clean
private

Definition at line 197 of file MergeEMShower3D_module.cc.

Referenced by Merge(), and ShowersCollection().

ShowerInfo ems::ShowersCollection::first

Definition at line 194 of file MergeEMShower3D_module.cc.

Referenced by MinAngle().

std::vector< ShowerInfo > ems::ShowersCollection::fParts
private
int ems::ShowersCollection::GId
private

Definition at line 198 of file MergeEMShower3D_module.cc.

Referenced by Merge(), and ShowersCollection().


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