CMS 3D CMS Logo

Public Member Functions | Private Types | Private Attributes

EwkMuTauHistManager Class Reference

#include <EwkTauDQM.h>

List of all members.

Public Member Functions

void bookHistograms ()
 EwkMuTauHistManager (const edm::ParameterSet &, DQMStore *)
void fillHistograms (const edm::Event &, const edm::EventSetup &)
void finalizeHistograms ()

Private Types

enum  {
  kPassedPreselection = 1, kPassedTrigger = 2, kPassedMuonId = 3, kPassedTauLeadTrack = 4,
  kPassedTauLeadTrackPt = 5, kPassedTauDiscrAgainstMuons = 6, kPassedDeltaR = 7, kPassedMuonTrackIso = 8,
  kPassedMuonEcalIso = 9, kPassedTauTrackIso = 10, kPassedTauEcalIso = 11
}
typedef std::vector< std::string > vstring

Private Attributes

edm::InputTag beamSpotSource_
edm::InputTag caloMEtSource_
int cfgError_
double deltaRCut_
std::string dqmDirectory_
DQMStoredqmStore_
MonitorElementhCaloMEtPt_
MonitorElementhCutFlowSummary_
vstring hltPaths_
MonitorElementhMtMuPFMEt_
MonitorElementhMuonCombIsoPt_
MonitorElementhMuonEcalIsoPt_
MonitorElementhMuonEta_
MonitorElementhMuonPhi_
MonitorElementhMuonPt_
MonitorElementhMuonTrackIsoPt_
MonitorElementhMuTauAcoplanarity_
MonitorElementhMuTauDeltaR_
MonitorElementhPFMEtPt_
MonitorElementhTauDiscrAgainstMuons_
MonitorElementhTauEcalIsoPt_
MonitorElementhTauJetCharge_
MonitorElementhTauJetEta_
MonitorElementhTauJetNumIsoTracks_
MonitorElementhTauJetNumSignalTracks_
MonitorElementhTauJetPhi_
MonitorElementhTauJetPt_
MonitorElementhTauLeadTrackPt_
MonitorElementhTauTrackIsoPt_
MonitorElementhVertexZ_
MonitorElementhVisMass_
MonitorElementhVisMassFinal_
int maxNumWarnings_
double muonCombIsoCut_
double muonEcalIsoCut_
double muonEtaCut_
int muonIsoMode_
double muonPtCut_
edm::InputTag muonSource_
double muonTrackIsoCut_
unsigned numEventsAnalyzed_
unsigned numEventsSelected_
long numWarningsBeamSpot_
long numWarningsCaloMEt_
long numWarningsHLTpath_
long numWarningsMuon_
long numWarningsPFMEt_
long numWarningsTauDiscrAgainstMuons_
long numWarningsTauDiscrByEcalIso_
long numWarningsTauDiscrByLeadTrackFinding_
long numWarningsTauDiscrByLeadTrackPtCut_
long numWarningsTauDiscrByTrackIso_
long numWarningsTauJet_
long numWarningsTriggerResults_
long numWarningsVertex_
edm::InputTag pfMEtSource_
edm::InputTag tauDiscrAgainstMuons_
edm::InputTag tauDiscrByEcalIso_
edm::InputTag tauDiscrByLeadTrackFinding_
edm::InputTag tauDiscrByLeadTrackPtCut_
edm::InputTag tauDiscrByTrackIso_
double tauJetEtaCut_
double tauJetPtCut_
edm::InputTag tauJetSource_
edm::InputTag triggerResultsSource_
edm::InputTag vertexSource_
double visMassCut_

Detailed Description

Booking and filling of histograms for data-quality monitoring purposes in Z --> muon + tau-jet channel

Author:
Letizia Lusito, Christian Veelken
Version:
Revision:
1.4
Id:
EwkTauDQM.h,v 1.4 2010/10/01 10:05:20 lusito Exp

Definition at line 225 of file EwkTauDQM.h.


Member Typedef Documentation

typedef std::vector<std::string> EwkMuTauHistManager::vstring [private]

Definition at line 253 of file EwkTauDQM.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
kPassedPreselection 
kPassedTrigger 
kPassedMuonId 
kPassedTauLeadTrack 
kPassedTauLeadTrackPt 
kPassedTauDiscrAgainstMuons 
kPassedDeltaR 
kPassedMuonTrackIso 
kPassedMuonEcalIso 
kPassedTauTrackIso 
kPassedTauEcalIso 

Definition at line 315 of file EwkTauDQM.h.


Constructor & Destructor Documentation

EwkMuTauHistManager::EwkMuTauHistManager ( const edm::ParameterSet cfg,
DQMStore dqmStore 
)

Definition at line 527 of file EwkTauDQM.cc.

