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 
9 
11 
12 
14  // Delete all layers
15  for (std::vector<const CSCLayer*>::const_iterator i=theComponents.begin();
16  i!=theComponents.end(); ++i){
17  delete (*i);
18  }
19 }
20 
21 
22 std::vector<const GeomDet*>
24  return std::vector <const GeomDet*>(theComponents.begin(),theComponents.end());
25 }
26 
27 
29  return layer(CSCDetId(id.rawId()));
30 }
31 
32 
33 void CSCChamber::addComponent( int n, const CSCLayer* gd ) {
34 
35  if ((n>0) && (n<7))
36  theComponents[n-1] = gd;
37  else
38  edm::LogError("CSC") << "Each chamber has only SIX layers.";
39 }
40 
41 const CSCLayer* CSCChamber::layer(CSCDetId iid) const {
42  if (iid.chamberId()!=id()) return 0; // not in this chamber
43  return layer(iid.layer());
44 }
45 
46 const CSCLayer* CSCChamber::layer(int ilay) const{
47 
48  if ((ilay>0) && (ilay<7))
49  return theComponents[ilay-1];
50  else {
51  return 0;
52  }
53 }
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:33
int layer() const
Definition: CSCDetId.h:63
virtual std::vector< const GeomDet * > components() const
Return the layers in this chamber.
Definition: CSCChamber.cc:23
std::vector< const CSCLayer * > theComponents
Definition: CSCChamber.h:69
CSCDetId chamberId() const
Definition: CSCDetId.h:55
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
Definition: CSCChamber.cc:41
virtual const GeomDet * component(DetId id) const
Return the layer with a given id in this chamber.
Definition: CSCChamber.cc:28
Definition: DetId.h:20