CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Attributes
IsolatedPixelTrackCandidateL1TProducer Class Reference
Inheritance diagram for IsolatedPixelTrackCandidateL1TProducer:
edm::stream::EDProducer<>

Classes

struct  seedAtEC
 

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
double getDistInCM (double eta1, double phi1, double eta2, double phi2)
 
std::pair< double, double > GetEtaPhiAtEcal (double etaIP, double phiIP, double pT, int charge, double vtxZ)
 
 IsolatedPixelTrackCandidateL1TProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &evt, const edm::EventSetup &es) override
 
 ~IsolatedPixelTrackCandidateL1TProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

const std::string bfield_
 
double bfVal_
 
const double ebEtaBoundary_
 
const double maxPForIsolationValue_
 
const double minPTrackValue_
 
const double pixelIsolationConeSizeAtEC_
 
const double prelimCone_
 
double rEB_
 
const double tauAssocCone_
 
const double tauUnbiasCone_
 
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecordtok_bFieldH_
 
const edm::ESGetToken< CaloGeometry, CaloGeometryRecordtok_geom_
 
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefstok_hlt_
 
const edm::EDGetTokenT< l1t::TauBxCollectiontok_l1_
 
const edm::EDGetTokenT< reco::VertexCollectiontok_vert_
 
const std::vector< edm::EDGetTokenT< reco::TrackCollection > > toks_pix_
 
const double vtxCutIsol_
 
const double vtxCutSeed_
 
double zEE_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 64 of file IsolatedPixelTrackCandidateL1TProducer.cc.

Constructor & Destructor Documentation

◆ IsolatedPixelTrackCandidateL1TProducer()

IsolatedPixelTrackCandidateL1TProducer::IsolatedPixelTrackCandidateL1TProducer ( const edm::ParameterSet ps)

Definition at line 109 of file IsolatedPixelTrackCandidateL1TProducer.cc.

References makeGlobalPositionRcd_cfg::tag.

110  : tok_hlt_(consumes<trigger::TriggerFilterObjectWithRefs>(config.getParameter<edm::InputTag>("L1GTSeedLabel"))),
111  tok_l1_(consumes<l1t::TauBxCollection>(config.getParameter<edm::InputTag>("L1eTauJetsSource"))),
112  tok_vert_(consumes<reco::VertexCollection>(config.getParameter<edm::InputTag>("VertexLabel"))),
113  toks_pix_(
114  edm::vector_transform(config.getParameter<std::vector<edm::InputTag> >("PixelTracksSources"),
115  [this](edm::InputTag const& tag) { return consumes<reco::TrackCollection>(tag); })),
116  tok_bFieldH_(esConsumes<MagneticField, IdealMagneticFieldRecord, edm::Transition::BeginRun>()),
117  tok_geom_(esConsumes<CaloGeometry, CaloGeometryRecord, edm::Transition::BeginRun>()),
118  bfield_(config.getParameter<std::string>("MagFieldRecordName")),
119  prelimCone_(config.getParameter<double>("ExtrapolationConeSize")),
120  pixelIsolationConeSizeAtEC_(config.getParameter<double>("PixelIsolationConeSizeAtEC")),
121  vtxCutSeed_(config.getParameter<double>("MaxVtxDXYSeed")),
122  vtxCutIsol_(config.getParameter<double>("MaxVtxDXYIsol")),
123  tauAssocCone_(config.getParameter<double>("tauAssociationCone")),
124  tauUnbiasCone_(config.getParameter<double>("tauUnbiasCone")),
125  minPTrackValue_(config.getParameter<double>("minPTrack")),
126  maxPForIsolationValue_(config.getParameter<double>("maxPTrackForIsolation")),
127  ebEtaBoundary_(config.getParameter<double>("EBEtaBoundary")),
128  rEB_(-1),
129  zEE_(-1),
130  bfVal_(0) {
131  // Register the product
132  produces<reco::IsolatedPixelTrackCandidateCollection>();
133 }
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
Definition: config.py:1
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
const edm::EDGetTokenT< reco::VertexCollection > tok_vert_
const edm::EDGetTokenT< l1t::TauBxCollection > tok_l1_
const std::vector< edm::EDGetTokenT< reco::TrackCollection > > toks_pix_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > tok_bFieldH_
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_hlt_

