11 [
this](
edm::InputTag const &
tag) { return mayConsume<reco::VertexCollection>(tag); });
12 hltPathNames_ = iConfig.
getParameter<std::vector<std::string>>(
"HLTPathNames");
16 hlTriggerResults_Label =
label.module;
18 for (
unsigned int i = 0;
i < VertexCollection_.size();
i++) {
20 VertexCollection_Label.push_back(
label.module);
27 triggerConfChanged_ =
true;
30 hltConfigProvider_.init(iRun, iSetup,
label.process, triggerConfChanged_);
31 const std::vector<std::string> &allHltPathNames = hltConfigProvider_.triggerNames();
34 for (
size_t trgs = 0; trgs < hltPathNames_.size(); trgs++) {
35 unsigned int found = 1;
37 for (
size_t it = 0; it < allHltPathNames.size(); ++it) {
38 found = allHltPathNames.at(it).find(hltPathNames_[trgs]);
43 hltPathIndexs_.push_back(it_mem);
47 for (
size_t trgs = 0; trgs < hltPathNames_.size(); trgs++) {
48 if (hltPathIndexs_[trgs] < 0) {
49 _isfoundHLTs.push_back(
false);
51 _isfoundHLTs.push_back(
true);
62 if (hlTriggerResults_Label.empty() || hlTriggerResults_Label ==
"NULL") {
63 edm::LogInfo(
"NoTriggerResults") <<
"TriggerResults ==> Empty";
66 iEvent.getByToken(hlTriggerResults_, TriggerResulsHandler);
67 if (TriggerResulsHandler.
isValid())
70 edm::LogInfo(
"NoTriggerResults") <<
"TriggerResults ==> not readable";
81 edm::LogInfo(
"NoSimVertex") <<
"SimVertex collection is invalid";
85 edm::LogInfo(
"NoSimVertex") <<
"SimVertex collection is empty";
93 for (
unsigned int ind = 0; ind < hltPathNames_.size(); ind++) {
94 for (
unsigned int coll = 0; coll < VertexCollection_.size(); coll++) {
95 bool VertexOK =
false;
96 if (!_isfoundHLTs[ind])
102 if (!VertexCollection_Label.at(coll).empty() && VertexCollection_Label.at(coll) !=
"NULL") {
103 iEvent.getByToken(VertexCollection_.at(coll), VertexHandler);
104 if (VertexHandler.
isValid() > 0)
110 float value = VertexHandler->begin()->z() - simPV;
113 float maxValue = H1_.at(ind)[
"Vertex_" + VertexCollection_Label.at(coll)]->getTH1F()->GetXaxis()->GetXmax();
119 H1_.at(ind)[
"Vertex_" + VertexCollection_Label.at(coll)]->Fill(
value);
131 for (
unsigned int ind = 0; ind < hltPathNames_.size(); ind++) {
132 dqmFolder = Form(
"%s/Vertex/%s", mainFolder_.c_str(), hltPathNames_[ind].c_str());
133 H1_.push_back(std::map<std::string, MonitorElement *>());
135 for (
unsigned int coll = 0; coll < VertexCollection_.size(); coll++) {
137 if (VertexCollection_Label.at(coll) == (
"hltFastPrimaryVertex"))
141 int vertexBins = 100;
142 if (!VertexCollection_Label.at(coll).empty() && VertexCollection_Label.at(coll) !=
"NULL") {
143 H1_.back()[
"Vertex_" + VertexCollection_Label.at(coll)] =
144 ibooker.
book1D(
"Vertex_" + VertexCollection_Label.at(coll),
145 VertexCollection_Label.at(coll).c_str(),
149 H1_.back()[
"Vertex_" + VertexCollection_Label.at(coll)]->
setAxisTitle(
"vertex error (cm)", 1);
T getParameter(std::string const &) const
virtual void setCurrentFolder(std::string const &fullpath)
#define DEFINE_FWK_MODULE(type)
const math::XYZTLorentzVectorD & position() const
T const * product() const
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Log< level::Info, false > LogInfo
static std::string const triggerResults("TriggerResults")
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)