Describe your module. In one sentence. More...
#include <MdMuonCounterAG/MdMuonCounter.h>
Public Types | |
enum | ResultFlag { eSuccess, eFailure, eBreakLoop, eContinueLoop } |
Flag returned by module methods to the RunController. More... | |
enum | Strategy { eGap, eGapRelax, eAmountInWindow, eConsecutive, eAmountGlobal } |
Kind of possible counting criteria to be used. More... | |
enum | VersionInfoType { eFilename = 1, eRevisionNumber = 2, eDate = 3, eTime = 4, eLastEditor = 5 } |
Different types of version info that can be retrieved from GetVersionInfo. More... | |
Public Member Functions | |
VModule::ResultFlag | Finish () |
Finish: invoked at end of the run (NOT end of the event) More... | |
utl::Stopwatch & | GetStopwatch () |
const utl::Stopwatch & | GetStopwatch () const |
std::string | GetVersionInfo (const VersionInfoType v) const |
Retrieve different sorts of module version info. More... | |
VModule::ResultFlag | Init () |
Initialize: invoked at beginning of run (NOT beginning of event) More... | |
void | InitTiming () |
MdMuonCounter () | |
VModule::ResultFlag | Run (evt::Event &e) |
Run: invoked once per event. More... | |
ResultFlag | RunWithTiming (evt::Event &event) |
~MdMuonCounter () | |
Static Public Member Functions | |
static std::string | GetResultFlagByName (const ResultFlag flag) |
Static Public Attributes | |
static const char *const | kStrategyTags [] = { "Gap", "GapRelax", "AmountInWindow", "Consecutive", "AmountGlobal" } |
Tags for the types of strategy. More... | |
Protected Types | |
enum | InfoLevel { eInfoNone = 0, eInfoFinal = 1, eInfoIntermediate = 2, eInfoDebug = 3 } |
Protected Attributes | |
int | fInfoLevel = 0 |
Private Types | |
typedef std::map< int, double > | TModuleDelay |
Private Member Functions | |
double | ComputeSignalT50 (mevt::Counter &, const utl::Vector &rAxis) const |
Set the median arrival time of muons in a counter combining the signals recorded by all associated modules. More... | |
void | DowngradeTrace (utl::TraceB &trace, unsigned int dataReduction=4) |
convert trace from 320Mhz sampling to 80Mhz storing. More... | |
double | EstimateNumberOfMuons (const utl::TraceUI &, const size_t segmentation) const |
Calculate the maximum likelihood estimator of the number of muons in this module. More... | |
unsigned int | FillChannelRecData (mevt::Channel &ch) |
Fill the data reconstructed for a channel. More... | |
void | FillChannelsOn (mevt::Module &m, const std::vector< unsigned int > &, const mdet::Module &) const |
Calculate the number of windows with a signal per time window. More... | |
void | FillModuleRecData (mevt::Module &m, const mdet::Module &) |
Fill the data reconstructed for a module. More... | |
double | GetMedian (const std::vector< double > v) const |
std::vector< unsigned int > | GetPatternMatchBins (mevt::Module &m) |
Get a vector with the bin numbers of the pattern matches for all channels. More... | |
utl::TimeStamp | GetSdTraceStartTime (const evt::Event &, const int counterId) const |
double | GetTimeCorrection (const utl::Vector &dposition, const utl::Vector &axis) const |
utl::TimeInterval | GetTraceOffset (const mevt::Module &m, const int counterId) const |
Get the offset in nanoseconds between the MD trace start time wrt the SD trace start time. More... | |
REGISTER_MODULE ("MdMuonCounterAG", MdMuonCounter) | |
Private Attributes | |
bool | fConvertTo80Mhz |
Downgrad trace to 80Mhz. More... | |
std::unique_ptr < VMuonCounterFunctor > | fCounter |
Object performing the counting. More... | |
utl::MessageLoggerConfig | fLog |
Output messages handler. More... | |
TModuleDelay | fModuleDelay |
unsigned int | fNGaps |
maximum number of gaps in a muon pattern (Gap strategy only). More... | |
unsigned int | fNMinOnes |
Number of 1s required. More... | |
unsigned int | fNOnes |
Number of 1s required. More... | |
double | fNOnesPerPatternMatch |
Number of 1s required. More... | |
bool | fSetTimeStamps |
Flag to indicate if the MD timestamps are set or not. More... | |
Strategy | fStrategy |
Counting stategy to be performed. More... | |
bool | fSyncCountingHisto |
Open the counting histogram at the time of the first muon. More... | |
utl::UnitsConfig | fUnits |
Units configuration. More... | |
unsigned int | fWindowSize |
The number of bins in the inhibition window. More... | |
Describe your module. In one sentence.
Perform offline trace analysis to estimate the number of muons.
Now here a longer description in doxygen. You may use HTML.
Definition at line 39 of file MdMuonCounter.h.
|
private |
Delay in nanoseconds of the MD trace latch wrt the SD trace latch The key of the map is a unique global identifier for each module calculated as counterId*100+moduleId. Accomodates up to 99 modules per counter...
Definition at line 140 of file MdMuonCounter.h.
|
protectedinherited |
|
inherited |
Flag returned by module methods to the RunController.
Enumerator | |
---|---|
eSuccess |
Report success to RunController. |
eFailure |
Report failure to RunController, causing RunController to terminate execution. |
eBreakLoop |
Break current loop. It works for nested loops too! |
eContinueLoop |
Skip remaining modules in the current loop and continue with next iteration of the loop. |
Kind of possible counting criteria to be used.
Enumerator | |
---|---|
eGap | |
eGapRelax | |
eAmountInWindow | |
eConsecutive | |
eAmountGlobal |
Definition at line 43 of file MdMuonCounter.h.
|
inherited |
|
inline |
Definition at line 53 of file MdMuonCounter.h.
|
inline |
Definition at line 54 of file MdMuonCounter.h.
|
private |
Set the median arrival time of muons in a counter combining the signals recorded by all associated modules.
Definition at line 610 of file MdMuonCounter.cc.
References DEBUGLOG, mdet::Counter::GetAssociatedTankId(), mdet::MDetector::GetCounter(), mevt::Counter::GetId(), mevt::Module::GetId(), det::Detector::GetMDetector(), mdet::Counter::GetModule(), mevt::ModuleRecData::GetPatternMatchTimes(), det::MPositionable< Config >::GetPosition(), sdet::Station::GetPosition(), mevt::Module::GetRecData(), det::Detector::GetSDetector(), sdet::SDetector::GetStation(), mevt::Module::IsCandidate(), mevt::Counter::ModulesBegin(), and mevt::Counter::ModulesEnd().
|
private |
convert trace from 320Mhz sampling to 80Mhz storing.
|
private |
Calculate the maximum likelihood estimator of the number of muons in this module.
Definition at line 536 of file MdMuonCounter.cc.
References utl::Trace< T >::Begin(), and utl::Trace< T >::End().
|
private |
Fill the data reconstructed for a channel.
Definition at line 333 of file MdMuonCounter.cc.
References mevt::ChannelRecData::ClearPatternMatchBins(), mevt::Channel::GetId(), mevt::ChannelRecData::GetNumberOfPatternMatchs(), mevt::Channel::GetRecData(), mevt::Channel::GetTrace(), mevt::Channel::HasRecData(), mevt::Channel::HasTrace(), and mevt::Channel::MakeRecData().
|
private |
Calculate the number of windows with a signal per time window.
Definition at line 478 of file MdMuonCounter.cc.
References DEBUGLOG, mdet::FrontEndSiPM::GetBufferLength(), mdet::FrontEnd::GetBufferLength(), mevt::ModuleRecData::GetChannelsOn(), mdet::Module::GetFrontEnd(), mdet::Module::GetFrontEndSiPM(), mdet::FrontEnd::GetMeanSampleRatePeriod(), mdet::FrontEndSiPM::GetMeanSampleRatePeriod(), mevt::Module::GetRecData(), mevt::ModuleRecData::HasChannelsOn(), mdet::Module::IsSiPM(), mevt::ModuleRecData::MakeChannelsOn(), utl::Trace< T >::PushBack(), and utl::Trace< T >::SetBinning().
|
private |
Fill the data reconstructed for a module.
Definition at line 363 of file MdMuonCounter.cc.
References mevt::ModuleRecData::AddPatternMatchTime(), DEBUGLOG, mdet::Scintillator::GetArea(), mevt::ModuleRecData::GetChannelsOn(), mdet::Module::GetFrontEnd(), mdet::Module::GetFrontEndSiPM(), mevt::Module::GetId(), mdet::FrontEnd::GetMeanSampleRatePeriod(), mdet::FrontEndSiPM::GetMeanSampleRatePeriod(), mevt::Module::GetNumberOfActiveChannels(), mevt::Module::GetRecData(), mevt::Module::HasRecData(), INFO, mevt::ModuleRecData::IsSaturated(), mdet::Module::IsSiPM(), mevt::Module::MakeRecData(), mdet::Module::ScintillatorsBegin(), mevt::ModuleRecData::SetActiveArea(), mevt::ModuleRecData::SetNumberOfEstimatedMuons(), mevt::ModuleRecData::SetNumberOfMuonsErrorHigh(), mevt::ModuleRecData::SetNumberOfMuonsErrorLow(), mevt::ModuleRecData::SetNumberOfMuonsLowLimit(), mevt::ModuleRecData::SetSegmentation(), and mevt::ModuleRecData::SetWindowSize().
|
virtual |
Finish: invoked at end of the run (NOT end of the event)
This method is for things that should be done at the end of the run (for example, closing files or writing out histograms) {You must override this method in your concrete module}
Implements fwk::VModule.
Definition at line 324 of file MdMuonCounter.cc.
References io::eSuccess.
|
private |
Helper function to compute the median from data stored in a vector Some library could provide this functionality in the future...
Definition at line 660 of file MdMuonCounter.cc.
|
private |
Get a vector with the bin numbers of the pattern matches for all channels.
Definition at line 453 of file MdMuonCounter.cc.
References mevt::Module::ChannelsBegin(), mevt::Module::ChannelsEnd(), and mevt::Module::GetId().
|
staticinherited |
Definition at line 8 of file VModule.cc.
References fwk::VModule::eBreakLoop, fwk::VModule::eContinueLoop, fwk::VModule::eFailure, and fwk::VModule::eSuccess.
Referenced by fwk::RunController::DoNextInSequence(), fwk::RunController::FinishBranch(), and fwk::RunController::InitBranch().
|
private |
Get the trace start time of the SD station associated to a counter Returns NULL if the time cannot be retrieved. This is why a pointer is used as the return value of this method.
Definition at line 582 of file MdMuonCounter.cc.
References sevt::Station::GetTraceStartTime(), sevt::Station::HasGPSData(), evt::Event::HasSEvent(), and WARNING.
|
inlineinherited |
Definition at line 106 of file VModule.h.
References fwk::VModule::fStopwatch.
|
inlineinherited |
Definition at line 107 of file VModule.h.
References fwk::VModule::fStopwatch.
|
private |
Get the correction due to the arrival particle front at different times. The result is provided in nanoseconds. A flat shower plane oriented according to the axis argument is assumed.
Definition at line 686 of file MdMuonCounter.cc.
References utl::kSpeedOfLight, and utl::s.
|
private |
Get the offset in nanoseconds between the MD trace start time wrt the SD trace start time.
For a SD station, nanoseconds between the trace start and the latch
Definition at line 550 of file MdMuonCounter.cc.
References mdet::Counter::GetAssociatedTankId(), mdet::MDetector::GetCounter(), sdet::Station::GetFADCBinSize(), mdet::Module::GetFrontEnd(), mdet::Module::GetFrontEndSiPM(), mevt::Module::GetId(), sdet::Station::GetLatchBin(), mdet::FrontEnd::GetMeanSampleRatePeriod(), mdet::FrontEndSiPM::GetMeanSampleRatePeriod(), mdet::Counter::GetModule(), mdet::FrontEndSiPM::GetPreT1BufferLength(), mdet::FrontEnd::GetPreT1BufferLength(), sdet::SDetector::GetStation(), and mdet::Module::IsSiPM().
|
inherited |
Retrieve different sorts of module version info.
Definition at line 26 of file VModule.cc.
Referenced by fwk::CentralConfig::GetConfig(), ThresholdCalculatorKG::ThresholdCalculator::Init(), fdDoubleBumpFinder::FdDoubleBumpFinder::Init(), LaserGeneratorNA::LaserGenerator::Init(), LaserLightSimulatorNA::LaserLightSimulator::Init(), FdElectronicsSimulatorOG::FdElectronicsSimulator::Init(), TelescopeSimulatorKG::TelescopeSimulator::Init(), TelescopeSimulatorKG2::TelescopeSimulator::Init(), SdSimpleSimKG::SdSimpleSim::Init(), ShowerPhotonGeneratorOG::ShowerPhotonGenerator::Init(), and testRunController::testModuleVersionInfo().
|
virtual |
Initialize: invoked at beginning of run (NOT beginning of event)
This method is for things that should be done once at the beginning of a run (for example, booking histograms, performing calculations that need to be done only once, initializing parameters) {You must override this method in your concrete module}
Implements fwk::VModule.
Definition at line 52 of file MdMuonCounter.cc.
References RdGeoCeLDFFitter::b, utl::ConsecutiveEnumFactory< EnumType, last, tags, NoConversionPolicy, first >::Create(), delay, io::eSuccess, utl::Branch::GetChild(), utl::Branch::GetFirstChild(), fwk::CentralConfig::GetInstance(), fwk::CentralConfig::GetTopBranch(), INFO, utl::LoadConfig(), and utl::ns.
|
inlineinherited |
Definition at line 95 of file VModule.h.
References fwk::VModule::fStopwatch, and utl::Stopwatch::Reset().
|
private |
|
virtual |
Run: invoked once per event.
This method is for things that should be done once per event {You must override this method in your concrete module}
Implements fwk::VModule.
Definition at line 147 of file MdMuonCounter.cc.
References mevt::Module::ChannelsBegin(), mevt::Module::ChannelsEnd(), mevt::MEvent::CountersBegin(), mevt::MEvent::CountersEnd(), DEBUGLOG, io::eSuccess, mdet::Counter::GetAssociatedTankId(), evt::ShowerSRecData::GetAxis(), mdet::MDetector::GetCounter(), mdet::Module::GetFrontEnd(), mdet::Module::GetFrontEndSiPM(), mevt::Channel::GetId(), mevt::Counter::GetId(), mevt::Module::GetId(), utl::TimeInterval::GetInterval(), mdet::FrontEnd::GetMeanSampleRatePeriod(), mdet::FrontEndSiPM::GetMeanSampleRatePeriod(), mdet::Counter::GetModule(), sevt::Station::GetRecData(), mevt::Module::GetRecData(), mevt::Module::GetRejectionReason(), sevt::StationRecData::GetSignalStartTime(), evt::Event::HasMEvent(), sevt::Station::HasRecData(), evt::Event::HasRecShower(), evt::Event::HasSEvent(), INFO, mevt::Counter::IsCandidate(), mevt::Counter::IsEmpty(), mevt::Counter::IsRejected(), mevt::Module::IsRejected(), mdet::Module::IsSiPM(), mevt::Counter::ModulesBegin(), mevt::Counter::ModulesEnd(), utl::nanosecond, mevt::ModuleRecData::SetChannelsOnStartTime(), mevt::Counter::SetSignalT50(), mevt::Counter::SetT502SdStart(), mevt::Channel::SetTraceStartTime(), det::DetectorComponent< C, ManagerProvider >::str(), and WARNING.
|
inlineinherited |
Definition at line 98 of file VModule.h.
References fwk::VModule::fStopwatch, fwk::VModule::Run(), utl::Stopwatch::Start(), and utl::Stopwatch::Stop().
Referenced by fwk::RunController::DoNextInSequence().
|
private |
Downgrad trace to 80Mhz.
Definition at line 79 of file MdMuonCounter.h.
|
private |
Object performing the counting.
Definition at line 85 of file MdMuonCounter.h.
|
protectedinherited |
Definition at line 123 of file VModule.h.
Referenced by RdChannelASCIINoiseImporterRD::RdChannelASCIINoiseImporterRD::Init(), Rd2dLDFFitter::Rd2dLDFFitter::Init(), RdChannelNoiseImporter_AERA::RdChannelNoiseImporter_AERA::Init(), and Rd2dLDFFitter::Rd2dLDFFitter::Run().
|
private |
Output messages handler.
Definition at line 61 of file MdMuonCounter.h.
|
private |
Definition at line 141 of file MdMuonCounter.h.
|
private |
maximum number of gaps in a muon pattern (Gap strategy only).
Definition at line 70 of file MdMuonCounter.h.
|
private |
Number of 1s required.
Definition at line 76 of file MdMuonCounter.h.
|
private |
Number of 1s required.
Definition at line 67 of file MdMuonCounter.h.
|
private |
Number of 1s required.
Definition at line 73 of file MdMuonCounter.h.
|
private |
Flag to indicate if the MD timestamps are set or not.
Definition at line 131 of file MdMuonCounter.h.
|
private |
Counting stategy to be performed.
Definition at line 82 of file MdMuonCounter.h.
|
private |
Open the counting histogram at the time of the first muon.
Definition at line 134 of file MdMuonCounter.h.
|
private |
Units configuration.
Definition at line 88 of file MdMuonCounter.h.
|
private |
The number of bins in the inhibition window.
Definition at line 64 of file MdMuonCounter.h.
|
static |
Tags for the types of strategy.
Definition at line 51 of file MdMuonCounter.h.