Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
genie::geometry::PathSegmentList Class Reference

Object to be filled with the neutrino path-segments representing geometry volume steps (generally boundary-to-boundary) along with geometry materials. Good for a single starting position and travelling along the direction of the neutrino 4-momentum. More...

#include "/cvmfs/nova.opensciencegrid.org/externals/genie/v3_00_06_p01/Linux64bit+2.6-2.12-e17-debug/GENIE-Generator/src/Tools/Geometry/PathSegmentList.h"

Public Types

typedef std::list< PathSegmentPathSegmentV_t
 
typedef PathSegmentV_t::const_iterator PathSegVCItr_t
 
typedef std::map< const TGeoMaterial *, Double_t > MaterialMap_t
 
typedef MaterialMap_t::const_iterator MaterialMapCItr_t
 

Public Member Functions

 PathSegmentList ()
 
 PathSegmentList (const PathSegmentList &plist)
 
 ~PathSegmentList ()
 
void SetDoCrossCheck (bool doit=true)
 
void SetPrintVerbose (bool doit=true)
 
void SetAllToZero (void)
 
void SetStartInfo (const TVector3 &pos=TVector3(0, 0, 1e37), const TVector3 &dir=TVector3(0, 0, 0))
 
bool IsSameStart (const TVector3 &pos, const TVector3 &dir) const
 
void AddSegment (const PathSegment &ps)
 
const TVector3 & GetDirection () const
 
const TVector3 & GetStartPos () const
 
const PathSegmentV_tGetPathSegmentV (void) const
 
size_t size (void) const
 
void FillMatStepSum (void)
 
const MaterialMap_tGetMatStepSumMap (void) const
 
void CrossCheck (double &mxddist, double &mxdstep) const
 
void Copy (const PathSegmentList &plist)
 
PathSegmentListoperator= (const PathSegmentList &list)
 
void Print (ostream &stream) const
 

Protected Attributes

TVector3 fStartPos
 Record, for future comparison, the path taken. More...
 
TVector3 fDirection
 direction (in top vol coords) More...
 
PathSegmentV_t fSegmentList
 Actual list of segments. More...
 
MaterialMap_t fMatStepSum
 Segment list re-evaluated by material for fast lookup of path lengths. More...
 
bool fDoCrossCheck
 
bool fPrintVerbose
 

Friends

ostream & operator<< (ostream &stream, const PathSegmentList &list)
 

Detailed Description

Object to be filled with the neutrino path-segments representing geometry volume steps (generally boundary-to-boundary) along with geometry materials. Good for a single starting position and travelling along the direction of the neutrino 4-momentum.

Author
Robert Hatcher rhatc.nosp@m.her@.nosp@m.fnal..nosp@m.gov FNAL

May 26, 2009

Copyright (c) 2003-2019, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org or see $GENIE/LICENSE

Definition at line 124 of file PathSegmentList.h.

Member Typedef Documentation

typedef std::map<const TGeoMaterial*,Double_t> genie::geometry::PathSegmentList::MaterialMap_t

Definition at line 148 of file PathSegmentList.h.

typedef MaterialMap_t::const_iterator genie::geometry::PathSegmentList::MaterialMapCItr_t

Definition at line 149 of file PathSegmentList.h.

Definition at line 142 of file PathSegmentList.h.

typedef PathSegmentV_t::const_iterator genie::geometry::PathSegmentList::PathSegVCItr_t

Definition at line 143 of file PathSegmentList.h.

Constructor & Destructor Documentation

PathSegmentList::PathSegmentList ( void  )

Definition at line 231 of file PathSegmentList.cxx.

PathSegmentList::PathSegmentList ( const PathSegmentList plist)

Definition at line 237 of file PathSegmentList.cxx.

References Copy().

238 {
239  this->Copy(plist);
240 }
void Copy(const PathSegmentList &plist)
PathSegmentList::~PathSegmentList ( )

Definition at line 242 of file PathSegmentList.cxx.

243 {
244 
245 }

Member Function Documentation

void genie::geometry::PathSegmentList::AddSegment ( const PathSegment ps)
inline
void PathSegmentList::Copy ( const PathSegmentList plist)

