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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) 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 &) override
 
virtual void beginJob () override
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &) override
 
virtual void endJob () override
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
virtual void endRun (edm::Run const &, edm::EventSetup const &) override
 

Private Attributes

const edm::EDGetTokenT
< reco::GsfElectronCollection
electronCollectionToken_
 
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::GsfTrackCollection
trackCollectionToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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 51 of file EcalZmassTask.cc.

Constructor & Destructor Documentation

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

Definition at line 90 of file EcalZmassTask.cc.

90  :
91  electronCollectionToken_(consumes<reco::GsfElectronCollection>(parameters.getParameter < edm::InputTag > ("electronCollection"))),
92  trackCollectionToken_(consumes<reco::GsfTrackCollection>(parameters.getParameter<edm::InputTag>("trackCollection"))),
93  prefixME_(parameters.getUntrackedParameter < std::string > ("prefixME", ""))
94 {
95 }
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 ( )

Definition at line 97 of file EcalZmassTask.cc.

98 {
99 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 103 of file EcalZmassTask.cc.

References electronCollectionToken_, MonitorElement::Fill(), edm::Event::getByToken(), h_ee_invMass_BB, h_ee_invMass_EB, h_ee_invMass_EE, and trackCollectionToken_.

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

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_, DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

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:872
MonitorElement * h_ee_invMass_EE
#define LogTrace(id)
MonitorElement * h_ee_invMass_BB
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void EcalZmassTask::beginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 313 of file EcalZmassTask.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 300 of file EcalZmassTask.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 294 of file EcalZmassTask.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 320 of file EcalZmassTask.cc.

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

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

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

Definition at line 69 of file EcalZmassTask.cc.

Referenced by analyze().

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::EDGetTokenT<reco::GsfTrackCollection> EcalZmassTask::trackCollectionToken_
private

Definition at line 70 of file EcalZmassTask.cc.

Referenced by analyze().