CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
ZCounting Class Reference

#include <ZCounting.h>

Inheritance diagram for ZCounting:
DQMEDAnalyzer edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

enum  MuonIDTypes { NoneID, LooseID, MediumID, TightID }
 
enum  MuonIsoTypes { NoneIso, TrackerIso, PFIso }
 
- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 ZCounting (const edm::ParameterSet &ps)
 
 ~ZCounting () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Member Functions

void analyzeElectrons (edm::Event const &e, edm::EventSetup const &eSetup)
 
void analyzeMuons (edm::Event const &e, edm::EventSetup const &eSetup)
 
bool ele_probe_selection (double pt, double abseta)
 
bool ele_tag_selection (double pt, double abseta)
 
void initHLT (const edm::TriggerResults &, const edm::TriggerNames &)
 
bool isElectronTrigger (ZCountingTrigger::TTrigger triggerMenu, TriggerBits hltBits)
 
bool isElectronTriggerObj (ZCountingTrigger::TTrigger triggerMenu, TriggerObjects hltMatchBits)
 
bool isMuonTrigger (const ZCountingTrigger::TTrigger &triggerMenu, const TriggerBits &hltBits)
 
bool isMuonTriggerObj (const ZCountingTrigger::TTrigger &triggerMenu, const TriggerObjects &hltMatchBits)
 
bool passMuonID (const reco::Muon &muon, const reco::Vertex &vtx, const MuonIDTypes &idType)
 
bool passMuonIso (const reco::Muon &muon, const MuonIsoTypes &isoType, const float isoCut)
 

Private Attributes

const float ELE_ETA_CRACK_HIGH = 1.56
 
const float ELE_ETA_CRACK_LOW = 1.4442
 
const float ELE_ETA_CUT_PROBE
 
const float ELE_ETA_CUT_TAG
 
const std::string ELE_ID_WP
 
const float ELE_MASS_CUT_HIGH
 
const float ELE_MASS_CUT_LOW
 
const float ELE_PT_CUT_PROBE
 
const float ELE_PT_CUT_TAG
 
const float ELECTRON_MASS = 0.000511
 
ElectronIdentifier EleID_
 
double EtaCutL1_
 
double EtaCutL2_
 
edm::InputTag fBeamspotTag
 
edm::EDGetTokenT< reco::BeamSpotfBeamspotToken
 
edm::InputTag fConversionTag
 
edm::EDGetTokenT< reco::ConversionCollectionfConversionToken
 
std::string fElectronName
 
edm::EDGetTokenT< edm::View< reco::GsfElectron > > fGsfElectronName_token
 
edm::InputTag fHLTObjTag
 
edm::EDGetTokenT< trigger::TriggerEventfHLTObjTag_token
 
edm::InputTag fHLTTag
 
edm::EDGetTokenT< edm::TriggerResultsfHLTTag_token
 
std::vector< std::string > fMuonHLTNames
 
std::vector< std::string > fMuonHLTObjectNames
 
std::string fMuonName
 
edm::EDGetTokenT< reco::MuonCollectionfMuonName_token
 
std::string fPVName
 
edm::EDGetTokenT< reco::VertexCollectionfPVName_token
 
edm::InputTag fRhoTag
 
edm::EDGetTokenT< double > fRhoToken
 
std::string fSCName
 
edm::EDGetTokenT< edm::View< reco::SuperCluster > > fSCName_token
 
std::string fTrackName
 
edm::EDGetTokenT< reco::TrackCollectionfTrackName_token
 
std::unique_ptr< ZCountingTrigger::TTriggerfTrigger
 
edm::ParameterSetID fTriggerNamesID
 
MonitorElementh_ee_mass_HLT_fail_central
 
MonitorElementh_ee_mass_HLT_fail_forward
 
MonitorElementh_ee_mass_HLT_pass_central
 
MonitorElementh_ee_mass_HLT_pass_forward
 
MonitorElementh_ee_mass_id_fail_central
 
MonitorElementh_ee_mass_id_fail_forward
 
MonitorElementh_ee_mass_id_pass_central
 
MonitorElementh_ee_mass_id_pass_forward
 
MonitorElementh_ee_yield_Z_ebeb
 
MonitorElementh_ee_yield_Z_ebee
 
MonitorElementh_ee_yield_Z_eeee
 
MonitorElementh_mass_Glo_fail_central
 
MonitorElementh_mass_Glo_fail_forward
 
MonitorElementh_mass_Glo_pass_central
 
MonitorElementh_mass_Glo_pass_forward
 
MonitorElementh_mass_HLT_fail_central
 
MonitorElementh_mass_HLT_fail_forward
 
MonitorElementh_mass_HLT_pass_central
 
MonitorElementh_mass_HLT_pass_forward
 
MonitorElementh_mass_SIT_fail_central
 
MonitorElementh_mass_SIT_fail_forward
 
MonitorElementh_mass_SIT_pass_central
 
MonitorElementh_mass_SIT_pass_forward
 
MonitorElementh_mass_yield_Z
 
MonitorElementh_npv
 
MonitorElementh_npv_yield_Z
 
MonitorElementh_yieldBB_Z
 
MonitorElementh_yieldEE_Z
 
MuonIDTypes IDType_ {NoneID}
 
std::string IDTypestr_
 
double IsoCut_
 
MuonIsoTypes IsoType_ {NoneIso}
 
std::string IsoTypestr_
 
int LumiBin_
 
double LumiMax_
 
double LumiMin_
 
int MassBin_
 
double MassMax_
 
double MassMin_
 
const double MUON_BOUND = 0.9
 
const double MUON_MASS = 0.105658369
 
double PtCutL1_
 
double PtCutL2_
 
int PVBin_
 
double PVMax_
 
double PVMin_
 
double VtxAbsZCut_
 
double VtxNdofCut_
 
double VtxNTracksFitCut_
 
double VtxRhoCut_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 41 of file ZCounting.h.

Member Enumeration Documentation

Enumerator
NoneID 
LooseID 
MediumID 
TightID 

Definition at line 46 of file ZCounting.h.

Enumerator
NoneIso 
TrackerIso 
PFIso 

Definition at line 47 of file ZCounting.h.

Constructor & Destructor Documentation

ZCounting::ZCounting ( const edm::ParameterSet ps)

Definition at line 24 of file ZCounting.cc.

References ELE_ID_WP, EleID_, EtaCutL1_, EtaCutL2_, fBeamspotTag, fBeamspotToken, fConversionTag, fConversionToken, fElectronName, fGsfElectronName_token, fHLTObjTag, fHLTObjTag_token, fHLTTag, fHLTTag_token, fMuonHLTNames, fMuonHLTObjectNames, fMuonName, fMuonName_token, fPVName, fPVName_token, fRhoTag, fRhoToken, fSCName, fSCName_token, fTrackName, fTrackName_token, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), IDType_, IDTypestr_, IsoCut_, IsoType_, IsoTypestr_, LooseID, LumiBin_, LumiMax_, LumiMin_, MassBin_, MassMax_, MassMin_, MediumID, NoneID, NoneIso, PFIso, PtCutL1_, PtCutL2_, PVBin_, PVMax_, PVMin_, ElectronIdentifier::setID(), AlCaHLTBitMon_QueryRunRegistry::string, TightID, TrackerIso, VtxAbsZCut_, VtxNdofCut_, VtxNTracksFitCut_, and VtxRhoCut_.

