CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
AlCaIsoTracksProducer Class Reference

#include <AlCaIsoTracksProducer.h>

Inheritance diagram for AlCaIsoTracksProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 AlCaIsoTracksProducer (const edm::ParameterSet &)
 
void endJob (void)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~AlCaIsoTracksProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

bool checkHLTMatch_
 
double cluRad_
 
std::vector< edm::InputTagecalLabels_
 
double etaMax_
 
const CaloGeometrygeo
 
std::vector< std::string > hltFiltTag_
 
double hltMatchingCone_
 
double isolE_
 
std::string l1FilterTag_
 
double l1jetVetoCone_
 
double m_ddirCut
 
double m_dvCut
 
double m_ecalCut
 
double m_pCut
 
double m_ptCut
 
int matrixInnerSize_
 
int matrixOuterSize_
 
int matrixSize_
 
int nHitsMinCore_
 
int nHitsMinIso_
 
TrackAssociatorParameters parameters_
 
double ringInnRad_
 
double ringOutRad_
 
bool skipNeutrals_
 
double taECALCone_
 
double taHCALCone_
 
edm::EDGetTokenT
< HBHERecHitCollection
tok_hbhe_
 
edm::EDGetTokenT
< trigger::TriggerEvent
tok_hlt_
 
edm::EDGetTokenT
< HORecHitCollection
tok_ho_
 
edm::EDGetTokenT
< EcalRecHitCollection
tok_ps_
 
edm::EDGetTokenT
< reco::TrackCollection
tok_track_
 
std::vector< edm::EDGetTokenT
< EcalRecHitCollection > > 
toks_ecal_
 
TrackDetectorAssociator trackAssociator_
 
bool useConeCorr_
 
bool useECALCluMatrix_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 53 of file AlCaIsoTracksProducer.h.

Constructor & Destructor Documentation

AlCaIsoTracksProducer::AlCaIsoTracksProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 136 of file AlCaIsoTracksProducer.cc.

References checkHLTMatch_, cluRad_, ecalLabels_, etaMax_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hltFiltTag_, hltMatchingCone_, i, isolE_, l1FilterTag_, l1jetVetoCone_, TrackAssociatorParameters::loadParameters(), m_ddirCut, m_dvCut, m_ecalCut, m_pCut, m_ptCut, matrixSize_, nHitsMinCore_, nHitsMinIso_, Parameters::parameters, parameters_, ringInnRad_, ringOutRad_, skipNeutrals_, AlCaHLTBitMon_QueryRunRegistry::string, taECALCone_, taHCALCone_, tok_hbhe_, tok_hlt_, tok_ho_, tok_ps_, tok_track_, toks_ecal_, trackAssociator_, useConeCorr_, TrackDetectorAssociator::useDefaultPropagator(), and useECALCluMatrix_.