Definition at line 288 of file PathSegmentList.cxx.

References fDirection, fDoCrossCheck, fMatStepSum, fPrintVerbose, fSegmentList, and fStartPos.

Referenced by operator=(), and PathSegmentList().

289 {
290  fSegmentList.clear();
291  fMatStepSum.clear();
292 
293  // copy the segments
294  //vector<PathSegment>::const_iterator pl_iter;
295  //for (pl_iter = plist.fSegmentList.begin(); pl_iter != plist.fSegmentList.end(); ++pl_iter) {
296  // this->fSegmentList.push_back( *pl_iter );
297  //}
298 
299  // other elements
300  fStartPos = plist.fStartPos;
301  fDirection = plist.fDirection;
302  fSegmentList = plist.fSegmentList;
303  fMatStepSum = plist.fMatStepSum;
306 }
PathSegmentV_t fSegmentList
Actual list of segments.
MaterialMap_t fMatStepSum
Segment list re-evaluated by material for fast lookup of path lengths.
TVector3 fStartPos
Record, for future comparison, the path taken.
TVector3 fDirection
direction (in top vol coords)
void PathSegmentList::CrossCheck ( double &  mxddist,
double &  mxdstep 
) const

Definition at line 309 of file PathSegmentList.cxx.

References genie::geometry::PathSegment::DoCrossCheck(), fSegmentList, fStartPos, and nd_projection_maker::ps.

Referenced by genie::geometry::ROOTGeomAnalyzer::GenerateVertex(), and genie::geometry::ROOTGeomAnalyzer::SwimOnce().

310 {
311 
312  double dstep, ddist;
313  mxdstep = 0;
314  mxddist = 0;
317  for ( ; sitr != sitr_end ; ++sitr ) {
318  const PathSegment& ps = *sitr;
319  ps.DoCrossCheck(fStartPos,ddist,dstep);
320  double addist = TMath::Abs(ddist);
321  double adstep = TMath::Abs(dstep);
322  if ( addist > mxddist ) mxddist = addist;
323  if ( adstep > mxdstep ) mxdstep = adstep;
324  }
325 
326 }
PathSegmentV_t fSegmentList
Actual list of segments.
TVector3 fStartPos
Record, for future comparison, the path taken.
PathSegmentV_t::const_iterator PathSegVCItr_t
void DoCrossCheck(const TVector3 &startpos, double &ddist, double &dstep) const
perform cross check on segment, return differences
void PathSegmentList::FillMatStepSum ( void  )

Definition at line 272 of file PathSegmentList.cxx.

References genie::geometry::PathSegment::fMaterial, fMatStepSum, fSegmentList, genie::geometry::PathSegment::GetSummedStepRange(), and nd_projection_maker::ps.

Referenced by genie::geometry::ROOTGeomAnalyzer::SwimOnce().

273 {
274  fMatStepSum.clear();
275 
278  for ( ; sitr != sitr_end ; ++sitr ) {
279  const PathSegment& ps = *sitr;
280  const TGeoMaterial* mat = ps.fMaterial;
281  // use the post-trim limits on how much material is stepped through
283  }
284 
285 }
PathSegmentV_t fSegmentList
Actual list of segments.
MaterialMap_t fMatStepSum
Segment list re-evaluated by material for fast lookup of path lengths.
const TGeoMaterial * fMaterial
ref only ptr to TGeoMaterial
PathSegmentV_t::const_iterator PathSegVCItr_t
Double_t GetSummedStepRange() const
get the sum of all the step range (in case step has been trimmed or split)
Eigen::MatrixXd mat
const TVector3& genie::geometry::PathSegmentList::GetDirection ( ) const
inline
const MaterialMap_t& genie::geometry::PathSegmentList::GetMatStepSumMap ( void  ) const
inline

Definition at line 152 of file PathSegmentList.h.

References genie::geometry::PathSegment::operator<<, and genie::geometry::PathSegment::Print().

Referenced by genie::geometry::ROOTGeomAnalyzer::ComputePathLengthPDG(), genie::geometry::ROOTGeomAnalyzer::GenerateVertex(), and Print().

