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

#include <PixelVTXMonitor.h>

Inheritance diagram for PixelVTXMonitor:
edm::EDAnalyzer edm::EDConsumerBase

Classes

struct  PixelMEs
 

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 PixelVTXMonitor (const edm::ParameterSet &)
 
 ~PixelVTXMonitor () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (edm::Event const &iEvent, edm::EventSetup const &iSetup) override
 
void beginJob () override
 
void beginRun (edm::Run const &iRun, edm::EventSetup const &iSetup) override
 
void endJob () override
 
void endRun (edm::Run const &iRun, edm::EventSetup const &iSetup) override
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Private Member Functions

void bookHistograms ()
 

Private Attributes

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

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Detailed Description

Definition at line 30 of file PixelVTXMonitor.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 33 of file PixelVTXMonitor.h.

◆ MonitorElement

Definition at line 32 of file PixelVTXMonitor.h.

Constructor & Destructor Documentation

◆ PixelVTXMonitor()

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

Definition at line 22 of file PixelVTXMonitor.cc.

22  : parameters_(ps) {
26  consumes<SiPixelClusterCollectionNew>(parameters_.getParameter<edm::InputTag>("PixelClusterInputTag"));
28  consumes<reco::VertexCollection>(parameters_.getParameter<edm::InputTag>("PixelVertexInputTag"));
29  hltInputTagToken_ = consumes<edm::TriggerResults>(parameters_.getParameter<edm::InputTag>("HLTInputTag"));
33  minVtxDoF_ = parameters_.getParameter<double>("MinVtxDoF");
34 }

References folderName_, edm::ParameterSet::getParameter(), hltInputTag_, hltInputTagToken_, minVtxDoF_, moduleName_, parameters_, pixelClusterInputTag_, pixelClusterInputTagToken_, pixelVertexInputTag_, pixelVertexInputTagToken_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~PixelVTXMonitor()

PixelVTXMonitor::~PixelVTXMonitor ( )
override

Definition at line 36 of file PixelVTXMonitor.cc.

36 {}

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 113 of file PixelVTXMonitor.cc.

113  {
114  if (histoMap_.empty())
115  return;
116 
117  //Access Pixel Clusters
120 
121  if (!siPixelClusters.isValid()) {
122  edm::LogError("PixelVTXMonotor") << "Could not find Cluster Collection " << pixelClusterInputTag_;
123  return;
124  }
125  unsigned nClusters = siPixelClusters->size();
126 
127  //Access Pixel Verteces
130  if (!pixelVertices.isValid()) {
131  edm::LogError("PixelVTXMonotor") << "Could not find Vertex Collection " << pixelVertexInputTag_;
132  return;
133  }
134 
135  int nVtx = 0;
136  for (reco::VertexCollection::const_iterator ivtx = pixelVertices->begin(); ivtx != pixelVertices->end(); ++ivtx) {
137  if (minVtxDoF_ == -1)
138  nVtx++;
139  else {
140  if ((ivtx->isValid() == true) && (ivtx->isFake() == false) && (ivtx->ndof() >= minVtxDoF_) &&
141  (ivtx->tracksSize() != 0))
142  nVtx++;
143  }
144  }
145  // Access Trigger Results
148  if (!triggerResults.isValid())
149  return;
150 
151  for (std::map<std::string, PixelMEs>::iterator it = histoMap_.begin(); it != histoMap_.end(); ++it) {
152  std::string path = it->first;
153  MonitorElement* me_clus = it->second.clusME;
154  MonitorElement* me_vtx = it->second.vtxME;
155  unsigned int index = hltConfig_.triggerIndex(path);
156  if (index < triggerResults->size() && triggerResults->accept(index)) {
157  if (me_vtx)
158  me_vtx->Fill(nVtx);
159  if (me_clus)
160  me_clus->Fill(nClusters);
161  }
162  }
163 }

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

◆ beginJob()

void PixelVTXMonitor::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 96 of file PixelVTXMonitor.cc.

96 { dbe_ = edm::Service<DQMStore>().operator->(); }

References dbe_.

◆ beginRun()

void PixelVTXMonitor::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 98 of file PixelVTXMonitor.cc.

98  {
99  bool changed = true;
100  if (hltConfig_.init(iRun, iSetup, hltInputTag_.process(), changed)) {
101  // if init returns TRUE, initialisation has succeeded!
102  edm::LogInfo("PixelVTXMonitor") << "HLT config with process name " << hltInputTag_.process()
103  << " successfully extracted";
104  } else {
105  // if init returns FALSE, initialisation has NOT succeeded, which indicates a problem
106  // with the file and/or code and needs to be investigated!
107  edm::LogError("PixelVTXMonotor") << "Error! HLT config extraction with process name " << hltInputTag_.process()
108  << " failed";
109  // In this case, all access methods will return empty values!
110  }
111  bookHistograms();
112 }

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

