CMS 3D CMS Logo

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

#include <TkStackMeasurementDet.h>

Inheritance diagram for TkStackMeasurementDet:
MeasurementDet

Public Types

typedef detset::const_iterator const_iterator
 
typedef edmNew::DetSet< Phase2TrackerCluster1Ddetset
 
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

bool hasBadComponents (const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent &data) const override
 return TRUE if at least one of the lower and upper components has badChannels More...
 
void init (const MeasurementDet *lowerDet, const MeasurementDet *upperDet)
 
bool isActive (const MeasurementTrackerEvent &data) const override
 return TRUE if both lower and upper components are active More...
 
bool isEmpty (const Phase2OTMeasurementDetSet &data) const
 
const TkPhase2OTMeasurementDetlowerDet () 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 StackGeomDetspecificGeomDet () const
 
 TkStackMeasurementDet (const StackGeomDet *gdet, const PixelClusterParameterEstimator *cpe)
 
const TkPhase2OTMeasurementDetupperDet () const
 
- 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 TkPhase2OTMeasurementDettheLowerDet
 
const PixelClusterParameterEstimatorthePixelCPE
 
const TkPhase2OTMeasurementDettheUpperDet
 

Additional Inherited Members

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

Detailed Description

Definition at line 14 of file TkStackMeasurementDet.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 25 of file TkStackMeasurementDet.h.

◆ detset

Definition at line 24 of file TkStackMeasurementDet.h.

◆ Phase2TrackerCluster1DRef

Definition at line 22 of file TkStackMeasurementDet.h.

Constructor & Destructor Documentation

◆ TkStackMeasurementDet()

TkStackMeasurementDet::TkStackMeasurementDet ( const StackGeomDet gdet,
const PixelClusterParameterEstimator cpe 
)

Definition at line 7 of file TkStackMeasurementDet.cc.

8  : MeasurementDet(gdet), thePixelCPE(cpe), theLowerDet(nullptr), theUpperDet(nullptr) {}
const TkPhase2OTMeasurementDet * theLowerDet
MeasurementDet(const GeomDet *gdet)
const PixelClusterParameterEstimator * thePixelCPE
const TkPhase2OTMeasurementDet * theUpperDet

Member Function Documentation

◆ hasBadComponents()

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

return TRUE if at least one of the lower and upper components has badChannels

Implements MeasurementDet.

Definition at line 44 of file TkStackMeasurementDet.h.

References data, lowerDet(), and upperDet().

44  {
45  return (lowerDet()->hasBadComponents(tsos, data) || upperDet()->hasBadComponents(tsos, data));
46  }
bool hasBadComponents(const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent &data) const override
return TRUE if at least one of the lower and upper components has badChannels
const TkPhase2OTMeasurementDet * lowerDet() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
const TkPhase2OTMeasurementDet * upperDet() const

◆ init()

void TkStackMeasurementDet::init ( const MeasurementDet lowerDet,
const MeasurementDet upperDet 
)

Definition at line 10 of file TkStackMeasurementDet.cc.

References lowerDet(), theLowerDet, theUpperDet, and upperDet().

Referenced by MeasurementTrackerImpl::initStackDet().

10  {
11  theLowerDet = dynamic_cast<const TkPhase2OTMeasurementDet*>(lowerDet);
12  theUpperDet = dynamic_cast<const TkPhase2OTMeasurementDet*>(upperDet);
13 
14  if ((theLowerDet == nullptr) || (theUpperDet == nullptr)) {
16  "TkStackMeasurementDet ERROR: Trying to glue a det which is not a TkPhase2OTMeasurementDet");
17  }
18 }
const TkPhase2OTMeasurementDet * theLowerDet
const TkPhase2OTMeasurementDet * lowerDet() const
const TkPhase2OTMeasurementDet * upperDet() const
const TkPhase2OTMeasurementDet * theUpperDet

◆ isActive()

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

return TRUE if both lower and upper components are active

Implements MeasurementDet.

Definition at line 36 of file TkStackMeasurementDet.h.

References data, TkPhase2OTMeasurementDet::isActive(), lowerDet(), and upperDet().

Referenced by measurements(), and recHits().

36  {
37  return lowerDet()->isActive(data) && upperDet()->isActive(data);
38  }
const TkPhase2OTMeasurementDet * lowerDet() 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;...
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
const TkPhase2OTMeasurementDet * upperDet() const

