CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
DTTrigGeom Class Reference

#include <DTTrigGeom.h>

Public Member Functions

float cellH () const
 Height of a cell (cm) More...
 
float cellPitch () const
 Width of a cell (cm) i.e. distance between ywo wires. More...
 
GlobalPoint CMSPosition (const DTBtiId obj) const
 CMS position of a BTI. More...
 
GlobalPoint CMSPosition (const DTTracoId obj) const
 CMS position of a TRACO. More...
 
float distSL () const
 Distance between the phi view superlayers (cms) More...
 
 DTTrigGeom (const DTChamber *stat, bool debug)
 Constructor. More...
 
void dumpGeom () const
 Dump the geometry. More...
 
void dumpLUT (short int btic)
 Dump the LUT for this chamber. More...
 
void IEEE32toDSP (float f, short int &DSPmantissa, short int &DSPexp)
 
LocalPoint localPosition (const DTBtiId) const
 Local position in chamber of a BTI. More...
 
LocalPoint localPosition (const DTTracoId) const
 Local position in chamber of a TRACO. More...
 
int mapTubeInFEch (int nsl, int nlay, int ntube) const
 Staggering of first wire of layer respect to default: obsolete 19/6/06. More...
 
int nCell (int sl) const
 Number of BTIs in a required superlayer (i.e. nCells in lay 1) More...
 
float phiCh () const
 Rotation angle of chamber (deg) More...
 
float phiSLOffset ()
 Superlayer offset in chamber front-end frame, in cm. More...
 
int posFE (int sl) const
 Front End position : 1=toward negative y, 0=toward positive y. More...
 
int sector () const
 Return sector number. More...
 
void setGeom (const DTChamber *stat)
 Set/Update Geometry. More...
 
const DTChamberstat () const
 Associated chamber. More...
 
DTChamberId statId () const
 Identifier of the associated chamber. More...
 
int station () const
 Return station number. More...
 
GlobalPoint toGlobal (const LocalPoint p) const
 Go to CMS coordinate system for a point. More...
 
GlobalVector toGlobal (const LocalVector v) const
 Go to CMS coordinate system for a vector. More...
 
LocalPoint toLocal (const GlobalPoint p) const
 Go to Local coordinate system for a point. More...
 
LocalVector toLocal (const GlobalVector v) const
 Go to Local coordinate system for a vector. More...
 
LocalPoint tubePosInCh (int nsl, int nlay, int ntube) const
 Wire position in chamber frame. More...
 
int wheel () const
 Return wheel number. More...
 
float ZcenterSL () const
 Coordinate of center of the 2 Phi SL. More...
 
float ZSL (int) const
 Radial coordinate in chamber frame of center of a superlayer. More...
 
 ~DTTrigGeom ()
 Destructor. More...
 

Private Member Functions

void getGeom ()
 Get the geometry from the station. More...
 

Private Attributes

bool _debug
 
float _H
 
int _NCELL [3]
 
float _PHICH
 
float _PITCH
 
const DTChamber_stat
 
float _ZSL [3]
 

Detailed Description

Muon Barrel Trigger Geometry

Author
C.Grandi S.Vanini

Definition at line 41 of file DTTrigGeom.h.

Constructor & Destructor Documentation

DTTrigGeom::DTTrigGeom ( const DTChamber stat,
bool  debug 
)

Constructor.

Definition at line 52 of file DTTrigGeom.cc.

References getGeom().

52  : _stat(stat) , _debug(debug) {
53 
54  getGeom();
55 
56 }
const DTChamber * _stat
Definition: DTTrigGeom.h:205
bool _debug
Definition: DTTrigGeom.h:213
#define debug
Definition: HDRShower.cc:19
void getGeom()
Get the geometry from the station.
Definition: DTTrigGeom.cc:211
DTTrigGeom::~DTTrigGeom ( )

Destructor.

Definition at line 63 of file DTTrigGeom.cc.

63 {}

Member Function Documentation

float DTTrigGeom::cellH ( ) const
inline

Height of a cell (cm)

Definition at line 75 of file DTTrigGeom.h.

References _H.

Referenced by DTBtiChip::DTBtiChip(), DTBtiCard::localDirection(), localPosition(), DTTracoChip::setTracoAcceptances(), DTTracoChip::storeCorr(), and DTTracoChip::storeUncorr().

75 { return _H; }
float _H
Definition: DTTrigGeom.h:209
float DTTrigGeom::cellPitch ( ) const
inline
GlobalPoint DTTrigGeom::CMSPosition ( const DTBtiId  obj) const
inline