25  : fHLTObjTag(iConfig.getParameter<edm::InputTag>("TriggerEvent")),
26  fHLTTag(iConfig.getParameter<edm::InputTag>("TriggerResults")),
27  fPVName(iConfig.getUntrackedParameter<std::string>("edmPVName", "offlinePrimaryVertices")),
28  fMuonName(iConfig.getUntrackedParameter<std::string>("edmName", "muons")),
29  fTrackName(iConfig.getUntrackedParameter<std::string>("edmTrackName", "generalTracks")),
30 
31  // Electron-specific Parameters
32  fElectronName(iConfig.getUntrackedParameter<std::string>("edmGsfEleName", "gedGsfElectrons")),
33  fSCName(iConfig.getUntrackedParameter<std::string>("edmSCName", "particleFlowEGamma")),
34 
35  // Electron-specific Tags
36  fRhoTag(iConfig.getParameter<edm::InputTag>("rhoname")),
37  fBeamspotTag(iConfig.getParameter<edm::InputTag>("beamspotName")),
38  fConversionTag(iConfig.getParameter<edm::InputTag>("conversionsName")),
39 
40  // Electron-specific Cuts
41  ELE_PT_CUT_TAG(iConfig.getUntrackedParameter<double>("PtCutEleTag")),
42  ELE_PT_CUT_PROBE(iConfig.getUntrackedParameter<double>("PtCutEleProbe")),
43  ELE_ETA_CUT_TAG(iConfig.getUntrackedParameter<double>("EtaCutEleTag")),
44  ELE_ETA_CUT_PROBE(iConfig.getUntrackedParameter<double>("EtaCutEleProbe")),
45 
46  ELE_MASS_CUT_LOW(iConfig.getUntrackedParameter<double>("MassCutEleLow")),
47  ELE_MASS_CUT_HIGH(iConfig.getUntrackedParameter<double>("MassCutEleHigh")),
48 
49  ELE_ID_WP(iConfig.getUntrackedParameter<std::string>("ElectronIDType", "TIGHT")),
50  EleID_(ElectronIdentifier(iConfig)) {
51  edm::LogInfo("ZCounting") << "Constructor ZCounting::ZCounting " << std::endl;
52 
53  //Get parameters from configuration file
54  fHLTTag_token = consumes<edm::TriggerResults>(fHLTTag);
55  fHLTObjTag_token = consumes<trigger::TriggerEvent>(fHLTObjTag);
56  fPVName_token = consumes<reco::VertexCollection>(fPVName);
57  fMuonName_token = consumes<reco::MuonCollection>(fMuonName);
58  fTrackName_token = consumes<reco::TrackCollection>(fTrackName);
59 
60  // Trigger-specific Parameters
61  fMuonHLTNames = iConfig.getParameter<std::vector<std::string>>("MuonTriggerNames");
62  fMuonHLTObjectNames = iConfig.getParameter<std::vector<std::string>>("MuonTriggerObjectNames");
63  if (fMuonHLTNames.size() != fMuonHLTObjectNames.size()) {
64  edm::LogError("ZCounting") << "List of MuonTriggerNames and MuonTriggerObjectNames has to be the same length"
65  << std::endl;
66  }
67 
68  // Electron-specific parameters
69  fGsfElectronName_token = consumes<edm::View<reco::GsfElectron>>(fElectronName);
70  fSCName_token = consumes<edm::View<reco::SuperCluster>>(fSCName);
71  fRhoToken = consumes<double>(fRhoTag);
72  fBeamspotToken = consumes<reco::BeamSpot>(fBeamspotTag);
73  fConversionToken = consumes<reco::ConversionCollection>(fConversionTag);
74 
75  // Muon-specific Cuts
76  IDTypestr_ = iConfig.getUntrackedParameter<std::string>("IDType");
77  IsoTypestr_ = iConfig.getUntrackedParameter<std::string>("IsoType");
78  IsoCut_ = iConfig.getUntrackedParameter<double>("IsoCut");
79 
80  if (IDTypestr_ == "Loose")
81  IDType_ = LooseID;
82  else if (IDTypestr_ == "Medium")
83  IDType_ = MediumID;
84  else if (IDTypestr_ == "Tight")
85  IDType_ = TightID;
86  else
87  IDType_ = NoneID;
88 
89  if (IsoTypestr_ == "Tracker-based")
91  else if (IsoTypestr_ == "PF-based")
92  IsoType_ = PFIso;
93  else
94  IsoType_ = NoneIso;
95 
96  PtCutL1_ = iConfig.getUntrackedParameter<double>("PtCutL1");
97  PtCutL2_ = iConfig.getUntrackedParameter<double>("PtCutL2");
98  EtaCutL1_ = iConfig.getUntrackedParameter<double>("EtaCutL1");
99  EtaCutL2_ = iConfig.getUntrackedParameter<double>("EtaCutL2");
100 
101  MassBin_ = iConfig.getUntrackedParameter<int>("MassBin");
102  MassMin_ = iConfig.getUntrackedParameter<double>("MassMin");
103  MassMax_ = iConfig.getUntrackedParameter<double>("MassMax");
104 
105  LumiBin_ = iConfig.getUntrackedParameter<int>("LumiBin");
106  LumiMin_ = iConfig.getUntrackedParameter<double>("LumiMin");
107  LumiMax_ = iConfig.getUntrackedParameter<double>("LumiMax");
108 
109  PVBin_ = iConfig.getUntrackedParameter<int>("PVBin");
110  PVMin_ = iConfig.getUntrackedParameter<double>("PVMin");
111  PVMax_ = iConfig.getUntrackedParameter<double>("PVMax");
112 
113  VtxNTracksFitCut_ = iConfig.getUntrackedParameter<double>("VtxNTracksFitMin");
114  VtxNdofCut_ = iConfig.getUntrackedParameter<double>("VtxNdofMin");
115  VtxAbsZCut_ = iConfig.getUntrackedParameter<double>("VtxAbsZMax");
116  VtxRhoCut_ = iConfig.getUntrackedParameter<double>("VtxRhoMax");
117 
119 }
double IsoCut_
Definition: ZCounting.h:113
edm::InputTag fRhoTag
Definition: ZCounting.h:97
edm::InputTag fBeamspotTag
Definition: ZCounting.h:100
double PtCutL1_
Definition: ZCounting.h:115
std::string fPVName
Definition: ZCounting.h:78
double LumiMax_
Definition: ZCounting.h:126
std::string fSCName
Definition: ZCounting.h:94
std::string fTrackName
Definition: ZCounting.h:88
std::vector< std::string > fMuonHLTNames
Definition: ZCounting.h:84
edm::InputTag fHLTObjTag
Definition: ZCounting.h:74
MuonIsoTypes IsoType_
Definition: ZCounting.h:112
edm::EDGetTokenT< edm::View< reco::GsfElectron > > fGsfElectronName_token
Definition: ZCounting.h:93
std::string fMuonName
Definition: ZCounting.h:82
edm::InputTag fConversionTag
Definition: ZCounting.h:103
ElectronIdentifier EleID_
Definition: ZCounting.h:153
const float ELE_ETA_CUT_TAG
Definition: ZCounting.h:144
double LumiMin_
Definition: ZCounting.h:125
edm::InputTag fHLTTag
Definition: ZCounting.h:75
edm::EDGetTokenT< reco::TrackCollection > fTrackName_token
Definition: ZCounting.h:89
std::string IDTypestr_
Definition: ZCounting.h:109
edm::EDGetTokenT< reco::MuonCollection > fMuonName_token
Definition: ZCounting.h:83
double VtxRhoCut_
Definition: ZCounting.h:135
const float ELE_MASS_CUT_HIGH
Definition: ZCounting.h:147
const std::string ELE_ID_WP
Definition: ZCounting.h:149
edm::EDGetTokenT< reco::VertexCollection > fPVName_token
Definition: ZCounting.h:79
int PVBin_
Definition: ZCounting.h:128
const float ELE_PT_CUT_PROBE
Definition: ZCounting.h:143
double VtxNTracksFitCut_
Definition: ZCounting.h:132
double VtxNdofCut_
Definition: ZCounting.h:133
MuonIDTypes IDType_
Definition: ZCounting.h:111
double PtCutL2_
Definition: ZCounting.h:116
const float ELE_MASS_CUT_LOW
Definition: ZCounting.h:146
edm::EDGetTokenT< trigger::TriggerEvent > fHLTObjTag_token
Definition: ZCounting.h:76
const float ELE_ETA_CUT_PROBE
Definition: ZCounting.h:145
int MassBin_
Definition: ZCounting.h:120
edm::EDGetTokenT< reco::ConversionCollection > fConversionToken
Definition: ZCounting.h:104
int LumiBin_
Definition: ZCounting.h:124
edm::EDGetTokenT< edm::TriggerResults > fHLTTag_token
Definition: ZCounting.h:77
std::string fElectronName
Definition: ZCounting.h:92
double EtaCutL1_
Definition: ZCounting.h:117
void setID(std::string ID)
edm::EDGetTokenT< double > fRhoToken
Definition: ZCounting.h:98
std::vector< std::string > fMuonHLTObjectNames
Definition: ZCounting.h:85
double MassMax_
Definition: ZCounting.h:122
double PVMax_
Definition: ZCounting.h:130
double MassMin_
Definition: ZCounting.h:121
edm::EDGetTokenT< reco::BeamSpot > fBeamspotToken
Definition: ZCounting.h:101
const float ELE_PT_CUT_TAG
Definition: ZCounting.h:142
std::string IsoTypestr_
Definition: ZCounting.h:110
edm::EDGetTokenT< edm::View< reco::SuperCluster > > fSCName_token
Definition: ZCounting.h:95
double EtaCutL2_
Definition: ZCounting.h:118
double PVMin_
Definition: ZCounting.h:129
double VtxAbsZCut_
Definition: ZCounting.h:134
ZCounting::~ZCounting ( )
override

Definition at line 124 of file ZCounting.cc.

124 { edm::LogInfo("ZCounting") << "Destructor ZCounting::~ZCounting " << std::endl; }

Member Function Documentation

void ZCounting::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 308 of file ZCounting.cc.

References analyzeMuons().

308  { // Fill event tree on the fly
309  edm::LogInfo("ZCounting") << "ZCounting::analyze" << std::endl;
310  analyzeMuons(iEvent, iSetup);
311  //analyzeElectrons(iEvent, iSetup);
312 }
void analyzeMuons(edm::Event const &e, edm::EventSetup const &eSetup)
Definition: ZCounting.cc:314
int iEvent
Definition: GenABIO.cc:224
void ZCounting::analyzeElectrons ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
private

Fill for ID efficiency

Fill for HLT efficiency

Definition at line 580 of file ZCounting.cc.

References edm::HLTGlobalStatus::accept(), reco::LeafCandidate::charge(), ELE_ETA_CRACK_LOW, ELE_MASS_CUT_HIGH, ELE_MASS_CUT_LOW, ele_probe_selection(), ele_tag_selection(), ELECTRON_MASS, pwdgSkimBPark_cfi::electrons, EleID_, SimCluster::energy(), SimCluster::eta(), reco::LeafCandidate::eta(), HLT_2018_cff::eta1, fBeamspotToken, fConversionToken, fGsfElectronName_token, fHLTObjTag_token, fHLTTag_token, dqm::impl::MonitorElement::Fill(), fPVName_token, fRhoToken, fSCName_token, fTrigger, fTriggerNamesID, edm::Event::getByToken(), h_ee_mass_HLT_fail_central, h_ee_mass_HLT_fail_forward, h_ee_mass_HLT_pass_central, h_ee_mass_HLT_pass_forward, h_ee_mass_id_fail_central, h_ee_mass_id_fail_forward, h_ee_mass_id_pass_central, h_ee_mass_id_pass_forward, h_ee_yield_Z_ebeb, h_ee_yield_Z_ebee, h_ee_yield_Z_eeee, initHLT(), isElectronTrigger(), isElectronTriggerObj(), edm::Ptr< T >::isNonnull(), edm::HandleBase::isValid(), eostools::ls(), edm::EventBase::luminosityBlock(), or, edm::TriggerNames::parameterSetID(), ElectronIdentifier::passID(), SimCluster::phi(), reco::LeafCandidate::phi(), funct::pow(), edm::Handle< T >::product(), DiDispStaMuonMonitor_cfi::pt, reco::LeafCandidate::pt(), HLT_2018_cff::pt1, SimDataFormats::CaloAnalysis::sc, ElectronIdentifier::setRho(), mathSSE::sqrt(), L1TEGammaOffline_cfi::triggerNames, edm::Event::triggerNames(), badGlobalMuonTaggersAOD_cff::vtx, VtxAbsZCut_, VtxNdofCut_, VtxNTracksFitCut_, and VtxRhoCut_.