References beamSpotSource_, caloMEtSource_, cfgError_, deltaRCut_, edm::ParameterSet::exists(), getIsoMode(), edm::ParameterSet::getParameter(), hltPaths_, maxNumWarnings_, muonCombIsoCut_, muonEcalIsoCut_, muonEtaCut_, muonIsoMode_, muonPtCut_, muonSource_, muonTrackIsoCut_, pfMEtSource_, tauDiscrAgainstMuons_, tauDiscrByEcalIso_, tauDiscrByLeadTrackFinding_, tauDiscrByLeadTrackPtCut_, tauDiscrByTrackIso_, tauJetEtaCut_, tauJetPtCut_, tauJetSource_, triggerResultsSource_, vertexSource_, and visMassCut_.

  : dqmStore_(dqmStore),
    dqmDirectory_(cfg.getParameter<std::string>("dqmDirectory")),
    numEventsAnalyzed_(0),
    numEventsSelected_(0),
    cfgError_(0),
    numWarningsTriggerResults_(0),
    numWarningsHLTpath_(0),
    numWarningsVertex_(0),
    numWarningsBeamSpot_(0),
    numWarningsMuon_(0),
    numWarningsTauJet_(0),
    numWarningsTauDiscrByLeadTrackFinding_(0),
    numWarningsTauDiscrByLeadTrackPtCut_(0),
    numWarningsTauDiscrByTrackIso_(0),
    numWarningsTauDiscrByEcalIso_(0),
    numWarningsTauDiscrAgainstMuons_(0),
    numWarningsCaloMEt_(0),
    numWarningsPFMEt_(0)
{
  triggerResultsSource_ = cfg.getParameter<edm::InputTag>("triggerResultsSource");
  vertexSource_ = cfg.getParameter<edm::InputTag>("vertexSource");
  beamSpotSource_ = cfg.getParameter<edm::InputTag>("beamSpotSource");
  muonSource_ = cfg.getParameter<edm::InputTag>("muonSource");
  tauJetSource_ = cfg.getParameter<edm::InputTag>("tauJetSource");
  caloMEtSource_ = cfg.getParameter<edm::InputTag>("caloMEtSource");
  pfMEtSource_ = cfg.getParameter<edm::InputTag>("pfMEtSource");

  tauDiscrByLeadTrackFinding_ = cfg.getParameter<edm::InputTag>("tauDiscrByLeadTrackFinding");
  tauDiscrByLeadTrackPtCut_ = cfg.getParameter<edm::InputTag>("tauDiscrByLeadTrackPtCut");
  tauDiscrByTrackIso_ = cfg.getParameter<edm::InputTag>("tauDiscrByTrackIso");
  tauDiscrByEcalIso_ = cfg.getParameter<edm::InputTag>("tauDiscrByEcalIso");
  tauDiscrAgainstMuons_ = cfg.getParameter<edm::InputTag>("tauDiscrAgainstMuons");

  hltPaths_ = cfg.getParameter<vstring>("hltPaths");

  muonEtaCut_ = cfg.getParameter<double>("muonEtaCut");
  muonPtCut_ = cfg.getParameter<double>("muonPtCut");
  muonTrackIsoCut_ = cfg.getParameter<double>("muonTrackIsoCut");
  muonEcalIsoCut_ = cfg.getParameter<double>("muonEcalIsoCut");
  muonCombIsoCut_ = cfg.getParameter<double>("muonCombIsoCut");
  std::string muonIsoMode_string = cfg.getParameter<std::string>("muonIsoMode");
  muonIsoMode_ = getIsoMode(muonIsoMode_string, cfgError_);

  tauJetEtaCut_ = cfg.getParameter<double>("tauJetEtaCut");
  tauJetPtCut_ = cfg.getParameter<double>("tauJetPtCut");

  visMassCut_ = cfg.getParameter<double>("visMassCut");
deltaRCut_ = cfg.getParameter<double>("deltaRCut");

  maxNumWarnings_ = cfg.exists("maxNumWarnings") ? cfg.getParameter<int>("maxNumWarnings") : 1;
}

Member Function Documentation

void EwkMuTauHistManager::bookHistograms ( )

Definition at line 580 of file EwkTauDQM.cc.

References DQMStore::book1D(), dqmDirectory_, dqmStore_, hCaloMEtPt_, hCutFlowSummary_, hMtMuPFMEt_, hMuonCombIsoPt_, hMuonEcalIsoPt_, hMuonEta_, hMuonPhi_, hMuonPt_, hMuonTrackIsoPt_, hMuTauAcoplanarity_, hMuTauDeltaR_, hPFMEtPt_, hTauDiscrAgainstMuons_, hTauEcalIsoPt_, hTauJetEta_, hTauJetNumIsoTracks_, hTauJetNumSignalTracks_, hTauJetPhi_, hTauJetPt_, hTauLeadTrackPt_, hTauTrackIsoPt_, hVertexZ_, hVisMass_, hVisMassFinal_, kPassedDeltaR, kPassedMuonEcalIso, kPassedMuonId, kPassedMuonTrackIso, kPassedPreselection, kPassedTauDiscrAgainstMuons, kPassedTauEcalIso, kPassedTauLeadTrack, kPassedTauLeadTrackPt, kPassedTauTrackIso, kPassedTrigger, Pi, MonitorElement::setBinLabel(), and DQMStore::setCurrentFolder().

