CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Attributes
IsolatedPixelTrackCandidateL1TProducer Class Reference

#include <IsolatedPixelTrackCandidateL1TProducer.h>

Inheritance diagram for IsolatedPixelTrackCandidateL1TProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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::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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 44 of file IsolatedPixelTrackCandidateL1TProducer.h.

Constructor & Destructor Documentation

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

Definition at line 41 of file IsolatedPixelTrackCandidateL1TProducer.cc.

References bfield_, bfVal_, ebEtaBoundary_, maxPForIsolationValue_, minPTrackValue_, pixelIsolationConeSizeAtEC_, prelimCone_, rEB_, AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, tauAssocCone_, tauUnbiasCone_, vtxCutIsol_, vtxCutSeed_, and zEE_.

41  :
42  tok_hlt_( consumes<trigger::TriggerFilterObjectWithRefs>(config.getParameter<edm::InputTag>("L1GTSeedLabel")) ),
43  tok_l1_( consumes<l1t::TauBxCollection>(config.getParameter<edm::InputTag>("L1eTauJetsSource")) ),
44  tok_vert_( consumes<reco::VertexCollection>(config.getParameter<edm::InputTag>("VertexLabel")) ),
46  config.getParameter<std::vector<edm::InputTag> >("PixelTracksSources"),
47  [this](edm::InputTag const & tag){return consumes<reco::TrackCollection>(tag);}) ),
48  bfield_( config.getParameter<std::string>("MagFieldRecordName") ),
49  prelimCone_( config.getParameter<double>("ExtrapolationConeSize") ),
50  pixelIsolationConeSizeAtEC_( config.getParameter<double>("PixelIsolationConeSizeAtEC") ),
51  vtxCutSeed_( config.getParameter<double>("MaxVtxDXYSeed") ),
52  vtxCutIsol_( config.getParameter<double>("MaxVtxDXYIsol") ),
53  tauAssocCone_( config.getParameter<double>("tauAssociationCone") ),
54  tauUnbiasCone_( config.getParameter<double>("tauUnbiasCone") ),
55  minPTrackValue_( config.getParameter<double>("minPTrack") ),
56  maxPForIsolationValue_( config.getParameter<double>("maxPTrackForIsolation") ),
57  ebEtaBoundary_( config.getParameter<double>("EBEtaBoundary") ),
58  rEB_( -1 ),
59  zEE_( -1 ),
60  bfVal_( 0 )
61 {
62  // Register the product
63  produces< reco::IsolatedPixelTrackCandidateCollection >();
64 }
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::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_hlt_
IsolatedPixelTrackCandidateL1TProducer::~IsolatedPixelTrackCandidateL1TProducer ( )
override

Definition at line 66 of file IsolatedPixelTrackCandidateL1TProducer.cc.

66  {
67 
68 }

Member Function Documentation

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

Definition at line 70 of file IsolatedPixelTrackCandidateL1TProducer.cc.

References g4SimHits_cfi::BField, bfVal_, DetId::Ecal, EcalBarrel, EcalEndcap, edm::EventSetup::get(), CaloGeometry::getSubdetectorGeometry(), VolumeBasedMagneticField::inTesla(), PV3DBase< T, PVType, FrameType >::mag(), rEB_, zEE_, and geometryCSVtoXML::zz.

70  {
71 
73  theEventSetup.get<CaloGeometryRecord>().get(pG);
74 
75  const double rad (dynamic_cast<const EcalBarrelGeometry*>( pG->getSubdetectorGeometry(DetId::Ecal, EcalBarrel ))->avgRadiusXYFrontFaceCenter() ) ;
76  const double zz (dynamic_cast<const EcalEndcapGeometry*>( pG->getSubdetectorGeometry(DetId::Ecal, EcalEndcap ))->avgAbsZFrontFaceCenter() ) ;
77 
78  rEB_ = rad;
79  zEE_ = zz;
80 
82  theEventSetup.get<IdealMagneticFieldRecord>().get(vbfField);
83  const VolumeBasedMagneticField* vbfCPtr = dynamic_cast<const VolumeBasedMagneticField*>(&(*vbfField));
84  GlobalVector BField = vbfCPtr->inTesla(GlobalPoint(0,0,0));
85  bfVal_=BField.mag();
86  edm::LogVerbatim("IsoTrack") << "rEB " << rEB_ << " zEE " << zEE_ << " B "
87  << bfVal_ << std::endl;
88 }
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:45
GlobalVector inTesla(const GlobalPoint &g) const override
Field value ad specified global point, in Tesla.
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T mag() const
Definition: PV3DBase.h:67
const T & get() const
Definition: EventSetup.h:55
double IsolatedPixelTrackCandidateL1TProducer::getDistInCM ( double  eta1,
double  phi1,
double  eta2,
double  phi2 
)

