1 #ifndef _MdMuonCounterAG_MdMuonCounter_h_
2 #define _MdMuonCounterAG_MdMuonCounter_h_
4 #include <utl/config.h>
6 #include <fwk/VModule.h>
7 #include <mevt/MEvent.h>
8 #include <mevt/Counter.h>
9 #include <mdet/MDetector.h>
10 #include <evt/ShowerRecData.h>
12 #include <utl/Trace-fwd.h>
13 #include <utl/MessageLoggerConfig.h>
14 #include <utl/UnitsConfig.h>
20 #include <boost/utility.hpp>
23 namespace MdMuonCounterAG {
26 class VMuonCounterFunctor;
55 VModule::ResultFlag
Init();
57 VModule::ResultFlag
Finish();
123 double GetMedian(
const std::vector<double> v)
const;
VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
double fNOnesPerPatternMatch
Number of 1s required.
Helper class for configuration of units: value and name.
Counter level event data.
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...
utl::MessageLoggerConfig fLog
Output messages handler.
unsigned int fNMinOnes
Number of 1s required.
bool fConvertTo80Mhz
Downgrad trace to 80Mhz.
void DowngradeTrace(utl::TraceB &trace, unsigned int dataReduction=4)
convert trace from 320Mhz sampling to 80Mhz storing.
double EstimateNumberOfMuons(const utl::TraceUI &, const size_t segmentation) const
Calculate the maximum likelihood estimator of the number of muons in this module. ...
A TimeStamp holds GPS second and nanosecond for some event.
std::vector< unsigned int > GetPatternMatchBins(mevt::Module &m)
Get a vector with the bin numbers of the pattern matches for all channels.
void FillModuleRecData(mevt::Module &m, const mdet::Module &)
Fill the data reconstructed for a module.
Wraps a message to logger (received as parameter or created here), its access and configuration...
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.
VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
utl::TimeStamp GetSdTraceStartTime(const evt::Event &, const int counterId) const
REGISTER_MODULE("MdMuonCounterAG", MdMuonCounter)
unsigned int fNGaps
maximum number of gaps in a muon pattern (Gap strategy only).
Strategy
Kind of possible counting criteria to be used.
unsigned int FillChannelRecData(mevt::Channel &ch)
Fill the data reconstructed for a channel.
bool fSyncCountingHisto
Open the counting histogram at the time of the first muon.
Describe your module. In one sentence.
A TimeInterval is used to represent time elapsed between two events.
Template class for a FADC data or calibrated data container. Use the typedefs (TraceD, TraceI, etc.) defined in Trace-fwd.h.
utl::UnitsConfig fUnits
Units configuration.
Channel level event data.
unsigned int fNOnes
Number of 1s required.
double GetMedian(const std::vector< double > v) const
VModule::ResultFlag Run(evt::Event &e)
Run: invoked once per event.
std::unique_ptr< VMuonCounterFunctor > fCounter
Object performing the counting.
unsigned int fWindowSize
The number of bins in the inhibition window.
std::map< int, double > TModuleDelay
double GetTimeCorrection(const utl::Vector &dposition, const utl::Vector &axis) const
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 mo...
Strategy fStrategy
Counting stategy to be performed.
static const char *const kStrategyTags[]
Tags for the types of strategy.
TModuleDelay fModuleDelay
bool fSetTimeStamps
Flag to indicate if the MD timestamps are set or not.