CMS 3D CMS Logo

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

#include <ME0Chamber.h>

Inheritance diagram for ME0Chamber:
GeomDet

Public Member Functions

void add (ME0EtaPartition *roll)
 
void add (ME0Layer *layer)
 Add Layer to the chamber which takes ownership. More...
 
const GeomDetcomponent (DetId id) const override
 Return the sub-component (roll) with a given id in this chamber. More...
 
std::vector< const GeomDet * > components () const override
 Return the rolls in the chamber. More...
 
float computeDeltaPhi (const LocalPoint &position, const LocalVector &direction) const
 
const ME0EtaPartitionetaPartition (int isl) const
 
const ME0EtaPartitionetaPartition (ME0DetId id) const
 
const std::vector< const ME0EtaPartition * > & etaPartitions () const
 
ME0DetId id () const
 Return the ME0DetId of this chamber. More...
 
const ME0Layerlayer (int isl) const
 
const ME0Layerlayer (ME0DetId id) const
 Return the layer corresponding to the given id. More...
 
const std::vector< const ME0Layer * > & layers () const
 Return the layers. More...
 
 ME0Chamber (ME0DetId id, const ReferenceCountingPointer< BoundPlane > &plane)
 Constructor. More...
 
int nEtaPartitions () const
 
int nLayers () const
 Retunr numbers of layers. More...
 
bool operator== (const ME0Chamber &ch) const
 equal if the id is the same More...
 
SubDetector subDetector () const override
 Which subdetector. More...
 
 ~ME0Chamber () override
 Destructor. More...
 
- Public Member Functions inherited from GeomDet
AlignmentPositionError const * alignmentPositionError () const
 Return pointer to alignment errors. More...
 
int gdetIndex () const
 
DetId geographicalId () const
 The label of this GeomDet. More...
 
 GeomDet (const ReferenceCountingPointer< Plane > &plane)
 
 GeomDet (Plane *plane)
 
int index () const
 
virtual bool isLeaf () const
 is a Unit More...
 
const Surface::PositionTypeposition () const
 The position (origin of the R.F.) More...
 
const Surface::RotationTyperotation () const
 The rotation defining the local R.F. More...
 
void setGdetIndex (int i)
 
void setIndex (int i)
 
const PlanespecificSurface () const
 Same as surface(), kept for backward compatibility. More...
 
const Planesurface () const
 The nominal surface of the GeomDet. More...
 
virtual const SurfaceDeformationsurfaceDeformation () const
 
GlobalPoint toGlobal (const Local2DPoint &lp) const
 Conversion to the global R.F. from the R.F. of the GeomDet. More...
 
GlobalPoint toGlobal (const Local3DPoint &lp) const
 Conversion to the global R.F. from the R.F. of the GeomDet. More...
 
GlobalVector toGlobal (const LocalVector &lv) const
 Conversion to the global R.F. from the R.F. of the GeomDet. More...
 
LocalPoint toLocal (const GlobalPoint &gp) const
 Conversion to the R.F. of the GeomDet. More...
 
LocalVector toLocal (const GlobalVector &gv) const
 Conversion to the R.F. of the GeomDet. More...
 
virtual const Topologytopology () const
 
virtual const GeomDetTypetype () const
 
virtual ~GeomDet ()
 

Private Attributes

ME0DetId detId_
 
std::vector< const ME0EtaPartition * > etaPartitions_
 
std::vector< const ME0Layer * > layers_
 

Additional Inherited Members

- Public Types inherited from GeomDet
using SubDetector = GeomDetEnumerators::SubDetector
 
- Protected Member Functions inherited from GeomDet
virtual bool setAlignmentPositionError (const AlignmentPositionError &ape)
 
void setDetId (DetId id)
 

Detailed Description

Definition at line 10 of file ME0Chamber.h.

Constructor & Destructor Documentation

◆ ME0Chamber()

ME0Chamber::ME0Chamber ( ME0DetId  id,
const ReferenceCountingPointer< BoundPlane > &  plane 
)

Constructor.

Definition at line 6 of file ME0Chamber.cc.

6  : GeomDet(plane), detId_(id) {
7  setDetId(id);
8 }

References GeomDet::setDetId().

◆ ~ME0Chamber()

ME0Chamber::~ME0Chamber ( )
override

Destructor.

Definition at line 10 of file ME0Chamber.cc.

10 {}

Member Function Documentation

◆ add() [1/2]

void ME0Chamber::add ( ME0EtaPartition roll)