Referenced by EwkTauDQM::beginJob().

{
  dqmStore_->setCurrentFolder(dqmDirectory_);

  //hNumGlobalMuons_ = dqmStore_->book1D("NumGlobalMuons" , "Num. global Muons", 5, -0.5, 4.5);
  hMuonPt_ = dqmStore_->book1D("MuonPt" , "P_{T}^{#mu}", 20, 0., 100.);
  hMuonEta_ = dqmStore_->book1D("MuonEta" , "#eta_{#mu}", 20, -4.0, +4.0);
  hMuonPhi_ = dqmStore_->book1D("MuonPhi" , "#phi_{#mu}", 20, -TMath::Pi(), +TMath::Pi());
  hMuonTrackIsoPt_ = dqmStore_->book1D("MuonTrackIsoPt" , "Muon Track Iso.", 20, -0.01, 10.);
  hMuonEcalIsoPt_ = dqmStore_->book1D("MuonEcalIsoPt" , "Muon Ecal Iso.", 20, -0.01, 10.);
  hMuonCombIsoPt_ = dqmStore_->book1D("MuonCombIsoPt" , "Muon Comb Iso.", 20, -0.01, 1.);

  hTauJetPt_ = dqmStore_->book1D("TauJetPt" , "P_{T}^{#tau-Jet}", 20, 0., 100.);
  hTauJetEta_ = dqmStore_->book1D("TauJetEta" , "#eta_{#tau-Jet}", 20, -4.0, +4.0);
  hTauJetPhi_ = dqmStore_->book1D("TauJetPhi" , "#phi_{#tau-Jet}", 20, -TMath::Pi(), +TMath::Pi());
  hTauLeadTrackPt_ = dqmStore_->book1D("TauLeadTrackPt" , "P_{T}^{#tau-Jetldg trk}", 20, 0., 50.);
  hTauTrackIsoPt_ = dqmStore_->book1D("TauTrackIsoPt" , "Tau Track Iso.", 20, -0.01, 40.);
  hTauEcalIsoPt_ = dqmStore_->book1D("TauEcalIsoPt" , "Tau Ecal Iso.", 10, -0.01, 10.);
  hTauDiscrAgainstMuons_ = dqmStore_->book1D("TauDiscrAgainstMuons" , "Tau Discr. against Muons", 2, -0.5, +1.5);
  //hTauJetCharge_ = dqmStore_->book1D("TauJetCharge" , "Q_{#tau-Jet}", 11, -5.5, +5.5);
  hTauJetNumSignalTracks_ = dqmStore_->book1D("TauJetNumSignalTracks" , "Num. Tau signal Cone Tracks", 20, -0.5, +19.5);
  hTauJetNumIsoTracks_ = dqmStore_->book1D("TauJetNumIsoTracks" , "Num. Tau isolation Cone Tracks", 20, -0.5, +19.5);
  
  hVisMass_ = dqmStore_->book1D("VisMass", "#mu + #tau-Jet visible Mass", 20, 0., 120.);
hVisMassFinal_ = dqmStore_->book1D("VisMassFinal", "#mu + #tau-Jet visible final Mass", 20, 0., 120.);
  //hMtMuCaloMEt_ = dqmStore_->book1D("MtMuCaloMEt", "#mu + E_{T}^{miss} (Calo) transverse Mass", 20, 20., 120.);
  hMtMuPFMEt_ = dqmStore_->book1D("MtMuPFMEt", "#mu + E_{T}^{miss} (PF) transverse Mass", 20, 0., 120.);
  //hPzetaCaloMEt_ = dqmStore_->book1D("PzetaCaloMEt", "P_{#zeta} - 1.5*P_{#zeta}^{vis} (Calo)", 20, -40., 40.);
  //hPzetaPFMEt_ = dqmStore_->book1D("PzetaPFMEt", "P_{#zeta} - 1.5*P_{#zeta}^{vis} (PF)", 20, -40., 40.);
  hMuTauAcoplanarity_ = dqmStore_->book1D("MuTauAcoplanarity", "#Delta #phi_{#mu #tau-Jet}", 20, -TMath::Pi(), +TMath::Pi());
  //hMuTauCharge_ = dqmStore_->book1D("MuTauCharge" , "Q_{#mu + #tau-Jet}", 11, -5.5, +5.5);
hMuTauDeltaR_ = dqmStore_->book1D("MuTauDeltaR", "#Delta R_{#mu #tau-Jet}", 20, 0, 5);
  //hVertexChi2_ = dqmStore_->book1D("VertexChi2", "Event Vertex #chi^{2} / n.d.o.f.", 20, 0., 2.0);
  hVertexZ_ = dqmStore_->book1D("VertexZ", "Event Vertex z-Position", 20, -25., +25.);
  //hVertexD0_ = dqmStore_->book1D("VertexD0", "Event Vertex d_{0}", 20, -0.0001, 0.05);

  hCaloMEtPt_ = dqmStore_->book1D("CaloMEtPt", "E_{T}^{miss} (Calo)", 20, 0., 100.);
  //hCaloMEtPhi_ = dqmStore_->book1D("CaloMEtPhi", "#phi^{miss} (Calo)", 20, -TMath::Pi(), +TMath::Pi());

  hPFMEtPt_ = dqmStore_->book1D("PFMEtPt", "E_{T}^{miss} (PF)", 20, 0., 100.);
  //hPFMEtPhi_ = dqmStore_->book1D("PFMEtPhi", "#phi^{miss} (PF)", 20, -TMath::Pi(), +TMath::Pi());

  hCutFlowSummary_ = dqmStore_->book1D("CutFlowSummary", "Cut-flow Summary", 11, 0.5, 11.5);
  hCutFlowSummary_->setBinLabel(kPassedPreselection, "Preselection");
  hCutFlowSummary_->setBinLabel(kPassedTrigger, "HLT");
  hCutFlowSummary_->setBinLabel(kPassedMuonId, "#mu ID");
  hCutFlowSummary_->setBinLabel(kPassedMuonTrackIso, "#mu Trk Iso.");
  hCutFlowSummary_->setBinLabel(kPassedMuonEcalIso, "#mu Ecal Iso.");
  hCutFlowSummary_->setBinLabel(kPassedTauLeadTrack, "#tau lead. Track");
  hCutFlowSummary_->setBinLabel(kPassedTauLeadTrackPt, "#tau lead. Track P_{T}");
  hCutFlowSummary_->setBinLabel(kPassedTauTrackIso, "#tau Track Iso.");
  hCutFlowSummary_->setBinLabel(kPassedTauEcalIso, "#tau Ecal Iso.");
  hCutFlowSummary_->setBinLabel(kPassedTauDiscrAgainstMuons, "#tau anti-#mu Discr.");
  //hCutFlowSummary_->setBinLabel(kPassedMuonCombIso, "#mu Comb Iso.");

hCutFlowSummary_->setBinLabel(kPassedDeltaR, "#DeltaR(#mu,#tau) ");
}
void EwkMuTauHistManager::fillHistograms ( const edm::Event evt,
const edm::EventSetup es 
)