152 { return fMatStepSum; };
MaterialMap_t fMatStepSum
Segment list re-evaluated by material for fast lookup of path lengths.
const PathSegmentV_t& genie::geometry::PathSegmentList::GetPathSegmentV ( void  ) const
inline
const TVector3& genie::geometry::PathSegmentList::GetStartPos ( ) const
inline
bool PathSegmentList::IsSameStart ( const TVector3 &  pos,
const TVector3 &  dir 
) const

Definition at line 266 of file PathSegmentList.cxx.

References fDirection, and fStartPos.

Referenced by genie::geometry::ROOTGeomAnalyzer::SwimOnce().

267 {
268  return ( this->fStartPos == pos && this->fDirection == dir );
269 }
TVector3 fStartPos
Record, for future comparison, the path taken.
TVector3 fDirection
direction (in top vol coords)
TDirectory * dir
Definition: macro.C:5
PathSegmentList & PathSegmentList::operator= ( const PathSegmentList list)

Definition at line 485 of file PathSegmentList.cxx.

References Copy().

486 {
487  this->Copy(list);
488  return (*this);
489 }
void Copy(const PathSegmentList &plist)
void PathSegmentList::Print ( ostream &  stream) const

Definition at line 329 of file PathSegmentList.cxx.

References clear, febshutoff_auto::end, allTimeWatchdog::endl, fDirection, fDoCrossCheck, shutoffs::filename, genie::PDGLibrary::Find(), fPrintVerbose, fSegmentList, fStartPos, genie::utils::xml::GetAttribute(), GetMatStepSumMap(), genie::PDGLibrary::Instance(), genie::kXmlEmpty, genie::kXmlInvalidRoot, genie::kXmlNotParsed, genie::kXmlOK, LOG, pDEBUG, pERROR, pINFO, std_candles::pl, nd_projection_maker::ps, genie::utils::str::TrimSpaces(), and genie::pathsegutils::Vec3AsString().

Referenced by genie::geometry::operator<<().

330 {
331  stream << "\nPathSegmentList [-]" << endl;
333  << " dir " << pathsegutils::Vec3AsString(&fDirection) << endl;
334 
335  double dstep, ddist, mxdstep = 0, mxddist = 0;
336  int k = 0, nseg = 0;
339  for ( ; sitr != sitr_end ; ++sitr, ++k ) {
340  const PathSegment& ps = *sitr;
341  ++nseg;
342  stream << " [" << setw(4) << k << "] " << ps;
343  if ( fDoCrossCheck ) {
344  ps.DoCrossCheck(fStartPos,ddist,dstep);
345  double addist = TMath::Abs(ddist);
346  double adstep = TMath::Abs(dstep);
347  if ( addist > mxddist ) mxddist = addist;
348  if ( adstep > mxdstep ) mxdstep = adstep;
349  stream << " recalc diff"
350  << " dist " << std::setw(12) << ddist
351  << " step " << std::setw(12) << dstep;
352  }
353  stream << std::endl;
354  }
355  if ( nseg == 0 ) stream << " holds no segments." << std::endl;
356 
357  if ( fDoCrossCheck )
358  stream << "PathSegmentList "
359  << " mxddist " << mxddist
360  << " mxdstep " << mxdstep
361  << std::endl;
362 
363  if ( fPrintVerbose ) {
366  // loop over map to get tgt weight for each material (once)
367  // steps outside the geometry may have no assigned material
368  for ( ; mitr != mitr_end; ++mitr ) {
369  const TGeoMaterial* mat = mitr->first;
370  double sumsteps = mitr->second;
371  stream << " fMatStepSum[" << mat->GetName() << "] = " << sumsteps << std::endl;
372  }
373  }
374 
375 }
PathSegmentV_t fSegmentList
Actual list of segments.
string Vec3AsString(const TVector3 *vec)
TVector3 fStartPos
Record, for future comparison, the path taken.
PathSegmentV_t::const_iterator PathSegVCItr_t
TVector3 fDirection
direction (in top vol coords)
MaterialMap_t::const_iterator MaterialMapCItr_t
const MaterialMap_t & GetMatStepSumMap(void) const
Eigen::MatrixXd mat
void PathSegmentList::SetAllToZero ( void  )

