CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalZmassTask Class Reference
Inheritance diagram for EcalZmassTask:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

 EcalZmassTask (const edm::ParameterSet &)
 
 ~EcalZmassTask () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

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_
 

Detailed Description

Definition at line 44 of file EcalZmassTask.cc.

Constructor & Destructor Documentation

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", "")) {}
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const std::string prefixME_
const edm::EDGetTokenT< reco::GsfElectronCollection > electronCollectionToken_
const edm::EDGetTokenT< reco::GsfTrackCollection > trackCollectionToken_
EcalZmassTask::~EcalZmassTask ( )
inlineoverride

Definition at line 47 of file EcalZmassTask.cc.

References analyze(), and bookHistograms().

47 {}

Member Function Documentation

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

Definition at line 81 of file EcalZmassTask.cc.

References ElectronMcFakeValidator_cfi::electronCollection, electronCollectionToken_, MonitorElement::Fill(), edm::Event::getByToken(), h_ee_invMass_BB, h_ee_invMass_EB, h_ee_invMass_EE, HE, edm::HandleBase::isValid(), reco::HitPattern::MISSING_INNER_HITS, and trackCollectionToken_.

Referenced by ~EcalZmassTask().

81  {
82  using namespace edm;
84  iEvent.getByToken(electronCollectionToken_, electronCollection);
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 }
MonitorElement * h_ee_invMass_EB
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
math::XYZTLorentzVectorD LV
const edm::EDGetTokenT< reco::GsfElectronCollection > electronCollectionToken_
void Fill(long long x)
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * h_ee_invMass_EE
MonitorElement * h_ee_invMass_BB
HLT enums.
const edm::EDGetTokenT< reco::GsfTrackCollection > trackCollectionToken_
void EcalZmassTask::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivate

Definition at line 216 of file EcalZmassTask.cc.

References DQMStore::IBooker::book1D(), DEFINE_FWK_MODULE, h_ee_invMass_BB, h_ee_invMass_EB, h_ee_invMass_EE, LogTrace, prefixME_, DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ~EcalZmassTask().

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 }
MonitorElement * h_ee_invMass_EB
const std::string prefixME_
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * h_ee_invMass_EE
#define LogTrace(id)
MonitorElement * h_ee_invMass_BB

Member Data Documentation

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

Definition at line 53 of file EcalZmassTask.cc.

Referenced by analyze().

MonitorElement* EcalZmassTask::h_95_ee_invMass_BB
private

Definition at line 70 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_95_ee_invMass_EB
private

Definition at line 68 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_95_ee_invMass_EE
private

Definition at line 69 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_e1_et
private

Definition at line 62 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_e1_eta
private

Definition at line 64 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_e1_phi
private

Definition at line 66 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_e2_et
private

Definition at line 63 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_e2_eta
private

Definition at line 65 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_e2_phi
private

Definition at line 67 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_ee_invMass
private

Definition at line 61 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_ee_invMass_BB
private

Definition at line 60 of file EcalZmassTask.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalZmassTask::h_ee_invMass_EB
private

Definition at line 58 of file EcalZmassTask.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalZmassTask::h_ee_invMass_EE
private

Definition at line 59 of file EcalZmassTask.cc.

Referenced by analyze(), and bookHistograms().

const std::string EcalZmassTask::prefixME_
private

Definition at line 56 of file EcalZmassTask.cc.

Referenced by bookHistograms().

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

Definition at line 54 of file EcalZmassTask.cc.

Referenced by analyze().