To support the old ME0 Geometry (with 1 eta partition) Add EtaPartition to the chamber which takes ownership

Definition at line 44 of file ME0Chamber.cc.

44 { etaPartitions_.emplace_back(rl); }

References etaPartitions_.

Referenced by counter.Counter::register().

◆ add() [2/2]

void ME0Chamber::add ( ME0Layer layer)

Add Layer to the chamber which takes ownership.

Definition at line 16 of file ME0Chamber.cc.

16 { layers_.emplace_back(rl); }

References layers_.

Referenced by ME0GeometryBuilder::buildGeometry(), and counter.Counter::register().

◆ component()

const GeomDet * ME0Chamber::component ( DetId  id) const
overridevirtual

Return the sub-component (roll) with a given id in this chamber.

Reimplemented from GeomDet.

Definition at line 22 of file ME0Chamber.cc.

22 { return layer(ME0DetId(id.rawId())); }

References layer().

◆ components()

std::vector< const GeomDet * > ME0Chamber::components ( ) const
overridevirtual

Return the rolls in the chamber.

Reimplemented from GeomDet.

Definition at line 18 of file ME0Chamber.cc.

18  {
19  return std::vector<const GeomDet*>(layers_.begin(), layers_.end());
20 }

References layers_.

◆ computeDeltaPhi()

float ME0Chamber::computeDeltaPhi ( const LocalPoint position,
const LocalVector direction 
) const

Definition at line 64 of file ME0Chamber.cc.

64  {
65  auto extrap = [](const LocalPoint& point, const LocalVector& dir, double extZ) -> LocalPoint {
66  double extX = point.x() + extZ * dir.x() / dir.z();
67  double extY = point.y() + extZ * dir.y() / dir.z();
68  return LocalPoint(extX, extY, extZ);
69  };
70  if (nLayers() < 2) {
71  return 0;
72  }
73 
74  const float beginOfChamber = layer(1)->position().z();
75  const float centerOfChamber = this->position().z();
76  const float endOfChamber = layer(nLayers())->position().z();
77 
78  LocalPoint projHigh =
79  extrap(position, direction, (centerOfChamber < 0 ? -1.0 : 1.0) * (endOfChamber - centerOfChamber));
80  LocalPoint projLow =
81  extrap(position, direction, (centerOfChamber < 0 ? -1.0 : 1.0) * (beginOfChamber - centerOfChamber));
82  auto globLow = toGlobal(projLow);
83  auto globHigh = toGlobal(projHigh);
84  return globHigh.phi() - globLow.phi(); //Geom::phi automatically normalizes to [-pi, pi]
85 }

