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