CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
TkDoubleSensMeasurementDet Class Referencefinal

#include <TkDoubleSensMeasurementDet.h>

Inheritance diagram for TkDoubleSensMeasurementDet:
MeasurementDet

Public Types

typedef detset::const_iterator const_iterator
 
typedef edmNew::DetSet< SiPixelClusterdetset
 
typedef edm::Ref< edmNew::DetSetVector< Phase2TrackerCluster1D >, Phase2TrackerCluster1DPhase2TrackerCluster1DRef
 
- Public Types inherited from MeasurementDet
typedef TrackingRecHit::ConstRecHitContainer RecHitContainer
 
using SimpleHitContainer = std::vector< BaseTrackerRecHit * >
 
typedef tracking::TempMeasurements TempMeasurements
 

Public Member Functions

const TkPixelMeasurementDetfirstDet () const
 
bool hasBadComponents (const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent &data) const override
 return TRUE if at least one of the first and second components has badChannels More...
 
void init (const MeasurementDet *firstDet, const MeasurementDet *secondDet)
 
bool isActive (const MeasurementTrackerEvent &data) const override
 return TRUE if both first and second components are active More...
 
bool isEmpty (const PxMeasurementDetSet &data) const
 
bool measurements (const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, const MeasurementTrackerEvent &data, TempMeasurements &result) const override
 
RecHitContainer recHits (const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data) const override
 
const TkPixelMeasurementDetsecondDet () const
 
const DoubleSensGeomDetspecificGeomDet () const
 
 TkDoubleSensMeasurementDet (const DoubleSensGeomDet *gdet, const PixelClusterParameterEstimator *cpe)
 
- Public Member Functions inherited from MeasurementDet
const GeomDetfastGeomDet () const
 
std::vector< TrajectoryMeasurementfastMeasurements (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
 
virtual bool recHits (SimpleHitContainer &result, const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &, const MeasurementTrackerEvent &data) const
 
const Surfacesurface () const
 
virtual ~MeasurementDet ()=default
 

Private Attributes

const TkPixelMeasurementDettheFirstDet
 
const PixelClusterParameterEstimatorthePixelCPE
 
const TkPixelMeasurementDettheSecondDet
 

Additional Inherited Members

- Protected Attributes inherited from MeasurementDet
TrackingRecHit::ConstRecHitPointer theInactiveHit
 
TrackingRecHit::ConstRecHitPointer theMissingHit
 

Detailed Description

Definition at line 13 of file TkDoubleSensMeasurementDet.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 25 of file TkDoubleSensMeasurementDet.h.

◆ detset

Definition at line 24 of file TkDoubleSensMeasurementDet.h.

◆ Phase2TrackerCluster1DRef

Definition at line 22 of file TkDoubleSensMeasurementDet.h.

Constructor & Destructor Documentation

◆ TkDoubleSensMeasurementDet()

TkDoubleSensMeasurementDet::TkDoubleSensMeasurementDet ( const DoubleSensGeomDet gdet,
const PixelClusterParameterEstimator cpe 
)

Definition at line 7 of file TkDoubleSensMeasurementDet.cc.

9  : MeasurementDet(gdet), thePixelCPE(cpe), theFirstDet(nullptr), theSecondDet(nullptr) {}
MeasurementDet(const GeomDet *gdet)
const TkPixelMeasurementDet * theFirstDet
const PixelClusterParameterEstimator * thePixelCPE
const TkPixelMeasurementDet * theSecondDet

Member Function Documentation

◆ firstDet()

const TkPixelMeasurementDet* TkDoubleSensMeasurementDet::firstDet ( ) const
inline

Definition at line 32 of file TkDoubleSensMeasurementDet.h.

References theFirstDet.

Referenced by hasBadComponents(), init(), isActive(), isEmpty(), and recHits().

32 { return theFirstDet; }
const TkPixelMeasurementDet * theFirstDet

◆ hasBadComponents()

bool TkDoubleSensMeasurementDet::hasBadComponents ( const TrajectoryStateOnSurface tsos,
const MeasurementTrackerEvent data 
) const
inlineoverridevirtual

return TRUE if at least one of the first and second components has badChannels

Implements MeasurementDet.

Definition at line 44 of file TkDoubleSensMeasurementDet.h.

References data, firstDet(), and secondDet().

44  {
45  return (firstDet()->hasBadComponents(tsos, data) || secondDet()->hasBadComponents(tsos, data));
46  }
const TkPixelMeasurementDet * secondDet() const
const TkPixelMeasurementDet * firstDet() const
bool hasBadComponents(const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent &data) const override
return TRUE if at least one of the first and second components has badChannels
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ init()

void TkDoubleSensMeasurementDet::init ( const MeasurementDet firstDet,
const MeasurementDet secondDet 
)

Definition at line 11 of file TkDoubleSensMeasurementDet.cc.

References firstDet(), secondDet(), theFirstDet, and theSecondDet.

Referenced by MeasurementTrackerImpl::initDoubleSensDet().

11  {
12  theFirstDet = dynamic_cast<const TkPixelMeasurementDet*>(firstDet);
13  theSecondDet = dynamic_cast<const TkPixelMeasurementDet*>(secondDet);
14 
15  if ((theFirstDet == nullptr) || (theSecondDet == nullptr)) {
17  "TkDoubleSensMeasurementDet ERROR: Trying to glue a det which is not a TkPixelMeasurementDet");
18  }
19 }
const TkPixelMeasurementDet * secondDet() const
const TkPixelMeasurementDet * theFirstDet
const TkPixelMeasurementDet * firstDet() const
const TkPixelMeasurementDet * theSecondDet

