CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MkFitGeometry Class Reference

#include <MkFitGeometry.h>

Public Member Functions

const std::vector< const DetLayer * > & detLayers () const
 
mkfit::IterationsInfo const & iterationsInfo () const
 
mkfit::LayerNumberConverter const & layerNumberConverter () const
 
 MkFitGeometry (const TrackerGeometry &geom, const GeometricSearchTracker &tracker, const TrackerTopology &ttopo, std::unique_ptr< mkfit::TrackerInfo > trackerInfo, std::unique_ptr< mkfit::IterationsInfo > iterationsInfo)
 
int mkFitLayerNumber (DetId detId) const
 
const TrackerTopologytopology () const
 
mkfit::TrackerInfo const & trackerInfo () const
 
unsigned int uniqueIdInLayer (int layer, unsigned int detId) const
 
 ~MkFitGeometry ()
 

Private Attributes

std::vector< std::unordered_map< unsigned int, unsigned int > > detIdToShortId_
 
std::vector< const DetLayer * > dets_
 
std::unique_ptr< mkfit::IterationsInfo > iterationsInfo_
 
std::unique_ptr< mkfit::LayerNumberConverter > lnc_
 
std::unique_ptr< mkfit::TrackerInfo > trackerInfo_
 
const TrackerTopologyttopo_
 

Detailed Description

Collection of geometry-related objects for mkFit

Definition at line 24 of file MkFitGeometry.h.

Constructor & Destructor Documentation

◆ MkFitGeometry()

MkFitGeometry::MkFitGeometry ( const TrackerGeometry geom,
const GeometricSearchTracker tracker,
const TrackerTopology ttopo,
std::unique_ptr< mkfit::TrackerInfo >  trackerInfo,
std::unique_ptr< mkfit::IterationsInfo >  iterationsInfo 
)
explicit

Definition at line 18 of file MkFitGeometry.cc.

23  : ttopo_(&ttopo),
24  lnc_{std::make_unique<mkfit::LayerNumberConverter>(mkfit::TkLayout::phase1)},
27  if (geom.numberOfLayers(PixelSubdetector::PixelBarrel) != 4 ||
28  geom.numberOfLayers(PixelSubdetector::PixelEndcap) != 3) {
29  throw cms::Exception("Assert") << "For now this code works only with phase1 tracker, you have something else";
30  }
31 
32  // Create DetLayer structure
33  dets_.resize(lnc_->nLayers(), nullptr);
34  auto setDet = [this](const int subdet, const int layer, const int isStereo, const DetId& detId, const DetLayer* lay) {
35  const int index = lnc_->convertLayerNumber(subdet, layer, false, isStereo, isPlusSide(*ttopo_, detId));
36  if (index < 0 or static_cast<unsigned>(index) >= dets_.size()) {
37  throw cms::Exception("LogicError") << "Invalid mkFit layer index " << index << " for DetId " << detId.rawId()
38  << " subdet " << subdet << " layer " << layer << " isStereo " << isStereo;
39  }
40  dets_[index] = lay;
41  };
42  constexpr int monoLayer = 0;
43  constexpr int stereoLayer = 1;
44  for (const DetLayer* lay : tracker.allLayers()) {
45  const auto& comp = lay->basicComponents();
46  if (UNLIKELY(comp.empty())) {
47  throw cms::Exception("LogicError") << "Got a tracker layer (subdet " << lay->subDetector()
48  << ") with empty basicComponents.";
49  }
50  // First component is enough for layer and side information
51  const auto& detId = comp.front()->geographicalId();
52  const auto subdet = detId.subdetId();
53  const auto layer = ttopo.layer(detId);
54 
55  // TODO: mono/stereo structure is still hardcoded for phase0/1 strip tracker
56  setDet(subdet, layer, monoLayer, detId, lay);
57  if (((subdet == StripSubdetector::TIB or subdet == StripSubdetector::TOB) and (layer == 1 or layer == 2)) or
58  subdet == StripSubdetector::TID or subdet == StripSubdetector::TEC) {
59  setDet(subdet, layer, stereoLayer, detId, lay);
60  }
61  }
62 
63  // Create "short id" aka "unique id within layer"
64  detIdToShortId_.resize(lnc_->nLayers());
65  for (const auto& detId : geom.detIds()) {
66  const auto ilay = mkFitLayerNumber(detId);
67  auto& map = detIdToShortId_[ilay];
68  const unsigned int ind = map.size();
69  // Make sure the short id fits in the 12 bits...
70  assert(ind < (int)1 << 11);
71  map[detId.rawId()] = ind;
72  }
73 }

References PVValHelper::phase1.

◆ ~MkFitGeometry()

MkFitGeometry::~MkFitGeometry ( )

Definition at line 77 of file MkFitGeometry.cc.

77 {}

Member Function Documentation

◆ detLayers()

const std::vector<const DetLayer*>& MkFitGeometry::detLayers ( ) const
inline

Definition at line 37 of file MkFitGeometry.h.

37 { return dets_; }

References dets_.

◆ iterationsInfo()

mkfit::IterationsInfo const& MkFitGeometry::iterationsInfo ( ) const
inline

Definition at line 36 of file MkFitGeometry.h.

36 { return *iterationsInfo_; }

References iterationsInfo_.

