1 #include <mdet/Module.h>
3 #include <mdet/Counter.h>
4 #include <mdet/MHierarchyInfo.h>
5 #include <sdet/Station.h>
6 #include <utl/Vector.h>
7 #include <utl/ErrorLogger.h>
11 #include <boost/iterator/transform_iterator.hpp>
12 #include <boost/lambda/lambda.hpp>
72 det::MPositionable<
Module>(*this),
73 fScintillators(*this),
76 fIndexByChannel(fIndexRelations.get<
ChannelTag>()),
77 fIndexByPixel(fIndexRelations.get<
PixelTag>()),
79 fIndexByFiber(fIndexRelations.get<
FiberTag>())
84 unsigned int numberOfPixels = 0;
85 unsigned int numberOfChannels = 0;
89 numberOfPixels =
fPMT->GetPixels().GetNumberOfComponents();
90 numberOfChannels =
fFrontEnd->GetChannels().GetNumberOfComponents();
95 numberOfPixels =
fSiPMArray->GetSiPMs().GetNumberOfComponents();
96 numberOfChannels =
fFrontEndSiPM->GetChannels().GetNumberOfComponents();
104 INFO(
"This Module uses PMT.");
106 INFO(
"This Module uses SiPM.");
108 std::ostringstream ss;
109 ss <<
"For the module ";
113 <<
fFibers.GetNumberOfComponents() <<
" fibers, "
114 << numberOfPixels <<
" pixels/sipms, "
115 << numberOfChannels <<
" channels "
116 " when the quantities must be the same.";
172 area +=
is->GetArea();
182 unsigned int nScintillators = 0;
187 return nScintillators;
227 return dist * normal2ground;
241 double length = 5000;
243 length = std::min(length, fIt->GetOnManifoldLength());
255 INFO(
"rereading channel-pmt/sipm-scintillator assignment..");
259 const Pixel& pix = *pixIt;
261 if (ids.size() != 3) {
262 std::ostringstream ss;
263 ss <<
"The information in MModelConfig is corrupt! Number of indexes in <channelScintillatorFiberIds> has to be three";
278 const SiPM& sipm = *sipmIt;
280 if (ids.size() != 3) {
281 std::ostringstream ss;
282 ss <<
"The information in MModelConfig is corrupt! Number of indexes in <channelScintillatorFiberIds> has to be three";
290 newtuple.
fPixelId = sipmIt->GetId();
utl::ShadowPtr< FrontEnd > fFrontEnd
utl::ShadowPtr< PMT > fPMT
const BackEndSiPM & GetBackEndSiPM() const
static const char *const PhotoDetectorTags[]
Tags for textual representation.
const Counter & GetCounter() const
The parent counter.
unsigned int GetNumberOfScintillators() const
AreaKind GetAreaKind() const
Detector description interface for Station-related data.
static EnumType Create(const int k)
int version of the overloaded creation method.
PixelGroup::ConstIterator PixelConstIterator
Convenience typedef for const iterator over the contained mdet::Pixel instances.
Module(const int mId, const det::VManager::IndexMap &parentMap, const Counter &parent)
Constructs the Module (obviously!).
static const char *const kComponentsNames[13]
Defines within it the common (templated) type for muon detector hierarchy components.
bool is(const double a, const double b)
utl::CoordinateSystemPtr GetLocalCoordinateSystem() const
Local system based on position and configured rotations.
void Update(std::vector< double > &init, const std::vector< double > &res)
#define INFO(message)
Macro for logging informational messages.
static const char *const kComponentsIds[13]
ScintillatorConstIterator ScintillatorsBegin() const
Begin iterator over the contained scitillators.
utl::Point GetPosition() const
Electronic front-end for the modules.
#define FATAL(message)
Macro for logging fatal messages.
const IdsContainer & GetChannelSiPMScintillatorFiberIds() const
Indices for Channel, Scintillator, Fiber of corrresponding Pixel.
const VManager::IndexMap & GetIdsMap() const
The id identifying this component within its detector hierarhy.
void Register(utl::VValidated &v)
Register the field so as to allow handling it.
utl::Validated< AreaKindForConfig > fAreaKind
T & GetData(P< T > &d, const std::string &p) const
Common utility function for configuration.
Electronic front-end for the modules.
utl::Point GetPosition() const
Tank position.
const SiPMArray & GetSiPMArray() const
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
PhotoDetector GetPhotoDetector() const
IndexByChannelId & fIndexByChannel
FiberConstIterator FibersBegin() const
Begin iterator over the contained fibers.
static const char *const AreaKindTags[]
Tags for textual representation.
utl::CoordinateSystemPtr GetLocalCoordinateSystem() const
Get the Auger reference system centered on the tank.
FiberConstIterator FibersEnd() const
End iterator over the contained fibers.
SiPMGroup::ConstIterator SiPMConstIterator
ScintillatorGroup::ConstIterator ScintillatorConstIterator
Scintillator handling.
std::vector< int > IdsContainer
Typedef for container of corresponding Channel, Scintillator, Fiber indices.
double GetBackgroundMuonsFlux() const
Background muons Flux.
Multiple-pixel photo-multiplier tube.
double GetShortestFiber() const
const FrontEnd & GetFrontEnd() const
ULong64_t GetMask() const
virtual double GetEulerPhi() const
First Euler angle for rotation over (original) z.
Root detector of the muon detector hierarchy.
utl::Validated< double > fBackgroundMuonsFlux
utl::Validated< PhotoDetectorForConfig > fPhotoDetector
static const char *const kComponentName
ScintillatorConstIterator ScintillatorsEnd() const
End iterator over the contained scintillators.
FiberGroup::ConstIterator FiberConstIterator
Fiber handling.
std::map< std::string, std::string > IndexMap
const FrontEndSiPM & GetFrontEndSiPM() const
double GetDepth() const
The depth of the origin of the module. This quantity is positive for an underground module...
utl::ShadowPtr< FrontEndSiPM > fFrontEndSiPM
AreaKind
Kind of module based on its area.
const sdet::Station & GetAssociatedTank() const
Retrieve the associated tank.
utl::ShadowPtr< BackEndSiPM > fBackEndSiPM
const IdsContainer & GetChannelScintillatorFiberIds() const
Indices for Channel, Scintillator, Fiber of corrresponding Pixel.
static const char *const kComponentId
Type
The type of file that we are acutally opening.
void Update(const bool invalidateData, const bool invalidateComponents)
utl::ShadowPtr< SiPMArray > fSiPMArray
utl::CoordinateSystemPtr GetReferenceCoordinateSystem() const
The reference is the local coordinate system of mdet::Counter.
ScintillatorGroup fScintillators
const PMT & GetPMT() const
structure that holds the mapping between different Ids