Definition at line 638 of file EwkTauDQM.cc.

References ExpressReco_HICollisions_FallBack::beamSpot, beamSpotSource_, calcDeltaPhi(), calcMt(), caloMEtSource_, cfgError_, deltaRCut_, reco::LeafCandidate::eta(), MonitorElement::Fill(), getTheMuon(), getTheTauJet(), hCaloMEtPt_, hCutFlowSummary_, hltPaths_, hMtMuPFMEt_, hMuonCombIsoPt_, hMuonEcalIsoPt_, hMuonEta_, hMuonPhi_, hMuonPt_, hMuonTrackIsoPt_, hMuTauAcoplanarity_, hMuTauDeltaR_, hPFMEtPt_, hTauDiscrAgainstMuons_, hTauEcalIsoPt_, hTauJetEta_, hTauJetNumIsoTracks_, hTauJetNumSignalTracks_, hTauJetPhi_, hTauJetPt_, hTauLeadTrackPt_, hTauTrackIsoPt_, hVertexZ_, hVisMass_, hVisMassFinal_, getHLTprescales::index, edm::Ref< C, T, F >::isAvailable(), edm::RefVector< C, T, F >::isAvailable(), reco::Muon::isGlobalMuon(), reco::PFTau::isolationPFChargedHadrCandsPtSum(), reco::PFTau::isolationPFGammaCandsEtSum(), reco::Muon::isolationR05(), reco::BaseTau::isolationTracks(), reco::Muon::isTrackerMuon(), kAbsoluteIso, kPassedDeltaR, kPassedMuonEcalIso, kPassedMuonId, kPassedMuonTrackIso, kPassedPreselection, kPassedTauDiscrAgainstMuons, kPassedTauEcalIso, kPassedTauLeadTrack, kPassedTauLeadTrackPt, kPassedTauTrackIso, kPassedTrigger, kRelativeIso, reco::BaseTau::leadTrack(), maxNumWarnings_, metsig::muon, muonCombIsoCut_, muonEcalIsoCut_, muonEtaCut_, muonIsoMode_, muonPtCut_, ExpressReco_HICollisions_FallBack::muons, muonSource_, numEventsAnalyzed_, numEventsSelected_, numWarningsBeamSpot_, numWarningsCaloMEt_, numWarningsHLTpath_, numWarningsMuon_, numWarningsPFMEt_, numWarningsTauDiscrAgainstMuons_, numWarningsTauDiscrByEcalIso_, numWarningsTauDiscrByLeadTrackFinding_, numWarningsTauDiscrByLeadTrackPtCut_, numWarningsTauDiscrByTrackIso_, numWarningsTauJet_, numWarningsTriggerResults_, numWarningsVertex_, reco::LeafCandidate::p4(), pfMEtSource_, reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), readEventData(), reco::BaseTau::signalTracks(), edm::RefVector< C, T, F >::size(), edm::TriggerNames::size(), tauDiscrAgainstMuons_, tauDiscrByLeadTrackFinding_, tauDiscrByLeadTrackPtCut_, tauDiscrByTrackIso_, tauJetEtaCut_, tauJetPtCut_, tauJetSource_, edm::TriggerNames::triggerIndex(), edm::Event::triggerNames(), triggerResultsSource_, ExpressReco_HICollisions_FallBack::vertexCollection, vertexSource_, visMassCut_, and reco::Vertex::z().

