All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Types | Private Attributes | List of all members
Noise::CoherentNoiseFactorProvider Class Reference

#include <CoherentNoiseFactorProvider.h>

Inheritance diagram for Noise::CoherentNoiseFactorProvider:
Noise::ICoherentNoiseFactor Noise::CoherentNoiseFactor

Public Member Functions

 CoherentNoiseFactorProvider (const fhicl::ParameterSet &pset)
 
void resetCoherentNoiseFactors (const TH1D *) override
 
float getCoherentNoiseFactor (unsigned int, unsigned int) const override
 
- Public Member Functions inherited from Noise::ICoherentNoiseFactor
virtual ~ICoherentNoiseFactor () noexcept=default
 

Private Types

using CorrFactorsMap = std::map< unsigned int, std::vector< float >>
 

Private Attributes

bool fDiagnosticOutput
 
CorrFactorsMap fCorrFactorsMap
 

Detailed Description

Definition at line 24 of file CoherentNoiseFactorProvider.h.

Member Typedef Documentation

using Noise::CoherentNoiseFactorProvider::CorrFactorsMap = std::map<unsigned int, std::vector<float>>
private

Definition at line 41 of file CoherentNoiseFactorProvider.h.

Constructor & Destructor Documentation

Noise::CoherentNoiseFactorProvider::CoherentNoiseFactorProvider ( const fhicl::ParameterSet &  pset)

Definition at line 31 of file CoherentNoiseFactorProvider.cxx.

31  {
32 
33  mf::LogInfo("CoherentNoiseFactorProvider") << "Recover the channel map" ;
34 
35  fDiagnosticOutput = pset.get<bool>("DiagnosticOutput", false);
36 
37  // Set up the board->correlated factors map
38  const auto& channelMap = art::ServiceHandle<icarusDB::IICARUSChannelMap const>{}.get();
39 
40  const icarusDB::TPCReadoutBoardToChannelMap& readoutBoardToChannelMap = channelMap->getReadoutBoardToChannelMap();
41 
42  for(const auto& boardPair : readoutBoardToChannelMap)
43  {
44  fCorrFactorsMap.insert({boardPair.first,std::vector<float>(4,0.)});
45  }
46 
47 
48  mf::LogInfo("CoherentNoiseFactorProvider") << "==> FragmentID map size: " << fCorrFactorsMap.size() << std::endl;
49 
50  return;
51 }
std::map< unsigned int, SlotChannelVecPair > TPCReadoutBoardToChannelMap

Member Function Documentation

float Noise::CoherentNoiseFactorProvider::getCoherentNoiseFactor ( unsigned int  board,
unsigned int  index 
) const
overridevirtual

Implements Noise::ICoherentNoiseFactor.

Definition at line 73 of file CoherentNoiseFactorProvider.cxx.

74 {
75  CorrFactorsMap::const_iterator cohFactorsItr = fCorrFactorsMap.find(board);
76 
77  if (cohFactorsItr == fCorrFactorsMap.end())
78  throw cet::exception("CoherentNoiseFactorService")
79  << "Readout board " << board << ", with index " << index << "'\n"
80  << "This is considered a fatal issue!\n";
81 
82  float cf = cohFactorsItr->second[index];
83 
84  return cf;
85 }
void Noise::CoherentNoiseFactorProvider::resetCoherentNoiseFactors ( const TH1D *  noiseHist)
overridevirtual

Implements Noise::ICoherentNoiseFactor.

Definition at line 55 of file CoherentNoiseFactorProvider.cxx.

56 {
57  for(size_t index = 0; index < 4; index++)
58  {
59  float meanVal = noiseHist->GetMean();
60 
61  for(auto& correction : fCorrFactorsMap)
62  {
63  float corVal = noiseHist->GetRandom() / meanVal;
64 
65  correction.second[index] = corVal;
66  }
67  }
68 
69  return;
70 }

Member Data Documentation

CorrFactorsMap Noise::CoherentNoiseFactorProvider::fCorrFactorsMap
private

Definition at line 43 of file CoherentNoiseFactorProvider.h.

bool Noise::CoherentNoiseFactorProvider::fDiagnosticOutput
private

Definition at line 39 of file CoherentNoiseFactorProvider.h.


The documentation for this class was generated from the following files: