CMS 3D CMS Logo

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