◆ isEmpty()

bool TkStackMeasurementDet::isEmpty ( const Phase2OTMeasurementDetSet data) const
inline

Definition at line 39 of file TkStackMeasurementDet.h.

References data, lowerDet(), and upperDet().

Referenced by plotting.Plot::clone().

39  {
40  return data.empty(lowerDet()->index()) || data.empty(upperDet()->index());
41  }
const TkPhase2OTMeasurementDet * lowerDet() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
const TkPhase2OTMeasurementDet * upperDet() const

◆ lowerDet()

const TkPhase2OTMeasurementDet* TkStackMeasurementDet::lowerDet ( ) const
inline

Definition at line 32 of file TkStackMeasurementDet.h.

References theLowerDet.

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

32 { return theLowerDet; }
const TkPhase2OTMeasurementDet * theLowerDet

◆ measurements()

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

Implements MeasurementDet.

Definition at line 100 of file TkStackMeasurementDet.cc.

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

103  {
104  LogDebug("MeasurementTracker") << "TkStackMeasurementDet::measurements";
105 
106  if (!isActive(data)) {
107  result.add(theInactiveHit, 0.F);
108  return true;
109  }
110 
111  LogTrace("MeasurementTracker") << " is active";
112 
113  auto oldSize = result.size();
114  MeasurementDet::RecHitContainer&& allHits = recHits(stateOnThisDet, data);
115 
116  for (auto&& hit : allHits) {
117  std::pair<bool, double> diffEst = est.estimate(stateOnThisDet, *hit);
118  if (diffEst.first) {
119  LogDebug("MeasurementTracker") << "New vh added with chi2: " << diffEst.second;
120  result.add(std::move(hit), diffEst.second);
121  }
122  }
123 
124  if (result.size() > oldSize)
125  return true;
126 
127  // create a TrajectoryMeasurement with an invalid RecHit and zero estimate
128  result.add(theMissingHit, 0.F);
129  LogDebug("MeasurementTracker") << "adding missing hit";
130  return false;
131 }
#define LogTrace(id)
TrackingRecHit::ConstRecHitPointer theMissingHit
bool isActive(const MeasurementTrackerEvent &data) const override
return TRUE if both lower and upper components are active
RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data) const override
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
TrackingRecHit::ConstRecHitPointer theInactiveHit
TrackingRecHit::ConstRecHitContainer RecHitContainer
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

◆ recHits()

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

Implements MeasurementDet.

Definition at line 20 of file TkStackMeasurementDet.cc.

References edmNew::DetSet< T >::begin(), data, HLT_2022v15_cff::distance, edmNew::DetSet< T >::empty(), edmNew::DetSet< T >::end(), GeomDet::geographicalId(), isActive(), LogTrace, lowerDet(), edmNew::DetSet< T >::offset(), mps_fire::result, edmNew::DetSet< T >::size(), specificGeomDet(), and upperDet().

Referenced by measurements().

