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

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 34 of file CaloExtractorByAssociator.h.

Constructor & Destructor Documentation

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

Definition at line 36 of file CaloExtractorByAssociator.cc.

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

36  :
37  theUseRecHitsFlag(par.getParameter<bool>("UseRecHitsFlag")),
38  theDepositLabel(par.getUntrackedParameter<string>("DepositLabel")),
39  theDepositInstanceLabels(par.getParameter<std::vector<std::string> >("DepositInstanceLabels")),
40  thePropagatorName(par.getParameter<std::string>("PropagatorName")),
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")),
56  theService(nullptr),
57  theAssociator(nullptr),
58  thePrintTimeReport(par.getUntrackedParameter<bool>("PrintTimeReport"))
59 {
60  ParameterSet serviceParameters = par.getParameter<ParameterSet>("ServiceParameters");
61  theService = new MuonServiceProxy(serviceParameters);
62 
63  //theAssociatorParameters = new TrackAssociatorParameters(par.getParameter<edm::ParameterSet>("TrackAssociatorParameters"), iC);
65  theAssociatorParameters->loadParameters(par.getParameter<edm::ParameterSet>("TrackAssociatorParameters"), iC);
67 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
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
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
bool thePrintTimeReport
flag to turn on/off printing of a time report
CaloExtractorByAssociator::~CaloExtractorByAssociator ( )
override

destructor

Definition at line 69 of file CaloExtractorByAssociator.cc.

References theAssociator, theAssociatorParameters, and theService.

Referenced by CaloExtractorByAssociator().

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

Member Function Documentation

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 83 of file CaloExtractorByAssociator.cc.

References reco::TrackBase::eta(), and reco::TrackBase::phi().

Referenced by CaloExtractorByAssociator().

84 {
85  IsoDeposit::Direction muonDir(muon.eta(), muon.phi());
86  IsoDeposit dep(muonDir );
87 
88 // LogWarning("CaloExtractorByAssociator")
89 // <<"single deposit is not an option here\n"
90 // <<"use ::deposits --> extract all and reweight as necessary";
91 
92  return dep;
93 
94 }
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 98 of file CaloExtractorByAssociator.cc.

References reco::IsoDeposit::addCandEnergy(), reco::IsoDeposit::addDeposit(), TrackDetectorAssociator::associate(), ecalTB2006H4_GenSimDigiReco_cfg::bField, 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(), CaloRecHit::energy(), EcalRecHit::energy(), stringResolutionProvider_cfi::et, PV3DBase< T, PVType, FrameType >::eta(), reco::LeafCandidate::eta(), reco::TrackBase::eta(), edm::EventSetup::get(), CaloGeometry::getPosition(), 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(), reco::TrackBase::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.

Referenced by CaloExtractorByAssociator().

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

Referenced by CaloExtractorByAssociator().

76 {
77 // LogWarning("CaloExtractorByAssociator")
78 // <<"fillVetos does nothing now: IsoDeposit provides enough functionality\n"
79 // <<"to remove a deposit at/around given (eta, phi)";
80 
81 }
double CaloExtractorByAssociator::noiseEcal ( const CaloTower tower) const
private

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

Definition at line 369 of file CaloExtractorByAssociator.cc.

References PVValHelper::eta, reco::LeafCandidate::eta(), theNoiseTow_EB, and theNoiseTow_EE.

Referenced by deposits().

369  {
370  double noise = theNoiseTow_EB;
371  double eta = tower.eta();
372  if (fabs(eta)>1.479) noise = theNoiseTow_EE;
373  return noise;
374 }
double eta() const final
momentum pseudorapidity
double CaloExtractorByAssociator::noiseHcal ( const CaloTower tower) const
private

Definition at line 376 of file CaloExtractorByAssociator.cc.

References reco::LeafCandidate::eta(), theNoise_HB, and theNoise_HE.

Referenced by deposits().

376  {
377  double noise = fabs(tower.eta())> 1.479 ? theNoise_HE : theNoise_HB;
378  return noise;
379 }
double eta() const final
momentum pseudorapidity
double CaloExtractorByAssociator::noiseHOcal ( const CaloTower tower) const
private

Definition at line 381 of file CaloExtractorByAssociator.cc.

References theNoise_HO.

Referenced by deposits().

381  {
382  double noise = theNoise_HO;
383  return noise;
384 }
double CaloExtractorByAssociator::noiseRecHit ( const DetId detId) const
private

Definition at line 387 of file CaloExtractorByAssociator.cc.

References DetId::det(), DetId::Ecal, EcalBarrel, EcalEndcap, DetId::Hcal, HcalBarrel, HcalEndcap, HcalOuter, DetId::subdetId(), theNoise_EB, theNoise_EE, theNoise_HB, theNoise_HE, and theNoise_HO.

Referenced by deposits().

387  {
388  double noise = 100;
389  DetId::Detector det = detId.det();
390  if (det == DetId::Ecal){
391  EcalSubdetector subDet = (EcalSubdetector)(detId.subdetId());
392  if (subDet == EcalBarrel){
393  noise = theNoise_EB;
394  } else if (subDet == EcalEndcap){
395  noise = theNoise_EE;
396  }
397  } else if (det == DetId::Hcal){
398  HcalSubdetector subDet = (HcalSubdetector)(detId.subdetId());
399  if (subDet == HcalBarrel){
400  noise = theNoise_HB;
401  } else if (subDet == HcalEndcap){
402  noise = theNoise_HE;
403  } else if (subDet == HcalOuter){
404  noise = theNoise_HO;
405  }
406  }
407  return noise;
408 }
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
HcalSubdetector
Definition: HcalAssistant.h:31
Detector
Definition: DetId.h:26
EcalSubdetector
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39

Member Data Documentation

TrackDetectorAssociator* muonisolation::CaloExtractorByAssociator::theAssociator
private
TrackAssociatorParameters* muonisolation::CaloExtractorByAssociator::theAssociatorParameters
private

associator, its' parameters and the propagator

Definition at line 102 of file CaloExtractorByAssociator.h.

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

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 80 of file CaloExtractorByAssociator.h.

Referenced by deposits().

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

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

Definition at line 63 of file CaloExtractorByAssociator.h.

Referenced by deposits().

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

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

Definition at line 60 of file CaloExtractorByAssociator.h.

double muonisolation::CaloExtractorByAssociator::theDR_Max
private

max cone size in which towers are considered

Definition at line 82 of file CaloExtractorByAssociator.h.

Referenced by deposits().

double muonisolation::CaloExtractorByAssociator::theDR_Veto_E
private

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

Definition at line 75 of file CaloExtractorByAssociator.h.

Referenced by deposits().

double muonisolation::CaloExtractorByAssociator::theDR_Veto_H
private

Definition at line 76 of file CaloExtractorByAssociator.h.

Referenced by deposits().

double muonisolation::CaloExtractorByAssociator::theDR_Veto_HO
private

Definition at line 77 of file CaloExtractorByAssociator.h.

Referenced by deposits().

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 86 of file CaloExtractorByAssociator.h.

Referenced by noiseRecHit().

double muonisolation::CaloExtractorByAssociator::theNoise_EE
private

Definition at line 87 of file CaloExtractorByAssociator.h.

Referenced by noiseRecHit().

double muonisolation::CaloExtractorByAssociator::theNoise_HB
private

Definition at line 88 of file CaloExtractorByAssociator.h.

Referenced by noiseHcal(), and noiseRecHit().

double muonisolation::CaloExtractorByAssociator::theNoise_HE
private

Definition at line 89 of file CaloExtractorByAssociator.h.

Referenced by noiseHcal(), and noiseRecHit().

double muonisolation::CaloExtractorByAssociator::theNoise_HO
private

Definition at line 90 of file CaloExtractorByAssociator.h.

Referenced by noiseHOcal(), and noiseRecHit().

double muonisolation::CaloExtractorByAssociator::theNoiseTow_EB
private

Definition at line 91 of file CaloExtractorByAssociator.h.

Referenced by noiseEcal().

double muonisolation::CaloExtractorByAssociator::theNoiseTow_EE
private

Definition at line 92 of file CaloExtractorByAssociator.h.

Referenced by noiseEcal().

bool muonisolation::CaloExtractorByAssociator::thePrintTimeReport
private

flag to turn on/off printing of a time report

Definition at line 106 of file CaloExtractorByAssociator.h.

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

propagator name to feed into the track associator

Definition at line 66 of file CaloExtractorByAssociator.h.

Referenced by deposits().

MuonServiceProxy* muonisolation::CaloExtractorByAssociator::theService
private

the event setup proxy, it takes care the services update

Definition at line 98 of file CaloExtractorByAssociator.h.

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

double muonisolation::CaloExtractorByAssociator::theThreshold_E
private

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

Definition at line 70 of file CaloExtractorByAssociator.h.

Referenced by deposits().

double muonisolation::CaloExtractorByAssociator::theThreshold_H
private

Definition at line 71 of file CaloExtractorByAssociator.h.

Referenced by deposits().

double muonisolation::CaloExtractorByAssociator::theThreshold_HO
private

Definition at line 72 of file CaloExtractorByAssociator.h.

Referenced by deposits().

bool muonisolation::CaloExtractorByAssociator::theUseRecHitsFlag
private

use towers or rec hits

Definition at line 57 of file CaloExtractorByAssociator.h.

Referenced by deposits().

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

Vector of calo Ids to veto – not used.

Definition at line 95 of file CaloExtractorByAssociator.h.