91 if (!electronCollection.isValid ())
return;
97 bool isIsolatedBarrel;
99 bool isConvertedBarrel;
100 bool isIsolatedEndcap;
102 bool isConvertedEndcap;
105 int elIsAcceptedEB=0;
106 int elIsAcceptedEE=0;
108 std::vector<TLorentzVector>
LV;
110 for (reco::GsfElectronCollection::const_iterator recoElectron =
111 electronCollection->begin ();
112 recoElectron != electronCollection->end (); recoElectron++)
115 if (recoElectron->et () <= 25)
119 double IsoTrk = (recoElectron->dr03TkSumPt () / recoElectron->et ());
121 (recoElectron->dr03EcalRecHitSumEt () / recoElectron->et ());
123 (recoElectron->dr03HcalTowerSumEt () / recoElectron->et ());
124 double HE = (recoElectron->hcalOverEcal ());
128 float DeltaPhiTkClu = recoElectron->deltaPhiSuperClusterTrackAtVtx ();
129 float DeltaEtaTkClu = recoElectron->deltaEtaSuperClusterTrackAtVtx ();
130 float sigmaIeIe = recoElectron->sigmaIetaIeta ();
134 float Dcot = recoElectron->convDcot ();
135 float Dist = recoElectron->convDist ();
140 isIsolatedBarrel =
false;
142 isConvertedBarrel =
false;
143 isIsolatedEndcap =
false;
145 isConvertedEndcap =
false;
150 if (fabs (recoElectron->eta ()) <= 1.4442)
154 if (IsoTrk < 0.09 && IsoEcal < 0.07 && IsoHcal < 0.10)
156 isIsolatedBarrel =
true;
160 if (fabs (DeltaEtaTkClu) < 0.004 && fabs (DeltaPhiTkClu) < 0.06
161 && sigmaIeIe < 0.01 && HE < 0.04)
167 if ((fabs (Dist) >= 0.02 || fabs (Dcot) >= 0.02)
168 && NumberOfExpectedInnerHits <= 1.0)
170 isConvertedBarrel =
true;
174 if (isIsolatedBarrel && isIDBarrel && isConvertedBarrel) {
177 TLorentzVector b_e2(recoElectron->momentum ().x (),recoElectron->momentum ().y (),recoElectron->momentum ().z (), recoElectron->p ());
183 if (fabs (recoElectron->eta ()) >= 1.5660
184 && fabs (recoElectron->eta ()) <= 2.5000)
188 if (IsoTrk < 0.04 && IsoEcal < 0.05 && IsoHcal < 0.025)
190 isIsolatedEndcap =
true;
194 if (fabs (DeltaEtaTkClu) < 0.007 && fabs (DeltaPhiTkClu) < 0.03
195 && sigmaIeIe < 0.031 && HE < 0.15)
201 if ((fabs (Dcot) > 0.02 || fabs (Dist) > 0.02)
202 && NumberOfExpectedInnerHits <= 1.0)
204 isConvertedEndcap =
true;
207 if (isIsolatedEndcap && isIDEndcap && isConvertedEndcap) {
210 TLorentzVector e_e2(recoElectron->momentum ().x (),recoElectron->momentum ().y (),recoElectron->momentum ().z (), recoElectron->p ());
219 double e_ee_invMass=0;
221 TLorentzVector e_pair =
LV[0] +
LV[1];
222 e_ee_invMass = e_pair.M ();
225 if (elIsAcceptedEB==2){
228 if (elIsAcceptedEE==2){
231 if (elIsAcceptedEB==1 && elIsAcceptedEE==1){
MonitorElement * h_ee_invMass_EB
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const edm::EDGetTokenT< reco::GsfElectronCollection > electronCollectionToken_
math::XYZTLorentzVectorD LV
MonitorElement * h_ee_invMass_EE
MonitorElement * h_ee_invMass_BB
const edm::EDGetTokenT< reco::GsfTrackCollection > trackCollectionToken_