21  {
23 
24  if (data.phase2OTVectorHits().empty())
25  return result;
26  LogTrace("MeasurementTracker") << " is not empty";
27  if (!isActive(data))
28  return result;
29  LogTrace("MeasurementTracker") << " and is active";
30 
31  //find clusters to skip
32  const detset& lowerDetSet = data.phase2OTData().detSet(lowerDet()->index());
33  const detset& upperDetSet = data.phase2OTData().detSet(upperDet()->index());
34  std::vector<bool> skipClustersUpper(data.phase2OTClustersToSkip().empty() ? 0 : upperDetSet.size(), false);
35  std::vector<bool> skipClustersLower(data.phase2OTClustersToSkip().empty() ? 0 : lowerDetSet.size(), false);
36 
37  const Phase2TrackerCluster1D* begin = nullptr;
38  if (!data.phase2OTData().handle()->data().empty()) {
39  begin = &(data.phase2OTData().handle()->data().front());
40  }
41  if (!data.phase2OTClustersToSkip().empty()) {
42  if (!lowerDetSet.empty()) {
43  for (const_iterator cil = lowerDetSet.begin(); cil != lowerDetSet.end(); ++cil) {
44  if (cil < begin) {
45  edm::LogError("IndexMisMatch") << "TkStackMeasurementDet cannot create hit because of index mismatch.";
46  return result;
47  }
48  unsigned int indexl = cil - begin;
49  if (data.phase2OTClustersToSkip()[indexl]) {
50  int iLocalL = std::distance(lowerDetSet.begin(), cil);
51  skipClustersLower[iLocalL] = true;
52  }
53  }
54  }
55  if (!upperDetSet.empty()) {
56  for (const_iterator ciu = upperDetSet.begin(); ciu != upperDetSet.end(); ++ciu) {
57  if (ciu < begin) {
58  edm::LogError("IndexMisMatch") << "TkStackMeasurementDet cannot create hit because of index mismatch.";
59  return result;
60  }
61  unsigned int indexu = ciu - begin;
62  if (data.phase2OTClustersToSkip()[indexu]) {
63  int iLocalU = std::distance(upperDetSet.begin(), ciu);
64  skipClustersUpper[iLocalU] = true;
65  }
66  }
67  }
68  }
69  DetId detIdStack = specificGeomDet().geographicalId();
70 
71  auto iterator = data.phase2OTVectorHits().find(detIdStack);
72  if (iterator == data.phase2OTVectorHits().end())
73  return result;
74  for (const auto& vecHit : data.phase2OTVectorHits()[detIdStack]) {
75  if (!data.phase2OTClustersToSkip().empty()) {
76  if (skipClustersLower[vecHit.lowerCluster().key() - lowerDetSet.offset()])
77  continue;
78  if (skipClustersUpper[vecHit.upperCluster().key() - upperDetSet.offset()])
79  continue;
80  }
81  result.push_back(std::make_shared<VectorHit>(vecHit));
82  }
83 
84  iterator = data.phase2OTVectorHitsRej().find(detIdStack);
85  if (iterator == data.phase2OTVectorHitsRej().end())
86  return result;
87  for (const auto& vecHit : data.phase2OTVectorHitsRej()[detIdStack]) {
88  if (!data.phase2OTClustersToSkip().empty()) {
89  if (skipClustersLower[vecHit.lowerCluster().key() - lowerDetSet.offset()])
90  continue;
91  if (skipClustersUpper[vecHit.upperCluster().key() - upperDetSet.offset()])
92  continue;
93  }
94  result.push_back(std::make_shared<VectorHit>(vecHit));
95  }
96 
97  return result;
98 }
Log< level::Error, false > LogError
const TkPhase2OTMeasurementDet * lowerDet() const
#define LogTrace(id)
bool isActive(const MeasurementTrackerEvent &data) const override
return TRUE if both lower and upper components are active
edmNew::DetSet< Phase2TrackerCluster1D > detset
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
Definition: DetId.h:17
detset::const_iterator const_iterator
TrackingRecHit::ConstRecHitContainer RecHitContainer
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
const TkPhase2OTMeasurementDet * upperDet() const
const StackGeomDet & specificGeomDet() const

◆ specificGeomDet()

const StackGeomDet& TkStackMeasurementDet::specificGeomDet ( ) const
inline

Definition at line 21 of file TkStackMeasurementDet.h.

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

Referenced by MeasurementTrackerImpl::initStackDet(), and recHits().

21 { return static_cast<StackGeomDet const&>(fastGeomDet()); }
const GeomDet & fastGeomDet() const

◆ upperDet()

const TkPhase2OTMeasurementDet* TkStackMeasurementDet::upperDet ( ) const
inline

Definition at line 33 of file TkStackMeasurementDet.h.

References theUpperDet.

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

33 { return theUpperDet; }
const TkPhase2OTMeasurementDet * theUpperDet

Member Data Documentation

◆ theLowerDet

const TkPhase2OTMeasurementDet* TkStackMeasurementDet::theLowerDet
private

Definition at line 50 of file TkStackMeasurementDet.h.

Referenced by init(), and lowerDet().

◆ thePixelCPE

const PixelClusterParameterEstimator* TkStackMeasurementDet::thePixelCPE
private

Definition at line 49 of file TkStackMeasurementDet.h.

◆ theUpperDet

const TkPhase2OTMeasurementDet* TkStackMeasurementDet::theUpperDet
private

Definition at line 51 of file TkStackMeasurementDet.h.

Referenced by init(), and upperDet().