34 #include "TLorentzVector.h"
62 virtual void endJob ()
override;
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",
""))
109 if (!electronCollection.isValid ())
return;
115 bool isIsolatedBarrel;
117 bool isConvertedBarrel;
118 bool isIsolatedEndcap;
120 bool isConvertedEndcap;
123 int elIsAcceptedEB=0;
124 int elIsAcceptedEE=0;
126 std::vector<TLorentzVector>
LV;
128 for (reco::GsfElectronCollection::const_iterator recoElectron =
129 electronCollection->begin ();
130 recoElectron != electronCollection->end (); recoElectron++)
133 if (recoElectron->et () <= 25)
137 double IsoTrk = (recoElectron->dr03TkSumPt () / recoElectron->et ());
139 (recoElectron->dr03EcalRecHitSumEt () / recoElectron->et ());
141 (recoElectron->dr03HcalTowerSumEt () / recoElectron->et ());
142 double HE = (recoElectron->hcalOverEcal ());
146 float DeltaPhiTkClu = recoElectron->deltaPhiSuperClusterTrackAtVtx ();
147 float DeltaEtaTkClu = recoElectron->deltaEtaSuperClusterTrackAtVtx ();
148 float sigmaIeIe = recoElectron->sigmaIetaIeta ();
152 float Dcot = recoElectron->convDcot ();
153 float Dist = recoElectron->convDist ();
154 int NumberOfExpectedInnerHits =
155 recoElectron->gsfTrack ()->trackerExpectedHitsInner ().
160 isIsolatedBarrel =
false;
162 isConvertedBarrel =
false;
163 isIsolatedEndcap =
false;
165 isConvertedEndcap =
false;
170 if (fabs (recoElectron->eta ()) <= 1.4442)
174 if (IsoTrk < 0.09 && IsoEcal < 0.07 && IsoHcal < 0.10)
176 isIsolatedBarrel =
true;
180 if (fabs (DeltaEtaTkClu) < 0.004 && fabs (DeltaPhiTkClu) < 0.06
181 && sigmaIeIe < 0.01 && HE < 0.04)
187 if ((fabs (Dist) >= 0.02 || fabs (Dcot) >= 0.02)
188 && NumberOfExpectedInnerHits <= 1.0)
190 isConvertedBarrel =
true;
194 if (isIsolatedBarrel && isIDBarrel && isConvertedBarrel) {
197 TLorentzVector b_e2(recoElectron->momentum ().x (),recoElectron->momentum ().y (),recoElectron->momentum ().z (), recoElectron->p ());
203 if (fabs (recoElectron->eta ()) >= 1.5660
204 && fabs (recoElectron->eta ()) <= 2.5000)
208 if (IsoTrk < 0.04 && IsoEcal < 0.05 && IsoHcal < 0.025)
210 isIsolatedEndcap =
true;
214 if (fabs (DeltaEtaTkClu) < 0.007 && fabs (DeltaPhiTkClu) < 0.03
215 && sigmaIeIe < 0.031 && HE < 0.15)
221 if ((fabs (Dcot) > 0.02 || fabs (Dist) > 0.02)
222 && NumberOfExpectedInnerHits <= 1.0)
224 isConvertedEndcap =
true;
227 if (isIsolatedEndcap && isIDEndcap && isConvertedEndcap) {
230 TLorentzVector e_e2(recoElectron->momentum ().x (),recoElectron->momentum ().y (),recoElectron->momentum ().z (), recoElectron->p ());
239 double e_ee_invMass=0;
241 TLorentzVector e_pair =
LV[0] +
LV[1];
242 e_ee_invMass = e_pair.M ();
245 if (elIsAcceptedEB==2){
248 if (elIsAcceptedEE==2){
251 if (elIsAcceptedEB==1 && elIsAcceptedEE==1){
272 LogTrace (logTraceName) <<
"Parameters initialization";
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);
334 descriptions.addDefault (desc);
MonitorElement * h_e2_eta
MonitorElement * h_ee_invMass_EB
const std::string prefixME_
virtual void beginJob() override
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
MonitorElement * h_e1_phi
MonitorElement * h_95_ee_invMass_EE
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * h_95_ee_invMass_EB
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
virtual void beginRun(edm::Run const &, edm::EventSetup const &) override
virtual void endRun(edm::Run const &, edm::EventSetup const &) override
const edm::EDGetTokenT< reco::GsfElectronCollection > electronCollectionToken_
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
EcalZmassTask(const edm::ParameterSet &)
math::XYZTLorentzVectorD LV
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
MonitorElement * h_ee_invMass_EE
virtual void endJob() override
MonitorElement * h_ee_invMass
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * h_95_ee_invMass_BB
MonitorElement * h_ee_invMass_BB
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::EDGetTokenT< reco::GsfTrackCollection > trackCollectionToken_
MonitorElement * h_e2_phi
MonitorElement * h_e1_eta
void setCurrentFolder(const std::string &fullpath)