CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
PPSDiamondSampicTimingCalibrationPCLHarvester Class Reference

#include <CalibPPS/TimingCalibration/PPSDiamondSampicTimingCalibrationPCLHarvester/plugins/PPSDiamondSampicTimingCalibrationPCLHarvester.cc>

Inheritance diagram for PPSDiamondSampicTimingCalibrationPCLHarvester:
DQMEDHarvester edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 PPSDiamondSampicTimingCalibrationPCLHarvester (const edm::ParameterSet &)
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void calibDb (DQMStore::IGetter &iGetter)
 
void calibJson (DQMStore::IGetter &iGetter)
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
bool getDbSampicChannel (DQMStore::IGetter &iGetter, int &db, int &sampic, int &channel, std::string ch_name, CTPPSDiamondDetId detid)
 

Private Attributes

std::vector< CTPPSDiamondDetIddetids_
 
const std::string dqmDir_
 
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecordgeomEsToken_
 
edm::ESHandle< PPSTimingCalibrationhTimingCalib_
 
const std::string jsonCalibFile_
 
const std::string jsonOutputPath_
 
const unsigned int min_entries_
 
edm::ESGetToken< PPSTimingCalibration, PPSTimingCalibrationRcdtimingCalibrationToken_
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Description: Harvester of the DiamondSampic calibration which produces sqlite file with a new channel alignment

Implementation: [Notes on implementation]

Definition at line 45 of file PPSDiamondSampicTimingCalibrationPCLHarvester.cc.

Constructor & Destructor Documentation

◆ PPSDiamondSampicTimingCalibrationPCLHarvester()

PPSDiamondSampicTimingCalibrationPCLHarvester::PPSDiamondSampicTimingCalibrationPCLHarvester ( const edm::ParameterSet iConfig)

Definition at line 68 of file PPSDiamondSampicTimingCalibrationPCLHarvester.cc.

References edm::ParameterSet::getParameter(), jsonCalibFile_, AlCaHLTBitMon_QueryRunRegistry::string, and timingCalibrationToken_.