137 {
138 
139  tok_track_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("InputTracksLabel"));
140 
141  tok_ho_ = consumes<HORecHitCollection>(iConfig.getParameter<edm::InputTag>("HOInput"));
142 
143  ecalLabels_=iConfig.getParameter<std::vector<edm::InputTag> >("ECALInputs");
144  const unsigned nLabels = ecalLabels_.size();
145  for ( unsigned i=0; i != nLabels; i++ )
146  toks_ecal_.push_back( consumes<EcalRecHitCollection>(ecalLabels_[i]) );
147 
148  tok_ps_ = consumes<EcalRecHitCollection>(edm::InputTag("ecalPreshowerRecHit","EcalRecHitsES"));
149 
150  tok_hbhe_ = consumes<HBHERecHitCollection>(iConfig.getParameter<edm::InputTag>("HBHEInput"));
151 
152  m_dvCut = iConfig.getParameter<double>("vtxCut");
153  m_ddirCut = iConfig.getParameter<double>("RIsolAtHCALSurface");
154  useConeCorr_=iConfig.getParameter<bool>("UseLowPtConeCorrection");
155  m_pCut = iConfig.getParameter<double>("MinTrackP");
156  m_ptCut = iConfig.getParameter<double>("MinTrackPt");
157  m_ecalCut = iConfig.getUntrackedParameter<double>("NeutralIsolCut",8.);
158 
159  taECALCone_=iConfig.getUntrackedParameter<double>("TrackAssociatorECALCone",0.5);
160  taHCALCone_=iConfig.getUntrackedParameter<double>("TrackAssociatorHCALCone",1.0);
161 
162  skipNeutrals_=iConfig.getUntrackedParameter<bool>("SkipNeutralIsoCheck",false);
163 
164  nHitsMinCore_=iConfig.getParameter<int>("MinNumberOfHitsCoreTrack");
165  nHitsMinIso_=iConfig.getParameter<int>("MinNumberOfHitsInConeTracks");
166 
167  isolE_ = iConfig.getParameter<double>("MaxNearbyTrackEnergy");
168  etaMax_= iConfig.getParameter<double>("MaxTrackEta");
169  cluRad_ = iConfig.getParameter<double>("ECALClusterRadius");
170  ringOutRad_ = iConfig.getParameter<double>("ECALRingOuterRadius");
171  ringInnRad_=iConfig.getParameter<double>("ECALRingInnerRadius");
172 
173  useECALCluMatrix_=iConfig.getParameter<bool>("ClusterECALasMatrix");
174  matrixSize_=iConfig.getParameter<int>("ECALMatrixFullSize");
175 
176  checkHLTMatch_=iConfig.getParameter<bool>("CheckHLTMatch");
177  tok_hlt_ = consumes<trigger::TriggerEvent>(iConfig.getParameter<edm::InputTag>("hltTriggerEventLabel"));
178  hltFiltTag_=iConfig.getParameter<std::vector<std::string> >("hltL3FilterLabels");
179  hltMatchingCone_=iConfig.getParameter<double>("hltMatchingCone");
180  l1FilterTag_=iConfig.getParameter<std::string>("l1FilterLabel");
181  l1jetVetoCone_=iConfig.getParameter<double>("l1JetVetoCone");
182 
184 //
185 // Parameters for track associator ===========================
186 //
187  edm::ParameterSet parameters = iConfig.getParameter<edm::ParameterSet>("TrackAssociatorParameters");
190 // ===============================================================
191 
192  //create also IsolatedPixelTrackCandidateCollection which contains isolation info and reference to primary track
193  produces<reco::IsolatedPixelTrackCandidateCollection>("HcalIsolatedTrackCollection");
194 
195  produces<reco::TrackCollection>("IsoTrackTracksCollection");
196  produces<reco::TrackExtraCollection>("IsoTrackExtraTracksCollection");
197 
198  produces<EcalRecHitCollection>("IsoTrackEcalRecHitCollection");
199  produces<EcalRecHitCollection>("IsoTrackPSEcalRecHitCollection");
200 
201  produces<HBHERecHitCollection>("IsoTrackHBHERecHitCollection");
202  produces<HORecHitCollection>("IsoTrackHORecHitCollection");
203 
204 }
T getParameter(std::string const &) const
std::vector< std::string > hltFiltTag_
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
dictionary parameters
Definition: Parameters.py:2
TrackDetectorAssociator trackAssociator_
edm::EDGetTokenT< reco::TrackCollection > tok_track_
void useDefaultPropagator()
use the default propagator
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
std::vector< edm::InputTag > ecalLabels_
TrackAssociatorParameters parameters_
edm::EDGetTokenT< trigger::TriggerEvent > tok_hlt_
edm::EDGetTokenT< EcalRecHitCollection > tok_ps_
edm::EDGetTokenT< HORecHitCollection > tok_ho_
void loadParameters(const edm::ParameterSet &)
std::vector< edm::EDGetTokenT< EcalRecHitCollection > > toks_ecal_
AlCaIsoTracksProducer::~AlCaIsoTracksProducer ( )

Definition at line 207 of file AlCaIsoTracksProducer.cc.

207 { }

Member Function Documentation

void AlCaIsoTracksProducer::endJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 559 of file AlCaIsoTracksProducer.cc.

559 {}
void AlCaIsoTracksProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

vector of used hits:

Implements edm::EDProducer.

Definition at line 210 of file AlCaIsoTracksProducer.cc.

