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++) {
60 if ( source ==
"gen" ) {
61 if ( TString(objTypeStr).Contains(
"MET") ||
62 TString(objTypeStr).Contains(
"MHT") ||
63 TString(objTypeStr).Contains(
"Jet") ) {
66 bookHist(iBooker, source, objTypeStr,
"MaxPt1");
67 bookHist(iBooker, source, objTypeStr,
"MaxPt2");
68 bookHist(iBooker, source, objTypeStr,
"Eta");
69 bookHist(iBooker, source, objTypeStr,
"Phi");
72 if ( TString(objTypeStr).Contains(
"MET") ||
73 TString(objTypeStr).Contains(
"MHT") ) {
74 bookHist(iBooker, source, objTypeStr,
"MaxPt1");
75 bookHist(iBooker, source, objTypeStr,
"SumEt");
77 bookHist(iBooker, source, objTypeStr,
"MaxPt1");
78 bookHist(iBooker, source, objTypeStr,
"MaxPt2");
79 bookHist(iBooker, source, objTypeStr,
"Eta");
80 bookHist(iBooker, source, objTypeStr,
"Phi");
90 const std::vector<reco::LeafCandidate> & matches,
91 std::map<int,double> theSumEt)
93 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::analyze()";
98 std::map<unsigned int, int> countobjects;
100 for (std::set<unsigned int>::iterator co =
_objectsType.begin();
102 countobjects[*co] = 0;
106 const int totalobjectssize2 = 2 * countobjects.size();
108 for (
size_t j = 0;
j < matches.size(); ++
j) {
114 const unsigned int objType = matches[
j].pdgId();
117 float pt = matches[
j].pt();
118 float eta = matches[
j].eta();
119 float phi = matches[
j].phi();
121 if ( !( TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT") ) ) {
122 this->
fillHist(isPassTrigger, source, objTypeStr,
"Eta", eta);
123 this->
fillHist(isPassTrigger, source, objTypeStr,
"Phi", phi);
125 else if( source!=
"gen" ) {
126 if(theSumEt[objType]>=0 && countobjects[objType] == 0) {
127 this->
fillHist(isPassTrigger, source, objTypeStr,
"SumEt", theSumEt[objType]);
131 if (countobjects[objType] == 0) {
132 if ( !( TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT") ) || source!=
"gen" ) {
133 this->
fillHist(isPassTrigger, source, objTypeStr,
"MaxPt1", pt);
136 ++(countobjects[objType]);
139 else if (countobjects[objType] == 1) {
140 if( !( TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT") ) ) {
141 this->
fillHist(isPassTrigger, source, objTypeStr,
"MaxPt2", pt);
144 ++(countobjects[objType]);
148 if (counttotal == totalobjectssize2) {
162 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::bookHist()";
164 sourceUpper[0] = std::toupper(sourceUpper[0]);
168 if (variable.find(
"SumEt") != std::string::npos) {
171 float *
edges =
new float[nBins + 1];
172 for (
size_t i = 0;
i < nBins + 1;
i++) {
175 h =
new TH1F(name.c_str(), title.c_str(), nBins,
edges);
179 else if (variable.find(
"MaxPt") != std::string::npos) {
180 std::string desc = (variable ==
"MaxPt1") ?
"Leading" :
"Next-to-Leading";
181 std::string title =
"pT of " + desc +
" " + sourceUpper +
" " + objType +
" "
184 float *
edges =
new float[nBins + 1];
185 for (
size_t i = 0;
i < nBins + 1;
i++) {
188 h =
new TH1F(name.c_str(), title.c_str(), nBins,
edges);
193 std::string symbol = (variable ==
"Eta") ?
"#eta" :
"#phi";
198 int nBins = (int)params[0];
199 double min = params[1];
200 double max = params[2];
201 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
218 sourceUpper[0] = toupper(sourceUpper[0]);
221 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::fillHist()" << name <<
" " <<
value;
223 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::fillHist()" << name <<
" worked";
void plotterBookHistos(DQMStore::IBooker &iBooker, const edm::Run &iRun, const edm::EventSetup &iSetup)
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)
void analyze(const bool &isPassTrigger, const std::string &source, const std::vector< reco::LeafCandidate > &matches, std::map< int, double > theSumEt)
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