11 hltPathNames_ = iConfig.
getParameter< std::vector<std::string> > (
"HLTPathNames");
15 hlTriggerResults_Label =
label.module;
17 for(
unsigned int i=0;
i<VertexCollection_.size() ;
i++){
19 VertexCollection_Label.push_back(
label.module);
30 triggerConfChanged_ =
true;
33 hltConfigProvider_.init(iRun, iSetup,
label.process, triggerConfChanged_);
34 const std::vector< std::string > & allHltPathNames = hltConfigProvider_.triggerNames();
37 for (
size_t trgs=0; trgs<hltPathNames_.size(); trgs++) {
38 unsigned int found = 1;
40 for (
size_t it=0 ; it < allHltPathNames.size() ; ++it )
42 found = allHltPathNames.at(it).find(hltPathNames_[trgs]);
48 hltPathIndexs_.push_back(it_mem);
52 for (
size_t trgs=0; trgs<hltPathNames_.size(); trgs++) {
53 if ( hltPathIndexs_[trgs] < 0 ) {
54 _isfoundHLTs.push_back(
false);
57 _isfoundHLTs.push_back(
true);
70 if ( hlTriggerResults_Label ==
"" || hlTriggerResults_Label ==
"NULL" ) {
71 edm::LogInfo(
"NoTriggerResults") <<
"TriggerResults ==> Empty";
74 iEvent.
getByToken(hlTriggerResults_, TriggerResulsHandler);
75 if (TriggerResulsHandler.
isValid()) trigRes=
true;
76 if ( !trigRes ) {
edm::LogInfo(
"NoTriggerResults") <<
"TriggerResults ==> not readable";
return;}
83 iEvent.
getByToken(simVertexCollection_, simVertexCollection);
84 if (!simVertexCollection.
isValid()) {
edm::LogInfo(
"NoSimVertex") <<
"SimVertex collection is invalid";
return;}
85 if (simVertexCollection->empty()) {
edm::LogInfo(
"NoSimVertex") <<
"SimVertex collection is empty";
return;}
86 const SimVertex simPVh = *(simVertexCollection->begin());
91 for (
unsigned int ind=0; ind<hltPathNames_.size();ind++) {
92 for (
unsigned int coll=0;
coll<VertexCollection_.size();
coll++) {
94 if ( !_isfoundHLTs[ind])
continue;
95 if ( !triggerResults.
accept(hltPathIndexs_[ind]) )
continue;
98 if (VertexCollection_Label.at(
coll) !=
"" && VertexCollection_Label.at(
coll) !=
"NULL" )
101 if (VertexHandler.
isValid()>0) VertexOK=
true;
106 float value=VertexHandler->begin()->z()-simPV;
109 float maxValue=H1_.at(ind)[
"Vertex_"+VertexCollection_Label.at(
coll)]->getTH1F()->GetXaxis()->GetXmax();
110 if(value>maxValue) value=maxValue-0.0001;
111 if(value<-maxValue) value=-maxValue+0.0001;
113 H1_.at(ind)[
"Vertex_"+VertexCollection_Label.at(
coll)] ->
Fill(value);
125 for (
unsigned int ind=0; ind<hltPathNames_.size();ind++) {
126 dqmFolder = Form(
"%s/Vertex/%s",mainFolder_.c_str(),hltPathNames_[ind].c_str());
127 H1_.push_back(std::map<std::string, MonitorElement *>());
129 for (
unsigned int coll=0;
coll<VertexCollection_.size();
coll++) {
131 if(VertexCollection_Label.at(
coll)==(
"hltFastPrimaryVertex")) maxValue = 2.;
134 int vertexBins = 100;
135 if ( VertexCollection_Label.at(
coll) !=
"" && VertexCollection_Label.at(
coll) !=
"NULL" ) {
136 H1_.back()[
"Vertex_"+VertexCollection_Label.at(
coll)] = ibooker.
book1D(
"Vertex_"+VertexCollection_Label.at(
coll), VertexCollection_Label.at(
coll).c_str(), vertexBins, vertexL, vertexU );
137 H1_.back()[
"Vertex_"+VertexCollection_Label.at(
coll)] -> setAxisTitle(
"vertex error (cm)",1);
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
bool accept() const
Has at least one path accepted the event?
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 >
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * book1D(Args &&...args)
const math::XYZTLorentzVectorD & position() const
void setCurrentFolder(const std::string &fullpath)
T const * product() const
static std::string const triggerResults("TriggerResults")
void labelsForToken(EDGetToken iToken, Labels &oLabels) const