CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
FastTrackerRecHitMatcher Class Reference
Inheritance diagram for FastTrackerRecHitMatcher:
edm::stream::EDProducer<>

Public Member Functions

 FastTrackerRecHitMatcher (const edm::ParameterSet &)
 
 ~FastTrackerRecHitMatcher () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Types

typedef std::pair< LocalPoint, LocalPointStripPosition
 

Private Member Functions

const FastSingleTrackerRecHit_cast2Single (const FastTrackerRecHit *recHit) const
 
std::unique_ptr< FastTrackerRecHitmatch (const FastSingleTrackerRecHit *monoRH, const FastSingleTrackerRecHit *stereoRH, const GluedGeomDet *gluedDet, LocalVector &trackdirection, bool stereLayerFirst) const
 
void produce (edm::Event &, const edm::EventSetup &) override
 
StripPosition project (const GeomDetUnit *det, const GluedGeomDet *glueddet, const StripPosition &strip, const LocalVector &trackdirection) const
 
std::unique_ptr< FastTrackerRecHitprojectOnly (const FastSingleTrackerRecHit *originalRH, const GeomDet *monoDet, const GluedGeomDet *gluedDet, LocalVector &ldir) const
 

Private Attributes

edm::EDGetTokenT< FastTrackerRecHitRefCollectionsimHit2RecHitMapToken
 
edm::EDGetTokenT< edm::PSimHitContainersimHitsToken
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtrackerGeometryESToken
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 30 of file FastTrackerRecHitMatcher.cc.

Member Typedef Documentation

◆ StripPosition

Definition at line 40 of file FastTrackerRecHitMatcher.cc.

Constructor & Destructor Documentation

◆ FastTrackerRecHitMatcher()

FastTrackerRecHitMatcher::FastTrackerRecHitMatcher ( const edm::ParameterSet iConfig)
explicit

Definition at line 77 of file FastTrackerRecHitMatcher.cc.

References edm::ParameterSet::getParameter(), simHit2RecHitMapToken, and simHitsToken.

79  simHitsToken = consumes<edm::PSimHitContainer>(iConfig.getParameter<edm::InputTag>("simHits"));
81  consumes<FastTrackerRecHitRefCollection>(iConfig.getParameter<edm::InputTag>("simHit2RecHitMap"));
82 
83  produces<FastTrackerRecHitCollection>();
84  produces<FastTrackerRecHitRefCollection>("simHit2RecHitMap");
85 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryESToken
edm::EDGetTokenT< FastTrackerRecHitRefCollection > simHit2RecHitMapToken
edm::EDGetTokenT< edm::PSimHitContainer > simHitsToken

◆ ~FastTrackerRecHitMatcher()

FastTrackerRecHitMatcher::~FastTrackerRecHitMatcher ( )
inlineoverride

Definition at line 33 of file FastTrackerRecHitMatcher.cc.

33 { ; }

Member Function Documentation

◆ _cast2Single()

const FastSingleTrackerRecHit* FastTrackerRecHitMatcher::_cast2Single ( const FastTrackerRecHit recHit) const
inlineprivate

Definition at line 62 of file FastTrackerRecHitMatcher.cc.

References Exception, and rpcPointValidation_cfi::recHit.

Referenced by produce().

62  {
63  if (!recHit->isSingle()) {
64  throw cms::Exception("FastTrackerRecHitMatcher")
65  << "all rechits in simHit2RecHitMap must be instances of FastSingleTrackerRecHit. recHit's rtti: "
66  << recHit->rtti() << std::endl;
67  }
68  return dynamic_cast<const FastSingleTrackerRecHit*>(recHit);
69  }

◆ fillDescriptions()

void FastTrackerRecHitMatcher::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 355 of file FastTrackerRecHitMatcher.cc.

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

355  {
356  //The following says we do not know what parameters are allowed so do no validation
357  // Please change this to state exactly what you do use, even if it is no parameters
359  desc.setUnknown();
360  descriptions.addDefault(desc);
361 }
void addDefault(ParameterSetDescription const &psetDescription)

