CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

DTTrigGeom Class Reference

#include <DTTrigGeom.h>

List of all members.

Public Member Functions

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

Private Member Functions

void getGeom ()
 Get the geometry from the station.

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

Date:
2009/11/02 14:18:31
Revision:
1.8
Author:
C.Grandi S.Vanini

Definition at line 43 of file DTTrigGeom.h.


Constructor & Destructor Documentation

DTTrigGeom::DTTrigGeom ( DTChamber stat,
bool  debug 
)

Constructor.

Definition at line 52 of file DTTrigGeom.cc.

References getGeom().

                                                  : _stat(stat) , _debug(debug) {

  getGeom();

}
DTTrigGeom::~DTTrigGeom ( )

Destructor.

Definition at line 63 of file DTTrigGeom.cc.

{}

Member Function Documentation

float DTTrigGeom::cellH ( ) const [inline]
float DTTrigGeom::cellPitch ( ) const [inline]
GlobalPoint DTTrigGeom::CMSPosition ( const DTBtiId  obj) const [inline]

CMS position of a BTI.

Definition at line 184 of file DTTrigGeom.h.

References localPosition(), and toGlobal().

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

                                                            { 
      return  toGlobal(localPosition(obj));
    }
GlobalPoint DTTrigGeom::CMSPosition ( const DTTracoId  obj) const [inline]

CMS position of a TRACO.

Definition at line 189 of file DTTrigGeom.h.

References localPosition(), and toGlobal().

                                                              { 
      return toGlobal(localPosition(obj)); 
    }
float DTTrigGeom::distSL ( ) const [inline]

Distance between the phi view superlayers (cms)

Definition at line 83 of file DTTrigGeom.h.

References _ZSL.

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

{ return fabs(_ZSL[2]-_ZSL[0]); }
void DTTrigGeom::dumpGeom ( ) const

Dump the geometry.

Definition at line 276 of file DTTrigGeom.cc.

References _stat, CMSPosition(), gather_cfg::cout, 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().

                           {
  std::cout << "Identification: wheel=" << wheel();
  std::cout << ", station=" << station();
  std::cout << ", sector=" << sector() << std::endl;
  GlobalPoint pp = _stat->toGlobal(LocalPoint(0,0,0));
  std::cout << "Position: Mag=" << pp.mag() << "cm, Phi=" << pp.phi()*180/3.14159;
  std::cout << " deg, Z=" << pp.z() << " cm" << std::endl;
  std::cout << "Rotation: ANGLE=" << phiCh()*180/3.14159 << std::endl;
  std::cout << "Z of superlayers: phi=" << ZSL(1) << ", ";
  std::cout << ZSL(3) << " theta=" << ZSL(2) << std::endl;
  std::cout << "Number of cells: SL1=" << nCell(1) << " SL2=" << nCell(2) <<
    " SL3=" << nCell(3) << std::endl;
  std::cout << "First wire positions:" << std::endl;
  int ii=0;
  int jj=0;
  for( ii = 1; ii<=3; ii++ ) {
    if(station()!=4||ii!=2){
      for ( jj =1; jj<=4; jj++ ) {
        std::cout << "    SL=" << ii << ", lay=" << jj << ", wire 1 position=";
        if ( jj ==4)
          std::cout << tubePosInCh( ii, jj, 2) << std::endl;
        else
          std::cout << tubePosInCh( ii, jj, 1) << std::endl;
      }
    }
  }

  GlobalPoint gp1 = CMSPosition(DTBtiId(statId(),1,1)); 
  

  std::cout << "First BTI position:";
  std::cout << " SL1:" << localPosition(DTBtiId(statId(),1,1)) << std::endl;
  std::cout << " Position: R=" << gp1.perp() << "cm, Phi=" << gp1.phi()*180/3.14159 << " deg, Z=" << gp1.z() << " cm" << std::endl;

  if(station()!=4)
  {
        GlobalPoint gp2 = CMSPosition(DTBtiId(statId(),2,1)); 
        std::cout << " SL2:" << localPosition(DTBtiId(statId(),2,1))<< std::endl;
        std::cout << " Position: R=" << gp2.perp() << "cm, Phi=" << gp2.phi()*180/3.14159 << " deg, Z=" << gp2.z() << " cm" << std::endl;
  }

  GlobalPoint gp3 = CMSPosition(DTBtiId(statId(),3,1)); 
  std::cout << " SL3:" << localPosition(DTBtiId(statId(),3,1)) << std::endl;
  std::cout << " Position: R=" << gp3.perp() << "cm, Phi=" << gp3.phi()*180/3.14159 << " deg, Z=" << gp3.z() << " cm" << std::endl;

  std::cout << "First TRACO position:";
  std::cout << localPosition(DTTracoId(statId(),1)) << std::endl;
  std::cout << "******************************************************" << std::endl;
}
void DTTrigGeom::dumpLUT ( short int  btic)

