test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
TkGluedMeasurementDet Class Referencefinal

#include <TkGluedMeasurementDet.h>

Inheritance diagram for TkGluedMeasurementDet:
MeasurementDet

Classes

class  HitCollectorForFastMeasurements
 
class  HitCollectorForRecHits
 
class  HitCollectorForSimpleHits
 

Public Member Functions

bool hasBadComponents (const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent &data) const
 return TRUE if at least one of the mono and stereo components has badChannels More...
 
void init (const MeasurementDet *monoDet, const MeasurementDet *stereoDet)
 
bool isActive (const MeasurementTrackerEvent &data) const
 return TRUE if both mono and stereo components are active More...
 
virtual bool measurements (const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, const MeasurementTrackerEvent &data, TempMeasurements &result) const
 
const TkStripMeasurementDetmonoDet () const
 
template<typename Collector >
void projectOnGluedDet (Collector &collector, const RecHitContainer &hits, const GlobalVector &gdir) const
 
template<typename Collector >
void projectOnGluedDet (Collector &collector, std::vector< SiStripRecHit2D > const &hits, const GlobalVector &gdir) const
 
unsigned int rawId () const
 
virtual RecHitContainer recHits (const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data) const
 
virtual bool recHits (SimpleHitContainer &result, const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &, const MeasurementTrackerEvent &data) const
 
const GluedGeomDetspecificGeomDet () const
 
const TkStripMeasurementDetstereoDet () const
 
 TkGluedMeasurementDet (const GluedGeomDet *gdet, const SiStripRecHitMatcher *matcher, const StripClusterParameterEstimator *cpe)
 
- Public Member Functions inherited from MeasurementDet
const GeomDetfastGeomDet () const
 
std::vector
< TrajectoryMeasurement
fastMeasurements (const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &est, const MeasurementTrackerEvent &data) const
 
virtual const GeomDetgeomDet () const
 
 MeasurementDet (const GeomDet *gdet)
 
const Surface::PositionTypeposition () const
 
virtual bool recHits (const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &, const MeasurementTrackerEvent &data, RecHitContainer &result, std::vector< float > &) const
 
const Surfacesurface () const
 

Private Member Functions

void checkHitProjection (const TrackingRecHit &hit, const TrajectoryStateOnSurface &ts, const GeomDet &det) const
 
void checkProjection (const TrajectoryStateOnSurface &ts, const RecHitContainer &monoHits, const RecHitContainer &stereoHits) const
 
template<typename Collector >
void collectRecHits (const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data, Collector &coll) const
 
template<typename Collector >
void doubleMatch (const TrajectoryStateOnSurface &ts, const MeasurementTrackerEvent &data, Collector &collector) const
 
RecHitContainer projectOnGluedDet (const std::vector< SiStripRecHit2D > &hits, const TrajectoryStateOnSurface &ts) const
 
template<typename HitCollector >
void projectOnGluedDet (HitCollector &collector, const std::vector< SiStripRecHit2D > &hits, const GlobalVector &gdir) const
 
RecHitContainer projectOnGluedDet (const RecHitContainer &hits, const TrajectoryStateOnSurface &ts) const
 
template<typename HitCollector >
void projectOnGluedDet (HitCollector &collector, const RecHitContainer &hits, const GlobalVector &gdir) const
 
bool testStrips (const TrajectoryStateOnSurface &tsos, const BoundPlane &gluedPlane, const TkStripMeasurementDet &mdet) const
 Test the strips on one of the two dets with projection. More...
 

Private Attributes

const
StripClusterParameterEstimator
theCPE
 
const SiStripRecHitMatchertheMatcher
 
const TkStripMeasurementDettheMonoDet
 
const TkStripMeasurementDettheStereoDet
 

Additional Inherited Members

- Public Types inherited from MeasurementDet
typedef
TrackingRecHit::ConstRecHitContainer 
RecHitContainer
 
using SimpleHitContainer = std::vector< BaseTrackerRecHit * >
 
typedef tracking::TempMeasurements TempMeasurements
 
- Protected Attributes inherited from MeasurementDet
TrackingRecHit::ConstRecHitPointer theInactiveHit
 
