53 : _stat(stat), _debug(debug) {
150 if (
station() == 4 && nsl == 2) {
151 std::cout <<
"No theta superlayer in station 4!" << std::endl;
175 if (nlay == 4 && ntube == 1) {
176 std::cout <<
"ATTENTION: no wire nuber 1 for 4th layer!!!" << std::endl;
197 if (
station() != 4 || sl != 2) {
202 std::cout <<
"No theta superlayer in station 4!" << std::endl;
227 for (i = 0; i < 3; i++) {
228 if (
station() == 4 && i == 1) {
246 << std::setw(4) << std::setprecision(1);
252 <<
"cm, Phi=" << pp.
phi() * 180 / 3.14159;
253 std::cout <<
" deg, Z=" << pp.
z() <<
" cm" << std::endl;
254 std::cout <<
"Rotation: ANGLE=" <<
phiCh() * 180 / 3.14159 << std::endl;
256 std::cout <<
"Z of superlayers: phi=" <<
ZSL(1) <<
", ";
260 <<
nCell(3) << std::endl;
267 if (sl < 1 || sl > 3) {
268 std::cout <<
"DTTrigGeom::ZSL: wrong SL number: " << sl;
269 std::cout << -999 <<
" returned" << std::endl;
281 <<
"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++) {
292 if (
station() != 4 || ii != 2) {
293 for (jj = 1; jj <= 4; jj++) {
294 std::cout <<
" SL=" << ii <<
", lay=" << jj <<
", wire 1 position=";
308 <<
"cm, Phi=" << gp1.
phi() * 180 / 3.14159 <<
" deg, Z=" << gp1.
z()
309 <<
" cm" << std::endl;
315 <<
"cm, Phi=" << gp2.
phi() * 180 / 3.14159
316 <<
" deg, Z=" << gp2.
z() <<
" cm" << std::endl;
322 <<
"cm, Phi=" << gp3.
phi() * 180 / 3.14159 <<
" deg, Z=" << gp3.
z()
323 <<
" cm" << std::endl;
327 std::cout <<
"******************************************************" 339 string name =
"Lut_from_CMSSW_geom";
358 fout.open(name.c_str(), ofstream::app);
375 float SL_shift = xBTI1_3 - xBTI1_1;
394 d = fabs(traco_1.
x());
395 xcn = fabs(traco_1.
y());
398 xcn = xcn + SL_shift;
399 xcn_sign =
static_cast<int>(pp.
y() / fabs(pp.
y())) *
400 static_cast<int>(traco_1.
y() / fabs(traco_1.
y()));
402 xcn_sign = -xcn_sign;
403 xcn = xcn * xcn_sign;
405 float m1 = (traco_2.
y() - traco_1.
y()) / (traco_2.
x() - traco_1.
x());
406 float q1 = traco_1.
y() - m1 * traco_1.
x();
408 float xn = q1 / (m - m1);
411 d =
sqrt(xn * xn + yn * yn);
412 xcn =
sqrt((xn - traco_1.
x()) * (xn - traco_1.
x()) +
413 (yn - traco_1.
y()) * (yn - traco_1.
y()));
416 xcn = xcn + SL_shift;
418 float diff = (pp.
x() - traco_1.
x()) * traco_1.
y();
419 xcn_sign =
static_cast<int>(diff / fabs(diff));
420 xcn = xcn * xcn_sign;
433 short int High_byte = (btic >> 8 & 0x00FF);
434 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0')
438 short int DSPmantissa = 0;
439 short int DSPexp = 0;
444 (DSPmantissa & 0x00FF);
445 High_byte = (DSPmantissa >> 8 & 0x00FF);
446 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0')
448 Low_byte = (DSPexp & 0x00FF);
449 High_byte = (DSPexp >> 8 & 0x00FF);
450 fout << setw(2) << setfill(
'0') << High_byte << setw(2) << setfill(
'0')
458 (DSPmantissa & 0x00FF);
459 High_byte = (DSPmantissa >> 8 & 0x00FF);
460 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0')
462 Low_byte = (DSPexp & 0x00FF);
463 High_byte = (DSPexp >> 8 & 0x00FF);
464 fout << setw(2) << setfill(
'0') << High_byte << setw(2) << setfill(
'0')
470 High_byte = (xcn_sign >> 8 & 0x00FF);
471 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0')
472 << Low_byte <<
dec <<
"\n";
525 memcpy(&pl, &f,
sizeof(
float));
527 if ((pl & 0x80000000) != 0)
529 lm = (0x800000 | (pl & 0x7FFFFF));
532 DSPexp = ((pl >> 23) & 0xFF) - 126;
533 DSPmantissa = (short)lm;
535 DSPmantissa = -DSPmantissa;
584 int nsl =
id.superlayer();
590 float zt = -
cellH() * 3. / 2.;
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
int sector() const
Return sector number.
const DTSuperLayer * superLayer(const DTSuperLayerId &id) const
Return the superlayer corresponding to the given id.
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.
DTTrigGeom(const DTChamber *stat, bool debug)
Constructor.
Point3DBase< Scalar, LocalTag > LocalPoint
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
const DTLayer * layer(const DTLayerId &id) const
Return the layer corresponding to the given id.
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.
const Plane & surface() const
The nominal surface of the GeomDet.
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.
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.
constexpr uint16_t localX(uint16_t px)
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.
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.