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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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 >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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 43 of file EcalZmassTask.cc.

Constructor & Destructor Documentation

◆ EcalZmassTask()

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

Definition at line 72 of file EcalZmassTask.cc.

74  consumes<reco::GsfElectronCollection>(parameters.getParameter<edm::InputTag>("electronCollection"))),
76  consumes<reco::GsfTrackCollection>(parameters.getParameter<edm::InputTag>("trackCollection"))),
77  prefixME_(parameters.getUntrackedParameter<std::string>("prefixME", "")) {}
const std::string prefixME_
const edm::EDGetTokenT< reco::GsfElectronCollection > electronCollectionToken_
const edm::EDGetTokenT< reco::GsfTrackCollection > trackCollectionToken_

◆ ~EcalZmassTask()

EcalZmassTask::~EcalZmassTask ( )
inlineoverride

Definition at line 46 of file EcalZmassTask.cc.

46 {}

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 80 of file EcalZmassTask.cc.

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_.

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

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 215 of file EcalZmassTask.cc.

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.

215  {
216  std::string logTraceName("EcalZmassTask");
217 
218  h_ee_invMass_EB = nullptr;
219  h_ee_invMass_EE = nullptr;
220  h_ee_invMass_BB = nullptr;
221 
222  LogTrace(logTraceName) << "Parameters initialization";
223 
224  iBooker.setCurrentFolder(prefixME_ + "/Zmass"); // Use folder with name of PAG
225 
226  h_ee_invMass_EB = iBooker.book1D("Z peak - WP80 EB-EE", "Z peak - WP80 EB-EE;InvMass (GeV)", 60, 60.0, 120.0);
227  h_ee_invMass_EE = iBooker.book1D("Z peak - WP80 EE-EE", "Z peak - WP80 EE-EE;InvMass (Gev)", 60, 60.0, 120.0);
228  h_ee_invMass_BB = iBooker.book1D("Z peak - WP80 EB-EB", "Z peak - WP80 EB-EB;InvMass (Gev)", 60, 60.0, 120.0);
229 }
MonitorElement * h_ee_invMass_EB
const std::string prefixME_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
#define LogTrace(id)
MonitorElement * h_ee_invMass_EE
MonitorElement * h_ee_invMass_BB
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

Member Data Documentation

◆ electronCollectionToken_

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

Definition at line 52 of file EcalZmassTask.cc.

Referenced by analyze().

◆ h_95_ee_invMass_BB

MonitorElement* EcalZmassTask::h_95_ee_invMass_BB
private

Definition at line 69 of file EcalZmassTask.cc.

◆ h_95_ee_invMass_EB

MonitorElement* EcalZmassTask::h_95_ee_invMass_EB
private

Definition at line 67 of file EcalZmassTask.cc.

◆ h_95_ee_invMass_EE

MonitorElement* EcalZmassTask::h_95_ee_invMass_EE
private

Definition at line 68 of file EcalZmassTask.cc.

◆ h_e1_et

MonitorElement* EcalZmassTask::h_e1_et
private

Definition at line 61 of file EcalZmassTask.cc.

◆ h_e1_eta

MonitorElement* EcalZmassTask::h_e1_eta
private

Definition at line 63 of file EcalZmassTask.cc.

◆ h_e1_phi

MonitorElement* EcalZmassTask::h_e1_phi
private

Definition at line 65 of file EcalZmassTask.cc.

◆ h_e2_et

MonitorElement* EcalZmassTask::h_e2_et
private

Definition at line 62 of file EcalZmassTask.cc.

◆ h_e2_eta

MonitorElement* EcalZmassTask::h_e2_eta
private

Definition at line 64 of file EcalZmassTask.cc.

◆ h_e2_phi

MonitorElement* EcalZmassTask::h_e2_phi
private

Definition at line 66 of file EcalZmassTask.cc.

◆ h_ee_invMass

MonitorElement* EcalZmassTask::h_ee_invMass
private

Definition at line 60 of file EcalZmassTask.cc.

◆ h_ee_invMass_BB

MonitorElement* EcalZmassTask::h_ee_invMass_BB
private

Definition at line 59 of file EcalZmassTask.cc.

Referenced by analyze(), and bookHistograms().

◆ h_ee_invMass_EB

MonitorElement* EcalZmassTask::h_ee_invMass_EB
private

Definition at line 57 of file EcalZmassTask.cc.

Referenced by analyze(), and bookHistograms().

◆ h_ee_invMass_EE

MonitorElement* EcalZmassTask::h_ee_invMass_EE
private

Definition at line 58 of file EcalZmassTask.cc.

Referenced by analyze(), and bookHistograms().

◆ prefixME_

const std::string EcalZmassTask::prefixME_
private

Definition at line 55 of file EcalZmassTask.cc.

Referenced by bookHistograms().

◆ trackCollectionToken_

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

Definition at line 53 of file EcalZmassTask.cc.

Referenced by analyze().