108 if (!electronCollection.isValid ())
return;
112 iEvent.
getByLabel (
"electronGsfTracks", gsftracks_h);
114 bool isIsolatedBarrel;
116 bool isConvertedBarrel;
117 bool isIsolatedEndcap;
119 bool isConvertedEndcap;
122 int elIsAcceptedEB=0;
123 int elIsAcceptedEE=0;
125 std::vector<TLorentzVector>
LV;
127 for (reco::GsfElectronCollection::const_iterator recoElectron =
128 electronCollection->begin ();
129 recoElectron != electronCollection->end (); recoElectron++)
132 if (recoElectron->et () <= 25)
136 double IsoTrk = (recoElectron->dr03TkSumPt () / recoElectron->et ());
138 (recoElectron->dr03EcalRecHitSumEt () / recoElectron->et ());
140 (recoElectron->dr03HcalTowerSumEt () / recoElectron->et ());
141 double HE = (recoElectron->hcalOverEcal ());
145 float DeltaPhiTkClu = recoElectron->deltaPhiSuperClusterTrackAtVtx ();
146 float DeltaEtaTkClu = recoElectron->deltaEtaSuperClusterTrackAtVtx ();
147 float sigmaIeIe = recoElectron->sigmaIetaIeta ();
151 float Dcot = recoElectron->convDcot ();
152 float Dist = recoElectron->convDist ();
153 int NumberOfExpectedInnerHits =
154 recoElectron->gsfTrack ()->trackerExpectedHitsInner ().
159 isIsolatedBarrel =
false;
161 isConvertedBarrel =
false;
162 isIsolatedEndcap =
false;
164 isConvertedEndcap =
false;
169 if (fabs (recoElectron->eta ()) <= 1.4442)
173 if (IsoTrk < 0.09 && IsoEcal < 0.07 && IsoHcal < 0.10)
175 isIsolatedBarrel =
true;
179 if (fabs (DeltaEtaTkClu) < 0.004 && fabs (DeltaPhiTkClu) < 0.06
180 && sigmaIeIe < 0.01 && HE < 0.04)
186 if ((fabs (Dist) >= 0.02 || fabs (Dcot) >= 0.02)
187 && NumberOfExpectedInnerHits <= 1.0)
189 isConvertedBarrel =
true;
193 if (isIsolatedBarrel && isIDBarrel && isConvertedBarrel) {
196 TLorentzVector b_e2(recoElectron->momentum ().x (),recoElectron->momentum ().y (),recoElectron->momentum ().z (), recoElectron->p ());
202 if (fabs (recoElectron->eta ()) >= 1.5660
203 && fabs (recoElectron->eta ()) <= 2.5000)
207 if (IsoTrk < 0.04 && IsoEcal < 0.05 && IsoHcal < 0.025)
209 isIsolatedEndcap =
true;
213 if (fabs (DeltaEtaTkClu) < 0.007 && fabs (DeltaPhiTkClu) < 0.03
214 && sigmaIeIe < 0.031 && HE < 0.15)
220 if ((fabs (Dcot) > 0.02 || fabs (Dist) > 0.02)
221 && NumberOfExpectedInnerHits <= 1.0)
223 isConvertedEndcap =
true;
226 if (isIsolatedEndcap && isIDEndcap && isConvertedEndcap) {
229 TLorentzVector e_e2(recoElectron->momentum ().x (),recoElectron->momentum ().y (),recoElectron->momentum ().z (), recoElectron->p ());
238 double e_ee_invMass=0;
240 TLorentzVector e_pair =
LV[0] +
LV[1];
241 e_ee_invMass = e_pair.M ();
244 if (elIsAcceptedEB==2){
247 if (elIsAcceptedEE==2){
250 if (elIsAcceptedEB==1 && elIsAcceptedEE==1){
MonitorElement * h_ee_invMass_EB
math::XYZTLorentzVectorD LV
const edm::InputTag theElectronCollectionLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MonitorElement * h_ee_invMass_EE
MonitorElement * h_ee_invMass_BB