Dump the LUT for this chamber.

Definition at line 327 of file DTTrigGeom.cc.

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

Referenced by DTSCTrigUnit::dumpLUT().

                                  {

  // chamber id
  int wh = wheel();
  int st = station();
  int se = sector();

  // open txt file 
  string name = "Lut_from_CMSSW_geom";
 /* name += "_wh_";
  if(wh<0)
        name += "-";
  name += abs(wh) + '0';
  name += "_st_";
  name += st + '0';
  name += "_se_";
  if(se<10)
        name += se + '0';
  else 
  {
        name += 1 + '0';
        name += (se-10) + '0';
  }
  */ 
  name += ".txt";

  ofstream fout;
  fout.open(name.c_str(),ofstream::app);

// *** dump file header
//  fout << "Identification: wheel\t" << wh;
//  fout << "\tstation\t" << st;
//  fout << "\tsector\t" << se;
  fout << wh;
  fout << "\t" << st;
  fout << "\t" << se;

  // SL shift
  float xBTI1_3         = localPosition( DTBtiId(DTSuperLayerId(wheel(),station(),sector(),3),1) ).x();
  float xBTI1_1         = localPosition( DTBtiId(DTSuperLayerId(wheel(),station(),sector(),1),1) ).x();
  float SL_shift        = xBTI1_3 - xBTI1_1;
  //  std::cout << " SL shift " << SL_shift << std::endl;

  // traco 1 and 2 global position
  LocalPoint traco1     = localPosition(DTTracoId(statId(),1));
  LocalPoint traco2     = localPosition(DTTracoId(statId(),2));
  GlobalPoint traco_1   = toGlobal(traco1);
  GlobalPoint traco_2   = toGlobal(traco2);
  // std::cout << " tr1 x " << traco_1.x() << " tr2 x " << traco_2.x() << std::endl;

  float d;
  float xcn;
  int xcn_sign;
  GlobalPoint pp = _stat->toGlobal(LocalPoint(0,0,ZcenterSL()));
  // std::cout << "Position: x=" << pp.x() << "cm, y=" << pp.y() << "cm, z=" << pp.z() << std::endl;  
    
  if(sector()==1 || sector() ==7){  
        d = fabs(traco_1.x());
        xcn = fabs(traco_1.y());
        // 110208 SV comment: this was inserted for a TRACO hardware bug
        if (SL_shift > 0) 
                xcn = xcn+SL_shift;
        xcn_sign = static_cast<int>(pp.y()/fabs(pp.y()))*static_cast<int>(traco_1.y()/fabs(traco_1.y()));
        if(station() == 2 || (station() == 4 && sector() == 1)) 
                xcn_sign = - xcn_sign;
        xcn = xcn*xcn_sign;
  }
  else {
        float m1 = (traco_2.y()-traco_1.y())/(traco_2.x()-traco_1.x());
        float q1 = traco_1.y()-m1*traco_1.x();
        float m = tan(phiCh());
        float xn = q1/(m-m1);
        float yn = m*xn;
  
        d = sqrt(xn*xn+yn*yn);
        xcn = sqrt( (xn-traco_1.x())*(xn-traco_1.x()) + (yn-traco_1.y())*(yn-traco_1.y()) );
        // 110208 SV comment: this was inserted for a TRACO hardware bug
        if (SL_shift > 0) 
                xcn = xcn+SL_shift;
  
        float diff = (pp.x()-traco_1.x())*traco_1.y();
        xcn_sign = static_cast<int>(diff/fabs(diff));
        xcn = xcn*xcn_sign;
  }
  // std::cout << " d " << d << " xcn " << xcn << " sign " << xcn_sign << std::endl; 
  //fout << "\td\t" << d << "\txcn\t" << xcn << "\t"; 
  //fout << "btic\t" << btic << "\t";

// *** dump TRACO LUT command
  fout << "\tA8";
  //short int btic = 31;
  //cout << "CHECK BTIC " << btic << endl;
  short int Low_byte = (btic & 0x00FF);   // output in hex bytes format with zero padding
  short int High_byte =( btic>>8 & 0x00FF);
  fout << setw(2) << setfill('0') << hex << High_byte << setw(2) << setfill('0') << Low_byte;   
    
  // convert parameters from IEE32 float to DSP float format
  short int DSPmantissa = 0;
  short int DSPexp = 0;

  // d parameter conversion and dump
  IEEE32toDSP(d, DSPmantissa, DSPexp);
  Low_byte = (DSPmantissa & 0x00FF);   // output in hex bytes format with zero padding
  High_byte =( DSPmantissa>>8 & 0x00FF);
  fout << setw(2) << setfill('0') << hex << High_byte << setw(2) << setfill('0') << Low_byte;   
  Low_byte = (DSPexp & 0x00FF);
  High_byte =( DSPexp>>8 & 0x00FF);
  fout << setw(2) << setfill('0') << High_byte << setw(2) << setfill('0') << Low_byte;  

  // xnc parameter conversion and dump
  DSPmantissa = 0;
  DSPexp = 0;
  IEEE32toDSP(xcn, DSPmantissa, DSPexp);
  Low_byte = (DSPmantissa & 0x00FF);   // output in hex bytes format with zero padding
  High_byte =( DSPmantissa>>8 & 0x00FF);
  fout << setw(2) << setfill('0') << hex << High_byte << setw(2) << setfill('0') << Low_byte;   
  Low_byte = (DSPexp & 0x00FF);
  High_byte =( DSPexp>>8 & 0x00FF);
  fout << setw(2) << setfill('0') << High_byte << setw(2) << setfill('0') << Low_byte;  

  // sign bits 
  Low_byte = (xcn_sign & 0x00FF);   // output in hex bytes format with zero padding
  High_byte =( xcn_sign>>8 & 0x00FF);
  fout << setw(2) << setfill('0') << hex << High_byte << setw(2) << setfill('0') << Low_byte << dec << "\n"; 

  fout.close();

  return;
 
}
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(), Surface::toGlobal(), GeomDet::toGlobal(), GloballyPositioned< T >::toLocal(), wheel(), DTTopology::wirePosition(), PV3DBase< T, PVType, FrameType >::z(), and ZSL().

