CMS 3D CMS Logo

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

Classes

struct  PixelMEs
 

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- 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
 

Public Member Functions

 PixelVTXMonitor (const edm::ParameterSet &)
 
 ~PixelVTXMonitor () override=default
 
- 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
 
 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
 

Protected Member Functions

void bookHistograms (DQMStore::IBooker &iBooker, const edm::Run &iRun, const edm::EventSetup &iSetup) override
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Member Functions

void analyze (const edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
void dqmBeginRun (const edm::Run &iRun, const edm::EventSetup &iSetup) override
 

Private Attributes

const std::string folderName_
 
std::map< std::string, PixelMEshistoMap_
 
HLTConfigProvider hltConfig_
 
const edm::InputTag hltInputTag_
 
const edm::EDGetTokenT< edm::TriggerResultshltInputTagToken_
 
const float minVtxDoF_
 
const std::string moduleName_
 
edm::ParameterSet parameters_
 
const edm::InputTag pixelClusterInputTag_
 
const edm::EDGetTokenT< SiPixelClusterCollectionNewpixelClusterInputTagToken_
 
const edm::InputTag pixelVertexInputTag_
 
const edm::EDGetTokenT< reco::VertexCollectionpixelVertexInputTagToken_
 

Additional Inherited Members

- 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 &)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 38 of file PixelVTXMonitor.cc.

Member Typedef Documentation

◆ DQMStore

Definition at line 41 of file PixelVTXMonitor.cc.

◆ MonitorElement

Definition at line 40 of file PixelVTXMonitor.cc.

Constructor & Destructor Documentation

◆ PixelVTXMonitor()

PixelVTXMonitor::PixelVTXMonitor ( const edm::ParameterSet ps)

Definition at line 78 of file PixelVTXMonitor.cc.

79  : parameters_(ps),
85  pixelClusterInputTagToken_(consumes<SiPixelClusterCollectionNew>(pixelClusterInputTag_)),
86  pixelVertexInputTagToken_(consumes<reco::VertexCollection>(pixelVertexInputTag_)),
87  hltInputTagToken_(consumes<edm::TriggerResults>(hltInputTag_)),
88  minVtxDoF_(parameters_.getParameter<double>("MinVtxDoF")) {}
const float minVtxDoF_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::EDGetTokenT< edm::TriggerResults > hltInputTagToken_
edm::ParameterSet parameters_
const edm::EDGetTokenT< SiPixelClusterCollectionNew > pixelClusterInputTagToken_
const edm::InputTag hltInputTag_
const edm::EDGetTokenT< reco::VertexCollection > pixelVertexInputTagToken_
T getUntrackedParameter(std::string const &, T const &) const
const std::string folderName_
const edm::InputTag pixelClusterInputTag_
const std::string moduleName_
const edm::InputTag pixelVertexInputTag_

◆ ~PixelVTXMonitor()

PixelVTXMonitor::~PixelVTXMonitor ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 160 of file PixelVTXMonitor.cc.

References dqm::impl::MonitorElement::Fill(), histoMap_, hltConfig_, hltInputTagToken_, iEvent, minVtxDoF_, heavyionUCCDQM_cfi::nClusters, L1TkPrimaryVertex_cfi::nVtx, castor_dqm_sourceclient_file_cfg::path, pixelClusterInputTag_, pixelClusterInputTagToken_, pixelVertexInputTag_, pixelVertexInputTagToken_, beam_dqm_sourceclient-live_cfg::pixelVertices, siPixelClusters_cfi::siPixelClusters, findQualityFiles::size, AlCaHLTBitMon_QueryRunRegistry::string, HLTConfigProvider::triggerIndex(), and triggerResults.