TrackingRecHit::ConstRecHitPointer theMissingHit
 

Detailed Description

Definition at line 19 of file TkGluedMeasurementDet.h.

Constructor & Destructor Documentation

TkGluedMeasurementDet::TkGluedMeasurementDet ( const GluedGeomDet gdet,
const SiStripRecHitMatcher matcher,
const StripClusterParameterEstimator cpe 
)

Definition at line 72 of file TkGluedMeasurementDet.cc.

74  :
75  MeasurementDet(gdet),
76  theMatcher(matcher), theCPE(cpe),
77  theMonoDet(nullptr), theStereoDet(nullptr)
78 {}
const TkStripMeasurementDet * theMonoDet
MeasurementDet(const GeomDet *gdet)
const SiStripRecHitMatcher * theMatcher
const TkStripMeasurementDet * theStereoDet
const StripClusterParameterEstimator * theCPE

Member Function Documentation

void TkGluedMeasurementDet::checkHitProjection ( const TrackingRecHit hit,
const TrajectoryStateOnSurface ts,
const GeomDet det 
) const
private

Definition at line 366 of file TkGluedMeasurementDet.cc.

References gather_cfg::cout, TrajectoryStateOnSurface::globalParameters(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), mag(), bookConverter::max, GlobalTrajectoryParameters::momentum(), LocalTrajectoryError::positionError(), RecHitPropagator::propagate(), GeomDet::surface(), theCPE, LocalError::xx(), LocalError::xy(), and LocalError::yy().

Referenced by checkProjection().

369 {
370  auto && vl = projectedPos(hit, det, ts.globalParameters().momentum(), theCPE);
371  ProjectedSiStripRecHit2D projectedHit(vl.first,vl.second, det, static_cast<SiStripRecHit2D const &>(hit));
372 
373  RecHitPropagator prop;
374  TrajectoryStateOnSurface propState = prop.propagate( hit, det.surface(), ts);
375 
376  if ((projectedHit.localPosition()-propState.localPosition()).mag() > 0.0001f) {
377  std::cout << "PROBLEM: projected and propagated hit positions differ by "
378  << (projectedHit.localPosition()-propState.localPosition()).mag() << std::endl;
379  }
380 
381  LocalError le1 = projectedHit.localPositionError();
382  LocalError le2 = propState.localError().positionError();
383  double eps = 1.e-5;
384  double cutoff = 1.e-4; // if element below cutoff, use absolute instead of relative accuracy
385  double maxdiff = std::max( std::max( fabs(le1.xx() - le2.xx())/(cutoff+le1.xx()),
386  fabs(le1.xy() - le2.xy())/(cutoff+fabs(le1.xy()))),
387  fabs(le1.yy() - le2.yy())/(cutoff+le1.xx()));
388  if (maxdiff > eps) {
389  std::cout << "PROBLEM: projected and propagated hit errors differ by "
390  << maxdiff << std::endl;
391  }
392 
393 }
float xx() const
Definition: LocalError.h:24
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
LocalError positionError() const
float xy() const
Definition: LocalError.h:25
TrajectoryStateOnSurface propagate(const TrackingRecHit &hit, const Plane &plane, const TrajectoryStateOnSurface &ts) const
float yy() const
Definition: LocalError.h:26
const LocalTrajectoryError & localError() const
const GlobalTrajectoryParameters & globalParameters() const
tuple cout
Definition: gather_cfg.py:145
const StripClusterParameterEstimator * theCPE
void TkGluedMeasurementDet::checkProjection ( const TrajectoryStateOnSurface ts,
const RecHitContainer monoHits,
const RecHitContainer stereoHits 
) const
private

Definition at line 354 of file TkGluedMeasurementDet.cc.

References checkHitProjection(), MeasurementDet::fastGeomDet(), and i.