Referenced by DTTrigGeom(), and setGeom().

                    {

  // Geometrical constants of chamber
  // Cell width (cm)
  _PITCH = 4.2;
  // Cell height (cm)
  _H = 1.3;
  // azimuthal angle of normal to the chamber
  _PHICH = _stat->surface().toGlobal(LocalVector(0,0,-1)).phi();

  // superlayer positions and number of cells
  DTSuperLayer* sl[3];
  DTLayer* l1[3];
  int i = 0;
  for(i=0; i<3; i++) {
    if(station()==4&&i==1) { // No theta SL in MB4
      _ZSL[i] = -999;
      _NCELL[i] = 0;
    } else {
      sl[i] = (DTSuperLayer*) _stat->superLayer(DTSuperLayerId(statId(),i+1));
      l1[i] = (DTLayer*) sl[i]->layer(DTLayerId(statId(),i+1,1));
      _ZSL[i] = _stat->surface().toLocal(sl[i]->position()).z(); // - 1.5 * _H;
      //LocalPoint posInLayer=l1[i]->layType()->getWire(1)->positionInLayer();
      const DTTopology& tp=l1[i]->specificTopology();
      float  posX=tp.wirePosition(tp.firstChannel());
      LocalPoint posInLayer(posX,0,0);
      _NCELL[i] = l1[i]->specificTopology().channels();
    }
  }

  // debugging
  if(_debug){
    std::cout << setiosflags(std::ios::showpoint | std::ios::fixed) << std::setw(4) <<
      std::setprecision(1);
    std::cout << "Identification: wheel=" << wheel();
    std::cout << ", station=" << station();
    std::cout << ", sector=" << sector() << std::endl;
    GlobalPoint pp = _stat->toGlobal(LocalPoint(0,0,0));
    std::cout << "Position: Mag=" << pp.mag() << "cm, Phi=" << pp.phi()*180/3.14159;
    std::cout << " deg, Z=" << pp.z() << " cm" << std::endl;
    std::cout << "Rotation: ANGLE=" << phiCh()*180/3.14159 << std::endl;
    //if(wheel()==2&&sector()==2){ // only 1 sector-wheel
      std::cout << "Z of superlayers: phi=" << ZSL(1) << ", ";
      std::cout << ZSL(3) << " theta=" << ZSL(2);
      std::cout << " (DeltaY = " << distSL() << ")" << std::endl;
      std::cout << " ncell: sl 1 " <<  nCell(1) << " sl 2 " <<  nCell(2) <<
              " sl 3 " <<  nCell(3) << std::endl;   
    //}
  }
  // end debugging

}
void DTTrigGeom::IEEE32toDSP ( float  f,
short int &  DSPmantissa,
short int &  DSPexp 
)

