3 #include <mevt/Module.h>
4 #include <mdet/Module.h>
7 #include <utl/TabularStream.h>
9 namespace MdPileUpCorrecterAG {
15 boost::tuple<double, double>
19 double nSingleRealizationMuons = 0;
20 double nAverageMuons = 0;
22 const unsigned int numberOfSamples = mdetModule.
IsSiPM() ?
41 for (
size_t bin = 0; bin < numberOfSamples; ++bin ) {
55 if ( traceRec.
At(bin) == 1 )
58 if ( traceRec.
At(bin) == 2 )
71 if ( chanOn + chanIn == ns )
76 return boost::tuple<double, double>(-1, -1);
92 for (
size_t bin = 0; bin < numberOfSamples; ++bin ) {
94 unsigned int k = channelsOnTrace.
At(bin);
98 unsigned int ni = channelsInhiTrace.
At(bin);
101 unsigned int bin_segmentation = ns-ni;
103 double S = double(ns)/bin_segmentation * std::log(1 -
double(k)/bin_segmentation)/std::log(1 - 1.0/bin_segmentation);
104 double A = ns * std::log(1 -
double(k)/bin_segmentation);
106 nSingleRealizationMuons +=
S;
113 return boost::tuple<double, double>(nAverageMuons, nSingleRealizationMuons);
Module level reconstruction data. This class contains all data required by the muon reconstruction...
void SetSaturated(const bool sat)
bool HasChannelsInhibited() const
T & At(const SizeType i)
trace entry with checked address
utl::TraceD & GetNumberOfMuonsVsTime()
boost::tuple< double, double > operator()(mevt::Module &module, const mdet::Module &mdetModule) const
Performs the counting.
ChannelRecData & GetRecData()
void MakeMeanMuonsVsTime()
InhibitionStrategy()
Creates a functor.
utl::TraceUI & GetChannelsInhibited()
utl::TraceUI & GetChannelsOn()
Number of windows with a signal in a module.
bool HasChannelsOn() const
bool HasMeanMuonsVsTime() const
ChannelConstIterator ChannelsBegin() const
void MakeNumberOfMuonsVsTime()
unsigned int GetBufferLength() const
Number of bins of the buffer.
const FrontEnd & GetFrontEnd() const
void MakeChannelsInhibited()
utl::TraceUI & GetTrace()
ChannelConstIterator ChannelsEnd() const
bool HasNumberOfMuonsVsTime() const
Template class for a FADC data or calibrated data container. Use the typedefs (TraceD, TraceI, etc.) defined in Trace-fwd.h.
ModuleRecData & GetRecData()
const FrontEndSiPM & GetFrontEndSiPM() const
Channel level event data.
size_t GetSegmentation() const
void PushBack(const T &value)
Insert a single value at the end.
utl::TraceD & GetMeanMuonsVsTime()
InternalChannelCollection::ComponentIterator ChannelIterator
unsigned int GetBufferLength() const
Number of bins of the buffer.