CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
PPSAlignmentWorker Class Reference
Inheritance diagram for PPSAlignmentWorker:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Classes

struct  SectorData
 

Public Member Functions

 PPSAlignmentWorker (const edm::ParameterSet &iConfig)
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 

Private Member Functions

void analyze (const edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
void bookHistograms (DQMStore::IBooker &iBooker, edm::Run const &, edm::EventSetup const &iSetup) override
 

Private Attributes

const bool debug_
 
const std::string dqmDir_
 
const edm::ESGetToken< PPSAlignmentConfiguration, PPSAlignmentConfigurationRcdesTokenAnalyze_
 
const edm::ESGetToken< PPSAlignmentConfiguration, PPSAlignmentConfigurationRcdesTokenBookHistograms_
 
SectorData sectorData45_
 
SectorData sectorData56_
 
const std::vector< edm::InputTagtracksTags_
 
std::vector< edm::EDGetTokenT< CTPPSLocalTrackLiteCollection > > tracksTokens_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 35 of file PPSAlignmentWorker.cc.

Constructor & Destructor Documentation

◆ PPSAlignmentWorker()

PPSAlignmentWorker::PPSAlignmentWorker ( const edm::ParameterSet iConfig)

Definition at line 106 of file PPSAlignmentWorker.cc.

References debug_, dqmDir_, edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, makeGlobalPositionRcd_cfg::tag, tracksTags_, and tracksTokens_.

108  esConsumes<PPSAlignmentConfiguration, PPSAlignmentConfigurationRcd, edm::Transition::BeginRun>(
109  edm::ESInputTag("", iConfig.getParameter<std::string>("label")))),
110  esTokenAnalyze_(esConsumes<PPSAlignmentConfiguration, PPSAlignmentConfigurationRcd>(
111  edm::ESInputTag("", iConfig.getParameter<std::string>("label")))),
112  tracksTags_(iConfig.getParameter<std::vector<edm::InputTag>>("tracksTags")),
113  dqmDir_(iConfig.getParameter<std::string>("dqm_dir")),
114  debug_(iConfig.getParameter<bool>("debug")) {
115  edm::LogInfo("PPSAlignmentWorker").log([&](auto& li) {
116  li << "parameters:\n";
117  li << "* label: " << iConfig.getParameter<std::string>("label") << "\n";
118  li << "* tracksTags:\n";
119  for (auto& tag : tracksTags_) {
120  li << " " << tag << ",\n";
121  }
122  li << "* dqm_dir: " << dqmDir_ << "\n";
123  li << "* debug: " << std::boolalpha << debug_;
124  });
125 
126  for (auto& tag : tracksTags_) {
127  tracksTokens_.emplace_back(consumes<CTPPSLocalTrackLiteCollection>(tag));
128  }
129 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const std::vector< edm::InputTag > tracksTags_
const edm::ESGetToken< PPSAlignmentConfiguration, PPSAlignmentConfigurationRcd > esTokenAnalyze_
const std::string dqmDir_
Log< level::Info, false > LogInfo
const edm::ESGetToken< PPSAlignmentConfiguration, PPSAlignmentConfigurationRcd > esTokenBookHistograms_
std::vector< edm::EDGetTokenT< CTPPSLocalTrackLiteCollection > > tracksTokens_

Member Function Documentation

◆ analyze()

void PPSAlignmentWorker::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 138 of file PPSAlignmentWorker.cc.

References looper::cfg, debug_, esTokenAnalyze_, Exception, edm::EventSetup::getData(), patZpeak::handle, mps_fire::i, iEvent, PPSAlignmentWorker::SectorData::process(), edm::errors::ProductNotFound, sectorData45_, sectorData56_, tracks, tracksTags_, and tracksTokens_.

138  {
140  bool foundProduct = false;
141 
142  for (unsigned int i = 0; i < tracksTokens_.size(); i++) {
143  if (auto handle = iEvent.getHandle(tracksTokens_[i])) {
144  tracks = *handle;
145  foundProduct = true;
146  edm::LogInfo("PPSAlignmentWorker") << "Found a product with " << tracksTags_[i];
147  break;
148  }
149  }
150  if (!foundProduct) {
151  throw edm::Exception(edm::errors::ProductNotFound) << "Could not find a product with any of the selected labels.";
152  }
153 
154  const auto& cfg = iSetup.getData(esTokenAnalyze_);
155 
158 }
unsigned int process(const CTPPSLocalTrackLiteCollection &tracks, const PPSAlignmentConfiguration &cfg, bool debug)
const std::vector< edm::InputTag > tracksTags_
int iEvent
Definition: GenABIO.cc:224
const edm::ESGetToken< PPSAlignmentConfiguration, PPSAlignmentConfigurationRcd > esTokenAnalyze_
bool getData(T &iHolder) const
Definition: EventSetup.h:122
Log< level::Info, false > LogInfo
auto const & tracks
cannot be loose
std::vector< CTPPSLocalTrackLite > CTPPSLocalTrackLiteCollection
Collection of CTPPSLocalTrackLite objects.
std::vector< edm::EDGetTokenT< CTPPSLocalTrackLiteCollection > > tracksTokens_

◆ bookHistograms()

void PPSAlignmentWorker::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 131 of file PPSAlignmentWorker.cc.

References looper::cfg, debug_, dqmDir_, esTokenBookHistograms_, edm::EventSetup::getData(), PPSAlignmentWorker::SectorData::init(), sectorData45_, and sectorData56_.

131  {
132  const auto& cfg = iSetup.getData(esTokenBookHistograms_);
133 
134  sectorData45_.init(iBooker, cfg, cfg.sectorConfig45(), dqmDir_ + "/worker", debug_);
135  sectorData56_.init(iBooker, cfg, cfg.sectorConfig56(), dqmDir_ + "/worker", debug_);
136 }
const std::string dqmDir_
void init(DQMStore::IBooker &iBooker, const PPSAlignmentConfiguration &cfg, const PPSAlignmentConfiguration::SectorConfig &scfg, const std::string &rootDir, bool debug)
const edm::ESGetToken< PPSAlignmentConfiguration, PPSAlignmentConfigurationRcd > esTokenBookHistograms_

◆ fillDescriptions()

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

Definition at line 160 of file PPSAlignmentWorker.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, HLT_2022v12_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

160  {
162 
163  desc.add<std::string>("label", "");
164  desc.add<std::vector<edm::InputTag>>("tracksTags", {edm::InputTag("ctppsLocalTrackLiteProducer")});
165  desc.add<std::string>("dqm_dir", "AlCaReco/PPSAlignment");
166  desc.add<bool>("debug", false);
167 
168  descriptions.addWithDefaultLabel(desc);
169 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ debug_

const bool PPSAlignmentWorker::debug_
private

Definition at line 101 of file PPSAlignmentWorker.cc.

Referenced by analyze(), bookHistograms(), and PPSAlignmentWorker().

◆ dqmDir_

const std::string PPSAlignmentWorker::dqmDir_
private

Definition at line 100 of file PPSAlignmentWorker.cc.

Referenced by bookHistograms(), and PPSAlignmentWorker().

◆ esTokenAnalyze_

const edm::ESGetToken<PPSAlignmentConfiguration, PPSAlignmentConfigurationRcd> PPSAlignmentWorker::esTokenAnalyze_
private

Definition at line 92 of file PPSAlignmentWorker.cc.

Referenced by analyze().

◆ esTokenBookHistograms_

const edm::ESGetToken<PPSAlignmentConfiguration, PPSAlignmentConfigurationRcd> PPSAlignmentWorker::esTokenBookHistograms_
private

Definition at line 91 of file PPSAlignmentWorker.cc.

Referenced by bookHistograms().

◆ sectorData45_

SectorData PPSAlignmentWorker::sectorData45_
private

Definition at line 97 of file PPSAlignmentWorker.cc.

Referenced by analyze(), and bookHistograms().

◆ sectorData56_

SectorData PPSAlignmentWorker::sectorData56_
private

Definition at line 98 of file PPSAlignmentWorker.cc.

Referenced by analyze(), and bookHistograms().

◆ tracksTags_

const std::vector<edm::InputTag> PPSAlignmentWorker::tracksTags_
private

Definition at line 94 of file PPSAlignmentWorker.cc.

Referenced by analyze(), and PPSAlignmentWorker().

◆ tracksTokens_

std::vector<edm::EDGetTokenT<CTPPSLocalTrackLiteCollection> > PPSAlignmentWorker::tracksTokens_
private

Definition at line 95 of file PPSAlignmentWorker.cc.

Referenced by analyze(), and PPSAlignmentWorker().