Referenced by EwkTauDQM::analyze().

{
  if ( cfgError_ ) return;

  //-----------------------------------------------------------------------------
  // access event-level information
  //-----------------------------------------------------------------------------

  bool readError = false;

//--- get decision of high-level trigger for the event
  edm::Handle<edm::TriggerResults> hltDecision;
  readEventData(evt, triggerResultsSource_, hltDecision, numWarningsTriggerResults_, maxNumWarnings_, 
                readError, "Failed to access Trigger results");
  if ( readError ) return;
  
  const edm::TriggerNames & triggerNames = evt.triggerNames(*hltDecision);
   
  bool isTriggered = false;
  for ( vstring::const_iterator hltPath = hltPaths_.begin();
        hltPath != hltPaths_.end(); ++hltPath ) {
    unsigned int index = triggerNames.triggerIndex(*hltPath);
    if ( index < triggerNames.size() ) {
      if ( hltDecision->accept(index) ) isTriggered = true;
    } else {
      if ( numWarningsHLTpath_ < maxNumWarnings_ || maxNumWarnings_ == -1 ) 
        edm::LogWarning ("EwkMuTauHistManager") << " Undefined HLT path = " << (*hltPath) << " !!";
      ++numWarningsHLTpath_;
      continue;
    }
  }
  
//--- get reconstructed primary event vertex of the event
//   (take as "the" primary event vertex the first entry in the collection
//    of vertex objects, corresponding to the vertex associated to the highest Pt sum of tracks)
  edm::Handle<reco::VertexCollection> vertexCollection;
  readEventData(evt, vertexSource_, vertexCollection, numWarningsVertex_, maxNumWarnings_,
                readError, "Failed to access Vertex collection");
  if ( readError ) return;

  const reco::Vertex* theEventVertex = ( vertexCollection->size() > 0 ) ? &(vertexCollection->at(0)) : 0;

//--- get beam-spot (expected vertex position) for the event
  edm::Handle<reco::BeamSpot> beamSpot;
  readEventData(evt, beamSpotSource_, beamSpot, numWarningsBeamSpot_, maxNumWarnings_,
                readError, "Failed to access Beam-spot");
  if ( readError ) return;
  
//--- get collections of reconstructed muons from the event
  edm::Handle<reco::MuonCollection> muons;
  readEventData(evt, muonSource_, muons, numWarningsMuon_, maxNumWarnings_,
                readError, "Failed to access Muon collection");
  if ( readError ) return;

  const reco::Muon* theMuon = getTheMuon(*muons, muonEtaCut_, muonPtCut_);

  double theMuonTrackIsoPt = 1.e+3;
  double theMuonEcalIsoPt = 1.e+3;
double theMuonCombIsoPt = 1.e+3;

  if ( theMuon ) {
    theMuonTrackIsoPt = theMuon->isolationR05().sumPt;
    //mu.isolationR05().emEt + mu.isolationR05().hadEt + mu.isolationR05().sumPt
    theMuonEcalIsoPt = theMuon->isolationR05().emEt;

    if ( muonIsoMode_ == kRelativeIso && theMuon->pt() > 0. ) {
      theMuonTrackIsoPt /= theMuon->pt();
      theMuonEcalIsoPt /= theMuon->pt();
      theMuonCombIsoPt=(theMuon->isolationR05().sumPt+theMuon->isolationR05().emEt)/theMuon->pt();
      //std::cout<<"Rel Iso ="<<theMuonCombIsoPt<<std::endl;
    }
  }

//--- get collections of reconstructed tau-jets from the event
  edm::Handle<reco::PFTauCollection> tauJets;
  readEventData(evt, tauJetSource_, tauJets, numWarningsTauJet_, maxNumWarnings_,
                readError, "Failed to access Tau-jet collection");
  if ( readError ) return;

//--- get collections of tau-jet discriminators for those tau-jets
  edm::Handle<reco::PFTauDiscriminator> tauDiscrByLeadTrackFinding;
  readEventData(evt, tauDiscrByLeadTrackFinding_, tauDiscrByLeadTrackFinding, numWarningsTauDiscrByLeadTrackFinding_, maxNumWarnings_,
                readError, "Failed to access collection of pf. Tau discriminators by leading Track finding");
  edm::Handle<reco::PFTauDiscriminator> tauDiscrByLeadTrackPtCut;
  readEventData(evt, tauDiscrByLeadTrackPtCut_, tauDiscrByLeadTrackPtCut, numWarningsTauDiscrByLeadTrackPtCut_, maxNumWarnings_,
                readError, "Failed to access collection of pf. Tau discriminators by leading Track Pt cut");
  edm::Handle<reco::PFTauDiscriminator> tauDiscrByTrackIso;
  readEventData(evt, tauDiscrByTrackIso_, tauDiscrByTrackIso, numWarningsTauDiscrByTrackIso_, maxNumWarnings_,
                readError, "Failed to access collection of pf. Tau discriminators by Track isolation");
  edm::Handle<reco::PFTauDiscriminator> tauDiscrByEcalIso;
  readEventData(evt, tauDiscrByTrackIso_, tauDiscrByEcalIso, numWarningsTauDiscrByEcalIso_, maxNumWarnings_,
                readError, "Failed to access collection of pf. Tau discriminators by ECAL isolation");
  edm::Handle<reco::PFTauDiscriminator> tauDiscrAgainstMuons;
  readEventData(evt, tauDiscrAgainstMuons_, tauDiscrAgainstMuons, numWarningsTauDiscrAgainstMuons_, maxNumWarnings_,
                readError, "Failed to access collection of pf. Tau discriminators against Muons");
  if ( readError ) return;

  int theTauJetIndex = -1;
  const reco::PFTau* theTauJet = getTheTauJet(*tauJets, tauJetEtaCut_, tauJetPtCut_, theTauJetIndex);

  double theTauDiscrByLeadTrackFinding = -1.;
  double theTauDiscrByLeadTrackPtCut = -1.;
  double theTauDiscrByTrackIso = -1.;
  double theTauDiscrByEcalIso = -1.;
  double theTauDiscrAgainstMuons = -1.;
  if ( theTauJetIndex != -1 ) {
    reco::PFTauRef theTauJetRef(tauJets, theTauJetIndex);
    theTauDiscrByLeadTrackFinding = (*tauDiscrByLeadTrackFinding)[theTauJetRef];
    theTauDiscrByLeadTrackPtCut = (*tauDiscrByLeadTrackPtCut)[theTauJetRef];
    theTauDiscrByTrackIso = (*tauDiscrByTrackIso)[theTauJetRef];
    theTauDiscrByEcalIso = (*tauDiscrByEcalIso)[theTauJetRef];
    theTauDiscrAgainstMuons = (*tauDiscrAgainstMuons)[theTauJetRef];
  }

//--- get missing transverse momentum
//    measured by calorimeters/reconstructed by particle-flow algorithm
  edm::Handle<reco::CaloMETCollection> caloMEtCollection;
  readEventData(evt, caloMEtSource_, caloMEtCollection, numWarningsCaloMEt_, maxNumWarnings_,
                readError, "Failed to access calo. MET collection");
  if ( readError ) return;

  const reco::CaloMET& caloMEt = caloMEtCollection->at(0);
  
  edm::Handle<reco::PFMETCollection> pfMEtCollection;
  readEventData(evt, pfMEtSource_, pfMEtCollection, numWarningsPFMEt_, maxNumWarnings_,
                readError, "Failed to access pf. MET collection");
  if ( readError ) return;

  const reco::PFMET& pfMEt = pfMEtCollection->at(0);

  if ( !(theMuon && theTauJet && theTauJetIndex != -1) ) return;

  //-----------------------------------------------------------------------------
  // compute EWK tau analysis specific quantities
  //-----------------------------------------------------------------------------

  double dPhiMuTau = calcDeltaPhi(theMuon->phi(), theTauJet->phi());
  //double dRMuTau = calcDeltaR(theMuon->p4(), theTauJet->p4());
  double dRMuTau = fabs(ROOT::Math::VectorUtil::DeltaR(theMuon->p4(),theTauJet->p4()));
  double mMuTau = (theMuon->p4() + theTauJet->p4()).M();

  //double mtMuCaloMEt = calcMt(theMuon->px(), theMuon->px(), caloMEt.px(), caloMEt.py());
  double mtMuPFMEt = calcMt(theMuon->px(), theMuon->px(), pfMEt.px(), pfMEt.py());

  //double pZetaCaloMEt = calcPzeta(theMuon->p4(), theTauJet->p4(), caloMEt.px(), caloMEt.py());
  //double pZetaPFMEt = calcPzeta(theMuon->p4(), theTauJet->p4(), pfMEt.px(), pfMEt.py());

  //-----------------------------------------------------------------------------
  // apply selection criteria; fill histograms
  //-----------------------------------------------------------------------------

//--- fill muon multiplicity histogram
  unsigned numGlobalMuons = 0;
  for ( reco::MuonCollection::const_iterator muon = muons->begin();
        muon != muons->end(); ++muon ) {
    if ( muon->isGlobalMuon() ) {
      ++numGlobalMuons;
    }
  }

  //hNumGlobalMuons_->Fill(numGlobalMuons);

  ++numEventsAnalyzed_;

  bool isSelected = false;
  int cutFlowStatus = -1;

  //if ( muonIsoMode_ == kAbsoluteIso){
  if ( mMuTau > visMassCut_ ) {
    cutFlowStatus = kPassedPreselection;
  }
  if ( cutFlowStatus == kPassedPreselection && (isTriggered || hltPaths_.size() == 0) ) {
    cutFlowStatus = kPassedTrigger;
  }
  if ( cutFlowStatus == kPassedTrigger && (theMuon->isGlobalMuon()||theMuon->isTrackerMuon()) ) {
    cutFlowStatus = kPassedMuonId;
   
  }
 
  if ( cutFlowStatus == kPassedMuonId && (theTauDiscrByLeadTrackFinding > 0.5) && (theTauJet->eta() < tauJetEtaCut_) && (theTauJet->pt() > tauJetPtCut_)  ) {
    cutFlowStatus = kPassedTauLeadTrack;
    
  }
  if ( cutFlowStatus == kPassedTauLeadTrack && theTauDiscrByLeadTrackPtCut > 0.5 ) {
    cutFlowStatus = kPassedTauLeadTrackPt;
    //hTauTrackIsoPt_->Fill(theTauJet->isolationPFChargedHadrCandsPtSum());
  }
  if ( cutFlowStatus == kPassedTauLeadTrackPt && theTauDiscrAgainstMuons  > 0.5 ) {
    cutFlowStatus = kPassedTauDiscrAgainstMuons;
    //hTauEcalIsoPt_->Fill(theTauJet->isolationPFGammaCandsEtSum());
  }
  if ( cutFlowStatus == kPassedTauDiscrAgainstMuons && dRMuTau > deltaRCut_) {
    cutFlowStatus = kPassedDeltaR;
    //hTauDiscrAgainstMuons_->Fill(theTauDiscrAgainstMuons);



hMuonPt_->Fill(theMuon->pt());
    hMuonEta_->Fill(theMuon->eta());
    hMuonPhi_->Fill(theMuon->phi());

    hTauJetPt_->Fill(theTauJet->pt());
    hTauJetEta_->Fill(theTauJet->eta());
    hTauJetPhi_->Fill(theTauJet->phi());

    //hTauJetCharge_->Fill(theTauJet->charge());
    if ( theTauJet->signalTracks().isAvailable()    ) hTauJetNumSignalTracks_->Fill(theTauJet->signalTracks().size());
    if ( theTauJet->isolationTracks().isAvailable() ) hTauJetNumIsoTracks_->Fill(theTauJet->isolationTracks().size());
  
    hVisMass_->Fill(mMuTau);
    //hMtMuCaloMEt_->Fill(mtMuCaloMEt);
    hMtMuPFMEt_->Fill(mtMuPFMEt);
    //hPzetaCaloMEt_->Fill(pZetaCaloMEt);
    //hPzetaPFMEt_->Fill(pZetaPFMEt);
    hMuTauAcoplanarity_->Fill(dPhiMuTau);
hMuTauDeltaR_->Fill(dRMuTau);
    //hMuTauCharge_->Fill(theMuon->charge() + theTauJet->charge());

    if ( theEventVertex ) {
      //hVertexChi2_->Fill(theEventVertex->normalizedChi2());
      hVertexZ_->Fill(theEventVertex->z());
      //hVertexD0_->Fill(getVertexD0(*theEventVertex, *beamSpot));
    }
    
    hCaloMEtPt_->Fill(caloMEt.pt());
    //hCaloMEtPhi_->Fill(caloMEt.phi());

    hPFMEtPt_->Fill(pfMEt.pt());
    //hPFMEtPhi_->Fill(pfMEt.phi());
    hMuonTrackIsoPt_->Fill(theMuonTrackIsoPt);
hMuonEcalIsoPt_->Fill(theMuonEcalIsoPt);
hMuonCombIsoPt_->Fill(theMuonCombIsoPt);
//hMuonCombIsoPt_->Fill((theMuonTrackIsoPt+theMuonEcalIsoPt)/theMuon->pt());

// std::cout<<"Rel Iso Hist = "<<(theMuonTrackIsoPt+theMuonEcalIsoPt)/theMuon->pt()<<std::endl;
hTauEcalIsoPt_->Fill(theTauJet->isolationPFGammaCandsEtSum());
hTauTrackIsoPt_->Fill(theTauJet->isolationPFChargedHadrCandsPtSum());
hTauDiscrAgainstMuons_->Fill(theTauDiscrAgainstMuons);
if ( theTauJet->leadTrack().isAvailable() ) hTauLeadTrackPt_->Fill(theTauJet->leadTrack()->pt());

  }

  

  if ( (cutFlowStatus == kPassedDeltaR) && (((theMuonTrackIsoPt < muonTrackIsoCut_)&&(muonIsoMode_ == kAbsoluteIso))||((1>0)&&(muonIsoMode_ == kRelativeIso))) ) {
    cutFlowStatus = kPassedMuonTrackIso;
    //isSelected = true;
  }
  if ( cutFlowStatus == kPassedMuonTrackIso && (((theMuonEcalIsoPt < muonEcalIsoCut_)&&(muonIsoMode_ == kAbsoluteIso))||((theMuonCombIsoPt < muonCombIsoCut_)&&(muonIsoMode_ == kRelativeIso))) ) {
  cutFlowStatus = kPassedMuonEcalIso;
    //isSelected = true;
  }

if ( cutFlowStatus == kPassedMuonEcalIso && theTauDiscrByTrackIso > 0.5 )
  {cutFlowStatus = kPassedTauTrackIso;

  }

if ( cutFlowStatus == kPassedTauTrackIso && theTauDiscrByEcalIso > 0.5 ) {
cutFlowStatus = kPassedTauEcalIso;
isSelected = true;

 }

  for ( int iCut = 1; iCut <= cutFlowStatus; ++iCut ) {
    hCutFlowSummary_->Fill(iCut);
  }

  






for ( int iCut = 1; iCut <= cutFlowStatus; ++iCut ) {
     hCutFlowSummary_->Fill(iCut);
   }



//     }
    



  if ( isSelected ) 
    {
hVisMassFinal_->Fill(mMuTau);
++numEventsSelected_;
    }
}
void EwkMuTauHistManager::finalizeHistograms ( )

