Public Member Functions | Private Attributes | List of all members
beamlinegeo::BeamlineGeometry Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-02/BeamlineUtils/BeamlineGeometry.h"

Public Member Functions

 BeamlineGeometry (const fhicl::ParameterSet &pset)
 Implementation of beamline geometry service. More...
 
 BeamlineGeometry (const fhicl::ParameterSet &pset, art::ActivityRegistry &)
 
void MakeObjects ()
 
void ConfigureGeometry (const fhicl::ParameterSet &pset)
 
unsigned int NumToFs () const
 Number of ToF counters in beamline. More...
 
unsigned int NumWCs () const
 Number of WCs in beamline. More...
 
unsigned int NumCherenkov () const
 Number of Cherenkov detectors in beamline. More...
 
unsigned int NumToFCounters (DetectorID tof) const
 Number of counter of this ToF. More...
 
unsigned int NumWCChannels (DetectorID wc) const
 Number of channels on this WC. More...
 
BeamlineObject GetBeamlineObject (BeamlineComponent component) const
 Return beamline object for a BeamlineComponent. More...
 
BeamlineObject GetBeamlineObject (ChannelID channel) const
 Return beamline object for a ChannelID. More...
 
BeamlineObject GetBeamlineObject (DetectorID detector) const
 Return beamline object for a DetectorID. More...
 
DetectorID GetDetectorID (BeamlineObject object) const
 Return DetectorID for a beamline object. More...
 
DetectorID GetDetectorID (BeamlineComponent component) const
 Return DetectorID for a BeamlineComponent. More...
 
float MagnetAngle () const
 Magnet angle. More...
 
float MagnetEffectiveLength () const
 Effective length of the magnet. More...
 
float MagnetMidplaneIntercept () const
 Intercept of the magnet midplane? More...
 
unsigned int NumWCPlaneWires () const
 Number of wires on each WC plane. More...
 
float WCWirePitch () const
 Wire chamber wire pitch. More...
 
float WCAngle (unsigned int wc) const
 WC angle. More...
 
TVector3 BeamlineToNOvADetectorCoords (TVector3 vec) const
 
TVector3 NOvADetectorToBeamlineCoords (TVector3 vec) const
 
TVector3 BeamlineComponentPos (BeamlineComponent component, BeamlineCoordSystem system) const
 
std::vector< SystemIDSystemIDs () const
 SystemIDs. More...
 
std::vector< DetectorIDDetectorIDs () const
 DetectorIDs. More...
 
std::vector< ChannelIDChannelIDs () const
 ChannelIDs. More...
 

Private Attributes

unsigned int fNumToFs
 
unsigned int fNumWCs
 
unsigned int fNumCherenkov
 
std::vector< unsigned intfNumToFCounters
 
float fMagnetAngle
 
float fMagnetEffectiveLength
 
float fMagnetMidplaneIntercept
 
unsigned int fNumWCPlaneWires
 
float fWCWirePitch
 
std::vector< float > fWCAngles
 
std::map< BeamlineComponent, BeamlineObjectfBeamlineObjects
 
TVector3 fNOvACoordOrigin
 

Detailed Description

Definition at line 194 of file BeamlineGeometry.h.

Constructor & Destructor Documentation

beamlinegeo::BeamlineGeometry::BeamlineGeometry ( const fhicl::ParameterSet pset)

Implementation of beamline geometry service.

BeamlineGeometry.h

Author
Mike Wallbank (University of Cincinnati) wallb.nosp@m.ank@.nosp@m.fnal..nosp@m.gov
Date
August 2019

Definition at line 11 of file BeamlineGeometry_service.cc.

References ConfigureGeometry(), and MakeObjects().

11  {
12  this->MakeObjects();
13  this->ConfigureGeometry(pset);
14 }
void ConfigureGeometry(const fhicl::ParameterSet &pset)
beamlinegeo::BeamlineGeometry::BeamlineGeometry ( const fhicl::ParameterSet pset,
art::ActivityRegistry  
)

Definition at line 17 of file BeamlineGeometry_service.cc.

