CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
tmtt::StubFEWindows Class Reference

#include <StubFEWindows.h>

Public Member Functions

const std::vector< double > & numTiltedLayerRings () const
 
void setZero ()
 
double * storedWindowSize (const TrackerTopology *trackerTopo, const DetId &detId)
 
const double * storedWindowSize (const TrackerTopology *trackerTopo, const DetId &detId) const
 
 StubFEWindows (const edm::ParameterSet &pSetStubAlgo)
 
std::vector< double > & windowSizeBarrelLayers ()
 
const std::vector< double > & windowSizeBarrelLayers () const
 
std::vector< std::vector< double > > & windowSizeEndcapDisksRings ()
 
const std::vector< std::vector< double > > & windowSizeEndcapDisksRings () const
 
std::vector< std::vector< double > > & windowSizeTiltedLayersRings ()
 
const std::vector< std::vector< double > > & windowSizeTiltedLayersRings () const
 

Private Attributes

std::vector< double > numTiltedLayerRings_
 
std::vector< double > windowSizeBarrelLayers_
 
std::vector< std::vector< double > > windowSizeEndcapDisksRings_
 
std::vector< std::vector< double > > windowSizeTiltedLayersRings_
 

Detailed Description

Definition at line 15 of file StubFEWindows.h.

Constructor & Destructor Documentation

◆ StubFEWindows()

tmtt::StubFEWindows::StubFEWindows ( const edm::ParameterSet pSetStubAlgo)

Definition at line 14 of file StubFEWindows.cc.

14  {
15  numTiltedLayerRings_ = pSetStubAlgo.getParameter<vector<double>>("NTiltedRings");
16  windowSizeBarrelLayers_ = pSetStubAlgo.getParameter<vector<double>>("BarrelCut");
17  const auto& pSetTiltedLayer = pSetStubAlgo.getParameter<vector<edm::ParameterSet>>("TiltedBarrelCutSet");
18  const auto& pSetEncapDisks = pSetStubAlgo.getParameter<vector<edm::ParameterSet>>("EndcapCutSet");
19  windowSizeTiltedLayersRings_.reserve(pSetTiltedLayer.size());
20  for (const auto& pSet : pSetTiltedLayer) {
21  windowSizeTiltedLayersRings_.emplace_back(pSet.getParameter<vector<double>>("TiltedCut"));
22  }
23  windowSizeEndcapDisksRings_.reserve(pSetEncapDisks.size());
24  for (const auto& pSet : pSetEncapDisks) {
25  windowSizeEndcapDisksRings_.emplace_back(pSet.getParameter<vector<double>>("EndcapCut"));
26  }
27  }

References edm::ParameterSet::getParameter().

Member Function Documentation

◆ numTiltedLayerRings()

const std::vector<double>& tmtt::StubFEWindows::numTiltedLayerRings ( ) const
inline

Definition at line 36 of file StubFEWindows.h.

36 { return numTiltedLayerRings_; }

References numTiltedLayerRings_.

◆ setZero()

void tmtt::StubFEWindows::setZero ( )

Definition at line 31 of file StubFEWindows.cc.

31  {
33  for (auto& x : windowSizeEndcapDisksRings_)
34  std::fill(x.begin(), x.end(), 0.);
35  for (auto& y : windowSizeTiltedLayersRings_)
36  std::fill(y.begin(), y.end(), 0.);
37  }

References ntuplemaker::fill.

◆ storedWindowSize() [1/2]

double * tmtt::StubFEWindows::storedWindowSize ( const TrackerTopology trackerTopo,
const DetId detId 
)

Definition at line 71 of file StubFEWindows.cc.

71  {
72  // Code accessing geometry inspired by L1Trigger/TrackTrigger/src/TTStubAlgorithm_official.cc
73 
74  // Scott Meyers's solution to give const & non-const versions of same function, without
75  // code duplication.
76  return const_cast<double*>((static_cast<const StubFEWindows*>(this))->storedWindowSize(trackerTopo, detId));
77  }

◆ storedWindowSize() [2/2]

const double * tmtt::StubFEWindows::storedWindowSize ( const TrackerTopology trackerTopo,
const DetId detId 
) const

Definition at line 41 of file StubFEWindows.cc.

41  {
42  // Code accessing geometry inspired by L1Trigger/TrackTrigger/src/TTStubAlgorithm_official.cc
43 
44  const double* storedHalfWindow = nullptr;
45  if (detId.subdetId() == StripSubdetector::TOB) {
46  unsigned int layer = trackerTopo->layer(detId);
47  unsigned int ladder = trackerTopo->tobRod(detId);
48  int type = 2 * trackerTopo->tobSide(detId) - 3; // -1 for tilted-, 1 for tilted+, 3 for flat
49  double corr = 0;
50 
51  if (type != TrackerModule::BarrelModuleType::flat) {
52  // Tilted barrel
53  corr = (numTiltedLayerRings_.at(layer) + 1) / 2.;
54  // Corrected ring number, between 0 and barrelNTilt.at(layer), in ascending |z|
55  ladder = corr - (corr - ladder) * type;
56  storedHalfWindow = &(windowSizeTiltedLayersRings_.at(layer).at(ladder));
57  } else {
58  // Flat barrel
59  storedHalfWindow = &(windowSizeBarrelLayers_.at(layer));
60  }
61 
62  } else if (detId.subdetId() == StripSubdetector::TID) {
63  // Endcap
64  unsigned int wheel = trackerTopo->tidWheel(detId);
65  unsigned int ring = trackerTopo->tidRing(detId);
66  storedHalfWindow = &(windowSizeEndcapDisksRings_.at(wheel).at(ring));
67  }
68  return storedHalfWindow;
69  }

