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