|
![CMS Logo](/cmsdoxygen/common/rightImage.jpg) |
Go to the documentation of this file.
6 #define TRACK_SORT 1 // just use all hits from inner track, then append from outer outside it
7 #define DET_SORT 0 // sort hits using global position of detector
8 #define HIT_SORT 0 // sort hits using global position of hit
15 #define DPRINT(x) std::cout << x << ": "
16 #define PRINT std::cout
18 #define DPRINT(x) LogTrace(x)
19 #define PRINT LogTrace("")
23 : useInnermostState_(iConfig.getParameter<
bool>(
"useInnermostState")),
24 theBuilderName(iConfig.getParameter<
std::
string>(
"ttrhBuilderName")),
44 <<
inner.eta() <<
'/' <<
outer.eta() << std::endl;
46 std::vector<const TrackingRecHit *>
hits;
48 DPRINT(
"TrackMerger") <<
"Inner track hits: " << std::endl;
49 for (
auto it =
inner.recHitsBegin(), ed =
inner.recHitsEnd(); it != ed; ++it) {
50 hits.push_back(&**it);
54 <<
hits.back()->isValid() <<
" detid: " <<
id() << std::endl;
57 DPRINT(
"TrackMerger") <<
"Outer track hits: " << std::endl;
61 DetId lastId(
hits.back()->geographicalId());
64 for (
auto it =
outer.recHitsBegin(), ed =
outer.recHitsEnd(); it != ed; ++it) {
67 int thisSubdet =
id.subdetId();
68 if (thisSubdet > lastSubdet || (thisSubdet == lastSubdet &&
theTrkTopo->
layer(
id) > lastLayer)) {
71 <<
hit->isValid() <<
" detid: " <<
id() << std::endl;
74 <<
hit->isValid() <<
" detid: " <<
id() << std::endl;
115 if ((
inner.outerPosition() -
inner.innerPosition()).Dot(
inner.momentum()) >= 0) {
128 if ((
outer.outerPosition() -
inner.innerPosition()).Dot(
inner.momentum()) >= 0) {
147 size_t nHitsFirstTrack =
hits.size();
148 for (
auto it =
outer.recHitsBegin(), ed =
outer.recHitsEnd(); it != ed; ++it) {
155 <<
" detid: " <<
id() << std::endl;
157 for (
auto hit2 :
hits) {
159 if (iHit > nHitsFirstTrack)
162 if (
id.subdetId() !=
id2.subdetId())
167 PRINT <<
" discared as duplicate of other hit" <<
id() << std::endl;
171 if (hit2->isValid() && !
valid) {
172 PRINT <<
" replacing old invalid hit on detid " <<
id2() << std::endl;
177 PRINT <<
" discared as additional hit on layer that already contains hit with detid " <<
id() << std::endl;
188 const std::vector<const TrackingRecHit *> &
hits,
192 std::vector<TransientTrackingRecHit::RecHitPointer> ttrh(
nhits);
193 for (
unsigned int i = 0;
i <
nhits; ++
i)
196 for (
const auto &
hit : ttrh)
210 GlobalPoint p1 = hit1->isValid() ? hit1->globalPosition() : hit1->det()->position();
211 GlobalPoint p2 = hit2->isValid() ? hit2->globalPosition() : hit2->det()->position();
ret
prodAgent to be discontinued
const TrackerGeomDet * idToDet(DetId) const override
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopoToken_
bool operator()(const TransientTrackingRecHit::RecHitPointer &hit1, const TransientTrackingRecHit::RecHitPointer &hit2) const
edm::ESHandle< MagneticField > theMagField
void addSecondTrackHits(std::vector< const TrackingRecHit * > &hits, const reco::Track &outer) const
edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > builderToken_
unsigned int layer(const DetId &id) const
Point3DBase< Scalar, LocalTag > LocalPoint
std::shared_ptr< TrackingRecHit const > RecHitPointer
const TrackerGeometry * geom_
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
DetId geographicalId() const
void init(const edm::EventSetup &iSetup)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
void sortByHitPosition(const GlobalVector &v, const std::vector< const TrackingRecHit * > &hits, TrackCandidate::RecHitContainer &ownHits) const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geometryToken_
TrackCandidate merge(const reco::Track &inner, const reco::Track &outer, DuplicateTrackType duplicateType) const
edm::ESHandle< TransientTrackingRecHitBuilder > theBuilder
edm::ESHandle< TrackerGeometry > theGeometry
bool operator()(const TrackingRecHit *hit1, const TrackingRecHit *hit2) const
TrackMerger(const edm::ParameterSet &iConfig, edm::ConsumesCollector)
edm::ESHandle< TrackerTopology > theTrkTopo
Abs< T >::type abs(const T &t)