34 #include "TLorentzVector.h"
73 : electronCollectionToken_(
75 trackCollectionToken_(
77 prefixME_(parameters.getUntrackedParameter<std::
string>(
"prefixME",
"")) {}
84 if (!electronCollection.isValid())
91 bool isIsolatedBarrel;
93 bool isConvertedBarrel;
94 bool isIsolatedEndcap;
96 bool isConvertedEndcap;
99 int elIsAcceptedEB = 0;
100 int elIsAcceptedEE = 0;
102 std::vector<TLorentzVector>
LV;
104 for (reco::GsfElectronCollection::const_iterator recoElectron = electronCollection->begin();
105 recoElectron != electronCollection->end();
107 if (recoElectron->et() <= 25)
111 double IsoTrk = (recoElectron->dr03TkSumPt() / recoElectron->et());
112 double IsoEcal = (recoElectron->dr03EcalRecHitSumEt() / recoElectron->et());
113 double IsoHcal = (recoElectron->dr03HcalTowerSumEt() / recoElectron->et());
114 double HE = (recoElectron->hcalOverEcal());
118 float DeltaPhiTkClu = recoElectron->deltaPhiSuperClusterTrackAtVtx();
119 float DeltaEtaTkClu = recoElectron->deltaEtaSuperClusterTrackAtVtx();
120 float sigmaIeIe = recoElectron->sigmaIetaIeta();
124 float Dcot = recoElectron->convDcot();
125 float Dist = recoElectron->convDist();
126 int NumberOfExpectedInnerHits =
131 isIsolatedBarrel =
false;
133 isConvertedBarrel =
false;
134 isIsolatedEndcap =
false;
136 isConvertedEndcap =
false;
140 if (fabs(recoElectron->eta()) <= 1.4442) {
142 if (IsoTrk < 0.09 && IsoEcal < 0.07 && IsoHcal < 0.10) {
143 isIsolatedBarrel =
true;
147 if (fabs(DeltaEtaTkClu) < 0.004 && fabs(DeltaPhiTkClu) < 0.06 && sigmaIeIe < 0.01 && HE < 0.04) {
152 if ((fabs(Dist) >= 0.02 || fabs(Dcot) >= 0.02) && NumberOfExpectedInnerHits <= 1.0) {
153 isConvertedBarrel =
true;
157 if (isIsolatedBarrel && isIDBarrel && isConvertedBarrel) {
161 recoElectron->momentum().x(), recoElectron->momentum().y(), recoElectron->momentum().z(), recoElectron->p());
167 if (fabs(recoElectron->eta()) >= 1.5660 && fabs(recoElectron->eta()) <= 2.5000) {
169 if (IsoTrk < 0.04 && IsoEcal < 0.05 && IsoHcal < 0.025) {
170 isIsolatedEndcap =
true;
174 if (fabs(DeltaEtaTkClu) < 0.007 && fabs(DeltaPhiTkClu) < 0.03 && sigmaIeIe < 0.031 && HE < 0.15) {
179 if ((fabs(Dcot) > 0.02 || fabs(Dist) > 0.02) && NumberOfExpectedInnerHits <= 1.0) {
180 isConvertedEndcap =
true;
183 if (isIsolatedEndcap && isIDEndcap && isConvertedEndcap) {
187 recoElectron->momentum().x(), recoElectron->momentum().y(), recoElectron->momentum().z(), recoElectron->p());
194 if (elIsAccepted > 1) {
195 double e_ee_invMass = 0;
196 if (
LV.size() == 2) {
197 TLorentzVector e_pair =
LV[0] +
LV[1];
198 e_ee_invMass = e_pair.M();
201 if (elIsAcceptedEB == 2) {
204 if (elIsAcceptedEE == 2) {
207 if (elIsAcceptedEB == 1 && elIsAcceptedEE == 1) {
222 LogTrace(logTraceName) <<
"Parameters initialization";
226 h_ee_invMass_EB = iBooker.
book1D(
"Z peak - WP80 EB-EE",
"Z peak - WP80 EB-EE;InvMass (GeV)", 60, 60.0, 120.0);
227 h_ee_invMass_EE = iBooker.
book1D(
"Z peak - WP80 EE-EE",
"Z peak - WP80 EE-EE;InvMass (Gev)", 60, 60.0, 120.0);
228 h_ee_invMass_BB = iBooker.
book1D(
"Z peak - WP80 EB-EB",
"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
virtual void setCurrentFolder(std::string const &fullpath)
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
EcalZmassTask(const edm::ParameterSet &)
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
MonitorElement * h_ee_invMass_EE
MonitorElement * h_ee_invMass
void analyze(const edm::Event &, const edm::EventSetup &) override
~EcalZmassTask() override
MonitorElement * h_95_ee_invMass_BB
MonitorElement * h_ee_invMass_BB
const edm::EDGetTokenT< reco::GsfTrackCollection > trackCollectionToken_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * h_e2_phi
MonitorElement * h_e1_eta