580  {
581  edm::LogInfo("ZCounting") << "ZCounting::analyzeElectrons" << std::endl;
582 
583  //-------------------------------
584  //--- Vertex
585  //-------------------------------
587  iEvent.getByToken(fPVName_token, hVertexProduct);
588  if (!hVertexProduct.isValid())
589  return;
590 
591  const reco::VertexCollection* pvCol = hVertexProduct.product();
592  int nvtx = 0;
593 
594  for (auto const& vtx : *pvCol) {
595  if (vtx.isFake())
596  continue;
597  if (vtx.tracksSize() < VtxNTracksFitCut_)
598  continue;
599  if (vtx.ndof() < VtxNdofCut_)
600  continue;
601  if (fabs(vtx.z()) > VtxAbsZCut_)
602  continue;
603  if (vtx.position().Rho() > VtxRhoCut_)
604  continue;
605 
606  nvtx++;
607  }
608 
609  // Good vertex requirement
610  if (nvtx == 0)
611  return;
612 
613  //-------------------------------
614  //--- Trigger
615  //-------------------------------
617  iEvent.getByToken(fHLTTag_token, hTrgRes);
618  if (!hTrgRes.isValid())
619  return;
620 
622  iEvent.getByToken(fHLTObjTag_token, hTrgEvt);
623 
624  const edm::TriggerNames& triggerNames = iEvent.triggerNames(*hTrgRes);
625  Bool_t config_changed = false;
626  if (fTriggerNamesID != triggerNames.parameterSetID()) {
627  fTriggerNamesID = triggerNames.parameterSetID();
628  config_changed = true;
629  }
630  if (config_changed) {
631  initHLT(*hTrgRes, triggerNames);
632  }
633 
634  TriggerBits triggerBits;
635  for (unsigned int irec = 0; irec < fTrigger->fRecords.size(); irec++) {
636  if (fTrigger->fRecords[irec].hltPathIndex == (unsigned int)-1)
637  continue;
638  if (hTrgRes->accept(fTrigger->fRecords[irec].hltPathIndex)) {
639  triggerBits[fTrigger->fRecords[irec].baconTrigBit] = true;
640  }
641  }
642 
643  // Trigger requirement
644  if (!isElectronTrigger(*fTrigger, triggerBits))
645  return;
646 
647  // Get Electrons
649  iEvent.getByToken(fGsfElectronName_token, electrons);
650 
651  // Get SuperClusters
653  iEvent.getByToken(fSCName_token, superclusters);
654 
655  // Get Rho
656  edm::Handle<double> rhoHandle;
657  iEvent.getByToken(fRhoToken, rhoHandle);
658  EleID_.setRho(*rhoHandle);
659 
660  // Get beamspot
661  edm::Handle<reco::BeamSpot> beamspotHandle;
662  iEvent.getByToken(fBeamspotToken, beamspotHandle);
663 
664  // Conversions
665  edm::Handle<reco::ConversionCollection> conversionsHandle;
666  iEvent.getByToken(fConversionToken, conversionsHandle);
667 
669  enum { eEleEle2HLT = 1, eEleEle1HLT1L1, eEleEle1HLT, eEleEleNoSel, eEleSC }; // event category enum
670 
671  // Loop over Tags
672  for (size_t itag = 0; itag < electrons->size(); ++itag) {
673  const auto el1 = electrons->ptrAt(itag);
674  if (not EleID_.passID(el1, beamspotHandle, conversionsHandle))
675  continue;
676 
677  float pt1 = el1->pt();
678  float eta1 = el1->eta();
679  float phi1 = el1->phi();
680 
681  if (!isElectronTriggerObj(*fTrigger, TriggerTools::matchHLT(eta1, phi1, fTrigger->fRecords, *hTrgEvt)))
682  continue;
683  TLorentzVector vTag(0., 0., 0., 0.);
684  vTag.SetPtEtaPhiM(pt1, eta1, phi1, ELECTRON_MASS);
685 
686  // Tag selection: kinematic cuts, lepton selection and trigger matching
687  double tag_pt = vTag.Pt();
688  double tag_abseta = fabs(vTag.Eta());
689 
690  bool tag_is_valid_tag = ele_tag_selection(tag_pt, tag_abseta);
691  bool tag_is_valid_probe = ele_probe_selection(tag_pt, tag_abseta);
692 
693  if (not(tag_is_valid_tag or tag_is_valid_probe))
694  continue;
695 
696  // Loop over probes
697  for (size_t iprobe = 0; iprobe < superclusters->size(); ++iprobe) {
698  // Initialize probe
699  const auto sc = superclusters->ptrAt(iprobe);
700  if (*sc == *(el1->superCluster())) {
701  continue;
702  }
703 
704  // Find matching electron
705  for (size_t iele = 0; iele < electrons->size(); ++iele) {
706  if (iele == itag)
707  continue;
708  const auto ele = electrons->ptrAt(iele);
709  if (*sc == *(ele->superCluster())) {
710  eleProbe = ele;
711  break;
712  }
713  }
714 
715  // Assign final probe 4-vector
716  TLorentzVector vProbe(0., 0., 0., 0.);
717  if (eleProbe.isNonnull()) {
718  vProbe.SetPtEtaPhiM(eleProbe->pt(), eleProbe->eta(), eleProbe->phi(), ELECTRON_MASS);
719  } else {
720  double pt = sc->energy() * sqrt(1 - pow(tanh(sc->eta()), 2));
721  vProbe.SetPtEtaPhiM(pt, sc->eta(), sc->phi(), ELECTRON_MASS);
722  }
723 
724  // Probe Selection
725  double probe_pt = vProbe.Pt();
726  double probe_abseta = fabs(sc->eta());
727  bool probe_is_valid_probe = ele_probe_selection(probe_pt, probe_abseta);
728  if (!probe_is_valid_probe)
729  continue;
730 
731  // Good Probe found!
732 
733  // Require good Z
734  TLorentzVector vDilep = vTag + vProbe;
735 
736  if ((vDilep.M() < ELE_MASS_CUT_LOW) || (vDilep.M() > ELE_MASS_CUT_HIGH))
737  continue;
738  if (eleProbe.isNonnull() and (eleProbe->charge() != -el1->charge()))
739  continue;
740 
741  // Good Z found!
742 
743  long ls = iEvent.luminosityBlock();
744  bool probe_pass_trigger = isElectronTriggerObj(
745  *fTrigger, TriggerTools::matchHLT(vProbe.Eta(), vProbe.Phi(), fTrigger->fRecords, *hTrgEvt));
746  bool probe_pass_id = eleProbe.isNonnull() and EleID_.passID(eleProbe, beamspotHandle, conversionsHandle);
747 
749  bool probe_is_forward = probe_abseta > ELE_ETA_CRACK_LOW;
750  bool tag_is_forward = tag_abseta > ELE_ETA_CRACK_LOW;
751 
752  if (probe_pass_id) {
753  if (probe_is_forward and tag_is_forward) {
754  h_ee_yield_Z_eeee->Fill(ls);
755  } else if (!probe_is_forward and !tag_is_forward) {
756  h_ee_yield_Z_ebeb->Fill(ls);
757  } else {
758  h_ee_yield_Z_ebee->Fill(ls);
759  }
760  }
761 
762  if (!tag_is_valid_tag)
763  continue;
764 
766  if (probe_pass_id) {
767  if (probe_is_forward) {
768  h_ee_mass_id_pass_forward->Fill(ls, vDilep.M());
769  } else {
770  h_ee_mass_id_pass_central->Fill(ls, vDilep.M());
771  }
772  } else {
773  if (probe_is_forward) {
774  h_ee_mass_id_fail_forward->Fill(ls, vDilep.M());
775  } else {
776  h_ee_mass_id_fail_central->Fill(ls, vDilep.M());
777  }
778  }
779 
781  if (probe_pass_id and probe_pass_trigger) {
782  if (probe_is_forward) {
783  h_ee_mass_HLT_pass_forward->Fill(ls, vDilep.M());
784  } else {
785  h_ee_mass_HLT_pass_central->Fill(ls, vDilep.M());
786  }
787  } else if (probe_pass_id) {
788  if (probe_is_forward) {
789  h_ee_mass_HLT_fail_forward->Fill(ls, vDilep.M());
790  } else {
791  h_ee_mass_HLT_fail_central->Fill(ls, vDilep.M());
792  }
793  }
794  } // End of probe loop
795  } //End of tag loop
796 }
bool isElectronTrigger(ZCountingTrigger::TTrigger triggerMenu, TriggerBits hltBits)
Definition: ZCounting.cc:903
double eta() const final
momentum pseudorapidity
float phi() const
Momentum azimuthal angle. Note this is taken from the first SimTrack only.
Definition: SimCluster.h:140
bool accept() const
Has at least one path accepted the event?
double pt() const final
transverse momentum
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
int charge() const final
electric charge
edm::EDGetTokenT< edm::View< reco::GsfElectron > > fGsfElectronName_token
Definition: ZCounting.h:93
bool isElectronTriggerObj(ZCountingTrigger::TTrigger triggerMenu, TriggerObjects hltMatchBits)
Definition: ZCounting.cc:907
ElectronIdentifier EleID_
Definition: ZCounting.h:153
MonitorElement * h_ee_mass_HLT_fail_central
Definition: ZCounting.h:184
MonitorElement * h_ee_mass_HLT_pass_forward
Definition: ZCounting.h:185
ParameterSetID const & parameterSetID() const
Definition: TriggerNames.cc:33
void Fill(long long x)
double VtxRhoCut_
Definition: ZCounting.h:135
int iEvent
Definition: GenABIO.cc:224
edm::ParameterSetID fTriggerNamesID
Definition: ZCounting.h:73
const float ELE_MASS_CUT_HIGH
Definition: ZCounting.h:147
edm::EDGetTokenT< reco::VertexCollection > fPVName_token
Definition: ZCounting.h:79
T sqrt(T t)
Definition: SSEVec.h:19
std::bitset< kNTrigBit > TriggerBits
Definition: TriggerDefs.h:7
double VtxNTracksFitCut_
Definition: ZCounting.h:132
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
bool passID(const reco::GsfElectronPtr &ele, edm::Handle< reco::BeamSpot > beamspot, edm::Handle< reco::ConversionCollection > conversions)
void initHLT(const edm::TriggerResults &, const edm::TriggerNames &)
Definition: ZCounting.cc:820
float energy() const
Energy. Note this is taken from the first SimTrack only.
Definition: SimCluster.h:104
MonitorElement * h_ee_yield_Z_eeee
Definition: ZCounting.h:190
MonitorElement * h_ee_yield_Z_ebee
Definition: ZCounting.h:189
double VtxNdofCut_
Definition: ZCounting.h:133
MonitorElement * h_ee_mass_HLT_fail_forward
Definition: ZCounting.h:186
bool isValid() const
Definition: HandleBase.h:70
bool ele_tag_selection(double pt, double abseta)
Definition: ZCounting.cc:807
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
const float ELE_MASS_CUT_LOW
Definition: ZCounting.h:146
const float ELE_ETA_CRACK_LOW
Definition: ZCounting.h:150
edm::EDGetTokenT< trigger::TriggerEvent > fHLTObjTag_token
Definition: ZCounting.h:76
MonitorElement * h_ee_mass_id_pass_forward
Definition: ZCounting.h:180
MonitorElement * h_ee_mass_HLT_pass_central
Definition: ZCounting.h:183
def ls(path, rec=False)
Definition: eostools.py:349
void setRho(double rho)
T const * product() const
Definition: Handle.h:69
MonitorElement * h_ee_yield_Z_ebeb
Definition: ZCounting.h:188
edm::EDGetTokenT< reco::ConversionCollection > fConversionToken
Definition: ZCounting.h:104
edm::EDGetTokenT< edm::TriggerResults > fHLTTag_token
Definition: ZCounting.h:77
bool ele_probe_selection(double pt, double abseta)
Definition: ZCounting.cc:798
MonitorElement * h_ee_mass_id_pass_central
Definition: ZCounting.h:178
MonitorElement * h_ee_mass_id_fail_forward
Definition: ZCounting.h:181
edm::EDGetTokenT< double > fRhoToken
Definition: ZCounting.h:98
MonitorElement * h_ee_mass_id_fail_central
Definition: ZCounting.h:179
const float ELECTRON_MASS
Definition: ZCounting.h:140
edm::EDGetTokenT< reco::BeamSpot > fBeamspotToken
Definition: ZCounting.h:101
std::unique_ptr< ZCountingTrigger::TTrigger > fTrigger
Definition: ZCounting.h:107
double phi() const final
momentum azimuthal angle
edm::EDGetTokenT< edm::View< reco::SuperCluster > > fSCName_token
Definition: ZCounting.h:95
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
double VtxAbsZCut_
Definition: ZCounting.h:134
float eta() const
Momentum pseudorapidity. Note this is taken from the simtrack before the calorimeter.
Definition: SimCluster.h:148
void ZCounting::analyzeMuons ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
private

Definition at line 314 of file ZCounting.cc.

