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 unsigned int jaux = 0;
133 for (
size_t j = 0;
j < matches.size(); ++
j) {
140 const unsigned int objType = matches[
j].pdgId();
143 float pt = matches[
j].pt();
144 float eta = matches[
j].eta();
145 float phi = matches[
j].phi();
147 if (!(TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT"))) {
148 this->
fillHist(isPassTrigger, source, objTypeStr,
"Eta", eta);
149 this->
fillHist(isPassTrigger, source, objTypeStr,
"Phi", phi);
150 }
else if (source !=
"gen") {
151 if (theSumEt[objType] >= 0 && countobjects[objType] == 0) {
152 this->
fillHist(isPassTrigger, source, objTypeStr,
"SumEt", theSumEt[objType]);
158 this->
fillHist(isPassTrigger, source, objTypeStr,
"Dxy", dxys[jaux]);
162 if (countobjects[objType] == 0) {
163 if (!(TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT")) || source !=
"gen") {
164 this->
fillHist(isPassTrigger, source, objTypeStr,
"MaxPt1", pt);
167 ++(countobjects[objType]);
169 }
else if (countobjects[objType] == 1 && !
_drop_pt2) {
170 if (!(TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT"))) {
171 this->
fillHist(isPassTrigger, source, objTypeStr,
"MaxPt2", pt);
174 ++(countobjects[objType]);
176 }
else if (countobjects[objType] == 2 && !
_drop_pt3) {
177 if (!(TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT"))) {
178 this->
fillHist(isPassTrigger, source, objTypeStr,
"MaxPt3", pt);
181 ++(countobjects[objType]);
184 if (counttotal == totalobjectssize) {
196 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::bookHist()";
198 sourceUpper[0] = std::toupper(sourceUpper[0]);
202 if (variable.find(
"SumEt") != std::string::npos) {
205 float *edges =
new float[nBins + 1];
206 for (
size_t i = 0;
i < nBins + 1;
i++) {
209 h =
new TH1F(name.c_str(), title.c_str(), nBins, edges);
211 }
else if (variable.find(
"Dxy") != std::string::npos) {
216 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
217 }
else if (variable.find(
"MaxPt") != std::string::npos) {
220 if (variable ==
"MaxPt1") {
222 }
else if (variable ==
"MaxPt2") {
223 desc =
"Next-to-Leading";
225 desc =
"Next-to-next-to-Leading";
229 "where event pass the " +
232 float *edges =
new float[nBins + 1];
233 for (
size_t i = 0;
i < nBins + 1;
i++) {
236 h =
new TH1F(name.c_str(), title.c_str(), nBins, edges);
241 std::string symbol = (variable ==
"Eta") ?
"#eta" :
"#phi";
245 int nBins = (int)params[0];
246 double min = params[1];
247 double max = params[2];
248 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
264 const float &
value) {
266 sourceUpper[0] = toupper(sourceUpper[0]);
269 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::fillHist()" << name <<
" " <<
value;
271 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::fillHist()" << name <<
" worked";
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
__host__ __device__ VT * co
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
T getParameter(std::string const &) const
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)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
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