Definition at line 493 of file DTTrigGeom.cc.

Referenced by dumpLUT().

{  
  long int lm;
  long int pl = 0;
  
  bool sign=false;

  DSPmantissa = 0;
  DSPexp = 0;

  if( f!=0.0 )
  {
        memcpy(&pl,&f,sizeof(float));
        
        if((pl & 0x80000000)!=0) 
                sign=true;        
        lm = ( 0x800000 | (pl & 0x7FFFFF)); // [1][23bit mantissa]
        lm >>= 9; //reduce to 15bits
        lm &= 0x7FFF;
        DSPexp = ((pl>>23)&0xFF)-126;
        DSPmantissa = (short)lm;
        if(sign) 
                DSPmantissa = - DSPmantissa;  // convert negative value in 2.s complement       

  }
  return;
}
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(), DTTracoChip::localPosition(), DTTracoCard::localPosition(), DTBtiCard::localPosition(), localPosition(), and DTBtiChip::localPosition().

                                                {
/* obsolete!
  float x = 0;
  float y = 0;
  float z = ZSL(id.superlayer());
  if(id.superlayer()==2){
    // SL 2: Reverse numbering -------V
    y = Xwire1BTI1SL(id.superlayer()) - ((float)(id.bti()-1)-0.5)*cellPitch();
  } else {
    x = Xwire1BTI1SL(id.superlayer()) + ((float)(id.bti()-1)-0.5)*cellPitch();
  }
*/

//NEWGEO
/*  int nsl = id.superlayer();
  int tube = mapTubeInFEch(nsl,1,id.bti());
  LocalPoint p = tubePosInCh(nsl,1,tube);
  //traslation because z axes is in middle of SL, x/y axes on left I of first cell
  
  LocalPoint p1 = tubePosInCh (nsl,1,1);
  LocalPoint p2 = tubePosInCh (nsl,2,1); 
  cout << "nbti " << id.bti() << " tube " << tube << " localpoint" << p << endl;
  cout << "localpoint layer 1" << p1  << " localpoint layer 2" << p2 << endl;
  
  float xt = 0;
  float yt = 0;
  float zt = - cellH() * 3./2.;
  if(nsl==2)
    yt = - cellPitch()/2.; 
  else
    xt = + cellPitch()/2.; 

  if(posFE(nsl)==0){//FE in positive y
      xt = - xt;
      yt = - yt;
  }
  
  cout << "localpoint " << p << ' '  << xt << ' ' << yt << endl;

  return LocalPoint(p.x()+xt,p.y()+yt,p.z()+zt);*/
        
        int nsl = id.superlayer();
        const DTSuperLayer* sl   = _stat->superLayer(DTSuperLayerId(statId(),nsl));
        const DTLayer* lay       = sl->layer(DTLayerId(statId(),nsl,1));
        int tube = id.bti();
        float localX             = lay->specificTopology().wirePosition(tube);
        float xt = -cellPitch()/2.;
        float zt = -cellH() * 3./2.;
        //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,
        LocalPoint posInLayer1(localX+xt,0,zt);
        LocalPoint posInChamber  = _stat->surface().toLocal(lay->toGlobal(posInLayer1));
        //GlobalPoint posInCMS = lay->toGlobal(posInLayer1);

        /* cout <<endl;
        cout << "tube " << ntube << " nlay " << nlay << endl;
        cout << "posinlayer " << posInLayer1 << "posinchamb " << posInChamber << "posinCMS " << posInCMS << endl;*/
        
        return posInChamber;
}
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(), PV3DBase< T, PVType, FrameType >::x(), x, detailsBasic3DVector::y, z, and ZcenterSL().

                                                  {
/* obsolete
  float x = Xwire1BTI1SL(1) +
    ( ( (float)(id.traco()) - 0.5 ) * DTConfig::NBTITC - 0.5 )*cellPitch();
  // half cell shift in SL1 of MB1 (since cmsim116)
  if(station()==1) x -= 0.5*cellPitch();
  float y = 0;
  float z = ZcenterSL();
*/
  //NEWGEO
  // position of first BTI in sl 3 on X
  float x = localPosition( DTBtiId(DTSuperLayerId(wheel(),station(),sector(),3),1) ).x();
// 10/7/06 May be not needed anymore in new geometry
//   if(posFE(3)==1)
//     x -= (id.traco()-2)*DTConfig::NBTITC * cellPitch();
//   if(posFE(3)==0)
    x += (id.traco()-2)*DTConfig::NBTITC * cellPitch();

  float y = 0;
  float z = ZcenterSL();

  return LocalPoint(x,y,z);
}
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().

                                                            {
  int nch = 0;
  if(station()==4 && nsl==2){
    std::cout << "No theta superlayer in station 4!" << std::endl;
  }
  else{
    // obsolete 19/06/2006  const DTLayer* lay = _stat->superLayer(DTSuperLayerId(statId(),nsl))->layer(DTLayerId(statId(),nsl,nlay));
          
/* obsolete 19/6/06
 if(lay->getFEPosition()==0)         //FE is in Y negative: opposite numbering                
          nch = lay->specificTopology().channels() - ntube + 1;   
//   if(lay->getFEPosition()==1)         //FE is in Y positive: same numbering digi-trig        
//     nch = ntube;
//  }
*/      
        // in new geometry depends on SL: theta tube numbering is reverted wrt hardware
        nch =ntube;
/*      if(nsl==2){     
                nch = lay->specificTopology().channels() - ntube + 1;
        }*/
  }
  return nch;
}
int DTTrigGeom::nCell ( int  sl) const [inline]

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