Definition at line 247 of file IsolatedPixelTrackCandidateL1TProducer.cc.

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

Referenced by produce().

247  {
248  double Rec;
249  double theta1=2*atan(exp(-eta1));
250  double theta2=2*atan(exp(-eta2));
251  if (std::abs(eta1)<1.479) Rec=rEB_; //radius of ECAL barrel
252  else if (std::abs(eta1)>1.479&&std::abs(eta1)<7.0) Rec=tan(theta1)*zEE_; //distance from IP to ECAL endcap
253  else return 1000;
254 
255  //|vect| times tg of acos(scalar product)
256  double angle=acos((sin(theta1)*sin(theta2)*(sin(phi1)*sin(phi2)+cos(phi1)*cos(phi2))+cos(theta1)*cos(theta2)));
257  if (angle<M_PI_2) return std::abs((Rec/sin(theta1))*tan(angle));
258  else return 1000;
259 }
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
std::pair< double, double > IsolatedPixelTrackCandidateL1TProducer::GetEtaPhiAtEcal ( double  etaIP,
double  phiIP,
double  pT,
int  charge,
double  vtxZ 
)

Definition at line 262 of file IsolatedPixelTrackCandidateL1TProducer.cc.

References funct::abs(), alpha, bfVal_, ALCARECOTkAlJpsiMuMu_cff::charge, hiPixelPairStep_cff::deltaPhi, ebEtaBoundary_, JetChargeProducer_cfi::exp, cmsBatch::log, M_PI, M_PI_2, rEB_, funct::sin(), funct::tan(), theta(), z, and zEE_.

Referenced by produce().

262  {
263 
264  double deltaPhi=0;
265  double etaEC = 100;
266  double phiEC = 100;
267 
268  double Rcurv = 9999999;
269  if (bfVal_!=0) Rcurv=pT*33.3*100/(bfVal_*10); //r(m)=pT(GeV)*33.3/B(kG)
270 
271  double ecDist = zEE_; //distance to ECAL andcap from IP (cm), 317 - ecal (not preshower), preshower -300
272  double ecRad = rEB_; //radius of ECAL barrel (cm)
273  double theta = 2*atan(exp(-etaIP));
274  double zNew = 0;
275  if (theta>M_PI_2) theta=M_PI-theta;
276  if (std::abs(etaIP)<ebEtaBoundary_) {
277  if ((0.5*ecRad/Rcurv)>1) {
278  etaEC = 10000;
279  deltaPhi = 0;
280  } else {
281  deltaPhi =-charge*asin(0.5*ecRad/Rcurv);
282  double alpha1 = 2*asin(0.5*ecRad/Rcurv);
283  double z = ecRad/tan(theta);
284  if (etaIP>0) zNew = z*(Rcurv*alpha1)/ecRad+vtxZ; //new z-coordinate of track
285  else zNew =-z*(Rcurv*alpha1)/ecRad+vtxZ; //new z-coordinate of track
286  double zAbs=std::abs(zNew);
287  if (zAbs<ecDist) {
288  etaEC = -log(tan(0.5*atan(ecRad/zAbs)));
289  deltaPhi = -charge*asin(0.5*ecRad/Rcurv);
290  }
291  if (zAbs>ecDist) {
292  zAbs = (std::abs(etaIP)/etaIP)*ecDist;
293  double Zflight = std::abs(zAbs-vtxZ);
294  double alpha = (Zflight*ecRad)/(z*Rcurv);
295  double Rec = 2*Rcurv*sin(alpha/2);
296  deltaPhi =-charge*alpha/2;
297  etaEC =-log(tan(0.5*atan(Rec/ecDist)));
298  }
299  }
300  } else {
301  zNew = (std::abs(etaIP)/etaIP)*ecDist;
302  double Zflight = std::abs(zNew-vtxZ);
303  double Rvirt = std::abs(Zflight*tan(theta));
304  double Rec = 2*Rcurv*sin(Rvirt/(2*Rcurv));
305  deltaPhi =-(charge)*(Rvirt/(2*Rcurv));
306  etaEC =-log(tan(0.5*atan(Rec/ecDist)));
307  }
308 
309  if (zNew<0) etaEC=-etaEC;
310  phiEC = phiIP+deltaPhi;
311 
312  if (phiEC<-M_PI) phiEC += M_2_PI;
313  if (phiEC>M_PI) phiEC -= M_2_PI;
314 
315  std::pair<double,double> retVal(etaEC,phiEC);
316  return retVal;
317 }
float alpha
Definition: AMPTWrapper.h:95
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
#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
void IsolatedPixelTrackCandidateL1TProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
override