◆ bookHistograms()

void PixelVTXMonitor::bookHistograms ( )
private

Definition at line 38 of file PixelVTXMonitor.cc.

38  {
39  std::vector<std::string> hltPathsOfInterest =
40  parameters_.getParameter<std::vector<std::string> >("HLTPathsOfInterest");
41  if (hltPathsOfInterest.empty())
42  return;
43 
44  const std::vector<std::string>& pathList = hltConfig_.triggerNames();
45  std::vector<std::string> selectedPaths;
46  for (std::vector<std::string>::const_iterator it = pathList.begin(); it != pathList.end(); ++it) {
47  int nmatch = 0;
48  for (std::vector<std::string>::const_iterator kt = hltPathsOfInterest.begin(); kt != hltPathsOfInterest.end();
49  ++kt) {
50  nmatch += TPRegexp(*kt).Match(*it);
51  }
52  if (!nmatch)
53  continue;
54  else
55  selectedPaths.push_back(*it);
56  }
57 
58  edm::ParameterSet ClusHistoPar = parameters_.getParameter<edm::ParameterSet>("TH1ClusPar");
59  edm::ParameterSet VtxHistoPar = parameters_.getParameter<edm::ParameterSet>("TH1VtxPar");
60 
61  std::string currentFolder = moduleName_ + "/" + folderName_;
62  dbe_->setCurrentFolder(currentFolder);
63 
64  PixelMEs local_MEs;
65  for (std::vector<std::string>::iterator it = selectedPaths.begin(); it != selectedPaths.end(); it++) {
66  std::string tag = (*it);
67  std::map<std::string, PixelMEs>::iterator iPos = histoMap_.find(tag);
68  if (iPos == histoMap_.end()) {
69  std::string hname, htitle;
70 
71  hname = "nPxlClus_";
72  hname += tag;
73  htitle = "# of Pixel Clusters (";
74  htitle += tag + ")";
75  local_MEs.clusME = dbe_->book1D(hname,
76  htitle,
77  ClusHistoPar.getParameter<int32_t>("Xbins"),
78  ClusHistoPar.getParameter<double>("Xmin"),
79  ClusHistoPar.getParameter<double>("Xmax"));
80 
81  hname = "nPxlVtx_";
82  hname += tag;
83  htitle = "# of Pixel Vertices (";
84  htitle += tag + ")";
85  local_MEs.vtxME = dbe_->book1D(hname,
86  htitle,
87  VtxHistoPar.getParameter<int32_t>("Xbins"),
88  VtxHistoPar.getParameter<double>("Xmin"),
89  VtxHistoPar.getParameter<double>("Xmax"));
90 
91  histoMap_.insert(std::make_pair(tag, local_MEs));
92  }
93  }
94 }

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

Referenced by beginRun().

◆ endJob()

void PixelVTXMonitor::endJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 167 of file PixelVTXMonitor.cc.

167 {}

◆ endRun()

void PixelVTXMonitor::endRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 165 of file PixelVTXMonitor.cc.

165 {}

Member Data Documentation

◆ dbe_

DQMStore* PixelVTXMonitor::dbe_
private

Definition at line 59 of file PixelVTXMonitor.h.

Referenced by beginJob(), and bookHistograms().

◆ folderName_

std::string PixelVTXMonitor::folderName_
private

Definition at line 50 of file PixelVTXMonitor.h.

Referenced by bookHistograms(), and PixelVTXMonitor().

◆ histoMap_

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

Definition at line 67 of file PixelVTXMonitor.h.

Referenced by analyze(), and bookHistograms().

◆ hltConfig_

HLTConfigProvider PixelVTXMonitor::hltConfig_
private

Definition at line 60 of file PixelVTXMonitor.h.

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

◆ hltInputTag_

edm::InputTag PixelVTXMonitor::hltInputTag_
private

Definition at line 56 of file PixelVTXMonitor.h.

Referenced by beginRun(), and PixelVTXMonitor().

◆ hltInputTagToken_

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

Definition at line 53 of file PixelVTXMonitor.h.

Referenced by analyze(), and PixelVTXMonitor().

◆ minVtxDoF_

float PixelVTXMonitor::minVtxDoF_
private

Definition at line 57 of file PixelVTXMonitor.h.

