33 constexpr
double dRMax_CandDep = 1.0;
37 : theUseRecHitsFlag(par.getParameter<
bool>(
"UseRecHitsFlag")),
38 theDepositLabel(par.getUntrackedParameter<
string>(
"DepositLabel")),
39 theDepositInstanceLabels(par.getParameter<
std::
vector<
std::
string> >(
"DepositInstanceLabels")),
41 theThreshold_E(par.getParameter<double>(
"Threshold_E")),
42 theThreshold_H(par.getParameter<double>(
"Threshold_H")),
43 theThreshold_HO(par.getParameter<double>(
"Threshold_HO")),
44 theDR_Veto_E(par.getParameter<double>(
"DR_Veto_E")),
45 theDR_Veto_H(par.getParameter<double>(
"DR_Veto_H")),
46 theDR_Veto_HO(par.getParameter<double>(
"DR_Veto_HO")),
47 theCenterConeOnCalIntersection(par.getParameter<
bool>(
"CenterConeOnCalIntersection")),
48 theDR_Max(par.getParameter<double>(
"DR_Max")),
49 theNoise_EB(par.getParameter<double>(
"Noise_EB")),
50 theNoise_EE(par.getParameter<double>(
"Noise_EE")),
51 theNoise_HB(par.getParameter<double>(
"Noise_HB")),
52 theNoise_HE(par.getParameter<double>(
"Noise_HE")),
53 theNoise_HO(par.getParameter<double>(
"Noise_HO")),
54 theNoiseTow_EB(par.getParameter<double>(
"NoiseTow_EB")),
55 theNoiseTow_EE(par.getParameter<double>(
"NoiseTow_EE")),
57 theAssociator(nullptr),
58 thePrintTimeReport(par.getUntrackedParameter<
bool>(
"PrintTimeReport")) {
108 LogError(
"MuonIsolation") <<
"Configuration is inconsistent: Need 3 deposit instance labels";
114 <<
"Deposit instance labels do not look like (e*, h*, ho*):"
115 <<
"proceed at your own risk. The extractor interprets lab0=from ecal; lab1=from hcal; lab2=from ho";
144 double dRtmp = depEcal.veto().dR;
146 depEcal.setVeto(Veto(dirTmp, dRtmp));
149 dRtmp = depHcal.
veto().
dR;
151 depHcal.
setVeto(Veto(dirTmp, dRtmp));
154 dRtmp = depHOcal.
veto().
dR;
156 depHOcal.
setVeto(Veto(dirTmp, dRtmp));
166 std::vector<const EcalRecHit*>::const_iterator eHitCI = mInfo.
ecalRecHits.begin();
167 for (; eHitCI != mInfo.
ecalRecHits.end(); ++eHitCI) {
171 double cosTheta = 1. / cosh(eHitPos.
eta());
178 bool vetoHit =
false;
182 LogDebug(
"RecoMuon|CaloExtractorByAssociator") <<
" >>> Veto ECAL hit: Calo deltaR= " <<
deltar;
183 LogDebug(
"RecoMuon|CaloExtractorByAssociator")
184 <<
" >>> Calo eta phi ethcal: " << eHitPos.
eta() <<
" " << eHitPos.
phi() <<
" " <<
et;
189 for (
unsigned int iH = 0; iH < mInfo.
crossedEcalIds.size() && !vetoHit; ++iH) {
200 depEcal.addCandEnergy(
et);
207 std::vector<const HBHERecHit*>::const_iterator hHitCI = mInfo.
hcalRecHits.begin();
208 for (; hHitCI != mInfo.
hcalRecHits.end(); ++hHitCI) {
212 double cosTheta = 1. / cosh(hHitPos.
eta());
219 bool vetoHit =
false;
223 LogDebug(
"RecoMuon|CaloExtractorByAssociator") <<
" >>> Veto HBHE hit: Calo deltaR= " <<
deltar;
224 LogDebug(
"RecoMuon|CaloExtractorByAssociator")
225 <<
" >>> Calo eta phi ethcal: " << hHitPos.
eta() <<
" " << hHitPos.
phi() <<
" " <<
et;
230 for (
unsigned int iH = 0; iH < mInfo.
crossedHcalIds.size() && !vetoHit; ++iH) {
248 std::vector<const HORecHit*>::const_iterator hoHitCI = mInfo.
hoRecHits.begin();
249 for (; hoHitCI != mInfo.
hoRecHits.end(); ++hoHitCI) {
250 const HORecHit* hoHitCPtr = *hoHitCI;
253 double cosTheta = 1. / cosh(hoHitPos.
eta());
260 bool vetoHit =
false;
264 LogDebug(
"RecoMuon|CaloExtractorByAssociator") <<
" >>> Veto HO hit: Calo deltaR= " <<
deltar;
265 LogDebug(
"RecoMuon|CaloExtractorByAssociator")
266 <<
" >>> Calo eta phi ethcal: " << hoHitPos.
eta() <<
" " << hoHitPos.
phi() <<
" " <<
et;
271 for (
unsigned int iH = 0; iH < mInfo.
crossedHOIds.size() && !vetoHit; ++iH) {
290 std::vector<const CaloTower*>::const_iterator calCI = mInfo.
towers.begin();
291 for (; calCI != mInfo.
towers.end(); ++calCI) {
298 double etecal = calCPtr->
emEt();
301 double ethcal = calCPtr->
hadEt();
304 double ethocal = calCPtr->
outerEt();
307 if ((!doEcal) && (!doHcal) && (!doHcal))
310 bool vetoTowerEcal =
false;
314 LogDebug(
"RecoMuon|CaloExtractorByAssociator") <<
" >>> Veto ecal tower: Calo deltaR= " << deltarEcal;
315 LogDebug(
"RecoMuon|CaloExtractorByAssociator")
316 <<
" >>> Calo eta phi ethcal: " << calCPtr->
eta() <<
" " << calCPtr->
phi() <<
" " << ethcal;
317 vetoTowerEcal =
true;
319 bool vetoTowerHcal =
false;
323 LogDebug(
"RecoMuon|CaloExtractorByAssociator") <<
" >>> Veto hcal tower: Calo deltaR= " << deltarHcal;
324 LogDebug(
"RecoMuon|CaloExtractorByAssociator")
325 <<
" >>> Calo eta phi ethcal: " << calCPtr->
eta() <<
" " << calCPtr->
phi() <<
" " << ethcal;
326 vetoTowerHcal =
true;
328 bool vetoTowerHOCal =
false;
332 LogDebug(
"RecoMuon|CaloExtractorByAssociator") <<
" >>> Veto HO tower: Calo deltaR= " << deltarHOcal;
333 LogDebug(
"RecoMuon|CaloExtractorByAssociator")
334 <<
" >>> Calo eta phi ethcal: " << calCPtr->
eta() <<
" " << calCPtr->
phi() <<
" " << ethcal;
335 vetoTowerHOCal =
true;
339 if (!(vetoTowerHOCal && vetoTowerHcal && vetoTowerEcal)) {
342 vetoTowerEcal =
true;
343 vetoTowerHcal =
true;
344 vetoTowerHOCal =
true;
350 if (deltar0 >
theDR_Max && !(vetoTowerEcal || vetoTowerHcal || vetoTowerHOCal))
357 depEcal.addCandEnergy(etecal);
359 depEcal.addDeposit(towerDir, etecal);
376 std::vector<IsoDeposit> resultDeps;
377 resultDeps.push_back(depEcal);
378 resultDeps.push_back(depHcal);
379 resultDeps.push_back(depHOcal);
387 if (fabs(
eta) > 1.479)