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();
64 for (std::set<unsigned int>::iterator it =
_objectsType.begin();
67 std::vector<std::string> sources(2);
73 for (
size_t i = 0;
i < sources.size();
i++)
78 bookHist(source, objTypeStr,
"MaxPt1");
79 bookHist(source, objTypeStr,
"MaxPt2");
86 const std::vector<MatchStruct> & matches)
92 std::map<unsigned int,int> countobjects;
94 for(std::set<unsigned int>::iterator co =
_objectsType.begin();
97 countobjects[*co] = 0;
101 const int totalobjectssize2 = 2*countobjects.size();
103 for (
size_t j = 0;
j < matches.size(); ++
j)
111 const unsigned int objType = matches[
j].objType;
114 float pt = matches[
j].pt;
115 float eta = matches[
j].eta;
116 float phi = matches[
j].phi;
117 this->
fillHist(isPassTrigger,source,objTypeStr,
"Eta",eta);
118 this->
fillHist(isPassTrigger,source,objTypeStr,
"Phi",phi);
119 if ( countobjects[objType] == 0 )
121 this->
fillHist(isPassTrigger,source,objTypeStr,
"MaxPt1",pt);
123 ++(countobjects[objType]);
126 else if ( countobjects[objType] == 1 )
128 this->
fillHist(isPassTrigger,source,objTypeStr,
"MaxPt2",pt);
130 ++(countobjects[objType]);
135 if ( counttotal == totalobjectssize2 )
149 sourceUpper[0] = std::toupper(sourceUpper[0]);
153 if (variable.find(
"MaxPt") != std::string::npos)
155 std::string desc = (variable ==
"MaxPt1") ?
"Leading" :
"Next-to-Leading";
156 std::string title =
"pT of " + desc +
" " + sourceUpper +
" " + objType +
" "
159 float *
edges =
new float[nBins + 1];
160 for(
size_t i = 0;
i < nBins + 1;
i++)
164 h =
new TH1F(name.c_str(), title.c_str(), nBins,
edges);
169 std::string symbol = (variable ==
"Eta") ?
"#eta" :
"#phi";
174 int nBins = (int)params[0];
175 double min = params[1];
176 double max = params[2];
177 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
188 const float &
value )
191 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)
tuple size
Write out results.