CMS 3D CMS Logo

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