35 #include "TLorentzVector.h"
91 theElectronCollectionLabel(parameters.getParameter < edm::InputTag > (
"electronCollection")),
92 prefixME_(parameters.getUntrackedParameter < std::string > (
"prefixME",
""))
108 if (!electronCollection.isValid ())
return;
112 iEvent.
getByLabel (
"electronGsfTracks", gsftracks_h);
114 bool isIsolatedBarrel;
116 bool isConvertedBarrel;
117 bool isIsolatedEndcap;
119 bool isConvertedEndcap;
122 int elIsAcceptedEB=0;
123 int elIsAcceptedEE=0;
125 std::vector<TLorentzVector>
LV;
127 for (reco::GsfElectronCollection::const_iterator recoElectron =
128 electronCollection->begin ();
129 recoElectron != electronCollection->end (); recoElectron++)
132 if (recoElectron->et () <= 25)
136 double IsoTrk = (recoElectron->dr03TkSumPt () / recoElectron->et ());
138 (recoElectron->dr03EcalRecHitSumEt () / recoElectron->et ());
140 (recoElectron->dr03HcalTowerSumEt () / recoElectron->et ());
141 double HE = (recoElectron->hcalOverEcal ());
145 float DeltaPhiTkClu = recoElectron->deltaPhiSuperClusterTrackAtVtx ();
146 float DeltaEtaTkClu = recoElectron->deltaEtaSuperClusterTrackAtVtx ();
147 float sigmaIeIe = recoElectron->sigmaIetaIeta ();
151 float Dcot = recoElectron->convDcot ();
152 float Dist = recoElectron->convDist ();
153 int NumberOfExpectedInnerHits =
154 recoElectron->gsfTrack ()->trackerExpectedHitsInner ().
159 isIsolatedBarrel =
false;
161 isConvertedBarrel =
false;
162 isIsolatedEndcap =
false;
164 isConvertedEndcap =
false;
169 if (fabs (recoElectron->eta ()) <= 1.4442)
173 if (IsoTrk < 0.09 && IsoEcal < 0.07 && IsoHcal < 0.10)
175 isIsolatedBarrel =
true;
179 if (fabs (DeltaEtaTkClu) < 0.004 && fabs (DeltaPhiTkClu) < 0.06
180 && sigmaIeIe < 0.01 && HE < 0.04)
186 if ((fabs (Dist) >= 0.02 || fabs (Dcot) >= 0.02)
187 && NumberOfExpectedInnerHits <= 1.0)
189 isConvertedBarrel =
true;
193 if (isIsolatedBarrel && isIDBarrel && isConvertedBarrel) {
196 TLorentzVector b_e2(recoElectron->momentum ().x (),recoElectron->momentum ().y (),recoElectron->momentum ().z (), recoElectron->p ());
202 if (fabs (recoElectron->eta ()) >= 1.5660
203 && fabs (recoElectron->eta ()) <= 2.5000)
207 if (IsoTrk < 0.04 && IsoEcal < 0.05 && IsoHcal < 0.025)
209 isIsolatedEndcap =
true;
213 if (fabs (DeltaEtaTkClu) < 0.007 && fabs (DeltaPhiTkClu) < 0.03
214 && sigmaIeIe < 0.031 && HE < 0.15)
220 if ((fabs (Dcot) > 0.02 || fabs (Dist) > 0.02)
221 && NumberOfExpectedInnerHits <= 1.0)
223 isConvertedEndcap =
true;
226 if (isIsolatedEndcap && isIDEndcap && isConvertedEndcap) {
229 TLorentzVector e_e2(recoElectron->momentum ().x (),recoElectron->momentum ().y (),recoElectron->momentum ().z (), recoElectron->p ());
238 double e_ee_invMass=0;
239 if (elIsAccepted>2)
edm::LogWarning(
"EcalZmassTask") <<
"WARNING: In this events we have more than two electrons accpeted!!!!!!!";
241 TLorentzVector e_pair =
LV[0] +
LV[1];
242 e_ee_invMass = e_pair.M ();
245 if (elIsAcceptedEB==2){
248 if (elIsAcceptedEE==2){
251 if (elIsAcceptedEB==1 && elIsAcceptedEE==1){
266 std::string logTraceName(
"EcalZmassTask");
272 LogTrace (logTraceName) <<
"Parameters initialization";
281 theDbe->
book1D (
"Z peak - WP80 EB-EE",
282 "Z peak - WP80 EB-EE;InvMass (GeV)", 60, 60.0, 120.0);
284 theDbe->
book1D (
"Z peak - WP80 EE-EE",
285 "Z peak - WP80 EE-EE;InvMass (Gev)", 60, 60.0, 120.0);
287 theDbe->
book1D (
"Z peak - WP80 EB-EB",
288 "Z peak - WP80 EB-EB;InvMass (Gev)", 60, 60.0, 120.0);
334 descriptions.addDefault (desc);
MonitorElement * h_e2_eta
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
MonitorElement * h_ee_invMass_EB
const std::string prefixME_
MonitorElement * h_e1_phi
MonitorElement * h_95_ee_invMass_EE
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * h_95_ee_invMass_EB
#define DEFINE_FWK_MODULE(type)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
EcalZmassTask(const edm::ParameterSet &)
math::XYZTLorentzVectorD LV
const edm::InputTag theElectronCollectionLabel
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MonitorElement * h_ee_invMass_EE
virtual void endRun(edm::Run const &, edm::EventSetup const &)
MonitorElement * h_ee_invMass
MonitorElement * h_95_ee_invMass_BB
MonitorElement * h_ee_invMass_BB
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
MonitorElement * h_e2_phi
MonitorElement * h_e1_eta
void setCurrentFolder(const std::string &fullpath)