CMS 3D CMS Logo

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

#include <TrackerSeedCleaner.h>

Public Types

typedef std::vector< TrajectorySeedtkSeeds
 

Public Member Functions

virtual void clean (const reco::TrackRef &, const RectangularEtaPhiTrackingRegion &region, tkSeeds &)
 the cleaner More...
 
virtual void init (const MuonServiceProxy *service)
 intizialization More...
 
virtual void setEvent (const edm::Event &)
 setEvent More...
 
 TrackerSeedCleaner (const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
 constructor More...
 
virtual ~TrackerSeedCleaner ()
 destructor More...
 

Private Attributes

edm::EDGetTokenT< reco::BeamSpotbeamspotToken_
 
edm::Handle< reco::BeamSpotbsHandle_
 
std::string builderName_
 
bool cleanBySharedHits
 
edm::InputTag theBeamSpotTag
 
const edm::EventtheEvent
 
const MuonServiceProxytheProxyService
 
RedundantSeedCleanertheRedundantCleaner
 
edm::ESHandle< TransientTrackingRecHitBuildertheTTRHBuilder
 
bool useDirection_Cleaner
 
bool usePt_Cleaner
 

Detailed Description

Seeds Cleaner based on direction

Author
A. Grelli - Purdue University, Pavia University

Definition at line 38 of file TrackerSeedCleaner.h.

Member Typedef Documentation

◆ tkSeeds

Definition at line 40 of file TrackerSeedCleaner.h.

Constructor & Destructor Documentation

◆ TrackerSeedCleaner()

TrackerSeedCleaner::TrackerSeedCleaner ( const edm::ParameterSet pset,
edm::ConsumesCollector iC 
)
inline

constructor

Definition at line 42 of file TrackerSeedCleaner.h.

43  : theProxyService(nullptr), theEvent(nullptr) {
44  builderName_ = pset.getParameter<std::string>("TTRHBuilder");
45  theBeamSpotTag = pset.getParameter<edm::InputTag>("beamSpot");
46  useDirection_Cleaner = pset.getParameter<bool>("directionCleaner");
47  usePt_Cleaner = pset.getParameter<bool>("ptCleaner");
48  cleanBySharedHits = pset.getParameter<bool>("cleanerFromSharedHits");
50  }

References beamspotToken_, builderName_, cleanBySharedHits, edm::ConsumesCollector::consumes(), muonDTDigis_cfi::pset, AlCaHLTBitMon_QueryRunRegistry::string, theBeamSpotTag, useDirection_Cleaner, and usePt_Cleaner.

◆ ~TrackerSeedCleaner()

virtual TrackerSeedCleaner::~TrackerSeedCleaner ( )
inlinevirtual

destructor

Definition at line 56 of file TrackerSeedCleaner.h.

56 {}

Member Function Documentation

◆ clean()

void TrackerSeedCleaner::clean ( const reco::TrackRef muR,
const RectangularEtaPhiTrackingRegion region,
tkSeeds seeds 
)
virtual

the cleaner

Definition at line 57 of file TrackerSeedCleaner.cc.

59  {
60  // call the shared input cleaner
63 
65 
66  LogDebug("TrackerSeedCleaner") << seeds.size() << " trajectory seeds to the events before cleaning" << endl;
67 
68  //check the validity otherwise vertexing
69  const reco::BeamSpot& bs = *bsHandle_;
70  /*reco track and seeds as arguments. Seeds eta and phi are checked and
71  based on deviation from L2 eta and phi seed is accepted or not*/
72 
73  std::vector<TrajectorySeed> result;
74 
75  TSCBLBuilderNoMaterial tscblBuilder;
76  // PerigeeConversions tspConverter;
77  for (TrajectorySeedCollection::iterator seed = seeds.begin(); seed < seeds.end(); ++seed) {
78  if (seed->nHits() < 2)
79  continue;
80  //get parameters and errors from the seed state
83  seed->startingState(), recHit->surface(), theProxyService->magneticField().product());
84 
85  TrajectoryStateClosestToBeamLine tsAtClosestApproachSeed =
86  tscblBuilder(*state.freeState(), bs); //as in TrackProducerAlgorithms
87  if (!tsAtClosestApproachSeed.isValid())
88  continue;
89  GlobalPoint vSeed1 = tsAtClosestApproachSeed.trackStateAtPCA().position();
90  GlobalVector pSeed = tsAtClosestApproachSeed.trackStateAtPCA().momentum();
91  GlobalPoint vSeed(vSeed1.x() - bs.x0(), vSeed1.y() - bs.y0(), vSeed1.z() - bs.z0());
92 
93  //eta,phi info from seeds
94  double etaSeed = state.globalMomentum().eta();
95  double phiSeed = pSeed.phi();
96 
97  //if the limits are too stringent rescale limits
99  typedef TkTrackingRegionsMargin<float> Margin;
100 
101  Range etaRange = region.etaRange();
102  double etaLimit = (fabs(fabs(etaRange.max()) - fabs(etaRange.mean())) < 0.1)
103  ? 0.1
104  : fabs(fabs(etaRange.max()) - fabs(etaRange.mean()));
105 
106  Margin phiMargin = region.phiMargin();
107  double phiLimit = (phiMargin.right() < 0.1) ? 0.1 : phiMargin.right();
108 
109  double ptSeed = pSeed.perp();
110  double ptMin = (region.ptMin() > 3.5) ? 3.5 : region.ptMin();
111  // Clean
112  bool inEtaRange = etaSeed >= (etaRange.mean() - etaLimit) && etaSeed <= (etaRange.mean() + etaLimit);
113  bool inPhiRange = (fabs(deltaPhi(phiSeed, double(region.direction().phi()))) < phiLimit);
114  // pt cleaner
115  bool inPtRange = ptSeed >= ptMin && ptSeed <= 2 * (muR->pt());
116 
117  // save efficiency don't clean triplets with pt cleaner
118  if (seed->nHits() == 3)
119  inPtRange = true;
120 
121  // use pt and angle cleaners
122  if (inPtRange && usePt_Cleaner && !useDirection_Cleaner) {
123  result.push_back(*seed);
124  LogDebug("TrackerSeedCleaner") << " Keeping the seed : this seed passed pt selection";
125  }
126 
127  // use only angle default option
128  if (inEtaRange && inPhiRange && !usePt_Cleaner && useDirection_Cleaner) {
129  result.push_back(*seed);
130  LogDebug("TrackerSeedCleaner") << " Keeping the seed : this seed passed direction selection";
131  }
132 
133  // use all the cleaners
134  if (inEtaRange && inPhiRange && inPtRange && usePt_Cleaner && useDirection_Cleaner) {
135  result.push_back(*seed);
136  LogDebug("TrackerSeedCleaner") << " Keeping the seed : this seed passed direction and pt selection";
137  }
138 
139  LogDebug("TrackerSeedCleaner") << " eta for current seed " << etaSeed << "\n"
140  << " phi for current seed " << phiSeed << "\n"
141  << " eta for L2 track " << muR->eta() << "\n"
142  << " phi for L2 track " << muR->phi() << "\n";
143  }
144 
145  //the new seeds collection
146  if (!result.empty() && (useDirection_Cleaner || usePt_Cleaner))
147  seeds.swap(result);
148 
149  LogDebug("TrackerSeedCleaner") << seeds.size() << " trajectory seeds to the events after cleaning" << endl;
150 
151  return;
152 }

