CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalZmassTask Class Reference
Inheritance diagram for EcalZmassTask:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 EcalZmassTask (const edm::ParameterSet &)
 
 ~EcalZmassTask () 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
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 

Private Attributes

const edm::EDGetTokenT< reco::GsfElectronCollectionelectronCollectionToken_
 
MonitorElementh_95_ee_invMass_BB
 
MonitorElementh_95_ee_invMass_EB
 
MonitorElementh_95_ee_invMass_EE
 
MonitorElementh_e1_et
 
MonitorElementh_e1_eta
 
MonitorElementh_e1_phi
 
MonitorElementh_e2_et
 
MonitorElementh_e2_eta
 
MonitorElementh_e2_phi
 
MonitorElementh_ee_invMass
 
MonitorElementh_ee_invMass_BB
 
MonitorElementh_ee_invMass_EB
 
MonitorElementh_ee_invMass_EE
 
const std::string prefixME_
 
const edm::EDGetTokenT< reco::GsfTrackCollectiontrackCollectionToken_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 44 of file EcalZmassTask.cc.

Constructor & Destructor Documentation

◆ EcalZmassTask()

EcalZmassTask::EcalZmassTask ( const edm::ParameterSet parameters)
explicit

Definition at line 73 of file EcalZmassTask.cc.

75  consumes<reco::GsfElectronCollection>(parameters.getParameter<edm::InputTag>("electronCollection"))),
77  consumes<reco::GsfTrackCollection>(parameters.getParameter<edm::InputTag>("trackCollection"))),
78  prefixME_(parameters.getUntrackedParameter<std::string>("prefixME", "")) {}

◆ ~EcalZmassTask()

EcalZmassTask::~EcalZmassTask ( )
inlineoverride

Definition at line 47 of file EcalZmassTask.cc.

47 {}

Member Function Documentation

◆ analyze()

void EcalZmassTask::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 81 of file EcalZmassTask.cc.

