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")),
58 thePrintTimeReport(par.getUntrackedParameter<
bool>(
"PrintTimeReport")) {
88 IsoDeposit::Direction muonDir(muon.
eta(), muon.
phi());
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";
118 typedef IsoDeposit::Veto Veto;
121 IsoDeposit::Direction muonDir(muon.
eta(), muon.
phi());
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());
173 double et = energy * cosTheta;
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());
214 double et = energy * cosTheta;
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());
255 double et = energy * cosTheta;
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)
constexpr float energy() const
T getParameter(std::string const &) const
bool compare(const P &i, const P &j)
math::XYZPoint trkGlobPosAtHO
const Veto & veto() const
Get veto area.
double eta() const final
momentum pseudorapidity
std::vector< const CaloTower * > towers
void setVeto(const Veto &aVeto)
Set veto.
std::vector< DetId > crossedTowerIds
constexpr const DetId & detid() const
std::vector< const EcalRecHit * > ecalRecHits
hits in the cone
std::vector< DetId > crossedEcalIds
Geom::Phi< T > phi() const
const DetId & detid() const
constexpr uint32_t rawId() const
get the raw id
std::vector< Track > TrackCollection
collection of Tracks
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
double phi() const
azimuthal angle of momentum vector
std::vector< DetId > crossedHcalIds
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
TrackAssociatorParameters
math::XYZPoint trkGlobPosAtHcal
double eta() const
pseudorapidity of momentum vector
void setPropagator(const Propagator *)
use a user configured propagator
std::vector< const HBHERecHit * > hcalRecHits
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
std::vector< DetId > crossedHOIds
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
FreeTrajectoryState initialFreeState() const
CaloTowerDetId id() const
reco::IsoDeposit IsoDeposit
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
std::vector< const HORecHit * > hoRecHits
double phi() const final
momentum azimuthal angle
double outerEnergy() const
constexpr Detector det() const
get the detector field from this detid