357 {
358  for (RecHitContainer::const_iterator i=monoHits.begin(); i != monoHits.end(); ++i) {
359  checkHitProjection( **i, ts, fastGeomDet());
360  }
361  for (RecHitContainer::const_iterator i=stereoHits.begin(); i != stereoHits.end(); ++i) {
362  checkHitProjection( **i, ts, fastGeomDet());
363  }
364 }
int i
Definition: DBlmapReader.cc:9
const GeomDet & fastGeomDet() const
void checkHitProjection(const TrackingRecHit &hit, const TrajectoryStateOnSurface &ts, const GeomDet &det) const
template<typename Collector >
void TkGluedMeasurementDet::collectRecHits ( const TrajectoryStateOnSurface ts,
const MeasurementTrackerEvent data,
Collector &  coll 
) const
private

Definition at line 204 of file TkGluedMeasurementDet.cc.

References TrajectoryStateOnSurface::globalParameters(), TrackingRecHit::hit(), TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localDirection(), SiStripRecHitMatcher::match(), GlobalTrajectoryParameters::momentum(), MeasurementDet::position(), projectOnGluedDet(), TkStripMeasurementDet::recHits(), TkStripMeasurementDet::simpleRecHits(), specificGeomDet(), MeasurementDet::surface(), theMatcher, theMonoDet, theStereoDet, GloballyPositioned< T >::toLocal(), and create_public_lumi_plots::transform.

Referenced by measurements(), and recHits().

205 {
206  //------ WARNING: here ts is used as it is on the mono/stereo surface.
207  //----- A further propagation is necessary.
208  //----- To limit the problem, the SimpleCPE should be used
209  RecHitContainer monoHits = theMonoDet->recHits( ts, data );
210  GlobalVector glbDir = (ts.isValid() ? ts.globalParameters().momentum() : position()-GlobalPoint(0,0,0));
211 
212  //edm::LogWarning("TkGluedMeasurementDet::recHits") << "Query-for-detid-" << theGeomDet->geographicalId().rawId();
213 
214  //checkProjection(ts, monoHits, stereoHits);
215 
216  if (monoHits.empty()) {
217  // make stereo TTRHs and project them
218  projectOnGluedDet( collector, theStereoDet->recHits(ts, data), glbDir);
219  } else {
220  // collect simple stereo hits
221  std::vector<SiStripRecHit2D> simpleSteroHitsByValue;
222  theStereoDet->simpleRecHits(ts, data, simpleSteroHitsByValue);
223 
224  if (simpleSteroHitsByValue.empty()) {
225  projectOnGluedDet( collector, monoHits, glbDir);
226  } else {
227 
228  LocalVector tkDir = (ts.isValid() ? ts.localDirection() : surface().toLocal( position()-GlobalPoint(0,0,0)));
230  vsStereoHits.resize(simpleSteroHitsByValue.size());
231  std::transform(simpleSteroHitsByValue.begin(), simpleSteroHitsByValue.end(), vsStereoHits.begin(), take_address());
232 
233  // convert mono hits to type expected by matcher
234  for (RecHitContainer::const_iterator monoHit = monoHits.begin();
235  monoHit != monoHits.end(); ++monoHit) {
236  const TrackingRecHit* tkhit = (**monoHit).hit();
237  const SiStripRecHit2D* verySpecificMonoHit = reinterpret_cast<const SiStripRecHit2D*>(tkhit);
238  theMatcher->match( verySpecificMonoHit, vsStereoHits.begin(), vsStereoHits.end(),
239  collector.collector(), &specificGeomDet(), tkDir);
240 
241  if (collector.hasNewMatchedHits()) {
242  collector.clearNewMatchedHitsFlag();
243  } else {
244  collector.addProjected( **monoHit, glbDir );
245  }
246  } // loop on mono hit
247  }
248  //GIO// std::cerr << "TkGluedMeasurementDet hits " << monoHits.size() << "/" << stereoHits.size() << " => " << result.size() << std::endl;
249  }
250 }
const TkStripMeasurementDet * theMonoDet
LocalVector localDirection() const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
void simpleRecHits(const TrajectoryStateOnSurface &ts, const MeasurementTrackerEvent &data, std::vector< SiStripRecHit2D > &result) const
const Surface & surface() const
virtual RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data) const
LocalPoint toLocal(const GlobalPoint &gp) const
const GluedGeomDet & specificGeomDet() const
const Surface::PositionType & position() const
RecHitContainer projectOnGluedDet(const std::vector< SiStripRecHit2D > &hits, const TrajectoryStateOnSurface &ts) const
const SiStripRecHitMatcher * theMatcher
virtual TrackingRecHit const * hit() const
const GlobalTrajectoryParameters & globalParameters() const
std::vector< const SiStripRecHit2D * > SimpleHitCollection
std::unique_ptr< SiStripMatchedRecHit2D > match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection, bool force=false) const
const TkStripMeasurementDet * theStereoDet
TrackingRecHit::ConstRecHitContainer RecHitContainer
template<typename Collector >
void TkGluedMeasurementDet::doubleMatch ( const TrajectoryStateOnSurface ts,
const MeasurementTrackerEvent data,
Collector &  collector 
) const
private
bool TkGluedMeasurementDet::hasBadComponents ( const TrajectoryStateOnSurface tsos,
const MeasurementTrackerEvent data 
) const
inlinevirtual

