21 const std::vector<unsigned int> & objectsType) :
23 _hltProcessName(pset.getParameter<std::
string>(
"hltProcessName")),
24 _objectsType(std::set<unsigned int>(objectsType.
begin(), objectsType.
end())),
25 _nObjects(objectsType.
size()),
26 _parametersEta(pset.getParameter<std::vector<double> >(
"parametersEta")),
27 _parametersPhi(pset.getParameter<std::vector<double> >(
"parametersPhi")),
28 _parametersTurnOn(pset.getParameter<std::vector<double> >(
"parametersTurnOn"))
30 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::constructor()";
48 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::plotterBookHistos()";
49 for (std::set<unsigned int>::iterator it =
_objectsType.begin();
51 std::vector<std::string> sources(2);
57 for (
size_t i = 0;
i < sources.size();
i++) {
59 bookHist(iBooker, source, objTypeStr,
"Eta");
60 bookHist(iBooker, source, objTypeStr,
"Phi");
61 bookHist(iBooker, source, objTypeStr,
"MaxPt1");
62 bookHist(iBooker, source, objTypeStr,
"MaxPt2");
63 bookHist(iBooker, source, objTypeStr,
"SumEt");
70 const std::vector<reco::LeafCandidate> & matches)
72 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::analyze()";
77 std::map<unsigned int, int> countobjects;
79 for (std::set<unsigned int>::iterator co =
_objectsType.begin();
81 countobjects[*co] = 0;
85 const int totalobjectssize2 = 2 * countobjects.size();
87 for (
size_t j = 0;
j < matches.size(); ++
j) {
93 const unsigned int objType = matches[
j].pdgId();
96 float pt = matches[
j].pt();
97 float eta = matches[
j].eta();
98 float phi = matches[
j].phi();
100 this->
fillHist(isPassTrigger, source, objTypeStr,
"Eta", eta);
101 this->
fillHist(isPassTrigger, source, objTypeStr,
"Phi", phi);
102 this->
fillHist(isPassTrigger, source, objTypeStr,
"SumEt", sumEt);
104 if (countobjects[objType] == 0) {
105 this->
fillHist(isPassTrigger, source, objTypeStr,
"MaxPt1", pt);
107 ++(countobjects[objType]);
109 }
else if (countobjects[objType] == 1) {
110 this->
fillHist(isPassTrigger, source, objTypeStr,
"MaxPt2", pt);
112 ++(countobjects[objType]);
115 if (counttotal == totalobjectssize2) {
128 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::bookHist()";
130 sourceUpper[0] = std::toupper(sourceUpper[0]);
134 if (variable.find(
"SumEt") != std::string::npos) {
137 float *
edges =
new float[nBins + 1];
138 for (
size_t i = 0;
i < nBins + 1;
i++) {
141 h =
new TH1F(name.c_str(), title.c_str(), nBins,
edges);
144 else if (variable.find(
"MaxPt") != std::string::npos) {
145 std::string desc = (variable ==
"MaxPt1") ?
"Leading" :
"Next-to-Leading";
146 std::string title =
"pT of " + desc +
" " + sourceUpper +
" " + objType +
" "
149 float *
edges =
new float[nBins + 1];
150 for (
size_t i = 0;
i < nBins + 1;
i++) {
153 h =
new TH1F(name.c_str(), title.c_str(), nBins,
edges);
156 std::string symbol = (variable ==
"Eta") ?
"#eta" :
"#phi";
161 int nBins = (int)params[0];
162 double min = params[1];
163 double max = params[2];
164 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
180 sourceUpper[0] = toupper(sourceUpper[0]);
183 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::fillHist()" << name <<
" " <<
value;
185 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::fillHist()" << name <<
" worked";
void plotterBookHistos(DQMStore::IBooker &iBooker, const edm::Run &iRun, const edm::EventSetup &iSetup)
void analyze(const bool &isPassTrigger, const std::string &source, const std::vector< reco::LeafCandidate > &matches)
std::set< unsigned int > _objectsType
HLTExoticaPlotter(const edm::ParameterSet &pset, const std::string &hltPath, const std::vector< unsigned int > &objectsType)
std::vector< double > _parametersEta
MonitorElement * book1D(Args &&...args)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
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 > _parametersPhi
void bookHist(DQMStore::IBooker &iBooker, const std::string &source, const std::string &objType, const std::string &variable)
static const std::string getTypeString(const unsigned int &objtype)
Tranform types into strings.
static std::string const source
tuple size
Write out results.
std::map< std::string, MonitorElement * > _elements