18  : BeamlineGeometry(pset) {
19 }
BeamlineGeometry(const fhicl::ParameterSet &pset)
Implementation of beamline geometry service.

Member Function Documentation

TVector3 beamlinegeo::BeamlineGeometry::BeamlineComponentPos ( BeamlineComponent  component,
BeamlineCoordSystem  system 
) const

Get the position of a beamline component in the specified coordinate system

Definition at line 210 of file BeamlineGeometry_service.cc.

References BeamlineToNOvADetectorCoords(), DEFINE_ART_SERVICE, GetBeamlineObject(), beamlinegeo::NOvADetector, elec2geo::pos, and beamlinegeo::BeamlineObject::Position.

Referenced by tbana::DSToFAna::AnalyzeDSToF2Location(), testbeam::BeamlineEventDisplay::DrawCkov(), testbeam::BeamlineEventDisplay::DrawMagnet(), testbeam::BeamlineEventDisplay::DrawNOvA(), testbeam::BeamlineEventDisplay::DrawToF(), testbeam::BeamlineEventDisplay::DrawWC(), testbeam::BeamlineEventDisplay::DrawWCTrack(), beamlinereco::WCTrackAlg::findTheHitPositions(), beamlinereco::WCTrackAlg::projectToDetector(), and beamlinereco::WCTrackAlg::projectToMagnetFace().

211  {
212  BeamlineObject obj = this->GetBeamlineObject(component);
213  TVector3 pos = obj.Position;
215  pos = this->BeamlineToNOvADetectorCoords(pos);
216  return pos;
217 }
system("rm -rf microbeam.root")
TVector3 BeamlineToNOvADetectorCoords(TVector3 vec) const
BeamlineObject GetBeamlineObject(BeamlineComponent component) const
Return beamline object for a BeamlineComponent.
TVector3 beamlinegeo::BeamlineGeometry::BeamlineToNOvADetectorCoords ( TVector3  vec) const

Convert a position vector in beamline coordinates to NOvA detector coordinates

Definition at line 200 of file BeamlineGeometry_service.cc.

References fNOvACoordOrigin.

Referenced by BeamlineComponentPos().

200  {
201  return vec-fNOvACoordOrigin;
202 }
Eigen::VectorXd vec
std::vector<ChannelID> beamlinegeo::BeamlineGeometry::ChannelIDs ( ) const

ChannelIDs.

void beamlinegeo::BeamlineGeometry::ConfigureGeometry ( const fhicl::ParameterSet pset)

Definition at line 49 of file BeamlineGeometry_service.cc.

References beamlinegeo::Cherenkov, beamlinegeo::CollimatorDS, beamlinegeo::CollimatorUS, fBeamlineObjects, fMagnetAngle, fMagnetEffectiveLength, fMagnetMidplaneIntercept, fNOvACoordOrigin, fNumCherenkov, fNumToFCounters, fNumToFs, fNumWCPlaneWires, fNumWCs, fWCAngles, fWCWirePitch, fhicl::ParameterSet::get(), beamlinegeo::HeliumPipe1, beamlinegeo::HeliumPipe2, beamlinegeo::HeliumPipe3, beamlinegeo::HeliumPipe4, beamlinegeo::Magnet, beamlinegeo::NOvA, beamlinegeo::Shielding1, beamlinegeo::Shielding2, beamlinegeo::Shielding3, beamlinegeo::Target, beamlinegeo::ToFDS, beamlinegeo::ToFDSSiPM, beamlinegeo::ToFUS, beamlinegeo::WC1, beamlinegeo::WC2, beamlinegeo::WC3, and beamlinegeo::WC4.

Referenced by BeamlineGeometry().