References TrackDetectorAssociator::associate(), edm::SortedCollection< T, SORT >::begin(), checkHLTMatch(), checkHLTMatch_, cluRad_, TrackDetMatchInfo::crossedEcalRecHits, deltaR(), TrackAssociatorParameters::dREcal, TrackAssociatorParameters::dRHcal, EcalBarrel, EcalEndcap, edm::SortedCollection< T, SORT >::end(), relval_parameters_module::energy, PV3DBase< T, PVType, FrameType >::eta(), etaMax_, geo, edm::EventSetup::get(), edm::Event::getByToken(), getDistInPlaneTrackDir(), TrackDetectorAssociator::getFreeTrajectoryState(), getL1triggerDirection(), CaloGeometry::getPosition(), edm::Event::getRefBeforePut(), EBDetId::hashedIndex(), EEDetId::hashedIndex(), hltFiltTag_, hltMatchingCone_, i, customizeTrackingMonitorSeedNumber::idx, EBDetId::ieta(), info(), EBDetId::iphi(), isolE_, EEDetId::ix(), EEDetId::iy(), l1FilterTag_, l1jetVetoCone_, m_ddirCut, m_ecalCut, m_ptCut, matrixSize_, nHitsMinCore_, nHitsMinIso_, parameters_, PV3DBase< T, PVType, FrameType >::phi(), edm::Handle< T >::product(), edm::ESHandle< class >::product(), RecoTauCleanerPlugins::pt, edm::SortedCollection< T, SORT >::push_back(), edm::Event::put(), ringInnRad_, ringOutRad_, reco::IsolatedPixelTrackCandidate::SetEnergyIn(), reco::IsolatedPixelTrackCandidate::SetEnergyOut(), reco::Track::setExtra(), reco::IsolatedPixelTrackCandidate::SetMaxPtPxl(), reco::IsolatedPixelTrackCandidate::SetSumPtPxl(), skipNeutrals_, mathSSE::sqrt(), taECALCone_, taHCALCone_, tok_hbhe_, tok_hlt_, tok_ho_, tok_ps_, tok_track_, toks_ecal_, trackAssociator_, TrackDetMatchInfo::trkGlobPosAtEcal, TrackDetMatchInfo::trkGlobPosAtHcal, TrackDetMatchInfo::trkMomAtHcal, TrackAssociatorParameters::useCalo, useConeCorr_, TrackAssociatorParameters::useEcal, useECALCluMatrix_, TrackAssociatorParameters::useHcal, and TrackAssociatorParameters::useMuon.

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

