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
 
bool isPhase1 () const
 
bool isPhase2 () const
 
mkfit::LayerNumberConverter const & layerNumberConverter () const
 
 MkFitGeometry (const TrackerGeometry &geom, const GeometricSearchTracker &tracker, const TrackerTopology &ttopo, std::unique_ptr< mkfit::TrackerInfo > trackerInfo, const mkfit::LayerNumberConverter &layNConv)
 
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,
const mkfit::LayerNumberConverter layNConv 
)
explicit

Definition at line 17 of file MkFitGeometry.cc.

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

◆ ~MkFitGeometry()

MkFitGeometry::~MkFitGeometry ( )

Definition at line 59 of file MkFitGeometry.cc.

59 {}

Member Function Documentation

◆ detLayers()

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

Definition at line 37 of file MkFitGeometry.h.

References dets_.

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

◆ isPhase1()

bool MkFitGeometry::isPhase1 ( ) const

Definition at line 66 of file MkFitGeometry.cc.

References lnc_.

Referenced by MkFitOutputConverter::convertCandidates().

66 { return lnc_->isPhase1(); }
std::unique_ptr< mkfit::LayerNumberConverter > lnc_
Definition: MkFitGeometry.h:45

◆ isPhase2()

bool MkFitGeometry::isPhase2 ( ) const

Definition at line 68 of file MkFitGeometry.cc.

References lnc_.

68 { return lnc_->isPhase2(); }
std::unique_ptr< mkfit::LayerNumberConverter > lnc_
Definition: MkFitGeometry.h:45

◆ layerNumberConverter()

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

Definition at line 33 of file MkFitGeometry.h.

References lnc_.

Referenced by MkFitSeedConverter::convertSeeds().

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

◆ mkFitLayerNumber()

int MkFitGeometry::mkFitLayerNumber ( DetId  detId) const

Definition at line 61 of file MkFitGeometry.cc.

References hcalRecHitTable_cff::detId, TrackerTopology::isStereo(), TrackerTopology::layer(), lnc_, and ttopo_.

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

61  {
62  return lnc_->convertLayerNumber(
63  detId.subdetId(), ttopo_->layer(detId), false, ttopo_->isStereo(detId), isPlusSide(*ttopo_, detId));
64 }
std::unique_ptr< mkfit::LayerNumberConverter > lnc_
Definition: MkFitGeometry.h:45
bool isStereo(const DetId &id) const
unsigned int layer(const DetId &id) const
const TrackerTopology * ttopo_
Definition: MkFitGeometry.h:44

◆ topology()

const TrackerTopology* MkFitGeometry::topology ( ) const
inline

Definition at line 41 of file MkFitGeometry.h.

References ttopo_.

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

◆ trackerInfo()

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

Definition at line 36 of file MkFitGeometry.h.

References trackerInfo_.

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

◆ uniqueIdInLayer()

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

Definition at line 38 of file MkFitGeometry.h.

References hcalRecHitTable_cff::detId, nano_mu_digi_cff::layer, and trackerInfo_.

Referenced by mkfit::convertHits().

38  {
39  return trackerInfo_->layer(layer).short_id(detId);
40  }
std::unique_ptr< mkfit::TrackerInfo > trackerInfo_
Definition: MkFitGeometry.h:46

Member Data Documentation

◆ dets_

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

Definition at line 47 of file MkFitGeometry.h.

Referenced by detLayers().

◆ lnc_

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

Definition at line 45 of file MkFitGeometry.h.

Referenced by isPhase1(), isPhase2(), layerNumberConverter(), and mkFitLayerNumber().

◆ trackerInfo_

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

Definition at line 46 of file MkFitGeometry.h.

Referenced by trackerInfo(), and uniqueIdInLayer().

◆ ttopo_

const TrackerTopology* MkFitGeometry::ttopo_
private

Definition at line 44 of file MkFitGeometry.h.

Referenced by mkFitLayerNumber(), and topology().