◆ match()

std::unique_ptr< FastTrackerRecHit > FastTrackerRecHitMatcher::match ( const FastSingleTrackerRecHit monoRH,
const FastSingleTrackerRecHit stereoRH,
const GluedGeomDet gluedDet,
LocalVector trackdirection,
bool  stereLayerFirst 
) const
private

Definition at line 195 of file FastTrackerRecHitMatcher.cc.

References HltBtagPostValidation_cff::c, alignmentValidation::c1, funct::cos(), change_name::diff, relativeConstraints::error, Exception, TrackingRecHit::geographicalId(), StripTopology::localPitch(), StripTopology::localPosition(), BaseTrackerRecHit::localPosition(), BaseTrackerRecHit::localPositionError(), visualization-live-secondInstance_cfg::m, PV3DBase< T, PVType, FrameType >::mag2(), Topology::measurementError(), Topology::measurementPosition(), GluedGeomDet::monoDet(), PV3DBase< T, PVType, FrameType >::phi(), position, project(), funct::sin(), GluedGeomDet::stereoDet(), GeomDet::surface(), toLocal(), GeomDet::topology(), PV2DBase< T, PVType, FrameType >::x(), geometryCSVtoXML::xx, geometryCSVtoXML::xy, and geometryCSVtoXML::yy.

Referenced by produce().

