Public Member Functions | Private Member Functions | List of all members
geo::GeometryTest35 Class Reference
Inheritance diagram for geo::GeometryTest35:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Member Functions

 GeometryTest35 (fhicl::ParameterSet const &pset)
 
virtual ~GeometryTest35 ()
 
virtual void analyze (art::Event const &)
 
virtual void beginJob ()
 
- Public Member Functions inherited from art::EDAnalyzer
 EDAnalyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDAnalyzer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Analyzer
virtual ~Analyzer () noexcept
 
 Analyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 Analyzer (Table< Config > const &config)
 
void doBeginJob ()
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Observer
 ~Observer () noexcept
 
 Observer (Observer const &)=delete
 
 Observer (Observer &&)=delete
 
Observeroperator= (Observer const &)=delete
 
Observeroperator= (Observer &&)=delete
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
void fillDescriptions (ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Member Functions

void testAuxDet ()
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- Protected Member Functions inherited from art::Observer
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &paths, fhicl::ParameterSet const &config)
 
detail::ProcessAndEventSelectorsprocessAndEventSelectors ()
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 53 of file GeometryTest35_module.cc.

Constructor & Destructor Documentation

geo::GeometryTest35::GeometryTest35 ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 71 of file GeometryTest35_module.cc.

72  : EDAnalyzer(pset)
73  {
74  }
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:27
geo::GeometryTest35::~GeometryTest35 ( )
virtual

Definition at line 77 of file GeometryTest35_module.cc.

78  {
79  }

Member Function Documentation

virtual void geo::GeometryTest35::analyze ( art::Event const &  )
inlinevirtual

Implements art::EDAnalyzer.

Definition at line 58 of file GeometryTest35_module.cc.

58 {}
void geo::GeometryTest35::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 82 of file GeometryTest35_module.cc.

83  {
84 
85  mf::LogVerbatim("GeometryTest35") << "\n35t specific testing...\n";
86 
87  try{
88 
89  MF_LOG_DEBUG("GeometryTest35") << "test AuxDets...";
90  this->testAuxDet();
91  MF_LOG_DEBUG("GeometryTest35") << "complete.";
92 
93  }
94  catch (cet::exception &e) {
95  mf::LogWarning("GeometryTest35") << "exception caught: \n" << e;
96  }
97 
98  return;
99  }
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
const double e
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
#define MF_LOG_DEBUG(id)
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void geo::GeometryTest35::testAuxDet ( )
private

Definition at line 104 of file GeometryTest35_module.cc.

105  {
107 
108  double origin[3] = {0.};
109  double AuxDetWorld[3] = {0.};
110  mf::LogVerbatim("35tAuxDetTest") << "Number of Aux Dets: " << geom->NAuxDets();
111  for(unsigned int a = 0; a < geom->NAuxDets(); ++a) {
112  geom->AuxDet(a).LocalToWorld(origin, AuxDetWorld);
113 
114  double testPos1[3] = {AuxDetWorld[0], AuxDetWorld[1], AuxDetWorld[2]};
115  double testPos2a[3] = {AuxDetWorld[0], AuxDetWorld[1], AuxDetWorld[2]};
116  double testPos2b[3] = {AuxDetWorld[0], AuxDetWorld[1], AuxDetWorld[2]};
117  std::string CounterType = "";
118 
119  if( strncmp( geom->AuxDet(a).TotalVolume()->GetName(), "volAuxDetTrap", 13 ) == 0 ){
120 
121  // in 35t gdml, width 2 is the smaller width at +z/2 in local coordinates
122  //
123  // Width 2
124  // ____ Height is the thickness
125  // / \ T of the trapezoid
126  // / \ |
127  // / \ | Length
128  // /__________\ _
129  // Width 1
130 
131  CounterType = "trapezoid";
132  testPos1[1] += geom->AuxDet(a).Length()/2 - 0.1;
133  testPos2a[2] += geom->AuxDet(a).HalfWidth2();
134  testPos2b[0] += geom->AuxDet(a).HalfWidth2();
135 
136  double TrapCheckPtA[3] = { AuxDetWorld[0]+geom->AuxDet(a).HalfWidth1(),
137  AuxDetWorld[1]+geom->AuxDet(a).Length()/2-0.1,
138  AuxDetWorld[2]};
139  double TrapCheckPtB[3] = { AuxDetWorld[0],
140  AuxDetWorld[1]+geom->AuxDet(a).Length()/2-0.1,
141  AuxDetWorld[2]+geom->AuxDet(a).HalfWidth1()};
142 
143 
144  // these points are close to the small end and should not be found
145 
146  bool trpCheckpta(true), trpCheckptb(true);
147  try{ trpCheckpta = (geom->FindAuxDetAtPosition(TrapCheckPtA) == a); }
148  catch(cet::exception &e){ trpCheckpta = false; }
149  try{ trpCheckptb = (geom->FindAuxDetAtPosition(TrapCheckPtB) == a); }
150  catch(cet::exception &e){ trpCheckptb = false; }
151 
152  if( trpCheckpta || trpCheckptb )
153  throw cet::exception("GeometryTest35_AuxDet")
154  << "\t ...Found unexpected test point outside of trapezoidal AuxDet "
155  << a << "\n";
156 
157 
158  } else {
159  CounterType = "box";
160  testPos2a[2] += geom->AuxDet(a).HalfWidth2();
161  testPos2b[0] += geom->AuxDet(a).HalfWidth2();
162  }
163 
164  mf::LogVerbatim("GeometryTest35_AuxDet") << "AuxDet " << a << ": " << CounterType
165  << ", Center: (" << AuxDetWorld[0] << ", "
166  << AuxDetWorld[1] << ", " << AuxDetWorld[2] << ")" << std::endl;
167 
168 
169  // if either test point 1 or test point 2 aren't found, something is wrong
170  // one of 2a or 2b should work
171 
172  bool tp1(false), tp2a(false), tp2b(false);
173  try{ tp1 = (geom->FindAuxDetAtPosition(testPos1) == a); }
174  catch(cet::exception &e){ }
175  try{ tp2a = (geom->FindAuxDetAtPosition(testPos2a) == a); }
176  catch(cet::exception &e){ }
177  try{ tp2b = (geom->FindAuxDetAtPosition(testPos2b) == a); }
178  catch(cet::exception &e){ }
179 
180 
181  if( !tp1 || !( tp2a || tp2b ) )
182  throw cet::exception("GeometryTest35_AuxDet")
183  << "\t ...Did not find expected test points around AuxDet "
184  << a << "\n";
185 
186  }// AuxDet loop
187 
188  }
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
void LocalToWorld(const double *auxdet, double *world) const
Transform point from local auxiliary detector frame to world frame.
Definition: AuxDetGeo.h:120
std::string string
Definition: nybbler.cc:12
double HalfWidth2() const
Definition: AuxDetGeo.h:104
const double e
AuxDetGeo const & AuxDet(unsigned int const ad=0) const
Returns the specified auxiliary detector.
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
double Length() const
Definition: AuxDetGeo.h:102
const TGeoVolume * TotalVolume() const
Definition: AuxDetGeo.h:106
unsigned int FindAuxDetAtPosition(double const worldLoc[3]) const
Returns the index of the auxiliary detector at specified location.
double HalfWidth1() const
Definition: AuxDetGeo.h:103
constexpr Point origin()
Returns a origin position with a point of the specified type.
Definition: geo_vectors.h:227
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
unsigned int NAuxDets() const
Returns the number of auxiliary detectors.

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