return TRUE if at least one of the mono and stereo components has badChannels

Implements MeasurementDet.

Definition at line 50 of file TkGluedMeasurementDet.h.

References MeasurementDet::hasBadComponents().

50  {
51  return (monoDet()->hasBadComponents(tsos,data) || stereoDet()->hasBadComponents(tsos,data));}
const TkStripMeasurementDet * monoDet() const
bool hasBadComponents(const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent &data) const
return TRUE if at least one of the mono and stereo components has badChannels
const TkStripMeasurementDet * stereoDet() const
void TkGluedMeasurementDet::init ( const MeasurementDet monoDet,
const MeasurementDet stereoDet 
)

Definition at line 80 of file TkGluedMeasurementDet.cc.

References monoDet(), stereoDet(), theMonoDet, and theStereoDet.

Referenced by MeasurementTrackerImpl::initGluedDet().

81  {
82  theMonoDet = dynamic_cast<const TkStripMeasurementDet *>(monoDet);
83  theStereoDet = dynamic_cast<const TkStripMeasurementDet *>(stereoDet);
84 
85  if ((theMonoDet == 0) || (theStereoDet == 0)) {
86  throw MeasurementDetException("TkGluedMeasurementDet ERROR: Trying to glue a det which is not a TkStripMeasurementDet");
87  }
88 }
const TkStripMeasurementDet * theMonoDet
const TkStripMeasurementDet * monoDet() const
const TkStripMeasurementDet * theStereoDet
const TkStripMeasurementDet * stereoDet() const
bool TkGluedMeasurementDet::isActive ( const MeasurementTrackerEvent data) const
inlinevirtual

return TRUE if both mono and stereo components are active

Implements MeasurementDet.

Definition at line 47 of file TkGluedMeasurementDet.h.

References MeasurementDet::isActive().

47 {return monoDet()->isActive(data) && stereoDet()->isActive(data); }
const TkStripMeasurementDet * monoDet() const
bool isActive(const MeasurementTrackerEvent &data) const
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
const TkStripMeasurementDet * stereoDet() const
bool TkGluedMeasurementDet::measurements ( const TrajectoryStateOnSurface stateOnThisDet,
const MeasurementEstimator est,
const MeasurementTrackerEvent data,
TempMeasurements result 
) const
virtual

Implements MeasurementDet.

Definition at line 117 of file TkGluedMeasurementDet.cc.

References tracking::TempMeasurements::add(), collectRecHits(), F(), MeasurementDet::fastGeomDet(), GeomDet::geographicalId(), MeasurementDet::geomDet(), TrajectoryStateOnSurface::globalMomentum(), TkStripMeasurementDet::hasAllGoodChannels(), TrajectoryStateOnSurface::hasError(), TkStripMeasurementDet::isActive(), cmsLHEtoEOSManager::l, TOBDetId::layer(), MeasurementEstimator::minPt2ForHitRecoveryInGluedDet(), PV3DBase< T, PVType, FrameType >::perp2(), tracking::TempMeasurements::size(), DetId::subdetId(), GeomDet::surface(), testStrips(), theCPE, MeasurementDet::theInactiveHit, theMatcher, MeasurementDet::theMissingHit, theMonoDet, theStereoDet, and unlikely.

