CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
EcalZmassTask Class Reference
Inheritance diagram for EcalZmassTask:
edm::EDAnalyzer

Public Member Functions

 EcalZmassTask (const edm::ParameterSet &)
 
 ~EcalZmassTask ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 

Private Attributes

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::InputTag theElectronCollectionLabel
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 52 of file EcalZmassTask.cc.

Constructor & Destructor Documentation

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

Definition at line 90 of file EcalZmassTask.cc.

90  :
91  theElectronCollectionLabel(parameters.getParameter < edm::InputTag > ("electronCollection")),
92  prefixME_(parameters.getUntrackedParameter < std::string > ("prefixME", ""))
93 {
94 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const std::string prefixME_
const edm::InputTag theElectronCollectionLabel
EcalZmassTask::~EcalZmassTask ( )

Definition at line 96 of file EcalZmassTask.cc.

97 {
98 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 102 of file EcalZmassTask.cc.

References MonitorElement::Fill(), edm::Event::getByLabel(), h_ee_invMass_BB, h_ee_invMass_EB, h_ee_invMass_EE, and theElectronCollectionLabel.

104 {
105  using namespace edm;
106  Handle < reco::GsfElectronCollection > electronCollection;
107  iEvent.getByLabel (theElectronCollectionLabel, electronCollection);
108  if (!electronCollection.isValid ()) return;
109 
110  //get GSF Tracks
112  iEvent.getByLabel ("electronGsfTracks", gsftracks_h);
113 
114  bool isIsolatedBarrel;
115  bool isIDBarrel;
116  bool isConvertedBarrel;
117  bool isIsolatedEndcap;
118  bool isIDEndcap;
119  bool isConvertedEndcap;
120 
121  int elIsAccepted=0;
122  int elIsAcceptedEB=0;
123  int elIsAcceptedEE=0;
124 
125  std::vector<TLorentzVector> LV;
126 
127  for (reco::GsfElectronCollection::const_iterator recoElectron =
128  electronCollection->begin ();
129  recoElectron != electronCollection->end (); recoElectron++)
130  {
131 
132  if (recoElectron->et () <= 25)
133  continue;
134 
135  // Define Isolation variables
136  double IsoTrk = (recoElectron->dr03TkSumPt () / recoElectron->et ());
137  double IsoEcal =
138  (recoElectron->dr03EcalRecHitSumEt () / recoElectron->et ());
139  double IsoHcal =
140  (recoElectron->dr03HcalTowerSumEt () / recoElectron->et ());
141  double HE = (recoElectron->hcalOverEcal ());
142 
143  //Define ID variables
144 
145  float DeltaPhiTkClu = recoElectron->deltaPhiSuperClusterTrackAtVtx ();
146  float DeltaEtaTkClu = recoElectron->deltaEtaSuperClusterTrackAtVtx ();
147  float sigmaIeIe = recoElectron->sigmaIetaIeta ();
148 
149  //Define Conversion Rejection Variables
150 
151  float Dcot = recoElectron->convDcot ();
152  float Dist = recoElectron->convDist ();
153  int NumberOfExpectedInnerHits =
154  recoElectron->gsfTrack ()->trackerExpectedHitsInner ().
155  numberOfHits ();
156 
157  //quality flags
158 
159  isIsolatedBarrel = false;
160  isIDBarrel = false;
161  isConvertedBarrel = false;
162  isIsolatedEndcap = false;
163  isIDEndcap = false;
164  isConvertedEndcap = false;
165 
166 
167  /***** Barrel WP80 Cuts *****/
168 
169  if (fabs (recoElectron->eta ()) <= 1.4442)
170  {
171 
172  /* Isolation */
173  if (IsoTrk < 0.09 && IsoEcal < 0.07 && IsoHcal < 0.10)
174  {
175  isIsolatedBarrel = true;
176  }
177 
178  /* Identification */
179  if (fabs (DeltaEtaTkClu) < 0.004 && fabs (DeltaPhiTkClu) < 0.06
180  && sigmaIeIe < 0.01 && HE < 0.04)
181  {
182  isIDBarrel = true;
183  }
184 
185  /* Conversion Rejection */
186  if ((fabs (Dist) >= 0.02 || fabs (Dcot) >= 0.02)
187  && NumberOfExpectedInnerHits <= 1.0)
188  {
189  isConvertedBarrel = true;
190  }
191  }
192 
193  if (isIsolatedBarrel && isIDBarrel && isConvertedBarrel) {
194  elIsAccepted++;
195  elIsAcceptedEB++;
196  TLorentzVector b_e2(recoElectron->momentum ().x (),recoElectron->momentum ().y (),recoElectron->momentum ().z (), recoElectron->p ());
197  LV.push_back(b_e2);
198  }
199 
200  /***** Endcap WP80 Cuts *****/
201 
202  if (fabs (recoElectron->eta ()) >= 1.5660
203  && fabs (recoElectron->eta ()) <= 2.5000)
204  {
205 
206  /* Isolation */
207  if (IsoTrk < 0.04 && IsoEcal < 0.05 && IsoHcal < 0.025)
208  {
209  isIsolatedEndcap = true;
210  }
211 
212  /* Identification */
213  if (fabs (DeltaEtaTkClu) < 0.007 && fabs (DeltaPhiTkClu) < 0.03
214  && sigmaIeIe < 0.031 && HE < 0.15)
215  {
216  isIDEndcap = true;
217  }
218 
219  /* Conversion Rejection */
220  if ((fabs (Dcot) > 0.02 || fabs (Dist) > 0.02)
221  && NumberOfExpectedInnerHits <= 1.0)
222  {
223  isConvertedEndcap = true;
224  }
225  }
226  if (isIsolatedEndcap && isIDEndcap && isConvertedEndcap) {
227  elIsAccepted++;
228  elIsAcceptedEE++;
229  TLorentzVector e_e2(recoElectron->momentum ().x (),recoElectron->momentum ().y (),recoElectron->momentum ().z (), recoElectron->p ());
230  LV.push_back(e_e2);
231  }
232 
233  }
234 
235  // Calculate the Z invariant masses
236 
237  if (elIsAccepted>1){
238  double e_ee_invMass=0;
239  if (elIsAccepted>2) edm::LogWarning("EcalZmassTask") << "WARNING: In this events we have more than two electrons accpeted!!!!!!!";
240  if (LV.size()==2){
241  TLorentzVector e_pair = LV[0] + LV[1];
242  e_ee_invMass = e_pair.M ();
243  }
244 
245  if (elIsAcceptedEB==2){
246  h_ee_invMass_BB->Fill(e_ee_invMass);
247  }
248  if (elIsAcceptedEE==2){
249  h_ee_invMass_EE->Fill(e_ee_invMass);
250  }
251  if (elIsAcceptedEB==1 && elIsAcceptedEE==1){
252  h_ee_invMass_EB->Fill(e_ee_invMass);
253  }
254 
255  LV.clear();
256 
257  }
258 }
MonitorElement * h_ee_invMass_EB
void Fill(long long x)
math::XYZTLorentzVectorD LV
const edm::InputTag theElectronCollectionLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
MonitorElement * h_ee_invMass_EE
MonitorElement * h_ee_invMass_BB
void EcalZmassTask::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 262 of file EcalZmassTask.cc.

References DQMStore::book1D(), h_ee_invMass_BB, h_ee_invMass_EB, h_ee_invMass_EE, LogTrace, cppFunctionSkipper::operator, prefixME_, and DQMStore::setCurrentFolder().

263 {
264 
265  DQMStore *theDbe;
266  std::string logTraceName("EcalZmassTask");
267 
268  h_ee_invMass_EB = 0;
269  h_ee_invMass_EE = 0;
270  h_ee_invMass_BB = 0;
271 
272  LogTrace (logTraceName) << "Parameters initialization";
273  theDbe = edm::Service < DQMStore > ().operator-> ();
274 
275  if (theDbe != 0)
276  {
277  theDbe->setCurrentFolder (prefixME_ + "/Zmass"); // Use folder with name of PAG
278 
279 
281  theDbe->book1D ("Z peak - WP80 EB-EE",
282  "Z peak - WP80 EB-EE;InvMass (GeV)", 60, 60.0, 120.0);
284  theDbe->book1D ("Z peak - WP80 EE-EE",
285  "Z peak - WP80 EE-EE;InvMass (Gev)", 60, 60.0, 120.0);
287  theDbe->book1D ("Z peak - WP80 EB-EB",
288  "Z peak - WP80 EB-EB;InvMass (Gev)", 60, 60.0, 120.0);
289  }
290 }
MonitorElement * h_ee_invMass_EB
const std::string prefixME_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
MonitorElement * h_ee_invMass_EE
#define LogTrace(id)
MonitorElement * h_ee_invMass_BB
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void EcalZmassTask::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 313 of file EcalZmassTask.cc.

315 {
316 }
void EcalZmassTask::beginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 300 of file EcalZmassTask.cc.

301 {
302 
303 }
void EcalZmassTask::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 294 of file EcalZmassTask.cc.

295 {
296 }
void EcalZmassTask::endLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 320 of file EcalZmassTask.cc.

322 {
323 }
void EcalZmassTask::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 307 of file EcalZmassTask.cc.

308 {
309 }
void EcalZmassTask::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 327 of file EcalZmassTask.cc.

References edm::ParameterSetDescription::setUnknown().

329 {
330  //The following says we do not know what parameters are allowed so do no validation
331  // Please change this to state exactly what you do use, even if it is no parameters
333  desc.setUnknown ();
334  descriptions.addDefault (desc);
335 }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

MonitorElement* EcalZmassTask::h_95_ee_invMass_BB
private

Definition at line 86 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_95_ee_invMass_EB
private

Definition at line 84 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_95_ee_invMass_EE
private

Definition at line 85 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_e1_et
private

Definition at line 78 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_e1_eta
private

Definition at line 80 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_e1_phi
private

Definition at line 82 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_e2_et
private

Definition at line 79 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_e2_eta
private

Definition at line 81 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_e2_phi
private

Definition at line 83 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_ee_invMass
private

Definition at line 77 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_ee_invMass_BB
private

Definition at line 76 of file EcalZmassTask.cc.

Referenced by analyze(), and beginJob().

MonitorElement* EcalZmassTask::h_ee_invMass_EB
private

Definition at line 74 of file EcalZmassTask.cc.

Referenced by analyze(), and beginJob().

MonitorElement* EcalZmassTask::h_ee_invMass_EE
private

Definition at line 75 of file EcalZmassTask.cc.

Referenced by analyze(), and beginJob().

const std::string EcalZmassTask::prefixME_
private

Definition at line 72 of file EcalZmassTask.cc.

Referenced by beginJob().

const edm::InputTag EcalZmassTask::theElectronCollectionLabel
private

Definition at line 70 of file EcalZmassTask.cc.

Referenced by analyze().