CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
muonisolation::CaloExtractorByAssociator Class Reference

#include <CaloExtractorByAssociator.h>

Inheritance diagram for muonisolation::CaloExtractorByAssociator:
reco::isodeposit::IsoDepositExtractor

Public Member Functions

 CaloExtractorByAssociator ()
 constructors More...
 
 CaloExtractorByAssociator (const edm::ParameterSet &par, edm::ConsumesCollector &&iC)
 
reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const override
 no-op: by design of this extractor the deposits are pulled out all at a time More...
 
std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const override
 return deposits for 3 calorimeter subdetectors (ecal, hcal, ho) – in this order More...
 
void fillVetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &tracks) override
 allows to set extra vetoes (in addition to the muon) – no-op at this point More...
 
 ~CaloExtractorByAssociator () override
 destructor More...
 
- Public Member Functions inherited from reco::isodeposit::IsoDepositExtractor
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackBaseRef &track) const
 make single IsoDeposit based on trackRef as input More...
 
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &track) const
 
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::CandidateBaseRef &track) const
 make single IsoDeposit based on a CandidateBaseRef as input More...
 
virtual std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackBaseRef &track) const
 
virtual std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &track) const
 
virtual std::vector< reco::IsoDepositdeposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::CandidateBaseRef &track) const
 
virtual void initEvent (const edm::Event &, const edm::EventSetup &)
 perform some constly initialization More...
 
virtual ~IsoDepositExtractor ()
 Destructor. More...
 

Private Member Functions

double noiseEcal (const CaloTower &tower) const
 Determine noise for HCAL and ECAL (take some defaults for the time being) More...
 
double noiseHcal (const CaloTower &tower) const
 
double noiseHOcal (const CaloTower &tower) const
 
double noiseRecHit (const DetId &detId) const
 

Private Attributes

edm::ESGetToken< MagneticField, IdealMagneticFieldRecordbFieldToken_
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordcaloGeomToken_
 
TrackDetectorAssociatortheAssociator
 
TrackAssociatorParameterstheAssociatorParameters
 associator, its' parameters and the propagator More...
 
bool theCenterConeOnCalIntersection
 
std::vector< std::string > theDepositInstanceLabels
 multiple deposits: labels – expect 3 labels beginning with "e", "h", "ho" More...
 
std::string theDepositLabel
 Label of deposit – suggest to set to "" (all info is in collection name anyways) More...
 
double theDR_Max
 max cone size in which towers are considered More...
 
double theDR_Veto_E
 cone sizes inside which the Et (towers) are not counted More...
 
double theDR_Veto_H
 
double theDR_Veto_HO
 
double theNoise_EB
 
double theNoise_EE
 
double theNoise_HB
 
double theNoise_HE
 
double theNoise_HO
 
double theNoiseTow_EB
 
double theNoiseTow_EE
 
bool thePrintTimeReport
 flag to turn on/off printing of a time report More...
 
std::string thePropagatorName
 propagator name to feed into the track associator More...
 
MuonServiceProxytheService
 the event setup proxy, it takes care the services update More...
 
double theThreshold_E
 
double theThreshold_H
 
double theThreshold_HO
 
bool theUseRecHitsFlag
 use towers or rec hits More...
 
std::vector< DetIdtheVetoCollection
 Vector of calo Ids to veto – not used. More...
 

Detailed Description

Definition at line 39 of file CaloExtractorByAssociator.h.

Constructor & Destructor Documentation

◆ CaloExtractorByAssociator() [1/2]

muonisolation::CaloExtractorByAssociator::CaloExtractorByAssociator ( )
inline

constructors

Definition at line 42 of file CaloExtractorByAssociator.h.

42 {};

◆ CaloExtractorByAssociator() [2/2]

CaloExtractorByAssociator::CaloExtractorByAssociator ( const edm::ParameterSet par,
edm::ConsumesCollector &&  iC 
)

Definition at line 31 of file CaloExtractorByAssociator.cc.

References caloGeomToken_, edm::ParameterSet::getParameter(), TrackAssociatorParameters::loadParameters(), MuonServiceProxy_cff::MuonServiceProxy, theAssociator, theAssociatorParameters, theService, theUseRecHitsFlag, and HLT_2024v12_cff::TrackAssociatorParameters.

