CMS 3D CMS Logo

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

#include <TotemGeometry.h>

Public Member Functions

bool addT2Plane (const TotemT2DetId &, const DetGeomDesc *&)
 
bool addT2Tile (const TotemT2DetId &, const DetGeomDesc *&)
 
const DetGeomDescplane (const TotemT2DetId &) const
 
const TotemT2Tiletile (const TotemT2DetId &) const
 
 TotemGeometry (const DetGeomDesc *)
 

Private Member Functions

void browse (const DetGeomDesc *, bool in_t2)
 
void browseT2 (const DetGeomDesc *&)
 

Private Attributes

std::map< TotemT2DetId, const DetGeomDesc * > nt2_planes_
 
std::map< TotemT2DetId, TotemT2Tilent2_tiles_
 

Detailed Description

Definition at line 17 of file TotemGeometry.h.

Constructor & Destructor Documentation

◆ TotemGeometry()

TotemGeometry::TotemGeometry ( const DetGeomDesc dgd)

Definition at line 11 of file TotemGeometry.cc.

References browse().

11 { browse(dgd, false); }
void browse(const DetGeomDesc *, bool in_t2)

Member Function Documentation

◆ addT2Plane()

bool TotemGeometry::addT2Plane ( const TotemT2DetId detid,
const DetGeomDesc *&  dgd 
)

Definition at line 37 of file TotemGeometry.cc.

References ALCARECOPPSCalTrackBasedSel_cff::detid, and nt2_planes_.

Referenced by browseT2().

37  {
38  if (nt2_planes_.count(detid) != 0)
39  return true;
40  nt2_planes_[detid] = dgd;
41  return true;
42 }
std::map< TotemT2DetId, const DetGeomDesc * > nt2_planes_
Definition: TotemGeometry.h:31

◆ addT2Tile()

bool TotemGeometry::addT2Tile ( const TotemT2DetId detid,
const DetGeomDesc *&  dgd 
)

Definition at line 46 of file TotemGeometry.cc.

References ALCARECOPPSCalTrackBasedSel_cff::detid, and nt2_tiles_.

Referenced by browseT2().

46  {
47  if (nt2_tiles_.count(detid) != 0)
48  return false;
50  return true;
51 }
std::map< TotemT2DetId, TotemT2Tile > nt2_tiles_
Definition: TotemGeometry.h:32

◆ browse()

void TotemGeometry::browse ( const DetGeomDesc parent,
bool  in_t2 
)
private

Definition at line 13 of file TotemGeometry.cc.

References browseT2(), and class-composition::parent.

Referenced by TotemGeometry().

13  {
14  if (parent->name() == "TotemT2")
15  in_t2 = true; // define the mother volume for all children
16  if (in_t2)
18  // start the recursive browsing
19  for (const auto& child : parent->components())
20  browse(child, in_t2);
21 }
void browseT2(const DetGeomDesc *&)
void browse(const DetGeomDesc *, bool in_t2)

◆ browseT2()

void TotemGeometry::browseT2 ( const DetGeomDesc *&  parent)
private

Definition at line 23 of file TotemGeometry.cc.

References addT2Plane(), addT2Tile(), protons_cff::arm, class-composition::parent, plane(), and tile().

Referenced by browse().

23  {
24  const unsigned short arm = parent->parentZPosition() > 0. ? 0 : 1;
25  if (parent->name() == "TotemT2SupportBox")
26  addT2Plane(TotemT2DetId(arm, parent->copyno() - 1), parent);
27  else if (parent->name() == "TotemT2Scint") {
28  unsigned short plane = 2 * (parent->copyno() / 10);
29  unsigned short tile = parent->copyno() % 10;
30  if (tile % 2 == 0)
31  plane += 1;
32  tile = (tile + 1) / 2 - 1;
34  }
35 }
Detector ID class for Totem T2 detectors. Bits [19:31] : Base CTPPSDetId class attributes Bits [16:18...
Definition: TotemT2DetId.h:25
bool addT2Plane(const TotemT2DetId &, const DetGeomDesc *&)
const DetGeomDesc * plane(const TotemT2DetId &) const
const TotemT2Tile & tile(const TotemT2DetId &) const
bool addT2Tile(const TotemT2DetId &, const DetGeomDesc *&)

◆ plane()

const DetGeomDesc * TotemGeometry::plane ( const TotemT2DetId detid) const

Definition at line 44 of file TotemGeometry.cc.

References ALCARECOPPSCalTrackBasedSel_cff::detid, and nt2_planes_.

Referenced by browseT2().

44 { return nt2_planes_.at(detid); }
std::map< TotemT2DetId, const DetGeomDesc * > nt2_planes_
Definition: TotemGeometry.h:31

◆ tile()

const TotemT2Tile & TotemGeometry::tile ( const TotemT2DetId detid) const

Definition at line 53 of file TotemGeometry.cc.

References ALCARECOPPSCalTrackBasedSel_cff::detid, and nt2_tiles_.

Referenced by browseT2().

53 { return nt2_tiles_.at(detid); }
std::map< TotemT2DetId, TotemT2Tile > nt2_tiles_
Definition: TotemGeometry.h:32

Member Data Documentation

◆ nt2_planes_

std::map<TotemT2DetId, const DetGeomDesc*> TotemGeometry::nt2_planes_
private

Definition at line 31 of file TotemGeometry.h.

Referenced by addT2Plane(), and plane().

◆ nt2_tiles_

std::map<TotemT2DetId, TotemT2Tile> TotemGeometry::nt2_tiles_
private

Definition at line 32 of file TotemGeometry.h.

Referenced by addT2Tile(), and tile().