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) {}

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.

44  {
45  return (lowerDet()->hasBadComponents(tsos, data) || upperDet()->hasBadComponents(tsos, data));
46  }

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

◆ init()

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

Definition at line 10 of file TkStackMeasurementDet.cc.

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 }

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

Referenced by MeasurementTrackerImpl::initStackDet().

◆ 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.

36  {
37  return lowerDet()->isActive(data) && upperDet()->isActive(data);
38  }

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

Referenced by measurements(), and recHits().

◆ isEmpty()

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

Definition at line 39 of file TkStackMeasurementDet.h.

39  {
40  return data.empty(lowerDet()->index()) || data.empty(upperDet()->index());
41  }

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

Referenced by plotting.Plot::clone().

◆ lowerDet()

const TkPhase2OTMeasurementDet* TkStackMeasurementDet::lowerDet ( ) const
inline

Definition at line 32 of file TkStackMeasurementDet.h.

32 { return theLowerDet; }

References theLowerDet.

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

◆ 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.

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 }

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

◆ recHits()

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

Implements MeasurementDet.

Definition at line 20 of file TkStackMeasurementDet.cc.

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 }

References edmNew::DetSet< T >::begin(), data, HLT_FULL_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().

◆ specificGeomDet()

const StackGeomDet& TkStackMeasurementDet::specificGeomDet ( ) const
inline

Definition at line 21 of file TkStackMeasurementDet.h.

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

References MeasurementDet::fastGeomDet().

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

◆ upperDet()

const TkPhase2OTMeasurementDet* TkStackMeasurementDet::upperDet ( ) const
inline

Definition at line 33 of file TkStackMeasurementDet.h.

33 { return theUpperDet; }

References theUpperDet.

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

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().

TkStackMeasurementDet::hasBadComponents
bool hasBadComponents(const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent &data) const override
return TRUE if at least one of the lower and upper components has badChannels
Definition: TkStackMeasurementDet.h:44
Phase2TrackerCluster1D
Definition: Phase2TrackerCluster1D.h:10
MeasurementDet::RecHitContainer
TrackingRecHit::ConstRecHitContainer RecHitContainer
Definition: MeasurementDet.h:19
MeasurementDet::MeasurementDet
MeasurementDet(const GeomDet *gdet)
Definition: MeasurementDet.h:23
TkStackMeasurementDet::lowerDet
const TkPhase2OTMeasurementDet * lowerDet() const
Definition: TkStackMeasurementDet.h:32
TkStackMeasurementDet::theLowerDet
const TkPhase2OTMeasurementDet * theLowerDet
Definition: TkStackMeasurementDet.h:50
TkStackMeasurementDet::thePixelCPE
const PixelClusterParameterEstimator * thePixelCPE
Definition: TkStackMeasurementDet.h:49
F
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
MeasurementEstimator::estimate
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
DetId
Definition: DetId.h:17
MeasurementDetException
Common base class.
Definition: MeasurementDetException.h:12
TkStackMeasurementDet::const_iterator
detset::const_iterator const_iterator
Definition: TkStackMeasurementDet.h:25
TkPhase2OTMeasurementDet::isActive
bool isActive(const MeasurementTrackerEvent &data) const override
Is this module active in reconstruction? It must be both 'setActiveThisEvent' and 'setActive'.
Definition: TkPhase2OTMeasurementDet.h:69
TkStackMeasurementDet::upperDet
const TkPhase2OTMeasurementDet * upperDet() const
Definition: TkStackMeasurementDet.h:33
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
TkStackMeasurementDet::specificGeomDet
const StackGeomDet & specificGeomDet() const
Definition: TkStackMeasurementDet.h:21
TkStackMeasurementDet::isActive
bool isActive(const MeasurementTrackerEvent &data) const override
return TRUE if both lower and upper components are active
Definition: TkStackMeasurementDet.h:36
eostools.move
def move(src, dest)
Definition: eostools.py:511
TkStackMeasurementDet::recHits
RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &data) const override
Definition: TkStackMeasurementDet.cc:20
MeasurementDet::theInactiveHit
TrackingRecHit::ConstRecHitPointer theInactiveHit
Definition: MeasurementDet.h:95
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
mps_fire.result
result
Definition: mps_fire.py:311
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
MeasurementDet::fastGeomDet
const GeomDet & fastGeomDet() const
Definition: MeasurementDet.h:80
TkStackMeasurementDet::theUpperDet
const TkPhase2OTMeasurementDet * theUpperDet
Definition: TkStackMeasurementDet.h:51
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7733
TkStackMeasurementDet::detset
edmNew::DetSet< Phase2TrackerCluster1D > detset
Definition: TkStackMeasurementDet.h:24
MeasurementDet::theMissingHit
TrackingRecHit::ConstRecHitPointer theMissingHit
Definition: MeasurementDet.h:94
hit
Definition: SiStripHitEffFromCalibTree.cc:88