32  : theUseRecHitsFlag(par.getParameter<bool>("UseRecHitsFlag")),
33  theDepositLabel(par.getUntrackedParameter<string>("DepositLabel")),
34  theDepositInstanceLabels(par.getParameter<std::vector<std::string> >("DepositInstanceLabels")),
35  thePropagatorName(par.getParameter<std::string>("PropagatorName")),
36  theThreshold_E(par.getParameter<double>("Threshold_E")),
37  theThreshold_H(par.getParameter<double>("Threshold_H")),
38  theThreshold_HO(par.getParameter<double>("Threshold_HO")),
39  theDR_Veto_E(par.getParameter<double>("DR_Veto_E")),
40  theDR_Veto_H(par.getParameter<double>("DR_Veto_H")),
41  theDR_Veto_HO(par.getParameter<double>("DR_Veto_HO")),
42  theCenterConeOnCalIntersection(par.getParameter<bool>("CenterConeOnCalIntersection")),
43  theDR_Max(par.getParameter<double>("DR_Max")),
44  theNoise_EB(par.getParameter<double>("Noise_EB")),
45  theNoise_EE(par.getParameter<double>("Noise_EE")),
46  theNoise_HB(par.getParameter<double>("Noise_HB")),
47  theNoise_HE(par.getParameter<double>("Noise_HE")),
48  theNoise_HO(par.getParameter<double>("Noise_HO")),
49  theNoiseTow_EB(par.getParameter<double>("NoiseTow_EB")),
50  theNoiseTow_EE(par.getParameter<double>("NoiseTow_EE")),
51  theService(nullptr),
52  theAssociator(nullptr),
54  thePrintTimeReport(par.getUntrackedParameter<bool>("PrintTimeReport")) {
55  ParameterSet serviceParameters = par.getParameter<ParameterSet>("ServiceParameters");
56  theService = new MuonServiceProxy(serviceParameters, edm::ConsumesCollector(iC));
57 
58  //theAssociatorParameters = new TrackAssociatorParameters(par.getParameter<edm::ParameterSet>("TrackAssociatorParameters"), iC);
60  theAssociatorParameters->loadParameters(par.getParameter<edm::ParameterSet>("TrackAssociatorParameters"), iC);
62 
63  if (theUseRecHitsFlag) {
65  }
66 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bFieldToken_
std::string thePropagatorName
propagator name to feed into the track associator
std::string theDepositLabel
Label of deposit – suggest to set to "" (all info is in collection name anyways) ...
double theDR_Max
max cone size in which towers are considered
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
std::vector< std::string > theDepositInstanceLabels
multiple deposits: labels – expect 3 labels beginning with "e", "h", "ho"
double theDR_Veto_E
cone sizes inside which the Et (towers) are not counted
TrackAssociatorParameters * theAssociatorParameters
associator, its&#39; parameters and the propagator
T getUntrackedParameter(std::string const &, T const &) const
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
bool thePrintTimeReport
flag to turn on/off printing of a time report
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_

◆ ~CaloExtractorByAssociator()

CaloExtractorByAssociator::~CaloExtractorByAssociator ( )
override

destructor

Definition at line 68 of file CaloExtractorByAssociator.cc.

References theAssociator, theAssociatorParameters, and theService.

68  {
71  if (theService)
72  delete theService;
73  if (theAssociator)
74  delete theAssociator;
75 }
TrackAssociatorParameters * theAssociatorParameters
associator, its&#39; parameters and the propagator
MuonServiceProxy * theService
the event setup proxy, it takes care the services update

Member Function Documentation

◆ deposit()

IsoDeposit CaloExtractorByAssociator::deposit ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Track track 
) const
overridevirtual

no-op: by design of this extractor the deposits are pulled out all at a time

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 85 of file CaloExtractorByAssociator.cc.

87  {
88  IsoDeposit::Direction muonDir(muon.eta(), muon.phi());
89  IsoDeposit dep(muonDir);
90 
91  // LogWarning("CaloExtractorByAssociator")
92  // <<"single deposit is not an option here\n"
93  // <<"use ::deposits --> extract all and reweight as necessary";
94 
95  return dep;
96 }

◆ deposits()

std::vector< IsoDeposit > CaloExtractorByAssociator::deposits ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Track track 
) const
overridevirtual

return deposits for 3 calorimeter subdetectors (ecal, hcal, ho) – in this order

Make separate deposits: for ECAL, HCAL, HO.

check configuration consistency could've been made at construction stage (fix later?)














this should be (eventually) set to the eta-phi of the crossing point of a straight line tangent to a muon at IP and the calorimeter













each deposit type veto is at the point of intersect with that detector

do things based on rec-hits here too much copy-pasting now (refactor later?)











first check if the hit is inside the veto cone by dR-alone

and now pitch those in the crossed list

first check if the hit is inside the veto cone by dR-alone