◆ ~IsolatedPixelTrackCandidateL1TProducer()

IsolatedPixelTrackCandidateL1TProducer::~IsolatedPixelTrackCandidateL1TProducer ( )
override

Definition at line 135 of file IsolatedPixelTrackCandidateL1TProducer.cc.

135 {}

Member Function Documentation

◆ beginRun()

void IsolatedPixelTrackCandidateL1TProducer::beginRun ( const edm::Run run,
const edm::EventSetup theEventSetup 
)
override

Definition at line 157 of file IsolatedPixelTrackCandidateL1TProducer.cc.

References ProducerSetup_cfi::BField, bfVal_, DetId::Ecal, EcalBarrel, EcalEndcap, edm::EventSetup::getData(), CaloGeometry::getSubdetectorGeometry(), VolumeBasedMagneticField::inTesla(), rEB_, tok_bFieldH_, tok_geom_, zEE_, and geometryCSVtoXML::zz.

157  {
158  const CaloGeometry* pG = &theEventSetup.getData(tok_geom_);
159 
160  const double rad(dynamic_cast<const EcalBarrelGeometry*>(pG->getSubdetectorGeometry(DetId::Ecal, EcalBarrel))
161  ->avgRadiusXYFrontFaceCenter());
162  const double zz(dynamic_cast<const EcalEndcapGeometry*>(pG->getSubdetectorGeometry(DetId::Ecal, EcalEndcap))
163  ->avgAbsZFrontFaceCenter());
164 
165  rEB_ = rad;
166  zEE_ = zz;
167 
168  const MagneticField* vbfField = &theEventSetup.getData(tok_bFieldH_);
169  const VolumeBasedMagneticField* vbfCPtr = dynamic_cast<const VolumeBasedMagneticField*>(&(*vbfField));
170  GlobalVector BField = vbfCPtr->inTesla(GlobalPoint(0, 0, 0));
171  bfVal_ = BField.mag();
172 #ifdef EDM_ML_DEBUG
173  edm::LogVerbatim("IsoTrack") << "rEB " << rEB_ << " zEE " << zEE_ << " B " << bfVal_;
174 #endif
175 }
Log< level::Info, true > LogVerbatim
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
GlobalVector inTesla(const GlobalPoint &g) const override
Field value ad specified global point, in Tesla.
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > tok_bFieldH_
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34

◆ fillDescriptions()

void IsolatedPixelTrackCandidateL1TProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 137 of file IsolatedPixelTrackCandidateL1TProducer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, AlCaHLTBitMon_QueryRunRegistry::string, and SiPixelMonitorTrack_cfi::tracksrc.

