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
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- 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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) 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
 
- 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::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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, 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 =
137  recoElectron->gsfTrack ()->trackerExpectedHitsInner ().
138  numberOfHits ();
139 
140  //quality flags
141 
142  isIsolatedBarrel = false;
143  isIDBarrel = false;
144  isConvertedBarrel = false;
145  isIsolatedEndcap = false;
146  isIDEndcap = false;
147  isConvertedEndcap = false;
148 
149 
150  /***** Barrel WP80 Cuts *****/
151 
152  if (fabs (recoElectron->eta ()) <= 1.4442)
153  {
154 
155  /* Isolation */
156  if (IsoTrk < 0.09 && IsoEcal < 0.07 && IsoHcal < 0.10)
157  {
158  isIsolatedBarrel = true;
159  }
160 
161  /* Identification */
162  if (fabs (DeltaEtaTkClu) < 0.004 && fabs (DeltaPhiTkClu) < 0.06
163  && sigmaIeIe < 0.01 && HE < 0.04)
164  {
165  isIDBarrel = true;
166  }
167 
168  /* Conversion Rejection */
169  if ((fabs (Dist) >= 0.02 || fabs (Dcot) >= 0.02)
170  && NumberOfExpectedInnerHits <= 1.0)
171  {
172  isConvertedBarrel = true;
173  }
174  }
175 
176  if (isIsolatedBarrel && isIDBarrel && isConvertedBarrel) {
177  elIsAccepted++;
178  elIsAcceptedEB++;
179  TLorentzVector b_e2(recoElectron->momentum ().x (),recoElectron->momentum ().y (),recoElectron->momentum ().z (), recoElectron->p ());
180  LV.push_back(b_e2);
181  }
182 
183  /***** Endcap WP80 Cuts *****/
184 
185  if (fabs (recoElectron->eta ()) >= 1.5660
186  && fabs (recoElectron->eta ()) <= 2.5000)
187  {
188 
189  /* Isolation */
190  if (IsoTrk < 0.04 && IsoEcal < 0.05 && IsoHcal < 0.025)
191  {
192  isIsolatedEndcap = true;
193  }
194 
195  /* Identification */
196  if (fabs (DeltaEtaTkClu) < 0.007 && fabs (DeltaPhiTkClu) < 0.03
197  && sigmaIeIe < 0.031 && HE < 0.15)
198  {
199  isIDEndcap = true;
200  }
201 
202  /* Conversion Rejection */
203  if ((fabs (Dcot) > 0.02 || fabs (Dist) > 0.02)
204  && NumberOfExpectedInnerHits <= 1.0)
205  {
206  isConvertedEndcap = true;
207  }
208  }
209  if (isIsolatedEndcap && isIDEndcap && isConvertedEndcap) {
210  elIsAccepted++;
211  elIsAcceptedEE++;
212  TLorentzVector e_e2(recoElectron->momentum ().x (),recoElectron->momentum ().y (),recoElectron->momentum ().z (), recoElectron->p ());
213  LV.push_back(e_e2);
214  }
215 
216  }
217 
218  // Calculate the Z invariant masses
219 
220  if (elIsAccepted>1){
221  double e_ee_invMass=0;
222  if (LV.size()==2){
223  TLorentzVector e_pair = LV[0] + LV[1];
224  e_ee_invMass = e_pair.M ();
225  }
226 
227  if (elIsAcceptedEB==2){
228  h_ee_invMass_BB->Fill(e_ee_invMass);
229  }
230  if (elIsAcceptedEE==2){
231  h_ee_invMass_EE->Fill(e_ee_invMass);
232  }
233  if (elIsAcceptedEB==1 && elIsAcceptedEE==1){
234  h_ee_invMass_EB->Fill(e_ee_invMass);
235  }
236 
237  LV.clear();
238 
239  }
240 }
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::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 243 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.

244 {
245  std::string logTraceName("EcalZmassTask");
246 
247  h_ee_invMass_EB = 0;
248  h_ee_invMass_EE = 0;
249  h_ee_invMass_BB = 0;
250 
251  LogTrace (logTraceName) << "Parameters initialization";
252 
253  iBooker.setCurrentFolder (prefixME_ + "/Zmass"); // Use folder with name of PAG
254 
256  iBooker.book1D ("Z peak - WP80 EB-EE",
257  "Z peak - WP80 EB-EE;InvMass (GeV)", 60, 60.0, 120.0);
259  iBooker.book1D ("Z peak - WP80 EE-EE",
260  "Z peak - WP80 EE-EE;InvMass (Gev)", 60, 60.0, 120.0);
262  iBooker.book1D ("Z peak - WP80 EB-EB",
263  "Z peak - WP80 EB-EB;InvMass (Gev)", 60, 60.0, 120.0);
264 }
MonitorElement * h_ee_invMass_EB
const std::string prefixME_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:113
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().