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 ( !( TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT") ) || source!=
"gen" ) {
61 bookHist(iBooker, source, objTypeStr,
"MaxPt1");
64 if ( !( TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT") ) ) {
65 bookHist(iBooker, source, objTypeStr,
"Eta");
66 bookHist(iBooker, source, objTypeStr,
"Phi");
67 bookHist(iBooker, source, objTypeStr,
"MaxPt2");
70 else if( source!=
"gen" ) {
71 bookHist(iBooker, source, objTypeStr,
"SumEt");
80 const std::vector<reco::LeafCandidate> & matches,
81 std::map<int,double> theSumEt)
83 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::analyze()";
88 std::map<unsigned int, int> countobjects;
90 for (std::set<unsigned int>::iterator co =
_objectsType.begin();
92 countobjects[*co] = 0;
96 const int totalobjectssize2 = 2 * countobjects.size();
98 for (
size_t j = 0;
j < matches.size(); ++
j) {
104 const unsigned int objType = matches[
j].pdgId();
107 float pt = matches[
j].pt();
108 float eta = matches[
j].eta();
109 float phi = matches[
j].phi();
111 if ( !( TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT") ) ) {
112 this->
fillHist(isPassTrigger, source, objTypeStr,
"Eta", eta);
113 this->
fillHist(isPassTrigger, source, objTypeStr,
"Phi", phi);
115 else if( source!=
"gen" ) {
116 if(theSumEt[objType]>=0 && countobjects[objType] == 0) {
117 this->
fillHist(isPassTrigger, source, objTypeStr,
"SumEt", theSumEt[objType]);
121 if (countobjects[objType] == 0) {
122 if ( !( TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT") ) || source!=
"gen" ) {
123 this->
fillHist(isPassTrigger, source, objTypeStr,
"MaxPt1", pt);
126 ++(countobjects[objType]);
129 else if (countobjects[objType] == 1) {
130 if( !( TString(objTypeStr).Contains(
"MET") || TString(objTypeStr).Contains(
"MHT") ) ) {
131 this->
fillHist(isPassTrigger, source, objTypeStr,
"MaxPt2", pt);
134 ++(countobjects[objType]);
138 if (counttotal == totalobjectssize2) {
152 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::bookHist()";
154 sourceUpper[0] = std::toupper(sourceUpper[0]);
158 if (variable.find(
"SumEt") != std::string::npos) {
161 float *
edges =
new float[nBins + 1];
162 for (
size_t i = 0;
i < nBins + 1;
i++) {
165 h =
new TH1F(name.c_str(), title.c_str(), nBins,
edges);
169 else if (variable.find(
"MaxPt") != std::string::npos) {
170 std::string desc = (variable ==
"MaxPt1") ?
"Leading" :
"Next-to-Leading";
171 std::string title =
"pT of " + desc +
" " + sourceUpper +
" " + objType +
" "
174 float *
edges =
new float[nBins + 1];
175 for (
size_t i = 0;
i < nBins + 1;
i++) {
178 h =
new TH1F(name.c_str(), title.c_str(), nBins,
edges);
183 std::string symbol = (variable ==
"Eta") ?
"#eta" :
"#phi";
188 int nBins = (int)params[0];
189 double min = params[1];
190 double max = params[2];
191 h =
new TH1F(name.c_str(), title.c_str(), nBins,
min,
max);
208 sourceUpper[0] = toupper(sourceUpper[0]);
211 LogDebug(
"ExoticaValidation") <<
"In HLTExoticaPlotter::fillHist()" << name <<
" " <<
value;
213 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