References edm::HLTGlobalStatus::accept(), HLT_2018_cff::eta1, HLT_2018_cff::eta2, EtaCutL1_, EtaCutL2_, fHLTObjTag_token, fHLTTag_token, dqm::impl::MonitorElement::Fill(), fMuonName_token, fPVName_token, fTrackName_token, fTrigger, fTriggerNamesID, edm::Event::getByToken(), h_mass_Glo_fail_central, h_mass_Glo_fail_forward, h_mass_Glo_pass_central, h_mass_Glo_pass_forward, h_mass_HLT_fail_central, h_mass_HLT_fail_forward, h_mass_HLT_pass_central, h_mass_HLT_pass_forward, h_mass_SIT_fail_central, h_mass_SIT_fail_forward, h_mass_SIT_pass_central, h_mass_SIT_pass_forward, h_mass_yield_Z, h_npv, h_npv_yield_Z, h_yieldBB_Z, h_yieldEE_Z, IDType_, initHLT(), reco::isMuon(), isMuonTrigger(), isMuonTriggerObj(), IsoCut_, IsoType_, edm::HandleBase::isValid(), edm::EventBase::luminosityBlock(), MassMax_, MassMin_, MUON_BOUND, MUON_MASS, edm::TriggerNames::parameterSetID(), passMuonID(), passMuonIso(), edm::Handle< T >::product(), HLT_2018_cff::pt1, HLT_2018_cff::pt2, PtCutL1_, PtCutL2_, MetAnalyzer::pv(), q1, q2, L1TEGammaOffline_cfi::triggerNames, edm::Event::triggerNames(), VtxAbsZCut_, VtxNdofCut_, VtxNTracksFitCut_, and VtxRhoCut_.

Referenced by analyze().

314  {
315  edm::LogInfo("ZCounting") << "ZCounting::analyzeMuons" << std::endl;
316  //-------------------------------
317  //--- Vertex
318  //-------------------------------
320  iEvent.getByToken(fPVName_token, hVertexProduct);
321  if (!hVertexProduct.isValid()) {
322  edm::LogWarning("ZCounting") << "ZCounting::analyzeMuons - no valid primary vertex product found" << std::endl;
323  return;
324  }
325  const reco::VertexCollection* pvCol = hVertexProduct.product();
326  const reco::Vertex* pv = &(*pvCol->begin());
327  int nvtx = 0;
328 
329  for (auto const& itVtx : *hVertexProduct) {
330  if (itVtx.isFake())
331  continue;
332  if (itVtx.tracksSize() < VtxNTracksFitCut_)
333  continue;
334  if (itVtx.ndof() < VtxNdofCut_)
335  continue;
336  if (fabs(itVtx.z()) > VtxAbsZCut_)
337  continue;
338  if (itVtx.position().Rho() > VtxRhoCut_)
339  continue;
340 
341  if (nvtx == 0) {
342  pv = &itVtx;
343  }
344  nvtx++;
345  }
346 
347  h_npv->Fill(iEvent.luminosityBlock(), nvtx);
348 
349  // Good vertex requirement
350  if (nvtx == 0)
351  return;
352 
353  //-------------------------------
354  //--- Trigger
355  //-------------------------------
357  iEvent.getByToken(fHLTTag_token, hTrgRes);
358  if (!hTrgRes.isValid())
359  return;
360 
362  iEvent.getByToken(fHLTObjTag_token, hTrgEvt);
363 
364  const edm::TriggerNames& triggerNames = iEvent.triggerNames(*hTrgRes);
365  bool config_changed = false;
366  if (fTriggerNamesID != triggerNames.parameterSetID()) {
367  fTriggerNamesID = triggerNames.parameterSetID();
368  config_changed = true;
369  }
370  if (config_changed) {
371  initHLT(*hTrgRes, triggerNames);
372  }
373 
374  TriggerBits triggerBits;
375  for (unsigned int irec = 0; irec < fTrigger->fRecords.size(); irec++) {
376  if (fTrigger->fRecords[irec].hltPathIndex == (unsigned int)-1)
377  continue;
378  if (hTrgRes->accept(fTrigger->fRecords[irec].hltPathIndex)) {
379  triggerBits[fTrigger->fRecords[irec].baconTrigBit] = true;
380  }
381  }
382  //if(fSkipOnHLTFail && triggerBits == 0) return;
383 
384  // Trigger requirement
385  if (!isMuonTrigger(*fTrigger, triggerBits))
386  return;
387 
388  //-------------------------------
389  //--- Muons and Tracks
390  //-------------------------------
392  iEvent.getByToken(fMuonName_token, hMuonProduct);
393  if (!hMuonProduct.isValid())
394  return;
395 
397  iEvent.getByToken(fTrackName_token, hTrackProduct);
398  if (!hTrackProduct.isValid())
399  return;
400 
401  TLorentzVector vTag(0., 0., 0., 0.);
402  TLorentzVector vProbe(0., 0., 0., 0.);
403  TLorentzVector vTrack(0., 0., 0., 0.);
404 
405  // Tag loop
406  for (auto const& itMu1 : *hMuonProduct) {
407  float pt1 = itMu1.muonBestTrack()->pt();
408  float eta1 = itMu1.muonBestTrack()->eta();
409  float phi1 = itMu1.muonBestTrack()->phi();
410  float q1 = itMu1.muonBestTrack()->charge();
411 
412  // Tag selection: kinematic cuts, lepton selection and trigger matching
413  if (pt1 < PtCutL1_)
414  continue;
415  if (fabs(eta1) > EtaCutL1_)
416  continue;
417  if (!(passMuonID(itMu1, *pv, IDType_) && passMuonIso(itMu1, IsoType_, IsoCut_)))
418  continue;
419  if (!isMuonTriggerObj(*fTrigger, TriggerTools::matchHLT(eta1, phi1, fTrigger->fRecords, *hTrgEvt)))
420  continue;
421 
422  vTag.SetPtEtaPhiM(pt1, eta1, phi1, MUON_MASS);
423 
424  // Probe loop over muons
425  for (auto const& itMu2 : *hMuonProduct) {
426  if (&itMu2 == &itMu1)
427  continue;
428 
429  float pt2 = itMu2.muonBestTrack()->pt();
430  float eta2 = itMu2.muonBestTrack()->eta();
431  float phi2 = itMu2.muonBestTrack()->phi();
432  float q2 = itMu2.muonBestTrack()->charge();
433 
434  // Probe selection: kinematic cuts and opposite charge requirement
435  if (pt2 < PtCutL2_)
436  continue;
437  if (fabs(eta2) > EtaCutL2_)
438  continue;
439  if (q1 == q2)
440  continue;
441 
442  vProbe.SetPtEtaPhiM(pt2, eta2, phi2, MUON_MASS);
443 
444  // Mass window
445  TLorentzVector vDilep = vTag + vProbe;
446  float dilepMass = vDilep.M();
447  if ((dilepMass < MassMin_) || (dilepMass > MassMax_))
448  continue;
449 
450  bool isTagCentral = false;
451  bool isProbeCentral = false;
452  if (fabs(eta1) < MUON_BOUND)
453  isTagCentral = true;
454  if (fabs(eta2) < MUON_BOUND)
455  isProbeCentral = true;
456 
457  // Determine event category for efficiency calculation
458  if (passMuonID(itMu2, *pv, IDType_) && passMuonIso(itMu2, IsoType_, IsoCut_)) {
459  if (isMuonTriggerObj(*fTrigger, TriggerTools::matchHLT(eta2, phi2, fTrigger->fRecords, *hTrgEvt))) {
460  // category 2HLT: both muons passing trigger requirements
461  if (&itMu1 > &itMu2)
462  continue; // make sure we don't double count MuMu2HLT category
463 
464  // Fill twice for each event, since both muons pass trigger
465  if (isTagCentral) {
466  h_mass_HLT_pass_central->Fill(iEvent.luminosityBlock(), dilepMass);
467  h_mass_SIT_pass_central->Fill(iEvent.luminosityBlock(), dilepMass);
468  h_mass_Glo_pass_central->Fill(iEvent.luminosityBlock(), dilepMass);
469  } else {
470  h_mass_HLT_pass_forward->Fill(iEvent.luminosityBlock(), dilepMass);
471  h_mass_SIT_pass_forward->Fill(iEvent.luminosityBlock(), dilepMass);
472  h_mass_Glo_pass_forward->Fill(iEvent.luminosityBlock(), dilepMass);
473  }
474 
475  if (isProbeCentral) {
476  h_mass_HLT_pass_central->Fill(iEvent.luminosityBlock(), dilepMass);
477  h_mass_SIT_pass_central->Fill(iEvent.luminosityBlock(), dilepMass);
478  h_mass_Glo_pass_central->Fill(iEvent.luminosityBlock(), dilepMass);
479  } else {
480  h_mass_HLT_pass_forward->Fill(iEvent.luminosityBlock(), dilepMass);
481  h_mass_SIT_pass_forward->Fill(iEvent.luminosityBlock(), dilepMass);
482  h_mass_Glo_pass_forward->Fill(iEvent.luminosityBlock(), dilepMass);
483  }
484 
485  } else {
486  // category 1HLT: probe passing selection but not trigger
487  if (isProbeCentral) {
488  h_mass_HLT_fail_central->Fill(iEvent.luminosityBlock(), dilepMass);
489  h_mass_SIT_pass_central->Fill(iEvent.luminosityBlock(), dilepMass);
490  h_mass_Glo_pass_central->Fill(iEvent.luminosityBlock(), dilepMass);
491  } else {
492  h_mass_HLT_fail_forward->Fill(iEvent.luminosityBlock(), dilepMass);
493  h_mass_SIT_pass_forward->Fill(iEvent.luminosityBlock(), dilepMass);
494  h_mass_Glo_pass_forward->Fill(iEvent.luminosityBlock(), dilepMass);
495  }
496  }
497  // category 2HLT + 1HLT: Fill once for Z yield
498  h_npv_yield_Z->Fill(iEvent.luminosityBlock(), nvtx);
499  h_mass_yield_Z->Fill(iEvent.luminosityBlock(), dilepMass);
500  if (isTagCentral && isProbeCentral)
501  h_yieldBB_Z->Fill(iEvent.luminosityBlock());
502  else if (!isTagCentral && !isProbeCentral)
503  h_yieldEE_Z->Fill(iEvent.luminosityBlock());
504  } else if (itMu2.isGlobalMuon()) {
505  // category Glo: probe is a Global muon but failing selection
506  if (isProbeCentral) {
507  h_mass_SIT_fail_central->Fill(iEvent.luminosityBlock(), dilepMass);
508  h_mass_Glo_pass_central->Fill(iEvent.luminosityBlock(), dilepMass);
509  } else {
510  h_mass_SIT_fail_forward->Fill(iEvent.luminosityBlock(), dilepMass);
511  h_mass_Glo_pass_forward->Fill(iEvent.luminosityBlock(), dilepMass);
512  }
513  } else if (itMu2.isStandAloneMuon()) {
514  // category Sta: probe is a Standalone muon
515  if (isProbeCentral) {
516  h_mass_Glo_fail_central->Fill(iEvent.luminosityBlock(), dilepMass);
517  } else {
518  h_mass_Glo_fail_forward->Fill(iEvent.luminosityBlock(), dilepMass);
519  }
520  } else if (itMu2.innerTrack()->hitPattern().trackerLayersWithMeasurement() >= 6 &&
521  itMu2.innerTrack()->hitPattern().numberOfValidPixelHits() >= 1) {
522  // cateogry Trk: probe is a tracker track
523  if (isProbeCentral) {
524  h_mass_Glo_fail_central->Fill(iEvent.luminosityBlock(), dilepMass);
525  } else {
526  h_mass_Glo_fail_forward->Fill(iEvent.luminosityBlock(), dilepMass);
527  }
528  }
529 
530  } // End of probe loop over muons
531 
532  // Probe loop over tracks, only for standalone efficiency calculation
533  for (auto const& itTrk : *hTrackProduct) {
534  // Check track is not a muon
535  bool isMuon = false;
536  for (auto const& itMu : *hMuonProduct) {
537  if (itMu.innerTrack().isNonnull() && itMu.innerTrack().get() == &itTrk) {
538  isMuon = true;
539  break;
540  }
541  }
542  if (isMuon)
543  continue;
544 
545  float pt2 = itTrk.pt();
546  float eta2 = itTrk.eta();
547  float phi2 = itTrk.phi();
548  float q2 = itTrk.charge();
549 
550  // Probe selection: kinematic cuts and opposite charge requirement
551  if (pt2 < PtCutL2_)
552  continue;
553  if (fabs(eta2) > EtaCutL2_)
554  continue;
555  if (q1 == q2)
556  continue;
557 
558  vTrack.SetPtEtaPhiM(pt2, eta2, phi2, MUON_MASS);
559 
560  TLorentzVector vDilep = vTag + vTrack;
561  float dilepMass = vDilep.M();
562  if ((dilepMass < MassMin_) || (dilepMass > MassMax_))
563  continue;
564 
565  bool isTrackCentral = false;
566  if (fabs(eta2) > MUON_BOUND)
567  isTrackCentral = true;
568 
569  if (itTrk.hitPattern().trackerLayersWithMeasurement() >= 6 && itTrk.hitPattern().numberOfValidPixelHits() >= 1) {
570  if (isTrackCentral)
571  h_mass_Glo_fail_central->Fill(iEvent.luminosityBlock(), dilepMass);
572  else
573  h_mass_Glo_fail_forward->Fill(iEvent.luminosityBlock(), dilepMass);
574  }
575 
576  } //End of probe loop over tracks
577 
578  } //End of tag loop
579 }
MonitorElement * h_mass_Glo_pass_forward
Definition: ZCounting.h:167
MonitorElement * h_mass_Glo_fail_forward
Definition: ZCounting.h:169
double IsoCut_
Definition: ZCounting.h:113
MonitorElement * h_mass_SIT_fail_central
Definition: ZCounting.h:163
double PtCutL1_
Definition: ZCounting.h:115
bool isMuon(const Candidate &part)
Definition: pdgIdUtils.h:9
MonitorElement * h_mass_SIT_pass_forward
Definition: ZCounting.h:162
bool accept() const
Has at least one path accepted the event?
MuonIsoTypes IsoType_
Definition: ZCounting.h:112
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
bool passMuonID(const reco::Muon &muon, const reco::Vertex &vtx, const MuonIDTypes &idType)
Definition: ZCounting.cc:866
MonitorElement * h_mass_HLT_pass_forward
Definition: ZCounting.h:157
MonitorElement * h_mass_yield_Z
Definition: ZCounting.h:173
MonitorElement * h_mass_Glo_pass_central
Definition: ZCounting.h:166
double q2[4]
Definition: TauolaWrapper.h:88
ParameterSetID const & parameterSetID() const
Definition: TriggerNames.cc:33
edm::EDGetTokenT< reco::TrackCollection > fTrackName_token
Definition: ZCounting.h:89
void Fill(long long x)
const double MUON_MASS
Definition: ZCounting.h:137
edm::EDGetTokenT< reco::MuonCollection > fMuonName_token
Definition: ZCounting.h:83
double VtxRhoCut_
Definition: ZCounting.h:135
int iEvent
Definition: GenABIO.cc:224
edm::ParameterSetID fTriggerNamesID
Definition: ZCounting.h:73
edm::EDGetTokenT< reco::VertexCollection > fPVName_token
Definition: ZCounting.h:79
MonitorElement * h_yieldEE_Z
Definition: ZCounting.h:175
std::bitset< kNTrigBit > TriggerBits
Definition: TriggerDefs.h:7
double VtxNTracksFitCut_
Definition: ZCounting.h:132
MonitorElement * h_npv_yield_Z
Definition: ZCounting.h:172
bool isMuonTrigger(const ZCountingTrigger::TTrigger &triggerMenu, const TriggerBits &hltBits)
Definition: ZCounting.cc:848
void initHLT(const edm::TriggerResults &, const edm::TriggerNames &)
Definition: ZCounting.cc:820
def pv(vc)
Definition: MetAnalyzer.py:7
double VtxNdofCut_
Definition: ZCounting.h:133
bool isValid() const
Definition: HandleBase.h:70
MuonIDTypes IDType_
Definition: ZCounting.h:111
MonitorElement * h_npv
Definition: ZCounting.h:171
double PtCutL2_
Definition: ZCounting.h:116
const double MUON_BOUND
Definition: ZCounting.h:138
edm::EDGetTokenT< trigger::TriggerEvent > fHLTObjTag_token
Definition: ZCounting.h:76
MonitorElement * h_mass_SIT_fail_forward
Definition: ZCounting.h:164
T const * product() const
Definition: Handle.h:69
double q1[4]
Definition: TauolaWrapper.h:87
MonitorElement * h_mass_HLT_pass_central
Definition: ZCounting.h:156
edm::EDGetTokenT< edm::TriggerResults > fHLTTag_token
Definition: ZCounting.h:77
MonitorElement * h_mass_HLT_fail_forward
Definition: ZCounting.h:159
double EtaCutL1_
Definition: ZCounting.h:117
bool passMuonIso(const reco::Muon &muon, const MuonIsoTypes &isoType, const float isoCut)
Definition: ZCounting.cc:883
MonitorElement * h_yieldBB_Z
Definition: ZCounting.h:174
double MassMax_
Definition: ZCounting.h:122
MonitorElement * h_mass_Glo_fail_central
Definition: ZCounting.h:168
double MassMin_
Definition: ZCounting.h:121
MonitorElement * h_mass_SIT_pass_central
Definition: ZCounting.h:161
std::unique_ptr< ZCountingTrigger::TTrigger > fTrigger
Definition: ZCounting.h:107
double EtaCutL2_
Definition: ZCounting.h:118
MonitorElement * h_mass_HLT_fail_central
Definition: ZCounting.h:158
bool isMuonTriggerObj(const ZCountingTrigger::TTrigger &triggerMenu, const TriggerObjects &hltMatchBits)
Definition: ZCounting.cc:857
double VtxAbsZCut_
Definition: ZCounting.h:134
void ZCounting::bookHistograms ( DQMStore::IBooker ibooker_,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 138 of file ZCounting.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), dqm::dqmstoreimpl::DQMStore::IBooker::cd(), h_mass_Glo_fail_central, h_mass_Glo_fail_forward, h_mass_Glo_pass_central, h_mass_Glo_pass_forward, h_mass_HLT_fail_central, h_mass_HLT_fail_forward, h_mass_HLT_pass_central, h_mass_HLT_pass_forward, h_mass_SIT_fail_central, h_mass_SIT_fail_forward, h_mass_SIT_pass_central, h_mass_SIT_pass_forward, h_mass_yield_Z, h_npv, h_npv_yield_Z, h_yieldBB_Z, h_yieldEE_Z, LumiBin_, LumiMax_, LumiMin_, MassBin_, MassMax_, MassMin_, PVBin_, PVMax_, PVMin_, dqm::impl::MonitorElement::setAxisTitle(), and dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder().