Definition at line 90 of file IsolatedPixelTrackCandidateL1TProducer.cc.

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

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

90  {
91 
92  auto trackCollection = std::make_unique<reco::IsolatedPixelTrackCandidateCollection>();
93 
94  //create vector of refs from input collections
95  std::vector<reco::TrackRef> pixelTrackRefs;
96 
97  for (unsigned int iPix=0; iPix<toks_pix_.size(); iPix++) {
99  theEvent.getByToken(toks_pix_[iPix],iPixCol);
100  for (reco::TrackCollection::const_iterator pit=iPixCol->begin(); pit!=iPixCol->end(); pit++) {
101  pixelTrackRefs.push_back(reco::TrackRef(iPixCol,pit-iPixCol->begin()));
102  }
103  }
104 
106  theEvent.getByToken(tok_l1_,l1eTauJets);
107 
109  theEvent.getByToken(tok_vert_,pVert);
110 
111  double ptTriggered = -10;
112  double etaTriggered = -100;
113  double phiTriggered = -100;
114 
116  theEvent.getByToken(tok_hlt_, l1trigobj);
117 
118  std::vector< edm::Ref<l1t::TauBxCollection> > l1tauobjref;
119  std::vector< edm::Ref<l1t::JetBxCollection> > l1jetobjref;
120 
121  // l1trigobj->getObjects(trigger::TriggerTau, l1tauobjref);
122  l1trigobj->getObjects(trigger::TriggerL1Tau, l1tauobjref);
123  // l1trigobj->getObjects(trigger::TriggerJet, l1jetobjref);
124  l1trigobj->getObjects(trigger::TriggerL1Jet, l1jetobjref);
125 
126  for (auto p : l1tauobjref) {
127  if (p->pt()>ptTriggered) {
128  ptTriggered = p->pt();
129  phiTriggered = p->phi();
130  etaTriggered = p->eta();
131  }
132  }
133  for (auto p : l1jetobjref) {
134  if (p->pt()>ptTriggered) {
135  ptTriggered = p->pt();
136  phiTriggered = p->phi();
137  etaTriggered = p->eta();
138  }
139  }
140  edm::LogVerbatim("IsoTrack") << "Sizes " << l1tauobjref.size() << ":"
141  << l1jetobjref.size() << " Trig " << ptTriggered
142  << ":" << etaTriggered << ":" << phiTriggered
143  << std::endl;
144 
145  double drMaxL1Track_ = tauAssocCone_;
146  int ntr = 0;
147  std::vector<seedAtEC> VecSeedsatEC;
148  //loop to select isolated tracks
149  for (unsigned iS=0; iS<pixelTrackRefs.size(); iS++) {
150  bool vtxMatch = false;
151  //associate to vertex (in Z)
152  reco::VertexCollection::const_iterator vitSel;
153  double minDZ = 1000;
154  bool found(false);
155  for (reco::VertexCollection::const_iterator vit=pVert->begin(); vit!=pVert->end(); vit++) {
156  if (std::abs(pixelTrackRefs[iS]->dz(vit->position()))<minDZ) {
157  minDZ = std::abs(pixelTrackRefs[iS]->dz(vit->position()));
158  vitSel = vit;
159  found = true;
160  }
161  }
162  //cut on dYX:
163  if (found) {
164  if(std::abs(pixelTrackRefs[iS]->dxy(vitSel->position()))<vtxCutSeed_) vtxMatch=true;
165  } else {
166  vtxMatch=true;
167  }
168  edm::LogVerbatim("IsoTrack") << "minZD " << minDZ << " Found " << found
169  << ":" << vtxMatch << std::endl;
170 
171  //select tracks not matched to triggered L1 jet
172  double R=reco::deltaR(etaTriggered, phiTriggered,
173  pixelTrackRefs[iS]->eta(), pixelTrackRefs[iS]->phi());
174  edm::LogVerbatim("IsoTrack") << "Distance to L1 " << R << ":"
175  << tauUnbiasCone_ << " Result "
176  << (R<tauUnbiasCone_) << std::endl;
177  if (R<tauUnbiasCone_) continue;
178 
179  //check taujet matching
180  bool tmatch=false;
182  for (l1t::TauBxCollection::const_iterator tj=l1eTauJets->begin(); tj!=l1eTauJets->end(); tj++) {
183  if (reco::deltaR(pixelTrackRefs[iS]->momentum().eta(), pixelTrackRefs[iS]->momentum().phi(), tj->momentum().eta(), tj->momentum().phi()) > drMaxL1Track_) continue;
184  selj = tj;
185  tmatch = true;
186  } //loop over L1 tau
187  edm::LogVerbatim("IsoTrack") << "tMatch " << tmatch << std::endl;
188 
189  //propagate seed track to ECAL surface:
190  std::pair<double,double> seedCooAtEC;
191  // in case vertex is found:
192  if (found) seedCooAtEC=GetEtaPhiAtEcal(pixelTrackRefs[iS]->eta(), pixelTrackRefs[iS]->phi(), pixelTrackRefs[iS]->pt(), pixelTrackRefs[iS]->charge(), vitSel->z());
193  //in case vertex is not found:
194  else seedCooAtEC=GetEtaPhiAtEcal(pixelTrackRefs[iS]->eta(), pixelTrackRefs[iS]->phi(), pixelTrackRefs[iS]->pt(), pixelTrackRefs[iS]->charge(), 0);
195  seedAtEC seed(iS,(tmatch||vtxMatch),seedCooAtEC.first,seedCooAtEC.second);
196  VecSeedsatEC.push_back(seed);
197  edm::LogVerbatim("IsoTrack") << "Seed " << seedCooAtEC.first
198  << seedCooAtEC.second << std::endl;
199  }
200  for (unsigned int i=0; i<VecSeedsatEC.size(); i++) {
201  unsigned int iSeed = VecSeedsatEC[i].index;
202  if (!VecSeedsatEC[i].ok) continue;
203  if(pixelTrackRefs[iSeed]->p()<minPTrackValue_) continue;
205  for (l1t::TauBxCollection::const_iterator tj=l1eTauJets->begin(); tj!=l1eTauJets->end(); tj++) {
206  if (reco::deltaR(pixelTrackRefs[iSeed]->momentum().eta(),pixelTrackRefs[iSeed]->momentum().phi(),tj->momentum().eta(),tj->momentum().phi()) > drMaxL1Track_) continue;
207  selj = tj;
208  } //loop over L1 tau
209  double maxP = 0;
210  double sumP = 0;
211  for(unsigned int j=0; j<VecSeedsatEC.size(); j++) {
212  if (i==j) continue;
213  unsigned int iSurr = VecSeedsatEC[j].index;
214  //define preliminary cone around seed track impact point from which tracks will be extrapolated:
215  if (reco::deltaR(pixelTrackRefs[iSeed]->eta(), pixelTrackRefs[iSeed]->phi(), pixelTrackRefs[iSurr]->eta(), pixelTrackRefs[iSurr]->phi())>prelimCone_) continue;
216  double minDZ2(1000);
217  bool found(false);
218  reco::VertexCollection::const_iterator vitSel2;
219  for (reco::VertexCollection::const_iterator vit=pVert->begin(); vit!=pVert->end(); vit++) {
220  if (std::abs(pixelTrackRefs[iSurr]->dz(vit->position()))<minDZ2) {
221  minDZ2 = std::abs(pixelTrackRefs[iSurr]->dz(vit->position()));
222  vitSel2 = vit;
223  found = true;
224  }
225  }
226  //cut ot dXY:
227  if (found&&std::abs(pixelTrackRefs[iSurr]->dxy(vitSel2->position()))>vtxCutIsol_) continue;
228  //calculate distance at ECAL surface and update isolation:
229  if (getDistInCM(VecSeedsatEC[i].eta, VecSeedsatEC[i].phi, VecSeedsatEC[j].eta, VecSeedsatEC[j].phi)<pixelIsolationConeSizeAtEC_) {
230  sumP+=pixelTrackRefs[iSurr]->p();
231  if(pixelTrackRefs[iSurr]->p()>maxP) maxP=pixelTrackRefs[iSurr]->p();
232  }
233  }
234  if (maxP<maxPForIsolationValue_) {
235  reco::IsolatedPixelTrackCandidate newCandidate(pixelTrackRefs[iSeed], l1t::TauRef(l1eTauJets,selj-l1eTauJets->begin()), maxP, sumP);
236  newCandidate.setEtaPhiEcal(VecSeedsatEC[i].eta, VecSeedsatEC[i].phi);
237  trackCollection->push_back(newCandidate);
238  ntr++;
239  }
240  }
241  edm::LogVerbatim("IsoTrack") << "Number of Isolated Track " << ntr << "\n";
242  // put the product in the event
243  theEvent.put(std::move(trackCollection));
244 }
const_iterator end(int bx) const
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 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
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:28
std::pair< double, double > GetEtaPhiAtEcal(double etaIP, double phiIP, double pT, int charge, double vtxZ)
const_iterator begin(int bx) const
def move(src, dest)
Definition: eostools.py:510
std::vector< Tau >::const_iterator const_iterator
Definition: BXVector.h:20
const edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_hlt_

