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 69 of file TkGluedMeasurementDet.cc.

71  :
72  MeasurementDet(gdet),
73  theMatcher(matcher), theCPE(cpe),
74  theMonoDet(nullptr), theStereoDet(nullptr)
75 {}
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 333 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().

336 {
337  auto && vl = projectedPos(hit, det, ts.globalParameters().momentum(), theCPE);
338  ProjectedSiStripRecHit2D projectedHit(vl.first,vl.second, det, static_cast<SiStripRecHit2D const &>(hit));
339 
340  RecHitPropagator prop;
341  TrajectoryStateOnSurface propState = prop.propagate( hit, det.surface(), ts);
342 
343  if ((projectedHit.localPosition()-propState.localPosition()).mag() > 0.0001f) {
344  std::cout << "PROBLEM: projected and propagated hit positions differ by "
345  << (projectedHit.localPosition()-propState.localPosition()).mag() << std::endl;
346  }
347 
348  LocalError le1 = projectedHit.localPositionError();
349  LocalError le2 = propState.localError().positionError();
350  double eps = 1.e-5;
351  double cutoff = 1.e-4; // if element below cutoff, use absolute instead of relative accuracy
352  double maxdiff = std::max( std::max( fabs(le1.xx() - le2.xx())/(cutoff+le1.xx()),
353  fabs(le1.xy() - le2.xy())/(cutoff+fabs(le1.xy()))),
354  fabs(le1.yy() - le2.yy())/(cutoff+le1.xx()));
355  if (maxdiff > eps) {
356  std::cout << "PROBLEM: projected and propagated hit errors differ by "
357  << maxdiff << std::endl;
358  }
359 
360 }
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 321 of file TkGluedMeasurementDet.cc.

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

324 {
325  for (RecHitContainer::const_iterator i=monoHits.begin(); i != monoHits.end(); ++i) {
326  checkHitProjection( **i, ts, fastGeomDet());
327  }
328  for (RecHitContainer::const_iterator i=stereoHits.begin(); i != stereoHits.end(); ++i) {
329  checkHitProjection( **i, ts, fastGeomDet());
330  }
331 }
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 171 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().

172 {
173  //------ WARNING: here ts is used as it is on the mono/stereo surface.
174  //----- A further propagation is necessary.
175  //----- To limit the problem, the SimpleCPE should be used
176  RecHitContainer monoHits = theMonoDet->recHits( ts, data );
177  GlobalVector glbDir = (ts.isValid() ? ts.globalParameters().momentum() : position()-GlobalPoint(0,0,0));
178 
179  //edm::LogWarning("TkGluedMeasurementDet::recHits") << "Query-for-detid-" << theGeomDet->geographicalId().rawId();
180 
181  //checkProjection(ts, monoHits, stereoHits);
182 
183  if (monoHits.empty()) {
184  // make stereo TTRHs and project them
185  projectOnGluedDet( collector, theStereoDet->recHits(ts, data), glbDir);
186  } else {
187  // collect simple stereo hits
188  std::vector<SiStripRecHit2D> simpleSteroHitsByValue;
189  theStereoDet->simpleRecHits(ts, data, simpleSteroHitsByValue);
190 
191  if (simpleSteroHitsByValue.empty()) {
192  projectOnGluedDet( collector, monoHits, glbDir);
193  } else {
194 
195  LocalVector tkDir = (ts.isValid() ? ts.localDirection() : surface().toLocal( position()-GlobalPoint(0,0,0)));
197  vsStereoHits.resize(simpleSteroHitsByValue.size());
198  std::transform(simpleSteroHitsByValue.begin(), simpleSteroHitsByValue.end(), vsStereoHits.begin(), take_address());
199 
200  // convert mono hits to type expected by matcher
201  for (RecHitContainer::const_iterator monoHit = monoHits.begin();
202  monoHit != monoHits.end(); ++monoHit) {
203  const TrackingRecHit* tkhit = (**monoHit).hit();
204  const SiStripRecHit2D* verySpecificMonoHit = reinterpret_cast<const SiStripRecHit2D*>(tkhit);
205  theMatcher->match( verySpecificMonoHit, vsStereoHits.begin(), vsStereoHits.end(),
206  collector.collector(), &specificGeomDet(), tkDir);
207 
208  if (collector.hasNewMatchedHits()) {
209  collector.clearNewMatchedHitsFlag();
210  } else {
211  collector.addProjected( **monoHit, glbDir );
212  }
213  } // loop on mono hit
214  }
215  //GIO// std::cerr << "TkGluedMeasurementDet hits " << monoHits.size() << "/" << stereoHits.size() << " => " << result.size() << std::endl;
216  }
217 }
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
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
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 77 of file TkGluedMeasurementDet.cc.

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

