31 #include "TLorentzVector.h" 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){
249 LogTrace (logTraceName) <<
"Parameters initialization";
254 iBooker.
book1D (
"Z peak - WP80 EB-EE",
255 "Z peak - WP80 EB-EE;InvMass (GeV)", 60, 60.0, 120.0);
257 iBooker.
book1D (
"Z peak - WP80 EE-EE",
258 "Z peak - WP80 EE-EE;InvMass (Gev)", 60, 60.0, 120.0);
260 iBooker.
book1D (
"Z peak - WP80 EB-EB",
261 "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
math::XYZTLorentzVectorD LV
#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
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
EcalZmassTask(const edm::ParameterSet &)
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
MonitorElement * book1D(Args &&...args)
MonitorElement * h_ee_invMass_EE
MonitorElement * h_ee_invMass
void analyze(const edm::Event &, const edm::EventSetup &) override
void setCurrentFolder(const std::string &fullpath)
~EcalZmassTask() override
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