CMS 3D CMS Logo

RPCChamber.cc
Go to the documentation of this file.
1 
7 /* This Class Header */
9 
10 /* Collaborating Class Header */
12 
13 /* C++ Headers */
14 #include <iostream>
15 
16 /* ====================================================================== */
17 
18 /* Constructor */
20  setDetId(id);
21 }
22 
23 /* Destructor */
25 
26 RPCDetId RPCChamber::id() const { return theId; }
27 
28 /* Operations */
29 
30 bool RPCChamber::operator==(const RPCChamber& ch) const { return this->id() == ch.id(); }
31 
32 void RPCChamber::add(RPCRoll* rl) { theRolls.emplace_back(rl); }
33 
34 std::vector<const GeomDet*> RPCChamber::components() const {
35  return std::vector<const GeomDet*>(theRolls.begin(), theRolls.end());
36 }
37 
38 const GeomDet* RPCChamber::component(DetId id) const { return roll(RPCDetId(id.rawId())); }
39 
40 const std::vector<const RPCRoll*>& RPCChamber::rolls() const { return theRolls; }
41 
42 int RPCChamber::nrolls() const { return theRolls.size(); }
43 
44 const RPCRoll* RPCChamber::roll(RPCDetId id) const {
45  if (id.chamberId() != theId)
46  return nullptr; // not in this Roll!
47  return roll(id.roll());
48 }
49 
50 const RPCRoll* RPCChamber::roll(int isl) const {
51  for (auto theRoll : theRolls) {
52  if (theRoll->id().roll() == isl)
53  return theRoll;
54  }
55  return nullptr;
56 }
GeomDet::setDetId
void setDetId(DetId id)
Definition: GeomDet.h:99
RPCRoll
Definition: RPCRoll.h:12
RPCChamber::nrolls
int nrolls() const
Retunr numbers of rolls.
Definition: RPCChamber.cc:42
RPCChamber::component
const GeomDet * component(DetId id) const override
Return the sub-component (roll) with a given id in this chamber.
Definition: RPCChamber.cc:38
GeomDet
Definition: GeomDet.h:27
RPCChamber::~RPCChamber
~RPCChamber() override
Destructor.
Definition: RPCChamber.cc:24
RPCDetId
Definition: RPCDetId.h:16
RPCChamber::id
RPCDetId id() const
Return the RPCChamberId of this chamber.
Definition: RPCChamber.cc:26
RPCChamber.h
RPCRoll.h
ReferenceCountingPointer
Definition: ReferenceCounted.h:60
RPCChamber::rolls
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:40
RPCChamber::components
std::vector< const GeomDet * > components() const override
Return the rolls in the chamber.
Definition: RPCChamber.cc:34
RPCChamber
Definition: RPCChamber.h:19
RPCChamber::operator==
bool operator==(const RPCChamber &ch) const
equal if the id is the same
Definition: RPCChamber.cc:30
DetId
Definition: DetId.h:17
RPCChamber::RPCChamber
RPCChamber(RPCDetId id, const ReferenceCountingPointer< BoundPlane > &plane)
Constructor.
Definition: RPCChamber.cc:19
RPCChamber::theRolls
std::vector< const RPCRoll * > theRolls
Definition: RPCChamber.h:59
RPCChamber::theId
RPCDetId theId
Definition: RPCChamber.h:56
RPCChamber::add
void add(RPCRoll *rl)
Add Roll to the chamber which takes ownership.
Definition: RPCChamber.cc:32
RPCChamber::roll
const RPCRoll * roll(RPCDetId id) const
Return the Roll corresponding to the given id.
Definition: RPCChamber.cc:44
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29