CMS position of a BTI.

Definition at line 182 of file DTTrigGeom.h.

References localPosition(), and toGlobal().

Referenced by DTBtiChip::CMSPosition(), DTTracoChip::CMSPosition(), DTBtiChip::DTBtiChip(), and dumpGeom().

182  {
183  return toGlobal(localPosition(obj));
184  }
GlobalPoint toGlobal(const LocalPoint p) const
Go to CMS coordinate system for a point.
Definition: DTTrigGeom.h:115
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
Definition: DTTrigGeom.cc:523
GlobalPoint DTTrigGeom::CMSPosition ( const DTTracoId  obj) const
inline

CMS position of a TRACO.

Definition at line 187 of file DTTrigGeom.h.

References localPosition(), and toGlobal().

187  {
188  return toGlobal(localPosition(obj));
189  }
GlobalPoint toGlobal(const LocalPoint p) const
Go to CMS coordinate system for a point.
Definition: DTTrigGeom.h:115
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
Definition: DTTrigGeom.cc:523
float DTTrigGeom::distSL ( ) const
inline

Distance between the phi view superlayers (cms)

Definition at line 81 of file DTTrigGeom.h.

References _ZSL.

Referenced by getGeom(), DTTracoCard::localDirection(), DTTracoCard::localPosition(), DTTracoChip::setTracoAcceptances(), DTTracoChip::storeCorr(), and DTTracoChip::storeUncorr().

81 { return fabs(_ZSL[2]-_ZSL[0]); }
float _ZSL[3]
Definition: DTTrigGeom.h:211
void DTTrigGeom::dumpGeom ( ) const

Dump the geometry.

Definition at line 276 of file DTTrigGeom.cc.

References _stat, CMSPosition(), gather_cfg::cout, cuy::ii, findQualityFiles::jj, localPosition(), PV3DBase< T, PVType, FrameType >::mag(), nCell(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), phiCh(), createTree::pp, sector(), statId(), station(), GeomDet::toGlobal(), tubePosInCh(), wheel(), PV3DBase< T, PVType, FrameType >::z(), and ZSL().

Referenced by DTSCTrigUnit::dumpGeom().

276  {
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 }
int sector() const
Return sector number.
Definition: DTTrigGeom.h:67
float phiCh() const
Rotation angle of chamber (deg)
Definition: DTTrigGeom.h:72
T perp() const
Definition: PV3DBase.h:72
int wheel() const
Return wheel number.
Definition: DTTrigGeom.h:61
tuple pp
Definition: createTree.py:15
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:52
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
int ii
Definition: cuy.py:588
T mag() const
Definition: PV3DBase.h:67
T z() const
Definition: PV3DBase.h:64
int station() const
Return station number.
Definition: DTTrigGeom.h:64
LocalPoint tubePosInCh(int nsl, int nlay, int ntube) const
Wire position in chamber frame.
Definition: DTTrigGeom.cc:169
DTChamberId statId() const
Identifier of the associated chamber.
Definition: DTTrigGeom.h:55
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
Definition: DTTrigGeom.cc:523
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
tuple cout
Definition: gather_cfg.py:121
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
void DTTrigGeom::dumpLUT ( short int  btic)

Dump the LUT for this chamber.

Definition at line 327 of file DTTrigGeom.cc.