138  {
139  edm::LogInfo("ZCounting") << "ZCounting::bookHistograms" << std::endl;
140  ibooker_.cd();
141  ibooker_.setCurrentFolder("ZCounting/Histograms");
142 
143  // Muon histograms
144  h_mass_HLT_pass_central = ibooker_.book2D("h_mass_HLT_pass_central",
145  "Muon HLT passing probes central",
146  LumiBin_,
147  LumiMin_,
148  LumiMax_,
149  MassBin_,
150  MassMin_,
151  MassMax_);
152  h_mass_HLT_pass_forward = ibooker_.book2D("h_mass_HLT_pass_forward",
153  "Muon HLT passing probes forward",
154  LumiBin_,
155  LumiMin_,
156  LumiMax_,
157  MassBin_,
158  MassMin_,
159  MassMax_);
160  h_mass_HLT_fail_central = ibooker_.book2D("h_mass_HLT_fail_central",
161  "Muon HLT failing probes central",
162  LumiBin_,
163  LumiMin_,
164  LumiMax_,
165  MassBin_,
166  MassMin_,
167  MassMax_);
168  h_mass_HLT_fail_forward = ibooker_.book2D("h_mass_HLT_fail_forward",
169  "Muon HLT failing probes forward",
170  LumiBin_,
171  LumiMin_,
172  LumiMax_,
173  MassBin_,
174  MassMin_,
175  MassMax_);
176 
177  h_mass_SIT_pass_central = ibooker_.book2D("h_mass_SIT_pass_central",
178  "Muon SIT passing probes central",
179  LumiBin_,
180  LumiMin_,
181  LumiMax_,
182  MassBin_,
183  MassMin_,
184  MassMax_);
185  h_mass_SIT_pass_forward = ibooker_.book2D("h_mass_SIT_pass_forward",
186  "Muon SIT passing probes forward",
187  LumiBin_,
188  LumiMin_,
189  LumiMax_,
190  MassBin_,
191  MassMin_,
192  MassMax_);
193  h_mass_SIT_fail_central = ibooker_.book2D("h_mass_SIT_fail_central",
194  "Muon SIT_failing probes central",
195  LumiBin_,
196  LumiMin_,
197  LumiMax_,
198  MassBin_,
199  MassMin_,
200  MassMax_);
201  h_mass_SIT_fail_forward = ibooker_.book2D("h_mass_SIT_fail_forward",
202  "Muon SIT failing probes forward",
203  LumiBin_,
204  LumiMin_,
205  LumiMax_,
206  MassBin_,
207  MassMin_,
208  MassMax_);
209 
210  h_mass_Glo_pass_central = ibooker_.book2D("h_mass_Glo_pass_central",
211  "Muon Glo passing probes central",
212  LumiBin_,
213  LumiMin_,
214  LumiMax_,
215  MassBin_,
216  MassMin_,
217  MassMax_);
218  h_mass_Glo_pass_forward = ibooker_.book2D("h_mass_Glo_pass_forward",
219  "Muon Glo passing probes forward",
220  LumiBin_,
221  LumiMin_,
222  LumiMax_,
223  MassBin_,
224  MassMin_,
225  MassMax_);
226  h_mass_Glo_fail_central = ibooker_.book2D("h_mass_Glo_fail_central",
227  "Muon Glo failing probes central",
228  LumiBin_,
229  LumiMin_,
230  LumiMax_,
231  MassBin_,
232  MassMin_,
233  MassMax_);
234  h_mass_Glo_fail_forward = ibooker_.book2D("h_mass_Glo_fail_forward",
235  "Muon Glo failing probes forward",
236  LumiBin_,
237  LumiMin_,
238  LumiMax_,
239  MassBin_,
240  MassMin_,
241  MassMax_);
242 
243  h_npv = ibooker_.book2D(
244  "h_npv", "Events with valid primary vertex", LumiBin_, LumiMin_, LumiMax_, PVBin_, PVMin_, PVMax_);
245  h_mass_yield_Z = ibooker_.book2D(
246  "h_mass_yield_Z", "reconstructed Z bosons", LumiBin_, LumiMin_, LumiMax_, MassBin_, MassMin_, MassMax_);
247  h_npv_yield_Z =
248  ibooker_.book2D("h_npv_yield_Z", "reconstructed Z bosons", LumiBin_, LumiMin_, LumiMax_, PVBin_, PVMin_, PVMax_);
249  h_yieldBB_Z = ibooker_.book1D("h_yieldBB_Z", "reconstructed Z bosons in barrel", LumiBin_, LumiMin_, LumiMax_);
250  h_yieldEE_Z = ibooker_.book1D("h_yieldEE_Z", "reconstructed Z bosons in endcap", LumiBin_, LumiMin_, LumiMax_);
251 
252  // Axis titles
253  h_mass_HLT_pass_central->setAxisTitle("luminosiry section", 1);
254  h_mass_HLT_pass_forward->setAxisTitle("luminosiry section", 1);
255  h_mass_HLT_fail_central->setAxisTitle("luminosiry section", 1);
256  h_mass_HLT_fail_forward->setAxisTitle("luminosiry section", 1);
257  h_mass_SIT_pass_central->setAxisTitle("luminosiry section", 1);
258  h_mass_SIT_pass_forward->setAxisTitle("luminosiry section", 1);
259  h_mass_SIT_fail_central->setAxisTitle("luminosiry section", 1);
260  h_mass_SIT_fail_forward->setAxisTitle("luminosiry section", 1);
261  h_mass_Glo_pass_central->setAxisTitle("luminosiry section", 1);
262  h_mass_Glo_pass_forward->setAxisTitle("luminosiry section", 1);
263  h_mass_Glo_fail_central->setAxisTitle("luminosiry section", 1);
264  h_mass_Glo_fail_forward->setAxisTitle("luminosiry section", 1);
265  h_mass_HLT_pass_central->setAxisTitle("tag and probe mass", 2);
266  h_mass_HLT_pass_forward->setAxisTitle("tag and probe mass", 2);
267  h_mass_HLT_fail_central->setAxisTitle("tag and probe mass", 2);
268  h_mass_HLT_fail_forward->setAxisTitle("tag and probe mass", 2);
269  h_mass_SIT_pass_central->setAxisTitle("tag and probe mass", 2);
270  h_mass_SIT_pass_forward->setAxisTitle("tag and probe mass", 2);
271  h_mass_SIT_fail_central->setAxisTitle("tag and probe mass", 2);
272  h_mass_SIT_fail_forward->setAxisTitle("tag and probe mass", 2);
273  h_mass_Glo_pass_central->setAxisTitle("tag and probe mass", 2);
274  h_mass_Glo_pass_forward->setAxisTitle("tag and probe mass", 2);
275  h_mass_Glo_fail_central->setAxisTitle("tag and probe mass", 2);
276  h_mass_Glo_fail_forward->setAxisTitle("tag and probe mass", 2);
277  h_npv->setAxisTitle("luminosity section", 1);
278  h_npv->setAxisTitle("number of primary vertices", 2);
279  h_npv_yield_Z->setAxisTitle("luminosiry section", 1);
280  h_npv_yield_Z->setAxisTitle("number of primary vertices", 2);
281  h_mass_yield_Z->setAxisTitle("luminosiry section", 1);
282  h_mass_yield_Z->setAxisTitle("tag and probe mass", 2);
283 
284  h_yieldBB_Z->setAxisTitle("luminosiry section", 1);
285  h_yieldEE_Z->setAxisTitle("luminosiry section", 1);
286 
287  /*
288  // Electron histograms
289  h_ee_mass_id_pass_central = ibooker_.book2D("h_ee_mass_id_pass_central", "h_ee_mass_id_pass_central", LumiBin_, LumiMin_, LumiMax_, MassBin_, MassMin_, MassMax_);
290  h_ee_mass_id_fail_central = ibooker_.book2D("h_ee_mass_id_fail_central", "h_ee_mass_id_fail_central", LumiBin_, LumiMin_, LumiMax_, MassBin_, MassMin_, MassMax_);
291  h_ee_mass_id_pass_forward = ibooker_.book2D("h_ee_mass_id_pass_forward", "h_ee_mass_id_pass_forward", LumiBin_, LumiMin_, LumiMax_, MassBin_, MassMin_, MassMax_);
292  h_ee_mass_id_fail_forward = ibooker_.book2D("h_ee_mass_id_fail_forward", "h_ee_mass_id_fail_forward", LumiBin_, LumiMin_, LumiMax_, MassBin_, MassMin_, MassMax_);
293 
294  h_ee_mass_HLT_pass_central = ibooker_.book2D("h_ee_mass_HLT_pass_central", "h_ee_mass_HLT_pass_central", LumiBin_, LumiMin_, LumiMax_, MassBin_, MassMin_, MassMax_);
295  h_ee_mass_HLT_fail_central = ibooker_.book2D("h_ee_mass_HLT_fail_central", "h_ee_mass_HLT_fail_central", LumiBin_, LumiMin_, LumiMax_, MassBin_, MassMin_, MassMax_);
296  h_ee_mass_HLT_pass_forward = ibooker_.book2D("h_ee_mass_HLT_pass_forward", "h_ee_mass_HLT_pass_forward", LumiBin_, LumiMin_, LumiMax_, MassBin_, MassMin_, MassMax_);
297  h_ee_mass_HLT_fail_forward = ibooker_.book2D("h_ee_mass_HLT_fail_forward", "h_ee_mass_HLT_fail_forward", LumiBin_, LumiMin_, LumiMax_, MassBin_, MassMin_, MassMax_);
298 
299  h_ee_yield_Z_ebeb = ibooker_.book1D("h_ee_yield_Z_ebeb", "h_ee_yield_Z_ebeb", LumiBin_, LumiMin_, LumiMax_);
300  h_ee_yield_Z_ebee = ibooker_.book1D("h_ee_yield_Z_ebee", "h_ee_yield_Z_ebee", LumiBin_, LumiMin_, LumiMax_);
301  h_ee_yield_Z_eeee = ibooker_.book1D("h_ee_yield_Z_eeee", "h_ee_yield_Z_eeee", LumiBin_, LumiMin_, LumiMax_);*/
302 }
MonitorElement * h_mass_Glo_pass_forward
Definition: ZCounting.h:167
MonitorElement * h_mass_Glo_fail_forward
Definition: ZCounting.h:169
MonitorElement * h_mass_SIT_fail_central
Definition: ZCounting.h:163
double LumiMax_
Definition: ZCounting.h:126
MonitorElement * h_mass_SIT_pass_forward
Definition: ZCounting.h:162
MonitorElement * h_mass_HLT_pass_forward
Definition: ZCounting.h:157
MonitorElement * h_mass_yield_Z
Definition: ZCounting.h:173
MonitorElement * h_mass_Glo_pass_central
Definition: ZCounting.h:166
double LumiMin_
Definition: ZCounting.h:125
MonitorElement * h_yieldEE_Z
Definition: ZCounting.h:175
int PVBin_
Definition: ZCounting.h:128
MonitorElement * h_npv_yield_Z
Definition: ZCounting.h:172
MonitorElement * h_npv
Definition: ZCounting.h:171
MonitorElement * h_mass_SIT_fail_forward
Definition: ZCounting.h:164
MonitorElement * h_mass_HLT_pass_central
Definition: ZCounting.h:156
int MassBin_
Definition: ZCounting.h:120
int LumiBin_
Definition: ZCounting.h:124
MonitorElement * h_mass_HLT_fail_forward
Definition: ZCounting.h:159
MonitorElement * h_yieldBB_Z
Definition: ZCounting.h:174
double MassMax_
Definition: ZCounting.h:122
double PVMax_
Definition: ZCounting.h:130
MonitorElement * h_mass_Glo_fail_central
Definition: ZCounting.h:168
double MassMin_
Definition: ZCounting.h:121
MonitorElement * h_mass_SIT_pass_central
Definition: ZCounting.h:161
double PVMin_
Definition: ZCounting.h:129
MonitorElement * h_mass_HLT_fail_central
Definition: ZCounting.h:158
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void ZCounting::dqmBeginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 129 of file ZCounting.cc.

