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 ()
 
const double * storedWindowSize (const TrackerTopology *trackerTopo, const DetId &detId) const
 
double * storedWindowSize (const TrackerTopology *trackerTopo, const DetId &detId)
 
 StubFEWindows (const edm::ParameterSet &pSetStubAlgo)
 
const 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 ()
 

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 15 of file StubFEWindows.cc.

References edm::ParameterSet::getParameter().

15  {
16  numTiltedLayerRings_ = pSetStubAlgo.getParameter<vector<double>>("NTiltedRings");
17  windowSizeBarrelLayers_ = pSetStubAlgo.getParameter<vector<double>>("BarrelCut");
18  const auto& pSetTiltedLayer = pSetStubAlgo.getParameter<vector<edm::ParameterSet>>("TiltedBarrelCutSet");
19  const auto& pSetEncapDisks = pSetStubAlgo.getParameter<vector<edm::ParameterSet>>("EndcapCutSet");
20  windowSizeTiltedLayersRings_.reserve(pSetTiltedLayer.size());
21  for (const auto& pSet : pSetTiltedLayer) {
22  windowSizeTiltedLayersRings_.emplace_back(pSet.getParameter<vector<double>>("TiltedCut"));
23  }
24  windowSizeEndcapDisksRings_.reserve(pSetEncapDisks.size());
25  for (const auto& pSet : pSetEncapDisks) {
26  windowSizeEndcapDisksRings_.emplace_back(pSet.getParameter<vector<double>>("EndcapCut"));
27  }
28  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< double > windowSizeBarrelLayers_
Definition: StubFEWindows.h:44
std::vector< std::vector< double > > windowSizeTiltedLayersRings_
Definition: StubFEWindows.h:46
std::vector< double > numTiltedLayerRings_
Definition: StubFEWindows.h:47
std::vector< std::vector< double > > windowSizeEndcapDisksRings_
Definition: StubFEWindows.h:45

Member Function Documentation

◆ numTiltedLayerRings()

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

Definition at line 36 of file StubFEWindows.h.

References numTiltedLayerRings_.

36 { return numTiltedLayerRings_; }
std::vector< double > numTiltedLayerRings_
Definition: StubFEWindows.h:47

◆ setZero()

void tmtt::StubFEWindows::setZero ( )

Definition at line 32 of file StubFEWindows.cc.

References ntuplemaker::fill, and x.

32  {
34  for (auto& x : windowSizeEndcapDisksRings_)
35  std::fill(x.begin(), x.end(), 0.);
36  for (auto& y : windowSizeTiltedLayersRings_)
37  std::fill(y.begin(), y.end(), 0.);
38  }
std::vector< double > windowSizeBarrelLayers_
Definition: StubFEWindows.h:44
std::vector< std::vector< double > > windowSizeTiltedLayersRings_
Definition: StubFEWindows.h:46
std::vector< std::vector< double > > windowSizeEndcapDisksRings_
Definition: StubFEWindows.h:45

◆ storedWindowSize() [1/2]

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

Definition at line 42 of file StubFEWindows.cc.

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

42  {
43  // Code accessing geometry inspired by L1Trigger/TrackTrigger/src/TTStubAlgorithm_official.cc
44 
45  const double* storedHalfWindow = nullptr;
46  if (detId.subdetId() == StripSubdetector::TOB) {
47  unsigned int layer = trackerTopo->layer(detId);
48  unsigned int ladder = trackerTopo->tobRod(detId);
49  int type = 2 * trackerTopo->tobSide(detId) - 3; // -1 for tilted-, 1 for tilted+, 3 for flat
50  double corr = 0;
51 
52  if (type != TrackerModule::BarrelModuleType::flat) {
53  // Tilted barrel
54  corr = (numTiltedLayerRings_.at(layer) + 1) / 2.;
55  // Corrected ring number, between 0 and barrelNTilt.at(layer), in ascending |z|
56  ladder = corr - (corr - ladder) * type;
57  storedHalfWindow = &(windowSizeTiltedLayersRings_.at(layer).at(ladder));
58  } else {
59  // Flat barrel
60  storedHalfWindow = &(windowSizeBarrelLayers_.at(layer));
61  }
62 
63  } else if (detId.subdetId() == StripSubdetector::TID) {
64  // Endcap
65  unsigned int wheel = trackerTopo->tidWheel(detId);
66  unsigned int ring = trackerTopo->tidRing(detId);
67  storedHalfWindow = &(windowSizeEndcapDisksRings_.at(wheel).at(ring));
68  }
69  return storedHalfWindow;
70  }
unsigned int tobSide(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int layer(const DetId &id) const
constexpr std::array< uint8_t, layerIndexSize > layer
dictionary corr
std::vector< double > windowSizeBarrelLayers_
Definition: StubFEWindows.h:44
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static constexpr auto TOB
std::vector< std::vector< double > > windowSizeTiltedLayersRings_
Definition: StubFEWindows.h:46
unsigned int tobRod(const DetId &id) const
unsigned int tidRing(const DetId &id) const
static constexpr auto TID
std::vector< double > numTiltedLayerRings_
Definition: StubFEWindows.h:47
std::vector< std::vector< double > > windowSizeEndcapDisksRings_
Definition: StubFEWindows.h:45

◆ storedWindowSize() [2/2]

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

Definition at line 72 of file StubFEWindows.cc.

72  {
73  // Code accessing geometry inspired by L1Trigger/TrackTrigger/src/TTStubAlgorithm_official.cc
74  // Non-const version of operator, without needing to duplicate code.
75  // (Scott Meyers trick).
76  return const_cast<double*>(std::as_const(*this).storedWindowSize(trackerTopo, detId));
77  }

◆ windowSizeBarrelLayers() [1/2]

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

Definition at line 24 of file StubFEWindows.h.

References windowSizeBarrelLayers_.

24 { return windowSizeBarrelLayers_; }
std::vector< double > windowSizeBarrelLayers_
Definition: StubFEWindows.h:44

◆ windowSizeBarrelLayers() [2/2]

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

Definition at line 31 of file StubFEWindows.h.

References windowSizeBarrelLayers_.

31 { return windowSizeBarrelLayers_; }
std::vector< double > windowSizeBarrelLayers_
Definition: StubFEWindows.h:44

◆ windowSizeEndcapDisksRings() [1/2]

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

Definition at line 25 of file StubFEWindows.h.

References windowSizeEndcapDisksRings_.

std::vector< std::vector< double > > windowSizeEndcapDisksRings_
Definition: StubFEWindows.h:45

◆ windowSizeEndcapDisksRings() [2/2]

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

Definition at line 32 of file StubFEWindows.h.

References windowSizeEndcapDisksRings_.

std::vector< std::vector< double > > windowSizeEndcapDisksRings_
Definition: StubFEWindows.h:45

◆ windowSizeTiltedLayersRings() [1/2]

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

Definition at line 26 of file StubFEWindows.h.

References windowSizeTiltedLayersRings_.

26  {
28  }
std::vector< std::vector< double > > windowSizeTiltedLayersRings_
Definition: StubFEWindows.h:46

◆ windowSizeTiltedLayersRings() [2/2]

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

Definition at line 33 of file StubFEWindows.h.

References windowSizeTiltedLayersRings_.

std::vector< std::vector< double > > windowSizeTiltedLayersRings_
Definition: StubFEWindows.h:46

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