27 const std::vector<unsigned int> & objectsType,
30 _hltProcessName(pset.getParameter<std::
string>(
"hltProcessName")),
31 _objectsType(std::set<unsigned int>(objectsType.
begin(),objectsType.
end())),
32 _nObjects(objectsType.
size()),
33 _parametersEta(pset.getParameter<std::vector<double> >(
"parametersEta")),
34 _parametersPhi(pset.getParameter<std::vector<double> >(
"parametersPhi")),
35 _parametersTurnOn(pset.getParameter<std::vector<double> >(
"parametersTurnOn")),
38 for(std::set<unsigned int>::iterator it =
_objectsType.begin();
62 for (std::set<unsigned int>::iterator it =
_objectsType.begin();
65 std::vector<std::string> sources(2);
71 for (
size_t i = 0;
i < sources.size();
i++)
76 bookHist(source, objTypeStr,
"MaxPt1");
77 bookHist(source, objTypeStr,
"MaxPt2");
84 const std::vector<MatchStruct> & matches)
90 std::map<unsigned int,int> countobjects;
92 for(std::set<unsigned int>::iterator co =
_objectsType.begin();
95 countobjects[*co] = 0;
99 const int totalobjectssize2 = 2*countobjects.size();
101 for (
size_t j = 0;
j < matches.size(); ++
j)
109 const unsigned int objType = matches[
j].objType;
112 float pt = matches[
j].pt;
113 float eta = matches[
j].eta;
114 float phi = matches[
j].phi;
115 this->
fillHist(isPassTrigger,source,objTypeStr,
"Eta",eta);
116 this->
fillHist(isPassTrigger,source,objTypeStr,
"Phi",phi);
117 if ( countobjects[objType] == 0 )
119 this->
fillHist(isPassTrigger,source,objTypeStr,
"MaxPt1",pt);
121 ++(countobjects[objType]);
124 else if ( countobjects[objType] == 1 )
126 this->
fillHist(isPassTrigger,source,objTypeStr,
"MaxPt2",pt);
128 ++(countobjects[objType]);
133 if ( counttotal == totalobjectssize2 )
147 sourceUpper[0] = std::toupper(sourceUpper[0]);
151 if (variable.find(
"MaxPt") != std::string::npos)
153 std::string desc = (variable ==
"MaxPt1") ?
"Leading" :
"Next-to-Leading";
154 std::string title =
"pT of " + desc +
" " + sourceUpper +
" " + objType +
" "
157 float *
edges =
new float[nBins + 1];
158 for(
size_t i = 0;
i < nBins + 1;
i++)
162 h =
new TH1F(name.c_str(), title.c_str(), nBins,
edges);
167 std::string symbol = (variable ==
"Eta") ?
"#eta" :
"#phi";
172 int nBins = (int)params[0];
173 double min = params[1];
174 double max = params[2];
175 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
186 const float &
value )
189 sourceUpper[0] = toupper(sourceUpper[0]);
T getParameter(std::string const &) const
static std::string getTypeString(const unsigned int &objtype)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
std::vector< double > _parametersPhi
std::set< unsigned int > _objectsType
std::map< std::string, MonitorElement * > _elements
HLTHiggsPlotter(const edm::ParameterSet &pset, const std::string &hltPath, const std::vector< unsigned int > &objectsType, DQMStore *dbe)
const T & max(const T &a, const T &b)
std::map< unsigned int, double > _cutMinPt
std::vector< double > _parametersTurnOn
void fillHist(const bool &passTrigger, const std::string &source, const std::string &objType, const std::string &var, const float &value)
std::vector< double > _parametersEta
void beginRun(const edm::Run &, const edm::EventSetup &)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
void analyze(const bool &isPassTrigger, const std::string &source, const std::vector< MatchStruct > &matches)
std::map< unsigned int, double > _cutMaxEta
void bookHist(const std::string &source, const std::string &objType, const std::string &variable)
static std::string const source
tuple size
Write out results.