Definition at line 92 of file DTTrigGeom.h.

References _NCELL.

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

                                   {
      return (sl>0&&sl<=3)*_NCELL[sl-1]; 
    }
float DTTrigGeom::phiCh ( ) const [inline]

Rotation angle of chamber (deg)

Definition at line 74 of file DTTrigGeom.h.

References _PHICH.

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

{ return _PHICH; }
float DTTrigGeom::phiSLOffset ( )

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

Definition at line 71 of file DTTrigGeom.cc.

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

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

                       {
  //sl1 offset respect to sl3 - in Front End view!!
  float x1 = tubePosInCh(1,1,1).x();
  float x3 = tubePosInCh(3,1,1).x();
  float offset = x1-x3;
  //   if(posFE(1)==1)        // Obsolete in
  //     offset = - offset;   // CMSSW
  
  return offset;
}
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().

                              {
   if( station()!=4 || sl!=2 ) {
     // obsolete 19/0602006 const DTLayer* lay  = _stat->superLayer(DTSuperLayerId(statId(),sl))->layer(DTLayerId(statId(),sl,1));
     return 1/*lay->getFEPosition()*/;                                               
   }
   else{
    std::cout << "No theta superlayer in station 4!" << std::endl;
    return 0;
  }
}
int DTTrigGeom::sector ( void  ) const [inline]
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().

                                         {

  _stat=stat;
  getGeom();

}
const DTChamber* DTTrigGeom::stat ( ) const [inline]