Referenced by analyze(), and PixelVTXMonitor().

◆ moduleName_

std::string PixelVTXMonitor::moduleName_
private

Definition at line 49 of file PixelVTXMonitor.h.

Referenced by bookHistograms(), and PixelVTXMonitor().

◆ parameters_

edm::ParameterSet PixelVTXMonitor::parameters_
private

◆ pixelClusterInputTag_

edm::InputTag PixelVTXMonitor::pixelClusterInputTag_
private

Definition at line 54 of file PixelVTXMonitor.h.

Referenced by analyze(), and PixelVTXMonitor().

◆ pixelClusterInputTagToken_

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

Definition at line 51 of file PixelVTXMonitor.h.

Referenced by analyze(), and PixelVTXMonitor().

◆ pixelVertexInputTag_

edm::InputTag PixelVTXMonitor::pixelVertexInputTag_
private

Definition at line 55 of file PixelVTXMonitor.h.

Referenced by analyze(), and PixelVTXMonitor().

◆ pixelVertexInputTagToken_

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

Definition at line 52 of file PixelVTXMonitor.h.

Referenced by analyze(), and PixelVTXMonitor().

heavyionUCCDQM_cfi.nClusters
nClusters
Definition: heavyionUCCDQM_cfi.py:9
PixelVTXMonitor::hltConfig_
HLTConfigProvider hltConfig_
Definition: PixelVTXMonitor.h:60
PixelVertexes_cfi.pixelVertices
pixelVertices
Definition: PixelVertexes_cfi.py:5
triggerResults
static const std::string triggerResults
Definition: EdmProvDump.cc:45
edm::InputTag::process
std::string const & process() const
Definition: InputTag.h:40
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
PixelVTXMonitor::minVtxDoF_
float minVtxDoF_
Definition: PixelVTXMonitor.h:57
PixelVTXMonitor::dbe_
DQMStore * dbe_
Definition: PixelVTXMonitor.h:59
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle
Definition: AssociativeIterator.h:50
PixelVTXMonitor::moduleName_
std::string moduleName_
Definition: PixelVTXMonitor.h:49
PixelVTXMonitor::pixelVertexInputTag_
edm::InputTag pixelVertexInputTag_
Definition: PixelVTXMonitor.h:55
PixelVTXMonitor::pixelClusterInputTagToken_
edm::EDGetTokenT< SiPixelClusterCollectionNew > pixelClusterInputTagToken_
Definition: PixelVTXMonitor.h:51
HIInitialJetCoreClusterSplitting_cff.siPixelClusters
siPixelClusters
Definition: HIInitialJetCoreClusterSplitting_cff.py:23
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
PixelVTXMonitor::hltInputTag_
edm::InputTag hltInputTag_
Definition: PixelVTXMonitor.h:56
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PixelVTXMonitor::pixelVertexInputTagToken_
edm::EDGetTokenT< reco::VertexCollection > pixelVertexInputTagToken_
Definition: PixelVTXMonitor.h:52
PixelVTXMonitor::hltInputTagToken_
edm::EDGetTokenT< edm::TriggerResults > hltInputTagToken_
Definition: PixelVTXMonitor.h:53
edm::ParameterSet
Definition: ParameterSet.h:47
edm::Service
Definition: Service.h:30
iEvent
int iEvent
Definition: GenABIO.cc:224
PixelVTXMonitor::pixelClusterInputTag_
edm::InputTag pixelClusterInputTag_
Definition: PixelVTXMonitor.h:54
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
HLTConfigProvider::triggerIndex
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
Definition: HLTConfigProvider.h:73
PixelVTXMonitor::parameters_
edm::ParameterSet parameters_
Definition: PixelVTXMonitor.h:47
HLTConfigProvider::init
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
Definition: HLTConfigProvider.cc:36
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
HLTConfigProvider::triggerNames
const std::vector< std::string > & triggerNames() const
names of trigger paths
Definition: HLTConfigProvider.h:69
TrackingDataMCValidation_Standalone_cff.hltPathsOfInterest
hltPathsOfInterest
Definition: TrackingDataMCValidation_Standalone_cff.py:18
PixelVTXMonitor::folderName_
std::string folderName_
Definition: PixelVTXMonitor.h:50
edm::InputTag
Definition: InputTag.h:15
PixelVTXMonitor::histoMap_
std::map< std::string, PixelMEs > histoMap_
Definition: PixelVTXMonitor.h:67
PixelVTXMonitor::bookHistograms
void bookHistograms()
Definition: PixelVTXMonitor.cc:38
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443