CMS 3D CMS Logo

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

#include <TrackTransformerForGlobalCosmicMuons.h>

Inheritance diagram for TrackTransformerForGlobalCosmicMuons:
TrackTransformerBase

Public Member Functions

edm::ESHandle< TrajectoryFitterfitter (bool) const
 the refitter used to refit the reco::Track More...
 
TransientTrackingRecHit::ConstRecHitContainer getTransientRecHits (const reco::TransientTrack &track) const
 
const MagneticFieldmagneticField () const
 the magnetic field More...
 
bool MuonKeep (DetId id) const
 check (via options) if this is a muon rec hit for removal More...
 
void setServices (const edm::EventSetup &) override
 set the services needed by the TrackTransformer More...
 
edm::ESHandle< TrajectorySmoothersmoother (bool) const
 the smoother used to smooth the trajectory which came from the refitting step More...
 
bool TrackerKeep (DetId id) const
 check (via options) if this is a tracker rec hit for removal More...
 
edm::ESHandle< GlobalTrackingGeometrytrackingGeometry () const
 the tracking geometry More...
 
 TrackTransformerForGlobalCosmicMuons (const edm::ParameterSet &, edm::ConsumesCollector)
 Constructor. More...
 
std::vector< Trajectorytransform (const reco::Track &) const override
 Convert a reco::Track into Trajectory. More...
 
 ~TrackTransformerForGlobalCosmicMuons () override
 Destructor. More...
 
- Public Member Functions inherited from TrackTransformerBase
 TrackTransformerBase ()
 Constructor. More...
 
virtual ~TrackTransformerBase ()
 Destructor. More...
 

Private Member Functions

edm::ESHandle< Propagatorpropagator (bool) const
 

Private Attributes

unsigned long long theCacheId_GTG
 
unsigned long long theCacheId_MG
 
unsigned long long theCacheId_TC
 
unsigned long long theCacheId_TRH
 
edm::ESHandle< TrajectoryFittertheFitterIO
 
edm::ESHandle< TrajectoryFittertheFitterOI
 
const edm::ESGetToken< TrajectoryFitter, TrajectoryFitter::RecordtheIOFitterToken
 
const edm::ESGetToken< Propagator, TrackingComponentsRecordtheIOpropToken
 
const edm::ESGetToken< TrajectorySmoother, TrajectoryFitter::RecordtheIOSmootherToken
 
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecordtheMFToken
 
edm::ESHandle< MagneticFieldtheMGField
 
edm::ESHandle< TransientTrackingRecHitBuildertheMuonRecHitBuilder
 
std::string theMuonRecHitBuilderName
 
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecordtheMuonRecHitBuildToken
 
const edm::ESGetToken< TrajectoryFitter, TrajectoryFitter::RecordtheOIFitterToken
 
const edm::ESGetToken< Propagator, TrackingComponentsRecordtheOIpropToken
 
const edm::ESGetToken< TrajectorySmoother, TrajectoryFitter::RecordtheOISmootherToken
 
edm::ESHandle< PropagatorthePropagatorIO
 
edm::ESHandle< PropagatorthePropagatorOI
 
bool theRPCInTheFit
 
int theSkipStationCSC
 
int theSkipStationDT
 
int theSkipWheelDT
 
edm::ESHandle< TrajectorySmoothertheSmootherIO
 
edm::ESHandle< TrajectorySmoothertheSmootherOI
 
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecordtheTkRecHitBuildToken
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtheTopologyToken
 
edm::ESHandle< TransientTrackingRecHitBuildertheTrackerRecHitBuilder
 
std::string theTrackerRecHitBuilderName
 
int theTrackerSkipSection
 
int theTrackerSkipSystem
 
edm::ESHandle< GlobalTrackingGeometrytheTrackingGeometry
 
const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecordthGlobTrackGeoToken
 
const TrackerTopologytTopo_
 

Detailed Description

Definition at line 45 of file TrackTransformerForGlobalCosmicMuons.h.

Constructor & Destructor Documentation

◆ TrackTransformerForGlobalCosmicMuons()

