9 #include <fwk/RunController.h>
10 #include <fwk/CentralConfig.h>
11 #include <fwk/CoordinateSystemRegistry.h>
13 #include <det/Detector.h>
14 #include <sdet/SDetector.h>
15 #include <sdet/Station.h>
17 #include <utl/TimeStamp.h>
18 #include <utl/UTCDateTime.h>
19 #include <utl/Point.h>
20 #include <utl/ReferenceEllipsoid.h>
21 #include <utl/CoordinateSystem.h>
23 #include <mdet/MDetector.h>
24 #include <mdet/Module.h>
25 #include <mdet/Counter.h>
26 #include <mdet/Scintillator.h>
27 #include <mdet/Channel.h>
29 #include <mdet/Fiber.h>
31 #include <tst/Verify.h>
33 #include <cppunit/extensions/HelperMacros.h>
43 #define ASSERT_CLOSE(x, y, eps) CPPUNIT_ASSERT(Verify<CloseTo>(x, y, eps))
44 #define ASSERT_EQUAL(x, y) CPPUNIT_ASSERT(Verify<Equal>(x, y))
49 CPPUNIT_TEST(testBasic);
50 CPPUNIT_TEST(testComponentAssignment);
51 CPPUNIT_TEST(testBrokenChannelsAssignment);
52 CPPUNIT_TEST_SUITE_END();
68 Detector::GetInstance();
76 Detector& detector = Detector::GetInstance();
96 int moduleCounter = 1;
107 int fiberCounter = 1;
115 int scintillatorCounter = 1;
119 ++scintillatorCounter;
128 Detector& detector = Detector::GetInstance();
136 const bitset<64> bit_mask = mask;
138 std::cout <<
"mask for counter " << CtrId <<
" module " << ModId <<
"\nin decimal: " << std::endl;
141 std::cout << mask << std::endl;
142 std::cout <<
"in bits: " << std::endl;
143 std::cout << bit_mask <<
" ==> (" << bit_mask.count() <<
")\n";
150 testBrokenChannelsAssignment(1764, 1,
UTCDateTime(2015,7,22).GetTimeStamp());
151 testBrokenChannelsAssignment(1764, 2,
UTCDateTime(2015,7,23).GetTimeStamp());
152 testBrokenChannelsAssignment(93 , 2,
UTCDateTime(2015,7,24).GetTimeStamp());
153 testBrokenChannelsAssignment(1622, 7,
UTCDateTime(2015,7,25).GetTimeStamp());
159 Detector& detector = Detector::GetInstance();
170 int pixelCounter = 1;
180 int channelCounter = 1;
int PixelToScintillatorId(const int pId) const
void Update(const utl::TimeStamp &time, const bool invData=true, const bool invComp=true, const bool forceRadio=false)
Update detector: deletes currently constructed stations and sets new time.
const Module & GetModule(const int mId) const
Retrieve by id a constant module.
const Pixel & GetPixel(int pId) const
Detector description interface for Station-related data.
#define ASSERT_EQUAL(x, y)
PixelGroup::ConstIterator PixelConstIterator
Convenience typedef for const iterator over the contained mdet::Pixel instances.
const mdet::MDetector & GetMDetector() const
int ScintillatorToPixelId(const int sId) const
ChannelConstIterator ChannelsEnd() const
End iterator over the contained channels.
unsigned int GetPostT1BufferLength() const
Number of bins of the post-T1 buffer.
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
ScintillatorConstIterator ScintillatorsBegin() const
Begin iterator over the contained scitillators.
utl::Point GetPosition() const
Electronic front-end for the modules.
unsigned int GetPreT1BufferLength() const
Number of bins of the (cyclic) pre-T1 buffer.
int ScintillatorToChannelId(const int sId) const
utl::CoordinateSystemPtr GetSiteCoordinateSystem() const
Get the coordinate system for the site.
ModuleConstIterator ModulesEnd() const
Begin iterator for the Modules contained in the Counter.
int FiberToChannelId(const int fId) const
const Channel & GetChannel(int cId) const
Detector associated to muon detector hierarchy.
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
A TimeStamp holds GPS second and nanosecond for some event.
int ChannelToScintillatorId(const int cId) const
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
ChannelGroup::ConstIterator ChannelConstIterator
Convenience typedef for const iterator over the contained mdet::Channel instances.
void testBrokenChannelsAssignment()
double GetX(const CoordinateSystemPtr &coordinateSystem) const
double GetMeanSampleRatePeriod() const
Mean electronic sample rate period.
FiberConstIterator FibersBegin() const
Begin iterator over the contained fibers.
Top of the hierarchy of the detector description interface.
int FiberToPixelId(const int fId) const
int PixelToChannelId(const int pId) const
FiberConstIterator FibersEnd() const
End iterator over the contained fibers.
void testComponentAssignment()
ScintillatorGroup::ConstIterator ScintillatorConstIterator
Scintillator handling.
const Scintillator & GetScintillatorFor(const Component &c) const
Returns the associated mdet::Scintillator.
Multiple-pixel photo-multiplier tube.
const Pixel & GetPixelFor(const Component &c) const
Returns the associated mdet::Pixel.
const FrontEnd & GetFrontEnd() const
PixelConstIterator PixelsBegin() const
Begin iterator over the contained pixels.
ULong64_t GetMask() const
Size of the (cyclic) external memory buffer associated to each module.
Root detector of the muon detector hierarchy.
int ScintillatorToFiberId(const int sId) const
double GetY(const CoordinateSystemPtr &coordinateSystem) const
int FiberToScintillatorId(const int fId) const
ScintillatorConstIterator ScintillatorsEnd() const
End iterator over the contained scintillators.
static CentralConfig * GetInstance()
Use this the first time you get an instance of central configuration.
const Fiber & GetFiber(int fId) const
FiberGroup::ConstIterator FiberConstIterator
Fiber handling.
ChannelConstIterator ChannelsBegin() const
Begin iterator over the contained channels.
ModuleConstIterator ModulesBegin() const
Begin iterator for the Modules contained in the Counter.
void testBrokenChannelsAssignment(int CtrId, int ModId, TimeStamp t)
const sdet::Station & GetAssociatedTank() const
Retrieve the associated tank.
ModuleGroup::ConstIterator ModuleConstIterator
Convenience typedef for const iterator over the contained Module instances.
unsigned int GetSegmentation() const
#define ASSERT_CLOSE(x, y, eps)
double GetZ(const CoordinateSystemPtr &coordinateSystem) const
const Scintillator & GetScintillator(int sId) const
Direct accesor by id.
const Counter & GetCounter(int id) const
Retrieve Counter by id.
int ChannelToFiberId(const int cId) const
TimeStamp GetTimeStamp() const
int PixelToFiberId(const int pId) const
PixelConstIterator PixelsEnd() const
End iterator over the contained pixels.
const PMT & GetPMT() const