23 std::vector<float> fpar;
24 std::vector<float> gtran;
25 std::vector<float> grmat;
26 std::vector<float> fupar;
27 std::vector<double>::const_iterator it, endIt;
28 const std::vector<DetId>& detids(rig.
detIds());
30 for (
size_t idt = 0; idt < detids.size(); ++idt) {
33 int jring = detid.
ring();
37 for ( it = rig.
shapeStart(idt); it != endIt; ++it) {
38 fpar.emplace_back( (
float)(*it) );
43 for ( it = rig.
tranStart(idt); it != endIt; ++it ) {
44 gtran.emplace_back((
float)(*it));
48 for ( it = rig.
rotStart(idt) ; it != endIt; ++it ) {
49 grmat.emplace_back((
float)(*it));
65 numfuPars = fu + 1 + size_t(cscpars.
pfupars[fu]);
70 <<
" in pfupars and go to " << numfuPars <<
"." << std::endl;
71 for ( ++fu; fu < numfuPars; ++fu ) {
73 fupar.emplace_back(cscpars.
pfupars[fu]);
82 size_t numgrp =
static_cast<size_t>(cscpars.
pfupars[fu]);
83 size_t maxFu = fu + 1 + numgrp;
85 for ( ;fu < maxFu; ++fu ) {
89 for ( ;fu < maxFu; ++fu ) {
112 if ( !theGeometry->centreTIOffsets() ) fupar[30] = 0.;
114 buildChamber (theGeometry, detid, fpar, fupar, gtran, grmat, wg );
120 const std::shared_ptr<CSCGeometry>& theGeometry
122 ,
const std::vector<float>& fpar
123 ,
const std::vector<float>& fupar
124 ,
const std::vector<float>& gtran
125 ,
const std::vector<float>& grmat
131 int jend = chamberId.
endcap();
132 int jstat = chamberId.
station();
133 int jring = chamberId.
ring();
135 int jlay = chamberId.
layer();
137 if (jlay != 0 )
edm::LogWarning(
myName) <<
"Error! CSCGeometryBuilderFromDDD was fed layer id = " << jlay <<
"\n";
139 const size_t kNpar = 4;
140 if ( fpar.size() != kNpar )
142 << kNpar <<
", found npar=" << fpar.size() << std::endl;
145 " C" << jch <<
" L" << jlay ;
147 <<
" hT=" << fpar[1] <<
" hD=" << fpar[2] <<
" hH=" << fpar[3] ;
148 LogTrace(
myName) <<
myName <<
": gtran[0,1,2]=" << gtran[0] <<
" " << gtran[1] <<
" " << gtran[2] ;
149 LogTrace(
myName) <<
myName <<
": grmat[0-8]=" << grmat[0] <<
" " << grmat[1] <<
" " << grmat[2] <<
" " 150 << grmat[3] <<
" " << grmat[4] <<
" " << grmat[5] <<
" " 151 << grmat[6] <<
" " << grmat[7] <<
" " << grmat[8] ;
153 <<
" upar[" << fupar.size()-1 <<
"]=" << fupar[fupar.size()-1];
164 if ( !fupar.empty() && aSpecs ==
nullptr ) {
166 aSpecs = theGeometry->buildSpecs (chamberType, fpar, fupar, wg);
167 }
else if ( fupar.empty() && aSpecs ==
nullptr ) {
168 edm::LogError(
myName) <<
"SHOULD BE THROW? Error, wg and/or fupar size are 0 BUT this Chamber Spec has not been built!";
179 grmat[3], grmat[4], grmat[5],
180 grmat[6], grmat[7], grmat[8] );
199 if ( gtran[2]<0. ) oldX *= -1;
205 float frameThickness = fupar[31]/10.;
206 float gapThickness = fupar[32]/10.;
207 float panelThickness = fupar[33]/10.;
208 float zAverageAGVtoAF = fupar[34]/10.;
210 float layerThickness = gapThickness;
211 float layerSeparation = gapThickness + panelThickness;
213 float chamberThickness = 7.*panelThickness + 6.*gapThickness + 2.*frameThickness ;
214 float hChamberThickness = chamberThickness/2.;
241 theGeometry->addChamber( chamber );
244 <<
" R" << jring <<
" C" << jch
246 <<
" t/2=" << fpar[2] <<
" (DDD) or " << hChamberThickness
247 <<
" (specs) adr=" <<
chamber ;
255 int localZwrtGlobalZ = +1;
256 if ( (jend==1 && jstat<3 ) || ( jend==2 && jstat>2 ) ) localZwrtGlobalZ = -1;
258 if ( jend == 2 ) globalZ = -1;
261 <<
", zAF-zAverageAGV=" << zAverageAGVtoAF
262 <<
", localZwrtGlobalZ=" << localZwrtGlobalZ
263 <<
", gtran[2]=" << gtran[2] ;
265 for (
short j = 1; j <= 6; ++j ) {
270 const CSCLayer* cLayer =
dynamic_cast<const CSCLayer*
> (theGeometry->idToDet( layerId ) );
272 if ( cLayer ==
nullptr ) {
283 float zlayer = gtran[2] - globalZ*zAverageAGVtoAF + localZwrtGlobalZ*(3.5-j)*layerSeparation;
287 std::array<const float, 4>
const & dims = geom->
parameters();
295 <<
" R" << jring <<
" C" << jch <<
" L" << j
298 <<
" adr=" << layer <<
" layerGeom adr=" <<
geom ;
300 chamber->addComponent(j, layer);
301 theGeometry->addLayer( layer );
305 " for chamber = " << ( chamber->id() ) <<
306 " already exists: layer address=" << cLayer <<
307 " chamber address=" << chamber <<
"\n";
void buildChamber(const std::shared_ptr< 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 rotEnd(size_t ind) const
virtual const std::array< const float, 4 > parameters() const
unique_ptr< ClusterSequence > cs
static int whatChamberType(int istation, int iring)
std::vector< double >::const_iterator rotStart(size_t ind) const
double narrowWidthOfWirePlane
const Bounds & bounds() const
Container wiresInEachGroup
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
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
void build(const std::shared_ptr< CSCGeometry > &theGeometry, const RecoIdealGeometry &rig, const CSCRecoDigiParameters &cscpars)
Build the geometry.
const std::vector< DetId > & detIds() const
virtual float thickness() const =0
std::vector< int > pUserParSize
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