References cms::cuda::bs, SiPixelRawToDigiRegional_cfi::deltaPhi, generateTowerEtThresholdLUT::etaRange, get, LogDebug, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), ptMin, rpcPointValidation_cfi::recHit, HLT_FULL_cff::region, mps_fire::result, fileCollector::seed, InitialStep_cff::seeds, trajectoryStateTransform::transientState(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ init()

void TrackerSeedCleaner::init ( const MuonServiceProxy service)
virtual

intizialization

Definition at line 43 of file TrackerSeedCleaner.cc.

43  {
45 
47 }

References HLT_FULL_cff::RedundantSeedCleaner.

◆ setEvent()

void TrackerSeedCleaner::setEvent ( const edm::Event event)
virtual

setEvent

Definition at line 52 of file TrackerSeedCleaner.cc.

52 { event.getByToken(beamspotToken_, bsHandle_); }

Member Data Documentation

◆ beamspotToken_

edm::EDGetTokenT<reco::BeamSpot> TrackerSeedCleaner::beamspotToken_
private

Definition at line 68 of file TrackerSeedCleaner.h.

Referenced by TrackerSeedCleaner().

◆ bsHandle_

edm::Handle<reco::BeamSpot> TrackerSeedCleaner::bsHandle_
private

Definition at line 67 of file TrackerSeedCleaner.h.

◆ builderName_

std::string TrackerSeedCleaner::builderName_
private

Definition at line 71 of file TrackerSeedCleaner.h.

Referenced by TrackerSeedCleaner().

◆ cleanBySharedHits

bool TrackerSeedCleaner::cleanBySharedHits
private

Definition at line 73 of file TrackerSeedCleaner.h.

Referenced by TrackerSeedCleaner().

◆ theBeamSpotTag

edm::InputTag TrackerSeedCleaner::theBeamSpotTag
private

Definition at line 66 of file TrackerSeedCleaner.h.

Referenced by TrackerSeedCleaner().

◆ theEvent

const edm::Event* TrackerSeedCleaner::theEvent
private

Definition at line 64 of file TrackerSeedCleaner.h.

◆ theProxyService

const MuonServiceProxy* TrackerSeedCleaner::theProxyService
private

Definition at line 63 of file TrackerSeedCleaner.h.

◆ theRedundantCleaner

RedundantSeedCleaner* TrackerSeedCleaner::theRedundantCleaner
private

Definition at line 69 of file TrackerSeedCleaner.h.

◆ theTTRHBuilder

edm::ESHandle<TransientTrackingRecHitBuilder> TrackerSeedCleaner::theTTRHBuilder
private

Definition at line 72 of file TrackerSeedCleaner.h.

◆ useDirection_Cleaner

bool TrackerSeedCleaner::useDirection_Cleaner
private

Definition at line 73 of file TrackerSeedCleaner.h.

Referenced by TrackerSeedCleaner().

◆ usePt_Cleaner

bool TrackerSeedCleaner::usePt_Cleaner
private

Definition at line 73 of file TrackerSeedCleaner.h.

Referenced by TrackerSeedCleaner().

Vector3DBase
Definition: Vector3DBase.h:8
TrajectoryStateClosestToBeamLine
Definition: TrajectoryStateClosestToBeamLine.h:15
service
Definition: service.py:1
generateTowerEtThresholdLUT.etaRange
etaRange
Definition: generateTowerEtThresholdLUT.py:55
Range
PixelRecoRange< float > Range
Definition: PixelTripletHLTGenerator.cc:31
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
TrackerSeedCleaner::useDirection_Cleaner
bool useDirection_Cleaner
Definition: TrackerSeedCleaner.h:73
TransientRecHitRecord
Definition: TransientRecHitRecord.h:14
ptMin
constexpr float ptMin
Definition: PhotonIDValueMapProducer.cc:155
HLT_FULL_cff.RedundantSeedCleaner
RedundantSeedCleaner
Definition: HLT_FULL_cff.py:9566
TrackerSeedCleaner::theTTRHBuilder
edm::ESHandle< TransientTrackingRecHitBuilder > theTTRHBuilder
Definition: TrackerSeedCleaner.h:72
TrackingRecHit::RecHitPointer
std::shared_ptr< TrackingRecHit const > RecHitPointer
Definition: TrackingRecHit.h:24
TransientTrackingRecHitBuilder::build
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
fileCollector.seed
seed
Definition: fileCollector.py:127
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
RedundantSeedCleaner::define
void define(std::vector< TrajectorySeed > &)
collection definition
Definition: RedundantSeedCleaner.cc:29
edm::Range
Definition: Range.h:11
cms::cuda::bs
bs
Definition: HistoContainer.h:127
TrackerSeedCleaner::beamspotToken_
edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
Definition: TrackerSeedCleaner.h:68
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
TrackerSeedCleaner::usePt_Cleaner
bool usePt_Cleaner
Definition: TrackerSeedCleaner.h:73
reco::BeamSpot
Definition: BeamSpot.h:21
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
Point3DBase< float, GlobalTag >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
InitialStep_cff.seeds
seeds
Definition: InitialStep_cff.py:231
PixelRecoRange< float >
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
TrackerSeedCleaner::theEvent
const edm::Event * theEvent
Definition: TrackerSeedCleaner.h:64
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88271
trajectoryStateTransform::transientState
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
Definition: TrajectoryStateTransform.cc:35
TkTrackingRegionsMargin< float >
get
#define get
TrackerSeedCleaner::theRedundantCleaner
RedundantSeedCleaner * theRedundantCleaner
Definition: TrackerSeedCleaner.h:69
RunInfoPI::state
state
Definition: RunInfoPayloadInspectoHelper.h:16
TSCBLBuilderNoMaterial
Definition: TSCBLBuilderNoMaterial.h:13
TrackerSeedCleaner::cleanBySharedHits
bool cleanBySharedHits
Definition: TrackerSeedCleaner.h:73
mps_fire.result
result
Definition: mps_fire.py:311
TrackerSeedCleaner::builderName_
std::string builderName_
Definition: TrackerSeedCleaner.h:71
TrackerSeedCleaner::bsHandle_
edm::Handle< reco::BeamSpot > bsHandle_
Definition: TrackerSeedCleaner.h:67
TrackerSeedCleaner::theProxyService
const MuonServiceProxy * theProxyService
Definition: TrackerSeedCleaner.h:63
TrackerSeedCleaner::theBeamSpotTag
edm::InputTag theBeamSpotTag
Definition: TrackerSeedCleaner.h:66
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
edm::InputTag
Definition: InputTag.h:15
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27