211 {
212  std::auto_ptr<reco::IsolatedPixelTrackCandidateCollection> outputHcalIsoTrackColl(new reco::IsolatedPixelTrackCandidateCollection);
213  std::auto_ptr<reco::TrackCollection> outputTColl(new reco::TrackCollection);
214  std::auto_ptr<reco::TrackExtraCollection> outputExTColl(new reco::TrackExtraCollection);
215 
216  reco::TrackExtraRefProd rTrackExtras = iEvent.getRefBeforePut<reco::TrackExtraCollection>("IsoTrackExtraTracksCollection");
217  std::auto_ptr<EcalRecHitCollection> outputEColl(new EcalRecHitCollection);
218  std::auto_ptr<EcalRecHitCollection> outputESColl(new EcalRecHitCollection);
219  std::auto_ptr<HBHERecHitCollection> outputHColl(new HBHERecHitCollection);
220  std::auto_ptr<HORecHitCollection> outputHOColl(new HORecHitCollection);
221 
223  iSetup.get<CaloGeometryRecord>().get(pG);
224  geo = pG.product();
225 
226  edm::Handle<reco::TrackCollection> trackCollection;
227  iEvent.getByToken(tok_track_,trackCollection);
228 
229 
230  // temporary collection of EB+EE recHits
231  std::auto_ptr<EcalRecHitCollection> tmpEcalRecHitCollection(new EcalRecHitCollection);
232 
233  std::vector<edm::EDGetTokenT<EcalRecHitCollection> >::const_iterator i;
234  for (i=toks_ecal_.begin(); i!=toks_ecal_.end(); i++)
235  {
237  iEvent.getByToken(*i,ec);
238  for(EcalRecHitCollection::const_iterator recHit = (*ec).begin(); recHit != (*ec).end(); ++recHit)
239  {
240  tmpEcalRecHitCollection->push_back(*recHit);
241  }
242  }
243 
245  iEvent.getByToken(tok_hbhe_, hbheRHcol);
246 
247  const reco::TrackCollection tC = *(trackCollection.product());
248 
249  int itrk=0;
250  int nisotr=0;
252 
253  // Parameters for TrackDetAssociator ================================
254  // For Low momentum tracks need to look for larger cone for search ====
255  // ====================================================================
256 
257  parameters_.useEcal = true;
258  parameters_.useHcal = true;
259  parameters_.useCalo = false;
260  parameters_.useMuon = false;
263 
265 
267  std::vector<HcalDetId> usedHitsHC;
268  std::vector<int> usedHitsEC;
270 
271  // main loop over input tracks
272  for (reco::TrackCollection::const_iterator track=tC.begin(); track!=tC.end(); track++) {
273  bool noChargedTracks = true;
274  int itrk1=0;
275  itrk++;
276  double px = track->px();
277  double py = track->py();
278  double pz = track->pz();
279  double ptrack = sqrt(px*px+py*py+pz*pz);
280 
281  if (ptrack < m_pCut || track->pt() < m_ptCut ) continue;
282 
283  if (track->hitPattern().numberOfValidHits() < nHitsMinCore_) continue;
284 
285  // check that track is not in the region of L1 jet
286  double l1jDR=deltaR(track->eta(), track->phi(), getL1triggerDirection(iEvent,tok_hlt_,l1FilterTag_).first,getL1triggerDirection(iEvent,tok_hlt_,l1FilterTag_).second);
287  if (l1jDR<l1jetVetoCone_) continue;
289 
291 
292  GlobalPoint gPointHcal(info.trkGlobPosAtHcal.x(),info.trkGlobPosAtHcal.y(),info.trkGlobPosAtHcal.z());
293 
294  GlobalVector trackMomAtHcal = info.trkMomAtHcal;
295 
296  double etaecal=info.trkGlobPosAtEcal.eta();
297  double phiecal=info.trkGlobPosAtEcal.phi();
298 
299  if (etaecal==0&&phiecal==0) continue;
300 
301  //check matching to HLT object (optional)
302 
303  if (checkHLTMatch_&&!checkHLTMatch(iEvent, tok_hlt_, hltFiltTag_, etaecal, phiecal,hltMatchingCone_)) continue;
304 
305  if (fabs(track->eta())>etaMax_) continue;
306 
307  // check charged isolation from all other tracks
308  double maxPNearby=-10;
309  double sumPNearby=0;
310  for (reco::TrackCollection::const_iterator track1=tC.begin(); track1!=tC.end(); track1++)
311  {
312  itrk1++;
313  if (track == track1) continue;
314  if (track->hitPattern().numberOfValidHits() < nHitsMinIso_) continue;
315  double ptrack1 = sqrt(track1->px()*track1->px()+track1->py()*track1->py()+track1->pz()*track1->pz());
316 
318 
319  GlobalPoint gPointHcal1(info1.trkGlobPosAtHcal.x(),info1.trkGlobPosAtHcal.y(),info1.trkGlobPosAtHcal.z());
320 
321  double etaecal1=info1.trkGlobPosAtEcal.eta();
322  double phiecal1=info1.trkGlobPosAtEcal.phi();
323 
324  if (etaecal1==0&&phiecal1==0) continue;
325 
326  double hcDist=getDistInPlaneTrackDir(gPointHcal, trackMomAtHcal, gPointHcal1);
327 
328 // double hcDist=getDistInCM(etaecal,phiecal,etaecal1,phiecal1);
329 
330  // increase required separation for low momentum tracks
331  double factor=1.;
332  double factor1=1.;
333 
334  if (useConeCorr_)
335  {
336  if(ptrack<10.)factor+=(10.-ptrack)/20.;
337  if(ptrack1<10.)factor1+=(10.-ptrack1)/20.;
338  }
339 
340  if( hcDist < m_ddirCut*factor*factor1 )
341  {
342  //calculate maximum P and sum P near seed track
343  if (track1->p()>maxPNearby)
344  {
345  maxPNearby=track1->p();
346  }
347  sumPNearby+=track1->p();
348 
349  //apply loose isolation criteria
350  if (track1->p()>isolE_)
351  {
352  noChargedTracks = false;
353  break;
354  }
356  }
357 
358  } //second track loop
359 
360  bool noNeutrals = false;
361 
362  // we have a good charge-isolated track, so check neutral isolation and write it out
363 
364  if(noChargedTracks)
365  {
366  //find ecal cluster energy and write ecal recHits
367  double ecClustR=0;
368  double ecClustN=0;
369  double ecOutRingR=0;
370 
371  //get index of ECAL crystal hit by track
372  std::vector<const EcalRecHit*> crossedECids=info.crossedEcalRecHits;
373  int etaIDcenter=-10000;
374  int phiIDcenter=-10000;
375  double enMax=0;
376  for (unsigned int i=0; i<crossedECids.size(); i++)
377  {
378  if ((*crossedECids[i]).id().subdetId()==EcalEndcap)
379  {
380  EEDetId did(crossedECids[i]->id());
381  if (crossedECids[i]->energy()>enMax)
382  {
383  enMax=crossedECids[i]->energy();
384  etaIDcenter=did.iy();
385  phiIDcenter=did.ix();
386  }
387  }
388  if ((*crossedECids[i]).id().subdetId()==EcalBarrel)
389  {
390  EBDetId did(crossedECids[i]->id());
391  if (crossedECids[i]->energy()>enMax)
392  {
393  enMax=crossedECids[i]->energy();
394  etaIDcenter=did.ieta();
395  phiIDcenter=did.iphi();
396  }
397  }
398  }
399  for (std::vector<EcalRecHit>::const_iterator ehit=tmpEcalRecHitCollection->begin(); ehit!=tmpEcalRecHitCollection->end(); ehit++)
400  {
402  // R scheme of ECAL CLUSTERIZATION
403  GlobalPoint posH = geo->getPosition((*ehit).detid());
404  double phihit = posH.phi();
405  double etahit = posH.eta();
406 
407  double dHit=deltaR(etaecal,phiecal,etahit,phihit);
408 
409  double dHitCM=getDistInPlaneTrackDir(gPointHcal, trackMomAtHcal, posH);
410 
411  if (dHitCM<cluRad_)
412  {
413  ecClustR+=ehit->energy();
414  }
415 
416  if (dHitCM>ringInnRad_&&dHitCM<ringOutRad_)
417  {
418  ecOutRingR+=ehit->energy();
419  }
420 
422  //NxN scheme & check whether hit was used or not, if not used push into usedHits
423  bool hitIsUsed=false;
424  int hitHashedIndex=-10000;
425  if (ehit->id().subdetId()==EcalBarrel)
426  {
427  EBDetId did(ehit->id());
428  hitHashedIndex=did.hashedIndex();
429  if (fabs(did.ieta()-etaIDcenter)<=matrixSize_/2&&fabs(did.iphi()-phiIDcenter)<=matrixSize_/2) ecClustN+=ehit->energy();
430  }
431 
432  if (ehit->id().subdetId()==EcalEndcap)
433  {
434  EEDetId did(ehit->id());
435  hitHashedIndex=did.hashedIndex();
436  if (fabs(did.iy()-etaIDcenter)<=matrixSize_/2&&fabs(did.ix()-phiIDcenter)<=matrixSize_/2) ecClustN+=ehit->energy();
437  }
438  for (uint32_t i=0; i<usedHitsEC.size(); i++)
439  {
440  if (usedHitsEC[i]==hitHashedIndex) hitIsUsed=true;
441  }
442 
443  if (hitIsUsed) continue; //skip if used
444  usedHitsEC.push_back(hitHashedIndex);
446 
447  if(dHit<1.)
448  {
449  outputEColl->push_back(*ehit);
450  }
451  }
452 
453  //check neutrals
454  if (ecOutRingR<m_ecalCut) noNeutrals=true;
455  else noNeutrals=false;
456 
457  if (noNeutrals||skipNeutrals_)
458  {
459 
460  // Take info on the track extras and keep it in the outercollection
461 
462  reco::TrackExtraRef myextra = (*track).extra();
463  reco::TrackExtraRef teref= reco::TrackExtraRef ( rTrackExtras, idx ++ );
464 
465  outputTColl->push_back(*track);
466  reco::Track & mytrack = outputTColl->back();
467 
468  mytrack.setExtra( teref );
469  outputExTColl->push_back(*myextra);
470  // reco::TrackExtra & tx = outputExTColl->back();
471 
472  //Create IsolatedPixelTrackCandidate (will change naming in future release)
473  reco::IsolatedPixelTrackCandidate newHITCandidate(reco::Candidate::LorentzVector(track->px(),track->py(),track->pz(),track->p()));
474  newHITCandidate.SetSumPtPxl(sumPNearby);
475  newHITCandidate.SetMaxPtPxl(maxPNearby);
476 
477  //set cluster energy deposition and ring energy deposition and push_back
478  if (!useECALCluMatrix_) newHITCandidate.SetEnergyIn(ecClustR);
479  else newHITCandidate.SetEnergyIn(ecClustN);
480  newHITCandidate.SetEnergyOut(ecOutRingR);
481  outputHcalIsoTrackColl->push_back(newHITCandidate);
482 
483  //save hcal recHits
484  for (std::vector<HBHERecHit>::const_iterator hhit=hbheRHcol->begin(); hhit!=hbheRHcol->end(); hhit++)
485  {
486  //check that this hit was not considered before and push it into usedHits
487  bool hitIsUsed=false;
488  for (uint32_t i=0; i<usedHitsHC.size(); i++)
489  {
490  if (usedHitsHC[i]==hhit->id()) hitIsUsed=true;
491  }
492  if (hitIsUsed) continue;
493  usedHitsHC.push_back(hhit->id());
495 
496  GlobalPoint posH = geo->getPosition((*hhit).detid());
497  double phihit = posH.phi();
498  double etahit = posH.eta();
499 
500  double dHit=deltaR(etaecal,phiecal,etahit,phihit);
501 
502  if(dHit<1.)
503 
504  {
505  outputHColl->push_back(*hhit);
506  }
507  }
508  }
509 
510  nisotr++;
511 
512  } //if (noNeutrals....
513 
514  } // end of main track loop
515 
516  if(outputTColl->size() > 0)
517  {
518  // Take HO collection
520  iEvent.getByToken(tok_ho_,ho);
521 
522  const HORecHitCollection Hitho = *(ho.product());
523  for(HORecHitCollection::const_iterator hoItr=Hitho.begin(); hoItr!=Hitho.end(); hoItr++)
524  {
525  outputHOColl->push_back(*hoItr);
526  }
527 
528  // Take Preshower collection
529 
530  // get the ps geometry
531  edm::ESHandle<CaloGeometry> geoHandle;
532  iSetup.get<CaloGeometryRecord>().get(geoHandle);
533 
534  // get the ps topology
535  EcalPreshowerTopology psTopology(geoHandle);
536 
537  // process rechits
539  iEvent.getByToken(tok_ps_,pRecHits);
540  const EcalRecHitCollection& psrechits = *(pRecHits.product());
541 
543 
544  for(IT i=psrechits.begin(); i!=psrechits.end(); i++)
545  {
546  outputESColl->push_back( *i );
547  }
548  }
549 
550  iEvent.put( outputHcalIsoTrackColl, "HcalIsolatedTrackCollection");
551  iEvent.put( outputTColl, "IsoTrackTracksCollection");
552  iEvent.put( outputExTColl, "IsoTrackExtraTracksCollection");
553  iEvent.put( outputEColl, "IsoTrackEcalRecHitCollection");
554  iEvent.put( outputESColl, "IsoTrackPSEcalRecHitCollection");
555  iEvent.put( outputHColl, "IsoTrackHBHERecHitCollection");
556  iEvent.put( outputHOColl, "IsoTrackHORecHitCollection");
557 }
std::vector< std::string > hltFiltTag_
int i
Definition: DBlmapReader.cc:9
int hashedIndex() const
get a compact index for arrays
Definition: EBDetId.h:86
static const TGPicture * info(bool iBackgroundIsBlack)
bool checkHLTMatch(edm::Event &iEvent, edm::EDGetTokenT< trigger::TriggerEvent > &hltToken, std::vector< std::string > hltFilterTag_, double eta, double phi, double hltMatchingCone_)
TrackDetectorAssociator trackAssociator_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
static FreeTrajectoryState getFreeTrajectoryState(const edm::EventSetup &, const reco::Track &)
get FreeTrajectoryState from different track representations
double getDistInPlaneTrackDir(const GlobalPoint caloPoint, const GlobalVector caloVector, const GlobalPoint rechitPoint)
edm::EDGetTokenT< reco::TrackCollection > tok_track_
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
const CaloGeometry * geo
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
std::vector< EcalRecHit >::const_iterator const_iterator
void push_back(T const &t)
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
Definition: TrackExtraFwd.h:13
std::vector< const EcalRecHit * > crossedEcalRecHits
hits in detector elements crossed by a track
math::XYZPoint trkGlobPosAtHcal
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
T sqrt(T t)
Definition: SSEVec.h:48
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:68
std::vector< IsolatedPixelTrackCandidate > IsolatedPixelTrackCandidateCollection
collectin of IsolatedPixelTrackCandidate objects
std::pair< double, double > getL1triggerDirection(edm::Event &iEvent, edm::EDGetTokenT< trigger::TriggerEvent > &hltToken, std::string l1FilterTag_)
std::vector< LinkConnSpec >::const_iterator IT
RefProd< PROD > getRefBeforePut()
Definition: Event.h:128
const_iterator end() const
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
Definition: TrackExtraFwd.h:9
void setExtra(const TrackExtraRef &ref)
set reference to &quot;extra&quot; object
Definition: Track.h:94
int hashedIndex() const
Definition: EEDetId.h:182
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
T const * product() const
Definition: Handle.h:81
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:41
T eta() const
Definition: PV3DBase.h:76
GlobalVector trkMomAtHcal
TrackAssociatorParameters parameters_
edm::EDGetTokenT< trigger::TriggerEvent > tok_hlt_
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
edm::EDGetTokenT< EcalRecHitCollection > tok_ps_
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
boost::remove_cv< typename boost::remove_reference< argument_type >::type >::type key_type
Definition: Ref.h:170
edm::EDGetTokenT< HORecHitCollection > tok_ho_
const_iterator begin() const
std::vector< edm::EDGetTokenT< EcalRecHitCollection > > toks_ecal_

