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")),
29 _parametersTurnOnSumEt(pset.getParameter<
std::vector<double>>(
"parametersTurnOnSumEt")),
30 _parametersDxy(pset.getParameter<
std::vector<double>>(
"parametersDxy")),
33 if (pset.
exists(
"dropPt2")) {
36 if (pset.
exists(
"dropPt3")) {
39 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::constructor()";
49 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::plotterBookHistos()";
51 std::vector<std::string>
sources(2);
57 for (
size_t i = 0;
i < sources.size();
i++) {
60 if (source ==
"gen") {
61 if (TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT") ||
62 TString(objTypeStr).Contains(
"Jet")) {
65 bookHist(iBooker, source, objTypeStr,
"MaxPt1");
67 bookHist(iBooker, source, objTypeStr,
"MaxPt2");
69 bookHist(iBooker, source, objTypeStr,
"MaxPt3");
70 bookHist(iBooker, source, objTypeStr,
"Eta");
71 bookHist(iBooker, source, objTypeStr,
"Phi");
76 bookHist(iBooker, source, objTypeStr,
"Dxy");
80 if (TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT")) {
81 bookHist(iBooker, source, objTypeStr,
"MaxPt1");
82 bookHist(iBooker, source, objTypeStr,
"SumEt");
84 bookHist(iBooker, source, objTypeStr,
"MaxPt1");
86 bookHist(iBooker, source, objTypeStr,
"MaxPt2");
88 bookHist(iBooker, source, objTypeStr,
"MaxPt3");
89 bookHist(iBooker, source, objTypeStr,
"Eta");
90 bookHist(iBooker, source, objTypeStr,
"Phi");
95 bookHist(iBooker, source, objTypeStr,
"Dxy");
105 const std::vector<reco::LeafCandidate> &
matches,
106 std::map<int, double> theSumEt,
107 std::vector<float> &dxys) {
108 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::analyze()";
109 if (!isPassTrigger) {
113 std::map<unsigned int, int> countobjects;
116 countobjects[*co] = 0;
122 int totalobjectssize = 1;
127 totalobjectssize *= countobjects.size();
129 for (
size_t j = 0;
j < matches.size(); ++
j) {
135 const unsigned int objType = matches[
j].pdgId();
138 float pt = matches[
j].pt();
139 float eta = matches[
j].eta();
140 float phi = matches[
j].phi();
142 if (!(TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT"))) {
143 this->
fillHist(isPassTrigger, source, objTypeStr,
"Eta", eta);
144 this->
fillHist(isPassTrigger, source, objTypeStr,
"Phi", phi);
145 }
else if (source !=
"gen") {
146 if (theSumEt[objType] >= 0 && countobjects[objType] == 0) {
147 this->
fillHist(isPassTrigger, source, objTypeStr,
"SumEt", theSumEt[objType]);
153 this->
fillHist(isPassTrigger, source, objTypeStr,
"Dxy", dxys[
j]);
155 if (countobjects[objType] == 0) {
156 if (!(TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT")) || source !=
"gen") {
157 this->
fillHist(isPassTrigger, source, objTypeStr,
"MaxPt1", pt);
162 }
else if (countobjects[objType] == 1 && !
_drop_pt2) {
163 if (!(TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT"))) {
164 this->
fillHist(isPassTrigger, source, objTypeStr,
"MaxPt2", pt);
169 }
else if (countobjects[objType] == 2 && !
_drop_pt3) {
170 if (!(TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT"))) {
171 this->
fillHist(isPassTrigger, source, objTypeStr,
"MaxPt3", pt);
177 if (counttotal == totalobjectssize) {
189 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::bookHist()";
191 sourceUpper[0] = std::toupper(sourceUpper[0]);
195 if (variable.find(
"SumEt") != std::string::npos) {
198 float *
edges =
new float[nBins + 1];
199 for (
size_t i = 0;
i < nBins + 1;
i++) {
202 h =
new TH1F(name.c_str(), title.c_str(),
nBins,
edges);
204 }
else if (variable.find(
"Dxy") != std::string::npos) {
209 h =
new TH1F(name.c_str(), title.c_str(),
nBins,
min,
max);
210 }
else if (variable.find(
"MaxPt") != std::string::npos) {
212 (variable ==
"MaxPt1") ?
"Leading" : (variable ==
"MaxPt2") ?
"Next-to-Leading" :
"Next-to-next-to-Leading";
215 "where event pass the " +
218 float *
edges =
new float[nBins + 1];
219 for (
size_t i = 0;
i < nBins + 1;
i++) {
222 h =
new TH1F(name.c_str(), title.c_str(),
nBins,
edges);
227 std::string symbol = (variable ==
"Eta") ?
"#eta" :
"#phi";
232 double min = params[1];
233 double max = params[2];
234 h =
new TH1F(name.c_str(), title.c_str(),
nBins,
min,
max);
250 const float &
value) {
252 sourceUpper[0] = toupper(sourceUpper[0]);
255 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::fillHist()" << name <<
" " <<
value;
257 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::fillHist()" << name <<
" worked";
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getParameter(std::string const &) const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void plotterBookHistos(DQMStore::IBooker &iBooker, const edm::Run &iRun, const edm::EventSetup &iSetup)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::set< unsigned int > _objectsType
std::vector< double > _parametersDxy
std::vector< double > _parametersTurnOnSumEt
HLTExoticaPlotter(const edm::ParameterSet &pset, const std::string &hltPath, const std::vector< unsigned int > &objectsType)
std::vector< double > _parametersEta
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)
void analyze(const bool &isPassTrigger, const std::string &source, const std::vector< reco::LeafCandidate > &matches, std::map< int, double > theSumEt, std::vector< float > &dxys)
static const std::string getTypeString(const unsigned int &objtype)
Tranform types into strings.
static std::string const source
std::map< std::string, MonitorElement * > _elements