199  {
200  // stripdet = mono
201  // partnerstripdet = stereo
202  const GeomDetUnit* stripdet = gluedDet->monoDet();
203  const GeomDetUnit* partnerstripdet = gluedDet->stereoDet();
204  const StripTopology& topol = (const StripTopology&)stripdet->topology();
205 
207 
208  // position of the initial and final point of the strip (RPHI cluster) in local strip coordinates
209  MeasurementPoint RPHIpoint = topol.measurementPosition(monoRH->localPosition());
210  MeasurementPoint RPHIpointini = MeasurementPoint(RPHIpoint.x(), -0.5);
211  MeasurementPoint RPHIpointend = MeasurementPoint(RPHIpoint.x(), 0.5);
212 
213  // position of the initial and final point of the strip in local coordinates (mono det)
214  StripPosition stripmono = StripPosition(topol.localPosition(RPHIpointini), topol.localPosition(RPHIpointend));
215 
216  // in case of no track hypothesis assume a track from the origin through the center of the strip
217  if (trackdirection.mag2() < FLT_MIN) {
218  LocalPoint lcenterofstrip = monoRH->localPosition();
219  GlobalPoint gcenterofstrip = (stripdet->surface()).toGlobal(lcenterofstrip);
220  GlobalVector gtrackdirection = gcenterofstrip - GlobalPoint(0, 0, 0);
221  trackdirection = (gluedDet->surface()).toLocal(gtrackdirection);
222  }
223 
224  //project mono hit on glued det
225  StripPosition projectedstripmono = project(stripdet, gluedDet, stripmono, trackdirection);
226  const StripTopology& partnertopol = (const StripTopology&)partnerstripdet->topology();
227 
228  //error calculation (the part that depends on mono RH only)
229  LocalVector RPHIpositiononGluedendvector = projectedstripmono.second - projectedstripmono.first;
230  double c1 = sin(RPHIpositiononGluedendvector.phi());
231  double s1 = -cos(RPHIpositiononGluedendvector.phi());
232  MeasurementError errormonoRH = topol.measurementError(monoRH->localPosition(), monoRH->localPositionError());
233  double pitch = topol.localPitch(monoRH->localPosition());
234  double sigmap12 = errormonoRH.uu() * pitch * pitch;
235 
236  // position of the initial and final point of the strip (STEREO cluster)
237  MeasurementPoint STEREOpoint = partnertopol.measurementPosition(stereoRH->localPosition());
238 
239  MeasurementPoint STEREOpointini = MeasurementPoint(STEREOpoint.x(), -0.5);
240  MeasurementPoint STEREOpointend = MeasurementPoint(STEREOpoint.x(), 0.5);
241 
242  // position of the initial and final point of the strip in local coordinates (stereo det)
243  StripPosition stripstereo(partnertopol.localPosition(STEREOpointini), partnertopol.localPosition(STEREOpointend));
244 
245  //project stereo hit on glued det
246  StripPosition projectedstripstereo = project(partnerstripdet, gluedDet, stripstereo, trackdirection);
247 
248  //perform the matching
249  //(x2-x1)(y-y1)=(y2-y1)(x-x1)
251  AlgebraicVector2 c, solution;
252  m(0, 0) = -(projectedstripmono.second.y() - projectedstripmono.first.y());
253  m(0, 1) = (projectedstripmono.second.x() - projectedstripmono.first.x());
254  m(1, 0) = -(projectedstripstereo.second.y() - projectedstripstereo.first.y());
255  m(1, 1) = (projectedstripstereo.second.x() - projectedstripstereo.first.x());
256  c(0) = m(0, 1) * projectedstripmono.first.y() + m(0, 0) * projectedstripmono.first.x();
257  c(1) = m(1, 1) * projectedstripstereo.first.y() + m(1, 0) * projectedstripstereo.first.x();
258  m.Invert();
259  solution = m * c;
260  position = LocalPoint(solution(0), solution(1));
261 
262  //
263  // temporary fix by tommaso
264  //
265 
266  LocalError tempError(100, 0, 100);
267 
268  // calculate the error
269  LocalVector stereopositiononGluedendvector = projectedstripstereo.second - projectedstripstereo.first;
270  double c2 = sin(stereopositiononGluedendvector.phi());
271  double s2 = -cos(stereopositiononGluedendvector.phi());
272  MeasurementError errorstereoRH =
273  partnertopol.measurementError(stereoRH->localPosition(), stereoRH->localPositionError());
274  pitch = partnertopol.localPitch(stereoRH->localPosition());
275  double sigmap22 = errorstereoRH.uu() * pitch * pitch;
276  double diff = (c1 * s2 - c2 * s1);
277  double invdet2 = 1 / (diff * diff);
278  float xx = invdet2 * (sigmap12 * s2 * s2 + sigmap22 * s1 * s1);
279  float xy = -invdet2 * (sigmap12 * c2 * s2 + sigmap22 * c1 * s1);
280  float yy = invdet2 * (sigmap12 * c2 * c2 + sigmap22 * c1 * c1);
282 
283  //Added by DAO to make sure y positions are zero.
284  DetId det(monoRH->geographicalId());
285  if (det.subdetId() > 2) {
286  return std::make_unique<FastMatchedTrackerRecHit>(position, error, *gluedDet, *monoRH, *stereoRH, stereoHitFirst);
287 
288  }
289 
290  else {
291  throw cms::Exception("FastTrackerRecHitMatcher") << "Matched Pixel!?";
292  }
293 }
std::pair< LocalPoint, LocalPoint > StripPosition
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
virtual const Topology & topology() const
Definition: GeomDet.cc:67
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T x() const
Definition: PV2DBase.h:43
T mag2() const
Definition: PV3DBase.h:63
virtual float localPitch(const LocalPoint &) const =0
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
ROOT::Math::SVector< double, 2 > AlgebraicVector2
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:19
LocalError localPositionError() const override
Definition: DetId.h:17
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
DetId geographicalId() const
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:20
LocalPoint localPosition() const override
static int position[264][3]
Definition: ReadPGInfo.cc:289
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepStd< double, 2, 2 > > AlgebraicMatrix22
virtual LocalPoint localPosition(float strip) const =0
StripPosition project(const GeomDetUnit *det, const GluedGeomDet *glueddet, const StripPosition &strip, const LocalVector &trackdirection) const

◆ produce()

void FastTrackerRecHitMatcher::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 87 of file FastTrackerRecHitMatcher.cc.