References fMuonHLTNames, fMuonHLTObjectNames, and fTrigger.

129  {
130  edm::LogInfo("ZCounting") << "ZCounting::beginRun" << std::endl;
131 
132  // Triggers
134 }
std::vector< std::string > fMuonHLTNames
Definition: ZCounting.h:84
std::vector< std::string > fMuonHLTObjectNames
Definition: ZCounting.h:85
std::unique_ptr< ZCountingTrigger::TTrigger > fTrigger
Definition: ZCounting.h:107
bool ZCounting::ele_probe_selection ( double  pt,
double  abseta 
)
private

Definition at line 798 of file ZCounting.cc.

References ELE_ETA_CRACK_HIGH, ELE_ETA_CRACK_LOW, ELE_ETA_CUT_PROBE, and ELE_PT_CUT_PROBE.

Referenced by analyzeElectrons().

798  {
799  if (pt < ELE_PT_CUT_PROBE)
800  return false;
801  if (abseta > ELE_ETA_CUT_PROBE)
802  return false;
803  if ((abseta > ELE_ETA_CRACK_LOW) and (abseta < ELE_ETA_CRACK_HIGH))
804  return false;
805  return true;
806 }
const float ELE_ETA_CRACK_HIGH
Definition: ZCounting.h:151
const float ELE_PT_CUT_PROBE
Definition: ZCounting.h:143
const float ELE_ETA_CRACK_LOW
Definition: ZCounting.h:150
const float ELE_ETA_CUT_PROBE
Definition: ZCounting.h:145
bool ZCounting::ele_tag_selection ( double  pt,
double  abseta 
)
private

Definition at line 807 of file ZCounting.cc.

References ELE_ETA_CRACK_HIGH, ELE_ETA_CRACK_LOW, ELE_ETA_CUT_TAG, and ELE_PT_CUT_TAG.

Referenced by analyzeElectrons().

807  {
808  if (pt < ELE_PT_CUT_TAG)
809  return false;
810  if (abseta > ELE_ETA_CUT_TAG)
811  return false;
812  if ((abseta > ELE_ETA_CRACK_LOW) and (abseta < ELE_ETA_CRACK_HIGH))
813  return false;
814  return true;
815 }
const float ELE_ETA_CRACK_HIGH
Definition: ZCounting.h:151
const float ELE_ETA_CUT_TAG
Definition: ZCounting.h:144
const float ELE_ETA_CRACK_LOW
Definition: ZCounting.h:150
const float ELE_PT_CUT_TAG
Definition: ZCounting.h:142
void ZCounting::initHLT ( const edm::TriggerResults result,
const edm::TriggerNames triggerNames 
)
private

