31 #include "TLorentzVector.h"
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",
""))
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){
251 LogTrace (logTraceName) <<
"Parameters initialization";
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);
MonitorElement * h_e2_eta
MonitorElement * h_ee_invMass_EB
const std::string prefixME_
MonitorElement * h_e1_phi
MonitorElement * h_95_ee_invMass_EE
MonitorElement * h_95_ee_invMass_EB
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
const edm::EDGetTokenT< reco::GsfElectronCollection > electronCollectionToken_
void bookHistograms(DQMStore::IBooker &, edm::Run 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 * book1D(Args &&...args)
MonitorElement * h_ee_invMass_EE
MonitorElement * h_ee_invMass
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
void setCurrentFolder(const std::string &fullpath)
MonitorElement * h_95_ee_invMass_BB
MonitorElement * h_ee_invMass_BB
const edm::EDGetTokenT< reco::GsfTrackCollection > trackCollectionToken_
MonitorElement * h_e2_phi
MonitorElement * h_e1_eta