Member Data Documentation

const std::string IsolatedPixelTrackCandidateL1TProducer::bfield_
private
double IsolatedPixelTrackCandidateL1TProducer::bfVal_
private
const double IsolatedPixelTrackCandidateL1TProducer::ebEtaBoundary_
private
const double IsolatedPixelTrackCandidateL1TProducer::maxPForIsolationValue_
private
const double IsolatedPixelTrackCandidateL1TProducer::minPTrackValue_
private
const double IsolatedPixelTrackCandidateL1TProducer::pixelIsolationConeSizeAtEC_
private
const double IsolatedPixelTrackCandidateL1TProducer::prelimCone_
private
double IsolatedPixelTrackCandidateL1TProducer::rEB_
private
const double IsolatedPixelTrackCandidateL1TProducer::tauAssocCone_
private
const double IsolatedPixelTrackCandidateL1TProducer::tauUnbiasCone_
private
const edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> IsolatedPixelTrackCandidateL1TProducer::tok_hlt_
private

Definition at line 66 of file IsolatedPixelTrackCandidateL1TProducer.h.

Referenced by produce().

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

Definition at line 67 of file IsolatedPixelTrackCandidateL1TProducer.h.

Referenced by produce().

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

Definition at line 68 of file IsolatedPixelTrackCandidateL1TProducer.h.

Referenced by produce().

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

Definition at line 69 of file IsolatedPixelTrackCandidateL1TProducer.h.

Referenced by produce().

const double IsolatedPixelTrackCandidateL1TProducer::vtxCutIsol_
private
const double IsolatedPixelTrackCandidateL1TProducer::vtxCutSeed_
private
double IsolatedPixelTrackCandidateL1TProducer::zEE_
private