2 using namespace RPCElectronicsSimulatorLX;
8 #include <det/Detector.h>
9 #include <cdet/CDetector.h>
10 #include <cdet/Station.h>
12 #include <evt/Event.h>
13 #include <evt/ShowerSimData.h>
16 #include <fwk/CentralConfig.h>
17 #include <fwk/RunController.h>
18 #include <fwk/LocalCoordinateSystem.h>
19 #include <fwk/CoordinateSystemRegistry.h>
20 #include <fwk/RandomEngineRegistry.h>
24 #include <cevt/CEvent.h>
27 #include <utl/config.h>
28 #include <utl/Trace.h>
29 #include <utl/AugerUnits.h>
31 #include <utl/MathConstants.h>
32 #include <utl/PhysicalConstants.h>
33 #include <utl/TimeStamp.h>
34 #include <utl/TabulatedFunction.h>
35 #include <utl/TabularStream.h>
36 #include <utl/ErrorLogger.h>
37 #include <utl/Particle.h>
38 #include <utl/AugerCoordinateSystem.h>
39 #include <utl/UTMPoint.h>
40 #include <utl/MultiTimeDistribution.h>
41 #include <utl/GeometryUtilities.h>
42 #include <utl/RandomEngine.h>
46 #include <CLHEP/Random/RandGauss.h>
52 using CLHEP::RandGauss;
56 fChargeThreshold(0.0),
69 std::ostringstream str;
71 str <<
"RPCElectronicsSimulator::Init() \n";
74 CentralConfig::GetInstance()->
GetTopBranch(
"RPCElectronicsSimulator");
83 &RandomEngineRegistry::GetInstance().Get(RandomEngineRegistry::eDetector);
99 INFO(
"RPCElectronicsSimulator::Finish()");
108 INFO(
"RPCElectronicsSimulator::Run()");
111 ERROR(
"RPCElectronicsSimulator::No CEvent!");
116 const cdet::CDetector & detector = det::Detector::GetInstance().GetCDetector();
118 CEvent &theCEvent =
event.GetCEvent();
124 tab <<
"station" <<
endc
128 <<
"hits. time" <<
endc
129 <<
"time alive" <<
endr;
150 <<
"Number of muons/active pads in station "
151 << rpcStation.
GetId() <<
" "
160 const double timeGPS =
164 for(Station::PadIterator pIt = rpcStation.
PadsBegin();
165 pIt != rpcStation.
PadsEnd(); ++pIt) {
182 const double timeBin = chargeDist.
GetBinning();
184 double timeVeto = qIt->get<0>()*timeBin;
186 for (; qIt != chargeDist.
SparseEnd(); ++qIt) {
188 const double time0 = qIt->get<0>() * timeBin;
189 const double charge = qIt->get<1>();
192 tab <<
' ' << rpcStation.
GetId() <<
' ' <<
endc
208 timeVeto = time + deadTime;
232 std::cout << tab << std::endl;
Branch GetTopBranch() const
Report success to RunController.
Detector description interface for CDetector-related data.
RPCElectronicsSimulator()
RandomEngineType & GetEngine()
StationIterator StationsEnd()
End of all stations.
utl::TimeDistributionI & GetHitsTimeDistribution(const StationConstants::SignalComponent source=StationConstants::eTotal)
Histogram class for time distributions with suppressed empty bins.
#define INFO(message)
Macro for logging informational messages.
bool HasHitsTimeDistribution(const StationConstants::SignalComponent source=StationConstants::eTotal) const
Check if the digitized PAD signal (optionally for a given source)
ChargeTimeDistributionsIterator ChargeTimeDistributionsBegin()
Begin iterator over Pad base signal sources.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
Class to hold simulated data at Pad level.
fwk::VModule::ResultFlag Finish(void)
Finish: invoked at end of the run (NOT end of the event)
class to hold data at Pad level
unsigned int GetId() const
Return Id of the Pad.
Class representing a document branch.
virtual ~RPCElectronicsSimulator()
double GetBinning() const
Size of one slot.
unsigned int GetNumberOfMuons() const
Get the number of the different ionizing particle types that entered the station. ...
int GetId() const
Get the station Id.
constexpr double nanosecond
class that triggers insertion of the line row in the TabularStream
fwk::VModule::ResultFlag Run(evt::Event &theEvent)
Run: invoked once per event.
class to format data in tabular form
void MakeHitsTimeDistribution(const StationConstants::SignalComponent source=StationConstants::eTotal)
Create a TimeDistributionI representing binary signal after digitization of PAD signal (optionally fo...
double GetDeadTime() const
void GetData(bool &b) const
Overloads of the GetData member template function.
const Station & GetStation(const int stationId) const
Get station by Station Id.
SparseIterator SparseEnd() const
ChargeTimeDistributionsIterator ChargeTimeDistributionsEnd()
End iterator over Pad base signal sources.
class to hold data at Station level
utl::RandomEngine * fRandomEngine
PadIterator PadsEnd()
end Pad iterator for read/write
ResultFlag
Flag returned by module methods to the RunController.
unsigned int GetNumberActivePads()
Get the number of pads with signal.
StationIterator StationsBegin()
Beginning of all stations.
total (shower and background)
Report failure to RunController, causing RunController to terminate execution.
PadSimData & GetSimData()
Get object containing Pad simulated data.
SparseIterator SparseBegin() const
Iterator over time slots with data in them (skips empty slots).
boost::indirect_iterator< InternalStationIterator, Station & > StationIterator
Iterator over all stations.
PadIterator PadsBegin()
begin Pad iterator for read/write
#define ERROR(message)
Macro for logging error messages.
fwk::VModule::ResultFlag Init(void)
Initialize: invoked at beginning of run (NOT beginning of event)
void AddTime(const double time, const T weight=T(1))
Add an entry (optionally weighted) for the given time. Slot will be computed.
boost::transform_iterator< InternalMapFunctor, InternalConstIterator, Tuple > SparseIterator
StationSimData & GetSimData()
Get simulated data at station level.
utl::MultiTimeDistributionD::Iterator ChargeTimeDistributionsIterator
Iterator over available Pad base signal sources.
Interface class to access to the SD part of an event.