49  {
50 
51  fhicl::ParameterSet geometry = pset.get<fhicl::ParameterSet>("Geometry");
52  fNumToFs = geometry.get<unsigned int>("NumToFs");
53  fNumWCs = geometry.get<unsigned int>("NumWCs");
54  fNumCherenkov = geometry.get<unsigned int>("NumCherenkov");
55 
56  fNumToFCounters = geometry.get<std::vector<unsigned int> >("NumToFCounters");
57 
58  fMagnetAngle = geometry.get<float>("MagnetAngle");
59  fMagnetEffectiveLength = geometry.get<float>("MagnetEffectiveLength");
60  fMagnetMidplaneIntercept = geometry.get<float>("MagnetMidplaneIntercept");
61 
62  fNumWCPlaneWires = geometry.get<unsigned int> ("NumWCPlaneWires");
63  fWCWirePitch = geometry.get<float> ("WCWirePitch");
64  fWCAngles = geometry.get<std::vector<float> >("WCAngles");
65 
66  fhicl::ParameterSet positions = geometry.get<fhicl::ParameterSet>("Positions");
68  = TVector3(&positions.get<std::vector<float> >("Target")[0]);
70  = TVector3(&positions.get<std::vector<float> >("ToFUS")[0]);
72  = TVector3(&positions.get<std::vector<float> >("ToFDS")[0]);
74  = TVector3(&positions.get<std::vector<float> >("ToFDSSiPM")[0]);
76  = TVector3(&positions.get<std::vector<float> >("WC1")[0]);
78  = TVector3(&positions.get<std::vector<float> >("WC2")[0]);
80  = TVector3(&positions.get<std::vector<float> >("WC3")[0]);
82  = TVector3(&positions.get<std::vector<float> >("WC4")[0]);
84  = TVector3(&positions.get<std::vector<float> >("Cherenkov")[0]);
86  = TVector3(&positions.get<std::vector<float> >("NOvA")[0]);
88  = TVector3(&positions.get<std::vector<float> >("Magnet")[0]);
90  = TVector3(&positions.get<std::vector<float> >("CollimatorUS")[0]);
92  = TVector3(&positions.get<std::vector<float> >("CollimatorDS")[0]);
94  = TVector3(&positions.get<std::vector<float> >("Shielding1")[0]);
96  = TVector3(&positions.get<std::vector<float> >("Shielding2")[0]);
98  = TVector3(&positions.get<std::vector<float> >("Shielding3")[0]);
100  = TVector3(&positions.get<std::vector<float> >("HeliumPipe1")[0]);
102  = TVector3(&positions.get<std::vector<float> >("HeliumPipe2")[0]);
104  = TVector3(&positions.get<std::vector<float> >("HeliumPipe3")[0]);
106  = TVector3(&positions.get<std::vector<float> >("HeliumPipe4")[0]);
107 
109 
110  return;
111 
112 }
std::vector< unsigned int > fNumToFCounters
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::vector< float > fWCAngles
std::map< BeamlineComponent, BeamlineObject > fBeamlineObjects
std::vector<DetectorID> beamlinegeo::BeamlineGeometry::DetectorIDs ( ) const

DetectorIDs.

beamlinegeo::BeamlineObject beamlinegeo::BeamlineGeometry::GetBeamlineObject ( BeamlineComponent  component) const

Return beamline object for a BeamlineComponent.

Definition at line 145 of file BeamlineGeometry_service.cc.

References test_component::component, om::cout, allTimeWatchdog::endl, and fBeamlineObjects.

Referenced by BeamlineComponentPos().

145  {
146  if (!fBeamlineObjects.count(component)) {
147  std::cout << "No beamline object " << static_cast<unsigned int>(component) << std::endl;
148  abort();
149  }
150  return fBeamlineObjects.at(component);
151 }
OStream cout
Definition: OStream.cxx:6
std::map< BeamlineComponent, BeamlineObject > fBeamlineObjects
BeamlineObject beamlinegeo::BeamlineGeometry::GetBeamlineObject ( ChannelID  channel) const

Return beamline object for a ChannelID.

BeamlineObject beamlinegeo::BeamlineGeometry::GetBeamlineObject ( DetectorID  detector) const

Return beamline object for a DetectorID.

DetectorID beamlinegeo::BeamlineGeometry::GetDetectorID ( BeamlineObject  object) const

Return DetectorID for a beamline object.

DetectorID beamlinegeo::BeamlineGeometry::GetDetectorID ( BeamlineComponent  component) const