Definition at line 248 of file PathSegmentList.cxx.

References fDirection, fMatStepSum, fSegmentList, fStartPos, LOG, and pDEBUG.

Referenced by genie::geometry::ROOTGeomAnalyzer::SwimOnce().

249 {
250  LOG("PathS", pDEBUG) << "SetAllToZero called";
251 
252  this->fStartPos.SetXYZ(0,0,1e37); // clear cache of position/direction
253  this->fDirection.SetXYZ(0,0,0); //
254  this->fSegmentList.clear(); // clear the vector
255  this->fMatStepSum.clear(); // clear the re-factorized info
256 }
PathSegmentV_t fSegmentList
Actual list of segments.
MaterialMap_t fMatStepSum
Segment list re-evaluated by material for fast lookup of path lengths.
TVector3 fStartPos
Record, for future comparison, the path taken.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
TVector3 fDirection
direction (in top vol coords)
#define pDEBUG
Definition: Messenger.h:64
void genie::geometry::PathSegmentList::SetDoCrossCheck ( bool  doit = true)
inline
void genie::geometry::PathSegmentList::SetPrintVerbose ( bool  doit = true)
inline

Definition at line 132 of file PathSegmentList.h.

References dir, and elec2geo::pos.

Referenced by genie::geometry::ROOTGeomAnalyzer::SwimOnce().

void PathSegmentList::SetStartInfo ( const TVector3 &  pos = TVector3(0,0,1e37),
const TVector3 &  dir = TVector3(0,0,0) 
)

Definition at line 259 of file PathSegmentList.cxx.

References dir, fDirection, fStartPos, and elec2geo::pos.

Referenced by genie::geometry::GeomVolSelectorI::GenerateTrimmedList(), and genie::geometry::ROOTGeomAnalyzer::SwimOnce().

260 {
261  this->fStartPos = pos;
262  this->fDirection = dir;
263 }
TVector3 fStartPos
Record, for future comparison, the path taken.
TVector3 fDirection
direction (in top vol coords)
TDirectory * dir
Definition: macro.C:5
size_t genie::geometry::PathSegmentList::size ( void  ) const
inline

Definition at line 146 of file PathSegmentList.h.

Referenced by genie::geometry::ROOTGeomAnalyzer::SwimOnce().

146 { return fSegmentList.size(); }
PathSegmentV_t fSegmentList
Actual list of segments.

Friends And Related Function Documentation

ostream& operator<< ( ostream &  stream,
const PathSegmentList list 
)
friend

Definition at line 94 of file PathSegmentList.cxx.

95  {
96  list.Print(stream);
97  return stream;
98  }
void Print(ostream &stream) const

Member Data Documentation

TVector3 genie::geometry::PathSegmentList::fDirection
protected

direction (in top vol coords)

Definition at line 171 of file PathSegmentList.h.

Referenced by Copy(), IsSameStart(), Print(), SetAllToZero(), and SetStartInfo().

bool genie::geometry::PathSegmentList::fDoCrossCheck
protected

Definition at line 179 of file PathSegmentList.h.

Referenced by Copy(), and Print().

MaterialMap_t genie::geometry::PathSegmentList::fMatStepSum
protected

Segment list re-evaluated by material for fast lookup of path lengths.

Definition at line 177 of file PathSegmentList.h.

Referenced by Copy(), FillMatStepSum(), and SetAllToZero().

bool genie::geometry::PathSegmentList::fPrintVerbose
protected

Definition at line 180 of file PathSegmentList.h.

Referenced by Copy(), and Print().

PathSegmentV_t genie::geometry::PathSegmentList::fSegmentList
protected

Actual list of segments.

Definition at line 174 of file PathSegmentList.h.

Referenced by Copy(), CrossCheck(), FillMatStepSum(), Print(), and SetAllToZero().

TVector3 genie::geometry::PathSegmentList::fStartPos
protected

Record, for future comparison, the path taken.

starting position (in top vol coords)

Definition at line 170 of file PathSegmentList.h.

Referenced by Copy(), CrossCheck(), IsSameStart(), Print(), SetAllToZero(), and SetStartInfo().


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