Public Member Functions | Private Member Functions | Private Attributes | List of all members
beamlineutil::BeamlineCalibration Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-04-14/BeamlineUtils/BeamlineCalibration.h"

Public Member Functions

 BeamlineCalibration (fhicl::ParameterSet const &pset)
 
 BeamlineCalibration (fhicl::ParameterSet const &pset, art::ActivityRegistry &)
 
double TimeCorrection (ChannelID channel) const
 Relative timing calibrations between individual digitizer channels. More...
 
double TimeCorrection (unsigned int channel) const
 Relative timing calibrations between individual digitizer channels. More...
 

Private Member Functions

void ReadCalibrationData (const fhicl::ParameterSet &pset)
 

Private Attributes

std::map< ChannelID, float > fTimeCorrections
 
art::ServiceHandle< BeamlineChannelMapfChannelMap
 

Detailed Description

Definition at line 33 of file BeamlineCalibration.h.

Constructor & Destructor Documentation

beamlineutil::BeamlineCalibration::BeamlineCalibration ( fhicl::ParameterSet const &  pset)
beamlineutil::BeamlineCalibration::BeamlineCalibration ( fhicl::ParameterSet const &  pset,
art::ActivityRegistry  
)

Member Function Documentation

void beamlineutil::BeamlineCalibration::ReadCalibrationData ( const fhicl::ParameterSet pset)
private

Definition at line 26 of file BeamlineCalibration_service.cc.

References fChannelMap, fTimeCorrections, fhicl::ParameterSet::get(), beamlinegeo::ToF, and beamlinegeo::ToFCounterNames.

26  {
27 
28  // Time corrections
29  fhicl::ParameterSet timeCorrections = pset.get<fhicl::ParameterSet>("TimeCorrections");
30 
31  // ToF
32  fhicl::ParameterSet tof_corrections = timeCorrections.get<fhicl::ParameterSet>("ToF");
33  for (std::map<beamlinegeo::ToFCounter, std::string>::const_iterator tofCounterIt = beamlinegeo::ToFCounterNames.begin();
34  tofCounterIt != beamlinegeo::ToFCounterNames.end(); ++tofCounterIt) {
35  DetectorID tofdet(beamlinegeo::BeamlineSystem::ToF, tofCounterIt->first);
36  std::vector<float> tofdet_corrections
37  = tof_corrections.get<std::vector<float> >(tofCounterIt->second);
38  for (unsigned int channel = 0; channel < tofdet_corrections.size(); ++channel) {
39  ChannelID chanid(tofdet, channel);
40  fTimeCorrections[chanid] = tofdet_corrections[channel];
41  }
42  }
43 
44  // Other
45  std::vector<std::pair<unsigned int, float> > other_corrections
46  = timeCorrections.get<std::vector<std::pair<unsigned int, float> > >("Other");
47  for (std::vector<std::pair<unsigned int, float> >::const_iterator otherCorrIt = other_corrections.begin();
48  otherCorrIt != other_corrections.end(); ++otherCorrIt) {
49  ChannelID chanid = fChannelMap->DigitChannel(otherCorrIt->first);
50  fTimeCorrections[chanid] = otherCorrIt->second;
51  }
52 
53  return;
54 
55 }
T get(std::string const &key) const
Definition: ParameterSet.h:231
art::ServiceHandle< BeamlineChannelMap > fChannelMap
std::map< ChannelID, float > fTimeCorrections
const std::map< ToFCounter, std::string > ToFCounterNames
double beamlineutil::BeamlineCalibration::TimeCorrection ( ChannelID  channel) const

Relative timing calibrations between individual digitizer channels.

Definition at line 58 of file BeamlineCalibration_service.cc.

References fTimeCorrections.

Referenced by beamlinereco::EventWaveformDump::analyze(), beamlinereco::ToFCalibration::produce(), and TimeCorrection().

58  {
59  if (!fTimeCorrections.count(channel))
60  return 0.;
61  return fTimeCorrections.at(channel);
62 }
std::map< ChannelID, float > fTimeCorrections
double beamlineutil::BeamlineCalibration::TimeCorrection ( unsigned int  channel) const

Relative timing calibrations between individual digitizer channels.

Definition at line 65 of file BeamlineCalibration_service.cc.

References DEFINE_ART_SERVICE, fChannelMap, and TimeCorrection().

65  {
66  ChannelID chanid = fChannelMap->DigitChannel(online_channel);
67  return this->TimeCorrection(chanid);
68 }
double TimeCorrection(ChannelID channel) const
Relative timing calibrations between individual digitizer channels.
art::ServiceHandle< BeamlineChannelMap > fChannelMap

Member Data Documentation

art::ServiceHandle<BeamlineChannelMap> beamlineutil::BeamlineCalibration::fChannelMap
private

Definition at line 55 of file BeamlineCalibration.h.

Referenced by ReadCalibrationData(), and TimeCorrection().

std::map<ChannelID, float> beamlineutil::BeamlineCalibration::fTimeCorrections
private

Definition at line 52 of file BeamlineCalibration.h.

Referenced by ReadCalibrationData(), and TimeCorrection().


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