Return DetectorID for a BeamlineComponent.

float beamlinegeo::BeamlineGeometry::MagnetAngle ( ) const
float beamlinegeo::BeamlineGeometry::MagnetEffectiveLength ( ) const

Effective length of the magnet.

Definition at line 171 of file BeamlineGeometry_service.cc.

References fMagnetEffectiveLength.

Referenced by beamlinereco::WCTrackAlg::calculateRecoP(), and beamlinereco::WCTrackAlg::projectToMagnetFace().

171  {
172  return fMagnetEffectiveLength;
173 }
float beamlinegeo::BeamlineGeometry::MagnetMidplaneIntercept ( ) const

Intercept of the magnet midplane?

Definition at line 176 of file BeamlineGeometry_service.cc.

References fMagnetMidplaneIntercept.

Referenced by beamlinereco::WCTrackAlg::calculateTrackKink_Dists().

176  {
178 }
void beamlinegeo::BeamlineGeometry::MakeObjects ( )

Definition at line 22 of file BeamlineGeometry_service.cc.

References beamlinegeo::Cherenkov, beamlinegeo::CollimatorDS, fBeamlineObjects, beamlinegeo::HeliumPipe1, beamlinegeo::HeliumPipe2, beamlinegeo::HeliumPipe3, beamlinegeo::HeliumPipe4, beamlinegeo::Magnet, beamlinegeo::NOvA, beamlinegeo::Shielding1, beamlinegeo::Shielding2, beamlinegeo::Shielding3, beamlinegeo::Target, beamlinegeo::ToFDS, beamlinegeo::ToFDSSiPM, beamlinegeo::ToFUS, beamlinegeo::WC1, beamlinegeo::WC2, beamlinegeo::WC3, and beamlinegeo::WC4.

Referenced by BeamlineGeometry().

22  {
23 
24  // Make beamline objects
45 
46 }
std::map< BeamlineComponent, BeamlineObject > fBeamlineObjects
TVector3 beamlinegeo::BeamlineGeometry::NOvADetectorToBeamlineCoords ( TVector3  vec) const

Convert a position vector in NOvA detector coordinates to beamline coordinates

Definition at line 205 of file BeamlineGeometry_service.cc.

References fNOvACoordOrigin.

Referenced by testbeam::BeamlineEventDisplay::DrawNOvATracks().

205  {
206  return vec+fNOvACoordOrigin;
207 }
Eigen::VectorXd vec
unsigned int beamlinegeo::BeamlineGeometry::NumCherenkov ( ) const

Number of Cherenkov detectors in beamline.

Definition at line 125 of file BeamlineGeometry_service.cc.

References fNumCherenkov.

125  {
126  return fNumCherenkov;
127 }
unsigned int beamlinegeo::BeamlineGeometry::NumToFCounters ( DetectorID  tof) const

Number of counter of this ToF.

Definition at line 130 of file BeamlineGeometry_service.cc.

References om::cout, beamlinegeo::DetectorID::Detector, allTimeWatchdog::endl, and fNumToFCounters.

130  {
131  if (tof.Detector >= fNumToFCounters.size()) {
132  std::cout << "ToF detector " << tof.Detector << " does not exist." << std::endl;
133  abort();
134  }
135  return fNumToFCounters.at(tof.Detector);
136 }
std::vector< unsigned int > fNumToFCounters
OStream cout
Definition: OStream.cxx:6
unsigned int beamlinegeo::BeamlineGeometry::NumToFs ( ) const

Number of ToF counters in beamline.

Definition at line 115 of file BeamlineGeometry_service.cc.

References fNumToFs.

115  {
116  return fNumToFs;
117 }
unsigned int beamlinegeo::BeamlineGeometry::NumWCChannels ( DetectorID  wc) const

Number of channels on this WC.

Definition at line 139 of file BeamlineGeometry_service.cc.

References om::cout, and allTimeWatchdog::endl.

139  {
140  std::cout << "Warning: BeamlineGeometry::NumWCChannels not yet implemented" << std::endl;
141  return 0;
142 }
OStream cout
Definition: OStream.cxx:6
unsigned int beamlinegeo::BeamlineGeometry::NumWCPlaneWires ( ) const

