CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCGeometry.cc
Go to the documentation of this file.
7 
8 #include <string>
9 
10 CSCGeometry::CSCGeometry(): debugV(false), gangedstripsME1a(true),
11  onlywiresME1a(false), useRealWireGeometry(true), useCentreTIOffsets(false) {
12  if ( debugV ) queryModelling();
13 }
14 
16 
17  // delete all the chambers (which will delete the layers)
18  for (ChamberContainer::const_iterator ich=theChambers.begin();
19  ich!=theChambers.end(); ++ich) delete (*ich);
20 
21  // delete specs
22  for ( CSCSpecsContainer::const_iterator it =
23  specsContainer.begin(); it!=specsContainer.end(); ++it) {
24  delete (*it).second; // they are never shared per chamber type so should be no possible double deletion.
25  }
26 
27 }
28 
29 
31  theChambers.push_back(ch);
32  addDet(ch);
33 }
34 
35 
37  theDetUnits.push_back(l);
38  theLayers.push_back(l);
39  theDetTypes.push_back(const_cast<GeomDetType*>(&(l->type()))); //@@ FIXME drop const_cast asap!
40  theDetUnitIds.push_back(l->geographicalId());
41  addDet(l);
42 }
43 
44 
46  theDetTypes.push_back(type);
47 }
48 
49 
51  theDets.push_back(det);
52  theDetIds.push_back(det->geographicalId());
53  theMap.insert(CSCDetMap::value_type(det->geographicalId(),det));
54 }
55 
56 
58 {
59  return theDetTypes;
60 }
61 
62 
64 {
65  return theDetUnits;
66 }
67 
68 
70 {
71  return theDets;
72 }
73 
74 
76 {
77  return theDetUnitIds;
78 }
79 
80 
82 {
83  return theDetIds;
84 }
85 
86 
88 {
89  return dynamic_cast<const GeomDetUnit*>(idToDet(id));
90 }
91 
92 
94  CSCDetMap::const_iterator i = theMap.find(id);
95  return (i != theMap.end()) ?
96  i->second : 0 ;
97 }
98 
99 
101 {
102  return theChambers;
103 }
104 
105 
107 {
108 // for( DetUnitContainer::const_iterator it = theDetUnits.begin();
109 // it != theDetUnits.end(); ++it ) {
110 // CSCLayer* layer = dynamic_cast<CSCLayer*>( *it );
111 // if ( layer ) theLayers.push_back( layer );
112 // }
113  return theLayers;
114 }
115 
116 
118  CSCDetId id1(id.endcap(), id.station(), id.ring(), id.chamber(), 0);
119  return dynamic_cast<const CSCChamber*>(idToDet(id1));
120 }
121 
122 
124  return dynamic_cast<const CSCLayer*>(idToDetUnit(id));
125 }
126 
128  // Dump user-selected overall modelling parameters.
129  // Only requires calling once per job.
130 
131  LogTrace("CSCGeometry|CSC") << "CSCGeometry::queryModelling entered...";
132 
133  std::string gs = " ";
134  if ( gangedstripsME1a )
135  gs = "GANGED";
136  else
137  gs = "UNGANGED";
138 
139  edm::LogInfo("CSC") << "CSCGeometry: in ME1a use " << gs << " strips" << "\n";
140 
141  std::string wo = " ";
142  if ( onlywiresME1a )
143  wo = "WIRES ONLY";
144  else
145  wo = "WIRES & STRIPS";
146 
147  edm::LogInfo("CSC") << "CSCGeometry: in ME1a use " << wo << "\n";
148 
149  std::string wg = " ";
150  if ( useRealWireGeometry )
151  wg = "REAL";
152  else
153  wg = "PSEUDO";
154 
155  edm::LogInfo("CSC") << "CSCGeometry: wires are modelled using " << wg << " wire geometry " << "\n";
156 
157  std::string cti = " ";
158  if ( useCentreTIOffsets )
159  cti = "WITH";
160  else
161  cti = "WITHOUT";
162 
163  edm::LogInfo("CSC") << "CSCGeometry: strip plane centre-to-intersection ideal " << cti << " corrections " << "\n";
164 }
165 
166 const CSCChamberSpecs* CSCGeometry::findSpecs( int iChamberType ) {
167  const CSCChamberSpecs* aSpecs = 0;
168  CSCSpecsContainer::const_iterator it = specsContainer.find( iChamberType );
169  if ( it != specsContainer.end() ) aSpecs = (*it).second;
170  return aSpecs;
171 }
172 
173 const CSCChamberSpecs* CSCGeometry::buildSpecs( int iChamberType,
174  const std::vector<float>& fpar,
175  const std::vector<float>& fupar,
176  const CSCWireGroupPackage& wg ) {
177 
178  // Note arg list order is hbot, htop, apothem, hthickness
179  TrapezoidalPlaneBounds bounds( fpar[0], fpar[1], fpar[3], fpar[2] );
180  const CSCChamberSpecs* aSpecs = new CSCChamberSpecs( this, iChamberType, bounds, fupar, wg );
181  specsContainer[ iChamberType ] = aSpecs;
182  return aSpecs;
183 }
CSCSpecsContainer specsContainer
Definition: CSCGeometry.h:176
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
void addDet(GeomDet *det)
Add a GeomDet; not to be called by the builder.
Definition: CSCGeometry.cc:50
std::vector< CSCChamber * > ChamberContainer
Definition: CSCGeometry.h:29
virtual const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.
Definition: CSCGeometry.cc:75
const CSCChamberSpecs * buildSpecs(int iChamberType, const std::vector< float > &fpar, const std::vector< float > &fupar, const CSCWireGroupPackage &wg)
Definition: CSCGeometry.cc:173
virtual const DetIdContainer & detIds() const
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: CSCGeometry.cc:81
virtual const DetUnitContainer & detUnits() const
Returm a vector of all GeomDetUnit.
Definition: CSCGeometry.cc:63
CSCDetMap theMap
Definition: CSCGeometry.h:153
virtual ~CSCGeometry()
Destructor.
Definition: CSCGeometry.cc:15
bool useRealWireGeometry
Definition: CSCGeometry.h:172
void queryModelling() const
Dump parameters for overall strip and wire modelling.
Definition: CSCGeometry.cc:127
DetContainer theDets
Definition: CSCGeometry.h:158
void addChamber(CSCChamber *ch)
Add a chamber with given DetId.
Definition: CSCGeometry.cc:30
DetUnitContainer theDetUnits
Definition: CSCGeometry.h:159
const ChamberContainer & chambers() const
Return a vector of all chambers.
Definition: CSCGeometry.cc:100
ChamberContainer theChambers
Definition: CSCGeometry.h:150
std::vector< GeomDet * > DetContainer
bool useCentreTIOffsets
Definition: CSCGeometry.h:173
DetTypeContainer theDetTypes
Definition: CSCGeometry.h:157
const GeomDetType & type() const
Definition: CSCLayer.h:33
virtual const DetContainer & dets() const
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: CSCGeometry.cc:69
void addLayer(CSCLayer *l)
Add a DetUnit.
Definition: CSCGeometry.cc:36
const CSCChamberSpecs * findSpecs(int iChamberType)
Definition: CSCGeometry.cc:166
void addDetType(GeomDetType *type)
Add a DetType.
Definition: CSCGeometry.cc:45
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: CSCGeometry.cc:87
std::vector< GeomDetUnit * > DetUnitContainer
bool gangedstripsME1a
Definition: CSCGeometry.h:170
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:74
Container::value_type value_type
#define LogTrace(id)
std::vector< GeomDetType * > DetTypeContainer
bool onlywiresME1a
Definition: CSCGeometry.h:171
Definition: DetId.h:20
virtual const GeomDet * idToDet(DetId) const
Definition: CSCGeometry.cc:93
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:117
DetIdContainer theDetIds
Definition: CSCGeometry.h:160
DetIdContainer theDetUnitIds
Definition: CSCGeometry.h:161
CSCGeometry()
Default constructor.
Definition: CSCGeometry.cc:10
LayerContainer theLayers
Definition: CSCGeometry.h:164
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to given DetId.
Definition: CSCGeometry.cc:123
virtual const DetTypeContainer & detTypes() const
Return a vector of all det types.
Definition: CSCGeometry.cc:57
std::vector< CSCLayer * > LayerContainer
Definition: CSCGeometry.h:30
const LayerContainer & layers() const
Return a vector of all layers.
Definition: CSCGeometry.cc:106
std::vector< DetId > DetIdContainer