1 #include <mdet/Scintillator.h>
3 #include <mdet/Module.h>
4 #include <mdet/Counter.h>
5 #include <mdet/MHierarchyInfo.h>
7 #include <sdet/Station.h>
11 #include <utl/Vector.h>
12 #include <utl/ErrorLogger.h>
13 #include <utl/RandomEngine.h>
14 #include <utl/TransformationMatrix.h>
15 #include <utl/GeometryUtilities.h>
17 #include <fwk/RandomEngineRegistry.h>
18 #include <fwk/LocalCoordinateSystem.h>
20 #include <CLHEP/Random/RandExponential.h>
24 #include <boost/function.hpp>
25 #include <boost/lambda/lambda.hpp>
26 #include <boost/logic/tribool.hpp>
27 #include <boost/ptr_container/ptr_vector.hpp>
212 return count >= limit;
247 boost::ptr_vector<utl::Point> pCross;
255 unsigned int index2ndPoint = 1;
257 if (pCross.size() > 2) {
263 for (
unsigned int i = 1; i < pCross.size(); ++i) {
264 double d = (pCross[i] - pCross[0]).GetMag();
284 const double d0 = ( pCross[0] - ground.
GetAnchor() ).GetMag();
285 const double d1 = ( pCross[index2ndPoint] - ground.
GetAnchor() ).GetMag();
286 const bool head = d1 > d0;
298 template<
class Container>
379 const double c = normal * pLocal;
388 const double ext2 = ext / 2;
390 return (-ext2 <= c && c <= ext2) ||
IsCloseTo(std::fabs(c), ext2);
double Plane(const utl::Point &point, const utl::Vector &normal, const utl::Photon &photonIn, utl::Photon &photonOut)
bool IntersectedBy(const utl::Line &line) const
Answers if line crosses the body of the Scintillator.
const Counter & GetCounter() const
The parent counter.
bool InExtent(double ext, const utl::Vector &pLocal, const utl::Vector &normal) const
Checks if the vector lies within Scintillator's extent for the given axis.
utl::Validated< double > fLength
bool OnSide(const utl::Plane &sidePlane, const utl::Line &line) const
Indicates whether the line hits the Scintillator on the side contained in sidePlane.
RandomEngineType & GetEngine()
bool IsCloseTo(double a, double b) const
FP Comparison criteria.
utl::Plane ComputeBottomPlane() const
The plane where the bottom of the Scintillator lays.
utl::Plane ComputeBackPlane() const
The plane where the back of the Scintillator lays.
utl::Plane ComputeTopPlane() const
The plane where the top of the Scintillator lays.
bool Contains(const utl::Point &point) const
Answers if point lies within the Scintillator.
double GetDecayTime() const
Characteristic decay time.
static const char *const kComponentsNames[13]
Defines within it the common (templated) type for muon detector hierarchy components.
utl::CoordinateSystemPtr GetLocalCoordinateSystem() const
Local system based on position and configured rotations.
const Point & GetAnchor() const
static const char *const kComponentsIds[13]
utl::Point GetPosition() const
utl::Plane ComputeLeftPlane() const
The plane where the left of the Scintillator lays.
void IntersectionHelper(Container &v, const utl::Line &l, utl::Plane(Scintillator::*ComputePlane)() const ) const
Helper function for another specific member.
void Register(utl::VValidated &v)
Register the field so as to allow handling it.
double GetLength() const
Return the length of the segment (ie the distance between begin and end).
T & GetData(P< T > &d, const std::string &p) const
Common utility function for configuration.
double GetWidth() const
Width of the strip (x direction in the local coordinate system).
Line Intersection(const Plane &p1, const Plane &p2)
double GetHeight() const
Height of the strip (z direction in the local coordinate system).
double GetDecayDelayStdDev() const
The standard deviation fo the delay time.
double GetEpsilon() const
FP comparison limit.
Actual muon-sensitive objects.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
double GetLength() const
Length of the strip (y direction in the local coordinate system).
Class describing a Plane object.
utl::Plane ComputeRightPlane() const
The plane where the right of the Scintillator lays.
utl::Plane ComputeGroundPlane() const
The (inifite) plane that coincides with the ground.
Wraps the random number engine used to generate distributions.
const Point & GetBegin() const
Return the initial point.
utl::CoordinateSystemPtr GetLocalCoordinateSystem() const
Get the Auger reference system centered on the tank.
utl::Validated< double > fEpsilon
double GetArea() const
Compute Scintillator's total area in square metres.
static const char *const kComponentName
utl::Validated< double > fDecayTime
utl::Validated< double > fWidth
double GetDecayDelayMean() const
The mean value of the delay time.
utl::Segment ComputeIntersectionWith(const utl::Line &line) const
Computes the intersection of line within the Scintillator.
double ComputeUndergroundGrammageFor(const utl::Line &l) const
Computes the amount of mass transversed until reaching the Scintillator.
std::map< std::string, std::string > IndexMap
const Module & GetModule() const
Retrieve the parent mdet::Module.
const Vector & GetDirection() const
const sdet::Station & GetAssociatedTank() const
Retrieve the associated tank.
double ComputeDecayDelay() const
Computes a delay due to decay process.
utl::Plane ComputeFrontPlane() const
The plane where the front of the Scintillator lays.
bool Intersects(const utl::Plane &p, const utl::Line &l) const
Check for intersection.
double GetLocalSoilDensity() const
Simplest density distribution: constant value.
Scintillator(int sId, const det::VManager::IndexMap &parentMap, const Module &parent)
Constructs the Scintillator (obviously!).
Type
The type of file that we are acutally opening.
utl::CoordinateSystemPtr GetReferenceCoordinateSystem() const
The reference is the local coordinate system of mdet::Module.
const Vector & GetNormal() const
utl::Validated< double > fHeight
utl::Segment ComputeUndergroundIntersectionOf(const utl::Line &line) const
Computes the intersection of line with the ground (until reaching the Scintillator).
utl::Validated< double > fLocalSoilDensity
utl::Plane ComputePlaneHelper(double ext, double x, double y, double z) const
Helper to construct the different planes.
static const char *const kComponentId
A segment joins two points.