◆ isActive()

bool TkDoubleSensMeasurementDet::isActive ( const MeasurementTrackerEvent data) const
inlineoverridevirtual

return TRUE if both first and second components are active

Implements MeasurementDet.

Definition at line 36 of file TkDoubleSensMeasurementDet.h.

References data, firstDet(), TkPixelMeasurementDet::isActive(), and secondDet().

Referenced by measurements(), and recHits().

36  {
37  return firstDet()->isActive(data) && secondDet()->isActive(data);
38  }
const TkPixelMeasurementDet * secondDet() const
bool isActive(const MeasurementTrackerEvent &data) const override
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
const TkPixelMeasurementDet * firstDet() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ isEmpty()

bool TkDoubleSensMeasurementDet::isEmpty ( const PxMeasurementDetSet data) const
inline

Definition at line 39 of file TkDoubleSensMeasurementDet.h.

References data, firstDet(), and secondDet().

Referenced by plotting.Plot::clone().

39  {
40  return data.empty(firstDet()->index()) || data.empty(secondDet()->index());
41  }
const TkPixelMeasurementDet * secondDet() const
const TkPixelMeasurementDet * firstDet() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ measurements()

bool TkDoubleSensMeasurementDet::measurements ( const TrajectoryStateOnSurface stateOnThisDet,
const MeasurementEstimator est,
const MeasurementTrackerEvent data,
TempMeasurements result 
) const
overridevirtual

Implements MeasurementDet.

Definition at line 74 of file TkDoubleSensMeasurementDet.cc.

References data, MeasurementEstimator::estimate(), F(), isActive(), LogDebug, LogTrace, eostools::move(), recHits(), mps_fire::result, MeasurementDet::theInactiveHit, and MeasurementDet::theMissingHit.

77  {
78  LogDebug("MeasurementTracker") << "TkDoubleSensMeasurementDet::measurements";
79 
80  if (!isActive(data)) {
81  result.add(theInactiveHit, 0.F);
82  return true;
83  }
84 
85  LogTrace("MeasurementTracker") << " is active";
86 
87  auto oldSize = result.size();
88  MeasurementDet::RecHitContainer&& allHits = recHits(stateOnThisDet, data);
89 
90  for (auto&& hit : allHits) {
91  std::pair<bool, double> diffEst = est.estimate(stateOnThisDet, *hit);
92  if (diffEst.first) {
93  LogDebug("MeasurementTracker") << "New vh added with chi2: " << diffEst.second;
94  result.add(std::move(hit), diffEst.second);
95  }
96  }
97 
98  if (result.size() > oldSize)
99  return true;
100 
101  // create a TrajectoryMeasurement with an invalid RecHit and zero estimate
102  result.add(theMissingHit, 0.F);
103  LogDebug("MeasurementTracker") << "adding missing hit";
104  return false;
105 }
#define LogTrace(id)
TrackingRecHit::ConstRecHitPointer theMissingHit
bool isActive(const MeasurementTrackerEvent &data) const override
return TRUE if both first and second components are active
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data) const override
TrackingRecHit::ConstRecHitPointer theInactiveHit
TrackingRecHit::ConstRecHitContainer RecHitContainer
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

◆ recHits()

