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 ();
136 int NumberOfExpectedInnerHits =
137 recoElectron->gsfTrack ()->trackerExpectedHitsInner ().
142 isIsolatedBarrel =
false;
144 isConvertedBarrel =
false;
145 isIsolatedEndcap =
false;
147 isConvertedEndcap =
false;
152 if (fabs (recoElectron->eta ()) <= 1.4442)
156 if (IsoTrk < 0.09 && IsoEcal < 0.07 && IsoHcal < 0.10)
158 isIsolatedBarrel =
true;
162 if (fabs (DeltaEtaTkClu) < 0.004 && fabs (DeltaPhiTkClu) < 0.06
163 && sigmaIeIe < 0.01 && HE < 0.04)
169 if ((fabs (Dist) >= 0.02 || fabs (Dcot) >= 0.02)
170 && NumberOfExpectedInnerHits <= 1.0)
172 isConvertedBarrel =
true;
176 if (isIsolatedBarrel && isIDBarrel && isConvertedBarrel) {
179 TLorentzVector b_e2(recoElectron->momentum ().x (),recoElectron->momentum ().y (),recoElectron->momentum ().z (), recoElectron->p ());
185 if (fabs (recoElectron->eta ()) >= 1.5660
186 && fabs (recoElectron->eta ()) <= 2.5000)
190 if (IsoTrk < 0.04 && IsoEcal < 0.05 && IsoHcal < 0.025)
192 isIsolatedEndcap =
true;
196 if (fabs (DeltaEtaTkClu) < 0.007 && fabs (DeltaPhiTkClu) < 0.03
197 && sigmaIeIe < 0.031 && HE < 0.15)
203 if ((fabs (Dcot) > 0.02 || fabs (Dist) > 0.02)
204 && NumberOfExpectedInnerHits <= 1.0)
206 isConvertedEndcap =
true;
209 if (isIsolatedEndcap && isIDEndcap && isConvertedEndcap) {
212 TLorentzVector e_e2(recoElectron->momentum ().x (),recoElectron->momentum ().y (),recoElectron->momentum ().z (), recoElectron->p ());
221 double e_ee_invMass=0;
223 TLorentzVector e_pair =
LV[0] +
LV[1];
224 e_ee_invMass = e_pair.M ();
227 if (elIsAcceptedEB==2){
230 if (elIsAcceptedEE==2){
233 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_