TrackTransformerForGlobalCosmicMuons::TrackTransformerForGlobalCosmicMuons ( const edm::ParameterSet parameterSet,
edm::ConsumesCollector  iC 
)

Constructor.

Definition at line 26 of file TrackTransformerForGlobalCosmicMuons.cc.

References edm::ParameterSet::getParameter(), edm::parameterSet(), theCacheId_GTG, theCacheId_MG, theCacheId_TC, theCacheId_TRH, theRPCInTheFit, theSkipStationCSC, theSkipStationDT, theSkipWheelDT, theTrackerSkipSection, and theTrackerSkipSystem.

28  : theIOpropToken(iC.esConsumes(edm::ESInputTag("", "SmartPropagatorRK"))),
29  theOIpropToken(iC.esConsumes(edm::ESInputTag("", "SmartPropagatorRKOpposite"))),
31  theMFToken(iC.esConsumes()),
32  theIOFitterToken(iC.esConsumes(edm::ESInputTag("", "KFFitterForRefitInsideOut"))),
33  theOIFitterToken(iC.esConsumes(edm::ESInputTag("", "KFSmootherForRefitInsideOut"))),
34  theIOSmootherToken(iC.esConsumes(edm::ESInputTag("", "KFFitterForRefitOutsideIn"))),
35  theOISmootherToken(iC.esConsumes(edm::ESInputTag("", "KFSmootherForRefitOutsideIn"))),
37  iC.esConsumes(edm::ESInputTag("", parameterSet.getParameter<string>("TrackerRecHitBuilder")))),
39  iC.esConsumes(edm::ESInputTag("", parameterSet.getParameter<string>("MuonRecHitBuilder")))),
41  theRPCInTheFit = parameterSet.getParameter<bool>("RefitRPCHits");
43  theSkipStationDT = parameterSet.getParameter<int>("SkipStationDT");
44  theSkipStationCSC = parameterSet.getParameter<int>("SkipStationCSC");
45  theSkipWheelDT = parameterSet.getParameter<int>("SkipWheelDT");
46  theTrackerSkipSystem = parameterSet.getParameter<int>("TrackerSkipSystem");
48  parameterSet.getParameter<int>("TrackerSkipSection"); //layer, wheel, or disk depending on the system
49 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theMFToken
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
const edm::ESGetToken< Propagator, TrackingComponentsRecord > theOIpropToken
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > theMuonRecHitBuildToken
const edm::ESGetToken< Propagator, TrackingComponentsRecord > theIOpropToken
const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > thGlobTrackGeoToken
const edm::ESGetToken< TrajectorySmoother, TrajectoryFitter::Record > theIOSmootherToken
const edm::ESGetToken< TrajectoryFitter, TrajectoryFitter::Record > theIOFitterToken
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > theTkRecHitBuildToken
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > theTopologyToken
const edm::ESGetToken< TrajectoryFitter, TrajectoryFitter::Record > theOIFitterToken
const edm::ESGetToken< TrajectorySmoother, TrajectoryFitter::Record > theOISmootherToken

◆ ~TrackTransformerForGlobalCosmicMuons()

TrackTransformerForGlobalCosmicMuons::~TrackTransformerForGlobalCosmicMuons ( )
override

Destructor.

Definition at line 52 of file TrackTransformerForGlobalCosmicMuons.cc.

52 {}

Member Function Documentation

◆ fitter()

ESHandle< TrajectoryFitter > TrackTransformerForGlobalCosmicMuons::fitter ( bool  up) const

the refitter used to refit the reco::Track

Definition at line 168 of file TrackTransformerForGlobalCosmicMuons.cc.

References theFitterIO, theFitterOI, and up.

Referenced by transform().

168  {
169  if (up)
170  return theFitterOI;
171  else
172  return theFitterIO;
173 }
Definition: BitonicSort.h:7

◆ getTransientRecHits()

TransientTrackingRecHit::ConstRecHitContainer TrackTransformerForGlobalCosmicMuons::getTransientRecHits ( const reco::TransientTrack track) const

Definition at line 100 of file TrackTransformerForGlobalCosmicMuons.cc.