120  {
121 
123  // LogDebug("TkStripMeasurementDet") << " DetID " << geomDet().geographicalId().rawId() << " (glued) fully inactive";
124  result.add(theInactiveHit, 0.F);
125  return true;
126  }
127 
128  auto oldSize = result.size();
129 
130  HitCollectorForFastMeasurements collector( &fastGeomDet(), theMatcher, theCPE, stateOnThisDet, est, result);
131  collectRecHits(stateOnThisDet, data, collector);
132 
133 
134  if (result.size()>oldSize) return true;
135 
136  auto id = geomDet().geographicalId().subdetId()-3;
137  auto l = TOBDetId(geomDet().geographicalId()).layer();
138  bool killHIP = (1==l) && (2==id); //TOB1
139  killHIP &= stateOnThisDet.globalMomentum().perp2()>est.minPt2ForHitRecoveryInGluedDet();
140  if (killHIP) {
141  result.add(theInactiveHit, 0.F);
142  return true;
143  }
144 
145 
146  //LogDebug("TkStripMeasurementDet") << "No hit found on TkGlued. Testing strips... ";
147  const BoundPlane &gluedPlane = geomDet().surface();
148  bool addMissingHit = false;
149  if(est.minPt2ForHitRecoveryInGluedDet() < 1e9f) {// HIP mitigation is active
150  // sorry for duplicating the big IF below, but to keep exloiting
151  // short-circuiting logic that's the easiest
152  addMissingHit = stateOnThisDet.hasError() && ( /* do this only if the state has uncertainties, otherwise it will throw
153  (states without uncertainties are passed to this code from seeding */
154  (theMonoDet->isActive(data) &&
156  testStrips(stateOnThisDet,gluedPlane,*theMonoDet)
157  )
158  ) /*Mono OK*/ &&
159  (theStereoDet->isActive(data) &&
161  testStrips(stateOnThisDet,gluedPlane,*theStereoDet)
162  )
163  ) /*Stereo OK*/
164  ); /* State has errors */
165  }
166  else {
167  // sorry for the big IF, but I want to exploit short-circuiting of logic
168  addMissingHit = stateOnThisDet.hasError() && ( /* do this only if the state has uncertainties, otherwise it will throw
169  (states without uncertainties are passed to this code from seeding */
170  (theMonoDet->isActive(data) &&
172  testStrips(stateOnThisDet,gluedPlane,*theMonoDet)
173  )
174  ) /*Mono OK*/ ||
175  (theStereoDet->isActive(data) &&
177  testStrips(stateOnThisDet,gluedPlane,*theStereoDet)
178  )
179  ) /*Stereo OK*/
180  ); /* State has errors */
181  }
182  if(addMissingHit) {
183  result.add(theMissingHit, 0.F);
184  return false;
185  }
186  result.add(theInactiveHit, 0.F);
187  return true;
188 
189 }
bool testStrips(const TrajectoryStateOnSurface &tsos, const BoundPlane &gluedPlane, const TkStripMeasurementDet &mdet) const
Test the strips on one of the two dets with projection.
const TkStripMeasurementDet * theMonoDet
unsigned int layer() const
layer id
Definition: TOBDetId.h:39
float minPt2ForHitRecoveryInGluedDet() const
virtual const GeomDet & geomDet() const
T perp2() const
Definition: PV3DBase.h:71
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
tuple result
Definition: mps_fire.py:83
TrackingRecHit::ConstRecHitPointer theMissingHit
const GeomDet & fastGeomDet() const
#define unlikely(x)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
bool hasAllGoodChannels() const
does this module have at least one bad strip, APV or channel?
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
void collectRecHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data, Collector &coll) const
const SiStripRecHitMatcher * theMatcher
TrackingRecHit::ConstRecHitPointer theInactiveHit
bool isActive(const MeasurementTrackerEvent &data) const
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
const TkStripMeasurementDet * theStereoDet
GlobalVector globalMomentum() const
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281
const StripClusterParameterEstimator * theCPE
const TkStripMeasurementDet* TkGluedMeasurementDet::monoDet ( ) const
inline

