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::LayerNumberConverter const & layerNumberConverter () const
 
 MkFitGeometry (const TrackerGeometry &geom, const GeometricSearchTracker &tracker, const TrackerTopology &ttopo, std::unique_ptr< mkfit::TrackerInfo > trackerInfo)
 
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< const DetLayer * > dets_
 
std::unique_ptr< mkfit::LayerNumberConverterlnc_
 
std::unique_ptr< mkfit::TrackerInfotrackerInfo_
 
const TrackerTopologyttopo_
 

Detailed Description

Collection of geometry-related objects for mkFit

Definition at line 23 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 
)
explicit

Definition at line 17 of file MkFitGeometry.cc.

References mkfit::phase1.

21  : ttopo_(&ttopo),
22  lnc_{std::make_unique<mkfit::LayerNumberConverter>(mkfit::TkLayout::phase1)},
24  if (geom.numberOfLayers(PixelSubdetector::PixelBarrel) != 4 ||
25  geom.numberOfLayers(PixelSubdetector::PixelEndcap) != 3) {
26  throw cms::Exception("Assert") << "For now this code works only with phase1 tracker, you have something else";
27  }
28 
29  // Create DetLayer structure
30  dets_.resize(lnc_->nLayers(), nullptr);
31  auto setDet = [this](const int subdet, const int layer, const int isStereo, const DetId& detId, const DetLayer* lay) {
32  const int index = lnc_->convertLayerNumber(subdet, layer, false, isStereo, isPlusSide(*ttopo_, detId));
33  if (index < 0 or static_cast<unsigned>(index) >= dets_.size()) {
34  throw cms::Exception("LogicError") << "Invalid mkFit layer index " << index << " for DetId " << detId.rawId()
35  << " subdet " << subdet << " layer " << layer << " isStereo " << isStereo;
36  }
37  dets_[index] = lay;
38  };
39  constexpr int monoLayer = 0;
40  constexpr int stereoLayer = 1;
41  for (const DetLayer* lay : tracker.allLayers()) {
42  const auto& comp = lay->basicComponents();
43  if (UNLIKELY(comp.empty())) {
44  throw cms::Exception("LogicError") << "Got a tracker layer (subdet " << lay->subDetector()
45  << ") with empty basicComponents.";
46  }
47  // First component is enough for layer and side information
48  const auto& detId = comp.front()->geographicalId();
49  const auto subdet = detId.subdetId();
50  const auto layer = ttopo.layer(detId);
51 
52  // TODO: mono/stereo structure is still hardcoded for phase0/1 strip tracker
53  setDet(subdet, layer, monoLayer, detId, lay);
54  if (((subdet == StripSubdetector::TIB or subdet == StripSubdetector::TOB) and (layer == 1 or layer == 2)) or
55  subdet == StripSubdetector::TID or subdet == StripSubdetector::TEC) {
56  setDet(subdet, layer, stereoLayer, detId, lay);
57  }
58  }
59 }
static constexpr auto TEC
std::unique_ptr< mkfit::LayerNumberConverter > lnc_
Definition: MkFitGeometry.h:42
unsigned int layer(const DetId &id) const
constexpr std::array< uint8_t, layerIndexSize > layer
const TrackerTopology * ttopo_
Definition: MkFitGeometry.h:41
mkfit::TrackerInfo const & trackerInfo() const
Definition: MkFitGeometry.h:33
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
static constexpr auto TOB
Definition: DetId.h:17
static constexpr auto TIB
std::unique_ptr< mkfit::TrackerInfo > trackerInfo_
Definition: MkFitGeometry.h:43
#define UNLIKELY(x)
Definition: Likely.h:21
std::vector< const DetLayer * > dets_
Definition: MkFitGeometry.h:44
static constexpr auto TID
def move(src, dest)
Definition: eostools.py:511

◆ ~MkFitGeometry()

MkFitGeometry::~MkFitGeometry ( )

Definition at line 63 of file MkFitGeometry.cc.

63 {}

Member Function Documentation

◆ detLayers()

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

Definition at line 34 of file MkFitGeometry.h.

References dets_.

34 { return dets_; }
std::vector< const DetLayer * > dets_
Definition: MkFitGeometry.h:44

◆ layerNumberConverter()

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

Definition at line 32 of file MkFitGeometry.h.

References lnc_.

Referenced by MkFitSeedConverter::convertSeeds().

32 { return *lnc_; }
std::unique_ptr< mkfit::LayerNumberConverter > lnc_
Definition: MkFitGeometry.h:42

◆ mkFitLayerNumber()

int MkFitGeometry::mkFitLayerNumber ( DetId  detId) const

Definition at line 65 of file MkFitGeometry.cc.

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

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

65  {
66  return lnc_->convertLayerNumber(
67  detId.subdetId(), ttopo_->layer(detId), false, ttopo_->isStereo(detId), isPlusSide(*ttopo_, detId));
68 }
std::unique_ptr< mkfit::LayerNumberConverter > lnc_
Definition: MkFitGeometry.h:42
bool isStereo(const DetId &id) const
unsigned int layer(const DetId &id) const
const TrackerTopology * ttopo_
Definition: MkFitGeometry.h:41
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48

◆ topology()

const TrackerTopology* MkFitGeometry::topology ( ) const
inline

Definition at line 38 of file MkFitGeometry.h.

References ttopo_.

38 { return ttopo_; }
const TrackerTopology * ttopo_
Definition: MkFitGeometry.h:41

◆ trackerInfo()

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

Definition at line 33 of file MkFitGeometry.h.

References trackerInfo_.

33 { return *trackerInfo_; }
std::unique_ptr< mkfit::TrackerInfo > trackerInfo_
Definition: MkFitGeometry.h:43

◆ uniqueIdInLayer()

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

Definition at line 35 of file MkFitGeometry.h.

References phase1PixelTopology::layer, and trackerInfo_.

Referenced by mkfit::convertHits().

35  {
36  return trackerInfo_->layer(layer).short_id(detId);
37  }
constexpr std::array< uint8_t, layerIndexSize > layer
std::unique_ptr< mkfit::TrackerInfo > trackerInfo_
Definition: MkFitGeometry.h:43

Member Data Documentation

◆ dets_

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

Definition at line 44 of file MkFitGeometry.h.

Referenced by detLayers().

◆ lnc_

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

Definition at line 42 of file MkFitGeometry.h.

Referenced by layerNumberConverter(), and mkFitLayerNumber().

◆ trackerInfo_

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

Definition at line 43 of file MkFitGeometry.h.

Referenced by trackerInfo(), and uniqueIdInLayer().

◆ ttopo_

const TrackerTopology* MkFitGeometry::ttopo_
private

Definition at line 41 of file MkFitGeometry.h.

Referenced by mkFitLayerNumber(), and topology().