22 const std::vector<unsigned int> & objectsType) :
24 _hltProcessName(pset.getParameter<std::
string>(
"hltProcessName")),
25 _objectsType(std::set<unsigned int>(objectsType.
begin(), objectsType.
end())),
26 _nObjects(objectsType.
size()),
27 _parametersEta(pset.getParameter<std::vector<double> >(
"parametersEta")),
28 _parametersPhi(pset.getParameter<std::vector<double> >(
"parametersPhi")),
29 _parametersTurnOn(pset.getParameter<std::vector<double> >(
"parametersTurnOn")),
30 _parametersTurnOnSumEt(pset.getParameter<std::vector<double> >(
"parametersTurnOnSumEt")),
31 _parametersDxy(pset.getParameter<std::vector<double> >(
"parametersDxy")),
35 if (pset.
exists(
"dropPt2")) {
38 if (pset.
exists(
"dropPt3")) {
41 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::constructor()";
59 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::plotterBookHistos()";
60 for (std::set<unsigned int>::iterator it =
_objectsType.begin();
62 std::vector<std::string> sources(2);
68 for (
size_t i = 0;
i < sources.size();
i++) {
71 if ( source ==
"gen" ) {
72 if ( TString(objTypeStr).Contains(
"MET") ||
73 TString(objTypeStr).Contains(
"MHT") ||
74 TString(objTypeStr).Contains(
"Jet") ) {
77 bookHist(iBooker, source, objTypeStr,
"MaxPt1");
80 bookHist(iBooker, source, objTypeStr,
"Eta");
81 bookHist(iBooker, source, objTypeStr,
"Phi");
88 bookHist(iBooker, source, objTypeStr,
"Dxy");
92 if ( TString(objTypeStr).Contains(
"MET") ||
93 TString(objTypeStr).Contains(
"MHT") ) {
94 bookHist(iBooker, source, objTypeStr,
"MaxPt1");
95 bookHist(iBooker, source, objTypeStr,
"SumEt");
97 bookHist(iBooker, source, objTypeStr,
"MaxPt1");
100 bookHist(iBooker, source, objTypeStr,
"Eta");
101 bookHist(iBooker, source, objTypeStr,
"Phi");
108 bookHist(iBooker, source, objTypeStr,
"Dxy");
119 const std::vector<reco::LeafCandidate> & matches,
120 std::map<int,double> theSumEt,
121 std::vector<float> & dxys)
123 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::analyze()";
124 if (!isPassTrigger) {
128 std::map<unsigned int, int> countobjects;
130 for (std::set<unsigned int>::iterator co =
_objectsType.begin();
132 countobjects[*co] = 0;
138 int totalobjectssize = 1;
141 totalobjectssize *= countobjects.size();
143 for (
size_t j = 0;
j < matches.size(); ++
j) {
149 const unsigned int objType = matches[
j].pdgId();
152 float pt = matches[
j].pt();
153 float eta = matches[
j].eta();
154 float phi = matches[
j].phi();
156 if ( !( TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT") ) ) {
157 this->
fillHist(isPassTrigger, source, objTypeStr,
"Eta", eta);
158 this->
fillHist(isPassTrigger, source, objTypeStr,
"Phi", phi);
160 else if( source!=
"gen" ) {
161 if(theSumEt[objType]>=0 && countobjects[objType] == 0) {
162 this->
fillHist(isPassTrigger, source, objTypeStr,
"SumEt", theSumEt[objType]);
167 this->
fillHist(isPassTrigger, source, objTypeStr,
"Dxy", dxys[
j] );
169 if (countobjects[objType] == 0) {
170 if ( !( TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT") ) || source!=
"gen" ) {
171 this->
fillHist(isPassTrigger, source, objTypeStr,
"MaxPt1", pt);
174 ++(countobjects[objType]);
177 else if (countobjects[objType] == 1 && !
_drop_pt2) {
178 if( !( TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT") ) ) {
179 this->
fillHist(isPassTrigger, source, objTypeStr,
"MaxPt2", pt);
182 ++(countobjects[objType]);
185 else if (countobjects[objType] == 2 && !
_drop_pt3) {
186 if( !( TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT") ) ) {
187 this->
fillHist(isPassTrigger, source, objTypeStr,
"MaxPt3", pt);
190 ++(countobjects[objType]);
194 if (counttotal == totalobjectssize) {
208 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::bookHist()";
210 sourceUpper[0] = std::toupper(sourceUpper[0]);
214 if (variable.find(
"SumEt") != std::string::npos) {
217 float * edges =
new float[nBins + 1];
218 for (
size_t i = 0;
i < nBins + 1;
i++) {
221 h =
new TH1F(name.c_str(), title.c_str(), nBins, edges);
224 else if (variable.find(
"Dxy") != std::string::npos) {
229 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
231 else if (variable.find(
"MaxPt") != std::string::npos) {
232 std::string desc = (variable ==
"MaxPt1") ?
"Leading" :
233 (variable ==
"MaxPt2") ?
"Next-to-Leading" :
"Next-to-next-to-Leading";
234 std::string title =
"pT of " + desc +
" " + sourceUpper +
" " + objType +
" "
237 float * edges =
new float[nBins + 1];
238 for (
size_t i = 0;
i < nBins + 1;
i++) {
241 h =
new TH1F(name.c_str(), title.c_str(), nBins, edges);
246 std::string symbol = (variable ==
"Eta") ?
"#eta" :
"#phi";
251 int nBins = (int)params[0];
252 double min = params[1];
253 double max = params[2];
254 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
271 sourceUpper[0] = toupper(sourceUpper[0]);
274 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::fillHist()" << name <<
" " <<
value;
276 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::fillHist()" << name <<
" worked";
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
MonitorElement * book1D(Args &&...args)
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)
volatile std::atomic< bool > shutdown_flag false
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