CMS 3D CMS Logo

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

#include <FastTSGFromIOHit.h>

Inheritance diagram for FastTSGFromIOHit:
TrackerSeedGenerator

Public Member Functions

 FastTSGFromIOHit (const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
 constructor More...
 
void trackerSeeds (const TrackCand &, const TrackingRegion &, const TrackerTopology *tTopo, std::vector< TrajectorySeed > &) override
 generate seed(s) for a track More...
 
 ~FastTSGFromIOHit () override
 destructor More...
 
- Public Member Functions inherited from TrackerSeedGenerator
const edm::EventgetEvent () const
 
virtual void init (const MuonServiceProxy *service)
 
virtual void setEvent (const edm::Event &)
 
 TrackerSeedGenerator ()
 
virtual void trackerSeeds (const TrackCand &, const TrackingRegion &, const TrackerTopology *, BTSeedCollection &)
 
virtual ~TrackerSeedGenerator ()
 destructor More...
 

Private Member Functions

bool clean (reco::TrackRef muRef, const RectangularEtaPhiTrackingRegion &region, const BasicTrajectorySeed *aSeed, const SimTrack &theSimTrack)
 

Private Attributes

std::vector< edm::EDGetTokenT< TrajectorySeedCollection > > seedsTks
 
edm::EDGetTokenT< edm::SimTrackContainersimTracksTk
 
std::string theCategory
 
double thePtCut
 

Additional Inherited Members

- Public Types inherited from TrackerSeedGenerator
typedef std::vector< TrajectorySeedBTSeedCollection
 
typedef std::pair< const Trajectory *, reco::TrackRefTrackCand
 
- Protected Attributes inherited from TrackerSeedGenerator
const edm::EventtheEvent
 
const MuonServiceProxytheProxyService
 

Detailed Description

Emulate TSGFromIOHit in RecoMuon

Author
Adam Everett - Purdue University

Tracker Seed Generator by propagating and updating a standAlone muon to the first pixel hits in tracker system

Emulate TSGFromIOHit in RecoMuon

Author
Adam Everett - Purdue University

Definition at line 25 of file FastTSGFromIOHit.h.

Constructor & Destructor Documentation

◆ FastTSGFromIOHit()

FastTSGFromIOHit::FastTSGFromIOHit ( const edm::ParameterSet pset,
edm::ConsumesCollector iC 
)

constructor

Definition at line 18 of file FastTSGFromIOHit.cc.

18  {
19  theCategory = "FastSimulation|Muons||FastTSGFromIOHit";
20 
21  thePtCut = iConfig.getParameter<double>("PtCut");
22 
23  simTracksTk = iC.consumes<edm::SimTrackContainer>(iConfig.getParameter<edm::InputTag>("SimTrackCollectionLabel"));
24  const auto& seedLabels = iConfig.getParameter<std::vector<edm::InputTag> >("SeedCollectionLabels");
25  for (const auto& seedLabel : seedLabels) {
26  seedsTks.push_back(iC.consumes<TrajectorySeedCollection>(seedLabel));
27  }
28 }

References edm::ConsumesCollector::consumes(), edm::ParameterSet::getParameter(), seedsTks, simTracksTk, theCategory, and thePtCut.

◆ ~FastTSGFromIOHit()

FastTSGFromIOHit::~FastTSGFromIOHit ( )
override

destructor

Definition at line 30 of file FastTSGFromIOHit.cc.

30 { LogTrace(theCategory) << " FastTSGFromIOHit dtor called "; }

References LogTrace, and theCategory.

Member Function Documentation

◆ clean()

bool FastTSGFromIOHit::clean ( reco::TrackRef  muRef,
const RectangularEtaPhiTrackingRegion region,
const BasicTrajectorySeed aSeed,
const SimTrack theSimTrack 
)
private

Definition at line 85 of file FastTSGFromIOHit.cc.

88  {
89  // Eta cleaner
90  const PixelRecoRange<float>& etaRange = region.etaRange();
91 
92  double etaSeed = theSimTrack.momentum().Eta();
93  double etaLimit = (fabs(fabs(etaRange.max()) - fabs(etaRange.mean())) < 0.05)
94  ? 0.05
95  : fabs(fabs(etaRange.max()) - fabs(etaRange.mean()));
96  bool inEtaRange = etaSeed >= (etaRange.mean() - etaLimit) && etaSeed <= (etaRange.mean() + etaLimit);
97  if (!inEtaRange) {
98  return false;
99  }
100 
101  // Phi cleaner
102  const TkTrackingRegionsMargin<float>& phiMargin = region.phiMargin();
103  double phiSeed = theSimTrack.momentum().Phi();
104  double phiLimit = (phiMargin.right() < 0.05) ? 0.05 : phiMargin.right();
105  bool inPhiRange = (fabs(deltaPhi(phiSeed, double(region.direction().phi()))) < phiLimit);
106  if (!inPhiRange) {
107  return false;
108  }
109 
110  // pt cleaner
111  double ptSeed = std::sqrt(theSimTrack.momentum().Perp2());
112  double ptMin = (region.ptMin() > 3.5) ? 3.5 : region.ptMin();
113  bool inPtRange = ptSeed >= ptMin && ptSeed <= 2 * (muRef->pt());
114  if (!inPtRange) {
115  return false;
116  }
117  return true;
118 }

References SiPixelRawToDigiRegional_cfi::deltaPhi, generateTowerEtThresholdLUT::etaRange, CoreSimTrack::momentum(), ptMin, HLT_2018_cff::region, TkTrackingRegionsMargin< T >::right(), and mathSSE::sqrt().

Referenced by trackerSeeds().

◆ trackerSeeds()

void FastTSGFromIOHit::trackerSeeds ( const TrackCand staMuon,
const TrackingRegion region,
const TrackerTopology tTopo,
std::vector< TrajectorySeed > &  result 
)
override

generate seed(s) for a track

Definition at line 32 of file FastTSGFromIOHit.cc.

35  {
36  // Make a ref to l2 muon
37  reco::TrackRef muRef(staMuon.second);
38 
39  // Cut on muons with low momenta
40  if (muRef->pt() < thePtCut || muRef->innerMomentum().Rho() < thePtCut || muRef->innerMomentum().R() < 2.5) {
41  return;
42  }
43 
44  // Retrieve the Monte Carlo truth (SimTracks)
47 
48  // Retrieve Seed collection
49  std::vector<edm::Handle<TrajectorySeedCollection> > seedCollections;
50  seedCollections.resize(seedsTks.size());
51  for (unsigned iSeed = 0; iSeed < seedsTks.size(); iSeed++) {
52  getEvent()->getByToken(seedsTks[iSeed], seedCollections[iSeed]);
53  }
54 
55  // cast the tracking region
56  const RectangularEtaPhiTrackingRegion& regionRef = dynamic_cast<const RectangularEtaPhiTrackingRegion&>(region);
57 
58  // select and store seeds
59  std::set<unsigned> simTrackIds;
60  for (const auto& seeds : seedCollections) {
61  for (const auto& seed : *seeds) {
62  // Find the simtrack corresponding to the seed
63  TrajectorySeed::range recHitRange = seed.recHits();
64  const FastTrackerRecHit* firstRecHit = (const FastTrackerRecHit*)(&(*(recHitRange.first)));
65  int simTrackId = firstRecHit->simTrackId(0);
66  const SimTrack& simTrack = (*simTracks)[simTrackId];
67 
68  // skip if simTrack already associated to a seed
69  if (simTrackIds.find(simTrackId) != simTrackIds.end()) {
70  continue;
71  }
72  simTrackIds.insert(simTrackId);
73 
74  // filter seed
75  if (!clean(muRef, regionRef, &seed, simTrack)) {
76  continue;
77  }
78 
79  // store results
80  result.push_back(L3MuonTrajectorySeed(seed, muRef));
81  }
82  }
83 }

References clean(), edm::Event::getByToken(), TrackerSeedGenerator::getEvent(), HLT_2018_cff::region, mps_fire::result, SurveyInfoScenario_cff::seed, seedmultiplicitymonitor_cfi::seedCollections, InitialStep_cff::seeds, seedsTks, muonSimHitMatcherPSet::simTrack, FastTrackerRecHit::simTrackId(), TrackCandidateProducer_cfi::simTracks, simTracksTk, and thePtCut.

Member Data Documentation

◆ seedsTks

std::vector<edm::EDGetTokenT<TrajectorySeedCollection> > FastTSGFromIOHit::seedsTks
private

Definition at line 49 of file FastTSGFromIOHit.h.

Referenced by FastTSGFromIOHit(), and trackerSeeds().

◆ simTracksTk

edm::EDGetTokenT<edm::SimTrackContainer> FastTSGFromIOHit::simTracksTk
private

Definition at line 48 of file FastTSGFromIOHit.h.

Referenced by FastTSGFromIOHit(), and trackerSeeds().

◆ theCategory

std::string FastTSGFromIOHit::theCategory
private

Definition at line 46 of file FastTSGFromIOHit.h.

Referenced by FastTSGFromIOHit(), and ~FastTSGFromIOHit().

◆ thePtCut

double FastTSGFromIOHit::thePtCut
private

Definition at line 50 of file FastTSGFromIOHit.h.

Referenced by FastTSGFromIOHit(), and trackerSeeds().

CoreSimTrack::momentum
const math::XYZTLorentzVectorD & momentum() const
Definition: CoreSimTrack.h:19
RectangularEtaPhiTrackingRegion
Definition: RectangularEtaPhiTrackingRegion.h:25
TrajectorySeedCollection
std::vector< TrajectorySeed > TrajectorySeedCollection
Definition: TrajectorySeedCollection.h:6
generateTowerEtThresholdLUT.etaRange
etaRange
Definition: generateTowerEtThresholdLUT.py:55
TrajectorySeed::range
std::pair< const_iterator, const_iterator > range
Definition: TrajectorySeed.h:21
ptMin
constexpr float ptMin
Definition: PhotonIDValueMapProducer.cc:153
TrackCandidateProducer_cfi.simTracks
simTracks
Definition: TrackCandidateProducer_cfi.py:15
FastTrackerRecHit
Definition: FastTrackerRecHit.h:40
FastTSGFromIOHit::theCategory
std::string theCategory
Definition: FastTSGFromIOHit.h:46
edm::Handle< edm::SimTrackContainer >
FastTSGFromIOHit::simTracksTk
edm::EDGetTokenT< edm::SimTrackContainer > simTracksTk
Definition: FastTSGFromIOHit.h:48
edm::Ref< TrackCollection >
seedmultiplicitymonitor_cfi.seedCollections
seedCollections
Definition: seedmultiplicitymonitor_cfi.py:5
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
FastTrackerRecHit::simTrackId
virtual int32_t simTrackId(size_t i) const
Definition: FastTrackerRecHit.h:99
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
FastTSGFromIOHit::thePtCut
double thePtCut
Definition: FastTSGFromIOHit.h:50
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
TrackerSeedGenerator::getEvent
const edm::Event * getEvent() const
Definition: TrackerSeedGenerator.h:41
FastTSGFromIOHit::clean
bool clean(reco::TrackRef muRef, const RectangularEtaPhiTrackingRegion &region, const BasicTrajectorySeed *aSeed, const SimTrack &theSimTrack)
Definition: FastTSGFromIOHit.cc:85
InitialStep_cff.seeds
seeds
Definition: InitialStep_cff.py:232
PixelRecoRange< float >
muonSimHitMatcherPSet.simTrack
simTrack
Definition: muonSimHitMatcherPSet.py:4
FastTSGFromIOHit::seedsTks
std::vector< edm::EDGetTokenT< TrajectorySeedCollection > > seedsTks
Definition: FastTSGFromIOHit.h:49
TkTrackingRegionsMargin< float >
TkTrackingRegionsMargin::right
const T & right() const
Definition: TkTrackingRegionsMargin.h:19
edm::SimTrackContainer
std::vector< SimTrack > SimTrackContainer
Definition: SimTrackContainer.h:12
SimTrack
Definition: SimTrack.h:6
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
mps_fire.result
result
Definition: mps_fire.py:303
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
L3MuonTrajectorySeed
Definition: L3MuonTrajectorySeed.h:16
edm::InputTag
Definition: InputTag.h:15
SurveyInfoScenario_cff.seed
seed
Definition: SurveyInfoScenario_cff.py:295