28 const std::string & hltPath,
29 const std::vector<unsigned int> & objectsType,
32 _hltProcessName(pset.getParameter<std::string>(
"hltProcessName")),
33 _objectsType(std::
set<unsigned int>(objectsType.
begin(),objectsType.
end())),
34 _nObjects(objectsType.
size()),
35 _parametersEta(pset.getParameter<std::vector<double> >(
"parametersEta")),
36 _parametersPhi(pset.getParameter<std::vector<double> >(
"parametersPhi")),
37 _parametersTurnOn(pset.getParameter<std::vector<double> >(
"parametersTurnOn")),
40 for(std::set<unsigned int>::iterator it =
_objectsType.begin();
63 for(std::set<unsigned int>::iterator it =
_objectsType.begin();
66 std::vector<std::string> sources(2);
72 for(
size_t i = 0;
i < sources.size();
i++)
74 std::string
source = sources[
i];
77 bookHist(source, objTypeStr,
"MaxPt1");
78 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 )
143 const std::string & objType,
const std::string & variable)
145 std::string sourceUpper =
source;
146 sourceUpper[0] = std::toupper(sourceUpper[0]);
147 std::string
name = source + objType + variable +
"_" +
_hltPath;
150 if(variable.find(
"MaxPt") != std::string::npos)
152 std::string desc = (variable ==
"MaxPt1") ?
"Leading" :
"Next-to-Leading";
153 std::string
title =
"pT of " + desc +
" " + sourceUpper +
" " + objType +
" "
156 float *
edges =
new float[nBins + 1];
157 for(
size_t i = 0;
i < nBins + 1;
i++)
161 h =
new TH1F(name.c_str(), title.c_str(), nBins,
edges);
166 std::string symbol = (variable ==
"Eta") ?
"#eta" :
"#phi";
167 std::string
title = symbol +
" of " + sourceUpper +
" " + objType +
" "+
171 int nBins = (int)params[0];
172 double min = params[1];
173 double max = params[2];
174 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
182 const std::string & objType,
const std::string & variable,
const float &
value )
184 std::string sourceUpper =
source;
185 sourceUpper[0] = toupper(sourceUpper[0]);
186 std::string
name = source + objType + variable +
"_" +
_hltPath;
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)
tuple size
Write out results.
void set(const std::string &name, int value)
set the flag, with a run-time name