146 if (
station() == 4 && nsl == 2) {
147 std::cout <<
"No theta superlayer in station 4!" << std::endl;
171 if (nlay == 4 && ntube == 1) {
172 std::cout <<
"ATTENTION: no wire nuber 1 for 4th layer!!!" << std::endl;
193 if (
station() != 4 || sl != 2) {
198 std::cout <<
"No theta superlayer in station 4!" << std::endl;
221 for (
i = 0;
i < 3;
i++) {
231 float posX =
tp.wirePosition(
tp.firstChannel());
244 std::cout <<
"Position: Mag=" <<
pp.mag() <<
"cm, Phi=" <<
pp.phi() * 180 / 3.14159;
245 std::cout <<
" deg, Z=" <<
pp.z() <<
" cm" << std::endl;
246 std::cout <<
"Rotation: ANGLE=" <<
phiCh() * 180 / 3.14159 << std::endl;
248 std::cout <<
"Z of superlayers: phi=" <<
ZSL(1) <<
", ";
258 if (sl < 1 || sl > 3) {
259 std::cout <<
"DTTrigGeom::ZSL: wrong SL number: " << sl;
260 std::cout << -999 <<
" returned" << std::endl;
271 std::cout <<
"Position: Mag=" <<
pp.mag() <<
"cm, Phi=" <<
pp.phi() * 180 / 3.14159;
272 std::cout <<
" deg, Z=" <<
pp.z() <<
" cm" << std::endl;
273 std::cout <<
"Rotation: ANGLE=" <<
phiCh() * 180 / 3.14159 << std::endl;
274 std::cout <<
"Z of superlayers: phi=" <<
ZSL(1) <<
", ";
277 std::cout <<
"First wire positions:" << std::endl;
280 for (
ii = 1;
ii <= 3;
ii++) {
282 for (
jj = 1;
jj <= 4;
jj++) {
283 std::cout <<
" SL=" <<
ii <<
", lay=" <<
jj <<
", wire 1 position=";
296 std::cout <<
" Position: R=" << gp1.
perp() <<
"cm, Phi=" << gp1.
phi() * 180 / 3.14159 <<
" deg, Z=" << gp1.
z()
297 <<
" cm" << std::endl;
302 std::cout <<
" Position: R=" << gp2.
perp() <<
"cm, Phi=" << gp2.
phi() * 180 / 3.14159 <<
" deg, Z=" << gp2.
z()
303 <<
" cm" << std::endl;
308 std::cout <<
" Position: R=" << gp3.
perp() <<
"cm, Phi=" << gp3.
phi() * 180 / 3.14159 <<
" deg, Z=" << gp3.
z()
309 <<
" cm" << std::endl;
313 std::cout <<
"******************************************************" << std::endl;
323 string name =
"Lut_from_CMSSW_geom";
342 fout.open(
name.c_str(), ofstream::app);
355 float SL_shift = xBTI1_3 - xBTI1_1;
374 d = fabs(traco_1.
x());
375 xcn = fabs(traco_1.
y());
378 xcn = xcn + SL_shift;
379 xcn_sign =
static_cast<int>(
pp.y() / fabs(
pp.y())) *
static_cast<int>(traco_1.
y() / fabs(traco_1.
y()));
381 xcn_sign = -xcn_sign;
382 xcn = xcn * xcn_sign;
384 float m1 = (traco_2.
y() - traco_1.
y()) / (traco_2.
x() - traco_1.
x());
385 float q1 = traco_1.
y() - m1 * traco_1.
x();
387 float xn = q1 / (
m - m1);
390 d =
sqrt(xn * xn + yn * yn);
391 xcn =
sqrt((xn - traco_1.
x()) * (xn - traco_1.
x()) + (yn - traco_1.
y()) * (yn - traco_1.
y()));
394 xcn = xcn + SL_shift;
396 float diff = (
pp.x() - traco_1.
x()) * traco_1.
y();
397 xcn_sign =
static_cast<int>(
diff / fabs(
diff));
398 xcn = xcn * xcn_sign;
409 short int Low_byte = (btic & 0x00FF);
410 short int High_byte = (btic >> 8 & 0x00FF);
411 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0') << Low_byte;
414 short int DSPmantissa = 0;
415 short int DSPexp = 0;
419 Low_byte = (DSPmantissa & 0x00FF);
420 High_byte = (DSPmantissa >> 8 & 0x00FF);
421 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0') << Low_byte;
422 Low_byte = (DSPexp & 0x00FF);
423 High_byte = (DSPexp >> 8 & 0x00FF);
424 fout << setw(2) << setfill(
'0') << High_byte << setw(2) << setfill(
'0') << Low_byte;
430 Low_byte = (DSPmantissa & 0x00FF);
431 High_byte = (DSPmantissa >> 8 & 0x00FF);
432 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0') << Low_byte;
433 Low_byte = (DSPexp & 0x00FF);
434 High_byte = (DSPexp >> 8 & 0x00FF);
435 fout << setw(2) << setfill(
'0') << High_byte << setw(2) << setfill(
'0') << Low_byte;
438 Low_byte = (xcn_sign & 0x00FF);
439 High_byte = (xcn_sign >> 8 & 0x00FF);
440 fout << setw(2) << setfill(
'0') << hex << High_byte << setw(2) << setfill(
'0') << Low_byte <<
dec <<
"\n";
492 memcpy(&pl, &
f,
sizeof(
float));
494 if ((pl & 0x80000000) != 0)
496 lm = (0x800000 | (pl & 0x7FFFFF));
499 DSPexp = ((pl >> 23) & 0xFF) - 126;
500 DSPmantissa = (short)lm;
502 DSPmantissa = -DSPmantissa;
551 int nsl =
id.superlayer();
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
const DTChamber * stat() const
Associated chamber.
int sector() const
Return sector number.
Local3DVector LocalVector
DTTrigGeom(const DTChamber *stat, bool debug)
Constructor.
Point3DBase< Scalar, LocalTag > LocalPoint
int posFE(int sl) const
Front End position : 1=toward negative y, 0=toward positive y.
float cellPitch() const
Width of a cell (cm) i.e. distance between ywo wires.
void setGeom(const DTChamber *stat)
Set/Update Geometry.
float phiCh() const
Rotation angle of chamber (deg)
Geom::Phi< T > phi() const
void dumpLUT(short int btic)
Dump the LUT for this chamber.
GlobalPoint CMSPosition(const DTBtiId obj) const
CMS position of a BTI.
LocalPoint toLocal(const GlobalPoint &gp) const
int wheel() const
Return wheel number.
const DTSuperLayer * superLayer(const DTSuperLayerId &id) const
Return the superlayer corresponding to the given id.
float distSL() const
Distance between the phi view superlayers (cms)
const DTLayer * layer(const DTLayerId &id) const
Return the layer corresponding to the given id.
Tan< T >::type tan(const T &t)
void dumpGeom() const
Dump the geometry.
DTChamberId statId() const
Identifier of the associated chamber.
const DTTopology & specificTopology() const
int station() const
Return station number.
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
float ZcenterSL() const
Coordinate of center of the 2 Phi SL.
float cellH() const
Height of a cell (cm)
const Plane & surface() const
The nominal surface of the GeomDet.
float phiSLOffset()
Superlayer offset in chamber front-end frame, in cm.
void getGeom()
Get the geometry from the station.
float const *__restrict__ zt
int mapTubeInFEch(int nsl, int nlay, int ntube) const
Staggering of first wire of layer respect to default: obsolete 19/6/06.
static int position[264][3]
float ZSL(int) const
Radial coordinate in chamber frame of center of a superlayer.
GlobalPoint toGlobal(const LocalPoint p) const
Go to CMS coordinate system for a point.
void IEEE32toDSP(float f, short int &DSPmantissa, short int &DSPexp)
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 wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
int nCell(int sl) const
Number of BTIs in a required superlayer (i.e. nCells in lay 1)