References DeadROC_duringRun::dir, layer(), nLayers(), point, GeomDet::position(), GeomDet::toGlobal(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by ME0SegAlgoRU::addUniqueSegments().

◆ etaPartition() [1/2]

const ME0EtaPartition * ME0Chamber::etaPartition ( int  isl) const

Definition at line 56 of file ME0Chamber.cc.

56  {
57  for (auto roll : etaPartitions_) {
58  if (roll->id().roll() == isl)
59  return roll;
60  }
61  return nullptr;
62 }

References etaPartitions_.

◆ etaPartition() [2/2]

const ME0EtaPartition * ME0Chamber::etaPartition ( ME0DetId  id) const

To support the old ME0 Geometry (with 1 eta partition) Return the eta partition corresponding to the given id

Definition at line 50 of file ME0Chamber.cc.

50  {
51  if (id.chamberId() != detId_)
52  return nullptr; // not in this eta partition!
53  return etaPartition(id.roll());
54 }

References detId_, and etaPartition().

Referenced by etaPartition().

◆ etaPartitions()

const std::vector< const ME0EtaPartition * > & ME0Chamber::etaPartitions ( ) const

To support the old ME0 Geometry (with 1 eta partition) Return the eta partitions

Definition at line 46 of file ME0Chamber.cc.

46 { return etaPartitions_; }

References etaPartitions_.

◆ id()

ME0DetId ME0Chamber::id ( void  ) const

Return the ME0DetId of this chamber.

Definition at line 12 of file ME0Chamber.cc.

12 { return detId_; }

References detId_.

Referenced by operator==().

◆ layer() [1/2]

const ME0Layer * ME0Chamber::layer ( int  isl) const

Definition at line 34 of file ME0Chamber.cc.

34  {
35  for (auto layer : layers_) {
36  if (layer->id().layer() == isl)
37  return layer;
38  }
39  return nullptr;
40 }

References ME0Layer::id(), layer(), ME0DetId::layer(), and layers_.

Referenced by geometryXMLparser.DTAlignable::index(), and geometryXMLparser.CSCAlignable::index().

◆ layer() [2/2]

const ME0Layer * ME0Chamber::layer ( ME0DetId  id) const

Return the layer corresponding to the given id.

Definition at line 28 of file ME0Chamber.cc.

28  {
29  if (id.chamberId() != detId_)
30  return nullptr; // not in this layer!
31  return layer(id.layer());
32 }

References detId_.

Referenced by component(), computeDeltaPhi(), geometryXMLparser.DTAlignable::index(), geometryXMLparser.CSCAlignable::index(), layer(), and ME0TriggerPseudoBuilder::segmentConversion().

◆ layers()

const std::vector< const ME0Layer * > & ME0Chamber::layers ( ) const

Return the layers.

Definition at line 24 of file ME0Chamber.cc.

24 { return layers_; }

References layers_.

◆ nEtaPartitions()

int ME0Chamber::nEtaPartitions ( ) const

To support the old ME0 Geometry (with 1 eta partition) Retunr numbers of eta partitions

Definition at line 48 of file ME0Chamber.cc.

48 { return etaPartitions_.size(); }

References etaPartitions_.

◆ nLayers()

int ME0Chamber::nLayers ( ) const

Retunr numbers of layers.

Definition at line 26 of file ME0Chamber.cc.

26 { return layers_.size(); }

References layers_.

Referenced by computeDeltaPhi().

◆ operator==()

bool ME0Chamber::operator== ( const ME0Chamber ch) const

equal if the id is the same

Definition at line 14 of file ME0Chamber.cc.

14 { return this->id() == ch.id(); }

References id().

◆ subDetector()

SubDetector ME0Chamber::subDetector ( ) const
inlineoverridevirtual

Which subdetector.

Reimplemented from GeomDet.

Definition at line 22 of file ME0Chamber.h.

22 { return GeomDetEnumerators::ME0; }

References GeomDetEnumerators::ME0.

Member Data Documentation

◆ detId_

ME0DetId ME0Chamber::detId_
private

Definition at line 70 of file ME0Chamber.h.

Referenced by etaPartition(), id(), and layer().

◆ etaPartitions_

std::vector<const ME0EtaPartition*> ME0Chamber::etaPartitions_
private

Definition at line 75 of file ME0Chamber.h.

Referenced by add(), etaPartition(), etaPartitions(), and nEtaPartitions().

◆ layers_

std::vector<const ME0Layer*> ME0Chamber::layers_
private

Definition at line 73 of file ME0Chamber.h.

Referenced by add(), components(), layer(), layers(), and nLayers().

Vector3DBase< float, LocalTag >
GeomDet::position
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
GeomDet::setDetId
void setDetId(DetId id)
Definition: GeomDet.h:99
ME0Chamber::detId_
ME0DetId detId_
Definition: ME0Chamber.h:70
GeomDet::GeomDet
GeomDet(Plane *plane)
Definition: GeomDet.h:31
ME0Layer::id
ME0DetId id() const
Return the ME0DetId of this layer.
Definition: ME0Layer.cc:11
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
ME0Chamber::nLayers
int nLayers() const
Retunr numbers of layers.
Definition: ME0Chamber.cc:26
ME0Chamber::etaPartition
const ME0EtaPartition * etaPartition(ME0DetId id) const
Definition: ME0Chamber.cc:50
Point3DBase< float, LocalTag >
ME0Chamber::layer
const ME0Layer * layer(ME0DetId id) const
Return the layer corresponding to the given id.
Definition: ME0Chamber.cc:28
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
ME0DetId
Definition: ME0DetId.h:16
ME0Chamber::layers_
std::vector< const ME0Layer * > layers_
Definition: ME0Chamber.h:73
GeomDetEnumerators::ME0
Definition: GeomDetEnumerators.h:22
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
ME0Chamber::etaPartitions_
std::vector< const ME0EtaPartition * > etaPartitions_
Definition: ME0Chamber.h:75
ME0DetId::layer
int layer() const
Layer id: each chamber has six layers of chambers: layer 1 is the inner layer and layer 6 is the oute...
Definition: ME0DetId.h:44
ME0Chamber::id
ME0DetId id() const
Return the ME0DetId of this chamber.
Definition: ME0Chamber.cc:12
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23