Member Data Documentation

bool AlCaIsoTracksProducer::checkHLTMatch_
private

Definition at line 83 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::cluRad_
private

Definition at line 89 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

std::vector<edm::InputTag> AlCaIsoTracksProducer::ecalLabels_
private

Definition at line 68 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer().

double AlCaIsoTracksProducer::etaMax_
private

Definition at line 88 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

const CaloGeometry* AlCaIsoTracksProducer::geo
private

Definition at line 67 of file AlCaIsoTracksProducer.h.

Referenced by produce().

std::vector<std::string> AlCaIsoTracksProducer::hltFiltTag_
private

Definition at line 84 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::hltMatchingCone_
private

Definition at line 85 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::isolE_
private

Definition at line 87 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

std::string AlCaIsoTracksProducer::l1FilterTag_
private

Definition at line 98 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::l1jetVetoCone_
private

Definition at line 99 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::m_ddirCut
private

Definition at line 73 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::m_dvCut
private

Definition at line 72 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer().

double AlCaIsoTracksProducer::m_ecalCut
private

Definition at line 77 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::m_pCut
private

Definition at line 75 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer().

double AlCaIsoTracksProducer::m_ptCut
private

Definition at line 76 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

int AlCaIsoTracksProducer::matrixInnerSize_
private

