27 const std::vector<unsigned int> & objectsType,
28 const unsigned int & NptPlots,
29 const std::vector<double> & NminOneCuts) :
31 _hltProcessName(pset.getParameter<
std::
string>(
"hltProcessName")),
32 _objectsType(
std::set<unsigned
int>(objectsType.
begin(),objectsType.
end())),
33 _nObjects(objectsType.
size()),
34 _parametersEta(pset.getParameter<
std::vector<double> >(
"parametersEta")),
35 _parametersPhi(pset.getParameter<
std::vector<double> >(
"parametersPhi")),
36 _parametersTurnOn(pset.getParameter<
std::vector<double> >(
"parametersTurnOn")),
38 _NminOneCuts(NminOneCuts)
40 for(std::set<unsigned int>::iterator it =
_objectsType.begin();
69 for (std::set<unsigned int>::iterator it =
_objectsType.begin();
72 std::vector<std::string> sources(2);
79 for (
size_t i = 0;
i < sources.size();
i++)
84 if( source ==
"gen" )
continue;
92 else bookHist(source, objTypeStr,
"CSV1", ibooker);
99 bookHist(source, objTypeStr,
"Eta", ibooker);
100 bookHist(source, objTypeStr,
"Phi", ibooker);
105 bookHist(source, objTypeStr, maxPt.Data(), ibooker);
113 const std::vector<MatchStruct> &
matches,
114 const unsigned int & minCandidates
117 if ( !isPassTrigger )
121 std::map<unsigned int,int> countobjects;
123 for(std::set<unsigned int>::iterator co =
_objectsType.begin();
126 countobjects[*co] = 0;
130 const int totalobjectssize2 =
_NptPlots*countobjects.size();
132 for (
size_t j = 0; j < matches.size(); ++j)
140 const unsigned int objType = matches[j].objType;
143 float pt = matches[j].pt;
144 float eta = matches[j].eta;
145 float phi = matches[j].phi;
148 if( (
unsigned)countobjects[objType] <
_NptPlots )
151 maxPt += (countobjects[
objType]+1);
152 this->
fillHist(isPassTrigger,source,objTypeStr,maxPt.Data(),
pt);
158 if( (
unsigned)countobjects[
objType] < minCandidates ) {
165 this->
fillHist(isPassTrigger,source,objTypeStr,
"Eta",eta);
166 this->
fillHist(isPassTrigger,source,objTypeStr,
"Phi",phi);
168 if ( counttotal == totalobjectssize2 )
176 std::map<std::string,bool> & nMinOne,
const float & dEtaqq,
const float & mqq,
const float & dPhibb,
const float & CSV1,
const float & CSV2,
const float & CSV3,
const bool & passAllCuts)
178 if ( !isPassTrigger )
182 std::map<unsigned int,int> countobjects;
184 for(std::set<unsigned int>::iterator co =
_objectsType.begin();
188 countobjects[*co] = 0;
192 const int totalobjectssize2 =
_NptPlots*countobjects.size();
194 for (
size_t j = 0; j < matches.size(); ++j)
202 const unsigned int objType = matches[j].objType;
205 float pt = matches[j].pt;
206 float eta = matches[j].eta;
207 float phi = matches[j].phi;
213 if( (
unsigned)(countobjects)[objType] <
_NptPlots )
216 maxPt += (countobjects[
objType]+1);
218 this->
fillHist(isPassTrigger,source,objTypeStr,maxPt.Data(),
pt);
225 this->
fillHist(isPassTrigger,source,objTypeStr,
"Eta",eta);
226 this->
fillHist(isPassTrigger,source,objTypeStr,
"Phi",phi);
229 if ( counttotal == totalobjectssize2 )
264 sourceUpper[0] = std::toupper(sourceUpper[0]);
268 if (variable.find(
"MaxPt") != std::string::npos)
271 if (variable ==
"MaxPt1") desc =
"Leading";
272 else if (variable ==
"MaxPt2") desc =
"Next-to-Leading";
273 else desc = variable.substr(5,6) +
"th Leading";
274 std::string title =
"pT of " + desc +
" " + sourceUpper +
" " + objType +
" " 277 size_t nBins = nBinsStandard;
278 float * edges =
new float[nBinsStandard + 1];
279 for(
size_t i = 0;
i < nBinsStandard + 1;
i++)
285 if( objType == jetObj ) {
286 const size_t nBinsJets = 25;
289 edges =
new float[nBinsJets+1];
290 for(
size_t i = 0;
i < nBinsJets + 1;
i++)
296 const size_t nBinsJets = 30;
299 edges =
new float[nBinsJets+1];
300 for(
size_t i = 0;
i < nBinsJets + 1;
i++)
305 h =
new TH1F(name.c_str(), title.c_str(), nBins, edges);
310 if( variable ==
"dEtaqq" ){
315 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
317 else if ( variable ==
"mqq" ){
322 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
324 else if ( variable ==
"dPhibb" ){
329 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
331 else if ( variable ==
"CSV1" ){
336 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
338 else if ( variable ==
"CSV2" ){
343 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
345 else if ( variable ==
"CSV3" ){
350 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
352 else if ( variable ==
"maxCSV" ){
357 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
361 std::string symbol = (variable ==
"Eta") ?
"#eta" :
"#phi";
366 int nBins = (
int)params[0];
367 double min = params[1];
368 double max = params[2];
369 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
381 const float &
value )
384 sourceUpper[0] = toupper(sourceUpper[0]);
T getParameter(std::string const &) const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
HLTHiggsPlotter(const edm::ParameterSet &pset, const std::string &hltPath, const std::vector< unsigned int > &objectsType, const unsigned int &minCandidates, const std::vector< double > &NminOneCuts)
std::vector< double > _parametersPhi
std::set< unsigned int > _objectsType
std::map< std::string, MonitorElement * > _elements
MonitorElement * book1D(Args &&...args)
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)
void bookHist(const std::string &source, const std::string &objType, const std::string &variable, DQMStore::IBooker &)
std::vector< double > _parametersEta
void beginRun(const edm::Run &, const edm::EventSetup &)
void bookHistograms(DQMStore::IBooker &, const bool &)
void analyze(const bool &isPassTrigger, const std::string &source, const std::vector< MatchStruct > &matches, const unsigned int &minCandidates)
std::map< unsigned int, double > _cutMaxEta
static const std::string getTypeString(const unsigned int &objtype)
Tranform types into strings.
static std::string const source
std::vector< double > _NminOneCuts