Definition at line 40 of file TkGluedMeasurementDet.h.

Referenced by init().

40 { return theMonoDet;}
const TkStripMeasurementDet * theMonoDet
TkGluedMeasurementDet::RecHitContainer TkGluedMeasurementDet::projectOnGluedDet ( const std::vector< SiStripRecHit2D > &  hits,
const TrajectoryStateOnSurface ts 
) const
private

Definition at line 328 of file TkGluedMeasurementDet.cc.

References MeasurementDet::fastGeomDet(), TrajectoryStateOnSurface::globalParameters(), GlobalTrajectoryParameters::momentum(), eostools::move(), mps_fire::result, and theCPE.

Referenced by collectRecHits().

330 {
332  for ( auto const & hit : hits) {
333  auto && vl = projectedPos(hit, fastGeomDet(), ts.globalParameters().momentum(), theCPE);
334  auto && phit = std::make_shared<ProjectedSiStripRecHit2D> (vl.first,vl.second,fastGeomDet(), static_cast<SiStripRecHit2D const &>(hit));
335  result.push_back(std::move(phit));
336  }
337  return result;
338 }
tuple result
Definition: mps_fire.py:83
const GeomDet & fastGeomDet() const
def move
Definition: eostools.py:510
const GlobalTrajectoryParameters & globalParameters() const
TrackingRecHit::ConstRecHitContainer RecHitContainer
const StripClusterParameterEstimator * theCPE
template<typename HitCollector >
void TkGluedMeasurementDet::projectOnGluedDet ( HitCollector &  collector,
const std::vector< SiStripRecHit2D > &  hits,
const GlobalVector gdir 
) const
private
TkGluedMeasurementDet::RecHitContainer TkGluedMeasurementDet::projectOnGluedDet ( const RecHitContainer hits,
const TrajectoryStateOnSurface ts 
) const
private

Definition at line 304 of file TkGluedMeasurementDet.cc.

References MeasurementDet::fastGeomDet(), TrajectoryStateOnSurface::globalParameters(), GlobalTrajectoryParameters::momentum(), eostools::move(), mps_fire::result, and theCPE.

306 {
308  for ( auto const & hit : hits) {
309  auto && vl = projectedPos(*hit, fastGeomDet(), ts.globalParameters().momentum(), theCPE);
310  auto && phit = std::make_shared<ProjectedSiStripRecHit2D> (vl.first,vl.second, fastGeomDet(), static_cast<SiStripRecHit2D const &>(*hit));
311  result.push_back(std::move(phit));
312  }
313  return result;
314 }
tuple result
Definition: mps_fire.py:83
const GeomDet & fastGeomDet() const
def move
Definition: eostools.py:510
const GlobalTrajectoryParameters & globalParameters() const
TrackingRecHit::ConstRecHitContainer RecHitContainer
const StripClusterParameterEstimator * theCPE
template<typename HitCollector >
void TkGluedMeasurementDet::projectOnGluedDet ( HitCollector &  collector,
const RecHitContainer hits,
const GlobalVector gdir 
) const
private
template<typename Collector >
void TkGluedMeasurementDet::projectOnGluedDet ( Collector &  collector,
const RecHitContainer hits,
const GlobalVector gdir 
) const

Definition at line 318 of file TkGluedMeasurementDet.cc.

321 {
322  for ( RecHitContainer::const_iterator ihit = hits.begin(); ihit!=hits.end(); ihit++) {
323  collector.addProjected( **ihit, gdir );
324  }
325 }
template<typename Collector >
void TkGluedMeasurementDet::projectOnGluedDet ( Collector &  collector,
std::vector< SiStripRecHit2D > const &  hits,
const GlobalVector gdir 
) const

Definition at line 342 of file TkGluedMeasurementDet.cc.

345 {
346  for ( auto const & hit : hits)
347  collector.addProjected(hit, gdir );
348 }
unsigned int TkGluedMeasurementDet::rawId ( ) const
inline

Definition at line 43 of file TkGluedMeasurementDet.h.