Definition at line 931 of file EwkTauDQM.cc.

References numEventsAnalyzed_, and numEventsSelected_.

Referenced by EwkTauDQM::endJob().

{
  edm::LogInfo ("EwkMuTauHistManager") 
    << "Filter-Statistics Summary:" << std::endl
    << " Events analyzed = " << numEventsAnalyzed_ << std::endl
    << " Events selected = " << numEventsSelected_;
  if ( numEventsAnalyzed_ > 0 ) {
    double eff = numEventsSelected_/(double)numEventsAnalyzed_;
    edm::LogInfo ("") 
      << "Overall efficiency = " << std::setprecision(4) << eff*100. 
      << " +/- " << std::setprecision(4) << TMath::Sqrt(eff*(1 - eff)/numEventsAnalyzed_)*100. << ")%";
  }
}

Member Data Documentation

Definition at line 240 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 243 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 321 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 267 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

std::string EwkMuTauHistManager::dqmDirectory_ [private]

Definition at line 272 of file EwkTauDQM.h.

Referenced by bookHistograms().

Definition at line 269 of file EwkTauDQM.h.

Referenced by bookHistograms().

Definition at line 308 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 314 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 254 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 298 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 281 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 280 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 277 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 278 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 276 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 279 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 301 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 295 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 311 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 289 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 288 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 290 of file EwkTauDQM.h.