and now pitch those in the crossed list

first check if the hit is inside the veto cone by dR-alone

and now pitch those in the crossed list

use calo towers

first check if the tower is inside the veto cone by dR-alone

first check if the tower is inside the veto cone by dR-alone

first check if the tower is inside the veto cone by dR-alone

and now pitch those in the crossed list

add the Et of the tower to deposits if it's not a vetoed; put into muonEnergy otherwise

Reimplemented from reco::isodeposit::IsoDepositExtractor.

Definition at line 99 of file CaloExtractorByAssociator.cc.

References reco::IsoDeposit::addCandEnergy(), reco::IsoDeposit::addDeposit(), TrackDetectorAssociator::associate(), Calorimetry_cff::bField, bFieldToken_, caloGeomToken_, compare(), TrackDetMatchInfo::crossedEcalIds, TrackDetMatchInfo::crossedHcalIds, TrackDetMatchInfo::crossedHOIds, TrackDetMatchInfo::crossedTowerIds, reco::deltaR(), CaloRecHit::detid(), EcalRecHit::detid(), reco::IsoDeposit::Veto::dR, TrackDetMatchInfo::ecalRecHits, CaloTower::emEnergy(), CaloTower::emEt(), hcalRecHitTable_cff::energy, CaloRecHit::energy(), EcalRecHit::energy(), EgHLTOffHistBins_cfi::et, PV3DBase< T, PVType, FrameType >::eta(), reco::LeafCandidate::eta(), options_cfi::eventSetup, CaloTower::hadEnergy(), CaloTower::hadEt(), TrackDetMatchInfo::hcalRecHits, TrackDetMatchInfo::hoRecHits, CaloTower::id(), reco::TransientTrack::initialFreeState(), LogDebug, SiStripPI::max, noiseEcal(), noiseHcal(), noiseHOcal(), noiseRecHit(), CaloTower::outerEnergy(), CaloTower::outerEt(), PV3DBase< T, PVType, FrameType >::phi(), reco::LeafCandidate::phi(), DetId::rawId(), TrackDetectorAssociator::setPropagator(), reco::IsoDeposit::setVeto(), AlCaHLTBitMon_QueryRunRegistry::string, theAssociator, theAssociatorParameters, theCenterConeOnCalIntersection, theDepositInstanceLabels, theDR_Max, theDR_Veto_E, theDR_Veto_H, theDR_Veto_HO, thePropagatorName, theService, theThreshold_E, theThreshold_H, theThreshold_HO, theUseRecHitsFlag, TrackDetMatchInfo::towers, TrackDetMatchInfo::trkGlobPosAtEcal, TrackDetMatchInfo::trkGlobPosAtHcal, TrackDetMatchInfo::trkGlobPosAtHO, reco::IsoDeposit::veto(), and reco::IsoDeposit::Veto::vetoDir.

