CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCChamber.cc
Go to the documentation of this file.
1 
7 
9 
10 
12  // Delete all layers
13  for (std::vector<const CSCLayer*>::const_iterator i=theComponents.begin();
14  i!=theComponents.end(); ++i){
15  delete (*i);
16  }
17 }
18 
19 
20 std::vector<const GeomDet*>
22  return std::vector <const GeomDet*>(theComponents.begin(),theComponents.end());
23 }
24 
25 
27  return layer(CSCDetId(id.rawId()));
28 }
29 
30 
31 void CSCChamber::addComponent( int n, const CSCLayer* gd ) {
32 
33  if ((n>0) && (n<7))
34  theComponents[n-1] = gd;
35  else
36  edm::LogError("CSC") << "Each chamber has only SIX layers.";
37 }
38 
39 const CSCLayer* CSCChamber::layer(CSCDetId iid) const {
40  if (iid.chamberId()!=id()) return 0; // not in this chamber
41  return layer(iid.layer());
42 }
43 
44 const CSCLayer* CSCChamber::layer(int ilay) const{
45 
46  if ((ilay>0) && (ilay<7))
47  return theComponents[ilay-1];
48  else {
49  return 0;
50  }
51 }
int i
Definition: DBlmapReader.cc:9
CSCDetId id() const
Get the (concrete) DetId.
Definition: CSCChamber.h:37
void addComponent(int n, const CSCLayer *gd)
Add a layer.
Definition: CSCChamber.cc:31
int layer() const
Definition: CSCDetId.h:74
virtual std::vector< const GeomDet * > components() const
Return the layers in this chamber.
Definition: CSCChamber.cc:21
std::vector< const CSCLayer * > theComponents
Definition: CSCChamber.h:69
CSCDetId chamberId() const
Definition: CSCDetId.h:66
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
Definition: CSCChamber.cc:39
virtual const GeomDet * component(DetId id) const
Return the layer with a given id in this chamber.
Definition: CSCChamber.cc:26
Definition: DetId.h:18