References MeasurementDet::fastGeomDet(), and GeomDet::geographicalId().

43 { return fastGeomDet().geographicalId(); }
const GeomDet & fastGeomDet() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
TkGluedMeasurementDet::RecHitContainer TkGluedMeasurementDet::recHits ( const TrajectoryStateOnSurface ts,
const MeasurementTrackerEvent data 
) const
virtual

Implements MeasurementDet.

Definition at line 91 of file TkGluedMeasurementDet.cc.

References collectRecHits(), MeasurementDet::fastGeomDet(), mps_fire::result, theCPE, and theMatcher.

92 {
93 
95  HitCollectorForRecHits collector( &fastGeomDet(), theMatcher, theCPE, result );
96  collectRecHits(ts, data, collector);
97  return result;
98 }
tuple result
Definition: mps_fire.py:83
const GeomDet & fastGeomDet() const
void collectRecHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data, Collector &coll) const
const SiStripRecHitMatcher * theMatcher
TrackingRecHit::ConstRecHitContainer RecHitContainer
const StripClusterParameterEstimator * theCPE
bool TkGluedMeasurementDet::recHits ( SimpleHitContainer result,
const TrajectoryStateOnSurface stateOnThisDet,
const MeasurementEstimator est,
const MeasurementTrackerEvent data 
) const
virtual

Reimplemented from MeasurementDet.

Definition at line 102 of file TkGluedMeasurementDet.cc.

References collectRecHits(), MeasurementDet::fastGeomDet(), TkStripMeasurementDet::isActive(), theCPE, theMatcher, theMonoDet, theStereoDet, and unlikely.

104  {
106  auto oldSize = result.size();
107  HitCollectorForSimpleHits collector( &fastGeomDet(), theMatcher, theCPE, stateOnThisDet, est, result);
108  collectRecHits(stateOnThisDet, data, collector);
109 
110  return result.size()>oldSize;
111 
112 }
const TkStripMeasurementDet * theMonoDet
tuple result
Definition: mps_fire.py:83
const GeomDet & fastGeomDet() const
#define unlikely(x)
void collectRecHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data, Collector &coll) const
const SiStripRecHitMatcher * theMatcher
bool isActive(const MeasurementTrackerEvent &data) const
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
const TkStripMeasurementDet * theStereoDet
return(e1-e2)*(e1-e2)+dp *dp
volatile std::atomic< bool > shutdown_flag false
const StripClusterParameterEstimator * theCPE
tuple size
Write out results.
const GluedGeomDet& TkGluedMeasurementDet::specificGeomDet ( ) const
inline

Definition at line 34 of file TkGluedMeasurementDet.h.

References compareJSON::const, and MeasurementDet::fastGeomDet().

Referenced by collectRecHits(), and MeasurementTrackerImpl::initGluedDet().

34 {return static_cast<GluedGeomDet const&>(fastGeomDet());}
const GeomDet & fastGeomDet() const
string const
Definition: compareJSON.py:14
const TkStripMeasurementDet* TkGluedMeasurementDet::stereoDet ( ) const
inline

Definition at line 41 of file TkGluedMeasurementDet.h.

Referenced by init().

41 { return theStereoDet;}
const TkStripMeasurementDet * theStereoDet
bool TkGluedMeasurementDet::testStrips ( const TrajectoryStateOnSurface tsos,
const BoundPlane gluedPlane,
const TkStripMeasurementDet mdet 
) const
private

Test the strips on one of the two dets with projection.

Definition at line 396 of file TkGluedMeasurementDet.cc.