160  {
161  if (histoMap_.empty())
162  return;
163 
164  //Access Pixel Clusters
166 
167  if (!siPixelClusters.isValid()) {
168  edm::LogError("PixelVTXMonotor") << "Could not find Cluster Collection " << pixelClusterInputTag_;
169  return;
170  }
171  unsigned nClusters = siPixelClusters->size();
172 
173  //Access Pixel Verteces
175  if (!pixelVertices.isValid()) {
176  edm::LogError("PixelVTXMonotor") << "Could not find Vertex Collection " << pixelVertexInputTag_;
177  return;
178  }
179 
180  int nVtx = 0;
181  for (const auto& ivtx : *pixelVertices) {
182  if (minVtxDoF_ == -1)
183  nVtx++;
184  else {
185  if ((ivtx.isValid() == true) && (ivtx.isFake() == false) && (ivtx.ndof() >= minVtxDoF_) &&
186  (ivtx.tracksSize() != 0))
187  nVtx++;
188  }
189  }
190  // Access Trigger Results
192  if (!triggerResults.isValid())
193  return;
194 
195  for (const auto& it : histoMap_) {
196  std::string path = it.first;
197  MonitorElement* me_clus = it.second.clusME;
198  MonitorElement* me_vtx = it.second.vtxME;
199  unsigned int index = hltConfig_.triggerIndex(path);
200  if (index < triggerResults->size() && triggerResults->accept(index)) {
201  if (me_vtx)
202  me_vtx->Fill(nVtx);
203  if (me_clus)
204  me_clus->Fill(nClusters);
205  }
206  }
207 }
size
Write out results.
const float minVtxDoF_
const edm::EDGetTokenT< edm::TriggerResults > hltInputTagToken_
const edm::EDGetTokenT< SiPixelClusterCollectionNew > pixelClusterInputTagToken_
Log< level::Error, false > LogError
const edm::EDGetTokenT< reco::VertexCollection > pixelVertexInputTagToken_
void Fill(long long x)
HLTConfigProvider hltConfig_
int iEvent
Definition: GenABIO.cc:224
std::map< std::string, PixelMEs > histoMap_
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
static std::string const triggerResults
Definition: EdmProvDump.cc:47
const edm::InputTag pixelClusterInputTag_
const edm::InputTag pixelVertexInputTag_

◆ bookHistograms()