Number of wires on each WC plane.

Definition at line 181 of file BeamlineGeometry_service.cc.

References fNumWCPlaneWires.

Referenced by beamlinereco::WCHitFinderAlg::createHits(), and testbeam::BeamlineEventDisplay::DrawWC().

181  {
182  return fNumWCPlaneWires;
183 }
unsigned int beamlinegeo::BeamlineGeometry::NumWCs ( ) const
std::vector<SystemID> beamlinegeo::BeamlineGeometry::SystemIDs ( ) const

SystemIDs.

float beamlinegeo::BeamlineGeometry::WCAngle ( unsigned int  wc) const

WC angle.

Definition at line 191 of file BeamlineGeometry_service.cc.

References om::cout, allTimeWatchdog::endl, and fWCAngles.

Referenced by beamlinereco::WCTrackAlg::findTheHitPositions().

191  {
192  if (wc >= fWCAngles.size()) {
193  std::cout << "No WC " << wc << std::endl;
194  abort();
195  }
196  return fWCAngles.at(wc);
197 }
OStream cout
Definition: OStream.cxx:6
std::vector< float > fWCAngles
float beamlinegeo::BeamlineGeometry::WCWirePitch ( ) const

Wire chamber wire pitch.

Definition at line 186 of file BeamlineGeometry_service.cc.

References fWCWirePitch.

Referenced by testbeam::BeamlineEventDisplay::DrawWC().

186  {
187  return fWCWirePitch;
188 }

Member Data Documentation

std::map<BeamlineComponent, BeamlineObject> beamlinegeo::BeamlineGeometry::fBeamlineObjects
private

Definition at line 295 of file BeamlineGeometry.h.

Referenced by ConfigureGeometry(), GetBeamlineObject(), and MakeObjects().

float beamlinegeo::BeamlineGeometry::fMagnetAngle
private

Definition at line 285 of file BeamlineGeometry.h.

Referenced by ConfigureGeometry(), and MagnetAngle().

float beamlinegeo::BeamlineGeometry::fMagnetEffectiveLength
private

Definition at line 286 of file BeamlineGeometry.h.

Referenced by ConfigureGeometry(), and MagnetEffectiveLength().

float beamlinegeo::BeamlineGeometry::fMagnetMidplaneIntercept
private

Definition at line 287 of file BeamlineGeometry.h.

Referenced by ConfigureGeometry(), and MagnetMidplaneIntercept().

TVector3 beamlinegeo::BeamlineGeometry::fNOvACoordOrigin
private
unsigned int beamlinegeo::BeamlineGeometry::fNumCherenkov
private

Definition at line 279 of file BeamlineGeometry.h.

Referenced by ConfigureGeometry(), and NumCherenkov().

std::vector<unsigned int> beamlinegeo::BeamlineGeometry::fNumToFCounters
private

Definition at line 282 of file BeamlineGeometry.h.

Referenced by ConfigureGeometry(), and NumToFCounters().

unsigned int beamlinegeo::BeamlineGeometry::fNumToFs
private

Definition at line 277 of file BeamlineGeometry.h.

Referenced by ConfigureGeometry(), and NumToFs().

unsigned int beamlinegeo::BeamlineGeometry::fNumWCPlaneWires
private

Definition at line 290 of file BeamlineGeometry.h.

Referenced by ConfigureGeometry(), and NumWCPlaneWires().

unsigned int beamlinegeo::BeamlineGeometry::fNumWCs
private

Definition at line 278 of file BeamlineGeometry.h.

Referenced by ConfigureGeometry(), and NumWCs().

std::vector<float> beamlinegeo::BeamlineGeometry::fWCAngles
private

Definition at line 292 of file BeamlineGeometry.h.

Referenced by ConfigureGeometry(), and WCAngle().

float beamlinegeo::BeamlineGeometry::fWCWirePitch
private

Definition at line 291 of file BeamlineGeometry.h.

Referenced by ConfigureGeometry(), and WCWirePitch().


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