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 edm::EDConsumerBase

Public Member Functions

 EcalZmassTask (const edm::ParameterSet &)
 
 ~EcalZmassTask ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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 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)
 

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 (LV.size()==2){
240  TLorentzVector e_pair = LV[0] + LV[1];
241  e_ee_invMass = e_pair.M ();
242  }
243 
244  if (elIsAcceptedEB==2){
245  h_ee_invMass_BB->Fill(e_ee_invMass);
246  }
247  if (elIsAcceptedEE==2){
248  h_ee_invMass_EE->Fill(e_ee_invMass);
249  }
250  if (elIsAcceptedEB==1 && elIsAcceptedEE==1){
251  h_ee_invMass_EB->Fill(e_ee_invMass);
252  }
253 
254  LV.clear();
255 
256  }
257 }
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:361
MonitorElement * h_ee_invMass_EE
MonitorElement * h_ee_invMass_BB
void EcalZmassTask::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 261 of file EcalZmassTask.cc.

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

262 {
263 
264  DQMStore *theDbe;
265  std::string logTraceName("EcalZmassTask");
266 
267  h_ee_invMass_EB = 0;
268  h_ee_invMass_EE = 0;
269  h_ee_invMass_BB = 0;
270 
271  LogTrace (logTraceName) << "Parameters initialization";
272  theDbe = edm::Service < DQMStore > ().operator-> ();
273 
274  if (theDbe != 0)
275  {
276  theDbe->setCurrentFolder (prefixME_ + "/Zmass"); // Use folder with name of PAG
277 
278 
280  theDbe->book1D ("Z peak - WP80 EB-EE",
281  "Z peak - WP80 EB-EE;InvMass (GeV)", 60, 60.0, 120.0);
283  theDbe->book1D ("Z peak - WP80 EE-EE",
284  "Z peak - WP80 EE-EE;InvMass (Gev)", 60, 60.0, 120.0);
286  theDbe->book1D ("Z peak - WP80 EB-EB",
287  "Z peak - WP80 EB-EB;InvMass (Gev)", 60, 60.0, 120.0);
288  }
289 }
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:722
MonitorElement * h_ee_invMass_EE
#define LogTrace(id)
MonitorElement * h_ee_invMass_BB
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
void EcalZmassTask::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 312 of file EcalZmassTask.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 299 of file EcalZmassTask.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 293 of file EcalZmassTask.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 319 of file EcalZmassTask.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 306 of file EcalZmassTask.cc.

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

Definition at line 326 of file EcalZmassTask.cc.

References edm::ParameterSetDescription::setUnknown().

328 {
329  //The following says we do not know what parameters are allowed so do no validation
330  // Please change this to state exactly what you do use, even if it is no parameters
332  desc.setUnknown ();
333  descriptions.addDefault (desc);
334 }
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().