26 m_pfNames = {
"allPFC",
"neutralHadPFC",
"chargedHadPFC",
"electronPFC",
"muonPFC",
"gammaPFC",
"hadHFPFC",
"emHFPFC"};
163 for (
unsigned int npv = 0; npv <
m_npvBins.size() - 1; npv++) {
203 std::string histName = Form(
"%s_jetMatched_%s%s_jetCuts%s_%s",
211 map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
m_directory +
"/" + histName, mHistInJet));
222 size_t pos = cEventObservable.find(
";");
224 cEventObservable.erase(0,
pos + 1);
226 pos = cEventObservable.find(
";");
228 cEventObservable.erase(0,
pos + 1);
230 pos = cEventObservable.find(
";");
231 int nBins = atoi(cEventObservable.substr(0,
pos).c_str());
232 cEventObservable.erase(0,
pos + 1);
234 pos = cEventObservable.find(
";");
235 float binMin = atof(cEventObservable.substr(0,
pos).c_str());
236 cEventObservable.erase(0,
pos + 1);
238 pos = cEventObservable.find(
";");
239 float binMax = atof(cEventObservable.substr(0,
pos).c_str());
240 cEventObservable.erase(0,
pos + 1);
242 pos = cEventObservable.find(
";");
243 int nBinsJet = atoi(cEventObservable.substr(0,
pos).c_str());
244 cEventObservable.erase(0,
pos + 1);
246 pos = cEventObservable.find(
";");
247 float binMinJet = atof(cEventObservable.substr(0,
pos).c_str());
248 cEventObservable.erase(0,
pos + 1);
250 float binMaxJet = atof(cEventObservable.c_str());
255 std::string histName = Form(
"%s_%s_%s",
m_pfNames[
m].c_str(), observableName.c_str(), npvString.c_str());
265 std::string histName = Form(
"%s_jetMatched_%s_jetCuts%s_%s",
267 observableName.c_str(),
271 ibooker.
book1D(histName, Form(
";%s;", axisString.c_str()), nBinsJet, binMinJet, binMaxJet);
272 map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
m_directory +
"/" + histName, mHistInJet));
291 std::string histName = Form(
"%s_jetMatched_%s%s_jetCuts%s_%s",
298 Form(
";%s;", pfInJetInfo.
axisName.c_str()),
302 map_of_MEs.insert(std::pair<std::string, MonitorElement*>(
m_directory +
"/" + histName, mHistInJet));
311 std::string histName = Form(
"jetPt_%s", npvString.c_str());
315 histName = Form(
"jetPtLead_%s", npvString.c_str());
316 mHist = ibooker.
book1D(histName, Form(
";%s;",
"p_{T, leading jet}"), 2000, 0, 2000);
319 histName = Form(
"jetEta_%s", npvString.c_str());
320 mHist = ibooker.
book1D(histName, Form(
";%s;",
"#eta_{jet}"), 200, -5, 5);
323 histName = Form(
"jetEtaLead_%s", npvString.c_str());
324 mHist = ibooker.
book1D(histName, Form(
";%s;",
"#eta_{leading jet}"), 200, -5, 5);
336 size_t pos = observableString.find(
";");
338 observableString.erase(0,
pos + 1);
340 std::vector<double> binList =
getBinList(observableString);
341 pos = observableString.find(
";");
342 binningDetails.
axisName = observableString.substr(0,
pos);
343 observableString.erase(0,
pos + 1);
345 pos = observableString.find(
";");
346 binningDetails.
nBins = atoi(observableString.substr(0,
pos).c_str());
347 observableString.erase(0,
pos + 1);
349 pos = observableString.find(
";");
350 binningDetails.
binMin = atof(observableString.substr(0,
pos).c_str());
351 observableString.erase(0,
pos + 1);
353 binningDetails.
binMax = atof(observableString.c_str());
355 return binningDetails;
370 double sigFigs = log10(
diff);
379 int nDecimals =
int(-1 * sigFigs) + 1;
389 signStringHigh =
"m";
390 return Form(
"%s%.0fp%.0f_%s%.0fp%.0f",
391 signStringLow.c_str(),
394 signStringHigh.c_str(),
400 std::vector<double> binList;
402 while (binString.find(
";") != std::string::npos) {
403 size_t pos = binString.find(
";");
404 binList.push_back(atof(binString.substr(0,
pos).c_str()));
405 binString.erase(0,
pos + 1);
407 binList.push_back(atof(binString.c_str()));
409 if (binList.size() == 3) {
411 double minVal = binList[1];
412 double maxVal = binList[2];
416 binList.push_back(minVal +
i * (maxVal - minVal) /
nBins);
426 std::vector<int>
nBins;
427 for (
unsigned int i = 0;
i < binnings.size();
i++) {
428 nTotalBins = (binnings[
i].size() - 1) * nTotalBins;
432 std::vector<std::vector<int>> binList;
434 for (
int i = 0;
i < nTotalBins;
i++) {
435 binList.push_back(std::vector<int>());
440 for (
unsigned int i = 0;
i < binnings.size();
i++) {
445 for (
int m = 0;
m < otherFactor;
m++) {
446 binList[
m * otherFactor +
j *
factor +
k].push_back(
j);
450 otherFactor = otherFactor *
nBins[
i];
453 std::vector<std::string> allSuffixes;
454 for (
int i = 0;
i < nTotalBins;
i++) {
466 for (
unsigned int i = 0;
i < binList.size();
i++) {
478 if (binVal <
bins[0])
480 for (
unsigned int i = 0;
i <
bins.size();
i++) {
481 if (binVal <
bins[
i])
489 std::vector<int> cbins;
490 std::vector<int>
nBins;
491 for (
unsigned int i = 0;
i < binVal.size();
i++) {
496 cbins.push_back(cbin);
501 for (
unsigned int i = 0;
i < binVal.size();
i++) {
510 std::vector<double> binVals;
519 std::vector<double> binVals;
530 double eventWeight = 1;
548 for (
unsigned int i = 0;
i < nTrig; ++
i) {
560 LogDebug(
"") <<
"PFAnalyzer: Could not find vertex collection" << std::endl;
566 for (reco::VertexCollection::const_iterator
v =
vertex.begin();
v !=
vertex.end(); ++
v) {
571 if (fabs(
v->z()) > 24.0)
589 edm::LogError(
"PFAnalyzer") <<
"invalid collection: PF candidate \n";
596 edm::LogError(
"PFAnalyzer") <<
"invalid collection: PF jets \n";
604 if (
pfJets->at(0).pt() < 450)
612 for (reco::PFCandidateCollection::const_iterator recoPF = pfCollection->begin(); recoPF != pfCollection->end();
630 switch (recoPF->particleId()) {
635 case reco::PFCandidate::ParticleType::h0:
651 case reco::PFCandidate::ParticleType::h_HF:
655 case reco::PFCandidate::ParticleType::egamma_HF:
693 for (reco::PFJetCollection::const_iterator cjet =
pfJets->begin(); cjet !=
pfJets->end(); ++cjet) {
699 if (jetBinNumber < 0)
703 std::vector<reco::PFCandidatePtr> pfConstits = cjet->getPFConstituents();
705 for (
auto recoPF : pfConstits) {
719 jetBinString.c_str(),
724 switch (recoPF->particleId()) {
729 case reco::PFCandidate::ParticleType::h0:
745 case reco::PFCandidate::ParticleType::h_HF:
749 case reco::PFCandidate::ParticleType::egamma_HF:
762 jetBinString.c_str(),
767 switch (recoPF->particleId()) {
772 case reco::PFCandidate::ParticleType::h0:
788 case reco::PFCandidate::ParticleType::h_HF:
792 case reco::PFCandidate::ParticleType::egamma_HF:
edm::EDGetTokenT< edm::ValueMap< float > > weightsToken_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Inizialize parameters for histo binning.
T getParameter(std::string const &) const
std::vector< std::vector< std::vector< double > > > m_jetBinList
static double getDNNESigIsolated(const reco::PFCandidate pfCand)
std::vector< std::vector< std::vector< double > > > m_binList
int getBinNumber(double binVal, std::vector< double > bins)
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
Initialize run-based parameters.
static double getRawHOEnergy(const reco::PFCandidate pfCand)
virtual void setCurrentFolder(std::string const &fullpath)
static double getDNNEBkgPhotonIsolated(const reco::PFCandidate pfCand)
static double getHcalEnergy_depth5(const reco::PFCandidate pfCand)
binInfo getBinInfo(std::string)
T const * product() const
static double getHCalEnergy(const reco::PFCandidate pfCand)
edm::InputTag highPtJetExpr_
std::map< std::string, std::function< double(const reco::PFJet)> > m_jetFuncMap
void analyze(const edm::Event &, const edm::EventSetup &) override
Get the analysis.
std::vector< Vertex > VertexCollection
collection of Vertex objects
static double getJetPt(const reco::PFJet jet)
edm::ParameterSet parameters_
Log< level::Error, false > LogError
std::vector< std::vector< std::string > > m_allJetSuffixes
static double getHOEnergy(const reco::PFCandidate pfCand)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< std::vector< std::string > > m_fullCutList
int getPFBin(const reco::PFCandidate pfCand, int i)
std::vector< double > vDouble
Jets made from PFObjects.
vstring m_eventObservableNames
static double getMVAEMu(const reco::PFCandidate pfCand)
std::vector< std::string > m_pfNames
std::map< std::string, MonitorElement * > map_of_MEs
static double getNTracksInBlock(const reco::PFCandidate pfCand)
std::string getSuffix(std::vector< int > binList, std::vector< std::string > observables, std::vector< std::vector< double >> binnings)
static double getEta(const reco::PFCandidate pfCand)
def binNumber(station, sl)
vstring m_eventObservables
static double getEnergy(const reco::PFCandidate pfCand)
int getJetBin(const reco::PFJet jetCand, int i)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
static double getDNNEBkgNonIsolated(const reco::PFCandidate pfCand)
std::vector< std::string > vstring
static double getHadCalibration(const reco::PFCandidate pfCand)
edm::InputTag theTriggerResultsLabel_
vstring m_pfInJetObservables
std::map< std::string, std::function< double(const reco::PFCandidate, const reco::PFJet)> > m_pfInJetFuncMap
Abs< T >::type abs(const T &t)
static double getHcalEnergy_depth3(const reco::PFCandidate pfCand)
std::map< std::string, std::function< double(const std::vector< reco::PFCandidatePtr > pfCands, reco::PFCandidate::ParticleType pfType)> > m_jetWideFuncMap
static double getEcalEnergy(const reco::PFCandidate pfCand)
static std::string const triggerResults
std::vector< std::string > getAllSuffixes(std::vector< std::string > observables, std::vector< std::vector< double >> binnings)
static double getRawHcalEnergy(const reco::PFCandidate pfCand)
edm::EDGetTokenT< reco::PFJetCollection > pfJetsToken_
PFAnalyzer(const edm::ParameterSet &)
Constructor.
static double getRawEcalEnergy(const reco::PFCandidate pfCand)
std::vector< std::vector< std::string > > m_fullJetCutList
int getBinNumbers(std::vector< double > binVal, std::vector< std::vector< double >> bins)
static double getEoverP(const reco::PFCandidate pfCand)
static double getMVAPiMu(const reco::PFCandidate pfCand)
static double getPhi(const reco::PFCandidate pfCand)
std::map< std::string, std::function< double(const reco::PFCandidateCollection, reco::PFCandidate::ParticleType pfType)> > m_eventFuncMap
bool passesEventSelection(const edm::Event &iEvent)
edm::ValueMap< float > const * weights_
std::string stringWithDecimals(int bin, std::vector< double > bins)
static double getMVAEPi(const reco::PFCandidate pfCand)
static double getMVAGammaNH(const reco::PFCandidate pfCand)
static double getHcalEnergy_depth4(const reco::PFCandidate pfCand)
edm::EDGetTokenT< reco::PFCandidateCollection > thePfCandidateCollection_
void bookMESetSelection(std::string, DQMStore::IBooker &)
Particle reconstructed by the particle flow algorithm.
static double getHcalEnergy(const reco::PFCandidate pfCand)
std::vector< double > getBinList(std::string binString)
edm::EDGetTokenT< GenEventInfoProduct > tok_ew_
static double getNPFC(const reco::PFCandidateCollection pfCands, reco::PFCandidate::ParticleType pfType)
static double getDNNESigNonIsolated(const reco::PFCandidate pfCand)
static double getHcalEnergy_depth1(const reco::PFCandidate pfCand)
static double getDNNEBkgTauIsolated(const reco::PFCandidate pfCand)
static double getMVANothingGamma(const reco::PFCandidate pfCand)
static double getNPFCinJet(const std::vector< reco::PFCandidatePtr > pfCands, reco::PFCandidate::ParticleType pfType)
std::vector< std::vector< std::string > > m_allSuffixes
static double getMVANothingNH(const reco::PFCandidate pfCand)
edm::EDGetTokenT< std::vector< reco::Vertex > > vertexToken_
vstring m_observableNames
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
static double getEnergySpectrum(const reco::PFCandidate pfCand, const reco::PFJet jet)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
static double getHcalEnergy_depth6(const reco::PFCandidate pfCand)
std::map< std::string, std::function< double(const reco::PFCandidate)> > m_funcMap
static double getMVAIsolated(const reco::PFCandidate pfCand)
~PFAnalyzer() override
Destructor.
static double getHcalEnergy_depth2(const reco::PFCandidate pfCand)
Power< A, B >::type pow(const A &a, const B &b)
vstring m_pfInJetObservableNames
static double getHcalEnergy_depth7(const reco::PFCandidate pfCand)
static double getPt(const reco::PFCandidate pfCand)