70  : geomEsToken_(esConsumes<edm::Transition::BeginRun>()),
71  dqmDir_(iConfig.getParameter<std::string>("dqmDir")),
72  min_entries_(iConfig.getParameter<unsigned int>("minEntries")),
73  jsonCalibFile_(iConfig.getParameter<std::string>("jsonCalibFile")),
74  jsonOutputPath_(iConfig.getParameter<std::string>("jsonOutputPath")) {
75  if (jsonCalibFile_.empty())
76  timingCalibrationToken_ = esConsumes<edm::Transition::BeginRun>(
77  edm::ESInputTag(iConfig.getParameter<std::string>("timingCalibrationTag")));
78 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > geomEsToken_
edm::ESGetToken< PPSTimingCalibration, PPSTimingCalibrationRcd > timingCalibrationToken_

Member Function Documentation

◆ beginRun()

void PPSDiamondSampicTimingCalibrationPCLHarvester::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
override

Definition at line 82 of file PPSDiamondSampicTimingCalibrationPCLHarvester.cc.

References CTPPSDiamondDetId::check(), detids_, relativeConstraints::geom, geomEsToken_, edm::EventSetup::getData(), edm::EventSetup::getHandle(), hTimingCalib_, jsonCalibFile_, and timingCalibrationToken_.

82  {
83  if (jsonCalibFile_.empty())
85  const auto& geom = iSetup.getData(geomEsToken_);
86  for (auto it = geom.beginSensor(); it != geom.endSensor(); ++it) {
87  if (!CTPPSDiamondDetId::check(it->first))
88  continue;
89  const CTPPSDiamondDetId detid(it->first);
90  detids_.emplace_back(detid);
91  }
92 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > geomEsToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
static bool check(unsigned int raw)
returns true if the raw ID is a PPS-timing one
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
edm::ESGetToken< PPSTimingCalibration, PPSTimingCalibrationRcd > timingCalibrationToken_

◆ calibDb()

void PPSDiamondSampicTimingCalibrationPCLHarvester::calibDb ( DQMStore::IGetter iGetter)
private

Definition at line 187 of file PPSDiamondSampicTimingCalibrationPCLHarvester.cc.

References cond::service::PoolDBOutputService::currentTime(), dqmiodatasetharvest::db, detids_, dqmDir_, pfMETCorrectionType0_cfi::formula, dqm::implementation::IGetter::get(), getDbSampicChannel(), hTimingCalib_, crabWrapper::key, min_entries_, CTPPSDetId::nPath, submitPVValidationJobs::params, castor_dqm_sourceclient_file_cfg::path, AlCaHarvesting_cff::PPSTimingCalibration, AlCaHLTBitMon_QueryRunRegistry::string, simBeamSpotPI::timeOffset, and cond::service::PoolDBOutputService::writeOneIOV().

Referenced by dqmEndJob().

187  {
189 
190  // book the parameters containers
193 
194  std::unordered_map<uint32_t, dqm::reco::MonitorElement*> timeHisto;
195  std::string rp_name, plane_name, ch_name, path;
196  const std::string& formula = calib.formula();
197 
198  for (const auto& detid : detids_) {
199  detid.channelName(path, CTPPSDiamondDetId::nPath);
200  detid.channelName(ch_name);
201  path = dqmDir_ + "/" + path + "/" + ch_name;
202  const auto chid = detid.rawId();
203 
204  int db, sampic, channel;
205  if (!getDbSampicChannel(iGetter, db, sampic, channel, path, detid))
206  continue;
207 
209  key.db = db;
210  key.sampic = sampic;
211  key.channel = channel;
212 
213  double timeOffset = calib.timeOffset(db, sampic, channel);
214  double timePrecision = calib.timePrecision(db, sampic, channel);
215  if (timeOffset == 0 && timePrecision == 0) {
216  edm::LogWarning("PPSDiamondSampicTimingCalibrationPCLHarvester:dqmEndJob")
217  << "No calibration found for db: " << db << " sampic: " << sampic << " channel: " << channel;
218  continue;
219  }
220 
221  int cell_ct = 0;
222  while (!calib.parameters(db, sampic, channel, cell_ct).empty()) {
223  auto parameters = calib.parameters(db, sampic, channel, cell_ct);
224  key.cell = cell_ct;
225  params[key] = parameters;
226  cell_ct++;
227  }
228 
229  key.cell = -1;
230 
231  time_info[key] = {timeOffset, timePrecision};
232  timeHisto[chid] = iGetter.get(path);
233  if (timeHisto[chid] == nullptr) {
234  edm::LogWarning("PPSDiamondSampicTimingCalibrationPCLHarvester:dqmEndJob")
235  << "Failed to retrieve time monitor for detid: " << detid;
236  continue;
237  }
238 
239  if (min_entries_ > 0 && timeHisto[chid]->getEntries() < min_entries_) {
240  edm::LogInfo("PPSDiamondSampicTimingCalibrationPCLHarvester:dqmEndJob")
241  << "Not enough entries (" << detid << "): " << timeHisto[chid]->getEntries() << " < " << min_entries_
242  << ". Skipping calibration.";
243  continue;
244  }
245 
246  double new_time_offset = timeOffset - timeHisto[chid]->getMean();
247  //scale x axis of the plots by calculated offset
248  timeHisto[chid]->getTH1F()->GetXaxis()->Set(
249  timeHisto[chid]->getTH1F()->GetXaxis()->GetNbins(),
250  timeHisto[chid]->getTH1F()->GetXaxis()->GetXmin() + new_time_offset, // new Xmin
251  timeHisto[chid]->getTH1F()->GetXaxis()->GetXmax() + new_time_offset); // new Xmax
252  timeHisto[chid]->getTH1F()->ResetStats();
253 
254  time_info[key] = {new_time_offset, timePrecision};
255  }
256 
257  auto calibPPS = PPSTimingCalibration(formula, params, time_info);
258  // write the object
260  poolDbService->writeOneIOV(calibPPS, poolDbService->currentTime(), "PPSTimingCalibrationRcd_SAMPIC");
261 }
std::map< Key, std::pair< double, double > > TimingMap
Helper structure for indexing calibration data.
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
bool getDbSampicChannel(DQMStore::IGetter &iGetter, int &db, int &sampic, int &channel, std::string ch_name, CTPPSDiamondDetId detid)
Log< level::Info, false > LogInfo
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
std::map< Key, std::vector< double > > ParametersMap
Log< level::Warning, false > LogWarning

◆ calibJson()

void PPSDiamondSampicTimingCalibrationPCLHarvester::calibJson ( DQMStore::IGetter iGetter)
private

Definition at line 128 of file PPSDiamondSampicTimingCalibrationPCLHarvester.cc.

References dqmiodatasetharvest::db, detids_, dqmDir_, pfMETCorrectionType0_cfi::formula, dqm::implementation::IGetter::get(), getDbSampicChannel(), jsonCalibFile_, jsonOutputPath_, min_entries_, CTPPSDetId::nPath, castor_dqm_sourceclient_file_cfg::path, AlCaHLTBitMon_QueryRunRegistry::string, and to_string().

Referenced by dqmEndJob().

128  {
129  std::unordered_map<uint32_t, dqm::reco::MonitorElement*> timeHisto;
130  std::string ch_name, path;
131 
132  pt::ptree node;
133  pt::read_json(jsonCalibFile_, node);
134  const std::string formula = node.get<std::string>("formula");
135 
136  for (const auto& detid : detids_) {
137  detid.channelName(path, CTPPSDiamondDetId::nPath);
138  detid.channelName(ch_name);
139  path = dqmDir_ + "/" + path + "/" + ch_name;
140  const auto chid = detid.rawId();
141 
142  int db, sampic, channel;
143  if (!getDbSampicChannel(iGetter, db, sampic, channel, path, detid))
144  continue;
145 
146  int ct = 0;
147  for (pt::ptree::value_type& par : node.get_child("parameters." + std::to_string(db))) {
148  double new_time_offset;
149  if (ct == 16 * (1 - sampic) + channel) { //flip the calibration - sampic 1 is first in json
150  double old_time_offset = par.second.get<double>("time_offset");
151 
152  timeHisto[chid] = iGetter.get(path);
153 
154  if (timeHisto[chid] == nullptr) {
155  edm::LogWarning("PPSDiamondSampicTimingCalibrationPCLHarvester:dqmEndJob")
156  << "Failed to retrieve time monitor for detid" << detid;
157  par.second.put<double>("time_offset", old_time_offset);
158  continue;
159  }
160 
161  if (min_entries_ > 0 && timeHisto[chid]->getEntries() < min_entries_) {
162  edm::LogWarning("PPSDiamondSampicTimingCalibrationPCLHarvester:dqmEndJob")
163  << "Not enough entries for channel (" << detid << "): " << timeHisto[chid]->getEntries() << " < "
164  << min_entries_ << ". Skipping calibration.";
165  par.second.put<double>("time_offset", old_time_offset);
166  continue;
167  }
168  new_time_offset = old_time_offset - timeHisto[chid]->getMean();
169  //scale x axis of the plots by calculated offset
170  timeHisto[chid]->getTH1F()->GetXaxis()->Set(
171  timeHisto[chid]->getTH1F()->GetXaxis()->GetNbins(),
172  timeHisto[chid]->getTH1F()->GetXaxis()->GetXmin() + new_time_offset, // new Xmin
173  timeHisto[chid]->getTH1F()->GetXaxis()->GetXmax() + new_time_offset); // new Xmax
174  timeHisto[chid]->getTH1F()->ResetStats();
175 
176  par.second.put<double>("time_offset", new_time_offset);
177  break;
178  }
179  ct++;
180  }
181  }
182  pt::write_json(jsonOutputPath_, node);
183 }
static std::string to_string(const XMLCh *ch)
bool getDbSampicChannel(DQMStore::IGetter &iGetter, int &db, int &sampic, int &channel, std::string ch_name, CTPPSDiamondDetId detid)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
Log< level::Warning, false > LogWarning

◆ dqmEndJob()

void PPSDiamondSampicTimingCalibrationPCLHarvester::dqmEndJob ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter 
)
overrideprivatevirtual

◆ fillDescriptions()

void PPSDiamondSampicTimingCalibrationPCLHarvester::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 276 of file PPSDiamondSampicTimingCalibrationPCLHarvester.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

276  {
278  desc.add<std::string>("timingCalibrationTag", "GlobalTag:PPSDiamondSampicCalibration")
279  ->setComment("input tag for timing calibration retrieval");
280  desc.add<std::string>("dqmDir", "AlCaReco/PPSDiamondSampicTimingCalibrationPCL")
281  ->setComment("input path for the various DQM plots");
282  desc.add<unsigned int>("minEntries", 1)->setComment("minimal number of hits to extract calibration");
283  desc.add<std::string>("jsonCalibFile", "")
284  ->setComment(
285  "input path for json file containing calibration, if none, calibration will be obtained from db instead");
286  desc.add<std::string>("jsonOutputPath", "offset_cal.json")->setComment("output path for the new json calibration");
287  descriptions.add("PPSDiamondSampicTimingCalibrationPCLHarvester", desc);
288 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ getDbSampicChannel()

bool PPSDiamondSampicTimingCalibrationPCLHarvester::getDbSampicChannel ( DQMStore::IGetter iGetter,
int &  db,
int &  sampic,
int &  channel,
std::string  ch_name,
CTPPSDiamondDetId  detid 
)
private

Definition at line 96 of file PPSDiamondSampicTimingCalibrationPCLHarvester.cc.

References dqmiodatasetharvest::db, dqm::implementation::IGetter::get(), and castor_dqm_sourceclient_file_cfg::path.

Referenced by calibDb(), and calibJson().

97  {
98  auto histDb = iGetter.get(path + "db");
99  auto histSampic = iGetter.get(path + "sampic");
100  auto histChannel = iGetter.get(path + "channel");
101 
102  if (histDb == nullptr) {
103  edm::LogWarning("PPSDiamondSampicTimingCalibrationPCLHarvester:dqmEndJob")
104  << "Failed to retrieve db for detid: " << detid;
105  return false;
106  }
107 
108  if (histSampic == nullptr) {
109  edm::LogWarning("PPSDiamondSampicTimingCalibrationPCLHarvester:dqmEndJob")
110  << "Failed to retrieve sampic for detid: " << detid;
111  return false;
112  }
113 
114  if (histChannel == nullptr) {
115  edm::LogWarning("PPSDiamondSampicTimingCalibrationPCLHarvester:dqmEndJob")
116  << "Failed to retrieve channel hwId for detid: " << detid;
117  return false;
118  }
119 
120  db = histDb->getIntValue();
121  sampic = histSampic->getIntValue();
122  channel = histChannel->getIntValue();
123 
124  return true;
125 }
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
Log< level::Warning, false > LogWarning

Member Data Documentation

◆ detids_

std::vector<CTPPSDiamondDetId> PPSDiamondSampicTimingCalibrationPCLHarvester::detids_
private

Definition at line 60 of file PPSDiamondSampicTimingCalibrationPCLHarvester.cc.

Referenced by beginRun(), calibDb(), and calibJson().

◆ dqmDir_

const std::string PPSDiamondSampicTimingCalibrationPCLHarvester::dqmDir_
private

Definition at line 61 of file PPSDiamondSampicTimingCalibrationPCLHarvester.cc.

Referenced by calibDb(), calibJson(), and dqmEndJob().

◆ geomEsToken_

edm::ESGetToken<CTPPSGeometry, VeryForwardRealGeometryRecord> PPSDiamondSampicTimingCalibrationPCLHarvester::geomEsToken_
private

Definition at line 57 of file PPSDiamondSampicTimingCalibrationPCLHarvester.cc.

Referenced by beginRun().

◆ hTimingCalib_

edm::ESHandle<PPSTimingCalibration> PPSDiamondSampicTimingCalibrationPCLHarvester::hTimingCalib_
private

Definition at line 59 of file PPSDiamondSampicTimingCalibrationPCLHarvester.cc.

Referenced by beginRun(), and calibDb().

◆ jsonCalibFile_

const std::string PPSDiamondSampicTimingCalibrationPCLHarvester::jsonCalibFile_
private

◆ jsonOutputPath_

const std::string PPSDiamondSampicTimingCalibrationPCLHarvester::jsonOutputPath_
private

Definition at line 63 of file PPSDiamondSampicTimingCalibrationPCLHarvester.cc.

Referenced by calibJson().

◆ min_entries_

const unsigned int PPSDiamondSampicTimingCalibrationPCLHarvester::min_entries_
private

Definition at line 62 of file PPSDiamondSampicTimingCalibrationPCLHarvester.cc.

Referenced by calibDb(), and calibJson().

◆ timingCalibrationToken_

edm::ESGetToken<PPSTimingCalibration, PPSTimingCalibrationRcd> PPSDiamondSampicTimingCalibrationPCLHarvester::timingCalibrationToken_
private