Associated chamber.

Definition at line 54 of file DTTrigGeom.h.

References _stat.

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

{ return _stat; }
DTChamberId DTTrigGeom::statId ( ) const [inline]
int DTTrigGeom::station ( ) const [inline]
GlobalVector DTTrigGeom::toGlobal ( const LocalVector  v) const [inline]

Go to CMS coordinate system for a vector.

Definition at line 120 of file DTTrigGeom.h.

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

{ return _stat->surface().toGlobal(v); }
GlobalPoint DTTrigGeom::toGlobal ( const LocalPoint  p) const [inline]

Go to CMS coordinate system for a point.

Definition at line 117 of file DTTrigGeom.h.

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

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

{ return _stat->surface().toGlobal(p); }
LocalPoint DTTrigGeom::toLocal ( const GlobalPoint  p) const [inline]

Go to Local coordinate system for a point.

Definition at line 123 of file DTTrigGeom.h.

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

{ return _stat->surface().toLocal(p); }
LocalVector DTTrigGeom::toLocal ( const GlobalVector  v) const [inline]

Go to Local coordinate system for a vector.

Definition at line 126 of file DTTrigGeom.h.

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

{ return _stat->surface().toLocal(v); }
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().

                                                          {
  if ( nlay==4 && ntube==1) {
    std::cout << "ATTENTION: no wire nuber 1 for 4th layer!!!" << std::endl;
    LocalPoint dummyLP(0,0,0);
    return dummyLP;
  }
  const DTSuperLayer* sl   = _stat->superLayer(DTSuperLayerId(statId(),nsl));
  const DTLayer* lay       = sl->layer(DTLayerId(statId(),nsl,nlay));
  
   float localX             = lay->specificTopology().wirePosition(ntube);
   LocalPoint posInLayer(localX,0,0);
   LocalPoint posInChamber  = _stat->surface().toLocal(lay->toGlobal(posInLayer));
   //obsolete 19/06/2006 GlobalPoint  posInCMS = lay->toGlobal(posInLayer);
  
 /* cout <<endl;
  cout << "tube " << ntube << " nlay " << nlay << endl;
  cout << "posinlayer " << posInLayer << "posinchamb " << posInChamber << "posinCMS " << posInCMS << endl;*/
  
  return posInChamber;
}
int DTTrigGeom::wheel ( ) const [inline]
float DTTrigGeom::ZcenterSL ( ) const [inline]

Coordinate of center of the 2 Phi SL.

Definition at line 86 of file DTTrigGeom.h.

References _ZSL.

Referenced by dumpLUT(), and localPosition().

{ return 0.5*(_ZSL[2]+_ZSL[0]); } 
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().

                            {
  if(sl<1||sl>3){
    std::cout << "DTTrigGeom::ZSL: wrong SL number: " << sl;
    std::cout << -999 << " returned" << std::endl;
    return -999;
  }
  return _ZSL[sl-1];
}

Member Data Documentation

bool DTTrigGeom::_debug [private]

Definition at line 215 of file DTTrigGeom.h.

Referenced by getGeom().

float DTTrigGeom::_H [private]

Definition at line 211 of file DTTrigGeom.h.

Referenced by cellH(), and getGeom().

int DTTrigGeom::_NCELL[3] [private]

Definition at line 214 of file DTTrigGeom.h.

Referenced by getGeom(), and nCell().

float DTTrigGeom::_PHICH [private]

Definition at line 210 of file DTTrigGeom.h.

Referenced by getGeom(), and phiCh().

float DTTrigGeom::_PITCH [private]

Definition at line 212 of file DTTrigGeom.h.

Referenced by cellPitch(), and getGeom().

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

Definition at line 213 of file DTTrigGeom.h.

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