GeomVolSelectorI.h
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3 
4 \class genie::geometry::GeomVolSelectorI
5 
6 \brief GENIE Interface for user-defined volume selector functors
7 
8 \author Robert Hatcher <rhatcher@fnal.gov>
9  FNAL
10 
11 \created August 25, 2009
12 
13 \cpright Copyright (c) 2003-2019, The GENIE Collaboration
14  For the full text of the license visit http://copyright.genie-mc.org
15  or see $GENIE/LICENSE
16 */
17 //____________________________________________________________________________
18 
19 #ifndef _GEOM_VOL_SELECTOR_I_H_
20 #define _GEOM_VOL_SELECTOR_I_H_
21 
22 #include <string>
23 #include "TLorentzVector.h"
24 
25 namespace genie {
26 namespace geometry {
27 
28 class PathSegment;
29 class PathSegmentList;
30 
32 
33 public :
34  virtual ~GeomVolSelectorI();
35  //
36  // define the GeomVolSelectorI interface:
37  //
38 
39  /// create and return a new PathSegmentList from the old list
40  /// relinquishes ownership of returned object
41  virtual PathSegmentList* GenerateTrimmedList(const PathSegmentList* untrimmed) const;
42 
43  /// This is the method every derived version must implement
44  /// To reject a segment outright: segment.fStepRangeSet.clear()
45  virtual void TrimSegment(PathSegment& segment) const = 0;
46 
47  /// Every derived version must also respond to a signal that starts
48  /// a new path segment list processing and ends it.
49  /// In general they can simply ignore the signal.
50  /// If the derived class needs to cache something, make it mutable
51  virtual void BeginPSList(const PathSegmentList* untrimmed) const = 0;
52  virtual void EndPSList() const = 0;
53 
54  /// configure for individual neutrino ray
55  void SetCurrentRay(const TLorentzVector& x4, const TLorentzVector& p4)
56  { fX4 = x4; fP4 = p4; }
57 
58  /// set scale factor for SI to "raydist" units of PathSegmentList
59  void SetSI2Local(double scale) { fScale = scale; }
60 
61  void SetRemoveEntries(bool rmset) { fRemoveEntries = rmset; }
62  bool GetRemoveEntries() { return fRemoveEntries; }
63 
64  void SetNeedPath() { fNeedPath = true; } /// allow toggle *on* only
65  bool GetNeedPath() const { return fNeedPath; }
66 
67  std::string GetName() const { return fName; }
68 
69 protected:
70 
73 
74  TLorentzVector fX4; ///< current neutrino ray's start position (global)
75  TLorentzVector fP4; ///< current neutrino ray's momentum (global)
76  double fScale; ///< SI->raydist scale factor
77  bool fRemoveEntries; ///< whether selector should remove entries or set hi=lo
78  bool fNeedPath; ///< selector needs PathSegment "path" string
79  std::string fName; ///< volume selector name
80 
81 };
82 
83 } // geometry namespace
84 } // genie namespace
85 
86 #endif // _GEOM_VOL_SELECTOR_I_H_
const XML_Char * name
Definition: expat.h:151
TLorentzVector fP4
current neutrino ray&#39;s momentum (global)
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
virtual void TrimSegment(PathSegment &segment) const =0
bool fNeedPath
selector needs PathSegment "path" string
virtual void BeginPSList(const PathSegmentList *untrimmed) const =0
Object to be filled with the neutrino path-segments representing geometry volume steps (generally bou...
GENIE Interface for user-defined volume selector functors.
std::string fName
volume selector name
Double_t scale
Definition: plot.C:25
bool fRemoveEntries
whether selector should remove entries or set hi=lo
virtual void EndPSList() const =0
bool GetNeedPath() const
allow toggle on only
double fScale
SI->raydist scale factor.
void SetCurrentRay(const TLorentzVector &x4, const TLorentzVector &p4)
configure for individual neutrino ray
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
virtual PathSegmentList * GenerateTrimmedList(const PathSegmentList *untrimmed) const
TLorentzVector fX4
current neutrino ray&#39;s start position (global)
Eigen::Matrix< T, Eigen::Dynamic, 1 > segment(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &v, size_t i, size_t n)
Definition: segment.hpp:17
void SetSI2Local(double scale)
set scale factor for SI to "raydist" units of PathSegmentList