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"))
33 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::constructor()";
51 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::plotterBookHistos()";
52 for (std::set<unsigned int>::iterator it =
_objectsType.begin();
54 std::vector<std::string> sources(2);
60 for (
size_t i = 0;
i < sources.size();
i++) {
63 if ( source ==
"gen" ) {
64 if ( TString(objTypeStr).Contains(
"MET") ||
65 TString(objTypeStr).Contains(
"MHT") ||
66 TString(objTypeStr).Contains(
"Jet") ) {
69 bookHist(iBooker, source, objTypeStr,
"MaxPt1");
70 bookHist(iBooker, source, objTypeStr,
"MaxPt2");
71 bookHist(iBooker, source, objTypeStr,
"MaxPt3");
72 bookHist(iBooker, source, objTypeStr,
"Eta");
73 bookHist(iBooker, source, objTypeStr,
"Phi");
79 bookHist(iBooker, source, objTypeStr,
"Dxy");
83 if ( TString(objTypeStr).Contains(
"MET") ||
84 TString(objTypeStr).Contains(
"MHT") ) {
85 bookHist(iBooker, source, objTypeStr,
"MaxPt1");
86 bookHist(iBooker, source, objTypeStr,
"SumEt");
88 bookHist(iBooker, source, objTypeStr,
"MaxPt1");
89 bookHist(iBooker, source, objTypeStr,
"MaxPt2");
90 bookHist(iBooker, source, objTypeStr,
"MaxPt3");
91 bookHist(iBooker, source, objTypeStr,
"Eta");
92 bookHist(iBooker, source, objTypeStr,
"Phi");
98 bookHist(iBooker, source, objTypeStr,
"Dxy");
109 const std::vector<reco::LeafCandidate> & matches,
110 std::map<int,double> theSumEt,
111 std::vector<float> & dxys)
113 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::analyze()";
114 if (!isPassTrigger) {
118 std::map<unsigned int, int> countobjects;
120 for (std::set<unsigned int>::iterator co =
_objectsType.begin();
122 countobjects[*co] = 0;
128 const int totalobjectssize3 = 3 * countobjects.size();
130 for (
size_t j = 0;
j < matches.size(); ++
j) {
136 const unsigned int objType = matches[
j].pdgId();
139 float pt = matches[
j].pt();
140 float eta = matches[
j].eta();
141 float phi = matches[
j].phi();
143 if ( !( TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT") ) ) {
144 this->
fillHist(isPassTrigger, source, objTypeStr,
"Eta", eta);
145 this->
fillHist(isPassTrigger, source, objTypeStr,
"Phi", phi);
147 else if( source!=
"gen" ) {
148 if(theSumEt[objType]>=0 && countobjects[objType] == 0) {
149 this->
fillHist(isPassTrigger, source, objTypeStr,
"SumEt", theSumEt[objType]);
154 this->
fillHist(isPassTrigger, source, objTypeStr,
"Dxy", dxys[
j] );
156 if (countobjects[objType] == 0) {
157 if ( !( TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT") ) || source!=
"gen" ) {
158 this->
fillHist(isPassTrigger, source, objTypeStr,
"MaxPt1", pt);
161 ++(countobjects[objType]);
164 else if (countobjects[objType] == 1) {
165 if( !( TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT") ) ) {
166 this->
fillHist(isPassTrigger, source, objTypeStr,
"MaxPt2", pt);
169 ++(countobjects[objType]);
172 else if (countobjects[objType] == 2) {
173 if( !( TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT") ) ) {
174 this->
fillHist(isPassTrigger, source, objTypeStr,
"MaxPt3", pt);
177 ++(countobjects[objType]);
181 if (counttotal == totalobjectssize3) {
195 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::bookHist()";
197 sourceUpper[0] = std::toupper(sourceUpper[0]);
201 if (variable.find(
"SumEt") != std::string::npos) {
204 float *
edges =
new float[nBins + 1];
205 for (
size_t i = 0;
i < nBins + 1;
i++) {
208 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);
218 else if (variable.find(
"MaxPt") != std::string::npos) {
219 std::string desc = (variable ==
"MaxPt1") ?
"Leading" :
220 (variable ==
"MaxPt2") ?
"Next-to-Leading" :
"Next-to-next-to-Leading";
221 std::string title =
"pT of " + desc +
" " + sourceUpper +
" " + objType +
" "
224 float *
edges =
new float[nBins + 1];
225 for (
size_t i = 0;
i < nBins + 1;
i++) {
228 h =
new TH1F(name.c_str(), title.c_str(), nBins,
edges);
233 std::string symbol = (variable ==
"Eta") ?
"#eta" :
"#phi";
238 int nBins = (int)params[0];
239 double min = params[1];
240 double max = params[2];
241 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
258 sourceUpper[0] = toupper(sourceUpper[0]);
261 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::fillHist()" << name <<
" " <<
value;
263 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
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)
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, std::vector< float > &dxys)
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