CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RPCChamber.cc
Go to the documentation of this file.
1 
9 /* This Class Header */
11 
12 /* Collaborating Class Header */
14 
15 
16 /* C++ Headers */
17 #include <iostream>
18 
19 /* ====================================================================== */
20 
21 /* Constructor */
24  GeomDet(plane), theId(id)
25 {
26  setDetId(id);
27 }
28 
29 /* Destructor */
31 }
32 
33 
36 {
37  return theId;
38 }
39 
40 /* Operations */
41 
42 bool
44  return this->id()==ch.id();
45 }
46 
47 
48 
49 void
51  theRolls.push_back(rl);
52 }
53 
54 
55 
56 std::vector<const GeomDet*>
58  return std::vector<const GeomDet*>(theRolls.begin(), theRolls.end());
59 }
60 
61 
62 
63 const GeomDet*
65  return roll(RPCDetId(id.rawId()));
66 }
67 
68 
69 const std::vector<const RPCRoll*>&
71 {
72  return theRolls;
73 }
74 
75 int
77 {
78  return theRolls.size();
79 }
80 
81 const RPCRoll*
83 {
84  if (id.chamberId()!=theId) return 0; // not in this Roll!
85  return roll(id.roll());
86 }
87 
88 
89 const RPCRoll*
90 RPCChamber::roll(int isl) const
91 {
92  for (std::vector<const RPCRoll*>::const_iterator i = theRolls.begin();
93  i!= theRolls.end(); ++i) {
94  if ((*i)->id().roll()==isl)
95  return (*i);
96  }
97  return 0;
98 }
99 
void add(RPCRoll *rl)
Add Roll to the chamber which takes ownership.
Definition: RPCChamber.cc:50
int i
Definition: DBlmapReader.cc:9
virtual std::vector< const GeomDet * > components() const
Return the rolls in the chamber.
Definition: RPCChamber.cc:57
void setDetId(DetId id)
Definition: GeomDet.h:97
const RPCRoll * roll(RPCDetId id) const
Return the Roll corresponding to the given id.
Definition: RPCChamber.cc:82
virtual const GeomDet * component(DetId id) const
Return the sub-component (roll) with a given id in this chamber.
Definition: RPCChamber.cc:64
RPCDetId id() const
Return the RPCChamberId of this chamber.
Definition: RPCChamber.cc:35
const std::vector< const RPCRoll * > & rolls() const
Return the Rolls.
Definition: RPCChamber.cc:70
Definition: DetId.h:20
virtual ~RPCChamber()
Destructor.
Definition: RPCChamber.cc:30
std::vector< const RPCRoll * > theRolls
Definition: RPCChamber.h:62
int nrolls() const
Retunr numbers of rolls.
Definition: RPCChamber.cc:76
RPCDetId theId
Definition: RPCChamber.h:59
RPCChamber(RPCDetId id, const ReferenceCountingPointer< BoundPlane > &plane)
Constructor.
Definition: RPCChamber.cc:22
bool operator==(const RPCChamber &ch) const
equal if the id is the same
Definition: RPCChamber.cc:43