101  {
102  theService->update(eventSetup);
104 
107  if (theDepositInstanceLabels.size() != 3) {
108  LogError("MuonIsolation") << "Configuration is inconsistent: Need 3 deposit instance labels";
109  }
110  if (!(theDepositInstanceLabels[0].compare(0, 1, std::string("e")) == 0) ||
111  !(theDepositInstanceLabels[1].compare(0, 1, std::string("h")) == 0) ||
112  !(theDepositInstanceLabels[2].compare(0, 2, std::string("ho")) == 0)) {
113  LogWarning("MuonIsolation")
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";
116  }
117 
118  typedef IsoDeposit::Veto Veto;
121  IsoDeposit::Direction muonDir(muon.eta(), muon.phi());
122 
123  IsoDeposit depEcal(muonDir);
124  IsoDeposit depHcal(muonDir);
125  IsoDeposit depHOcal(muonDir);
126 
127  auto const& bField = eventSetup.getData(bFieldToken_);
128 
130  FreeTrajectoryState iFTS = tMuon.initialFreeState();
132 
134  depEcal.setVeto(
136  depHcal.setVeto(
138  depHOcal.setVeto(
140 
142  reco::isodeposit::Direction dirTmp = depEcal.veto().vetoDir;
143  double dRtmp = depEcal.veto().dR;
144  depEcal = IsoDeposit(dirTmp);
145  depEcal.setVeto(Veto(dirTmp, dRtmp));
146 
147  dirTmp = depHcal.veto().vetoDir;
148  dRtmp = depHcal.veto().dR;
149  depHcal = IsoDeposit(dirTmp);
150  depHcal.setVeto(Veto(dirTmp, dRtmp));
151 
152  dirTmp = depHOcal.veto().vetoDir;
153  dRtmp = depHOcal.veto().dR;
154  depHOcal = IsoDeposit(dirTmp);
155  depHOcal.setVeto(Veto(dirTmp, dRtmp));
156  }
157 
158  if (theUseRecHitsFlag) {
161  auto const& caloGeom = eventSetup.getData(caloGeomToken_);
162 
163  //Ecal
164  std::vector<const EcalRecHit*>::const_iterator eHitCI = mInfo.ecalRecHits.begin();
165  for (; eHitCI != mInfo.ecalRecHits.end(); ++eHitCI) {
166  const EcalRecHit* eHitCPtr = *eHitCI;
167  GlobalPoint eHitPos = caloGeom.getPosition(eHitCPtr->detid());
168  double deltar0 = reco::deltaR(muon, eHitPos);
169  double cosTheta = 1. / cosh(eHitPos.eta());
170  double energy = eHitCPtr->energy();
171  double et = energy * cosTheta;
172  if (deltar0 > std::max(dRMax_CandDep, theDR_Max) ||
173  !(et > theThreshold_E && energy > 3 * noiseRecHit(eHitCPtr->detid())))
174  continue;
175 
176  bool vetoHit = false;
177  double deltar = reco::deltaR(mInfo.trkGlobPosAtEcal, eHitPos);
179  if (deltar < theDR_Veto_E) {
180  LogDebug("RecoMuon|CaloExtractorByAssociator") << " >>> Veto ECAL hit: Calo deltaR= " << deltar;
181  LogDebug("RecoMuon|CaloExtractorByAssociator")
182  << " >>> Calo eta phi ethcal: " << eHitPos.eta() << " " << eHitPos.phi() << " " << et;
183  vetoHit = true;
184  }
186  if (!vetoHit) {
187  for (unsigned int iH = 0; iH < mInfo.crossedEcalIds.size() && !vetoHit; ++iH) {
188  if (mInfo.crossedEcalIds[iH].rawId() == eHitCPtr->detid().rawId())
189  vetoHit = true;
190  }
191  }
192 
193  //check theDR_Max only here to keep vetoHits being added to the veto energy
194  if (deltar0 > theDR_Max && !vetoHit)
195  continue;
196 
197  if (vetoHit) {
198  depEcal.addCandEnergy(et);
199  } else {
200  depEcal.addDeposit(reco::isodeposit::Direction(eHitPos.eta(), eHitPos.phi()), et);
201  }
202  }
203 
204  //Hcal
205  std::vector<const HBHERecHit*>::const_iterator hHitCI = mInfo.hcalRecHits.begin();
206  for (; hHitCI != mInfo.hcalRecHits.end(); ++hHitCI) {
207  const HBHERecHit* hHitCPtr = *hHitCI;
208  GlobalPoint hHitPos = caloGeom.getPosition(hHitCPtr->detid());
209  double deltar0 = reco::deltaR(muon, hHitPos);
210  double cosTheta = 1. / cosh(hHitPos.eta());
211  double energy = hHitCPtr->energy();
212  double et = energy * cosTheta;
213  if (deltar0 > std::max(dRMax_CandDep, theDR_Max) ||
214  !(et > theThreshold_H && energy > 3 * noiseRecHit(hHitCPtr->detid())))
215  continue;
216 
217  bool vetoHit = false;
218  double deltar = reco::deltaR(mInfo.trkGlobPosAtHcal, hHitPos);
220  if (deltar < theDR_Veto_H) {
221  LogDebug("RecoMuon|CaloExtractorByAssociator") << " >>> Veto HBHE hit: Calo deltaR= " << deltar;
222  LogDebug("RecoMuon|CaloExtractorByAssociator")
223  << " >>> Calo eta phi ethcal: " << hHitPos.eta() << " " << hHitPos.phi() << " " << et;
224  vetoHit = true;
225  }
227  if (!vetoHit) {
228  for (unsigned int iH = 0; iH < mInfo.crossedHcalIds.size() && !vetoHit; ++iH) {
229  if (mInfo.crossedHcalIds[iH].rawId() == hHitCPtr->detid().rawId())
230  vetoHit = true;
231  }
232  }
233 
234  //check theDR_Max only here to keep vetoHits being added to the veto energy
235  if (deltar0 > theDR_Max && !vetoHit)
236  continue;
237 
238  if (vetoHit) {
239  depHcal.addCandEnergy(et);
240  } else {
241  depHcal.addDeposit(reco::isodeposit::Direction(hHitPos.eta(), hHitPos.phi()), et);
242  }
243  }
244 
245  //HOcal
246  std::vector<const HORecHit*>::const_iterator hoHitCI = mInfo.hoRecHits.begin();
247  for (; hoHitCI != mInfo.hoRecHits.end(); ++hoHitCI) {
248  const HORecHit* hoHitCPtr = *hoHitCI;
249  GlobalPoint hoHitPos = caloGeom.getPosition(hoHitCPtr->detid());
250  double deltar0 = reco::deltaR(muon, hoHitPos);
251  double cosTheta = 1. / cosh(hoHitPos.eta());
252  double energy = hoHitCPtr->energy();
253  double et = energy * cosTheta;
254  if (deltar0 > std::max(dRMax_CandDep, theDR_Max) ||
255  !(et > theThreshold_HO && energy > 3 * noiseRecHit(hoHitCPtr->detid())))
256  continue;
257 
258  bool vetoHit = false;
259  double deltar = reco::deltaR(mInfo.trkGlobPosAtHO, hoHitPos);
261  if (deltar < theDR_Veto_HO) {
262  LogDebug("RecoMuon|CaloExtractorByAssociator") << " >>> Veto HO hit: Calo deltaR= " << deltar;
263  LogDebug("RecoMuon|CaloExtractorByAssociator")
264  << " >>> Calo eta phi ethcal: " << hoHitPos.eta() << " " << hoHitPos.phi() << " " << et;
265  vetoHit = true;
266  }
268  if (!vetoHit) {
269  for (unsigned int iH = 0; iH < mInfo.crossedHOIds.size() && !vetoHit; ++iH) {
270  if (mInfo.crossedHOIds[iH].rawId() == hoHitCPtr->detid().rawId())
271  vetoHit = true;
272  }
273  }
274 
275  //check theDR_Max only here to keep vetoHits being added to the veto energy
276  if (deltar0 > theDR_Max && !vetoHit)
277  continue;
278 
279  if (vetoHit) {
280  depHOcal.addCandEnergy(et);
281  } else {
282  depHOcal.addDeposit(reco::isodeposit::Direction(hoHitPos.eta(), hoHitPos.phi()), et);
283  }
284  }
285 
286  } else {
288  std::vector<const CaloTower*>::const_iterator calCI = mInfo.towers.begin();
289  for (; calCI != mInfo.towers.end(); ++calCI) {
290  const CaloTower* calCPtr = *calCI;
291  double deltar0 = reco::deltaR(muon, *calCPtr);
292  if (deltar0 > std::max(dRMax_CandDep, theDR_Max))
293  continue;
294 
295  //even more copy-pasting .. need to refactor
296  double etecal = calCPtr->emEt();
297  double eecal = calCPtr->emEnergy();
298  bool doEcal = etecal > theThreshold_E && eecal > 3 * noiseEcal(*calCPtr);
299  double ethcal = calCPtr->hadEt();
300  double ehcal = calCPtr->hadEnergy();
301  bool doHcal = ethcal > theThreshold_H && ehcal > 3 * noiseHcal(*calCPtr);
302  double ethocal = calCPtr->outerEt();
303  double ehocal = calCPtr->outerEnergy();
304  bool doHOcal = ethocal > theThreshold_HO && ehocal > 3 * noiseHOcal(*calCPtr);
305  if ((!doEcal) && (!doHcal) && (!doHcal))
306  continue;
307 
308  bool vetoTowerEcal = false;
309  double deltarEcal = reco::deltaR(mInfo.trkGlobPosAtEcal, *calCPtr);
311  if (deltarEcal < theDR_Veto_E) {
312  LogDebug("RecoMuon|CaloExtractorByAssociator") << " >>> Veto ecal tower: Calo deltaR= " << deltarEcal;
313  LogDebug("RecoMuon|CaloExtractorByAssociator")
314  << " >>> Calo eta phi ethcal: " << calCPtr->eta() << " " << calCPtr->phi() << " " << ethcal;
315  vetoTowerEcal = true;
316  }
317  bool vetoTowerHcal = false;
318  double deltarHcal = reco::deltaR(mInfo.trkGlobPosAtHcal, *calCPtr);
320  if (deltarHcal < theDR_Veto_H) {
321  LogDebug("RecoMuon|CaloExtractorByAssociator") << " >>> Veto hcal tower: Calo deltaR= " << deltarHcal;
322  LogDebug("RecoMuon|CaloExtractorByAssociator")
323  << " >>> Calo eta phi ethcal: " << calCPtr->eta() << " " << calCPtr->phi() << " " << ethcal;
324  vetoTowerHcal = true;
325  }
326  bool vetoTowerHOCal = false;
327  double deltarHOcal = reco::deltaR(mInfo.trkGlobPosAtHO, *calCPtr);
329  if (deltarHOcal < theDR_Veto_HO) {
330  LogDebug("RecoMuon|CaloExtractorByAssociator") << " >>> Veto HO tower: Calo deltaR= " << deltarHOcal;
331  LogDebug("RecoMuon|CaloExtractorByAssociator")
332  << " >>> Calo eta phi ethcal: " << calCPtr->eta() << " " << calCPtr->phi() << " " << ethcal;
333  vetoTowerHOCal = true;
334  }
335 
337  if (!(vetoTowerHOCal && vetoTowerHcal && vetoTowerEcal)) {
338  for (unsigned int iH = 0; iH < mInfo.crossedTowerIds.size(); ++iH) {
339  if (mInfo.crossedTowerIds[iH].rawId() == calCPtr->id().rawId()) {
340  vetoTowerEcal = true;
341  vetoTowerHcal = true;
342  vetoTowerHOCal = true;
343  break;
344  }
345  }
346  }
347 
348  if (deltar0 > theDR_Max && !(vetoTowerEcal || vetoTowerHcal || vetoTowerHOCal))
349  continue;
350 
351  reco::isodeposit::Direction towerDir(calCPtr->eta(), calCPtr->phi());
353  if (doEcal) {
354  if (vetoTowerEcal)
355  depEcal.addCandEnergy(etecal);
356  else if (deltar0 <= theDR_Max)
357  depEcal.addDeposit(towerDir, etecal);
358  }
359  if (doHcal) {
360  if (vetoTowerHcal)
361  depHcal.addCandEnergy(ethcal);
362  else if (deltar0 <= theDR_Max)
363  depHcal.addDeposit(towerDir, ethcal);
364  }
365  if (doHOcal) {
366  if (vetoTowerHOCal)
367  depHOcal.addCandEnergy(ethocal);
368  else if (deltar0 <= theDR_Max)
369  depHOcal.addDeposit(towerDir, ethocal);
370  }
371  }
372  }
373 
374  std::vector<IsoDeposit> resultDeps;
375  resultDeps.push_back(depEcal);
376  resultDeps.push_back(depHcal);
377  resultDeps.push_back(depHOcal);
378 
379  return resultDeps;
380 }
double noiseHcal(const CaloTower &tower) const
bool compare(const P &i, const P &j)
math::XYZPoint trkGlobPosAtHO
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bFieldToken_
constexpr const DetId & detid() const
Definition: CaloRecHit.h:33
double outerEnergy() const
Definition: CaloTower.h:132
std::vector< const CaloTower * > towers
std::vector< DetId > crossedTowerIds
std::string thePropagatorName
propagator name to feed into the track associator
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
std::vector< const EcalRecHit * > ecalRecHits
hits in the cone
std::vector< DetId > crossedEcalIds
double theDR_Max
max cone size in which towers are considered
T eta() const
Definition: PV3DBase.h:73
double hadEt() const
Definition: CaloTower.h:136
std::vector< std::string > theDepositInstanceLabels
multiple deposits: labels – expect 3 labels beginning with "e", "h", "ho"
double theDR_Veto_E
cone sizes inside which the Et (towers) are not counted
TrackAssociatorParameters * theAssociatorParameters
associator, its&#39; parameters and the propagator
Log< level::Error, false > LogError
std::vector< DetId > crossedHcalIds
double outerEt() const
Definition: CaloTower.h:137
math::XYZPoint trkGlobPosAtHcal
constexpr float energy() const
Definition: CaloRecHit.h:29
void setPropagator(const Propagator *)
use a user configured propagator
std::vector< const HBHERecHit * > hcalRecHits
std::vector< DetId > crossedHOIds
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
reco::IsoDeposit IsoDeposit
Definition: Isolation.h:7
Definition: deltar.py:1
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
double emEnergy() const
Definition: CaloTower.h:130
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
double noiseEcal(const CaloTower &tower) const
Determine noise for HCAL and ECAL (take some defaults for the time being)
double hadEnergy() const
Definition: CaloTower.h:131
const DetId & detid() const
Definition: EcalRecHit.h:73
double emEt() const
Definition: CaloTower.h:135
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
Log< level::Warning, false > LogWarning
float energy() const
Definition: EcalRecHit.h:69
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
std::vector< const HORecHit * > hoRecHits
double phi() const final
momentum azimuthal angle
double noiseHOcal(const CaloTower &tower) const
CaloTowerDetId id() const
Definition: CaloTower.h:123
Definition: event.py:1
#define LogDebug(id)
double eta() const final
momentum pseudorapidity

◆ fillVetos()

void CaloExtractorByAssociator::fillVetos ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::TrackCollection tracks 
)
overridevirtual

allows to set extra vetoes (in addition to the muon) – no-op at this point

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 77 of file CaloExtractorByAssociator.cc.

79  {
80  // LogWarning("CaloExtractorByAssociator")
81  // <<"fillVetos does nothing now: IsoDeposit provides enough functionality\n"
82  // <<"to remove a deposit at/around given (eta, phi)";
83 }

◆ noiseEcal()

double CaloExtractorByAssociator::noiseEcal ( const CaloTower tower) const
private

Determine noise for HCAL and ECAL (take some defaults for the time being)

Definition at line 382 of file CaloExtractorByAssociator.cc.

References PVValHelper::eta, hgchebackDigitizer_cfi::noise, theNoiseTow_EB, theNoiseTow_EE, and l1tHGCalTowerProducer_cfi::tower.

Referenced by deposits().

◆ noiseHcal()

double CaloExtractorByAssociator::noiseHcal ( const CaloTower tower) const
private

◆ noiseHOcal()

double CaloExtractorByAssociator::noiseHOcal ( const CaloTower tower) const
private

Definition at line 395 of file CaloExtractorByAssociator.cc.

References hgchebackDigitizer_cfi::noise, and theNoise_HO.

Referenced by deposits().

◆ noiseRecHit()

double CaloExtractorByAssociator::noiseRecHit ( const DetId detId) const
private

Definition at line 400 of file CaloExtractorByAssociator.cc.

References hcalRecHitTable_cff::detId, DetId::Ecal, EcalBarrel, EcalEndcap, DetId::Hcal, HcalBarrel, HcalEndcap, HcalOuter, hgchebackDigitizer_cfi::noise, theNoise_EB, theNoise_EE, theNoise_HB, theNoise_HE, and theNoise_HO.

Referenced by deposits().

400  {
401  double noise = 100;
402  DetId::Detector det = detId.det();
403  if (det == DetId::Ecal) {
404  EcalSubdetector subDet = (EcalSubdetector)(detId.subdetId());
405  if (subDet == EcalBarrel) {
406  noise = theNoise_EB;
407  } else if (subDet == EcalEndcap) {
408  noise = theNoise_EE;
409  }
410  } else if (det == DetId::Hcal) {
411  HcalSubdetector subDet = (HcalSubdetector)(detId.subdetId());
412  if (subDet == HcalBarrel) {
413  noise = theNoise_HB;
414  } else if (subDet == HcalEndcap) {
415  noise = theNoise_HE;
416  } else if (subDet == HcalOuter) {
417  noise = theNoise_HO;
418  }
419  }
420  return noise;
421 }
HcalSubdetector
Definition: HcalAssistant.h:31
Detector
Definition: DetId.h:24
EcalSubdetector

Member Data Documentation

◆ bFieldToken_

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> muonisolation::CaloExtractorByAssociator::bFieldToken_
private

Definition at line 108 of file CaloExtractorByAssociator.h.

Referenced by deposits().

◆ caloGeomToken_

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> muonisolation::CaloExtractorByAssociator::caloGeomToken_
private

Definition at line 109 of file CaloExtractorByAssociator.h.

Referenced by CaloExtractorByAssociator(), and deposits().

◆ theAssociator

TrackDetectorAssociator* muonisolation::CaloExtractorByAssociator::theAssociator
private

◆ theAssociatorParameters

TrackAssociatorParameters* muonisolation::CaloExtractorByAssociator::theAssociatorParameters
private

associator, its' parameters and the propagator

Definition at line 105 of file CaloExtractorByAssociator.h.

Referenced by CaloExtractorByAssociator(), deposits(), and ~CaloExtractorByAssociator().

◆ theCenterConeOnCalIntersection

bool muonisolation::CaloExtractorByAssociator::theCenterConeOnCalIntersection
private

centers the cone on the veto direction – makes more sense for very displaced tracks like in cosmics

Definition at line 84 of file CaloExtractorByAssociator.h.

Referenced by deposits().

◆ theDepositInstanceLabels

std::vector<std::string> muonisolation::CaloExtractorByAssociator::theDepositInstanceLabels
private

multiple deposits: labels – expect 3 labels beginning with "e", "h", "ho"

Definition at line 67 of file CaloExtractorByAssociator.h.

Referenced by deposits().

◆ theDepositLabel

std::string muonisolation::CaloExtractorByAssociator::theDepositLabel
private

Label of deposit – suggest to set to "" (all info is in collection name anyways)

Definition at line 64 of file CaloExtractorByAssociator.h.

◆ theDR_Max

double muonisolation::CaloExtractorByAssociator::theDR_Max
private

max cone size in which towers are considered

Definition at line 86 of file CaloExtractorByAssociator.h.

Referenced by deposits().

◆ theDR_Veto_E

double muonisolation::CaloExtractorByAssociator::theDR_Veto_E
private

cone sizes inside which the Et (towers) are not counted

Definition at line 79 of file CaloExtractorByAssociator.h.

Referenced by deposits().

◆ theDR_Veto_H

double muonisolation::CaloExtractorByAssociator::theDR_Veto_H
private

Definition at line 80 of file CaloExtractorByAssociator.h.

Referenced by deposits().

◆ theDR_Veto_HO

double muonisolation::CaloExtractorByAssociator::theDR_Veto_HO
private

Definition at line 81 of file CaloExtractorByAssociator.h.

Referenced by deposits().

◆ theNoise_EB

double muonisolation::CaloExtractorByAssociator::theNoise_EB
private

the noise "sigmas" for a hit or tower to be considered consider if Energy > 3.*sigma

Definition at line 90 of file CaloExtractorByAssociator.h.

Referenced by noiseRecHit().

◆ theNoise_EE

double muonisolation::CaloExtractorByAssociator::theNoise_EE
private

Definition at line 91 of file CaloExtractorByAssociator.h.

Referenced by noiseRecHit().

◆ theNoise_HB

double muonisolation::CaloExtractorByAssociator::theNoise_HB
private

Definition at line 92 of file CaloExtractorByAssociator.h.

Referenced by noiseHcal(), and noiseRecHit().

◆ theNoise_HE

double muonisolation::CaloExtractorByAssociator::theNoise_HE
private

Definition at line 93 of file CaloExtractorByAssociator.h.

Referenced by noiseHcal(), and noiseRecHit().

◆ theNoise_HO

double muonisolation::CaloExtractorByAssociator::theNoise_HO
private

Definition at line 94 of file CaloExtractorByAssociator.h.

Referenced by noiseHOcal(), and noiseRecHit().

◆ theNoiseTow_EB

double muonisolation::CaloExtractorByAssociator::theNoiseTow_EB
private

Definition at line 95 of file CaloExtractorByAssociator.h.

Referenced by noiseEcal().

◆ theNoiseTow_EE

double muonisolation::CaloExtractorByAssociator::theNoiseTow_EE
private

Definition at line 96 of file CaloExtractorByAssociator.h.

Referenced by noiseEcal().

◆ thePrintTimeReport

bool muonisolation::CaloExtractorByAssociator::thePrintTimeReport
private

flag to turn on/off printing of a time report

Definition at line 112 of file CaloExtractorByAssociator.h.

◆ thePropagatorName

std::string muonisolation::CaloExtractorByAssociator::thePropagatorName
private

propagator name to feed into the track associator

Definition at line 70 of file CaloExtractorByAssociator.h.

Referenced by deposits().

◆ theService

MuonServiceProxy* muonisolation::CaloExtractorByAssociator::theService
private

the event setup proxy, it takes care the services update

Definition at line 102 of file CaloExtractorByAssociator.h.

Referenced by CaloExtractorByAssociator(), deposits(), and ~CaloExtractorByAssociator().

◆ theThreshold_E

double muonisolation::CaloExtractorByAssociator::theThreshold_E
private

Cone cuts and thresholds min values of Et to be included in deposits

Definition at line 74 of file CaloExtractorByAssociator.h.

Referenced by deposits().

◆ theThreshold_H

double muonisolation::CaloExtractorByAssociator::theThreshold_H
private

Definition at line 75 of file CaloExtractorByAssociator.h.

Referenced by deposits().

◆ theThreshold_HO

double muonisolation::CaloExtractorByAssociator::theThreshold_HO
private

Definition at line 76 of file CaloExtractorByAssociator.h.

Referenced by deposits().

◆ theUseRecHitsFlag

bool muonisolation::CaloExtractorByAssociator::theUseRecHitsFlag
private

use towers or rec hits

Definition at line 61 of file CaloExtractorByAssociator.h.

Referenced by CaloExtractorByAssociator(), and deposits().

◆ theVetoCollection

std::vector<DetId> muonisolation::CaloExtractorByAssociator::theVetoCollection
private

Vector of calo Ids to veto – not used.

Definition at line 99 of file CaloExtractorByAssociator.h.