137  {
139  std::vector<edm::InputTag> tracksrc = {edm::InputTag("hltPixelTracks")};
140  desc.add<edm::InputTag>("L1eTauJetsSource", edm::InputTag("hltGtStage2Digis", "Tau"));
141  desc.add<double>("tauAssociationCone", 0.0);
142  desc.add<double>("tauUnbiasCone", 1.2);
143  desc.add<std::vector<edm::InputTag> >("PixelTracksSources", tracksrc);
144  desc.add<double>("ExtrapolationConeSize", 1.0);
145  desc.add<double>("PixelIsolationConeSizeAtEC", 40);
146  desc.add<edm::InputTag>("L1GTSeedLabel", edm::InputTag("hltL1sV0SingleJet60"));
147  desc.add<double>("MaxVtxDXYSeed", 101.0);
148  desc.add<double>("MaxVtxDXYIsol", 101.0);
149  desc.add<edm::InputTag>("VertexLabel", edm::InputTag("hltTrimmedPixelVertices"));
150  desc.add<std::string>("MagFieldRecordName", "VolumeBasedMagneticField");
151  desc.add<double>("minPTrack", 5.0);
152  desc.add<double>("maxPTrackForIsolation", 3.0);
153  desc.add<double>("EBEtaBoundary", 1.479);
154  descriptions.add("isolPixelTrackProdL1T", desc);
155 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ getDistInCM()

double IsolatedPixelTrackCandidateL1TProducer::getDistInCM ( double  eta1,
double  phi1,
double  eta2,
double  phi2 
)

Definition at line 362 of file IsolatedPixelTrackCandidateL1TProducer.cc.

References funct::abs(), angle(), funct::cos(), HLT_2023v12_cff::eta1, HLT_2023v12_cff::eta2, JetChargeProducer_cfi::exp, M_PI_2, rEB_, funct::sin(), funct::tan(), and zEE_.

Referenced by produce().

362  {
363  double Rec;
364  double theta1 = 2 * atan(exp(-eta1));
365  double theta2 = 2 * atan(exp(-eta2));
366  if (std::abs(eta1) < 1.479)
367  Rec = rEB_; //radius of ECAL barrel
368  else if (std::abs(eta1) > 1.479 && std::abs(eta1) < 7.0)
369  Rec = tan(theta1) * zEE_; //distance from IP to ECAL endcap
370  else
371  return 1000;
372 
373  //|vect| times tg of acos(scalar product)
374  double angle =
375  acos((sin(theta1) * sin(theta2) * (sin(phi1) * sin(phi2) + cos(phi1) * cos(phi2)) + cos(theta1) * cos(theta2)));
376  if (angle < M_PI_2)
377  return std::abs((Rec / sin(theta1)) * tan(angle));
378  else
379  return 1000;
380 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
#define M_PI_2
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11

◆ GetEtaPhiAtEcal()

std::pair< double, double > IsolatedPixelTrackCandidateL1TProducer::GetEtaPhiAtEcal ( double  etaIP,
double  phiIP,
double  pT,
int  charge,
double  vtxZ 
)

Definition at line 382 of file IsolatedPixelTrackCandidateL1TProducer.cc.

References funct::abs(), simBeamSpotPI::alpha, bfVal_, ALCARECOTkAlJpsiMuMu_cff::charge, SiPixelRawToDigiRegional_cfi::deltaPhi, ebEtaBoundary_, JetChargeProducer_cfi::exp, dqm-mbProfile::log, M_PI, M_PI_2, pv::pT, rEB_, funct::sin(), funct::tan(), theta(), z, and zEE_.

Referenced by produce().

383  {
384  double deltaPhi = 0;
385  double etaEC = 100;
386  double phiEC = 100;
387 
388  double Rcurv = 9999999;
389  if (bfVal_ != 0)
390  Rcurv = pT * 33.3 * 100 / (bfVal_ * 10); //r(m)=pT(GeV)*33.3/B(kG)
391 
392  double ecDist = zEE_; //distance to ECAL andcap from IP (cm), 317 - ecal (not preshower), preshower -300
393  double ecRad = rEB_; //radius of ECAL barrel (cm)
394  double theta = 2 * atan(exp(-etaIP));
395  double zNew = 0;
396  if (theta > M_PI_2)
397  theta = M_PI - theta;
398  if (std::abs(etaIP) < ebEtaBoundary_) {
399  if ((0.5 * ecRad / Rcurv) > 1) {
400  etaEC = 10000;
401  deltaPhi = 0;
402  } else {
403  deltaPhi = -charge * asin(0.5 * ecRad / Rcurv);
404  double alpha1 = 2 * asin(0.5 * ecRad / Rcurv);
405  double z = ecRad / tan(theta);
406  if (etaIP > 0)
407  zNew = z * (Rcurv * alpha1) / ecRad + vtxZ; //new z-coordinate of track
408  else
409  zNew = -z * (Rcurv * alpha1) / ecRad + vtxZ; //new z-coordinate of track
410  double zAbs = std::abs(zNew);
411  if (zAbs < ecDist) {
412  etaEC = -log(tan(0.5 * atan(ecRad / zAbs)));
413  deltaPhi = -charge * asin(0.5 * ecRad / Rcurv);
414  }
415  if (zAbs > ecDist) {
416  zAbs = (std::abs(etaIP) / etaIP) * ecDist;
417  double Zflight = std::abs(zAbs - vtxZ);
418  double alpha = (Zflight * ecRad) / (z * Rcurv);
419  double Rec = 2 * Rcurv * sin(alpha / 2);
420  deltaPhi = -charge * alpha / 2;
421  etaEC = -log(tan(0.5 * atan(Rec / ecDist)));
422  }
423  }
424  } else {
425  zNew = (std::abs(etaIP) / etaIP) * ecDist;
426  double Zflight = std::abs(zNew - vtxZ);
427  double Rvirt = std::abs(Zflight * tan(theta));
428  double Rec = 2 * Rcurv * sin(Rvirt / (2 * Rcurv));
429  deltaPhi = -(charge) * (Rvirt / (2 * Rcurv));
430  etaEC = -log(tan(0.5 * atan(Rec / ecDist)));
431  }
432 
433  if (zNew < 0)
434  etaEC = -etaEC;
435  phiEC = phiIP + deltaPhi;
436 
437  if (phiEC < -M_PI)
438  phiEC += M_2_PI;
439  if (phiEC > M_PI)
440  phiEC -= M_2_PI;
441 
442  std::pair<double, double> retVal(etaEC, phiEC);
443  return retVal;
444 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
#define M_PI_2
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI
Geom::Theta< T > theta() const

◆ produce()

void IsolatedPixelTrackCandidateL1TProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
override

Definition at line 177 of file IsolatedPixelTrackCandidateL1TProducer.cc.

References funct::abs(), BXVector< T >::begin(), ALCARECOTkAlJpsiMuMu_cff::charge, reco::deltaR(), PVValHelper::dxy, PVValHelper::dz, BXVector< T >::end(), PVValHelper::eta, newFWLiteAna::found, getDistInCM(), GetEtaPhiAtEcal(), edm::Event::getHandle(), trigger::TriggerRefsCollections::getObjects(), mps_fire::i, dqmiolumiharvest::j, RecoMuonValidator_cfi::maxP, maxPForIsolationValue_, minPTrackValue_, eostools::move(), convertSQLiteXML::ok, AlCaHLTBitMon_ParallelJobs::p, phi, pixelIsolationConeSizeAtEC_, prelimCone_, DiDispStaMuonMonitor_cfi::pt, edm::Event::put(), dttmaxenums::R, fileCollector::seed, reco::IsolatedPixelTrackCandidate::setEtaPhiEcal(), tauAssocCone_, tauUnbiasCone_, tok_hlt_, tok_l1_, tok_vert_, toks_pix_, JetHT_cfg::trackCollection, trigger::TriggerL1Jet, trigger::TriggerL1Tau, vtxCutIsol_, and vtxCutSeed_.

177  {
178  auto trackCollection = std::make_unique<reco::IsolatedPixelTrackCandidateCollection>();
179 
180  //create vector of refs from input collections
181  std::vector<reco::TrackRef> pixelTrackRefs;
182 
183  for (unsigned int iPix = 0; iPix < toks_pix_.size(); iPix++) {
184  const edm::Handle<reco::TrackCollection>& iPixCol = theEvent.getHandle(toks_pix_[iPix]);
185  for (reco::TrackCollection::const_iterator pit = iPixCol->begin(); pit != iPixCol->end(); pit++) {
186  pixelTrackRefs.push_back(reco::TrackRef(iPixCol, pit - iPixCol->begin()));
187  }
188  }
189 
190  const edm::Handle<l1t::TauBxCollection>& l1eTauJets = theEvent.getHandle(tok_l1_);
191 
192  const edm::Handle<reco::VertexCollection>& pVert = theEvent.getHandle(tok_vert_);
193 
194  double ptTriggered = -10;
195  double etaTriggered = -100;
196  double phiTriggered = -100;
197 
198  const edm::Handle<trigger::TriggerFilterObjectWithRefs>& l1trigobj = theEvent.getHandle(tok_hlt_);
199 
200  std::vector<edm::Ref<l1t::TauBxCollection> > l1tauobjref;
201  std::vector<edm::Ref<l1t::JetBxCollection> > l1jetobjref;
202 
203  // l1trigobj->getObjects(trigger::TriggerTau, l1tauobjref);
204  l1trigobj->getObjects(trigger::TriggerL1Tau, l1tauobjref);
205  // l1trigobj->getObjects(trigger::TriggerJet, l1jetobjref);
206  l1trigobj->getObjects(trigger::TriggerL1Jet, l1jetobjref);
207 
208  for (const auto& p : l1tauobjref) {
209  if (p->pt() > ptTriggered) {
210  ptTriggered = p->pt();
211  phiTriggered = p->phi();
212  etaTriggered = p->eta();
213  }
214  }
215  for (const auto& p : l1jetobjref) {
216  if (p->pt() > ptTriggered) {
217  ptTriggered = p->pt();
218  phiTriggered = p->phi();
219  etaTriggered = p->eta();
220  }
221  }
222 #ifdef EDM_ML_DEBUG
223  edm::LogVerbatim("IsoTrack") << "Sizes " << l1tauobjref.size() << ":" << l1jetobjref.size() << " Trig " << ptTriggered
224  << ":" << etaTriggered << ":" << phiTriggered;
225 #endif
226  double drMaxL1Track_ = tauAssocCone_;
227  int ntr = 0;
228  std::vector<seedAtEC> VecSeedsatEC;
229  //loop to select isolated tracks
230  for (unsigned iS = 0; iS < pixelTrackRefs.size(); iS++) {
231  bool vtxMatch = false;
232  //associate to vertex (in Z)
233  reco::VertexCollection::const_iterator vitSel;
234  double minDZ = 1000;
235  bool found(false);
236  for (reco::VertexCollection::const_iterator vit = pVert->begin(); vit != pVert->end(); vit++) {
237  if (std::abs(pixelTrackRefs[iS]->dz(vit->position())) < minDZ) {
238  minDZ = std::abs(pixelTrackRefs[iS]->dz(vit->position()));
239  vitSel = vit;
240  found = true;
241  }
242  }
243  //cut on dYX:
244  if (found) {
245  if (std::abs(pixelTrackRefs[iS]->dxy(vitSel->position())) < vtxCutSeed_)
246  vtxMatch = true;
247  } else {
248  vtxMatch = true;
249  }
250 #ifdef EDM_ML_DEBUG
251  edm::LogVerbatim("IsoTrack") << "minZD " << minDZ << " Found " << found << ":" << vtxMatch;
252 #endif
253  //select tracks not matched to triggered L1 jet
254  double R = reco::deltaR(etaTriggered, phiTriggered, pixelTrackRefs[iS]->eta(), pixelTrackRefs[iS]->phi());
255 #ifdef EDM_ML_DEBUG
256  edm::LogVerbatim("IsoTrack") << "Distance to L1 " << R << ":" << tauUnbiasCone_ << " Result "
257  << (R < tauUnbiasCone_);
258 #endif
259  if (R < tauUnbiasCone_)
260  continue;
261 
262  //check taujet matching
263  bool tmatch = false;
265  for (l1t::TauBxCollection::const_iterator tj = l1eTauJets->begin(); tj != l1eTauJets->end(); tj++) {
266  if (reco::deltaR(pixelTrackRefs[iS]->momentum().eta(),
267  pixelTrackRefs[iS]->momentum().phi(),
268  tj->momentum().eta(),
269  tj->momentum().phi()) > drMaxL1Track_)
270  continue;
271  selj = tj;
272  tmatch = true;
273  } //loop over L1 tau
274 #ifdef EDM_ML_DEBUG
275  edm::LogVerbatim("IsoTrack") << "tMatch " << tmatch;
276 #endif
277  //propagate seed track to ECAL surface:
278  std::pair<double, double> seedCooAtEC;
279  // in case vertex is found:
280  if (found)
281  seedCooAtEC = GetEtaPhiAtEcal(pixelTrackRefs[iS]->eta(),
282  pixelTrackRefs[iS]->phi(),
283  pixelTrackRefs[iS]->pt(),
284  pixelTrackRefs[iS]->charge(),
285  vitSel->z());
286  //in case vertex is not found:
287  else
288  seedCooAtEC = GetEtaPhiAtEcal(pixelTrackRefs[iS]->eta(),
289  pixelTrackRefs[iS]->phi(),
290  pixelTrackRefs[iS]->pt(),
291  pixelTrackRefs[iS]->charge(),
292  0);
293  seedAtEC seed(iS, (tmatch || vtxMatch), seedCooAtEC.first, seedCooAtEC.second);
294  VecSeedsatEC.push_back(seed);
295 #ifdef EDM_ML_DEBUG
296  edm::LogVerbatim("IsoTrack") << "Seed " << seedCooAtEC.first << seedCooAtEC.second;
297 #endif
298  }
299  for (unsigned int i = 0; i < VecSeedsatEC.size(); i++) {
300  unsigned int iSeed = VecSeedsatEC[i].index;
301  if (!VecSeedsatEC[i].ok)
302  continue;
303  if (pixelTrackRefs[iSeed]->p() < minPTrackValue_)
304  continue;
306  for (l1t::TauBxCollection::const_iterator tj = l1eTauJets->begin(); tj != l1eTauJets->end(); tj++) {
307  if (reco::deltaR(pixelTrackRefs[iSeed]->momentum().eta(),
308  pixelTrackRefs[iSeed]->momentum().phi(),
309  tj->momentum().eta(),
310  tj->momentum().phi()) > drMaxL1Track_)
311  continue;
312  selj = tj;
313  } //loop over L1 tau
314  double maxP = 0;
315  double sumP = 0;
316  for (unsigned int j = 0; j < VecSeedsatEC.size(); j++) {
317  if (i == j)
318  continue;
319  unsigned int iSurr = VecSeedsatEC[j].index;
320  //define preliminary cone around seed track impact point from which tracks will be extrapolated:
321  if (reco::deltaR(pixelTrackRefs[iSeed]->eta(),
322  pixelTrackRefs[iSeed]->phi(),
323  pixelTrackRefs[iSurr]->eta(),
324  pixelTrackRefs[iSurr]->phi()) > prelimCone_)
325  continue;
326  double minDZ2(1000);
327  bool found(false);
328  reco::VertexCollection::const_iterator vitSel2;
329  for (reco::VertexCollection::const_iterator vit = pVert->begin(); vit != pVert->end(); vit++) {
330  if (std::abs(pixelTrackRefs[iSurr]->dz(vit->position())) < minDZ2) {
331  minDZ2 = std::abs(pixelTrackRefs[iSurr]->dz(vit->position()));
332  vitSel2 = vit;
333  found = true;
334  }
335  }
336  //cut ot dXY:
337  if (found && std::abs(pixelTrackRefs[iSurr]->dxy(vitSel2->position())) > vtxCutIsol_)
338  continue;
339  //calculate distance at ECAL surface and update isolation:
340  if (getDistInCM(VecSeedsatEC[i].eta, VecSeedsatEC[i].phi, VecSeedsatEC[j].eta, VecSeedsatEC[j].phi) <
342  sumP += pixelTrackRefs[iSurr]->p();
343  if (pixelTrackRefs[iSurr]->p() > maxP)
344  maxP = pixelTrackRefs[iSurr]->p();
345  }
346  }
349  pixelTrackRefs[iSeed], l1t::TauRef(l1eTauJets, selj - l1eTauJets->begin()), maxP, sumP);
350  newCandidate.setEtaPhiEcal(VecSeedsatEC[i].eta, VecSeedsatEC[i].phi);
351  trackCollection->push_back(newCandidate);
352  ntr++;
353  }
354  }
355 #ifdef EDM_ML_DEBUG
356  edm::LogVerbatim("IsoTrack") << "Number of Isolated Track " << ntr;
357 #endif
358  // put the product in the event
359  theEvent.put(std::move(trackCollection));
360 }
Log< level::Info, true > LogVerbatim
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
double getDistInCM(double eta1, double phi1, double eta2, double phi2)
const edm::EDGetTokenT< reco::VertexCollection > tok_vert_
const_iterator begin(int bx) const
std::vector< T >::const_iterator const_iterator
Definition: BXVector.h:18
const edm::EDGetTokenT< l1t::TauBxCollection > tok_l1_
const std::vector< edm::EDGetTokenT< reco::TrackCollection > > toks_pix_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::pair< double, double > GetEtaPhiAtEcal(double etaIP, double phiIP, double pT, int charge, double vtxZ)
trackCollection
Definition: JetHT_cfg.py:51
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
const_iterator end(int bx) const
def move(src, dest)
Definition: eostools.py:511
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_hlt_

Member Data Documentation

◆ bfield_

const std::string IsolatedPixelTrackCandidateL1TProducer::bfield_
private

Definition at line 92 of file IsolatedPixelTrackCandidateL1TProducer.cc.

◆ bfVal_

double IsolatedPixelTrackCandidateL1TProducer::bfVal_
private

Definition at line 106 of file IsolatedPixelTrackCandidateL1TProducer.cc.

Referenced by beginRun(), and GetEtaPhiAtEcal().

◆ ebEtaBoundary_

const double IsolatedPixelTrackCandidateL1TProducer::ebEtaBoundary_
private

Definition at line 101 of file IsolatedPixelTrackCandidateL1TProducer.cc.

Referenced by GetEtaPhiAtEcal().

◆ maxPForIsolationValue_

const double IsolatedPixelTrackCandidateL1TProducer::maxPForIsolationValue_
private

Definition at line 100 of file IsolatedPixelTrackCandidateL1TProducer.cc.

Referenced by produce().

◆ minPTrackValue_

const double IsolatedPixelTrackCandidateL1TProducer::minPTrackValue_
private

Definition at line 99 of file IsolatedPixelTrackCandidateL1TProducer.cc.

Referenced by produce().

◆ pixelIsolationConeSizeAtEC_

const double IsolatedPixelTrackCandidateL1TProducer::pixelIsolationConeSizeAtEC_
private

Definition at line 94 of file IsolatedPixelTrackCandidateL1TProducer.cc.

Referenced by produce().

◆ prelimCone_

const double IsolatedPixelTrackCandidateL1TProducer::prelimCone_
private

Definition at line 93 of file IsolatedPixelTrackCandidateL1TProducer.cc.

Referenced by produce().

◆ rEB_

double IsolatedPixelTrackCandidateL1TProducer::rEB_
private

◆ tauAssocCone_

const double IsolatedPixelTrackCandidateL1TProducer::tauAssocCone_
private

Definition at line 97 of file IsolatedPixelTrackCandidateL1TProducer.cc.

Referenced by produce().

◆ tauUnbiasCone_

const double IsolatedPixelTrackCandidateL1TProducer::tauUnbiasCone_
private

Definition at line 98 of file IsolatedPixelTrackCandidateL1TProducer.cc.

Referenced by produce().

◆ tok_bFieldH_

const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> IsolatedPixelTrackCandidateL1TProducer::tok_bFieldH_
private

Definition at line 89 of file IsolatedPixelTrackCandidateL1TProducer.cc.

Referenced by beginRun().

◆ tok_geom_

const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> IsolatedPixelTrackCandidateL1TProducer::tok_geom_
private

Definition at line 90 of file IsolatedPixelTrackCandidateL1TProducer.cc.

Referenced by beginRun().

◆ tok_hlt_

const edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> IsolatedPixelTrackCandidateL1TProducer::tok_hlt_
private

Definition at line 85 of file IsolatedPixelTrackCandidateL1TProducer.cc.

Referenced by produce().

◆ tok_l1_

const edm::EDGetTokenT<l1t::TauBxCollection> IsolatedPixelTrackCandidateL1TProducer::tok_l1_
private

Definition at line 86 of file IsolatedPixelTrackCandidateL1TProducer.cc.

Referenced by produce().

◆ tok_vert_

const edm::EDGetTokenT<reco::VertexCollection> IsolatedPixelTrackCandidateL1TProducer::tok_vert_
private

Definition at line 87 of file IsolatedPixelTrackCandidateL1TProducer.cc.

Referenced by produce().

◆ toks_pix_

const std::vector<edm::EDGetTokenT<reco::TrackCollection> > IsolatedPixelTrackCandidateL1TProducer::toks_pix_
private

Definition at line 88 of file IsolatedPixelTrackCandidateL1TProducer.cc.

Referenced by produce().

◆ vtxCutIsol_

const double IsolatedPixelTrackCandidateL1TProducer::vtxCutIsol_
private

Definition at line 96 of file IsolatedPixelTrackCandidateL1TProducer.cc.

Referenced by produce().

◆ vtxCutSeed_

const double IsolatedPixelTrackCandidateL1TProducer::vtxCutSeed_
private

Definition at line 95 of file IsolatedPixelTrackCandidateL1TProducer.cc.

Referenced by produce().

◆ zEE_

double IsolatedPixelTrackCandidateL1TProducer::zEE_
private