References _cast2Single(), edm::Ref< C, T, F >::get(), edm::EventSetup::getData(), StripSubdetector::glued(), iEvent, edm::Ref< C, T, F >::isNull(), match(), eostools::move(), projectOnly(), DetId::rawId(), rpcPointValidation_cfi::recHit, rpcPointValidation_cfi::simHit, Reconstruction_BefMix_cff::simHit2RecHitMap, simHit2RecHitMapToken, FastTrackerRecHitCombiner_cfi::simHits, simHitsToken, StripSubdetector::stereo(), GeomDet::surface(), GloballyPositioned< T >::toLocal(), trackerGeometryESToken, and PSimHit::trackId().

87  {
88  // services
89  auto const& geometry = iSetup.getData(trackerGeometryESToken);
90 
91  // input
93  iEvent.getByToken(simHitsToken, simHits);
94 
97 
98  // output
99  auto output_recHits = std::make_unique<FastTrackerRecHitCollection>();
100  auto output_simHit2RecHitMap =
101  std::make_unique<FastTrackerRecHitRefCollection>(simHit2RecHitMap->size(), FastTrackerRecHitRef());
102  edm::RefProd<FastTrackerRecHitCollection> output_recHits_refProd =
103  iEvent.getRefBeforePut<FastTrackerRecHitCollection>();
104 
105  bool skipNext = false;
106  for (unsigned simHitCounter = 0; simHitCounter < simHits->size(); ++simHitCounter) {
107  // skip hit in case it was matched to previous one
108  if (skipNext) {
109  skipNext = false;
110  continue;
111  }
112  skipNext = false;
113 
114  // get simHit and associated recHit
115  const PSimHit& simHit = (*simHits)[simHitCounter];
116  const FastTrackerRecHitRef& recHitRef = (*simHit2RecHitMap)[simHitCounter];
117 
118  // skip simHits w/o associated recHit
119  if (recHitRef.isNull())
120  continue;
121 
122  // cast
123  const FastSingleTrackerRecHit* recHit = _cast2Single(recHitRef.get());
124 
125  // get subdetector id
126  DetId detid = recHit->geographicalId();
127  unsigned int subdet = detid.subdetId();
128 
129  // treat pixel hits
130  if (subdet <= 2) {
131  (*output_simHit2RecHitMap)[simHitCounter] = recHitRef;
132  }
133 
134  // treat strip hits
135  else {
136  StripSubdetector stripSubDetId(detid);
137 
138  // treat regular regular strip hits
139  if (!stripSubDetId.glued()) {
140  (*output_simHit2RecHitMap)[simHitCounter] = recHitRef;
141  }
142 
143  // treat strip hits on glued layers
144  else {
145  // Obtain direction of simtrack at simhit in local coordinates of glued module
146  // - direction of simtrack at simhit, in coordindates of the single module
147  LocalVector localSimTrackDir = simHit.localDirection();
148  // - transform to global coordinates
149  GlobalVector globalSimTrackDir = recHit->det()->surface().toGlobal(localSimTrackDir);
150  // - transform to local coordinates of glued module
151  const GluedGeomDet* gluedDet = (const GluedGeomDet*)geometry.idToDet(DetId(stripSubDetId.glued()));
152  LocalVector gluedLocalSimTrackDir = gluedDet->surface().toLocal(globalSimTrackDir);
153 
154  // check whether next hit is partner
155  const FastSingleTrackerRecHit* partnerRecHit = nullptr;
156  // - there must be a next hit
157  if (simHitCounter + 1 < simHits->size()) {
158  const FastTrackerRecHitRef& nextRecHitRef = (*simHit2RecHitMap)[simHitCounter + 1];
159  const PSimHit& nextSimHit = (*simHits)[simHitCounter + 1];
160  // - partner hit must not be null
161  // - simHit and partner simHit must belong to same simTrack
162  // - partner hit must be on the module glued to the module of the hit
163  if ((!nextRecHitRef.isNull()) && simHit.trackId() == nextSimHit.trackId() &&
164  StripSubdetector(nextRecHitRef->geographicalId()).partnerDetId() == detid.rawId()) {
165  partnerRecHit = _cast2Single(nextRecHitRef.get());
166  skipNext = true;
167  }
168  }
169 
170  std::unique_ptr<FastTrackerRecHit> newRecHit(nullptr);
171 
172  // if partner found: create a matched hit
173  if (partnerRecHit) {
174  newRecHit = match(stripSubDetId.stereo() ? partnerRecHit : recHit,
175  stripSubDetId.stereo() ? recHit : partnerRecHit,
176  gluedDet,
177  gluedLocalSimTrackDir,
178  stripSubDetId.stereo());
179  }
180  // else: create projected hit
181  else {
182  newRecHit = projectOnly(recHit, geometry.idToDet(detid), gluedDet, gluedLocalSimTrackDir);
183  }
184  output_recHits->push_back(std::move(newRecHit));
185  (*output_simHit2RecHitMap)[simHitCounter] =
186  FastTrackerRecHitRef(output_recHits_refProd, output_recHits->size() - 1);
187  }
188  }
189  }
190 
191  iEvent.put(std::move(output_recHits));
192  iEvent.put(std::move(output_simHit2RecHitMap), "simHit2RecHitMap");
193 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
std::unique_ptr< FastTrackerRecHit > match(const FastSingleTrackerRecHit *monoRH, const FastSingleTrackerRecHit *stereoRH, const GluedGeomDet *gluedDet, LocalVector &trackdirection, bool stereLayerFirst) const
std::unique_ptr< FastTrackerRecHit > projectOnly(const FastSingleTrackerRecHit *originalRH, const GeomDet *monoDet, const GluedGeomDet *gluedDet, LocalVector &ldir) const
LocalPoint toLocal(const GlobalPoint &gp) const
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryESToken
edm::Ref< FastTrackerRecHitCollection > FastTrackerRecHitRef
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< FastTrackerRecHitRefCollection > simHit2RecHitMapToken
edm::EDGetTokenT< edm::PSimHitContainer > simHitsToken
const FastSingleTrackerRecHit * _cast2Single(const FastTrackerRecHit *recHit) const
unsigned int trackId() const
Definition: PSimHit.h:106
bool isNull() const
Checks for null.
Definition: Ref.h:235
Definition: DetId.h:17
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:232
def move(src, dest)
Definition: eostools.py:511

◆ project()

FastTrackerRecHitMatcher::StripPosition FastTrackerRecHitMatcher::project ( const GeomDetUnit det,
const GluedGeomDet glueddet,
const StripPosition strip,
const LocalVector trackdirection 
) const
private

Definition at line 295 of file FastTrackerRecHitMatcher.cc.

References pfClustersFromCombinedCaloHF_cfi::scale, digitizers_cfi::strip, GeomDet::surface(), toLocal(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by match().

298  {
299  GlobalPoint globalpointini = (det->surface()).toGlobal(strip.first);
300  GlobalPoint globalpointend = (det->surface()).toGlobal(strip.second);
301 
302  // position of the initial and final point of the strip in glued local coordinates
303  LocalPoint positiononGluedini = (glueddet->surface()).toLocal(globalpointini);
304  LocalPoint positiononGluedend = (glueddet->surface()).toLocal(globalpointend);
305 
306  //correct the position with the track direction
307 
308  float scale = -positiononGluedini.z() / trackdirection.z();
309 
310  LocalPoint projpositiononGluedini = positiononGluedini + scale * trackdirection;
311  LocalPoint projpositiononGluedend = positiononGluedend + scale * trackdirection;
312 
313  return StripPosition(projpositiononGluedini, projpositiononGluedend);
314 }
std::pair< LocalPoint, LocalPoint > StripPosition
T z() const
Definition: PV3DBase.h:61
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37

◆ projectOnly()

std::unique_ptr< FastTrackerRecHit > FastTrackerRecHitMatcher::projectOnly ( const FastSingleTrackerRecHit originalRH,
const GeomDet monoDet,
const GluedGeomDet gluedDet,
LocalVector ldir 
) const
private

Definition at line 316 of file FastTrackerRecHitMatcher.cc.

References dumpMFGeometry_cfg::delta, Exception, GeomDet::geographicalId(), BaseTrackerRecHit::localPosition(), BaseTrackerRecHit::localPositionError(), GluedGeomDet::monoDet(), position, LocalError::rotate(), GluedGeomDet::stereoDet(), GeomDet::surface(), Surface::toGlobal(), PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by produce().

319  {
320  LocalPoint position(originalRH->localPosition().x(), 0., 0.);
321  const BoundPlane& gluedPlane = gluedDet->surface();
322  const BoundPlane& hitPlane = monoDet->surface();
323 
324  double delta = gluedPlane.localZ(hitPlane.position());
325 
326  LocalPoint lhitPos = gluedPlane.toLocal(monoDet->surface().toGlobal(position));
327  LocalPoint projectedHitPos = lhitPos - ldir * delta / ldir.z();
328 
329  LocalVector hitXAxis = gluedPlane.toLocal(hitPlane.toGlobal(LocalVector(1, 0, 0)));
330  LocalError hitErr = originalRH->localPositionError();
331 
332  if (gluedPlane.normalVector().dot(hitPlane.normalVector()) < 0) {
333  // the two planes are inverted, and the correlation element must change sign
334  hitErr = LocalError(hitErr.xx(), -hitErr.xy(), hitErr.yy());
335  }
336  LocalError rotatedError = hitErr.rotate(hitXAxis.x(), hitXAxis.y());
337 
338  const GeomDetUnit* gluedMonoDet = gluedDet->monoDet();
339  const GeomDetUnit* gluedStereoDet = gluedDet->stereoDet();
340  int isMono = 0;
341  int isStereo = 0;
342 
343  if (monoDet->geographicalId() == gluedMonoDet->geographicalId())
344  isMono = 1;
345  if (monoDet->geographicalId() == gluedStereoDet->geographicalId())
346  isStereo = 1;
347  //Added by DAO to make sure y positions are zero and correct Mono or stereo Det is filled.
348 
349  if ((isMono && isStereo) || (!isMono && !isStereo))
350  throw cms::Exception("FastTrackerRecHitMatcher") << "Something wrong with DetIds.";
351  return std::make_unique<FastProjectedTrackerRecHit>(projectedHitPos, rotatedError, *gluedDet, *originalRH);
352 }
LocalError rotate(float x, float y) const
Return a new LocalError, rotated by an angle defined by the direction (x,y)
Definition: LocalError.h:37
T z() const
Definition: PV3DBase.h:61
float yy() const
Definition: LocalError.h:24
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:19
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
float xy() const
Definition: LocalError.h:23
LocalError localPositionError() const override
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:20
LocalPoint localPosition() const override
static int position[264][3]
Definition: ReadPGInfo.cc:289
float xx() const
Definition: LocalError.h:22

Member Data Documentation

◆ simHit2RecHitMapToken

edm::EDGetTokenT<FastTrackerRecHitRefCollection> FastTrackerRecHitMatcher::simHit2RecHitMapToken
private

Definition at line 73 of file FastTrackerRecHitMatcher.cc.

Referenced by FastTrackerRecHitMatcher(), and produce().

◆ simHitsToken

edm::EDGetTokenT<edm::PSimHitContainer> FastTrackerRecHitMatcher::simHitsToken
private

Definition at line 72 of file FastTrackerRecHitMatcher.cc.

Referenced by FastTrackerRecHitMatcher(), and produce().

◆ trackerGeometryESToken

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> FastTrackerRecHitMatcher::trackerGeometryESToken
private

Definition at line 74 of file FastTrackerRecHitMatcher.cc.

Referenced by produce().