81  {
82  using namespace edm;
85  if (!electronCollection.isValid())
86  return;
87 
88  // get GSF Tracks
90  iEvent.getByToken(trackCollectionToken_, gsftracks_h);
91 
92  bool isIsolatedBarrel;
93  bool isIDBarrel;
94  bool isConvertedBarrel;
95  bool isIsolatedEndcap;
96  bool isIDEndcap;
97  bool isConvertedEndcap;
98 
99  int elIsAccepted = 0;
100  int elIsAcceptedEB = 0;
101  int elIsAcceptedEE = 0;
102 
103  std::vector<TLorentzVector> LV;
104 
105  for (reco::GsfElectronCollection::const_iterator recoElectron = electronCollection->begin();
106  recoElectron != electronCollection->end();
107  recoElectron++) {
108  if (recoElectron->et() <= 25)
109  continue;
110 
111  // Define Isolation variables
112  double IsoTrk = (recoElectron->dr03TkSumPt() / recoElectron->et());
113  double IsoEcal = (recoElectron->dr03EcalRecHitSumEt() / recoElectron->et());
114  double IsoHcal = (recoElectron->dr03HcalTowerSumEt() / recoElectron->et());
115  double HE = (recoElectron->hcalOverEcal());
116 
117  // Define ID variables
118 
119  float DeltaPhiTkClu = recoElectron->deltaPhiSuperClusterTrackAtVtx();
120  float DeltaEtaTkClu = recoElectron->deltaEtaSuperClusterTrackAtVtx();
121  float sigmaIeIe = recoElectron->sigmaIetaIeta();
122 
123  // Define Conversion Rejection Variables
124 
125  float Dcot = recoElectron->convDcot();
126  float Dist = recoElectron->convDist();
127  int NumberOfExpectedInnerHits =
128  recoElectron->gsfTrack()->hitPattern().numberOfLostHits(reco::HitPattern::MISSING_INNER_HITS);
129 
130  // quality flags
131 
132  isIsolatedBarrel = false;
133  isIDBarrel = false;
134  isConvertedBarrel = false;
135  isIsolatedEndcap = false;
136  isIDEndcap = false;
137  isConvertedEndcap = false;
138 
139  /***** Barrel WP80 Cuts *****/
140 
141  if (fabs(recoElectron->eta()) <= 1.4442) {
142  /* Isolation */
143  if (IsoTrk < 0.09 && IsoEcal < 0.07 && IsoHcal < 0.10) {
144  isIsolatedBarrel = true;
145  }
146 
147  /* Identification */
148  if (fabs(DeltaEtaTkClu) < 0.004 && fabs(DeltaPhiTkClu) < 0.06 && sigmaIeIe < 0.01 && HE < 0.04) {
149  isIDBarrel = true;
150  }
151 
152  /* Conversion Rejection */
153  if ((fabs(Dist) >= 0.02 || fabs(Dcot) >= 0.02) && NumberOfExpectedInnerHits <= 1.0) {
154  isConvertedBarrel = true;
155  }
156  }
157 
158  if (isIsolatedBarrel && isIDBarrel && isConvertedBarrel) {
159  elIsAccepted++;
160  elIsAcceptedEB++;
161  TLorentzVector b_e2(
162  recoElectron->momentum().x(), recoElectron->momentum().y(), recoElectron->momentum().z(), recoElectron->p());
163  LV.push_back(b_e2);
164  }
165 
166  /***** Endcap WP80 Cuts *****/
167 
168  if (fabs(recoElectron->eta()) >= 1.5660 && fabs(recoElectron->eta()) <= 2.5000) {
169  /* Isolation */
170  if (IsoTrk < 0.04 && IsoEcal < 0.05 && IsoHcal < 0.025) {
171  isIsolatedEndcap = true;
172  }
173 
174  /* Identification */
175  if (fabs(DeltaEtaTkClu) < 0.007 && fabs(DeltaPhiTkClu) < 0.03 && sigmaIeIe < 0.031 && HE < 0.15) {
176  isIDEndcap = true;
177  }
178 
179  /* Conversion Rejection */
180  if ((fabs(Dcot) > 0.02 || fabs(Dist) > 0.02) && NumberOfExpectedInnerHits <= 1.0) {
181  isConvertedEndcap = true;
182  }
183  }
184  if (isIsolatedEndcap && isIDEndcap && isConvertedEndcap) {
185  elIsAccepted++;
186  elIsAcceptedEE++;
187  TLorentzVector e_e2(
188  recoElectron->momentum().x(), recoElectron->momentum().y(), recoElectron->momentum().z(), recoElectron->p());
189  LV.push_back(e_e2);
190  }
191  }
192 
193  // Calculate the Z invariant masses
194 
195  if (elIsAccepted > 1) {
196  double e_ee_invMass = 0;
197  if (LV.size() == 2) {
198  TLorentzVector e_pair = LV[0] + LV[1];
199  e_ee_invMass = e_pair.M();
200  }
201 
202  if (elIsAcceptedEB == 2) {
203  h_ee_invMass_BB->Fill(e_ee_invMass);
204  }
205  if (elIsAcceptedEE == 2) {
206  h_ee_invMass_EE->Fill(e_ee_invMass);
207  }
208  if (elIsAcceptedEB == 1 && elIsAcceptedEE == 1) {
209  h_ee_invMass_EB->Fill(e_ee_invMass);
210  }
211 
212  LV.clear();
213  }
214 }

References pdwgLeptonRecoSkim_cfi::electronCollection, electronCollectionToken_, dqm::impl::MonitorElement::Fill(), h_ee_invMass_BB, h_ee_invMass_EB, h_ee_invMass_EE, HE, iEvent, reco::HitPattern::MISSING_INNER_HITS, and trackCollectionToken_.

◆ bookHistograms()

void EcalZmassTask::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 216 of file EcalZmassTask.cc.

216  {
217  std::string logTraceName("EcalZmassTask");
218 
219  h_ee_invMass_EB = nullptr;
220  h_ee_invMass_EE = nullptr;
221  h_ee_invMass_BB = nullptr;
222 
223  LogTrace(logTraceName) << "Parameters initialization";
224 
225  iBooker.setCurrentFolder(prefixME_ + "/Zmass"); // Use folder with name of PAG
226 
227  h_ee_invMass_EB = iBooker.book1D("Z peak - WP80 EB-EE", "Z peak - WP80 EB-EE;InvMass (GeV)", 60, 60.0, 120.0);
228  h_ee_invMass_EE = iBooker.book1D("Z peak - WP80 EE-EE", "Z peak - WP80 EE-EE;InvMass (Gev)", 60, 60.0, 120.0);
229  h_ee_invMass_BB = iBooker.book1D("Z peak - WP80 EB-EB", "Z peak - WP80 EB-EB;InvMass (Gev)", 60, 60.0, 120.0);
230 }

References dqm::implementation::IBooker::book1D(), h_ee_invMass_BB, h_ee_invMass_EB, h_ee_invMass_EE, LogTrace, prefixME_, dqm::implementation::NavigatorBase::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Member Data Documentation

