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());
402 unsigned numIdElectrons = 0;
415 bool fullSelect =
false;
416 int cutFlowStatus = -1;
462 for (
int iCut = 1; iCut <= cutFlowStatus; ++iCut) {
491 if (theEventVertex) {
509 edm::LogInfo(
"EwkElecTauHistManager") <<
"Filter-Statistics Summary:" << std::endl
514 edm::LogInfo(
"") <<
"Overall efficiency = " << std::setprecision(4) << eff * 100. <<
" +/- " << std::setprecision(4)
551 : dqmDirectory_(
cfg.getParameter<
std::
string>(
"dqmDirectory")),
552 numEventsAnalyzed_(0),
553 numEventsSelected_(0),
555 numWarningsTriggerResults_(0),
556 numWarningsHLTpath_(0),
557 numWarningsVertex_(0),
558 numWarningsBeamSpot_(0),
560 numWarningsTauJet_(0),
561 numWarningsTauDiscrByLeadTrackFinding_(0),
562 numWarningsTauDiscrByLeadTrackPtCut_(0),
563 numWarningsTauDiscrByTrackIso_(0),
564 numWarningsTauDiscrByEcalIso_(0),
565 numWarningsTauDiscrAgainstMuons_(0),
566 numWarningsCaloMEt_(0),
567 numWarningsPFMEt_(0) {
621 hVisMass_ = iBooker.
book1D(
"VisMass",
"#mu + #tau-Jet visible Mass", 20, 0., 120.);
622 hVisMassFinal_ = iBooker.
book1D(
"VisMassFinal",
"#mu + #tau-Jet visible final Mass", 20, 0., 120.);
623 hMtMuPFMEt_ = iBooker.
book1D(
"MtMuPFMEt",
"#mu + E_{T}^{miss} (PF) transverse Mass", 20, 0., 120.);
627 hVertexZ_ = iBooker.
book1D(
"VertexZ",
"Event Vertex z-Position", 20, -25., +25.);
629 hPFMEtPt_ = iBooker.
book1D(
"PFMEtPt",
"E_{T}^{miss} (PF)", 20, 0., 100.);
652 bool readError =
false;
662 "Failed to access Trigger results");
668 bool isTriggered =
false;
676 edm::LogWarning(
"EwkMuTauHistManager") <<
" Undefined HLT path = " << (*hltPath) <<
" !!";
693 "Failed to access Vertex collection");
715 double theMuonTrackIsoPt = 1.e+3;
716 double theMuonEcalIsoPt = 1.e+3;
717 double theMuonCombIsoPt = 1.e+3;
726 theMuonTrackIsoPt /= theMuon->
pt();
727 theMuonEcalIsoPt /= theMuon->
pt();
741 "Failed to access Tau-jet collection");
753 "Failed to access collection of pf. Tau discriminators by " 754 "leading Track finding");
762 "Failed to access collection of pf. Tau discriminators by " 763 "leading Track Pt cut");
771 "Failed to access collection of pf. Tau discriminators by " 780 "Failed to access collection of pf. Tau discriminators by ECAL " 789 "Failed to access collection of pf. Tau discriminators against Muons");
793 int theTauJetIndex = -1;
796 double theTauDiscrByLeadTrackFinding = -1.;
797 double theTauDiscrByLeadTrackPtCut = -1.;
798 double theTauDiscrByTrackIso = -1.;
799 double theTauDiscrByEcalIso = -1.;
800 double theTauDiscrAgainstMuons = -1.;
801 if (theTauJetIndex != -1) {
803 theTauDiscrByLeadTrackFinding = (*tauDiscrByLeadTrackFinding)[theTauJetRef];
804 theTauDiscrByLeadTrackPtCut = (*tauDiscrByLeadTrackPtCut)[theTauJetRef];
805 theTauDiscrByTrackIso = (*tauDiscrByTrackIso)[theTauJetRef];
806 theTauDiscrByEcalIso = (*tauDiscrByEcalIso)[theTauJetRef];
807 theTauDiscrAgainstMuons = (*tauDiscrAgainstMuons)[theTauJetRef];
819 "Failed to access calo. MET collection");
832 "Failed to access pf. MET collection");
838 if (!(theMuon && theTauJet && theTauJetIndex != -1))
848 double mMuTau = (theMuon->
p4() + theTauJet->
p4()).M();
852 double mtMuPFMEt =
calcMt(theMuon->
px(), theMuon->
px(), pfMEt.
px(), pfMEt.
py());
864 unsigned numGlobalMuons = 0;
866 if (
muon->isGlobalMuon()) {
876 int cutFlowStatus = -1;
928 if (theEventVertex) {
974 for (
int iCut = 1; iCut <= cutFlowStatus; ++iCut) {
978 for (
int iCut = 1; iCut <= cutFlowStatus; ++iCut) {
991 edm::LogInfo(
"EwkMuTauHistManager") <<
"Filter-Statistics Summary:" << std::endl
996 edm::LogInfo(
"") <<
"Overall efficiency = " << std::setprecision(4) << eff * 100. <<
" +/- " << std::setprecision(4)
1011 if (isoMode_string ==
"absoluteIso") {
1013 }
else if (isoMode_string ==
"relativeIso") {
1016 edm::LogError(
"getIsoMode") <<
" Failed to decode isoMode string = " << isoMode_string <<
" !!";
1035 double calcMt(
double px1,
double py1,
double px2,
double py2) {
1036 double pt1 = TMath::Sqrt(px1 * px1 + py1 * py1);
1037 double pt2 = TMath::Sqrt(px2 * px2 + py2 * py2);
1039 double p1Dotp2 = px1 * px2 + py1 * py2;
1040 double cosAlpha = p1Dotp2 / (
pt1 *
pt2);
1042 return TMath::Sqrt(2 *
pt1 *
pt2 * (1 - cosAlpha));
1049 double cosPhi1 =
cos(
p1.phi());
1050 double sinPhi1 =
sin(
p1.phi());
1051 double cosPhi2 =
cos(
p2.phi());
1052 double sinPhi2 =
sin(
p2.phi());
1053 double zetaX = cosPhi1 + cosPhi2;
1054 double zetaY = sinPhi1 + sinPhi2;
1055 double zetaR = TMath::Sqrt(zetaX * zetaX + zetaY * zetaY);
1061 double pxVis =
p1.px() +
p2.px();
1062 double pyVis =
p1.py() +
p2.py();
1063 double pZetaVis = pxVis * zetaX + pyVis * zetaY;
1065 double px = pxVis + pxMEt;
1066 double py = pyVis + pyMEt;
1067 double pZeta =
px * zetaX +
py * zetaY;
1069 return pZeta - 1.5 * pZetaVis;
1073 if ((TMath::Abs(
electron.eta()) < 1.479 || TMath::Abs(
electron.eta()) > 1.566) &&
1074 electron.deltaPhiSuperClusterTrackAtVtx() < 0.8 &&
electron.deltaEtaSuperClusterTrackAtVtx() < 0.01 &&
1086 TMath::Abs(
electron.deltaEtaSuperClusterTrackAtVtx()) < 0.009 &&
1087 TMath::Abs(
electron.deltaPhiSuperClusterTrackAtVtx()) < 0.7) ||
1088 (TMath::Abs(
electron.eta()) < 1.479 &&
1091 TMath::Abs(
electron.deltaEtaSuperClusterTrackAtVtx()) < 0.007 &&
1092 TMath::Abs(
electron.deltaPhiSuperClusterTrackAtVtx()) < 0.8))) {
1108 if (theElectron ==
nullptr ||
electron->pt() > theElectron->
pt())
1121 if (theMuon ==
nullptr ||
muon->pt() > theMuon->
pt())
1132 int& theTauJetIndex) {
1134 theTauJetIndex = -1;
1136 int numTauJets = tauJets.
size();
1137 for (
int iTauJet = 0; iTauJet < numTauJets; ++iTauJet) {
1141 if (theTauJet ==
nullptr || tauJet.
pt() > theTauJet->
pt()) {
1142 theTauJet = &tauJet;
1143 theTauJetIndex = iTauJet;
1154 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_
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_
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_
int charge() const final
electric charge
long numWarningsTauDiscrByLeadTrackPtCut_
double eta() const final
momentum pseudorapidity