References alignCSCRings::corr, PVValHelper::ladder, TrackerTopology::layer(), relativeConstraints::ring, DetId::subdetId(), StripSubdetector::TID, TrackerTopology::tidRing(), TrackerTopology::tidWheel(), StripSubdetector::TOB, TrackerTopology::tobRod(), TrackerTopology::tobSide(), and makeMuonMisalignmentScenario::wheel.

◆ windowSizeBarrelLayers() [1/2]

std::vector<double>& tmtt::StubFEWindows::windowSizeBarrelLayers ( )
inline

Definition at line 31 of file StubFEWindows.h.

31 { return windowSizeBarrelLayers_; }

References windowSizeBarrelLayers_.

◆ windowSizeBarrelLayers() [2/2]

const std::vector<double>& tmtt::StubFEWindows::windowSizeBarrelLayers ( ) const
inline

Definition at line 24 of file StubFEWindows.h.

24 { return windowSizeBarrelLayers_; }

References windowSizeBarrelLayers_.

◆ windowSizeEndcapDisksRings() [1/2]

std::vector<std::vector<double> >& tmtt::StubFEWindows::windowSizeEndcapDisksRings ( )
inline

Definition at line 32 of file StubFEWindows.h.

References windowSizeEndcapDisksRings_.

◆ windowSizeEndcapDisksRings() [2/2]

const std::vector<std::vector<double> >& tmtt::StubFEWindows::windowSizeEndcapDisksRings ( ) const
inline

Definition at line 25 of file StubFEWindows.h.

References windowSizeEndcapDisksRings_.

◆ windowSizeTiltedLayersRings() [1/2]

std::vector<std::vector<double> >& tmtt::StubFEWindows::windowSizeTiltedLayersRings ( )
inline

Definition at line 33 of file StubFEWindows.h.

References windowSizeTiltedLayersRings_.

◆ windowSizeTiltedLayersRings() [2/2]

const std::vector<std::vector<double> >& tmtt::StubFEWindows::windowSizeTiltedLayersRings ( ) const
inline

Definition at line 26 of file StubFEWindows.h.

26  {
28  }

References windowSizeTiltedLayersRings_.

Member Data Documentation

◆ numTiltedLayerRings_

std::vector<double> tmtt::StubFEWindows::numTiltedLayerRings_
private

Definition at line 47 of file StubFEWindows.h.

Referenced by numTiltedLayerRings().

◆ windowSizeBarrelLayers_

std::vector<double> tmtt::StubFEWindows::windowSizeBarrelLayers_
private

Definition at line 44 of file StubFEWindows.h.

Referenced by windowSizeBarrelLayers().

◆ windowSizeEndcapDisksRings_

std::vector<std::vector<double> > tmtt::StubFEWindows::windowSizeEndcapDisksRings_
private

Definition at line 45 of file StubFEWindows.h.

Referenced by windowSizeEndcapDisksRings().

◆ windowSizeTiltedLayersRings_

std::vector<std::vector<double> > tmtt::StubFEWindows::windowSizeTiltedLayersRings_
private

Definition at line 46 of file StubFEWindows.h.

Referenced by windowSizeTiltedLayersRings().

tmtt::StubFEWindows::storedWindowSize
const double * storedWindowSize(const TrackerTopology *trackerTopo, const DetId &detId) const
Definition: StubFEWindows.cc:41
TrackerTopology::layer
unsigned int layer(const DetId &id) const
Definition: TrackerTopology.cc:47
TrackerTopology::tidRing
unsigned int tidRing(const DetId &id) const
Definition: TrackerTopology.h:218
TrackerTopology::tobRod
unsigned int tobRod(const DetId &id) const
Definition: TrackerTopology.h:195
TrackerTopology::tidWheel
unsigned int tidWheel(const DetId &id) const
Definition: TrackerTopology.h:201
tmtt::StubFEWindows::numTiltedLayerRings_
std::vector< double > numTiltedLayerRings_
Definition: StubFEWindows.h:47
tmtt::StubFEWindows::windowSizeTiltedLayersRings_
std::vector< std::vector< double > > windowSizeTiltedLayersRings_
Definition: StubFEWindows.h:46
alignCSCRings.corr
dictionary corr
Definition: alignCSCRings.py:124
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
ntuplemaker.fill
fill
Definition: ntuplemaker.py:304
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
tmtt::StubFEWindows::windowSizeBarrelLayers_
std::vector< double > windowSizeBarrelLayers_
Definition: StubFEWindows.h:44
genVertex_cff.x
x
Definition: genVertex_cff.py:12
PVValHelper::ladder
Definition: PVValidationHelpers.h:72
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
tmtt::StubFEWindows::windowSizeEndcapDisksRings_
std::vector< std::vector< double > > windowSizeEndcapDisksRings_
Definition: StubFEWindows.h:45
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17
TrackerTopology::tobSide
unsigned int tobSide(const DetId &id) const
Definition: TrackerTopology.h:180