20 std::vector<float> fpar;
21 std::vector<float> gtran;
22 std::vector<float> grmat;
23 std::vector<float> fupar;
24 std::vector<double>::const_iterator it, endIt;
25 const std::vector<DetId>& detids(rig.
detIds());
27 for (
size_t idt = 0; idt < detids.size(); ++idt) {
30 int jring = detid.
ring();
34 for (it = rig.
shapeStart(idt); it != endIt; ++it) {
35 fpar.emplace_back((
float)(*it));
40 for (it = rig.
tranStart(idt); it != endIt; ++it) {
41 gtran.emplace_back((
float)(*it));
45 for (it = rig.
rotStart(idt); it != endIt; ++it) {
46 grmat.emplace_back((
float)(*it));
62 numfuPars = fu + 1 + size_t(cscpars.
pfupars[fu]);
68 <<
" in pfupars and go to " << numfuPars <<
"." << std::endl;
69 for (++fu; fu < numfuPars; ++fu) {
71 fupar.emplace_back(cscpars.
pfupars[fu]);
80 size_t numgrp =
static_cast<size_t>(cscpars.
pfupars[fu]);
81 size_t maxFu = fu + 1 + numgrp;
83 for (; fu < maxFu; ++fu) {
87 for (; fu < maxFu; ++fu) {
113 buildChamber(theGeometry, detid, fpar, fupar, gtran, grmat, wg);
120 const std::vector<float>& fpar,
121 const std::vector<float>& fupar,
122 const std::vector<float>& gtran,
123 const std::vector<float>& grmat,
128 int jend = chamberId.
endcap();
129 int jstat = chamberId.
station();
130 int jring = chamberId.
ring();
132 int jlay = chamberId.
layer();
137 const size_t kNpar = 4;
138 if (fpar.size() != kNpar)
139 edm::LogError(
myName) <<
"Error, expected npar=" << kNpar <<
", found npar=" << fpar.size() << std::endl;
141 LogTrace(
myName) <<
myName <<
": E" << jend <<
" S" << jstat <<
" R" << jring <<
" C" << jch <<
" L" << jlay;
142 LogTrace(
myName) <<
myName <<
": npar=" << fpar.size() <<
" hB=" << fpar[0] <<
" hT=" << fpar[1] <<
" hD=" << fpar[2]
143 <<
" hH=" << fpar[3];
144 LogTrace(
myName) <<
myName <<
": gtran[0,1,2]=" << gtran[0] <<
" " << gtran[1] <<
" " << gtran[2];
145 LogTrace(
myName) <<
myName <<
": grmat[0-8]=" << grmat[0] <<
" " << grmat[1] <<
" " << grmat[2] <<
" " << grmat[3]
146 <<
" " << grmat[4] <<
" " << grmat[5] <<
" " << grmat[6] <<
" " << grmat[7] <<
" " << grmat[8];
147 LogTrace(
myName) <<
myName <<
": nupar=" << fupar.size() <<
" upar[0]=" << fupar[0] <<
" upar[" << fupar.size() - 1
148 <<
"]=" << fupar[fupar.size() - 1];
157 if (!fupar.empty() && aSpecs ==
nullptr) {
159 aSpecs = theGeometry.
buildSpecs(chamberType, fpar, fupar, wg);
160 }
else if (fupar.empty() && aSpecs ==
nullptr) {
162 <<
"SHOULD BE THROW? Error, wg and/or fupar size are 0 BUT this Chamber Spec has not been built!";
173 grmat[0], grmat[1], grmat[2], grmat[3], grmat[4], grmat[5], grmat[6], grmat[7], grmat[8]);
199 float frameThickness = fupar[31] / 10.;
200 float gapThickness = fupar[32] / 10.;
201 float panelThickness = fupar[33] / 10.;
202 float zAverageAGVtoAF = fupar[34] / 10.;
204 float layerThickness = gapThickness;
205 float layerSeparation = gapThickness + panelThickness;
207 float chamberThickness = 7. * panelThickness + 6. * gapThickness + 2. * frameThickness;
208 float hChamberThickness = chamberThickness / 2.;
237 LogTrace(
myName) <<
myName <<
": Create chamber E" << jend <<
" S" << jstat <<
" R" << jring <<
" C" << jch
238 <<
" z=" << gtran[2] <<
" t/2=" << fpar[2] <<
" (DDD) or " << hChamberThickness
247 int localZwrtGlobalZ = +1;
248 if ((jend == 1 && jstat < 3) || (jend == 2 && jstat > 2))
249 localZwrtGlobalZ = -1;
254 LogTrace(
myName) <<
myName <<
": layerSeparation=" << layerSeparation <<
", zAF-zAverageAGV=" << zAverageAGVtoAF
255 <<
", localZwrtGlobalZ=" << localZwrtGlobalZ <<
", gtran[2]=" << gtran[2];
257 for (
short j = 1;
j <= 6; ++
j) {
263 if (cLayer ==
nullptr) {
271 float zlayer = gtran[2] - globalZ * zAverageAGVtoAF + localZwrtGlobalZ * (3.5 -
j) * layerSeparation;
275 std::array<const float, 4>
const& dims = geom->
parameters();
282 LogTrace(
myName) <<
myName <<
": Create layer E" << jend <<
" S" << jstat <<
" R" << jring <<
" C" << jch
283 <<
" L" <<
j <<
" z=" << zlayer <<
" t=" << layerThickness <<
" or " 286 chamber->addComponent(
j, layer);
290 <<
" already exists: layer address=" << cLayer <<
" chamber address=" << chamber <<
"\n";
std::vector< double >::const_iterator rotEnd(size_t ind) const
const CSCChamberSpecs * buildSpecs(int iChamberType, const std::vector< float > &fpar, const std::vector< float > &fupar, const CSCWireGroupPackage &wg)
virtual const std::array< const float, 4 > parameters() const
const GeomDet * idToDet(DetId) const override
unique_ptr< ClusterSequence > cs
static int whatChamberType(int istation, int iring)
std::vector< double >::const_iterator rotStart(size_t ind) const
double narrowWidthOfWirePlane
bool centreTIOffsets() const
void addChamber(CSCChamber *ch)
Add a chamber with given DetId.
const Bounds & bounds() const
Container wiresInEachGroup
void build(CSCGeometry &theGeometry, const RecoIdealGeometry &rig, const CSCRecoDigiParameters &cscpars)
Build the geometry.
const Plane & surface() const
The nominal surface of the GeomDet.
TkRotation & rotateAxes(const Basic3DVector< T > &newX, const Basic3DVector< T > &newY, const Basic3DVector< T > &newZ)
std::vector< float > pfupars
void addLayer(CSCLayer *l)
Add a DetUnit.
const CSCChamberSpecs * findSpecs(int iChamberType)
void buildChamber(CSCGeometry &theGeometry, CSCDetId chamberId, const std::vector< float > &fpar, const std::vector< float > &fupar, const std::vector< float > >ran, const std::vector< float > &grmat, const CSCWireGroupPackage &wg)
Build one CSC chamber, and its component layers, and add them to the geometry.
std::vector< double >::const_iterator tranEnd(size_t ind) const
std::vector< int > pChamberType
static PlanePointer build(Args &&...args)
std::vector< double >::const_iterator tranStart(size_t ind) const
const CSCLayerGeometry * evenLayerGeometry(int iendcap) const
std::vector< int > pUserParOffset
double wideWidthOfWirePlane
const std::vector< DetId > & detIds() const
virtual float thickness() const =0
std::vector< int > pUserParSize
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
CSCGeometryBuilder()
Constructor.
const CSCLayerGeometry * oddLayerGeometry(int iendcap) const
Accessors for LayerGeometry's.
std::vector< double >::const_iterator shapeEnd(size_t ind) const
std::vector< double >::const_iterator shapeStart(size_t ind) const
virtual ~CSCGeometryBuilder()
Destructor.
Container consecutiveGroups
double alignmentPinToFirstWire