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];
178 const CSCChamber* chamber = theGeometry->chamber( chamberId );
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.;
271 theGeometry->addChamber( chamber );
274 <<
" R" << jring <<
" C" << jch
276 <<
" t/2=" << fpar[2] <<
" (DDD) or " << hChamberThickness
277 <<
" (specs) adr=" << chamber ;
285 int localZwrtGlobalZ = +1;
286 if ( (jend==1 && jstat<3 ) || ( jend==2 && jstat>2 ) ) localZwrtGlobalZ = -1;
288 if ( jend == 2 ) globalZ = -1;
294 <<
", zAF-zAverageAGV=" << zAverageAGVtoAF
295 <<
", localZwrtGlobalZ=" << localZwrtGlobalZ
296 <<
", gtran[2]=" << gtran[2] ;
298 for (
short j = 1;
j <= 6; ++
j ) {
303 const CSCLayer* cLayer =
dynamic_cast<const CSCLayer*
> (theGeometry->idToDet( layerId ) );
316 float zlayer = gtran[2] - globalZ*zAverageAGVtoAF + localZwrtGlobalZ*(3.5-
j)*layerSeparation;
320 std::array<const float, 4>
const & dims = geom->
parameters();
328 <<
" R" << jring <<
" C" << jch <<
" L" <<
j
331 <<
" adr=" << layer <<
" layerGeom adr=" <<
geom ;
333 chamber->addComponent(
j, layer);
334 theGeometry->addLayer( layer );
338 " for chamber = " << ( chamber->id() ) <<
339 " already exists: layer address=" << cLayer <<
340 " chamber address=" << chamber <<
"\n";
auto_ptr< ClusterSequence > cs
std::vector< double >::const_iterator rotEnd(size_t ind) const
virtual const std::array< const float, 4 > parameters() const
static int whatChamberType(int istation, int iring)
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.
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
virtual float thickness() const =0
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
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
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