147 std::cout <<
"No theta superlayer in station 4!" << std::endl;
170 if ( nlay==4 && ntube==1) {
171 std::cout <<
"ATTENTION: no wire nuber 1 for 4th layer!!!" << std::endl;
197 std::cout <<
"No theta superlayer in station 4!" << std::endl;
243 std::cout << setiosflags(std::ios::showpoint | std::ios::fixed) << std::setw(4) <<
244 std::setprecision(1);
249 std::cout <<
"Position: Mag=" << pp.
mag() <<
"cm, Phi=" << pp.
phi()*180/3.14159;
250 std::cout <<
" deg, Z=" << pp.
z() <<
" cm" << std::endl;
251 std::cout <<
"Rotation: ANGLE=" <<
phiCh()*180/3.14159 << std::endl;
253 std::cout <<
"Z of superlayers: phi=" <<
ZSL(1) <<
", ";
257 " sl 3 " <<
nCell(3) << std::endl;
267 std::cout <<
"DTTrigGeom::ZSL: wrong SL number: " << sl;
268 std::cout << -999 <<
" returned" << std::endl;
281 std::cout <<
"Position: Mag=" << pp.
mag() <<
"cm, Phi=" << pp.
phi()*180/3.14159;
282 std::cout <<
" deg, Z=" << pp.
z() <<
" cm" << std::endl;
283 std::cout <<
"Rotation: ANGLE=" <<
phiCh()*180/3.14159 << std::endl;
284 std::cout <<
"Z of superlayers: phi=" <<
ZSL(1) <<
", ";
287 " SL3=" <<
nCell(3) << std::endl;
288 std::cout <<
"First wire positions:" << std::endl;
291 for( ii = 1; ii<=3; ii++ ) {
293 for ( jj =1; jj<=4; jj++ ) {
294 std::cout <<
" SL=" << ii <<
", lay=" << jj <<
", wire 1 position=";
308 std::cout <<
" Position: R=" << gp1.
perp() <<
"cm, Phi=" << gp1.
phi()*180/3.14159 <<
" deg, Z=" << gp1.
z() <<
" cm" << std::endl;
314 std::cout <<
" Position: R=" << gp2.
perp() <<
"cm, Phi=" << gp2.
phi()*180/3.14159 <<
" deg, Z=" << gp2.
z() <<
" cm" << std::endl;
319 std::cout <<
" Position: R=" << gp3.
perp() <<
"cm, Phi=" << gp3.
phi()*180/3.14159 <<
" deg, Z=" << gp3.
z() <<
" cm" << std::endl;
323 std::cout <<
"******************************************************" << std::endl;
335 string name =
"Lut_from_CMSSW_geom";
354 fout.open(name.c_str(),ofstream::app);
367 float SL_shift = xBTI1_3 - xBTI1_1;
384 d = fabs(traco_1.
x());
385 xcn = fabs(traco_1.
y());
389 xcn_sign =
static_cast<int>(pp.
y()/fabs(pp.
y()))*
static_cast<int>(traco_1.
y()/fabs(traco_1.
y()));
391 xcn_sign = - xcn_sign;
395 float m1 = (traco_2.
y()-traco_1.
y())/(traco_2.
x()-traco_1.
x());
396 float q1 = traco_1.
y()-m1*traco_1.
x();
398 float xn = q1/(m-m1);
401 d =
sqrt(xn*xn+yn*yn);
402 xcn =
sqrt( (xn-traco_1.
x())*(xn-traco_1.
x()) + (yn-traco_1.
y())*(yn-traco_1.
y()) );
407 float diff = (pp.
x()-traco_1.
x())*traco_1.
y();
408 xcn_sign =
static_cast<int>(diff/fabs(diff));
419 short int Low_byte = (btic & 0x00FF);
420 short int High_byte =( btic>>8 & 0x00FF);
421 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0') << Low_byte;
424 short int DSPmantissa = 0;
425 short int DSPexp = 0;
429 Low_byte = (DSPmantissa & 0x00FF);
430 High_byte =( DSPmantissa>>8 & 0x00FF);
431 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0') << Low_byte;
432 Low_byte = (DSPexp & 0x00FF);
433 High_byte =( DSPexp>>8 & 0x00FF);
434 fout << setw(2) << setfill(
'0') << High_byte << setw(2) << setfill(
'0') << Low_byte;
440 Low_byte = (DSPmantissa & 0x00FF);
441 High_byte =( DSPmantissa>>8 & 0x00FF);
442 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0') << Low_byte;
443 Low_byte = (DSPexp & 0x00FF);
444 High_byte =( DSPexp>>8 & 0x00FF);
445 fout << setw(2) << setfill(
'0') << High_byte << setw(2) << setfill(
'0') << Low_byte;
448 Low_byte = (xcn_sign & 0x00FF);
449 High_byte =( xcn_sign>>8 & 0x00FF);
450 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0') << Low_byte << dec <<
"\n";
505 memcpy(&pl,&f,
sizeof(
float));
507 if((pl & 0x80000000)!=0)
509 lm = ( 0x800000 | (pl & 0x7FFFFF));
512 DSPexp = ((pl>>23)&0xFF)-126;
513 DSPmantissa = (short)lm;
515 DSPmantissa = - DSPmantissa;
564 int nsl =
id.superlayer();
570 float zt = -
cellH() * 3./2.;
DTTrigGeom(DTChamber *stat, bool debug)
Constructor.
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
int sector() const
Return sector number.
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Local3DVector LocalVector
int mapTubeInFEch(int nsl, int nlay, int ntube) const
Staggering of first wire of layer respect to default: obsolete 19/6/06.
float phiCh() const
Rotation angle of chamber (deg)
float cellPitch() const
Width of a cell (cm) i.e. distance between ywo wires.
int wheel() const
Return wheel number.
void setGeom(const DTChamber *stat)
Set/Update Geometry.
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Geom::Phi< T > phi() const
void dumpLUT(short int btic)
Dump the LUT for this chamber.
GlobalPoint toGlobal(const LocalPoint p) const
Go to CMS coordinate system for a point.
void dumpGeom() const
Dump the geometry.
int firstChannel() const
Returns the wire number of the first wire.
const DTTopology & specificTopology() const
float distSL() const
Distance between the phi view superlayers (cms)
float cellH() const
Height of a cell (cm)
LocalPoint toLocal(const GlobalPoint &gp) const
float ZcenterSL() const
Coordinate of center of the 2 Phi SL.
Tan< T >::type tan(const T &t)
int posFE(int sl) const
Front End position : 1=toward negative y, 0=toward positive y.
unsigned int offset(bool)
const DTLayer * layer(DTLayerId id) const
Return the layer corresponding to the given id.
int station() const
Return station number.
int channels() const
Returns the number of wires in the layer.
LocalPoint tubePosInCh(int nsl, int nlay, int ntube) const
Wire position in chamber frame.
float phiSLOffset()
Superlayer offset in chamber front-end frame, in cm.
DTChamberId statId() const
Identifier of the associated chamber.
void getGeom()
Get the geometry from the station.
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
const DTChamber * stat() const
Associated chamber.
const BoundPlane & surface() const
The nominal surface of the GeomDet.
static int position[264][3]
void IEEE32toDSP(float f, short int &DSPmantissa, short int &DSPexp)
GlobalPoint CMSPosition(const DTBtiId obj) const
CMS position of a BTI.
int nCell(int sl) const
Number of BTIs in a required superlayer (i.e. nCells in lay 1)
float ZSL(int) const
Radial coordinate in chamber frame of center of a superlayer.
const DTSuperLayer * superLayer(DTSuperLayerId id) const
Return the superlayer corresponding to the given id.