◆ layerNumberConverter()

mkfit::LayerNumberConverter const& MkFitGeometry::layerNumberConverter ( ) const
inline

Definition at line 34 of file MkFitGeometry.h.

34 { return *lnc_; }

References lnc_.

Referenced by MkFitSeedConverter::convertSeeds().

◆ mkFitLayerNumber()

int MkFitGeometry::mkFitLayerNumber ( DetId  detId) const

Definition at line 79 of file MkFitGeometry.cc.

79  {
80  return lnc_->convertLayerNumber(
81  detId.subdetId(), ttopo_->layer(detId), false, ttopo_->isStereo(detId), isPlusSide(*ttopo_, detId));
82 }

References TrackerTopology::isStereo(), TrackerTopology::layer(), lnc_, DetId::subdetId(), and ttopo_.

Referenced by mkfit::convertHits(), and MkFitEventOfHitsProducer::fill().

◆ topology()

const TrackerTopology* MkFitGeometry::topology ( ) const
inline

Definition at line 39 of file MkFitGeometry.h.

39 { return ttopo_; }

References ttopo_.

◆ trackerInfo()

mkfit::TrackerInfo const& MkFitGeometry::trackerInfo ( ) const
inline

Definition at line 35 of file MkFitGeometry.h.

35 { return *trackerInfo_; }

References trackerInfo_.

◆ uniqueIdInLayer()

unsigned int MkFitGeometry::uniqueIdInLayer ( int  layer,
unsigned int  detId 
) const
inline

Definition at line 38 of file MkFitGeometry.h.

38 { return detIdToShortId_.at(layer).at(detId); }

References detIdToShortId_, and phase1PixelTopology::layer.

Referenced by mkfit::convertHits().

Member Data Documentation

◆ detIdToShortId_

std::vector<std::unordered_map<unsigned int, unsigned int> > MkFitGeometry::detIdToShortId_
private

Definition at line 47 of file MkFitGeometry.h.

Referenced by uniqueIdInLayer().

◆ dets_

std::vector<const DetLayer*> MkFitGeometry::dets_
private

Definition at line 46 of file MkFitGeometry.h.

Referenced by detLayers().

◆ iterationsInfo_

std::unique_ptr<mkfit::IterationsInfo> MkFitGeometry::iterationsInfo_
private

Definition at line 45 of file MkFitGeometry.h.

Referenced by iterationsInfo().

◆ lnc_

std::unique_ptr<mkfit::LayerNumberConverter> MkFitGeometry::lnc_
private

Definition at line 43 of file MkFitGeometry.h.

Referenced by layerNumberConverter(), and mkFitLayerNumber().

◆ trackerInfo_

std::unique_ptr<mkfit::TrackerInfo> MkFitGeometry::trackerInfo_
private

Definition at line 44 of file MkFitGeometry.h.

Referenced by trackerInfo().

◆ ttopo_

const TrackerTopology* MkFitGeometry::ttopo_
private

Definition at line 42 of file MkFitGeometry.h.

Referenced by mkFitLayerNumber(), and topology().

AlCaHLTBitMon_QueryRunRegistry.comp
string comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
MkFitGeometry::mkFitLayerNumber
int mkFitLayerNumber(DetId detId) const
Definition: MkFitGeometry.cc:79
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
DetLayer
Definition: DetLayer.h:21
cms::cuda::assert
assert(be >=bs)
TrackerTopology::layer
unsigned int layer(const DetId &id) const
Definition: TrackerTopology.cc:47
MkFitGeometry::trackerInfo_
std::unique_ptr< mkfit::TrackerInfo > trackerInfo_
Definition: MkFitGeometry.h:44
PVValHelper::phase1
Definition: PVValidationHelpers.h:80
DetId
Definition: DetId.h:17
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
TrackerTopology::isStereo
bool isStereo(const DetId &id) const
Definition: TrackerTopology.cc:158
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
StripSubdetector::TIB
static constexpr auto TIB
Definition: StripSubdetector.h:16
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
MkFitGeometry::detIdToShortId_
std::vector< std::unordered_map< unsigned int, unsigned int > > detIdToShortId_
Definition: MkFitGeometry.h:47
MkFitGeometry::trackerInfo
mkfit::TrackerInfo const & trackerInfo() const
Definition: MkFitGeometry.h:35
MkFitGeometry::ttopo_
const TrackerTopology * ttopo_
Definition: MkFitGeometry.h:42
MkFitGeometry::dets_
std::vector< const DetLayer * > dets_
Definition: MkFitGeometry.h:46
eostools.move
def move(src, dest)
Definition: eostools.py:511
StripSubdetector::TEC
static constexpr auto TEC
Definition: StripSubdetector.h:19
MkFitGeometry::iterationsInfo
mkfit::IterationsInfo const & iterationsInfo() const
Definition: MkFitGeometry.h:36
MkFitGeometry::lnc_
std::unique_ptr< mkfit::LayerNumberConverter > lnc_
Definition: MkFitGeometry.h:43
Exception
Definition: hltDiff.cc:245
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
MkFitGeometry::iterationsInfo_
std::unique_ptr< mkfit::IterationsInfo > iterationsInfo_
Definition: MkFitGeometry.h:45
genParticles_cff.map
map
Definition: genParticles_cff.py:11
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17