void PixelVTXMonitor::bookHistograms ( DQMStore::IBooker iBooker,
const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 90 of file PixelVTXMonitor.cc.

References dqm::implementation::IBooker::book1D(), PixelVTXMonitor::PixelMEs::clusME, folderName_, edm::ParameterSet::getParameter(), histoMap_, hltConfig_, TrackingDataMCValidation_Standalone_cff::hltPathsOfInterest, moduleName_, parameters_, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, makeGlobalPositionRcd_cfg::tag, HLTConfigProvider::triggerNames(), and PixelVTXMonitor::PixelMEs::vtxME.

90  {
91  std::vector<std::string> hltPathsOfInterest =
92  parameters_.getParameter<std::vector<std::string> >("HLTPathsOfInterest");
93  if (hltPathsOfInterest.empty())
94  return;
95 
96  const std::vector<std::string>& pathList = hltConfig_.triggerNames();
97  std::vector<std::string> selectedPaths;
98  for (const auto& it : pathList) {
99  int nmatch = 0;
100  for (const auto& kt : hltPathsOfInterest) {
101  nmatch += TPRegexp(kt).Match(it);
102  }
103  if (!nmatch)
104  continue;
105  else
106  selectedPaths.push_back(it);
107  }
108 
109  edm::ParameterSet ClusHistoPar = parameters_.getParameter<edm::ParameterSet>("TH1ClusPar");
110  edm::ParameterSet VtxHistoPar = parameters_.getParameter<edm::ParameterSet>("TH1VtxPar");
111 
112  std::string currentFolder = moduleName_ + "/" + folderName_;
113  iBooker.setCurrentFolder(currentFolder);
114 
115  PixelMEs local_MEs;
116  for (const auto& tag : selectedPaths) {
117  std::map<std::string, PixelMEs>::iterator iPos = histoMap_.find(tag);
118  if (iPos == histoMap_.end()) {
119  std::string hname, htitle;
120 
121  hname = "nPxlClus_";
122  hname += tag;
123  htitle = "# of Pixel Clusters (";
124  htitle += tag + ")";
125  local_MEs.clusME = iBooker.book1D(hname,
126  htitle,
127  ClusHistoPar.getParameter<int32_t>("Xbins"),
128  ClusHistoPar.getParameter<double>("Xmin"),
129  ClusHistoPar.getParameter<double>("Xmax"));
130 
131  hname = "nPxlVtx_";
132  hname += tag;
133  htitle = "# of Pixel Vertices (";
134  htitle += tag + ")";
135  local_MEs.vtxME = iBooker.book1D(hname,
136  htitle,
137  VtxHistoPar.getParameter<int32_t>("Xbins"),
138  VtxHistoPar.getParameter<double>("Xmin"),
139  VtxHistoPar.getParameter<double>("Xmax"));
140 
141  histoMap_.insert(std::make_pair(tag, local_MEs));
142  }
143  }
144 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
edm::ParameterSet parameters_
HLTConfigProvider hltConfig_
std::map< std::string, PixelMEs > histoMap_
const std::string folderName_
const std::vector< std::string > & triggerNames() const
names of trigger paths
const std::string moduleName_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ dqmBeginRun()

void PixelVTXMonitor::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 146 of file PixelVTXMonitor.cc.

References hltConfig_, hltInputTag_, HLTConfigProvider::init(), and edm::InputTag::process().

146  {
147  bool changed = true;
148  if (hltConfig_.init(iRun, iSetup, hltInputTag_.process(), changed)) {
149  // if init returns TRUE, initialisation has succeeded!
150  edm::LogInfo("PixelVTXMonitor") << "HLT config with process name " << hltInputTag_.process()
151  << " successfully extracted";
152  } else {
153  // if init returns FALSE, initialisation has NOT succeeded, which indicates a problem
154  // with the file and/or code and needs to be investigated!
155  edm::LogError("PixelVTXMonotor") << "Error! HLT config extraction with process name " << hltInputTag_.process()
156  << " failed";
157  // In this case, all access methods will return empty values!
158  }
159 }
Log< level::Error, false > LogError
const edm::InputTag hltInputTag_
HLTConfigProvider hltConfig_
Log< level::Info, false > LogInfo
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
std::string const & process() const
Definition: InputTag.h:40

Member Data Documentation

◆ folderName_

const std::string PixelVTXMonitor::folderName_
private

Definition at line 55 of file PixelVTXMonitor.cc.

Referenced by bookHistograms().

◆ histoMap_

std::map<std::string, PixelMEs> PixelVTXMonitor::histoMap_
private

Definition at line 71 of file PixelVTXMonitor.cc.

Referenced by analyze(), and bookHistograms().

◆ hltConfig_

HLTConfigProvider PixelVTXMonitor::hltConfig_
private

Definition at line 64 of file PixelVTXMonitor.cc.

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

◆ hltInputTag_

const edm::InputTag PixelVTXMonitor::hltInputTag_
private

Definition at line 58 of file PixelVTXMonitor.cc.

Referenced by dqmBeginRun().

◆ hltInputTagToken_

const edm::EDGetTokenT<edm::TriggerResults> PixelVTXMonitor::hltInputTagToken_
private

Definition at line 61 of file PixelVTXMonitor.cc.

Referenced by analyze().

◆ minVtxDoF_

const float PixelVTXMonitor::minVtxDoF_
private

Definition at line 62 of file PixelVTXMonitor.cc.

Referenced by analyze().

◆ moduleName_

const std::string PixelVTXMonitor::moduleName_
private

Definition at line 54 of file PixelVTXMonitor.cc.

Referenced by bookHistograms().

◆ parameters_

edm::ParameterSet PixelVTXMonitor::parameters_
private

◆ pixelClusterInputTag_

const edm::InputTag PixelVTXMonitor::pixelClusterInputTag_
private

Definition at line 56 of file PixelVTXMonitor.cc.

Referenced by analyze().

◆ pixelClusterInputTagToken_

const edm::EDGetTokenT<SiPixelClusterCollectionNew> PixelVTXMonitor::pixelClusterInputTagToken_
private

Definition at line 59 of file PixelVTXMonitor.cc.

Referenced by analyze().

◆ pixelVertexInputTag_

const edm::InputTag PixelVTXMonitor::pixelVertexInputTag_
private

Definition at line 57 of file PixelVTXMonitor.cc.

Referenced by analyze().

◆ pixelVertexInputTagToken_

const edm::EDGetTokenT<reco::VertexCollection> PixelVTXMonitor::pixelVertexInputTagToken_
private

Definition at line 60 of file PixelVTXMonitor.cc.

Referenced by analyze().