References TransientTrackingRecHitBuilder::build(), filterCSVwithJSON::copy, MuonSubdetId::CSC, DetId::det(), MuonSubdetId::DT, GlobalTrackingGeometry::idToDet(), createfilelist::int, LogTrace, DetId::Muon, MuonKeep(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, GeomDet::position(), TrackerTopology::pxbLayer(), TrackerTopology::pxfDisk(), MuonSubdetId::RPC, DetId::subdetId(), StripSubdetector::TEC, TrackerTopology::tecWheel(), theMuonRecHitBuilder, theRPCInTheFit, theTrackerRecHitBuilder, StripSubdetector::TIB, TrackerTopology::tibLayer(), StripSubdetector::TID, TrackerTopology::tidWheel(), StripSubdetector::TOB, TrackerTopology::tobLayer(), HLT_2022v15_cff::track, DetId::Tracker, TrackerKeep(), trackingGeometry(), and tTopo_.

Referenced by transform().

101  {
104 
105  for (trackingRecHit_iterator hit = track.recHitsBegin(); hit != track.recHitsEnd(); ++hit) {
106  if ((*hit)->isValid()) {
107  if ((*hit)->geographicalId().det() == DetId::Tracker && TrackerKeep((*hit)->geographicalId())) {
108  tkHits.push_back(theTrackerRecHitBuilder->build(&**hit));
109  } else if ((*hit)->geographicalId().det() == DetId::Muon && MuonKeep((*hit)->geographicalId())) {
110  if ((*hit)->geographicalId().subdetId() == 3 && !theRPCInTheFit) {
111  LogTrace("Reco|TrackingTools|TrackTransformer") << "RPC Rec Hit discarged";
112  continue;
113  }
114  staHits.push_back(theMuonRecHitBuilder->build(&**hit));
115  }
116  }
117  }
118 
119  if (staHits.empty())
120  return staHits;
121 
122  /*
123  bool up = staHits.front()->globalPosition().y()>0 ? true : false;
124 
125  if(up){
126  reverse(staHits.begin(),staHits.end());
127  reverse(tkHits.begin(),tkHits.end());
128  }
129 */
130  copy(staHits.begin(), staHits.end(), back_inserter(tkHits));
131 
132  for (TransientTrackingRecHit::ConstRecHitContainer::const_iterator hit = tkHits.begin(); hit != tkHits.end(); ++hit) {
133  DetId hitId = (*hit)->geographicalId();
134  GlobalPoint glbpoint = trackingGeometry()->idToDet(hitId)->position();
135 
136  if (hitId.det() == DetId::Tracker) {
137  if (hitId.subdetId() == StripSubdetector::TIB)
138  LogTrace("TrackFitters") << glbpoint << " I am TIB " << tTopo_->tibLayer(hitId);
139  else if (hitId.subdetId() == StripSubdetector::TOB)
140  LogTrace("TrackFitters") << glbpoint << " I am TOB " << tTopo_->tobLayer(hitId);
141  else if (hitId.subdetId() == StripSubdetector::TEC)
142  LogTrace("TrackFitters") << glbpoint << " I am TEC " << tTopo_->tecWheel(hitId);
143  else if (hitId.subdetId() == StripSubdetector::TID)
144  LogTrace("TrackFitters") << glbpoint << " I am TID " << tTopo_->tidWheel(hitId);
145  else if (hitId.subdetId() == (int)PixelSubdetector::PixelBarrel)
146  LogTrace("TrackFitters") << glbpoint << " I am PixBar " << tTopo_->pxbLayer(hitId);
147  else if (hitId.subdetId() == (int)PixelSubdetector::PixelEndcap)
148  LogTrace("TrackFitters") << glbpoint << " I am PixFwd " << tTopo_->pxfDisk(hitId);
149  else
150  LogTrace("TrackFitters") << " UNKNOWN TRACKER HIT TYPE ";
151  } else if (hitId.det() == DetId::Muon) {
152  if (hitId.subdetId() == MuonSubdetId::DT)
153  LogTrace("TrackFitters") << glbpoint << " I am DT " << DTWireId(hitId);
154  else if (hitId.subdetId() == MuonSubdetId::CSC)
155  LogTrace("TrackFitters") << glbpoint << " I am CSC " << CSCDetId(hitId);
156  else if (hitId.subdetId() == MuonSubdetId::RPC)
157  LogTrace("TrackFitters") << glbpoint << " I am RPC " << RPCDetId(hitId);
158  else
159  LogTrace("TrackFitters") << " UNKNOWN MUON HIT TYPE ";
160  } else
161  LogTrace("TrackFitters") << " UNKNOWN HIT TYPE ";
162  }
163 
164  return tkHits;
165 }
static constexpr auto TEC
unsigned int tobLayer(const DetId &id) const
unsigned int pxbLayer(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
const GeomDet * idToDet(DetId) const override
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
#define LogTrace(id)
edm::ESHandle< TransientTrackingRecHitBuilder > theTrackerRecHitBuilder
bool MuonKeep(DetId id) const
check (via options) if this is a muon rec hit for removal
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
unsigned int pxfDisk(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static constexpr auto TOB
edm::ESHandle< TransientTrackingRecHitBuilder > theMuonRecHitBuilder
std::vector< ConstRecHitPointer > ConstRecHitContainer
edm::ESHandle< GlobalTrackingGeometry > trackingGeometry() const
the tracking geometry
Definition: DetId.h:17
static constexpr auto TIB
bool TrackerKeep(DetId id) const
check (via options) if this is a tracker rec hit for removal
static constexpr int RPC
Definition: MuonSubdetId.h:13
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
unsigned int tibLayer(const DetId &id) const
static constexpr int DT
Definition: MuonSubdetId.h:11
static constexpr int CSC
Definition: MuonSubdetId.h:12
static constexpr auto TID

◆ magneticField()

const MagneticField* TrackTransformerForGlobalCosmicMuons::magneticField ( ) const
inline

the magnetic field

Definition at line 59 of file TrackTransformerForGlobalCosmicMuons.h.

References theMGField.

Referenced by transform().

59 { return &*theMGField; }

◆ MuonKeep()

bool TrackTransformerForGlobalCosmicMuons::MuonKeep ( DetId  id) const

check (via options) if this is a muon rec hit for removal

Definition at line 265 of file TrackTransformerForGlobalCosmicMuons.cc.

References MuonSubdetId::CSC, MuonSubdetId::DT, GeomDetEnumerators::isCSC(), GeomDetEnumerators::isDT(), GeomDetEnumerators::isRPC(), DetId::Muon, MuonSubdetId::RPC, DTChamberId::station(), relativeConstraints::station, RPCDetId::station(), CSCDetId::station(), theSkipStationCSC, theSkipStationDT, theSkipWheelDT, DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by getTransientRecHits().

265  {
266  if (id.det() != DetId::Muon)
267  return false;
268  if (theSkipStationDT < 0 && theSkipStationCSC < 0)
269  return true;
270 
271  int station = -999;
272  int wheel = -999;
273  bool isRPC = false;
274  bool isDT = false;
275  bool isCSC = false;
276 
277  if (id.subdetId() == MuonSubdetId::DT) {
278  DTChamberId did(id.rawId());
279  station = did.station();
280  wheel = did.wheel();
281  isDT = true;
282  } else if (id.subdetId() == MuonSubdetId::CSC) {
283  CSCDetId did(id.rawId());
284  station = did.station();
285  isCSC = true;
286  } else if (id.subdetId() == MuonSubdetId::RPC) {
287  RPCDetId rpcid(id.rawId());
288  station = rpcid.station();
289  isRPC = true;
290  }
291 
293  return false;
294  if (isDT && station == theSkipStationDT)
295  return false;
296  if (isCSC && station == theSkipStationCSC)
297  return false;
298 
299  if (isDT && theSkipWheelDT > -998 && wheel == theSkipWheelDT)
300  return false;
301 
302  return true;
303 }
bool isDT(GeomDetEnumerators::SubDetector m)
bool isRPC(GeomDetEnumerators::SubDetector m)
static constexpr int RPC
Definition: MuonSubdetId.h:13
bool isCSC(GeomDetEnumerators::SubDetector m)
static constexpr int DT
Definition: MuonSubdetId.h:11
static constexpr int CSC
Definition: MuonSubdetId.h:12

◆ propagator()

ESHandle< Propagator > TrackTransformerForGlobalCosmicMuons::propagator ( bool  up) const
private

Definition at line 183 of file TrackTransformerForGlobalCosmicMuons.cc.

References thePropagatorIO, thePropagatorOI, and up.

Referenced by transform().

183  {
184  if (up)
185  return thePropagatorIO;
186  else
187  return thePropagatorOI;
188 }
Definition: BitonicSort.h:7

◆ setServices()

void TrackTransformerForGlobalCosmicMuons::setServices ( const edm::EventSetup setup)
overridevirtual

set the services needed by the TrackTransformer

Implements TrackTransformerBase.

Definition at line 54 of file TrackTransformerForGlobalCosmicMuons.cc.

References LogTrace, metname, singleTopDQM_cfi::setup, AlCaHLTBitMon_QueryRunRegistry::string, theCacheId_GTG, theCacheId_MG, theCacheId_TC, theCacheId_TRH, theFitterIO, theFitterOI, theIOFitterToken, theIOpropToken, theIOSmootherToken, theMFToken, theMGField, theMuonRecHitBuilder, theMuonRecHitBuildToken, theOIFitterToken, theOIpropToken, theOISmootherToken, thePropagatorIO, thePropagatorOI, theSmootherIO, theSmootherOI, theTkRecHitBuildToken, theTopologyToken, theTrackerRecHitBuilder, theTrackingGeometry, thGlobTrackGeoToken, and tTopo_.

54  {
55  const std::string metname = "Reco|TrackingTools|TrackTransformer";
56 
57  theFitterIO = setup.getHandle(theIOFitterToken);
58  theFitterOI = setup.getHandle(theOIFitterToken);
61 
62  unsigned long long newCacheId_TC = setup.get<TrackingComponentsRecord>().cacheIdentifier();
63 
64  if (newCacheId_TC != theCacheId_TC) {
65  LogTrace(metname) << "Tracking Component changed!";
66  theCacheId_TC = newCacheId_TC;
69  }
70 
71  // Global Tracking Geometry
72  unsigned long long newCacheId_GTG = setup.get<GlobalTrackingGeometryRecord>().cacheIdentifier();
73  if (newCacheId_GTG != theCacheId_GTG) {
74  LogTrace(metname) << "GlobalTrackingGeometry changed!";
75  theCacheId_GTG = newCacheId_GTG;
77  }
78 
79  // Magfield Field
80  unsigned long long newCacheId_MG = setup.get<IdealMagneticFieldRecord>().cacheIdentifier();
81  if (newCacheId_MG != theCacheId_MG) {
82  LogTrace(metname) << "Magnetic Field changed!";
83  theCacheId_MG = newCacheId_MG;
84  theMGField = setup.getHandle(theMFToken);
85  }
86 
87  // Transient Rechit Builders
88  unsigned long long newCacheId_TRH = setup.get<TransientRecHitRecord>().cacheIdentifier();
89  if (newCacheId_TRH != theCacheId_TRH) {
90  theCacheId_TRH = newCacheId_TRH;
91  LogTrace(metname) << "TransientRecHitRecord changed!";
94  }
95 
96  //Retrieve tracker topology from geometry
97  tTopo_ = &setup.getData(theTopologyToken);
98 }
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theMFToken
const std::string metname
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
const edm::ESGetToken< Propagator, TrackingComponentsRecord > theOIpropToken
#define LogTrace(id)
edm::ESHandle< TransientTrackingRecHitBuilder > theTrackerRecHitBuilder
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > theMuonRecHitBuildToken
const edm::ESGetToken< Propagator, TrackingComponentsRecord > theIOpropToken
edm::ESHandle< TransientTrackingRecHitBuilder > theMuonRecHitBuilder
const edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > thGlobTrackGeoToken
const edm::ESGetToken< TrajectorySmoother, TrajectoryFitter::Record > theIOSmootherToken
const edm::ESGetToken< TrajectoryFitter, TrajectoryFitter::Record > theIOFitterToken
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > theTkRecHitBuildToken
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > theTopologyToken
const edm::ESGetToken< TrajectoryFitter, TrajectoryFitter::Record > theOIFitterToken
const edm::ESGetToken< TrajectorySmoother, TrajectoryFitter::Record > theOISmootherToken

◆ smoother()

ESHandle< TrajectorySmoother > TrackTransformerForGlobalCosmicMuons::smoother ( bool  up) const

the smoother used to smooth the trajectory which came from the refitting step

Definition at line 176 of file TrackTransformerForGlobalCosmicMuons.cc.

References theSmootherIO, theSmootherOI, and up.

Referenced by transform().

176  {
177  if (up)
178  return theSmootherOI;
179  else
180  return theSmootherIO;
181 }
Definition: BitonicSort.h:7

◆ TrackerKeep()

bool TrackTransformerForGlobalCosmicMuons::TrackerKeep ( DetId  id) const

check (via options) if this is a tracker rec hit for removal

Definition at line 245 of file TrackTransformerForGlobalCosmicMuons.cc.

References phase1PixelTopology::layer, TrackerTopology::layer(), theTrackerSkipSection, theTrackerSkipSystem, DetId::Tracker, and tTopo_.

Referenced by getTransientRecHits().

245  {
246  if (id.det() != DetId::Tracker)
247  return false;
248  if (theTrackerSkipSystem < 0)
249  return true;
250  bool retVal = true;
251 
252  int layer = -999;
253 
254  if (id.subdetId() == theTrackerSkipSystem)
255  layer = tTopo_->layer(id);
256 
258  retVal = false;
259 
260  return retVal;
261 }
unsigned int layer(const DetId &id) const
constexpr std::array< uint8_t, layerIndexSize > layer

◆ trackingGeometry()

edm::ESHandle<GlobalTrackingGeometry> TrackTransformerForGlobalCosmicMuons::trackingGeometry ( ) const
inline

the tracking geometry

Definition at line 62 of file TrackTransformerForGlobalCosmicMuons.h.

References theTrackingGeometry.

Referenced by getTransientRecHits(), and transform().

62 { return theTrackingGeometry; }
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry

◆ transform()

vector< Trajectory > TrackTransformerForGlobalCosmicMuons::transform ( const reco::Track tr) const
overridevirtual

Convert a reco::Track into Trajectory.

Convert Tracks into Trajectories.

Implements TrackTransformerBase.

Definition at line 191 of file TrackTransformerForGlobalCosmicMuons.cc.

References alongMomentum, TrajectoryFitter::fit(), fitter(), getTransientRecHits(), LogTrace, magneticField(), metname, oppositeToMomentum, Propagator::propagate(), propagator(), fileCollector::seed, smoother(), AlCaHLTBitMon_QueryRunRegistry::string, HLT_2022v15_cff::track, trackingGeometry(), FastTrackerRecHitMaskProducer_cfi::trajectories, TrajectorySmoother::trajectories(), funct::true, and up.

191  {
192  const std::string metname = "Reco|TrackingTools|TrackTransformer";
193 
195 
196  // Build the transient Rechits
198 
199  if (recHitsForReFit.size() < 2)
200  return vector<Trajectory>();
201 
202  bool up = recHitsForReFit.back()->globalPosition().y() > 0 ? true : false;
203  LogTrace(metname) << "Up ? " << up;
204 
205  PropagationDirection propagationDirection = up ? oppositeToMomentum : alongMomentum;
206  TrajectoryStateOnSurface firstTSOS = up ? track.outermostMeasurementState() : track.innermostMeasurementState();
207  unsigned int innerId = up ? track.track().outerDetId() : track.track().innerDetId();
208 
209  LogTrace(metname) << "Prop Dir: " << propagationDirection << " FirstId " << innerId << " firstTSOS " << firstTSOS;
210 
211  TrajectorySeed seed({}, {}, propagationDirection);
212 
213  if (recHitsForReFit.front()->geographicalId() != DetId(innerId)) {
214  LogTrace(metname) << "Propagation occurring" << endl;
215  firstTSOS = propagator(up)->propagate(firstTSOS, recHitsForReFit.front()->det()->surface());
216  LogTrace(metname) << "Final destination: " << recHitsForReFit.front()->det()->surface().position() << endl;
217  if (!firstTSOS.isValid()) {
218  LogTrace(metname) << "Propagation error!" << endl;
219  return vector<Trajectory>();
220  }
221  }
222 
223  vector<Trajectory> trajectories = fitter(up)->fit(seed, recHitsForReFit, firstTSOS);
224 
225  if (trajectories.empty()) {
226  LogTrace(metname) << "No Track refitted!" << endl;
227  return vector<Trajectory>();
228  }
229 
230  Trajectory trajectoryBW = trajectories.front();
231 
232  vector<Trajectory> trajectoriesSM = smoother(up)->trajectories(trajectoryBW);
233 
234  if (trajectoriesSM.empty()) {
235  LogTrace(metname) << "No Track smoothed!" << endl;
236  return vector<Trajectory>();
237  }
238 
239  return trajectoriesSM;
240 }
Definition: BitonicSort.h:7
virtual TrajectoryContainer trajectories(const Trajectory &traj) const
const std::string metname
PropagationDirection
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
#define LogTrace(id)
const MagneticField * magneticField() const
the magnetic field
TransientTrackingRecHit::ConstRecHitContainer getTransientRecHits(const reco::TransientTrack &track) const
std::vector< ConstRecHitPointer > ConstRecHitContainer
edm::ESHandle< GlobalTrackingGeometry > trackingGeometry() const
the tracking geometry
Definition: DetId.h:17
edm::ESHandle< TrajectorySmoother > smoother(bool) const
the smoother used to smooth the trajectory which came from the refitting step
edm::ESHandle< TrajectoryFitter > fitter(bool) const
the refitter used to refit the reco::Track
std::vector< Trajectory > fit(const Trajectory &traj, fitType type=standard) const
edm::ESHandle< Propagator > propagator(bool) const

Member Data Documentation

◆ theCacheId_GTG

unsigned long long TrackTransformerForGlobalCosmicMuons::theCacheId_GTG
private

◆ theCacheId_MG

unsigned long long TrackTransformerForGlobalCosmicMuons::theCacheId_MG
private

◆ theCacheId_TC

unsigned long long TrackTransformerForGlobalCosmicMuons::theCacheId_TC
private

◆ theCacheId_TRH

unsigned long long TrackTransformerForGlobalCosmicMuons::theCacheId_TRH
private

◆ theFitterIO

edm::ESHandle<TrajectoryFitter> TrackTransformerForGlobalCosmicMuons::theFitterIO
private

Definition at line 114 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by fitter(), and setServices().

◆ theFitterOI

edm::ESHandle<TrajectoryFitter> TrackTransformerForGlobalCosmicMuons::theFitterOI
private

Definition at line 115 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by fitter(), and setServices().

◆ theIOFitterToken

const edm::ESGetToken<TrajectoryFitter, TrajectoryFitter::Record> TrackTransformerForGlobalCosmicMuons::theIOFitterToken
private

Definition at line 86 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by setServices().

◆ theIOpropToken

const edm::ESGetToken<Propagator, TrackingComponentsRecord> TrackTransformerForGlobalCosmicMuons::theIOpropToken
private

Definition at line 82 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by setServices().

◆ theIOSmootherToken

const edm::ESGetToken<TrajectorySmoother, TrajectoryFitter::Record> TrackTransformerForGlobalCosmicMuons::theIOSmootherToken
private

Definition at line 88 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by setServices().

◆ theMFToken

const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> TrackTransformerForGlobalCosmicMuons::theMFToken
private

Definition at line 85 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by setServices().

◆ theMGField

edm::ESHandle<MagneticField> TrackTransformerForGlobalCosmicMuons::theMGField
private

Definition at line 112 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by magneticField(), and setServices().

◆ theMuonRecHitBuilder

edm::ESHandle<TransientTrackingRecHitBuilder> TrackTransformerForGlobalCosmicMuons::theMuonRecHitBuilder
private

Definition at line 124 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by getTransientRecHits(), and setServices().

◆ theMuonRecHitBuilderName

std::string TrackTransformerForGlobalCosmicMuons::theMuonRecHitBuilderName
private

Definition at line 123 of file TrackTransformerForGlobalCosmicMuons.h.

◆ theMuonRecHitBuildToken

const edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> TrackTransformerForGlobalCosmicMuons::theMuonRecHitBuildToken
private

Definition at line 91 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by setServices().

◆ theOIFitterToken

const edm::ESGetToken<TrajectoryFitter, TrajectoryFitter::Record> TrackTransformerForGlobalCosmicMuons::theOIFitterToken
private

Definition at line 87 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by setServices().

◆ theOIpropToken

const edm::ESGetToken<Propagator, TrackingComponentsRecord> TrackTransformerForGlobalCosmicMuons::theOIpropToken
private

Definition at line 83 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by setServices().

◆ theOISmootherToken

const edm::ESGetToken<TrajectorySmoother, TrajectoryFitter::Record> TrackTransformerForGlobalCosmicMuons::theOISmootherToken
private

Definition at line 89 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by setServices().

◆ thePropagatorIO

edm::ESHandle<Propagator> TrackTransformerForGlobalCosmicMuons::thePropagatorIO
private

Definition at line 94 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by propagator(), and setServices().

◆ thePropagatorOI

edm::ESHandle<Propagator> TrackTransformerForGlobalCosmicMuons::thePropagatorOI
private

Definition at line 95 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by propagator(), and setServices().

◆ theRPCInTheFit

bool TrackTransformerForGlobalCosmicMuons::theRPCInTheFit
private

◆ theSkipStationCSC

int TrackTransformerForGlobalCosmicMuons::theSkipStationCSC
private

◆ theSkipStationDT

int TrackTransformerForGlobalCosmicMuons::theSkipStationDT
private

◆ theSkipWheelDT

int TrackTransformerForGlobalCosmicMuons::theSkipWheelDT
private

◆ theSmootherIO

edm::ESHandle<TrajectorySmoother> TrackTransformerForGlobalCosmicMuons::theSmootherIO
private

Definition at line 117 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by setServices(), and smoother().

◆ theSmootherOI

edm::ESHandle<TrajectorySmoother> TrackTransformerForGlobalCosmicMuons::theSmootherOI
private

Definition at line 118 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by setServices(), and smoother().

◆ theTkRecHitBuildToken

const edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> TrackTransformerForGlobalCosmicMuons::theTkRecHitBuildToken
private

Definition at line 90 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by setServices().

◆ theTopologyToken

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> TrackTransformerForGlobalCosmicMuons::theTopologyToken
private

Definition at line 92 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by setServices().

◆ theTrackerRecHitBuilder

edm::ESHandle<TransientTrackingRecHitBuilder> TrackTransformerForGlobalCosmicMuons::theTrackerRecHitBuilder
private

Definition at line 121 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by getTransientRecHits(), and setServices().

◆ theTrackerRecHitBuilderName

std::string TrackTransformerForGlobalCosmicMuons::theTrackerRecHitBuilderName
private

Definition at line 120 of file TrackTransformerForGlobalCosmicMuons.h.

◆ theTrackerSkipSection

int TrackTransformerForGlobalCosmicMuons::theTrackerSkipSection
private

◆ theTrackerSkipSystem

int TrackTransformerForGlobalCosmicMuons::theTrackerSkipSystem
private

◆ theTrackingGeometry

edm::ESHandle<GlobalTrackingGeometry> TrackTransformerForGlobalCosmicMuons::theTrackingGeometry
private

Definition at line 111 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by setServices(), and trackingGeometry().

◆ thGlobTrackGeoToken

const edm::ESGetToken<GlobalTrackingGeometry, GlobalTrackingGeometryRecord> TrackTransformerForGlobalCosmicMuons::thGlobTrackGeoToken
private

Definition at line 84 of file TrackTransformerForGlobalCosmicMuons.h.

Referenced by setServices().

◆ tTopo_

const TrackerTopology* TrackTransformerForGlobalCosmicMuons::tTopo_
private