10 hltPathNames_ = iConfig.getParameter< std::vector<std::string> > (
"HLTPathNames");
11 simVertexCollection_ = consumes<std::vector<SimVertex> >(iConfig.getParameter<
edm::InputTag> (
"SimVertexCollection"));
14 hlTriggerResults_Label =
label.module;
16 for(
unsigned int i=0;
i<VertexCollection_.size() ;
i++){
18 VertexCollection_Label.push_back(
label.module);
29 triggerConfChanged_ =
true;
32 hltConfigProvider_.init(iRun, iSetup,
label.process, triggerConfChanged_);
33 const std::vector< std::string > & allHltPathNames = hltConfigProvider_.triggerNames();
36 for (
size_t trgs=0; trgs<hltPathNames_.size(); trgs++) {
37 unsigned int found = 1;
39 for (
size_t it=0 ; it < allHltPathNames.size() ; ++it )
41 found = allHltPathNames.at(it).find(hltPathNames_[trgs]);
47 hltPathIndexs_.push_back(it_mem);
51 for (
size_t trgs=0; trgs<hltPathNames_.size(); trgs++) {
52 if ( hltPathIndexs_[trgs] < 0 ) {
53 _isfoundHLTs.push_back(
false);
56 _isfoundHLTs.push_back(
true);
69 if ( hlTriggerResults_Label ==
"" || hlTriggerResults_Label ==
"NULL" ) {
70 edm::LogInfo(
"NoTriggerResults") <<
"TriggerResults ==> Empty";
73 iEvent.
getByToken(hlTriggerResults_, TriggerResulsHandler);
74 if (TriggerResulsHandler.isValid()) trigRes=
true;
75 if ( !trigRes ) {
edm::LogInfo(
"NoTriggerResults") <<
"TriggerResults ==> not readable";
return;}
82 iEvent.
getByToken(simVertexCollection_, simVertexCollection);
83 const SimVertex simPVh = *(simVertexCollection->begin());
88 for (
unsigned int ind=0; ind<hltPathNames_.size();ind++) {
89 for (
unsigned int coll=0;
coll<VertexCollection_.size();
coll++) {
91 if ( !_isfoundHLTs[ind])
continue;
95 if (VertexCollection_Label.at(
coll) !=
"" && VertexCollection_Label.at(
coll) !=
"NULL" )
98 if (VertexHandler.isValid()>0) VertexOK=
true;
103 float value=VertexHandler->begin()->z()-simPV;
106 float maxValue=H1_.at(ind)[
"Vertex_"+VertexCollection_Label.at(
coll)]->getTH1F()->GetXaxis()->GetXmax();
107 if(value>maxValue) value=maxValue-0.0001;
108 if(value<-maxValue) value=-maxValue+0.0001;
110 H1_.at(ind)[
"Vertex_"+VertexCollection_Label.at(
coll)] ->
Fill(value);
122 for (
unsigned int ind=0; ind<hltPathNames_.size();ind++) {
123 dqmFolder = Form(
"HLT/BTag/Vertex/%s",hltPathNames_[ind].c_str());
124 H1_.push_back(std::map<std::string, MonitorElement *>());
126 for (
unsigned int coll=0;
coll<VertexCollection_.size();
coll++) {
127 float maxValue = 0.02;
128 if(VertexCollection_Label.at(
coll)==(
"hltFastPrimaryVertex")) maxValue = 2.;
129 float vertexU = maxValue;
130 float vertexL = -maxValue;
131 int vertexBins = 100;
132 if ( VertexCollection_Label.at(
coll) !=
"" && VertexCollection_Label.at(
coll) !=
"NULL" ) {
133 H1_.back()[
"Vertex_"+VertexCollection_Label.at(
coll)] = ibooker.
book1D(
"Vertex_"+VertexCollection_Label.at(
coll), VertexCollection_Label.at(
coll).c_str(), vertexBins, vertexL, vertexU );
134 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)
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)
static std::string const triggerResults("TriggerResults")
void labelsForToken(EDGetToken iToken, Labels &oLabels) const