References MeasurementDet::fastGeomDet(), TrajectoryStateOnSurface::globalParameters(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::localError(), Topology::measurementError(), Topology::measurementPosition(), GlobalTrajectoryParameters::momentum(), LocalTrajectoryError::positionError(), LocalError::rotate(), TkStripMeasurementDet::specificGeomDet(), StripGeomDetUnit::specificTopology(), mathSSE::sqrt(), GeomDet::surface(), TkStripMeasurementDet::testStrips(), MeasurementError::uu(), PV2DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by measurements().

398  {
399  // from TrackingRecHitProjector
400  const GeomDet &det = mdet.fastGeomDet();
401  const BoundPlane &stripPlane = det.surface();
402 
403  //LocalPoint glp = tsos.localPosition();
404  LocalError err = tsos.localError().positionError();
405  /*LogDebug("TkStripMeasurementDet") <<
406  "Testing local pos glued: " << glp <<
407  " local err glued: " << tsos.localError().positionError() <<
408  " in? " << gluedPlane.bounds().inside(glp) <<
409  " in(3s)? " << gluedPlane.bounds().inside(glp, err, 3.0f);*/
410 
411  GlobalVector gdir = tsos.globalParameters().momentum();
412 
413  LocalPoint slp = stripPlane.toLocal(tsos.globalPosition());
414  LocalVector sld = stripPlane.toLocal(gdir);
415 
416  double delta = stripPlane.localZ( tsos.globalPosition());
417  LocalPoint pos = slp - sld * delta/sld.z();
418 
419 
420  // now the error
421  LocalVector hitXAxis = stripPlane.toLocal( gluedPlane.toGlobal( LocalVector(1,0,0)));
422  if (stripPlane.normalVector().dot( gluedPlane.normalVector()) < 0) {
423  // the two planes are inverted, and the correlation element must change sign
424  err = LocalError( err.xx(), -err.xy(), err.yy());
425  }
426  LocalError rotatedError = err.rotate( hitXAxis.x(), hitXAxis.y());
427 
428  /* // This is probably meaningless
429  LogDebug("TkStripMeasurementDet") <<
430  "Testing local pos on strip (SLP): " << slp <<
431  " in? :" << stripPlane.bounds().inside(slp) <<
432  " in(3s)? :" << stripPlane.bounds().inside(slp, rotatedError, 3.0f);
433  // but it helps to test bugs in the formula for POS */
434  /*LogDebug("TkStripMeasurementDet") <<
435  "Testing local pos strip: " << pos <<
436  " in? " << stripPlane.bounds().inside(pos) <<
437  " in(3s)? " << stripPlane.bounds().inside(pos, rotatedError, 3.0f);*/
438 
439  // now we need to convert to MeasurementFrame
440  const StripTopology &topo = mdet.specificGeomDet().specificTopology();
441  float utraj = topo.measurementPosition(pos).x();
442  float uerr = std::sqrt(topo.measurementError(pos,rotatedError).uu());
443  return mdet.testStrips(utraj, uerr);
444 }
dbl * delta
Definition: mlp_gen.cc:36
float xx() const
Definition: LocalError.h:24
T y() const
Definition: PV3DBase.h:63
GlobalPoint globalPosition() const
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
LocalError positionError() const
const GeomDet & fastGeomDet() const
float xy() const
Definition: LocalError.h:25
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
float uu() const
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
const LocalTrajectoryError & localError() const
const GlobalTrajectoryParameters & globalParameters() const
const StripGeomDetUnit & specificGeomDet() const
bool testStrips(float utraj, float uerr) const
return true if there are &#39;enough&#39; good strips in the utraj +/- 3 uerr range.
LocalError rotate(float x, float y) const
Return a new LocalError, rotated by an angle defined by the direction (x,y)
Definition: LocalError.h:39
T x() const
Definition: PV2DBase.h:45
T x() const
Definition: PV3DBase.h:62

Member Data Documentation

const StripClusterParameterEstimator* TkGluedMeasurementDet::theCPE
private
const SiStripRecHitMatcher* TkGluedMeasurementDet::theMatcher
private

Definition at line 54 of file TkGluedMeasurementDet.h.

Referenced by collectRecHits(), measurements(), and recHits().

const TkStripMeasurementDet* TkGluedMeasurementDet::theMonoDet
private

Definition at line 56 of file TkGluedMeasurementDet.h.

Referenced by collectRecHits(), init(), measurements(), and recHits().

const TkStripMeasurementDet* TkGluedMeasurementDet::theStereoDet
private

Definition at line 57 of file TkGluedMeasurementDet.h.

Referenced by collectRecHits(), init(), measurements(), and recHits().