26 std::string dqmSubDirectoryElecTauChannel = cfgElecTauChannel.getParameter<
std::string>(
"dqmSubDirectory");
27 cfgElecTauChannel.addParameter<
std::string>(
"dqmDirectory",
92 : dqmDirectory_(
cfg.getParameter<
std::
string>(
"dqmDirectory")),
93 numEventsAnalyzed_(0),
94 numEventsSelected_(0),
96 numWarningsTriggerResults_(0),
97 numWarningsHLTpath_(0),
98 numWarningsVertex_(0),
99 numWarningsBeamSpot_(0),
100 numWarningsElectron_(0),
101 numWarningsTauJet_(0),
102 numWarningsTauDiscrByLeadTrackFinding_(0),
103 numWarningsTauDiscrByLeadTrackPtCut_(0),
104 numWarningsTauDiscrByTrackIso_(0),
105 numWarningsTauDiscrByEcalIso_(0),
106 numWarningsTauDiscrAgainstElectrons_(0),
107 numWarningsTauDiscrAgainstMuons_(0),
108 numWarningsCaloMEt_(0),
109 numWarningsPFMEt_(0) {
151 hVisMass_ = iBooker.
book1D(
"VisMass",
"e + #tau-Jet visible Mass", 20, 20., 120.);
152 hMtElecPFMEt_ = iBooker.
book1D(
"MtElecPFMEt",
"e + E_{T}^{miss} (PF) transverse Mass", 20, 20., 120.);
156 hVertexZ_ = iBooker.
book1D(
"VertexZ",
"Event Vertex z-Position", 20, -25., +25.);
158 hPFMEtPt_ = iBooker.
book1D(
"PFMEtPt",
"E_{T}^{miss} (PF)", 20, 0., 100.);
181 bool readError =
false;
191 "Failed to access Trigger results");
197 bool isTriggered =
false;
205 edm::LogWarning(
"EwkElecTauHistManager") <<
" Undefined HLT path = " << (*hltPath) <<
" !!";
222 "Failed to access Vertex collection");
243 "Failed to access Electron collection");
249 double theElectronTrackIsoPt = 1.e+3;
250 double theElectronEcalIsoPt = 1.e+3;
252 theElectronTrackIsoPt = theElectron->
dr03TkSumPt();
256 theElectronTrackIsoPt /= theElectron->
pt();
257 theElectronEcalIsoPt /= theElectron->
pt();
269 "Failed to access Tau-jet collection");
281 "Failed to access collection of pf. Tau discriminators by " 282 "leading Track finding");
290 "Failed to access collection of pf. Tau discriminators by " 291 "leading Track Pt cut");
299 "Failed to access collection of pf. Tau discriminators by " 308 "Failed to access collection of pf. Tau discriminators by ECAL " 317 "Failed to access collection of pf. Tau discriminators against " 326 "Failed to access collection of pf. Tau discriminators against Muons");
330 int theTauJetIndex = -1;
333 double theTauDiscrByLeadTrackFinding = -1.;
334 double theTauDiscrByLeadTrackPtCut = -1.;
335 double theTauDiscrByTrackIso = -1.;
336 double theTauDiscrByEcalIso = -1.;
337 double theTauDiscrAgainstElectrons = -1.;
338 double theTauDiscrAgainstMuons = -1.;
339 if (theTauJetIndex != -1) {
341 theTauDiscrByLeadTrackFinding = (*tauDiscrByLeadTrackFinding)[theTauJetRef];
342 theTauDiscrByLeadTrackPtCut = (*tauDiscrByLeadTrackPtCut)[theTauJetRef];
343 theTauDiscrByTrackIso = (*tauDiscrByTrackIso)[theTauJetRef];
344 theTauDiscrByEcalIso = (*tauDiscrByEcalIso)[theTauJetRef];
345 theTauDiscrAgainstElectrons = (*tauDiscrAgainstElectrons)[theTauJetRef];
346 theTauDiscrAgainstMuons = (*tauDiscrAgainstMuons)[theTauJetRef];
358 "Failed to access calo. MET collection");
371 "Failed to access pf. MET collection");
377 if (!(theElectron && theTauJet && theTauJetIndex != -1))
386 double mElecTau = (theElectron->
p4() + theTauJet->
p4()).M();
390 double mtElecPFMEt =
calcMt(theElectron->
px(), theElectron->
py(), pfMEt.
px(), pfMEt.
py());
404 bool fullSelect =
false;
405 int cutFlowStatus = -1;
451 for (
int iCut = 1; iCut <= cutFlowStatus; ++iCut) {
480 if (theEventVertex) {
498 edm::LogInfo(
"EwkElecTauHistManager") <<
"Filter-Statistics Summary:" << std::endl
503 edm::LogInfo(
"") <<
"Overall efficiency = " << std::setprecision(4) << eff * 100. <<
" +/- " << std::setprecision(4)
540 : dqmDirectory_(
cfg.getParameter<
std::
string>(
"dqmDirectory")),
541 numEventsAnalyzed_(0),
542 numEventsSelected_(0),
544 numWarningsTriggerResults_(0),
545 numWarningsHLTpath_(0),
546 numWarningsVertex_(0),
547 numWarningsBeamSpot_(0),
549 numWarningsTauJet_(0),
550 numWarningsTauDiscrByLeadTrackFinding_(0),
551 numWarningsTauDiscrByLeadTrackPtCut_(0),
552 numWarningsTauDiscrByTrackIso_(0),
553 numWarningsTauDiscrByEcalIso_(0),
554 numWarningsTauDiscrAgainstMuons_(0),
555 numWarningsCaloMEt_(0),
556 numWarningsPFMEt_(0) {
610 hVisMass_ = iBooker.
book1D(
"VisMass",
"#mu + #tau-Jet visible Mass", 20, 0., 120.);
611 hVisMassFinal_ = iBooker.
book1D(
"VisMassFinal",
"#mu + #tau-Jet visible final Mass", 20, 0., 120.);
612 hMtMuPFMEt_ = iBooker.
book1D(
"MtMuPFMEt",
"#mu + E_{T}^{miss} (PF) transverse Mass", 20, 0., 120.);
616 hVertexZ_ = iBooker.
book1D(
"VertexZ",
"Event Vertex z-Position", 20, -25., +25.);
618 hPFMEtPt_ = iBooker.
book1D(
"PFMEtPt",
"E_{T}^{miss} (PF)", 20, 0., 100.);
641 bool readError =
false;
651 "Failed to access Trigger results");
657 bool isTriggered =
false;
665 edm::LogWarning(
"EwkMuTauHistManager") <<
" Undefined HLT path = " << (*hltPath) <<
" !!";
682 "Failed to access Vertex collection");
704 double theMuonTrackIsoPt = 1.e+3;
705 double theMuonEcalIsoPt = 1.e+3;
706 double theMuonCombIsoPt = 1.e+3;
715 theMuonTrackIsoPt /= theMuon->
pt();
716 theMuonEcalIsoPt /= theMuon->
pt();
730 "Failed to access Tau-jet collection");
742 "Failed to access collection of pf. Tau discriminators by " 743 "leading Track finding");
751 "Failed to access collection of pf. Tau discriminators by " 752 "leading Track Pt cut");
760 "Failed to access collection of pf. Tau discriminators by " 769 "Failed to access collection of pf. Tau discriminators by ECAL " 778 "Failed to access collection of pf. Tau discriminators against Muons");
782 int theTauJetIndex = -1;
785 double theTauDiscrByLeadTrackFinding = -1.;
786 double theTauDiscrByLeadTrackPtCut = -1.;
787 double theTauDiscrByTrackIso = -1.;
788 double theTauDiscrByEcalIso = -1.;
789 double theTauDiscrAgainstMuons = -1.;
790 if (theTauJetIndex != -1) {
792 theTauDiscrByLeadTrackFinding = (*tauDiscrByLeadTrackFinding)[theTauJetRef];
793 theTauDiscrByLeadTrackPtCut = (*tauDiscrByLeadTrackPtCut)[theTauJetRef];
794 theTauDiscrByTrackIso = (*tauDiscrByTrackIso)[theTauJetRef];
795 theTauDiscrByEcalIso = (*tauDiscrByEcalIso)[theTauJetRef];
796 theTauDiscrAgainstMuons = (*tauDiscrAgainstMuons)[theTauJetRef];
808 "Failed to access calo. MET collection");
821 "Failed to access pf. MET collection");
827 if (!(theMuon && theTauJet && theTauJetIndex != -1))
837 double mMuTau = (theMuon->
p4() + theTauJet->
p4()).M();
841 double mtMuPFMEt =
calcMt(theMuon->
px(), theMuon->
px(), pfMEt.
px(), pfMEt.
py());
855 int cutFlowStatus = -1;
907 if (theEventVertex) {
953 for (
int iCut = 1; iCut <= cutFlowStatus; ++iCut) {
957 for (
int iCut = 1; iCut <= cutFlowStatus; ++iCut) {
970 edm::LogInfo(
"EwkMuTauHistManager") <<
"Filter-Statistics Summary:" << std::endl
975 edm::LogInfo(
"") <<
"Overall efficiency = " << std::setprecision(4) << eff * 100. <<
" +/- " << std::setprecision(4)
990 if (isoMode_string ==
"absoluteIso") {
992 }
else if (isoMode_string ==
"relativeIso") {
995 edm::LogError(
"getIsoMode") <<
" Failed to decode isoMode string = " << isoMode_string <<
" !!";
1014 double calcMt(
double px1,
double py1,
double px2,
double py2) {
1015 double pt1 = TMath::Sqrt(px1 * px1 + py1 * py1);
1016 double pt2 = TMath::Sqrt(px2 * px2 + py2 * py2);
1018 double p1Dotp2 = px1 * px2 + py1 * py2;
1019 double cosAlpha = p1Dotp2 / (
pt1 *
pt2);
1021 return TMath::Sqrt(2 *
pt1 *
pt2 * (1 - cosAlpha));
1028 double cosPhi1 =
cos(
p1.phi());
1029 double sinPhi1 =
sin(
p1.phi());
1030 double cosPhi2 =
cos(
p2.phi());
1031 double sinPhi2 =
sin(
p2.phi());
1032 double zetaX = cosPhi1 + cosPhi2;
1033 double zetaY = sinPhi1 + sinPhi2;
1034 double zetaR = TMath::Sqrt(zetaX * zetaX + zetaY * zetaY);
1040 double pxVis =
p1.px() +
p2.px();
1041 double pyVis =
p1.py() +
p2.py();
1042 double pZetaVis = pxVis * zetaX + pyVis * zetaY;
1044 double px = pxVis + pxMEt;
1045 double py = pyVis + pyMEt;
1046 double pZeta =
px * zetaX +
py * zetaY;
1048 return pZeta - 1.5 * pZetaVis;
1052 if ((TMath::Abs(
electron.eta()) < 1.479 || TMath::Abs(
electron.eta()) > 1.566) &&
1053 electron.deltaPhiSuperClusterTrackAtVtx() < 0.8 &&
electron.deltaEtaSuperClusterTrackAtVtx() < 0.01 &&
1065 TMath::Abs(
electron.deltaEtaSuperClusterTrackAtVtx()) < 0.009 &&
1066 TMath::Abs(
electron.deltaPhiSuperClusterTrackAtVtx()) < 0.7) ||
1067 (TMath::Abs(
electron.eta()) < 1.479 &&
1070 TMath::Abs(
electron.deltaEtaSuperClusterTrackAtVtx()) < 0.007 &&
1071 TMath::Abs(
electron.deltaPhiSuperClusterTrackAtVtx()) < 0.8))) {
1087 if (theElectron ==
nullptr ||
electron->pt() > theElectron->
pt())
1100 if (theMuon ==
nullptr ||
muon->pt() > theMuon->
pt())
1111 int& theTauJetIndex) {
1113 theTauJetIndex = -1;
1115 int numTauJets = tauJets.
size();
1116 for (
int iTauJet = 0; iTauJet < numTauJets; ++iTauJet) {
1120 if (theTauJet ==
nullptr || tauJet.
pt() > theTauJet->
pt()) {
1121 theTauJet = &tauJet;
1122 theTauJetIndex = iTauJet;
1133 return TMath::Sqrt(
dX *
dX +
dY *
dY);
MonitorElement * hCutFlowSummary_
edm::InputTag tauDiscrByEcalIso_
long numWarningsTauDiscrByEcalIso_
bool accept() const
Has at least one path accepted the event?
edm::InputTag beamSpotSource_
double calcDeltaPhi(double phi1, double phi2)
MonitorElement * hPFMEtPt_
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
void bookHistograms(DQMStore::IBooker &)
double calcMt(double px1, double py1, double px2, double py2)
edm::InputTag tauDiscrByLeadTrackFinding_
T getParameter(std::string const &) const
MonitorElement * hTauJetPhi_
edm::InputTag pfMEtSource_
edm::InputTag beamSpotSource_
std::vector< PFTau > PFTauCollection
collection of PFTau objects
EwkMuTauHistManager(const edm::ParameterSet &)
float sumPt
sum-pt of tracks
double pt() const final
transverse momentum
edm::InputTag tauDiscrByLeadTrackPtCut_
double z() const
z coordinate
MonitorElement * hElecTauAcoplanarity_
edm::InputTag electronSource_
virtual void setCurrentFolder(std::string const &fullpath)
int getIsoMode(const std::string &isoMode_string, int &error)
edm::InputTag tauDiscrByTrackIso_
long numWarningsTauDiscrAgainstMuons_
MonitorElement * hVisMass_
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::InputTag tauDiscrByLeadTrackFinding_
long numWarningsTauDiscrByEcalIso_
double getVertexD0(const reco::Vertex &vertex, const reco::BeamSpot &beamSpot)
long numWarningsTauDiscrByTrackIso_
MonitorElement * hMuonPhi_
std::vector< std::string > vstring
MonitorElement * hElectronEcalIsoPt_
Sin< T >::type sin(const T &t)
MonitorElement * hTauEcalIsoPt_
std::string dqmDirectory_
long numWarningsTauDiscrByLeadTrackFinding_
tauDiscrByLeadTrackFinding
double electronEcalIsoCut_
unsigned numEventsSelected_
MonitorElement * hPFMEtPt_
unsigned numEventsSelected_
std::string dqmDirectory_
float isolationPFGammaCandsEtSum() const
edm::InputTag tauDiscrByLeadTrackPtCut_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Log< level::Error, false > LogError
std::string dqmDirectoryName(const std::string &dqmRootDirectory, const std::string &dqmSubDirectory)
MonitorElement * hCutFlowSummary_
long numWarningsTauDiscrByLeadTrackPtCut_
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
void finalizeHistograms()
edm::InputTag caloMEtSource_
double electronTrackIsoCut_
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
edm::InputTag tauDiscrAgainstMuons_
MonitorElement * hVertexZ_
const LorentzVector & p4() const final
four-momentum Lorentz vector
void fillHistograms(const edm::Event &, const edm::EventSetup &)
MonitorElement * hTauDiscrAgainstMuons_
long numWarningsBeamSpot_
std::vector< Muon > MuonCollection
collection of Muon objects
bool isTrackerMuon() const override
MonitorElement * hMuonEcalIsoPt_
void fillHistograms(const edm::Event &, const edm::EventSetup &)
long numWarningsTauDiscrByTrackIso_
MonitorElement * hElecTauCharge_
edm::InputTag vertexSource_
float dr03TkSumPt() const
const reco::GsfElectron * getTheElectron(const reco::GsfElectronCollection &electrons, double electronEtaCut, double electronPtCut)
MonitorElement * hElectronTrackIsoPt_
MonitorElement * hTauJetNumSignalTracks_
double px() const final
x coordinate of momentum vector
edm::InputTag tauJetSource_
MonitorElement * hMuonEta_
void dqmEndRun(const edm::Run &, const edm::EventSetup &) override
bool passesElectronId(const reco::GsfElectron &electron)
MonitorElement * hVisMassFinal_
MonitorElement * hTauLeadTrackPt_
EwkElecTauHistManager * elecTauHistManager_
MonitorElement * hElectronEta_
void addParameter(std::string const &name, T const &value)
Cos< T >::type cos(const T &t)
edm::InputTag caloMEtSource_
long numWarningsTriggerResults_
std::string dqmDirectory_
long numWarningsTauDiscrAgainstMuons_
MonitorElement * hMtMuPFMEt_
MonitorElement * hCaloMEtPt_
MonitorElement * hTauJetPt_
const reco::Muon * getTheMuon(const reco::MuonCollection &muons, double muonEtaCut, double muonPtCut)
virtual const reco::TrackRefVector & signalTracks() const
edm::InputTag tauDiscrByEcalIso_
MonitorElement * hVertexZ_
virtual reco::TrackRef leadTrack() const
const reco::PFTau * getTheTauJet(const reco::PFTauCollection &tauJets, double tauJetEtaCut, double tauJetPtCut, int &theTauJetIndex)
MonitorElement * hTauJetPt_
const LorentzVector & p4(P4Kind kind) const
double py() const final
y coordinate of momentum vector
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
void finalizeHistograms()
MonitorElement * hTauTrackIsoPt_
MonitorElement * hElectronPhi_
double calcPzeta(const reco::Candidate::LorentzVector &p1, const reco::Candidate::LorentzVector &p2, double pxMEt, double pyMEt)
edm::InputTag tauDiscrAgainstElectrons_
MonitorElement * hCaloMEtPt_
virtual const reco::TrackRefVector & isolationTracks() const
long numWarningsTauDiscrByLeadTrackFinding_
MonitorElement * hMuonPt_
long numWarningsElectron_
Log< level::Info, false > LogInfo
edm::InputTag tauDiscrByTrackIso_
float dX(const MatchPair &match)
MonitorElement * hMuTauDeltaR_
long numWarningsTriggerResults_
float isolationPFChargedHadrCandsPtSum() const
size_type size() const
Size of the RefVector.
edm::InputTag muonSource_
EwkElecTauHistManager(const edm::ParameterSet &)
MonitorElement * hMuTauAcoplanarity_
MonitorElement * hTauJetNumIsoTracks_
MonitorElement * hMuonCombIsoPt_
bool isSelected(const std::vector< L1HPSPFTauQualityCut > &qualityCuts, const l1t::PFCandidate &pfCand, float_t primaryVertexZ)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
edm::InputTag vertexSource_
electronEtaCut
"HLT_Ele10_LW_L1R"
bool passesElectronPreId(const reco::GsfElectron &electron)
edm::InputTag pfMEtSource_
long numWarningsBeamSpot_
EwkMuTauHistManager * muTauHistManager_
std::vector< std::string > vstring
void readEventData(const edm::Event &evt, const edm::InputTag &src, edm::Handle< T > &handle, long &numWarnings, int maxNumWarnings, bool &error, const char *errorMessage)
void bookHistograms(DQMStore::IBooker &)
MonitorElement * hTauJetEta_
edm::InputTag tauJetSource_
edm::InputTag triggerResultsSource_
unsigned numEventsAnalyzed_
float dr03EcalRecHitSumEt() const
edm::InputTag triggerResultsSource_
MonitorElement * hTauJetEta_
edm::InputTag tauDiscrAgainstMuons_
const std::string dqmRootDirectory
const std::string dqmSeparator
MonitorElement * hVisMass_
MonitorElement * hMuonTrackIsoPt_
Log< level::Warning, false > LogWarning
unsigned numEventsAnalyzed_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
long numWarningsTauDiscrAgainstElectrons_
double phi() const final
momentum azimuthal angle
EwkTauDQM(const edm::ParameterSet &)
MonitorElement * hElectronPt_
const MuonIsolation & isolationR05() const
bool isGlobalMuon() const override
MonitorElement * hMtElecPFMEt_
float dY(const MatchPair &match)
int charge() const final
electric charge
long numWarningsTauDiscrByLeadTrackPtCut_
double eta() const final
momentum pseudorapidity