Definition at line 284 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 292 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 291 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 285 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 283 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 286 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 287 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 305 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 294 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 296 of file EwkTauDQM.h.

Referenced by bookHistograms(), and fillHistograms().

Definition at line 323 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 260 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 259 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 256 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 261 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 257 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 241 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 258 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager().

Definition at line 318 of file EwkTauDQM.h.

Referenced by fillHistograms(), and finalizeHistograms().

Definition at line 319 of file EwkTauDQM.h.

Referenced by fillHistograms(), and finalizeHistograms().

Definition at line 328 of file EwkTauDQM.h.

Referenced by fillHistograms().

Definition at line 336 of file EwkTauDQM.h.

Referenced by fillHistograms().

Definition at line 326 of file EwkTauDQM.h.

Referenced by fillHistograms().

Definition at line 329 of file EwkTauDQM.h.

Referenced by fillHistograms().

Definition at line 337 of file EwkTauDQM.h.

Referenced by fillHistograms().

Definition at line 335 of file EwkTauDQM.h.

Referenced by fillHistograms().

Definition at line 334 of file EwkTauDQM.h.

Referenced by fillHistograms().

Definition at line 331 of file EwkTauDQM.h.

Referenced by fillHistograms().

Definition at line 332 of file EwkTauDQM.h.

Referenced by fillHistograms().

Definition at line 333 of file EwkTauDQM.h.

Referenced by fillHistograms().

Definition at line 330 of file EwkTauDQM.h.

Referenced by fillHistograms().

Definition at line 325 of file EwkTauDQM.h.

Referenced by fillHistograms().

Definition at line 327 of file EwkTauDQM.h.

Referenced by fillHistograms().

Definition at line 244 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 250 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 249 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager().

Definition at line 246 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 247 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 248 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 263 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 264 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 242 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 238 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 239 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().

Definition at line 266 of file EwkTauDQM.h.

Referenced by EwkMuTauHistManager(), and fillHistograms().