30 std::vector<float> fpar;
31 std::vector<float> gtran;
32 std::vector<float> grmat;
33 std::vector<float> fupar;
34 std::vector<double>::const_iterator it, endIt;
35 const std::vector<DetId>& detids(rig.
detIds());
37 for (
size_t idt = 0; idt < detids.size(); ++idt) {
41 int jring = detid.
ring();
46 for ( it = rig.
shapeStart(idt); it != endIt; ++it) {
47 fpar.push_back( (
float)(*it) );
52 for ( it = rig.
tranStart(idt); it != endIt; ++it ) {
53 gtran.push_back((
float)(*it));
57 for ( it = rig.
rotStart(idt) ; it != endIt; ++it ) {
58 grmat.push_back((
float)(*it));
79 numfuPars = fu + 1 + size_t(cscpars.
pfupars[fu]);
84 <<
" in pfupars and go to " << numfuPars <<
"." << std::endl;
86 for ( ++fu; fu < numfuPars; ++fu ) {
88 fupar.push_back(cscpars.
pfupars[fu]);
100 size_t numgrp =
static_cast<size_t>(cscpars.
pfupars[fu]);
101 size_t maxFu = fu + 1 + numgrp;
103 for ( ;fu < maxFu; ++fu ) {
109 for ( ;fu < maxFu; ++fu ) {
133 if ( !theGeometry->centreTIOffsets() ) fupar[30] = 0.;
135 buildChamber (theGeometry, detid, fpar, fupar, gtran, grmat, wg );
142 boost::shared_ptr<CSCGeometry> theGeometry
144 ,
const std::vector<float>& fpar
145 ,
const std::vector<float>& fupar
146 ,
const std::vector<float>& gtran
147 ,
const std::vector<float>& grmat
153 int jend = chamberId.
endcap();
154 int jstat = chamberId.
station();
155 int jring = chamberId.
ring();
157 int jlay = chamberId.
layer();
159 if (jlay != 0 )
edm::LogWarning(
myName) <<
"Error! CSCGeometryBuilderFromDDD was fed layer id = " << jlay <<
"\n";
161 const size_t kNpar = 4;
162 if ( fpar.size() != kNpar )
164 << kNpar <<
", found npar=" << fpar.size() << std::endl;
167 " C" << jch <<
" L" << jlay ;
169 <<
" hT=" << fpar[1] <<
" hD=" << fpar[2] <<
" hH=" << fpar[3] ;
170 LogTrace(
myName) <<
myName <<
": gtran[0,1,2]=" << gtran[0] <<
" " << gtran[1] <<
" " << gtran[2] ;
171 LogTrace(
myName) <<
myName <<
": grmat[0-8]=" << grmat[0] <<
" " << grmat[1] <<
" " << grmat[2] <<
" "
172 << grmat[3] <<
" " << grmat[4] <<
" " << grmat[5] <<
" "
173 << grmat[6] <<
" " << grmat[7] <<
" " << grmat[8] ;
175 <<
" upar[" << fupar.size()-1 <<
"]=" << fupar[fupar.size()-1];
189 if ( fupar.size() != 0 && aSpecs == 0 ) {
191 aSpecs = theGeometry->buildSpecs (chamberType, fpar, fupar, wg);
192 }
else if ( fupar.size() == 0 && aSpecs == 0 ) {
193 std::cout <<
"SHOULD BE THROW? Error, wg and/or fupar size are 0 BUT this Chamber Spec has not been built!" << std::endl;
208 grmat[3], grmat[4], grmat[5],
209 grmat[6], grmat[7], grmat[8] );
228 if ( gtran[2]<0. ) oldX *= -1;
234 float frameThickness = fupar[31]/10.;
235 float gapThickness = fupar[32]/10.;
236 float panelThickness = fupar[33]/10.;
237 float zAverageAGVtoAF = fupar[34]/10.;
239 float layerThickness = gapThickness;
240 float layerSeparation = gapThickness + panelThickness;
242 float chamberThickness = 7.*panelThickness + 6.*gapThickness + 2.*frameThickness ;
243 float hChamberThickness = chamberThickness/2.;
272 theGeometry->addChamber( chamber );
275 <<
" R" << jring <<
" C" << jch
277 <<
" t/2=" << fpar[2] <<
" (DDD) or " << hChamberThickness
278 <<
" (specs) adr=" << chamber ;
286 int localZwrtGlobalZ = +1;
287 if ( (jend==1 && jstat<3 ) || ( jend==2 && jstat>2 ) ) localZwrtGlobalZ = -1;
289 if ( jend == 2 ) globalZ = -1;
295 <<
", zAF-zAverageAGV=" << zAverageAGVtoAF
296 <<
", localZwrtGlobalZ=" << localZwrtGlobalZ
297 <<
", gtran[2]=" << gtran[2] ;
299 for (
short j = 1;
j <= 6; ++
j ) {
304 const CSCLayer* cLayer =
dynamic_cast<const CSCLayer*
> (theGeometry->idToDet( layerId ) );
317 float zlayer = gtran[2] - globalZ*zAverageAGVtoAF + localZwrtGlobalZ*(3.5-
j)*layerSeparation;
324 dims[2] = layerThickness/2.;
334 <<
" R" << jring <<
" C" << jch <<
" L" <<
j
337 <<
" adr=" << layer <<
" layerGeom adr=" <<
geom ;
339 chamber->addComponent(
j, layer);
340 theGeometry->addLayer( layer );
344 " for chamber = " << ( chamber->id() ) <<
345 " already exists: layer address=" << cLayer <<
346 " chamber address=" << chamber <<
"\n";
std::vector< double >::const_iterator rotEnd(size_t ind) const
static int whatChamberType(int istation, int iring)
const CSCLayerGeometry *const evenLayerGeometry(int iendcap) const
std::vector< double >::const_iterator rotStart(size_t ind) const
double narrowWidthOfWirePlane
void buildChamber(boost::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.
Container wiresInEachGroup
static BoundPlanePointer build(const PositionType &pos, const RotationType &rot, const Bounds *bounds, MediumProperties *mp=0)
TkRotation & rotateAxes(const Basic3DVector< T > &newX, const Basic3DVector< T > &newY, const Basic3DVector< T > &newZ)
std::vector< float > pfupars
virtual float thickness() const =0
virtual const std::vector< float > parameters() const
std::vector< double >::const_iterator tranEnd(size_t ind) const
std::vector< int > pChamberType
std::vector< double >::const_iterator tranStart(size_t ind) const
std::vector< int > pUserParOffset
double wideWidthOfWirePlane
const std::vector< DetId > & detIds() const
const Bounds & bounds() const
std::vector< int > pUserParSize
CSCGeometryBuilder()
Constructor.
const CSCLayerGeometry *const oddLayerGeometry(int iendcap) const
Accessors for LayerGeometry's.
std::vector< double >::const_iterator shapeEnd(size_t ind) const
void build(boost::shared_ptr< CSCGeometry > theGeometry, const RecoIdealGeometry &rig, const CSCRecoDigiParameters &cscpars)
Build the geometry.
std::vector< double >::const_iterator shapeStart(size_t ind) const
virtual ~CSCGeometryBuilder()
Destructor.
Container consecutiveGroups
double alignmentPinToFirstWire
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.