Referenced by MeasurementTrackerImpl::initGluedDet().

78  {
79  theMonoDet = dynamic_cast<const TkStripMeasurementDet *>(monoDet);
80  theStereoDet = dynamic_cast<const TkStripMeasurementDet *>(stereoDet);
81 
82  if ((theMonoDet == 0) || (theStereoDet == 0)) {
83  throw MeasurementDetException("TkGluedMeasurementDet ERROR: Trying to glue a det which is not a TkStripMeasurementDet");
84  }
85 }
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 114 of file TkGluedMeasurementDet.cc.

References tracking::TempMeasurements::add(), collectRecHits(), F(), MeasurementDet::fastGeomDet(), MeasurementDet::geomDet(), TkStripMeasurementDet::hasAllGoodChannels(), TrajectoryStateOnSurface::hasError(), TkStripMeasurementDet::isActive(), tracking::TempMeasurements::size(), GeomDet::surface(), testStrips(), theCPE, MeasurementDet::theInactiveHit, theMatcher, MeasurementDet::theMissingHit, theMonoDet, theStereoDet, and unlikely.

117  {
118 
120  // LogDebug("TkStripMeasurementDet") << " DetID " << geomDet().geographicalId().rawId() << " (glued) fully inactive";
121  result.add(theInactiveHit, 0.F);
122  return true;
123  }
124 
125  auto oldSize = result.size();
126 
127  HitCollectorForFastMeasurements collector( &fastGeomDet(), theMatcher, theCPE, stateOnThisDet, est, result);
128  collectRecHits(stateOnThisDet, data, collector);
129 
130 
131  if (result.size()>oldSize) return true;
132 
133  //LogDebug("TkStripMeasurementDet") << "No hit found on TkGlued. Testing strips... ";
134  const BoundPlane &gluedPlane = geomDet().surface();
135  if ( // sorry for the big IF, but I want to exploit short-circuiting of logic
136  stateOnThisDet.hasError() && ( /* do this only if the state has uncertainties, otherwise it will throw
137  (states without uncertainties are passed to this code from seeding */
138  (theMonoDet->isActive(data) &&
140  testStrips(stateOnThisDet,gluedPlane,*theMonoDet)
141  )
142  ) /*Mono OK*/ ||
143  (theStereoDet->isActive(data) &&
145  testStrips(stateOnThisDet,gluedPlane,*theStereoDet)
146  )
147  ) /*Stereo OK*/
148  ) /* State has errors */
149  ) {
150  result.add(theMissingHit, 0.F);
151  return false;
152  }
153  result.add(theInactiveHit, 0.F);
154  return true;
155 
156 }
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
virtual const GeomDet & geomDet() const
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)
bool hasAllGoodChannels() const
does this module have at least one bad strip, APV or channel?
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
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
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 295 of file TkGluedMeasurementDet.cc.

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

Referenced by collectRecHits().

297 {
299  for ( auto const & hit : hits) {
300  auto && vl = projectedPos(hit, fastGeomDet(), ts.globalParameters().momentum(), theCPE);
301  auto && phit = std::make_shared<ProjectedSiStripRecHit2D> (vl.first,vl.second,fastGeomDet(), static_cast<SiStripRecHit2D const &>(hit));
302  result.push_back(std::move(phit));
303  }
304  return result;
305 }
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 271 of file TkGluedMeasurementDet.cc.

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

