11 #include "art/Framework/Services/Registry/ServiceHandle.h"
12 #include "art/Framework/Services/Registry/ServiceDefinitionMacros.h"
13 #include "messagefacility/MessageLogger/MessageLogger.h"
14 #include "fhiclcpp/ParameterSet.h"
15 #include "cetlib_except/exception.h"
16 #include "cetlib/cpu_timer.h"
33 mf::LogInfo(
"CoherentNoiseFactorProvider") <<
"Recover the channel map" ;
38 const auto& channelMap = art::ServiceHandle<icarusDB::IICARUSChannelMap const>{}.get();
42 for(
const auto& boardPair : readoutBoardToChannelMap)
48 mf::LogInfo(
"CoherentNoiseFactorProvider") <<
"==> FragmentID map size: " <<
fCorrFactorsMap.size() << std::endl;
57 for(
size_t index = 0; index < 4; index++)
59 float meanVal = noiseHist->GetMean();
63 float corVal = noiseHist->GetRandom() / meanVal;
65 correction.second[index] = corVal;
75 CorrFactorsMap::const_iterator cohFactorsItr =
fCorrFactorsMap.find(board);
78 throw cet::exception(
"CoherentNoiseFactorService")
79 <<
"Readout board " << board <<
", with index " << index <<
"'\n"
80 <<
"This is considered a fatal issue!\n";
82 float cf = cohFactorsItr->second[index];
Utilities related to art service access.
CoherentNoiseFactorProvider(const fhicl::ParameterSet &pset)
void resetCoherentNoiseFactors(const TH1D *) override
float getCoherentNoiseFactor(unsigned int, unsigned int) const override
std::map< unsigned int, SlotChannelVecPair > TPCReadoutBoardToChannelMap
CorrFactorsMap fCorrFactorsMap