CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalZmassTask Class Reference
Inheritance diagram for EcalZmassTask:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 EcalZmassTask (const edm::ParameterSet &)
 
 ~EcalZmassTask ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual 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::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::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 45 of file EcalZmassTask.cc.

Constructor & Destructor Documentation

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

Definition at line 76 of file EcalZmassTask.cc.

76  :
77  electronCollectionToken_(consumes<reco::GsfElectronCollection>(parameters.getParameter < edm::InputTag > ("electronCollection"))),
78  trackCollectionToken_(consumes<reco::GsfTrackCollection>(parameters.getParameter<edm::InputTag>("trackCollection"))),
79  prefixME_(parameters.getUntrackedParameter < std::string > ("prefixME", ""))
80 {
81 }
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 ( )
inline

Definition at line 49 of file EcalZmassTask.cc.

49 {}

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 85 of file EcalZmassTask.cc.

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

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

Implements DQMEDAnalyzer.

Definition at line 241 of file EcalZmassTask.cc.

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

242 {
243  std::string logTraceName("EcalZmassTask");
244 
245  h_ee_invMass_EB = 0;
246  h_ee_invMass_EE = 0;
247  h_ee_invMass_BB = 0;
248 
249  LogTrace (logTraceName) << "Parameters initialization";
250 
251  iBooker.setCurrentFolder (prefixME_ + "/Zmass"); // Use folder with name of PAG
252 
254  iBooker.book1D ("Z peak - WP80 EB-EE",
255  "Z peak - WP80 EB-EE;InvMass (GeV)", 60, 60.0, 120.0);
257  iBooker.book1D ("Z peak - WP80 EE-EE",
258  "Z peak - WP80 EE-EE;InvMass (Gev)", 60, 60.0, 120.0);
260  iBooker.book1D ("Z peak - WP80 EB-EB",
261  "Z peak - WP80 EB-EB;InvMass (Gev)", 60, 60.0, 120.0);
262 }
MonitorElement * h_ee_invMass_EB
const std::string prefixME_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * h_ee_invMass_EE
#define LogTrace(id)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * h_ee_invMass_BB

Member Data Documentation

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

Definition at line 55 of file EcalZmassTask.cc.

Referenced by analyze().

MonitorElement* EcalZmassTask::h_95_ee_invMass_BB
private

Definition at line 72 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_95_ee_invMass_EB
private

Definition at line 70 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_95_ee_invMass_EE
private

Definition at line 71 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_e1_et
private

Definition at line 64 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_e1_eta
private

Definition at line 66 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_e1_phi
private

Definition at line 68 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_e2_et
private

Definition at line 65 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_e2_eta
private

Definition at line 67 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_e2_phi
private

Definition at line 69 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_ee_invMass
private

Definition at line 63 of file EcalZmassTask.cc.

MonitorElement* EcalZmassTask::h_ee_invMass_BB
private

Definition at line 62 of file EcalZmassTask.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalZmassTask::h_ee_invMass_EB
private

Definition at line 60 of file EcalZmassTask.cc.

Referenced by analyze(), and bookHistograms().

MonitorElement* EcalZmassTask::h_ee_invMass_EE
private

Definition at line 61 of file EcalZmassTask.cc.

Referenced by analyze(), and bookHistograms().

const std::string EcalZmassTask::prefixME_
private

Definition at line 58 of file EcalZmassTask.cc.

Referenced by bookHistograms().

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

Definition at line 56 of file EcalZmassTask.cc.

Referenced by analyze().