TkDoubleSensMeasurementDet::RecHitContainer TkDoubleSensMeasurementDet::recHits ( const TrajectoryStateOnSurface ts,
const MeasurementTrackerEvent data 
) const
overridevirtual

Implements MeasurementDet.

Definition at line 21 of file TkDoubleSensMeasurementDet.cc.

References edmNew::DetSet< T >::begin(), data, HLT_2024v13_cff::distance, edmNew::DetSet< T >::empty(), edmNew::DetSet< T >::end(), firstDet(), isActive(), LogTrace, mps_fire::result, secondDet(), and edmNew::DetSet< T >::size().

Referenced by measurements().

22  {
24 
25  if (data.pixelData().handle()->data().empty())
26  return result;
27  LogTrace("MeasurementTracker") << " is not empty";
28  if (!isActive(data))
29  return result;
30  LogTrace("MeasurementTracker") << " and is active";
31 
32  //find clusters to skip
33  const detset& firstDetSet = data.pixelData().detSet(firstDet()->index());
34  const detset& secondDetSet = data.pixelData().detSet(secondDet()->index());
35  std::vector<bool> skipClustersUpper(data.pixelClustersToSkip().empty() ? 0 : secondDetSet.size(), false);
36  std::vector<bool> skipClustersLower(data.pixelClustersToSkip().empty() ? 0 : firstDetSet.size(), false);
37 
38  const SiPixelCluster* begin = nullptr;
39  if (!data.pixelData().handle()->data().empty()) {
40  begin = &(data.pixelData().handle()->data().front());
41  }
42  if (!data.pixelClustersToSkip().empty()) {
43  if (!firstDetSet.empty()) {
44  for (const_iterator cil = firstDetSet.begin(); cil != firstDetSet.end(); ++cil) {
45  if (cil < begin) {
46  edm::LogError("IndexMisMatch") << "TkDoubleSensMeasurementDet cannot create hit because of index mismatch.";
47  return result;
48  }
49  unsigned int indexl = cil - begin;
50  if (data.pixelClustersToSkip()[indexl]) {
51  int iLocalL = std::distance(firstDetSet.begin(), cil);
52  skipClustersLower[iLocalL] = true;
53  }
54  }
55  }
56  if (!secondDetSet.empty()) {
57  for (const_iterator ciu = secondDetSet.begin(); ciu != secondDetSet.end(); ++ciu) {
58  if (ciu < begin) {
59  edm::LogError("IndexMisMatch") << "TkDoubleSensMeasurementDet cannot create hit because of index mismatch.";
60  return result;
61  }
62  unsigned int indexu = ciu - begin;
63  if (data.pixelClustersToSkip()[indexu]) {
64  int iLocalU = std::distance(secondDetSet.begin(), ciu);
65  skipClustersUpper[iLocalU] = true;
66  }
67  }
68  }
69  }
70 
71  return result;
72 }
const TkPixelMeasurementDet * secondDet() const
Log< level::Error, false > LogError
#define LogTrace(id)
bool isActive(const MeasurementTrackerEvent &data) const override
return TRUE if both first and second components are active
const TkPixelMeasurementDet * firstDet() const
detset::const_iterator const_iterator
edmNew::DetSet< SiPixelCluster > detset
TrackingRecHit::ConstRecHitContainer RecHitContainer
Pixel cluster – collection of neighboring pixels above threshold.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ secondDet()

const TkPixelMeasurementDet* TkDoubleSensMeasurementDet::secondDet ( ) const
inline

Definition at line 33 of file TkDoubleSensMeasurementDet.h.

References theSecondDet.

Referenced by hasBadComponents(), init(), isActive(), isEmpty(), and recHits().

33 { return theSecondDet; }
const TkPixelMeasurementDet * theSecondDet

◆ specificGeomDet()

const DoubleSensGeomDet& TkDoubleSensMeasurementDet::specificGeomDet ( ) const
inline

Member Data Documentation

◆ theFirstDet

const TkPixelMeasurementDet* TkDoubleSensMeasurementDet::theFirstDet
private

Definition at line 50 of file TkDoubleSensMeasurementDet.h.

Referenced by firstDet(), and init().

◆ thePixelCPE

const PixelClusterParameterEstimator* TkDoubleSensMeasurementDet::thePixelCPE
private

Definition at line 49 of file TkDoubleSensMeasurementDet.h.

◆ theSecondDet

const TkPixelMeasurementDet* TkDoubleSensMeasurementDet::theSecondDet
private

Definition at line 51 of file TkDoubleSensMeasurementDet.h.

Referenced by init(), and secondDet().