273 {
275  for ( auto const & hit : hits) {
276  auto && vl = projectedPos(*hit, fastGeomDet(), ts.globalParameters().momentum(), theCPE);
277  auto && phit = std::make_shared<ProjectedSiStripRecHit2D> (vl.first,vl.second, fastGeomDet(), static_cast<SiStripRecHit2D const &>(*hit));
278  result.push_back(std::move(phit));
279  }
280  return result;
281 }
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 285 of file TkGluedMeasurementDet.cc.

288 {
289  for ( RecHitContainer::const_iterator ihit = hits.begin(); ihit!=hits.end(); ihit++) {
290  collector.addProjected( **ihit, gdir );
291  }
292 }
template<typename Collector >
void TkGluedMeasurementDet::projectOnGluedDet ( Collector &  collector,
std::vector< SiStripRecHit2D > const &  hits,
const GlobalVector gdir 
) const

Definition at line 309 of file TkGluedMeasurementDet.cc.

312 {
313  for ( auto const & hit : hits)
314  collector.addProjected(hit, gdir );
315 }
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 88 of file TkGluedMeasurementDet.cc.

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

89 {
90 
92  HitCollectorForRecHits collector( &fastGeomDet(), theMatcher, theCPE, result );
93  collectRecHits(ts, data, collector);
94  return result;
95 }
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
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
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 99 of file TkGluedMeasurementDet.cc.

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

101  {
103  auto oldSize = result.size();
104  HitCollectorForSimpleHits collector( &fastGeomDet(), theMatcher, theCPE, stateOnThisDet, est, result);
105  collectRecHits(stateOnThisDet, data, collector);
106 
107  return result.size()>oldSize;
108 
109 }
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
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
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 363 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().

365  {
366  // from TrackingRecHitProjector
367  const GeomDet &det = mdet.fastGeomDet();
368  const BoundPlane &stripPlane = det.surface();
369 
370  //LocalPoint glp = tsos.localPosition();
371  LocalError err = tsos.localError().positionError();
372  /*LogDebug("TkStripMeasurementDet") <<
373  "Testing local pos glued: " << glp <<
374  " local err glued: " << tsos.localError().positionError() <<
375  " in? " << gluedPlane.bounds().inside(glp) <<
376  " in(3s)? " << gluedPlane.bounds().inside(glp, err, 3.0f);*/
377 
378  GlobalVector gdir = tsos.globalParameters().momentum();
379 
380  LocalPoint slp = stripPlane.toLocal(tsos.globalPosition());
381  LocalVector sld = stripPlane.toLocal(gdir);
382 
383  double delta = stripPlane.localZ( tsos.globalPosition());
384  LocalPoint pos = slp - sld * delta/sld.z();
385 
386 
387  // now the error
388  LocalVector hitXAxis = stripPlane.toLocal( gluedPlane.toGlobal( LocalVector(1,0,0)));
389  if (stripPlane.normalVector().dot( gluedPlane.normalVector()) < 0) {
390  // the two planes are inverted, and the correlation element must change sign
391  err = LocalError( err.xx(), -err.xy(), err.yy());
392  }
393  LocalError rotatedError = err.rotate( hitXAxis.x(), hitXAxis.y());
394 
395  /* // This is probably meaningless
396  LogDebug("TkStripMeasurementDet") <<
397  "Testing local pos on strip (SLP): " << slp <<
398  " in? :" << stripPlane.bounds().inside(slp) <<
399  " in(3s)? :" << stripPlane.bounds().inside(slp, rotatedError, 3.0f);
400  // but it helps to test bugs in the formula for POS */
401  /*LogDebug("TkStripMeasurementDet") <<
402  "Testing local pos strip: " << pos <<
403  " in? " << stripPlane.bounds().inside(pos) <<
404  " in(3s)? " << stripPlane.bounds().inside(pos, rotatedError, 3.0f);*/
405 
406  // now we need to convert to MeasurementFrame
407  const StripTopology &topo = mdet.specificGeomDet().specificTopology();
408  float utraj = topo.measurementPosition(pos).x();
409  float uerr = std::sqrt(topo.measurementError(pos,rotatedError).uu());
410  return mdet.testStrips(utraj, uerr);
411 }
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().