CMS 3D CMS Logo

GEMSuperChamber.cc
Go to the documentation of this file.
3 
5  : GeomDet(plane), detId_(id) {
6  setDetId(id);
7 }
8 
10 
11 GEMDetId GEMSuperChamber::id() const { return detId_; }
12 
13 bool GEMSuperChamber::operator==(const GEMSuperChamber& sch) const { return this->id() == sch.id(); }
14 
15 void GEMSuperChamber::add(const GEMChamber* ch) { chambers_.emplace_back(ch); }
16 
17 std::vector<const GeomDet*> GEMSuperChamber::components() const {
18  return std::vector<const GeomDet*>(chambers_.begin(), chambers_.end());
19 }
20 
21 const GeomDet* GEMSuperChamber::component(DetId id) const { return chamber(GEMDetId(id.rawId())); }
22 
23 const std::vector<const GEMChamber*>& GEMSuperChamber::chambers() const { return chambers_; }
24 
25 int GEMSuperChamber::nChambers() const { return chambers_.size(); }
26 
28  if (id.chamber() != detId_.chamber())
29  return nullptr; // not in this super chamber!
30  return chamber(id.layer());
31 }
32 
33 const GEMChamber* GEMSuperChamber::chamber(int isl) const {
34  for (auto ch : chambers_) {
35  if (ch->id().layer() == isl)
36  return ch;
37  }
38  return nullptr;
39 }
40 
41 float GEMSuperChamber::computeDeltaPhi(const LocalPoint& position, const LocalVector& direction) const {
42  auto extrap = [](const LocalPoint& point, const LocalVector& dir, double extZ) -> LocalPoint {
43  if (dir.z() == 0)
44  return LocalPoint(0.f, 0.f, extZ);
45  double extX = point.x() + extZ * dir.x() / dir.z();
46  double extY = point.y() + extZ * dir.y() / dir.z();
47  return LocalPoint(extX, extY, extZ);
48  };
49  if (nChambers() < 2) {
50  return 0.f;
51  }
52 
53  const float beginOfChamber = chamber(1)->position().z();
54  const float centerOfChamber = this->position().z();
55  const float endOfChamber = chamber(nChambers())->position().z();
56 
57  LocalPoint projHigh =
58  extrap(position, direction, (centerOfChamber < 0 ? -1.0 : 1.0) * (endOfChamber - centerOfChamber));
59  LocalPoint projLow =
60  extrap(position, direction, (centerOfChamber < 0 ? -1.0 : 1.0) * (beginOfChamber - centerOfChamber));
61  auto globLow = toGlobal(projLow);
62  auto globHigh = toGlobal(projHigh);
63  return globHigh.phi() - globLow.phi(); //Geom::phi automatically normalizes to [-pi, pi]
64 }
Vector3DBase< float, LocalTag >
GeomDet::position
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
GEMSuperChamber::detId_
GEMDetId detId_
Definition: GEMSuperChamber.h:62
GeomDet::setDetId
void setDetId(DetId id)
Definition: GeomDet.h:99
GEMSuperChamber::add
void add(const GEMChamber *ch)
Add chamber to the super chamber which takes ownership.
Definition: GEMSuperChamber.cc:15
GEMSuperChamber::chambers
const std::vector< const GEMChamber * > & chambers() const
Return the chambers in the super chamber.
Definition: GEMSuperChamber.cc:23
GeomDet
Definition: GeomDet.h:27
GEMSuperChamber
Definition: GEMSuperChamber.h:19
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
GEMSuperChamber::chamber
const GEMChamber * chamber(GEMDetId id) const
Return the chamber corresponding to the given id.
Definition: GEMSuperChamber.cc:27
GEMSuperChamber::nChambers
int nChambers() const
Return numbers of chambers.
Definition: GEMSuperChamber.cc:25
ReferenceCountingPointer
Definition: ReferenceCounted.h:60
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
GEMSuperChamber::computeDeltaPhi
float computeDeltaPhi(const LocalPoint &position, const LocalVector &direction) const
Definition: GEMSuperChamber.cc:41
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
DetId
Definition: DetId.h:17
GEMSuperChamber::components
std::vector< const GeomDet * > components() const override
Return the chambers in the super chamber.
Definition: GEMSuperChamber.cc:17
GEMSuperChamber::GEMSuperChamber
GEMSuperChamber(GEMDetId id, const ReferenceCountingPointer< BoundPlane > &plane)
constructor
Definition: GEMSuperChamber.cc:4
Point3DBase< float, LocalTag >
GEMSuperChamber::chambers_
std::vector< const GEMChamber * > chambers_
Definition: GEMSuperChamber.h:65
GEMSuperChamber::~GEMSuperChamber
~GEMSuperChamber() override
destructor
Definition: GEMSuperChamber.cc:9
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
GEMSuperChamber::component
const GeomDet * component(DetId id) const override
Return the sub-component (chamber) with a given id in this super chamber.
Definition: GEMSuperChamber.cc:21
GEMDetId::chamber
constexpr int chamber() const
Definition: GEMDetId.h:183
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
GEMSuperChamber::operator==
bool operator==(const GEMSuperChamber &sch) const
equal if the id is the same
Definition: GEMSuperChamber.cc:13
GEMDetId
Definition: GEMDetId.h:18
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
GEMChamber.h
GEMChamber
Definition: GEMChamber.h:19
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
GEMSuperChamber.h
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
GEMSuperChamber::id
GEMDetId id() const
Return the GEMDetId of this super chamber.
Definition: GEMSuperChamber.cc:11
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23