Definition at line 95 of file AlCaIsoTracksProducer.h.

int AlCaIsoTracksProducer::matrixOuterSize_
private

Definition at line 96 of file AlCaIsoTracksProducer.h.

int AlCaIsoTracksProducer::matrixSize_
private

Definition at line 94 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

int AlCaIsoTracksProducer::nHitsMinCore_
private

Definition at line 70 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

int AlCaIsoTracksProducer::nHitsMinIso_
private

Definition at line 71 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

TrackAssociatorParameters AlCaIsoTracksProducer::parameters_
private
double AlCaIsoTracksProducer::ringInnRad_
private

Definition at line 91 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::ringOutRad_
private

Definition at line 90 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

bool AlCaIsoTracksProducer::skipNeutrals_
private

Definition at line 82 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::taECALCone_
private

Definition at line 79 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::taHCALCone_
private

Definition at line 80 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::EDGetTokenT<HBHERecHitCollection> AlCaIsoTracksProducer::tok_hbhe_
private

Definition at line 102 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::EDGetTokenT<trigger::TriggerEvent> AlCaIsoTracksProducer::tok_hlt_
private

Definition at line 104 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::EDGetTokenT<HORecHitCollection> AlCaIsoTracksProducer::tok_ho_
private

Definition at line 101 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::EDGetTokenT<EcalRecHitCollection> AlCaIsoTracksProducer::tok_ps_
private

Definition at line 107 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

edm::EDGetTokenT<reco::TrackCollection> AlCaIsoTracksProducer::tok_track_
private

Definition at line 103 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

std::vector<edm::EDGetTokenT<EcalRecHitCollection> > AlCaIsoTracksProducer::toks_ecal_
private

Definition at line 106 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

TrackDetectorAssociator AlCaIsoTracksProducer::trackAssociator_
private

Definition at line 63 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

bool AlCaIsoTracksProducer::useConeCorr_
private

Definition at line 74 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

bool AlCaIsoTracksProducer::useECALCluMatrix_
private

Definition at line 93 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().