References _stat, TauDecayModes::dec, diffTreeTool::diff, DTSuperLayerId, groupFilesInBlocks::fout, IEEE32toDSP(), localPosition(), contentValuesFiles::m, mergeVDriftHistosByStation::name, phiCh(), createTree::pp, q1, sector(), mathSSE::sqrt(), statId(), station(), funct::tan(), GeomDet::toGlobal(), toGlobal(), wheel(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and ZcenterSL().

Referenced by DTSCTrigUnit::dumpLUT().

327  {
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 }
int sector() const
Return sector number.
Definition: DTTrigGeom.h:67
float phiCh() const
Rotation angle of chamber (deg)
Definition: DTTrigGeom.h:72
int wheel() const
Return wheel number.
Definition: DTTrigGeom.h:61
tuple pp
Definition: createTree.py:15
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:52
DTSuperLayerId
T y() const
Definition: PV3DBase.h:63
GlobalPoint toGlobal(const LocalPoint p) const
Go to CMS coordinate system for a point.
Definition: DTTrigGeom.h:115
T sqrt(T t)
Definition: SSEVec.h:48
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
int station() const
Return station number.
Definition: DTTrigGeom.h:64
double q1[4]
Definition: TauolaWrapper.h:87
DTChamberId statId() const
Identifier of the associated chamber.
Definition: DTTrigGeom.h:55
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
Definition: DTTrigGeom.cc:523
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
void IEEE32toDSP(float f, short int &DSPmantissa, short int &DSPexp)
Definition: DTTrigGeom.cc:493
T x() const
Definition: PV3DBase.h:62
void DTTrigGeom::getGeom ( )
private

Get the geometry from the station.

Definition at line 211 of file DTTrigGeom.cc.

References _debug, _H, _NCELL, _PHICH, _PITCH, _stat, _ZSL, DTTopology::channels(), gather_cfg::cout, distSL(), DTLayerId, DTTopology::firstChannel(), i, PV3DBase< T, PVType, FrameType >::mag(), nCell(), PV3DBase< T, PVType, FrameType >::phi(), phiCh(), position, createTree::pp, sector(), DTLayer::specificTopology(), statId(), station(), DTChamber::superLayer(), GeomDet::surface(), GeomDet::toGlobal(), Surface::toGlobal(), GloballyPositioned< T >::toLocal(), wheel(), DTTopology::wirePosition(), PV3DBase< T, PVType, FrameType >::z(), and ZSL().

Referenced by DTTrigGeom(), and setGeom().

211  {
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* sl[3];
223  DTLayer* 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 {
231  l1[i] = (DTLayer*) 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 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
int sector() const
Return sector number.
Definition: DTTrigGeom.h:67
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
int i
Definition: DBlmapReader.cc:9
Local3DVector LocalVector
Definition: LocalVector.h:12
float phiCh() const
Rotation angle of chamber (deg)
Definition: DTTrigGeom.h:72
int wheel() const
Return wheel number.
Definition: DTTrigGeom.h:61
tuple pp
Definition: createTree.py:15
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:52
bool _debug
Definition: DTTrigGeom.h:213
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
float _H
Definition: DTTrigGeom.h:209
float _ZSL[3]
Definition: DTTrigGeom.h:211
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
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
LocalPoint toLocal(const GlobalPoint &gp) const
T z() const
Definition: PV3DBase.h:64
int station() const
Return station number.
Definition: DTTrigGeom.h:64
int channels() const
Returns the number of wires in the layer.
Definition: DTTopology.h:75
DTChamberId statId() const
Identifier of the associated chamber.
Definition: DTTrigGeom.h:55
static int position[264][3]
Definition: ReadPGInfo.cc:509
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
tuple cout
Definition: gather_cfg.py:121
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
const DTSuperLayer * superLayer(DTSuperLayerId id) const
Return the superlayer corresponding to the given id.
Definition: DTChamber.cc:65
void DTTrigGeom::IEEE32toDSP ( float  f,
short int &  DSPmantissa,
short int &  DSPexp 
)

Definition at line 493 of file DTTrigGeom.cc.

References jetcorrextractor::sign().

Referenced by dumpLUT().

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 }
double sign(double x)
double f[11][100]
LocalPoint DTTrigGeom::localPosition ( const DTBtiId  id) const

Local position in chamber of a BTI.

NB: attention: in NEWGEO definition has changed:

 +---------+---------+---------+
 | 1  o    | 5  o    | 9  o    |
 +----+----+----+----+----+----+
      | 3  o    |  7 o    |
 +----+----+----+----+----+ - - - -> x/-x
 | 2  o    | 6  o    |
 +----+----+----+----+----+
      | 4  o    | 8  o    |  
      +---------+---------+
      ^
      |
     x=0

Definition at line 523 of file DTTrigGeom.cc.

References _stat, cellH(), cellPitch(), DTLayerId, DTSuperLayerId, DTSuperLayer::layer(), DTLayer::specificTopology(), statId(), DTChamber::superLayer(), GeomDet::surface(), GeomDet::toGlobal(), GloballyPositioned< T >::toLocal(), and DTTopology::wirePosition().

Referenced by CMSPosition(), DTTracoChip::DTTracoChip(), dumpGeom(), dumpLUT(), DTBtiCard::localDirection(), DTBtiCard::localPosition(), DTBtiChip::localPosition(), DTTracoCard::localPosition(), DTTracoChip::localPosition(), and localPosition().

523  {
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 }
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
float cellPitch() const
Width of a cell (cm) i.e. distance between ywo wires.
Definition: DTTrigGeom.h:78
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:52
DTSuperLayerId
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
float cellH() const
Height of a cell (cm)
Definition: DTTrigGeom.h:75
LocalPoint toLocal(const GlobalPoint &gp) const
const DTLayer * layer(DTLayerId id) const
Return the layer corresponding to the given id.
Definition: DTSuperLayer.cc:68
DTChamberId statId() const
Identifier of the associated chamber.
Definition: DTTrigGeom.h:55
const DTSuperLayer * superLayer(DTSuperLayerId id) const
Return the superlayer corresponding to the given id.
Definition: DTChamber.cc:65
LocalPoint DTTrigGeom::localPosition ( const DTTracoId  id) const

Local position in chamber of a TRACO.

    NB: attention: in NEWGEO definition has changed:

    +----+----+----+----+----+----+----+----+----+----+----+----+
    |  5 |  6 |  7 |  8 |  9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
    +----+----+----+----+----+----+----+----+----+----+----+----+
    \                                                           /
    | \                                                       /
    |   \                                                   /
    |     \                                               /
    |       \                                           /
----|-------------------------------------------------------------------> 
    |          \                                     /
    |            \                                 /
    |              \                             /
    |                \                         /
    |                  \                     /
    |                   +----+----+----+----+
    |                   |  1 |  2 |  3 |  4 |
    |                   +----+----+----+----+
    X=0
    ^
    |
   traco position

Definition at line 584 of file DTTrigGeom.cc.

References cellPitch(), DTSuperLayerId, localPosition(), DTConfig::NBTITC, sector(), station(), wheel(), x, PV3DBase< T, PVType, FrameType >::x(), detailsBasic3DVector::y, detailsBasic3DVector::z, and ZcenterSL().

584  {
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 }
int sector() const
Return sector number.
Definition: DTTrigGeom.h:67
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
DTSuperLayerId
float float float z
float ZcenterSL() const
Coordinate of center of the 2 Phi SL.
Definition: DTTrigGeom.h:84
int station() const
Return station number.
Definition: DTTrigGeom.h:64
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
Definition: DTTrigGeom.cc:523
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
Definition: DDAxes.h:10
static const int NBTITC
Definition: DTConfig.h:38
T x() const
Definition: PV3DBase.h:62
int DTTrigGeom::mapTubeInFEch ( int  nsl,
int  nlay,
int  ntube 
) const

Staggering of first wire of layer respect to default: obsolete 19/6/06.

Map tube number into hw wire number, and reverse hw num->tube (nb NOT in bti hardware number, this depends on connectors)

Definition at line 144 of file DTTrigGeom.cc.

References gather_cfg::cout, and station().

Referenced by DTBtiCard::loadBTI().

144  {
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 }
int station() const
Return station number.
Definition: DTTrigGeom.h:64
tuple cout
Definition: gather_cfg.py:121
int DTTrigGeom::nCell ( int  sl) const
inline

Number of BTIs in a required superlayer (i.e. nCells in lay 1)

Definition at line 90 of file DTTrigGeom.h.

References _NCELL.

Referenced by DTBtiCard::activeGetBTI(), DTBtiChip::add_digi(), dumpGeom(), getGeom(), and DTBtiChip::run().

90  {
91  return (sl>0&&sl<=3)*_NCELL[sl-1];
92  }
int _NCELL[3]
Definition: DTTrigGeom.h:212
float DTTrigGeom::phiCh ( ) const
inline

Rotation angle of chamber (deg)

Definition at line 72 of file DTTrigGeom.h.

References _PHICH.

Referenced by DTTracoChip::calculateAngles(), dumpGeom(), dumpLUT(), and getGeom().

72 { return _PHICH; }
float _PHICH
Definition: DTTrigGeom.h:208
float DTTrigGeom::phiSLOffset ( )

Superlayer offset in chamber front-end frame, in cm.

Definition at line 71 of file DTTrigGeom.cc.

References HLT_25ns14e33_v1_cff::offset, tubePosInCh(), and PV3DBase< T, PVType, FrameType >::x().

Referenced by DTTracoChip::DTTracoChip(), and DTTracoChip::setTracoAcceptances().

71  {
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 }
LocalPoint tubePosInCh(int nsl, int nlay, int ntube) const
Wire position in chamber frame.
Definition: DTTrigGeom.cc:169
T x() const
Definition: PV3DBase.h:62
int DTTrigGeom::posFE ( int  sl) const

Front End position : 1=toward negative y, 0=toward positive y.

Definition at line 191 of file DTTrigGeom.cc.

References gather_cfg::cout, and station().

191  {
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 }
int station() const
Return station number.
Definition: DTTrigGeom.h:64
tuple cout
Definition: gather_cfg.py:121
int DTTrigGeom::sector ( void  ) const
inline

Return sector number.

Definition at line 67 of file DTTrigGeom.h.

References _stat, DTChamber::id(), and DTChamberId::sector().

Referenced by dumpGeom(), dumpLUT(), getGeom(), geometryXMLparser.DTAlignable::index(), localPosition(), DTGeomSupplier::sector(), DTSCTrigUnit::sector(), DTTracoChip::sector(), and DTBtiChip::sector().

67 { return _stat->id().sector(); }
const DTChamber * _stat
Definition: DTTrigGeom.h:205
DTChamberId id() const
Return the DTChamberId of this chamber.
Definition: DTChamber.cc:33
int sector() const
Definition: DTChamberId.h:61
void DTTrigGeom::setGeom ( const DTChamber stat)

Set/Update Geometry.

Definition at line 203 of file DTTrigGeom.cc.

References _stat, getGeom(), and stat().

Referenced by DTSCTrigUnit::setGeom().

203  {
204 
205  _stat=stat;
206  getGeom();
207 
208 }
const DTChamber * _stat
Definition: DTTrigGeom.h:205
void getGeom()
Get the geometry from the station.
Definition: DTTrigGeom.cc:211
const DTChamber * stat() const
Associated chamber.
Definition: DTTrigGeom.h:52
const DTChamber* DTTrigGeom::stat ( ) const
inline

Associated chamber.

Definition at line 52 of file DTTrigGeom.h.

References _stat.

Referenced by setGeom(), DTGeomSupplier::stat(), and DTSCTrigUnit::stat().

52 { return _stat; }
const DTChamber * _stat
Definition: DTTrigGeom.h:205
DTChamberId DTTrigGeom::statId ( ) const
inline

Identifier of the associated chamber.

Definition at line 55 of file DTTrigGeom.h.

References _stat, and DTChamber::id().

Referenced by DTBtiCard::activeGetBTI(), DTTracoCard::activeGetTRACO(), DTGeomSupplier::ChamberId(), DTBtiChip::DTBtiChip(), DTTracoChip::DTTracoChip(), dumpGeom(), dumpLUT(), getGeom(), localPosition(), DTSCTrigUnit::statId(), and tubePosInCh().

55 { return _stat->id(); }
const DTChamber * _stat
Definition: DTTrigGeom.h:205
DTChamberId id() const
Return the DTChamberId of this chamber.
Definition: DTChamber.cc:33
int DTTrigGeom::station ( ) const
inline

Return station number.

Definition at line 64 of file DTTrigGeom.h.

References _stat, DTChamber::id(), and DTChamberId::station().

Referenced by dumpGeom(), dumpLUT(), getGeom(), geometryXMLparser.DTAlignable::index(), geometryXMLparser.CSCAlignable::index(), localPosition(), mapTubeInFEch(), posFE(), DTGeomSupplier::station(), DTSCTrigUnit::station(), DTTracoChip::station(), and DTBtiChip::station().

64 { return _stat->id().station(); }
const DTChamber * _stat
Definition: DTTrigGeom.h:205
DTChamberId id() const
Return the DTChamberId of this chamber.
Definition: DTChamber.cc:33
int station() const
Return the station number.
Definition: DTChamberId.h:51
GlobalPoint DTTrigGeom::toGlobal ( const LocalPoint  p) const
inline

Go to CMS coordinate system for a point.

Definition at line 115 of file DTTrigGeom.h.

References _stat, GeomDet::surface(), and Surface::toGlobal().

Referenced by DTGeomSupplier::CMSDirection(), DTGeomSupplier::CMSPosition(), CMSPosition(), and dumpLUT().

115 { return _stat->surface().toGlobal(p); }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
const DTChamber * _stat
Definition: DTTrigGeom.h:205
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
GlobalVector DTTrigGeom::toGlobal ( const LocalVector  v) const
inline

Go to CMS coordinate system for a vector.

Definition at line 118 of file DTTrigGeom.h.

References _stat, GeomDet::surface(), and Surface::toGlobal().

118 { return _stat->surface().toGlobal(v); }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
const DTChamber * _stat
Definition: DTTrigGeom.h:205
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
LocalPoint DTTrigGeom::toLocal ( const GlobalPoint  p) const
inline

Go to Local coordinate system for a point.

Definition at line 121 of file DTTrigGeom.h.

References _stat, GeomDet::surface(), and GloballyPositioned< T >::toLocal().

121 { return _stat->surface().toLocal(p); }
const DTChamber * _stat
Definition: DTTrigGeom.h:205
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
LocalPoint toLocal(const GlobalPoint &gp) const
LocalVector DTTrigGeom::toLocal ( const GlobalVector  v) const
inline

Go to Local coordinate system for a vector.

Definition at line 124 of file DTTrigGeom.h.

References _stat, GeomDet::surface(), and GloballyPositioned< T >::toLocal().

124 { return _stat->surface().toLocal(v); }
const DTChamber * _stat
Definition: DTTrigGeom.h:205
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
LocalPoint toLocal(const GlobalPoint &gp) const
LocalPoint DTTrigGeom::tubePosInCh ( int  nsl,
int  nlay,
int  ntube 
) const

Wire position in chamber frame.

Definition at line 169 of file DTTrigGeom.cc.

References _stat, gather_cfg::cout, DTLayerId, DTSuperLayerId, DTSuperLayer::layer(), DTLayer::specificTopology(), statId(), DTChamber::superLayer(), GeomDet::surface(), GeomDet::toGlobal(), GloballyPositioned< T >::toLocal(), and DTTopology::wirePosition().

Referenced by dumpGeom(), and phiSLOffset().

169  {
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 }
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
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:52
DTSuperLayerId
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
LocalPoint toLocal(const GlobalPoint &gp) const
const DTLayer * layer(DTLayerId id) const
Return the layer corresponding to the given id.
Definition: DTSuperLayer.cc:68
DTChamberId statId() const
Identifier of the associated chamber.
Definition: DTTrigGeom.h:55
tuple cout
Definition: gather_cfg.py:121
const DTSuperLayer * superLayer(DTSuperLayerId id) const
Return the superlayer corresponding to the given id.
Definition: DTChamber.cc:65
int DTTrigGeom::wheel ( ) const
inline

Return wheel number.

Definition at line 61 of file DTTrigGeom.h.

References _stat, DTChamber::id(), and DTChamberId::wheel().

Referenced by dumpGeom(), dumpLUT(), getGeom(), geometryXMLparser.DTAlignable::index(), localPosition(), DTGeomSupplier::wheel(), DTSCTrigUnit::wheel(), DTTracoChip::wheel(), and DTBtiChip::wheel().

61 { return _stat->id().wheel(); }
const DTChamber * _stat
Definition: DTTrigGeom.h:205
DTChamberId id() const
Return the DTChamberId of this chamber.
Definition: DTChamber.cc:33
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
float DTTrigGeom::ZcenterSL ( ) const
inline

Coordinate of center of the 2 Phi SL.

Definition at line 84 of file DTTrigGeom.h.

References _ZSL.

Referenced by dumpLUT(), and localPosition().

84 { return 0.5*(_ZSL[2]+_ZSL[0]); }
float _ZSL[3]
Definition: DTTrigGeom.h:211
float DTTrigGeom::ZSL ( int  sl) const

Radial coordinate in chamber frame of center of a superlayer.

Definition at line 265 of file DTTrigGeom.cc.

References _ZSL, and gather_cfg::cout.

Referenced by dumpGeom(), and getGeom().

265  {
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 }
float _ZSL[3]
Definition: DTTrigGeom.h:211
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

bool DTTrigGeom::_debug
private
float DTTrigGeom::_H
private

Definition at line 209 of file DTTrigGeom.h.

Referenced by cellH(), and getGeom().

int DTTrigGeom::_NCELL[3]
private

Definition at line 212 of file DTTrigGeom.h.

Referenced by getGeom(), and nCell().

float DTTrigGeom::_PHICH
private

Definition at line 208 of file DTTrigGeom.h.

Referenced by getGeom(), and phiCh().

float DTTrigGeom::_PITCH
private

Definition at line 210 of file DTTrigGeom.h.

Referenced by cellPitch(), and getGeom().

const DTChamber* DTTrigGeom::_stat
private
float DTTrigGeom::_ZSL[3]
private

Definition at line 211 of file DTTrigGeom.h.

Referenced by distSL(), getGeom(), ZcenterSL(), and ZSL().