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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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 52 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_, edm::EDConsumerBase::consumesCollector(), ecalLabels_, etaMax_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hltFiltTag_, hltMatchingCone_, i, HLT_25ns14e33_v1_cff::InputTag, 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");
191 // ===============================================================
192 
193  //create also IsolatedPixelTrackCandidateCollection which contains isolation info and reference to primary track
194  produces<reco::IsolatedPixelTrackCandidateCollection>("HcalIsolatedTrackCollection");
195 
196  produces<reco::TrackCollection>("IsoTrackTracksCollection");
197  produces<reco::TrackExtraCollection>("IsoTrackExtraTracksCollection");
198 
199  produces<EcalRecHitCollection>("IsoTrackEcalRecHitCollection");
200  produces<EcalRecHitCollection>("IsoTrackPSEcalRecHitCollection");
201 
202  produces<HBHERecHitCollection>("IsoTrackHBHERecHitCollection");
203  produces<HORecHitCollection>("IsoTrackHORecHitCollection");
204 
205 }
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
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
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_
std::vector< edm::EDGetTokenT< EcalRecHitCollection > > toks_ecal_
AlCaIsoTracksProducer::~AlCaIsoTracksProducer ( )

Definition at line 208 of file AlCaIsoTracksProducer.cc.

208 { }

Member Function Documentation

void AlCaIsoTracksProducer::endJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 560 of file AlCaIsoTracksProducer.cc.

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

vector of used hits:

Implements edm::EDProducer.

Definition at line 211 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(), EnergyCorrector::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_, HLT_50ns_5e33_v1_cff::trackCollection, 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().

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

Member Data Documentation

bool AlCaIsoTracksProducer::checkHLTMatch_
private

Definition at line 82 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::cluRad_
private

Definition at line 88 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 67 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer().

double AlCaIsoTracksProducer::etaMax_
private

Definition at line 87 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

const CaloGeometry* AlCaIsoTracksProducer::geo
private

Definition at line 66 of file AlCaIsoTracksProducer.h.

Referenced by produce().

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

Definition at line 83 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::hltMatchingCone_
private

Definition at line 84 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::isolE_
private

Definition at line 86 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

std::string AlCaIsoTracksProducer::l1FilterTag_
private

Definition at line 97 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::l1jetVetoCone_
private

Definition at line 98 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::m_ddirCut
private

Definition at line 72 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::m_dvCut
private

Definition at line 71 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer().

double AlCaIsoTracksProducer::m_ecalCut
private

Definition at line 76 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::m_pCut
private

Definition at line 74 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer().

double AlCaIsoTracksProducer::m_ptCut
private

Definition at line 75 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

int AlCaIsoTracksProducer::matrixInnerSize_
private

Definition at line 94 of file AlCaIsoTracksProducer.h.

int AlCaIsoTracksProducer::matrixOuterSize_
private

Definition at line 95 of file AlCaIsoTracksProducer.h.

int AlCaIsoTracksProducer::matrixSize_
private

Definition at line 93 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

int AlCaIsoTracksProducer::nHitsMinCore_
private

Definition at line 69 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

int AlCaIsoTracksProducer::nHitsMinIso_
private

Definition at line 70 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 90 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::ringOutRad_
private

Definition at line 89 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

bool AlCaIsoTracksProducer::skipNeutrals_
private

Definition at line 81 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::taECALCone_
private

Definition at line 78 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

double AlCaIsoTracksProducer::taHCALCone_
private

Definition at line 79 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 101 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 103 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 100 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 106 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 102 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

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

Definition at line 105 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

TrackDetectorAssociator AlCaIsoTracksProducer::trackAssociator_
private

Definition at line 62 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

bool AlCaIsoTracksProducer::useConeCorr_
private

Definition at line 73 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().

bool AlCaIsoTracksProducer::useECALCluMatrix_
private

Definition at line 92 of file AlCaIsoTracksProducer.h.

Referenced by AlCaIsoTracksProducer(), and produce().