CMS 3D CMS Logo

DTTrigGeom.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: DTTrigGeom
4 //
5 // Description: Muon Barrel Trigger Geometry
6 //
7 //
8 // Author List:
9 // C. Grandi
10 // Modifications:
11 // S. Vanini : NEWGEO implementation
12 // S. Vanini 090902 : dumpLUT method implemented
13 // A. Gozzelino May 11th 2012: IEEE32toDSP method bug fix
14 //--------------------------------------------------
15 
16 //-----------------------
17 // This Class's Header --
18 //-----------------------
20 
21 //-------------
22 // C Headers --
23 //-------------
24 
25 //---------------
26 // C++ Headers --
27 //---------------
28 #include <cstring>
29 #include <fstream>
30 #include <iomanip>
31 #include <iostream>
32 #include <sstream>
33 
34 //-------------------------------
35 // Collaborating Class Headers --
36 //-------------------------------
45 
46 using namespace std;
47 
48 //----------------
49 // Constructors --
50 //----------------
51 
53  : _stat(stat), _debug(debug) {
54 
55  getGeom();
56 }
57 
58 //--------------
59 // Destructor --
60 //--------------
61 
63 
64 //--------------
65 // Operations --
66 //--------------
67 
69  // sl1 offset respect to sl3 - in Front End view!!
70  float x1 = tubePosInCh(1, 1, 1).x();
71  float x3 = tubePosInCh(3, 1, 1).x();
72  float offset = x1 - x3;
73  // if(posFE(1)==1) // Obsolete in
74  // offset = - offset; // CMSSW
75 
76  return offset;
77 }
78 
79 /* OBSOLETE - MAYBE - 19/06/06
80 int
81 DTTrigGeom::layerFEStaggering(int nsl, int nlay) const {
82 
83  NB the staggering is in FE view!
84  return cell staggering respect to first wire in layer 1 in cell units
85  the following is the default: staggering 0 of each layer
86  +---------+---------+---------+
87  | 1 o | 2 o | 3 o |
88  +----+----+----+----+----+----+
89  | 1 o | 2 o |
90  +----+----+----+----+----+
91  | 1 o | 2 o |
92  +----+----+----+----+----+
93  | 1 o | 2 o |
94  +---------+---------+ ------------> x (y coming out of video) in SL
95 frame
96 
97 
98  int stag = 0;
99 
100  if(station()==4 && nsl==2){
101  std::cout << "No theta superlayer in station 4!" << std::endl;
102  return 0;
103  }
104  //position in chamber of wire 1 in layer 1
105  LocalPoint posInCh_lay1 = tubePosInCh(nsl,1,1);
106  //position in chamber of wire 1 in layer nlay
107  int n1stwire = (nlay==4 ? 2 : 1);
108  LocalPoint posInCh_lay = tubePosInCh(nsl,nlay,n1stwire);
109 
110  cout << endl;
111  cout << nlay << posInCh_lay1 << posInCh_lay << endl;
112  cout <<endl ;
113 
114 
115  //NB PITCH-0.01 for computer approximation bug
116  if(nsl==2){//SL2: first wire is toward positive y
117  stag = static_cast<int>((-posInCh_lay.y()+posInCh_lay1.y())/(_PITCH-0.01) +
118 0.5*(fmod(nlay,2.)==0?1:0));
119  }
120  else{//SL1 and SL3: first wire is toward negative x
121  if (nlay==4) {
122  stag =
123 static_cast<int>((+posInCh_lay.x()-posInCh_lay1.x()+_PITCH)/(_PITCH-0.01) +
124 0.5*(fmod(nlay,2.)==0?1:0));
125  }
126  else {
127  stag =
128 static_cast<int>((+posInCh_lay.x()-posInCh_lay1.x())/(_PITCH-0.01) +
129 0.5*(fmod(nlay,2.)==0?1:0));
130  }
131  }
132 
133  //FEP=1 means in y negative in layer frame
134  const DTLayer* lay =
135 _stat->superLayer(DTSuperLayerId(statId(),nsl))->layer(DTLayerId(statId(),nsl,nlay));
136  const DTLayer* lay1 =
137 _stat->superLayer(DTSuperLayerId(statId(),nsl))->layer(DTLayerId(statId(),nsl,1));
138 
139  if(lay->getFEPosition()==1){ //FE staggering is reverted //MODIFICARE
140 DOPO!!!!!! int nWire = lay->specificTopology().channels(); int nWire1 =
141 lay1->specificTopology().channels(); stag = - nWire + nWire1 - stag +
142 (fmod(nlay,2.)==0?1:0);
143  }
144  return stag;
145 }
146 */
147 
148 int DTTrigGeom::mapTubeInFEch(int nsl, int nlay, int ntube) const {
149  int nch = 0;
150  if (station() == 4 && nsl == 2) {
151  std::cout << "No theta superlayer in station 4!" << std::endl;
152  } else {
153  // obsolete 19/06/2006 const DTLayer* lay =
154  // _stat->superLayer(DTSuperLayerId(statId(),nsl))->layer(DTLayerId(statId(),nsl,nlay));
155 
156  /* obsolete 19/6/06
157  if(lay->getFEPosition()==0) //FE is in Y negative: opposite
158  numbering nch = lay->specificTopology().channels() - ntube + 1;
159  // if(lay->getFEPosition()==1) //FE is in Y positive: same
160  numbering digi-trig
161  // nch = ntube;
162  // }
163  */
164  // in new geometry depends on SL: theta tube numbering is reverted wrt
165  // hardware
166  nch = ntube;
167  /* if(nsl==2){
168  nch = lay->specificTopology().channels() - ntube + 1;
169  }*/
170  }
171  return nch;
172 }
173 
174 LocalPoint DTTrigGeom::tubePosInCh(int nsl, int nlay, int ntube) const {
175  if (nlay == 4 && ntube == 1) {
176  std::cout << "ATTENTION: no wire nuber 1 for 4th layer!!!" << std::endl;
177  LocalPoint dummyLP(0, 0, 0);
178  return dummyLP;
179  }
180  const DTSuperLayer *sl = _stat->superLayer(DTSuperLayerId(statId(), nsl));
181  const DTLayer *lay = sl->layer(DTLayerId(statId(), nsl, nlay));
182 
183  float localX = lay->specificTopology().wirePosition(ntube);
184  LocalPoint posInLayer(localX, 0, 0);
185  LocalPoint posInChamber = _stat->surface().toLocal(lay->toGlobal(posInLayer));
186  // obsolete 19/06/2006 GlobalPoint posInCMS = lay->toGlobal(posInLayer);
187 
188  /* cout <<endl;
189  cout << "tube " << ntube << " nlay " << nlay << endl;
190  cout << "posinlayer " << posInLayer << "posinchamb " << posInChamber <<
191  "posinCMS " << posInCMS << endl;*/
192 
193  return posInChamber;
194 }
195 
196 int DTTrigGeom::posFE(int sl) const {
197  if (station() != 4 || sl != 2) {
198  // obsolete 19/0602006 const DTLayer* lay =
199  // _stat->superLayer(DTSuperLayerId(statId(),sl))->layer(DTLayerId(statId(),sl,1));
200  return 1 /*lay->getFEPosition()*/;
201  } else {
202  std::cout << "No theta superlayer in station 4!" << std::endl;
203  return 0;
204  }
205 }
206 
208 
209  _stat = stat;
210  getGeom();
211 }
212 
214 
215  // Geometrical constants of chamber
216  // Cell width (cm)
217  _PITCH = 4.2;
218  // Cell height (cm)
219  _H = 1.3;
220  // azimuthal angle of normal to the chamber
221  _PHICH = _stat->surface().toGlobal(LocalVector(0, 0, -1)).phi();
222 
223  // superlayer positions and number of cells
224  DTSuperLayer const *sl[3];
225  DTLayer const *l1[3];
226  int i = 0;
227  for (i = 0; i < 3; i++) {
228  if (station() == 4 && i == 1) { // No theta SL in MB4
229  _ZSL[i] = -999;
230  _NCELL[i] = 0;
231  } else {
232  sl[i] = _stat->superLayer(DTSuperLayerId(statId(), i + 1));
233  l1[i] = sl[i]->layer(DTLayerId(statId(), i + 1, 1));
234  _ZSL[i] = _stat->surface().toLocal(sl[i]->position()).z(); // - 1.5 * _H;
235  // LocalPoint posInLayer=l1[i]->layType()->getWire(1)->positionInLayer();
236  const DTTopology &tp = l1[i]->specificTopology();
237  float posX = tp.wirePosition(tp.firstChannel());
238  LocalPoint posInLayer(posX, 0, 0);
239  _NCELL[i] = l1[i]->specificTopology().channels();
240  }
241  }
242 
243  // debugging
244  if (_debug) {
245  std::cout << setiosflags(std::ios::showpoint | std::ios::fixed)
246  << std::setw(4) << std::setprecision(1);
247  std::cout << "Identification: wheel=" << wheel();
248  std::cout << ", station=" << station();
249  std::cout << ", sector=" << sector() << std::endl;
250  GlobalPoint pp = _stat->toGlobal(LocalPoint(0, 0, 0));
251  std::cout << "Position: Mag=" << pp.mag()
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;
255  // if(wheel()==2&&sector()==2){ // only 1 sector-wheel
256  std::cout << "Z of superlayers: phi=" << ZSL(1) << ", ";
257  std::cout << ZSL(3) << " theta=" << ZSL(2);
258  std::cout << " (DeltaY = " << distSL() << ")" << std::endl;
259  std::cout << " ncell: sl 1 " << nCell(1) << " sl 2 " << nCell(2) << " sl 3 "
260  << nCell(3) << std::endl;
261  //}
262  }
263  // end debugging
264 }
265 
266 float DTTrigGeom::ZSL(int sl) const {
267  if (sl < 1 || sl > 3) {
268  std::cout << "DTTrigGeom::ZSL: wrong SL number: " << sl;
269  std::cout << -999 << " returned" << std::endl;
270  return -999;
271  }
272  return _ZSL[sl - 1];
273 }
274 
275 void DTTrigGeom::dumpGeom() const {
276  std::cout << "Identification: wheel=" << wheel();
277  std::cout << ", station=" << station();
278  std::cout << ", sector=" << sector() << std::endl;
279  GlobalPoint pp = _stat->toGlobal(LocalPoint(0, 0, 0));
280  std::cout << "Position: Mag=" << pp.mag()
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) << ", ";
285  std::cout << ZSL(3) << " theta=" << ZSL(2) << std::endl;
286  std::cout << "Number of cells: SL1=" << nCell(1) << " SL2=" << nCell(2)
287  << " SL3=" << nCell(3) << std::endl;
288  std::cout << "First wire positions:" << std::endl;
289  int ii = 0;
290  int jj = 0;
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=";
295  if (jj == 4)
296  std::cout << tubePosInCh(ii, jj, 2) << std::endl;
297  else
298  std::cout << tubePosInCh(ii, jj, 1) << std::endl;
299  }
300  }
301  }
302 
303  GlobalPoint gp1 = CMSPosition(DTBtiId(statId(), 1, 1));
304 
305  std::cout << "First BTI position:";
306  std::cout << " SL1:" << localPosition(DTBtiId(statId(), 1, 1)) << std::endl;
307  std::cout << " Position: R=" << gp1.perp()
308  << "cm, Phi=" << gp1.phi() * 180 / 3.14159 << " deg, Z=" << gp1.z()
309  << " cm" << std::endl;
310 
311  if (station() != 4) {
312  GlobalPoint gp2 = CMSPosition(DTBtiId(statId(), 2, 1));
313  std::cout << " SL2:" << localPosition(DTBtiId(statId(), 2, 1)) << std::endl;
314  std::cout << " Position: R=" << gp2.perp()
315  << "cm, Phi=" << gp2.phi() * 180 / 3.14159
316  << " deg, Z=" << gp2.z() << " cm" << std::endl;
317  }
318 
319  GlobalPoint gp3 = CMSPosition(DTBtiId(statId(), 3, 1));
320  std::cout << " SL3:" << localPosition(DTBtiId(statId(), 3, 1)) << std::endl;
321  std::cout << " Position: R=" << gp3.perp()
322  << "cm, Phi=" << gp3.phi() * 180 / 3.14159 << " deg, Z=" << gp3.z()
323  << " cm" << std::endl;
324 
325  std::cout << "First TRACO position:";
326  std::cout << localPosition(DTTracoId(statId(), 1)) << std::endl;
327  std::cout << "******************************************************"
328  << std::endl;
329 }
330 
331 void DTTrigGeom::dumpLUT(short int btic) {
332 
333  // chamber id
334  int wh = wheel();
335  int st = station();
336  int se = sector();
337 
338  // open txt file
339  string name = "Lut_from_CMSSW_geom";
340  /* name += "_wh_";
341  if(wh<0)
342  name += "-";
343  name += abs(wh) + '0';
344  name += "_st_";
345  name += st + '0';
346  name += "_se_";
347  if(se<10)
348  name += se + '0';
349  else
350  {
351  name += 1 + '0';
352  name += (se-10) + '0';
353  }
354  */
355  name += ".txt";
356 
357  ofstream fout;
358  fout.open(name.c_str(), ofstream::app);
359 
360  // *** dump file header
361  // fout << "Identification: wheel\t" << wh;
362  // fout << "\tstation\t" << st;
363  // fout << "\tsector\t" << se;
364  fout << wh;
365  fout << "\t" << st;
366  fout << "\t" << se;
367 
368  // SL shift
369  float xBTI1_3 =
371  .x();
372  float xBTI1_1 =
374  .x();
375  float SL_shift = xBTI1_3 - xBTI1_1;
376  // std::cout << " SL shift " << SL_shift << std::endl;
377 
378  // traco 1 and 2 global position
379  LocalPoint traco1 = localPosition(DTTracoId(statId(), 1));
380  LocalPoint traco2 = localPosition(DTTracoId(statId(), 2));
381  GlobalPoint traco_1 = toGlobal(traco1);
382  GlobalPoint traco_2 = toGlobal(traco2);
383  // std::cout << " tr1 x " << traco_1.x() << " tr2 x " << traco_2.x() <<
384  // std::endl;
385 
386  float d;
387  float xcn;
388  int xcn_sign;
390  // std::cout << "Position: x=" << pp.x() << "cm, y=" << pp.y() << "cm, z=" <<
391  // pp.z() << std::endl;
392 
393  if (sector() == 1 || sector() == 7) {
394  d = fabs(traco_1.x());
395  xcn = fabs(traco_1.y());
396  // 110208 SV comment: this was inserted for a TRACO hardware bug
397  if (SL_shift > 0)
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()));
401  if (station() == 2 || (station() == 4 && sector() == 1))
402  xcn_sign = -xcn_sign;
403  xcn = xcn * xcn_sign;
404  } else {
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();
407  float m = tan(phiCh());
408  float xn = q1 / (m - m1);
409  float yn = m * xn;
410 
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()));
414  // 110208 SV comment: this was inserted for a TRACO hardware bug
415  if (SL_shift > 0)
416  xcn = xcn + SL_shift;
417 
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;
421  }
422  // std::cout << " d " << d << " xcn " << xcn << " sign " << xcn_sign <<
423  // std::endl;
424  // fout << "\td\t" << d << "\txcn\t" << xcn << "\t";
425  // fout << "btic\t" << btic << "\t";
426 
427  // *** dump TRACO LUT command
428  fout << "\tA8";
429  // short int btic = 31;
430  // cout << "CHECK BTIC " << btic << endl;
431  short int Low_byte =
432  (btic & 0x00FF); // output in hex bytes format with zero padding
433  short int High_byte = (btic >> 8 & 0x00FF);
434  fout << setw(2) << setfill('0') << hex << High_byte << setw(2) << setfill('0')
435  << Low_byte;
436 
437  // convert parameters from IEE32 float to DSP float format
438  short int DSPmantissa = 0;
439  short int DSPexp = 0;
440 
441  // d parameter conversion and dump
442  IEEE32toDSP(d, DSPmantissa, DSPexp);
443  Low_byte =
444  (DSPmantissa & 0x00FF); // output in hex bytes format with zero padding
445  High_byte = (DSPmantissa >> 8 & 0x00FF);
446  fout << setw(2) << setfill('0') << hex << High_byte << setw(2) << setfill('0')
447  << Low_byte;
448  Low_byte = (DSPexp & 0x00FF);
449  High_byte = (DSPexp >> 8 & 0x00FF);
450  fout << setw(2) << setfill('0') << High_byte << setw(2) << setfill('0')
451  << Low_byte;
452 
453  // xnc parameter conversion and dump
454  DSPmantissa = 0;
455  DSPexp = 0;
456  IEEE32toDSP(xcn, DSPmantissa, DSPexp);
457  Low_byte =
458  (DSPmantissa & 0x00FF); // output in hex bytes format with zero padding
459  High_byte = (DSPmantissa >> 8 & 0x00FF);
460  fout << setw(2) << setfill('0') << hex << High_byte << setw(2) << setfill('0')
461  << Low_byte;
462  Low_byte = (DSPexp & 0x00FF);
463  High_byte = (DSPexp >> 8 & 0x00FF);
464  fout << setw(2) << setfill('0') << High_byte << setw(2) << setfill('0')
465  << Low_byte;
466 
467  // sign bits
468  Low_byte =
469  (xcn_sign & 0x00FF); // output in hex bytes format with zero padding
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";
473 
474  fout.close();
475 
476  return;
477 }
478 
479 /*
480 // A. Gozzelino May 11th 2012: Old and wrong definition
481 void
482 DTTrigGeom::IEEE32toDSP(float f, short int & DSPmantissa, short int & DSPexp)
483 {
484  long int *pl=0, lm;
485  bool sign=false;
486 
487  DSPmantissa = 0;
488  DSPexp = 0;
489 
490  if( f!=0.0 )
491  {
492  memcpy(pl,&f,sizeof(float));
493 
494  if((*pl & 0x80000000)!=0)
495  sign=true;
496  lm = ( 0x800000 | (*pl & 0x7FFFFF)); // [1][23bit mantissa]
497  lm >>= 9; //reduce to 15bits
498  lm &= 0x7FFF;
499  DSPexp = ((*pl>>23)&0xFF)-126;
500  DSPmantissa = (short)lm;
501  if(sign)
502  DSPmantissa = - DSPmantissa; // convert negative value in 2.s
503 complement
504 
505  }
506  return;
507 }
508 */
509 
510 //*******************
511 // A.Gozzelino May 11th 2012: bug fix in method IEEE32toDSP
512 //******************
513 
514 void DTTrigGeom::IEEE32toDSP(float f, short int &DSPmantissa,
515  short int &DSPexp) {
516  long int lm;
517  long int pl = 0;
518 
519  bool sign = false;
520 
521  DSPmantissa = 0;
522  DSPexp = 0;
523 
524  if (f != 0.0) {
525  memcpy(&pl, &f, sizeof(float));
526 
527  if ((pl & 0x80000000) != 0)
528  sign = true;
529  lm = (0x800000 | (pl & 0x7FFFFF)); // [1][23bit mantissa]
530  lm >>= 9; // reduce to 15bits
531  lm &= 0x7FFF;
532  DSPexp = ((pl >> 23) & 0xFF) - 126;
533  DSPmantissa = (short)lm;
534  if (sign)
535  DSPmantissa = -DSPmantissa; // convert negative value in 2.s complement
536  }
537  return;
538 }
539 //********************** end bug fix ****************
540 
542  /* obsolete!
543  float x = 0;
544  float y = 0;
545  float z = ZSL(id.superlayer());
546  if(id.superlayer()==2){
547  // SL 2: Reverse numbering -------V
548  y = Xwire1BTI1SL(id.superlayer()) - ((float)(id.bti()-1)-0.5)*cellPitch();
549  } else {
550  x = Xwire1BTI1SL(id.superlayer()) + ((float)(id.bti()-1)-0.5)*cellPitch();
551  }
552  */
553 
554  // NEWGEO
555  /* int nsl = id.superlayer();
556  int tube = mapTubeInFEch(nsl,1,id.bti());
557  LocalPoint p = tubePosInCh(nsl,1,tube);
558  //traslation because z axes is in middle of SL, x/y axes on left I of first
559  cell
560 
561  LocalPoint p1 = tubePosInCh (nsl,1,1);
562  LocalPoint p2 = tubePosInCh (nsl,2,1);
563  cout << "nbti " << id.bti() << " tube " << tube << " localpoint" << p <<
564  endl; cout << "localpoint layer 1" << p1 << " localpoint layer 2" << p2 <<
565  endl;
566 
567  float xt = 0;
568  float yt = 0;
569  float zt = - cellH() * 3./2.;
570  if(nsl==2)
571  yt = - cellPitch()/2.;
572  else
573  xt = + cellPitch()/2.;
574 
575  if(posFE(nsl)==0){//FE in positive y
576  xt = - xt;
577  yt = - yt;
578  }
579 
580  cout << "localpoint " << p << ' ' << xt << ' ' << yt << endl;
581 
582  return LocalPoint(p.x()+xt,p.y()+yt,p.z()+zt);*/
583 
584  int nsl = id.superlayer();
585  const DTSuperLayer *sl = _stat->superLayer(DTSuperLayerId(statId(), nsl));
586  const DTLayer *lay = sl->layer(DTLayerId(statId(), nsl, 1));
587  int tube = id.bti();
588  float localX = lay->specificTopology().wirePosition(tube);
589  float xt = -cellPitch() / 2.;
590  float zt = -cellH() * 3. / 2.;
591  // LocalPoint posInLayer1(localX+xt,yt,0); //Correction now y is left I of
592  // first cell of layer 1 y=0 and z in the middle of SL,
593  LocalPoint posInLayer1(localX + xt, 0, zt);
594  LocalPoint posInChamber =
595  _stat->surface().toLocal(lay->toGlobal(posInLayer1));
596  // GlobalPoint posInCMS = lay->toGlobal(posInLayer1);
597 
598  /* cout <<endl;
599  cout << "tube " << ntube << " nlay " << nlay << endl;
600  cout << "posinlayer " << posInLayer1 << "posinchamb " << posInChamber <<
601  "posinCMS " << posInCMS << endl;*/
602 
603  return posInChamber;
604 }
605 
607  /* obsolete
608  float x = Xwire1BTI1SL(1) +
609  ( ( (float)(id.traco()) - 0.5 ) * DTConfig::NBTITC - 0.5 )*cellPitch();
610  // half cell shift in SL1 of MB1 (since cmsim116)
611  if(station()==1) x -= 0.5*cellPitch();
612  float y = 0;
613  float z = ZcenterSL();
614  */
615  // NEWGEO
616  // position of first BTI in sl 3 on X
617  float x =
619  .x();
620  // 10/7/06 May be not needed anymore in new geometry
621  // if(posFE(3)==1)
622  // x -= (id.traco()-2)*DTConfig::NBTITC * cellPitch();
623  // if(posFE(3)==0)
624  x += (id.traco() - 2) * DTConfig::NBTITC * cellPitch();
625 
626  float y = 0;
627  float z = ZcenterSL();
628 
629  return LocalPoint(x, y, z);
630 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
int sector() const
Return sector number.
Definition: DTTrigGeom.h:66
const DTSuperLayer * superLayer(const DTSuperLayerId &id) const
Return the superlayer corresponding to the given id.
Definition: DTChamber.cc:65
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
Local3DVector LocalVector
Definition: LocalVector.h:12
int mapTubeInFEch(int nsl, int nlay, int ntube) const
Staggering of first wire of layer respect to default: obsolete 19/6/06.
Definition: DTTrigGeom.cc:148
DTTrigGeom(const DTChamber *stat, bool debug)
Constructor.
Definition: DTTrigGeom.cc:52
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:32
float phiCh() const
Rotation angle of chamber (deg)
Definition: DTTrigGeom.h:71
T perp() const
Definition: PV3DBase.h:72
float cellPitch() const
Width of a cell (cm) i.e. distance between ywo wires.
Definition: DTTrigGeom.h:77
int wheel() const
Return wheel number.
Definition: DTTrigGeom.h:60
void setGeom(const DTChamber *stat)
Set/Update Geometry.
Definition: DTTrigGeom.cc:207
float _PHICH
Definition: DTTrigGeom.h:212
const DTChamber * _stat
Definition: DTTrigGeom.h:209
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
bool _debug
Definition: DTTrigGeom.h:217
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T y() const
Definition: PV3DBase.h:63
float _H
Definition: DTTrigGeom.h:213
const DTLayer * layer(const DTLayerId &id) const
Return the layer corresponding to the given id.
Definition: DTSuperLayer.cc:68
void dumpLUT(short int btic)
Dump the LUT for this chamber.
Definition: DTTrigGeom.cc:331
GlobalPoint toGlobal(const LocalPoint p) const
Go to CMS coordinate system for a point.
Definition: DTTrigGeom.h:113
float _ZSL[3]
Definition: DTTrigGeom.h:215
void dumpGeom() const
Dump the geometry.
Definition: DTTrigGeom.cc:275
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
float _PITCH
Definition: DTTrigGeom.h:214
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:78
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
T mag() const
Definition: PV3DBase.h:67
float distSL() const
Distance between the phi view superlayers (cms)
Definition: DTTrigGeom.h:80
float cellH() const
Height of a cell (cm)
Definition: DTTrigGeom.h:74
T sqrt(T t)
Definition: SSEVec.h:18
LocalPoint toLocal(const GlobalPoint &gp) const
T z() const
Definition: PV3DBase.h:64
float ZcenterSL() const
Coordinate of center of the 2 Phi SL.
Definition: DTTrigGeom.h:83
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
double f[11][100]
int posFE(int sl) const
Front End position : 1=toward negative y, 0=toward positive y.
Definition: DTTrigGeom.cc:196
ii
Definition: cuy.py:590
int station() const
Return station number.
Definition: DTTrigGeom.h:63
#define debug
Definition: HDRShower.cc:19
int channels() const
Returns the number of wires in the layer.
Definition: DTTopology.h:75
LocalPoint tubePosInCh(int nsl, int nlay, int ntube) const
Wire position in chamber frame.
Definition: DTTrigGeom.cc:174
float phiSLOffset()
Superlayer offset in chamber front-end frame, in cm.
Definition: DTTrigGeom.cc:68
double q1[4]
Definition: TauolaWrapper.h:87
DTChamberId statId() const
Identifier of the associated chamber.
Definition: DTTrigGeom.h:54
constexpr uint16_t localX(uint16_t px)
void getGeom()
Get the geometry from the station.
Definition: DTTrigGeom.cc:213
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
Definition: DTTrigGeom.cc:541
const DTChamber * stat() const
Associated chamber.
Definition: DTTrigGeom.h:51
static int position[264][3]
Definition: ReadPGInfo.cc:509
~DTTrigGeom()
Destructor.
Definition: DTTrigGeom.cc:62
static const int NBTITC
Definition: DTConfig.h:38
void IEEE32toDSP(float f, short int &DSPmantissa, short int &DSPexp)
Definition: DTTrigGeom.cc:514
T x() const
Definition: PV3DBase.h:62
GlobalPoint CMSPosition(const DTBtiId obj) const
CMS position of a BTI.
Definition: DTTrigGeom.h:188
int nCell(int sl) const
Number of BTIs in a required superlayer (i.e. nCells in lay 1)
Definition: DTTrigGeom.h:89
float ZSL(int) const
Radial coordinate in chamber frame of center of a superlayer.
Definition: DTTrigGeom.cc:266
int _NCELL[3]
Definition: DTTrigGeom.h:216