Definition at line 820 of file ZCounting.cc.

References fTrigger, createfilelist::int, edm::is_glob(), match(), patCandidatesForDimuonsSequences_cff::matches, topSingleLeptonDQM_PU_cfi::pattern, edm::regexMatch(), edm::HLTGlobalStatus::size(), AlCaHLTBitMon_QueryRunRegistry::string, edm::TriggerNames::triggerIndex(), and edm::TriggerNames::triggerNames().

Referenced by analyzeElectrons(), and analyzeMuons().

820  {
821  for (unsigned int irec = 0; irec < fTrigger->fRecords.size(); irec++) {
822  fTrigger->fRecords[irec].hltPathName = "";
823  fTrigger->fRecords[irec].hltPathIndex = (unsigned int)-1;
824  const std::string pattern = fTrigger->fRecords[irec].hltPattern;
825  if (edm::is_glob(pattern)) { // handle pattern with wildcards (*,?)
826  std::vector<std::vector<std::string>::const_iterator> matches =
827  edm::regexMatch(triggerNames.triggerNames(), pattern);
828  if (matches.empty()) {
829  edm::LogWarning("ZCounting") << "requested pattern [" << pattern << "] does not match any HLT paths"
830  << std::endl;
831  } else {
832  for (auto const& match : matches) {
833  fTrigger->fRecords[irec].hltPathName = *match;
834  }
835  }
836  } else { // take full HLT path name given
837  fTrigger->fRecords[irec].hltPathName = pattern;
838  }
839  // Retrieve index in trigger menu corresponding to HLT path
840  unsigned int index = triggerNames.triggerIndex(fTrigger->fRecords[irec].hltPathName);
841  if (index < result.size()) { // check for valid index
842  fTrigger->fRecords[irec].hltPathIndex = index;
843  }
844  }
845 }
bool is_glob(std::string const &pattern)
Definition: RegexMatch.cc:17
Strings const & triggerNames() const
Definition: TriggerNames.cc:20
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:24
unsigned int size() const
Get number of paths stored.
std::vector< std::vector< std::string >::const_iterator > regexMatch(std::vector< std::string > const &strings, std::regex const &regexp)
Definition: RegexMatch.cc:26
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
std::unique_ptr< ZCountingTrigger::TTrigger > fTrigger
Definition: ZCounting.h:107
bool ZCounting::isElectronTrigger ( ZCountingTrigger::TTrigger  triggerMenu,
TriggerBits  hltBits 
)
private

Definition at line 903 of file ZCounting.cc.

References ZCountingTrigger::TTrigger::pass().

Referenced by analyzeElectrons().

903  {
904  return triggerMenu.pass("HLT_Ele35_WPTight_Gsf_v*", hltBits);
905 }
bool pass(const std::string &iName, const TriggerBits &iTrig) const
Definition: TTrigger.cc:65
bool ZCounting::isElectronTriggerObj ( ZCountingTrigger::TTrigger  triggerMenu,
TriggerObjects  hltMatchBits 
)
private

Definition at line 907 of file ZCounting.cc.

References DEFINE_FWK_MODULE, and ZCountingTrigger::TTrigger::passObj().

Referenced by analyzeElectrons().

907  {
908  return triggerMenu.passObj("HLT_Ele35_WPTight_Gsf_v*", "hltEle35noerWPTightGsfTrackIsoFilter", hltMatchBits);
909 }
bool passObj(const std::string &iName, const std::string &iObjName, const TriggerObjects &iTrigObj) const
Definition: TTrigger.cc:74
bool ZCounting::isMuonTrigger ( const ZCountingTrigger::TTrigger triggerMenu,
const TriggerBits hltBits 
)
private

Definition at line 848 of file ZCounting.cc.

References fMuonHLTNames, mps_fire::i, and ZCountingTrigger::TTrigger::pass().

Referenced by analyzeMuons().

848  {
849  for (unsigned int i = 0; i < fMuonHLTNames.size(); ++i) {
850  if (triggerMenu.pass(fMuonHLTNames.at(i), hltBits))
851  return true;
852  }
853  return false;
854 }
std::vector< std::string > fMuonHLTNames
Definition: ZCounting.h:84
bool pass(const std::string &iName, const TriggerBits &iTrig) const
Definition: TTrigger.cc:65
bool ZCounting::isMuonTriggerObj ( const ZCountingTrigger::TTrigger triggerMenu,
const TriggerObjects hltMatchBits 
)
private

Definition at line 857 of file ZCounting.cc.

References fMuonHLTNames, fMuonHLTObjectNames, mps_fire::i, and ZCountingTrigger::TTrigger::passObj().

Referenced by analyzeMuons().

857  {
858  for (unsigned int i = 0; i < fMuonHLTNames.size(); ++i) {
859  if (triggerMenu.passObj(fMuonHLTNames.at(i), fMuonHLTObjectNames.at(i), hltMatchBits))
860  return true;
861  }
862  return false;
863 }
bool passObj(const std::string &iName, const std::string &iObjName, const TriggerObjects &iTrigObj) const
Definition: TTrigger.cc:74
std::vector< std::string > fMuonHLTNames
Definition: ZCounting.h:84
std::vector< std::string > fMuonHLTObjectNames
Definition: ZCounting.h:85
bool ZCounting::passMuonID ( const reco::Muon muon,
const reco::Vertex vtx,
const MuonIDTypes idType 
)
private

Definition at line 866 of file ZCounting.cc.

References muon::isLooseMuon(), muon::isMediumMuon(), muon::isTightMuon(), LooseID, MediumID, NoneID, and TightID.

Referenced by analyzeMuons().

869  { //Muon ID selection, using internal function "DataFormats/MuonReco/src/MuonSelectors.cc
870 
871  if (idType == LooseID && muon::isLooseMuon(muon))
872  return true;
873  else if (idType == MediumID && muon::isMediumMuon(muon))
874  return true;
875  else if (idType == TightID && muon::isTightMuon(muon, vtx))
876  return true;
877  else if (idType == NoneID)
878  return true;
879  else
880  return false;
881 }
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
bool isLooseMuon(const reco::Muon &)
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
bool ZCounting::passMuonIso ( const reco::Muon muon,
const MuonIsoTypes isoType,
const float  isoCut 
)
private

Definition at line 883 of file ZCounting.cc.

References zSelection_cfi::isoCut, reco::Muon::isolationR03(), SiStripPI::max, NoneIso, PFIso, reco::Muon::pfIsolationR04(), reco::MuonPFIsolation::sumChargedHadronPt, reco::MuonPFIsolation::sumNeutralHadronEt, reco::MuonPFIsolation::sumPhotonEt, reco::MuonIsolation::sumPt, reco::MuonPFIsolation::sumPUPt, and TrackerIso.

Referenced by analyzeMuons().

885  { //Muon isolation selection, up-to-date with MUO POG recommendation
886 
887  if (isoType == TrackerIso && muon.isolationR03().sumPt < isoCut)
888  return true;
889  else if (isoType == PFIso &&
891  std::max(0.,
893  0.5 * muon.pfIsolationR04().sumPUPt) <
894  isoCut)
895  return true;
896  else if (isoType == NoneIso)
897  return true;
898  else
899  return false;
900 }
float sumPt
sum-pt of tracks
Definition: MuonIsolation.h:6
float sumPhotonEt
sum pt of PF photons
float sumNeutralHadronEt
sum pt of neutral hadrons
float sumPUPt
sum pt of charged Particles not from PV (for Pu corrections)
const MuonPFIsolation & pfIsolationR04() const
Definition: Muon.h:172
const MuonIsolation & isolationR03() const
Definition: Muon.h:166
float sumChargedHadronPt
sum-pt of charged Hadron

Member Data Documentation

const float ZCounting::ELE_ETA_CRACK_HIGH = 1.56
private

Definition at line 151 of file ZCounting.h.

Referenced by ele_probe_selection(), and ele_tag_selection().

const float ZCounting::ELE_ETA_CRACK_LOW = 1.4442
private

Definition at line 150 of file ZCounting.h.

Referenced by analyzeElectrons(), ele_probe_selection(), and ele_tag_selection().

const float ZCounting::ELE_ETA_CUT_PROBE
private

Definition at line 145 of file ZCounting.h.

Referenced by ele_probe_selection().

const float ZCounting::ELE_ETA_CUT_TAG
private

Definition at line 144 of file ZCounting.h.

Referenced by ele_tag_selection().

const std::string ZCounting::ELE_ID_WP
private

Definition at line 149 of file ZCounting.h.

Referenced by ZCounting().

const float ZCounting::ELE_MASS_CUT_HIGH
private

Definition at line 147 of file ZCounting.h.

Referenced by analyzeElectrons().

const float ZCounting::ELE_MASS_CUT_LOW
private

Definition at line 146 of file ZCounting.h.

Referenced by analyzeElectrons().

const float ZCounting::ELE_PT_CUT_PROBE
private

Definition at line 143 of file ZCounting.h.

Referenced by ele_probe_selection().

const float ZCounting::ELE_PT_CUT_TAG
private

Definition at line 142 of file ZCounting.h.

Referenced by ele_tag_selection().

const float ZCounting::ELECTRON_MASS = 0.000511
private

Definition at line 140 of file ZCounting.h.

Referenced by analyzeElectrons().

ElectronIdentifier ZCounting::EleID_
private

Definition at line 153 of file ZCounting.h.

Referenced by analyzeElectrons(), and ZCounting().

double ZCounting::EtaCutL1_
private

Definition at line 117 of file ZCounting.h.

Referenced by analyzeMuons(), and ZCounting().

double ZCounting::EtaCutL2_
private

Definition at line 118 of file ZCounting.h.

Referenced by analyzeMuons(), and ZCounting().

edm::InputTag ZCounting::fBeamspotTag
private

Definition at line 100 of file ZCounting.h.

Referenced by ZCounting().

edm::EDGetTokenT<reco::BeamSpot> ZCounting::fBeamspotToken
private

Definition at line 101 of file ZCounting.h.

Referenced by analyzeElectrons(), and ZCounting().

edm::InputTag ZCounting::fConversionTag
private

Definition at line 103 of file ZCounting.h.

Referenced by ZCounting().

edm::EDGetTokenT<reco::ConversionCollection> ZCounting::fConversionToken
private

Definition at line 104 of file ZCounting.h.

Referenced by analyzeElectrons(), and ZCounting().

std::string ZCounting::fElectronName
private

Definition at line 92 of file ZCounting.h.

Referenced by ZCounting().

edm::EDGetTokenT<edm::View<reco::GsfElectron> > ZCounting::fGsfElectronName_token
private

Definition at line 93 of file ZCounting.h.

Referenced by analyzeElectrons(), and ZCounting().

edm::InputTag ZCounting::fHLTObjTag
private