◆ electronCollectionToken_

const edm::EDGetTokenT<reco::GsfElectronCollection> EcalZmassTask::electronCollectionToken_
private

Definition at line 53 of file EcalZmassTask.cc.

Referenced by analyze().

◆ h_95_ee_invMass_BB

MonitorElement* EcalZmassTask::h_95_ee_invMass_BB
private

Definition at line 70 of file EcalZmassTask.cc.

◆ h_95_ee_invMass_EB

MonitorElement* EcalZmassTask::h_95_ee_invMass_EB
private

Definition at line 68 of file EcalZmassTask.cc.

◆ h_95_ee_invMass_EE

MonitorElement* EcalZmassTask::h_95_ee_invMass_EE
private

Definition at line 69 of file EcalZmassTask.cc.

◆ h_e1_et

MonitorElement* EcalZmassTask::h_e1_et
private

Definition at line 62 of file EcalZmassTask.cc.

◆ h_e1_eta

MonitorElement* EcalZmassTask::h_e1_eta
private

Definition at line 64 of file EcalZmassTask.cc.

◆ h_e1_phi

MonitorElement* EcalZmassTask::h_e1_phi
private

Definition at line 66 of file EcalZmassTask.cc.

◆ h_e2_et

MonitorElement* EcalZmassTask::h_e2_et
private

Definition at line 63 of file EcalZmassTask.cc.

◆ h_e2_eta

MonitorElement* EcalZmassTask::h_e2_eta
private

Definition at line 65 of file EcalZmassTask.cc.

◆ h_e2_phi

MonitorElement* EcalZmassTask::h_e2_phi
private

Definition at line 67 of file EcalZmassTask.cc.

◆ h_ee_invMass

MonitorElement* EcalZmassTask::h_ee_invMass
private

Definition at line 61 of file EcalZmassTask.cc.

◆ h_ee_invMass_BB

MonitorElement* EcalZmassTask::h_ee_invMass_BB
private

Definition at line 60 of file EcalZmassTask.cc.

Referenced by analyze(), and bookHistograms().

◆ h_ee_invMass_EB

MonitorElement* EcalZmassTask::h_ee_invMass_EB
private

Definition at line 58 of file EcalZmassTask.cc.

Referenced by analyze(), and bookHistograms().

◆ h_ee_invMass_EE

MonitorElement* EcalZmassTask::h_ee_invMass_EE
private

Definition at line 59 of file EcalZmassTask.cc.

Referenced by analyze(), and bookHistograms().

◆ prefixME_

const std::string EcalZmassTask::prefixME_
private

Definition at line 56 of file EcalZmassTask.cc.

Referenced by bookHistograms().

◆ trackCollectionToken_

const edm::EDGetTokenT<reco::GsfTrackCollection> EcalZmassTask::trackCollectionToken_
private

Definition at line 54 of file EcalZmassTask.cc.

Referenced by analyze().

EcalZmassTask::electronCollectionToken_
const edm::EDGetTokenT< reco::GsfElectronCollection > electronCollectionToken_
Definition: EcalZmassTask.cc:53
edm
HLT enums.
Definition: AlignableModifier.h:19
EcalZmassTask::h_ee_invMass_EB
MonitorElement * h_ee_invMass_EB
Definition: EcalZmassTask.cc:58
pdwgLeptonRecoSkim_cfi.electronCollection
electronCollection
Definition: pdwgLeptonRecoSkim_cfi.py:5
edm::Handle< reco::GsfElectronCollection >
parameters
parameters
Definition: BeamSpot_PayloadInspector.cc:14
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalZmassTask::h_ee_invMass_EE
MonitorElement * h_ee_invMass_EE
Definition: EcalZmassTask.cc:59
EcalZmassTask::h_ee_invMass_BB
MonitorElement * h_ee_invMass_BB
Definition: EcalZmassTask.cc:60
iEvent
int iEvent
Definition: GenABIO.cc:224
HE
Definition: GlobalHaloAlgo.cc:15
EcalZmassTask::prefixME_
const std::string prefixME_
Definition: EcalZmassTask.cc:56
reco::HitPattern::MISSING_INNER_HITS
Definition: HitPattern.h:155
LV
math::XYZTLorentzVectorD LV
Definition: HLTTauDQMPlotter.h:15
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
EcalZmassTask::trackCollectionToken_
const edm::EDGetTokenT< reco::GsfTrackCollection > trackCollectionToken_
Definition: EcalZmassTask.cc:54
edm::InputTag
Definition: InputTag.h:15