25 using namespace isodeposit;
39 double ptThreshold_, etEcalThreshold_, etHcalThreshold_, dRVetoTrk_, dRTrk_, dREcal_, dRHcal_;
84 double isovalueTrk = (
trkIso->sumWithin(
dRTrk, vetosTrk));
88 iso.push_back(isovalueTrk);
90 iso.push_back(isovalueEcal);
92 iso.push_back(isovalueHcal);
100 alpha * (((1 +
beta) / 2 * isovalueEcal) + ((1 -
beta) / 2 * isovalueHcal)) + ((1 -
alpha) * isovalueTrk);
101 iso.push_back(combIso);
104 double relIso = combIso /=
t.pt();
114 alpha_(
cfg.getParameter<double>(
"alpha")),
115 beta_(
cfg.getParameter<double>(
"beta")),
116 ptThreshold_(
cfg.getParameter<double>(
"ptThreshold")),
117 etEcalThreshold_(
cfg.getParameter<double>(
"etEcalThreshold")),
118 etHcalThreshold_(
cfg.getParameter<double>(
"etHcalThreshold")),
119 dRVetoTrk_(
cfg.getParameter<double>(
"dRVetoTrk")),
120 dRTrk_(
cfg.getParameter<double>(
"dRTrk")),
121 dREcal_(
cfg.getParameter<double>(
"dREcal")),
122 dRHcal_(
cfg.getParameter<double>(
"dRHcal")),
124 produces<std::vector<pat::Muon> >();
137 unique_ptr<vector<pat::Muon> > muonColl(
new vector<pat::Muon>(*
muons));
138 for (
unsigned int i = 0;
i < muonColl->size(); ++
i) {
153 float zDauMuEnergyEm =
m.calEnergy().em;
154 float zDauMuEnergyHad =
m.calEnergy().had;
158 float zDaudxyFromBS = -1;
159 float zDaudzFromBS = -1;
160 float zDaudxyFromPV = -1;
161 float zDaudzFromPV = -1;
162 int zDauNofMuChambers =
m.numberOfChambers();
163 int zDauNofMuMatches =
m.numberOfMatches();
166 float zDauTrkChi2 = -1;
167 float zDauSaChi2 = -1;
168 float zDauNofMuonHits = -1;
169 float zDauSaNofMuonHits = -1;
170 float zDauNofStripHits = -1;
171 float zDauTrkNofStripHits = -1;
172 float zDauNofPixelHits = -1;
173 float zDauTrkNofPixelHits = -1;
175 if (muGlbRef.
isNonnull() &&
m.isGlobalMuon() ==
true) {
176 zDaudxyFromBS = muGlbRef->dxy(beamSpotHandle->
position());
177 zDaudzFromBS = muGlbRef->dz(beamSpotHandle->
position());
180 zDauChi2 = muGlbRef->normalizedChi2();
181 zDauTrkChi2 = muTrkRef->normalizedChi2();
182 zDauSaChi2 = muSaRef->normalizedChi2();
183 zDauNofMuonHits = muGlbRef->hitPattern().numberOfValidMuonHits();
184 zDauSaNofMuonHits = muSaRef->hitPattern().numberOfValidMuonHits();
185 zDauNofStripHits = muGlbRef->hitPattern().numberOfValidStripHits();
186 zDauTrkNofStripHits = muTrkRef->hitPattern().numberOfValidStripHits();
187 zDauNofPixelHits = muGlbRef->hitPattern().numberOfValidPixelHits();
188 zDauTrkNofPixelHits = muTrkRef->hitPattern().numberOfValidPixelHits();
189 }
else if (muSaRef.
isNonnull() &&
m.isStandAloneMuon() ==
true) {
190 zDaudxyFromBS = muSaRef->dxy(beamSpotHandle->
position());
191 zDaudzFromBS = muSaRef->dz(beamSpotHandle->
position());
194 zDauSaChi2 = muSaRef->normalizedChi2();
195 zDauSaNofMuonHits = muSaRef->hitPattern().numberOfValidMuonHits();
197 }
else if (muTrkRef.
isNonnull() &&
m.isTrackerMuon() ==
true) {
198 zDaudxyFromBS = muTrkRef->dxy(beamSpotHandle->
position());
199 zDaudzFromBS = muTrkRef->dz(beamSpotHandle->
position());
202 zDauTrkChi2 = muTrkRef->normalizedChi2();
203 zDauTrkNofStripHits = muTrkRef->hitPattern().numberOfValidStripHits();
204 zDauTrkNofPixelHits = muTrkRef->hitPattern().numberOfValidPixelHits();
209 int dimTrig = muHLTMatches.size();
215 m.addUserFloat(
"zDau_dxyFromBS", zDaudxyFromBS);
216 m.addUserFloat(
"zDau_dzFromBS", zDaudzFromBS);
217 m.addUserFloat(
"zDau_dxyFromPV", zDaudxyFromPV);
218 m.addUserFloat(
"zDau_dzFromPV", zDaudzFromPV);
219 m.addUserFloat(
"zDau_HLTBit", muHLTBit);
220 m.addUserFloat(
"zDau_dzFromPV", zDaudzFromPV);
221 m.addUserFloat(
"zDau_Chi2", zDauChi2);
222 m.addUserFloat(
"zDau_TrkChi2", zDauTrkChi2);
223 m.addUserFloat(
"zDau_SaChi2", zDauSaChi2);
224 m.addUserFloat(
"zDau_NofMuonHits", zDauNofMuonHits);
225 m.addUserFloat(
"zDau_SaNofMuonHits", zDauSaNofMuonHits);
226 m.addUserFloat(
"zDau_NofStripHits", zDauNofStripHits);
227 m.addUserFloat(
"zDau_TrkNofStripHits", zDauTrkNofStripHits);
228 m.addUserFloat(
"zDau_NofPixelHits", zDauNofPixelHits);
229 m.addUserFloat(
"zDau_TrkNofPixelHits", zDauTrkNofPixelHits);
230 m.addUserFloat(
"zDau_NofMuChambers", zDauNofMuChambers);
231 m.addUserFloat(
"zDau_NofMuMatches", zDauNofMuMatches);
232 m.addUserFloat(
"zDau_MuEnergyEm", zDauMuEnergyEm);
233 m.addUserFloat(
"zDau_MuEnergyHad", zDauMuEnergyHad);