4 #include <det/VManager.h>
5 #include <det/MPositionable.h>
7 #include <mdet/MComponentGroup.h>
8 #include <mdet/MDetectorComponent.h>
9 #include <mdet/Scintillator.h>
10 #include <mdet/Fiber.h>
11 #include <mdet/Pixel.h>
13 #include <mdet/FrontEnd.h>
14 #include <mdet/SiPM.h>
15 #include <mdet/SiPMArray.h>
16 #include <mdet/FrontEndSiPM.h>
17 #include <mdet/BackEndSiPM.h>
19 #include <utl/Point.h>
20 #include <utl/CoordinateSystemPtr.h>
21 #include <utl/ShadowPtr.h>
22 #include <utl/AugerException.h>
23 #include <utl/ConsecutiveEnumFactory.h>
24 #include <utl/Validated.h>
29 #include <boost/utility.hpp>
31 #include <boost/multi_index_container.hpp>
32 #include <boost/multi_index/member.hpp>
33 #include <boost/multi_index/ordered_index.hpp>
181 template<
class Component>
190 template<
class Component>
200 template<
class Component>
210 template<
class Component>
220 template<
class Component>
230 template<
class Component>
278 { CheckComponent();
return fIndexByChannel.find(cId)->fScintillatorId; }
287 { CheckComponent();
return fIndexByFiber.find(fId)->fChannelId; }
290 { CheckComponent();
return fIndexByFiber.find(fId)->fScintillatorId; }
293 { CheckComponent();
return fIndexByFiber.find(fId)->fPixelId; }
296 { CheckComponent();
return fIndexByPixel.find(pId)->fScintillatorId; }
299 { CheckComponent();
return fIndexByPixel.find(pId)->fFiberId; }
302 { CheckComponent();
return fIndexByPixel.find(pId)->fChannelId; }
367 void Update(
const bool invalidateData,
const bool invalidateComponents);
406 friend struct det::ParentCreator;
409 friend struct det::ComponentUpdater;
462 typedef boost::multi_index_container<
464 boost::multi_index::indexed_by<
465 boost::multi_index::ordered_unique<
466 boost::multi_index::tag<ChannelTag>, boost::multi_index::member< IdTuple, int, &IdTuple::fChannelId >
468 boost::multi_index::ordered_unique<
469 boost::multi_index::tag<PixelTag>, boost::multi_index::member< IdTuple, int, &IdTuple::fPixelId >
471 boost::multi_index::ordered_unique<
472 boost::multi_index::tag<ScintillatorTag>, boost::multi_index::member< IdTuple, int, &IdTuple::fScintillatorId >
474 boost::multi_index::ordered_unique<
475 boost::multi_index::tag<FiberTag>, boost::multi_index::member< IdTuple, int, &IdTuple::fFiberId >
504 const Pixel& pix = *pixIt;
506 if (ids.size() != 3) {
507 FATAL(
"The information in MModelConfig is corrupt! Number of indeces in "
508 "<channelScintillatorFiberIds> has to be three");
519 const SiPM& sipm = *sipmIt;
521 if (ids.size() != 3) {
522 FATAL(
"The information in MModelConfig is corrupt! Number of indeces in "
523 "<channelScintillatorFiberIds> has to be three");
528 newtuple.
fPixelId = sipmIt->GetId();
537 IdTuple GetIdTuple(
const Channel&
c)
const
540 IdTuple GetIdTuple(
const Pixel&
p)
const
543 IdTuple GetIdTuple(
const ChannelSiPM& c)
const
546 IdTuple GetIdTuple(
const SiPM& p)
const
549 IdTuple GetIdTuple(
const Scintillator&
s)
const
552 IdTuple GetIdTuple(
const Fiber&
f)
const
int PixelToScintillatorId(const int pId) const
Simple factory to create an enumerator for a given enumeration.
utl::ShadowPtr< FrontEnd > fFrontEnd
utl::ShadowPtr< PMT > fPMT
const BackEndSiPM & GetBackEndSiPM() const
IndexContainer::index< ChannelTag >::type IndexByChannelId
static const char *const PhotoDetectorTags[]
Tags for textual representation.
Defines within it the common (templated) type for muon detector hierarchy components groups...
int fId
Id of the component.
const Pixel & GetPixel(int pId) const
bool ExistsFiber(const int fId) const
utl::ConsecutiveEnumFactory< AreaKind, eLarge, AreaKindTags > AreaKindCreator
Convenience typedef for creation of AreaKind enumerators.
const Counter & GetCounter() const
The parent counter.
unsigned int GetNumberOfScintillators() const
AreaKind GetAreaKind() const
PixelGroup::ConstIterator PixelConstIterator
Convenience typedef for const iterator over the contained mdet::Pixel instances.
bool ExistsPixel(const int pId) const
Module(const int mId, const det::VManager::IndexMap &parentMap, const Counter &parent)
Constructs the Module (obviously!).
std::string AreaKindForConfig
bool ExistsSiPM(const int pId) const
int ScintillatorToPixelId(const int sId) const
Mixin class to be inherited from objects that have a position.
bool ExistsChannelSiPM(const int cId) const
Defines within it the common (templated) type for muon detector hierarchy components.
const Fiber & GetFiberFor(const Component &c) const
Linking between fibers, scintillators, channels and pixels.
const Channel & GetChannelFor(const Component &c) const
Returns the associated mdet::Channel.
int ChannelToPixelId(const int cId) const
MComponentGroup< Module, Scintillator, det::ParentCreator >::Type ScintillatorGroup
Type for the set of associated mdet::Scintillator.
ScintillatorConstIterator ScintillatorsBegin() const
Begin iterator over the contained scitillators.
Electronic front-end for the modules.
#define FATAL(message)
Macro for logging fatal messages.
int ScintillatorToChannelId(const int sId) const
const IdsContainer & GetChannelSiPMScintillatorFiberIds() const
Indices for Channel, Scintillator, Fiber of corrresponding Pixel.
int FiberToChannelId(const int fId) const
const Channel & GetChannel(int cId) const
IndexByFiberId & fIndexByFiber
utl::Validated< AreaKindForConfig > fAreaKind
Electronic front-end for the modules.
int ChannelToScintillatorId(const int cId) const
const ChannelSiPM & GetChannelSiPM(int cId) const
const SiPMArray & GetSiPMArray() const
Actual muon-sensitive objects.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
IndexContainer::index< PixelTag >::type IndexByPixelId
const SiPM & GetSiPM(const int pId) const
const SiPM & GetSiPMFor(const Component &c) const
Returns the associated mdet::SiPM.
friend void boost::checked_delete(T *) BOOST_NOEXCEPT
Friendship for destruction. Depends on det::ComponentGroup innards.
boost::multi_index_container< IdTuple, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< ChannelTag >, boost::multi_index::member< IdTuple, int,&IdTuple::fChannelId > >, boost::multi_index::ordered_unique< boost::multi_index::tag< PixelTag >, boost::multi_index::member< IdTuple, int,&IdTuple::fPixelId > >, boost::multi_index::ordered_unique< boost::multi_index::tag< ScintillatorTag >, boost::multi_index::member< IdTuple, int,&IdTuple::fScintillatorId > >, boost::multi_index::ordered_unique< boost::multi_index::tag< FiberTag >, boost::multi_index::member< IdTuple, int,&IdTuple::fFiberId > > > > IndexContainer
MComponentGroup< Module, Fiber, det::ParentCreator >::Type FiberGroup
Type for the set of associated mdet::Fiber.
PhotoDetector GetPhotoDetector() const
IndexByChannelId & fIndexByChannel
FiberConstIterator FibersBegin() const
Begin iterator over the contained fibers.
static const char *const AreaKindTags[]
Tags for textual representation.
int FiberToPixelId(const int fId) const
int PixelToChannelId(const int pId) const
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.
const Scintillator & GetScintillatorFor(const Component &c) const
Returns the associated mdet::Scintillator.
double GetBackgroundMuonsFlux() const
Background muons Flux.
Multiple-pixel photo-multiplier tube.
const Pixel & GetPixelFor(const Component &c) const
Returns the associated mdet::Pixel.
IndexContainer fIndexRelations
double GetShortestFiber() const
const FrontEnd & GetFrontEnd() const
ULong64_t GetMask() const
Root detector of the muon detector hierarchy.
IndexContainer::index< ScintillatorTag >::type IndexByScintillatorId
bool ExistsChannel(const int cId) const
utl::Validated< double > fBackgroundMuonsFlux
int ScintillatorToFiberId(const int sId) const
std::string const
Returns the message that identifies this component.
utl::Validated< PhotoDetectorForConfig > fPhotoDetector
IndexByScintillatorId & fIndexByScintillator
static const char *const kComponentName
int FiberToScintillatorId(const int fId) const
ScintillatorConstIterator ScintillatorsEnd() const
End iterator over the contained scintillators.
const Fiber & GetFiber(int fId) const
FiberGroup::ConstIterator FiberConstIterator
Fiber handling.
std::string PhotoDetectorForConfig
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.
utl::ConsecutiveEnumFactory< PhotoDetector, eSiPM, PhotoDetectorTags > PhotoDetectorCreator
Convenience typedef for creation of PhotoDetector enumerators.
int GetId() const
The id of this component.
utl::ShadowPtr< BackEndSiPM > fBackEndSiPM
const IdsContainer & GetChannelScintillatorFiberIds() const
Indices for Channel, Scintillator, Fiber of corrresponding Pixel.
Optical mdet::Fiber used to conect mdet::Scintillator to mdet::Pixel.
static const char *const kComponentId
const Scintillator & GetScintillator(int sId) const
Direct accesor by id.
Type
The type of file that we are acutally opening.
void Update(const bool invalidateData, const bool invalidateComponents)
utl::ShadowPtr< SiPMArray > fSiPMArray
bool ExistsScintillator(const int sId) const
int ChannelToFiberId(const int cId) const
IndexContainer::index< FiberTag >::type IndexByFiberId
utl::CoordinateSystemPtr GetReferenceCoordinateSystem() const
The reference is the local coordinate system of mdet::Counter.
ScintillatorGroup fScintillators
int PixelToFiberId(const int pId) const
const ChannelSiPM & GetChannelSiPMFor(const Component &c) const
Returns the associated mdet::ChannelSiPM.
const PMT & GetPMT() const
structure that holds the mapping between different Ids
IndexByPixelId & fIndexByPixel