9 #ifndef GEO_GEOMETRYBASE_H 10 #define GEO_GEOMETRYBASE_H 16 #include "NovaDAQConventions/DAQConventions.h" 71 Atom<bool> ForceUseFCLOnly{
Name(
"ForceUseFCLOnly"),
Comment(
"Force geometry to only use the value set by the fcl file"),
false};
84 const PlaneGeo* Plane(
unsigned int i)
const;
85 const std::set<unsigned int>& GetPlanesByView(
View_t v=
kXorY)
const;
86 const unsigned int NextPlaneInView(
unsigned int p,
88 const unsigned int NextPlaneOtherView(
unsigned int p,
90 const unsigned int FirstPlaneInMuonCatcher()
const;
91 double CellTpos(
unsigned int ip,
unsigned int ic,
double w=0.0)
const;
92 void CellInfo(
unsigned int ip,
unsigned int ic,
96 int* iplane,
int* icell)
const;
111 void CountCellsOnLine(
double X1,
double Y1,
double Z1,
112 double X2,
double Y2,
double Z2,
113 std::vector<OfflineChan>& Xhitsonline,
114 std::vector<OfflineChan>& Yhitsonline);
116 void CountCellsOnLine(TVector3 r1, TVector3 r2,
117 std::vector<OfflineChan>& Xhitsonline,
118 std::vector<OfflineChan>& Yhitsonline);
121 void CountCellsOnLine(
double X1,
double Y1,
double Z1,
122 double X2,
double Y2,
double Z2,
123 std::vector<CellOnLine>& Xhitsonline,
124 std::vector<CellOnLine>& Yhitsonline);
126 void CountCellsOnLine(TVector3 r1, TVector3 r2,
127 std::vector<CellOnLine>& Xhitsonline,
128 std::vector<CellOnLine>& Yhitsonline);
136 void CountCellsOnLineFast(
double x1,
double y1,
double z1,
137 double x2,
double y2,
double z2,
138 std::vector<OfflineChan>& Xhitsonline,
139 std::vector<OfflineChan>& Yhitsonline);
141 void CountCellsOnLineFast(TVector3 r1, TVector3 r2,
142 std::vector<OfflineChan>& Xhitsonline,
143 std::vector<OfflineChan>& Yhitsonline);
147 double v1,
double z1,
148 double v2,
double z2,
149 std::vector<OfflineChan>& hitsonline);
152 unsigned int NPlanes()
const;
153 double DetHalfWidth()
const;
154 double DetHalfHeight()
const;
155 double DetLength()
const;
156 double SurfaceY()
const;
165 TVector3 BoosterBeamDirection()
const;
168 double DistToElectronics(
double localz,
const CellGeo& cell)
const;
174 void WorldBox(
double* xlo_cm,
double* xhi_cm,
175 double* ylo_cm,
double* yhi_cm,
176 double* zlo_cm,
double* zhi_cm)
const;
178 void DetectorEnclosureBox(
double* xlo_cm,
double* xhi_cm,
179 double* ylo_cm,
double* yhi_cm,
180 double* zlo_cm,
double* zhi_cm)
const;
182 void DetectorBigBox(
double* xlo_cm,
double* xhi_cm,
183 double* ylo_cm,
double* yhi_cm,
184 double* zlo_cm,
double* zhi_cm)
const;
186 bool IntersectsDetector(
double* xyz_cm,
double* dxyz)
const;
187 bool IntersectsBigBox(
double* xyz_cm,
double* dxyz)
const;
192 bool isInsideDetectorBigBox(
const double x_cm,
const double y_cm,
const double z_cm)
const;
195 bool isInsideFiducialVolume(
const double x_cm,
const double y_cm,
const double z_cm)
const;
196 bool isInsideFiducialVolume(
const double* xyz_dimensionless)
const;
198 void FiducialBox(TVector3& r0, TVector3& r1)
const;
201 int CurrentCell(
int* ip,
int* ic)
const;
203 const CellUniqueId CellId(
const double&
x,
const double&
y,
const double&
z,
204 double dxds=0.,
double dyds=0.,
205 double dzds=1.,
double step=0.01)
const;
206 TGeoMaterial*
Material(
double x,
double y,
double z)
const;
207 bool IsActive(
const TGeoMaterial*
m)
const;
208 double TotalMass(
const char *
volume=
"vDetEnclosure")
const;
209 double MassBetweenPoints(
double *
p1,
double *
p2)
const;
211 void MaterialsBetweenPoints(
const double *p1,
213 std::vector<double>&
ds,
214 std::vector<const TGeoMaterial*>&
mat)
const;
216 void MaterialsBetweenPoints(TVector3 v1,
218 std::vector<double>& ds,
219 std::vector<const TGeoMaterial*>& mat)
const;
221 bool calculateMassesLong(
const unsigned int number_of_points,
223 double DEdge(
const double* x0,
const double*
dx,
224 double *exitp=0)
const;
233 TVector3* point_in_cell=0,
234 TVector3* point_on_track=0)
const;
239 int Run()
const {
return fRunNumber; }
240 TGeoManager* ROOTGeoManager()
const;
255 typedef std::unordered_map<CellUniqueId, OfflineChan>
UIDMap;
261 void setDetectorBigBox(
double detector_bigbox_range);
263 void FindPlanes(std::vector<const TGeoNode*>&
n,
unsigned int depth,
bool inMuonCatcher =
false);
264 void MakePlane (std::vector<const TGeoNode*>&
n,
unsigned int depth,
bool inMuonCatcher);
267 void SetDetectorSize();
335 #endif // GEO_GEOMETRYBASE_H novadaq::cnv::DetId fDetId
id for the detector being used
double fFiducialVolumeZLo
bool getPlaneAndCellID(const double &x, const double &y, const double &z, int &plane, int &cell) const
bool isDetectorBigBoxUsed() const
Do we use the Detector Big Box.
double fDetectorBigBoxXHi
Dimensions of the DetectorBigBox in cm.
double fDetLength
Detector length (cm)
Float_t y1[n_points_granero]
std::string fROOTFile
root file holding the geometry
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Float_t x1[n_points_granero]
std::string fGDMLFile
gdml file holding the geometry
bool fIsDetectorBigBoxUsed
Do we need to use the BigBox cut?
std::set< unsigned int > fAllPlanes
List of all planes.
std::string GDMLFromFCL() const
double fFiducialVolumeXLo
double fDetHalfHeight
Detector 1/2 height (cm)
std::vector< PlaneGeo * > fPlanes
The detector planes.
double fDetHalfWidth
Detector 1/2 width (cm)
TVector3 exit
Exit point from cell.
CoordinateTransformation * getCoordinateTransformation() const
double fFiducialVolumeXHi
Give every cell in the geometry a unique ID number based on the TGeo path to the node.
unsigned int fRunNumber
Run number of configuration.
int getCellID(const double &x, const double &y, const double &z) const
TVector3 entry
Entry point into cell.
std::set< unsigned int > fYplanes
List of Y measuring planes.
UIDMap fIdMap
Unique ID -> Plane,Cell.
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Geometry information for a single readout plane.
_return_codes
Return codes which flag errors and the like.
double fDetectorBigBoxZHi
void FindPlanes(TGeoNode *n, TGeoVolume *v)
CoordinateTransformation fCoordinateTransformation
Coordinate Transformation class.
double fDetectorBigBoxXLo
double fDetectorBigBoxYLo
double fFiducialVolumeZHi
double fBigBoxRange
Range of big box.
A very simple service to remember what detector we're working in.
std::string GDMLFile() const
static constexpr double m
std::vector< PlaneGeo * > fPlanesInMuonCatcher
Same pointers as fPlanes.
int getPlaneID(const double &x, const double &y, const double &z) const
unsigned long long int CellUniqueId
std::set< unsigned int > fXplanes
List of X measuring planes.
double fDetectorBigBoxZLo
OfflineChan chan
Channel passed through by line.
double ClosestApproach(const double point[], const double intercept[], const double slopes[], double closest[])
Find the distance of closest approach between point and line.
fhicl::ParameterSet fConfigTB
std::unordered_map< CellUniqueId, OfflineChan > UIDMap
TVector3 NuMIBeamDirection(caf::Det_t det)
Average direction of NuMI neutrinos in a given detector This function is a copy of geo::GeometryBase:...
double fDetectorBigBoxYHi
std::string ROOTFile() const
The geometry of one entire detector (near, far, ipnd)
double fFiducialVolumeYHi
std::string fGDMLFromFCL
keep track of original fcl parameter
Encapsulate the cell geometry.
double fFiducialVolumeYLo
Simple object representing a (plane, cell) pair.
std::string fStoreTempGeo
folder to store temp geo file