Definition at line 74 of file ZCounting.h.

Referenced by ZCounting().

edm::EDGetTokenT<trigger::TriggerEvent> ZCounting::fHLTObjTag_token
private

Definition at line 76 of file ZCounting.h.

Referenced by analyzeElectrons(), analyzeMuons(), and ZCounting().

edm::InputTag ZCounting::fHLTTag
private

Definition at line 75 of file ZCounting.h.

Referenced by ZCounting().

edm::EDGetTokenT<edm::TriggerResults> ZCounting::fHLTTag_token
private

Definition at line 77 of file ZCounting.h.

Referenced by analyzeElectrons(), analyzeMuons(), and ZCounting().

std::vector<std::string> ZCounting::fMuonHLTNames
private

Definition at line 84 of file ZCounting.h.

Referenced by dqmBeginRun(), isMuonTrigger(), isMuonTriggerObj(), and ZCounting().

std::vector<std::string> ZCounting::fMuonHLTObjectNames
private

Definition at line 85 of file ZCounting.h.

Referenced by dqmBeginRun(), isMuonTriggerObj(), and ZCounting().

std::string ZCounting::fMuonName
private

Definition at line 82 of file ZCounting.h.

Referenced by ZCounting().

edm::EDGetTokenT<reco::MuonCollection> ZCounting::fMuonName_token
private

Definition at line 83 of file ZCounting.h.

Referenced by analyzeMuons(), and ZCounting().

std::string ZCounting::fPVName
private

Definition at line 78 of file ZCounting.h.

Referenced by ZCounting().

edm::EDGetTokenT<reco::VertexCollection> ZCounting::fPVName_token
private

Definition at line 79 of file ZCounting.h.

Referenced by analyzeElectrons(), analyzeMuons(), and ZCounting().

edm::InputTag ZCounting::fRhoTag
private

Definition at line 97 of file ZCounting.h.

Referenced by ZCounting().

edm::EDGetTokenT<double> ZCounting::fRhoToken
private

Definition at line 98 of file ZCounting.h.

Referenced by analyzeElectrons(), and ZCounting().

std::string ZCounting::fSCName
private

Definition at line 94 of file ZCounting.h.

Referenced by ZCounting().

edm::EDGetTokenT<edm::View<reco::SuperCluster> > ZCounting::fSCName_token
private

Definition at line 95 of file ZCounting.h.

Referenced by analyzeElectrons(), and ZCounting().

std::string ZCounting::fTrackName
private

Definition at line 88 of file ZCounting.h.

Referenced by ZCounting().

edm::EDGetTokenT<reco::TrackCollection> ZCounting::fTrackName_token
private

Definition at line 89 of file ZCounting.h.

Referenced by analyzeMuons(), and ZCounting().

std::unique_ptr<ZCountingTrigger::TTrigger> ZCounting::fTrigger
private

Definition at line 107 of file ZCounting.h.

Referenced by analyzeElectrons(), analyzeMuons(), dqmBeginRun(), and initHLT().

edm::ParameterSetID ZCounting::fTriggerNamesID
private

Definition at line 73 of file ZCounting.h.

Referenced by analyzeElectrons(), and analyzeMuons().

MonitorElement* ZCounting::h_ee_mass_HLT_fail_central
private

Definition at line 184 of file ZCounting.h.

Referenced by analyzeElectrons().

MonitorElement* ZCounting::h_ee_mass_HLT_fail_forward
private

Definition at line 186 of file ZCounting.h.

Referenced by analyzeElectrons().

MonitorElement* ZCounting::h_ee_mass_HLT_pass_central
private

Definition at line 183 of file ZCounting.h.

Referenced by analyzeElectrons().

MonitorElement* ZCounting::h_ee_mass_HLT_pass_forward
private

Definition at line 185 of file ZCounting.h.

Referenced by analyzeElectrons().

MonitorElement* ZCounting::h_ee_mass_id_fail_central
private

Definition at line 179 of file ZCounting.h.

Referenced by analyzeElectrons().

MonitorElement* ZCounting::h_ee_mass_id_fail_forward
private

Definition at line 181 of file ZCounting.h.

Referenced by analyzeElectrons().

MonitorElement* ZCounting::h_ee_mass_id_pass_central
private

Definition at line 178 of file ZCounting.h.

Referenced by analyzeElectrons().

MonitorElement* ZCounting::h_ee_mass_id_pass_forward
private

Definition at line 180 of file ZCounting.h.

Referenced by analyzeElectrons().

MonitorElement* ZCounting::h_ee_yield_Z_ebeb
private

Definition at line 188 of file ZCounting.h.

Referenced by analyzeElectrons().

MonitorElement* ZCounting::h_ee_yield_Z_ebee
private

Definition at line 189 of file ZCounting.h.

Referenced by analyzeElectrons().

MonitorElement* ZCounting::h_ee_yield_Z_eeee
private

Definition at line 190 of file ZCounting.h.

Referenced by analyzeElectrons().

MonitorElement* ZCounting::h_mass_Glo_fail_central
private

Definition at line 168 of file ZCounting.h.

Referenced by analyzeMuons(), and bookHistograms().

MonitorElement* ZCounting::h_mass_Glo_fail_forward
private

Definition at line 169 of file ZCounting.h.

Referenced by analyzeMuons(), and bookHistograms().

MonitorElement* ZCounting::h_mass_Glo_pass_central
private

Definition at line 166 of file ZCounting.h.

Referenced by analyzeMuons(), and bookHistograms().

MonitorElement* ZCounting::h_mass_Glo_pass_forward
private

Definition at line 167 of file ZCounting.h.

Referenced by analyzeMuons(), and bookHistograms().

MonitorElement* ZCounting::h_mass_HLT_fail_central
private

Definition at line 158 of file ZCounting.h.

Referenced by analyzeMuons(), and bookHistograms().

MonitorElement* ZCounting::h_mass_HLT_fail_forward
private

Definition at line 159 of file ZCounting.h.

Referenced by analyzeMuons(), and bookHistograms().

MonitorElement* ZCounting::h_mass_HLT_pass_central
private

Definition at line 156 of file ZCounting.h.

Referenced by analyzeMuons(), and bookHistograms().

MonitorElement* ZCounting::h_mass_HLT_pass_forward
private

Definition at line 157 of file ZCounting.h.

Referenced by analyzeMuons(), and bookHistograms().

MonitorElement* ZCounting::h_mass_SIT_fail_central
private

Definition at line 163 of file ZCounting.h.

Referenced by analyzeMuons(), and bookHistograms().

MonitorElement* ZCounting::h_mass_SIT_fail_forward
private

Definition at line 164 of file ZCounting.h.

Referenced by analyzeMuons(), and bookHistograms().

MonitorElement* ZCounting::h_mass_SIT_pass_central
private

Definition at line 161 of file ZCounting.h.

Referenced by analyzeMuons(), and bookHistograms().

MonitorElement* ZCounting::h_mass_SIT_pass_forward
private

Definition at line 162 of file ZCounting.h.

Referenced by analyzeMuons(), and bookHistograms().

MonitorElement* ZCounting::h_mass_yield_Z
private

Definition at line 173 of file ZCounting.h.

Referenced by analyzeMuons(), and bookHistograms().

MonitorElement* ZCounting::h_npv
private

Definition at line 171 of file ZCounting.h.

Referenced by analyzeMuons(), and bookHistograms().

MonitorElement* ZCounting::h_npv_yield_Z
private

Definition at line 172 of file ZCounting.h.

Referenced by analyzeMuons(), and bookHistograms().

MonitorElement* ZCounting::h_yieldBB_Z
private

Definition at line 174 of file ZCounting.h.

Referenced by analyzeMuons(), and bookHistograms().

MonitorElement* ZCounting::h_yieldEE_Z
private

Definition at line 175 of file ZCounting.h.

Referenced by analyzeMuons(), and bookHistograms().

MuonIDTypes ZCounting::IDType_ {NoneID}
private

Definition at line 111 of file ZCounting.h.

Referenced by analyzeMuons(), and ZCounting().

std::string ZCounting::IDTypestr_
private

Definition at line 109 of file ZCounting.h.

Referenced by ZCounting().

double ZCounting::IsoCut_
private

Definition at line 113 of file ZCounting.h.

Referenced by analyzeMuons(), and ZCounting().

MuonIsoTypes ZCounting::IsoType_ {NoneIso}
private

Definition at line 112 of file ZCounting.h.

Referenced by analyzeMuons(), and ZCounting().

std::string ZCounting::IsoTypestr_
private

Definition at line 110 of file ZCounting.h.

Referenced by ZCounting().

int ZCounting::LumiBin_
private

Definition at line 124 of file ZCounting.h.

Referenced by bookHistograms(), and ZCounting().

double ZCounting::LumiMax_
private

Definition at line 126 of file ZCounting.h.

Referenced by bookHistograms(), and ZCounting().

double ZCounting::LumiMin_
private

Definition at line 125 of file ZCounting.h.

Referenced by bookHistograms(), and ZCounting().

int ZCounting::MassBin_
private

Definition at line 120 of file ZCounting.h.

Referenced by bookHistograms(), and ZCounting().

double ZCounting::MassMax_
private

Definition at line 122 of file ZCounting.h.

Referenced by analyzeMuons(), bookHistograms(), and ZCounting().

double ZCounting::MassMin_
private

Definition at line 121 of file ZCounting.h.

Referenced by analyzeMuons(), bookHistograms(), and ZCounting().

const double ZCounting::MUON_BOUND = 0.9
private

Definition at line 138 of file ZCounting.h.

Referenced by analyzeMuons().

const double ZCounting::MUON_MASS = 0.105658369
private

Definition at line 137 of file ZCounting.h.

Referenced by analyzeMuons().

double ZCounting::PtCutL1_
private

Definition at line 115 of file ZCounting.h.

Referenced by analyzeMuons(), and ZCounting().

double ZCounting::PtCutL2_
private

Definition at line 116 of file ZCounting.h.

Referenced by analyzeMuons(), and ZCounting().

int ZCounting::PVBin_
private

Definition at line 128 of file ZCounting.h.

Referenced by bookHistograms(), and ZCounting().

double ZCounting::PVMax_
private

Definition at line 130 of file ZCounting.h.

Referenced by bookHistograms(), and ZCounting().

double ZCounting::PVMin_
private

Definition at line 129 of file ZCounting.h.

Referenced by bookHistograms(), and ZCounting().

double ZCounting::VtxAbsZCut_
private

Definition at line 134 of file ZCounting.h.

Referenced by analyzeElectrons(), analyzeMuons(), and ZCounting().

double ZCounting::VtxNdofCut_
private

Definition at line 133 of file ZCounting.h.

Referenced by analyzeElectrons(), analyzeMuons(), and ZCounting().

double ZCounting::VtxNTracksFitCut_
private

Definition at line 132 of file ZCounting.h.

Referenced by analyzeElectrons(), analyzeMuons(), and ZCounting().

double ZCounting::VtxRhoCut_
private

Definition at line 135 of file ZCounting.h.

Referenced by analyzeElectrons(), analyzeMuons(), and ZCounting().