27 const std::vector<unsigned int> & objectsType) :
29 _hltProcessName(pset.getParameter<std::
string>(
"hltProcessName")),
30 _objectsType(std::set<unsigned int>(objectsType.
begin(),objectsType.
end())),
31 _nObjects(objectsType.
size()),
32 _parametersEta(pset.getParameter<std::vector<double> >(
"parametersEta")),
33 _parametersPhi(pset.getParameter<std::vector<double> >(
"parametersPhi")),
34 _parametersTurnOn(pset.getParameter<std::vector<double> >(
"parametersTurnOn"))
36 for(std::set<unsigned int>::iterator it =
_objectsType.begin();
65 for (std::set<unsigned int>::iterator it =
_objectsType.begin();
68 std::vector<std::string> sources(2);
74 for (
size_t i = 0;
i < sources.size();
i++)
77 bookHist(source, objTypeStr,
"Eta", ibooker);
78 bookHist(source, objTypeStr,
"Phi", ibooker);
79 bookHist(source, objTypeStr,
"MaxPt1", ibooker);
80 bookHist(source, objTypeStr,
"MaxPt2", ibooker);
88 const std::vector<MatchStruct> & matches)
94 std::map<unsigned int,int> countobjects;
96 for(std::set<unsigned int>::iterator co =
_objectsType.begin();
99 countobjects[*co] = 0;
103 const int totalobjectssize2 = 2*countobjects.size();
105 for (
size_t j = 0;
j < matches.size(); ++
j)
113 const unsigned int objType = matches[
j].objType;
116 float pt = matches[
j].pt;
117 float eta = matches[
j].eta;
118 float phi = matches[
j].phi;
119 this->
fillHist(isPassTrigger,source,objTypeStr,
"Eta",eta);
120 this->
fillHist(isPassTrigger,source,objTypeStr,
"Phi",phi);
121 if ( countobjects[objType] == 0 )
123 this->
fillHist(isPassTrigger,source,objTypeStr,
"MaxPt1",pt);
125 ++(countobjects[objType]);
128 else if ( countobjects[objType] == 1 )
130 this->
fillHist(isPassTrigger,source,objTypeStr,
"MaxPt2",pt);
132 ++(countobjects[objType]);
137 if ( counttotal == totalobjectssize2 )
152 sourceUpper[0] = std::toupper(sourceUpper[0]);
156 if (variable.find(
"MaxPt") != std::string::npos)
158 std::string desc = (variable ==
"MaxPt1") ?
"Leading" :
"Next-to-Leading";
159 std::string title =
"pT of " + desc +
" " + sourceUpper +
" " + objType +
" "
162 float *
edges =
new float[nBins + 1];
163 for(
size_t i = 0;
i < nBins + 1;
i++)
167 h =
new TH1F(name.c_str(), title.c_str(), nBins,
edges);
172 std::string symbol = (variable ==
"Eta") ?
"#eta" :
"#phi";
177 int nBins = (int)params[0];
178 double min = params[1];
179 double max = params[2];
180 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
191 const float &
value )
194 sourceUpper[0] = toupper(sourceUpper[0]);
T getParameter(std::string const &) const
void bookHistograms(DQMStore::IBooker &)
HLTHiggsPlotter(const edm::ParameterSet &pset, const std::string &hltPath, const std::vector< unsigned int > &objectsType)
std::vector< double > _parametersPhi
std::set< unsigned int > _objectsType
std::map< std::string, MonitorElement * > _elements
const T & max(const T &a, const T &b)
MonitorElement * book1D(Args &&...args)
std::map< unsigned int, double > _cutMinPt
std::vector< double > _parametersTurnOn
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
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 analyze(const bool &isPassTrigger, const std::string &source, const std::vector< MatchStruct > &matches)
std::map< unsigned int, double > _cutMaxEta
static const std::string getTypeString(const unsigned int &objtype)
Tranform types into strings.
static std::string const source
tuple size
Write out results.