CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

DTBtiChip Class Reference

#include <DTBtiChip.h>

List of all members.

Public Member Functions

void add_digi (int cell, const DTDigi *digi)
 Add a digi to the DTBtiChip.
void add_digi_clock (int cell, int clock_digi)
 Add a clock digi to the DTBtiChip.
void addTrig (int step, DTBtiTrig *btitrig)
void clear ()
 delete hits and triggers
GlobalPoint CMSPosition () const
 Position in CMS frame.
DTConfigBticonfig () const
 Configuration set.
 DTBtiChip (DTBtiCard *card, DTTrigGeom *geom, int supl, int n, DTConfigBti *_config)
 original constructor
 DTBtiChip (const DTBtiChip &bti)
 Copy constructor.
DTTrigGeomgeom () const
 Return trigger geometry.
std::vector< const DTDigi * > get_CellDigis (int cell)
 get digi vector - SV 28/XI/02
DTBtiId id () const
 Return the DTBtiChip Id.
void init_clock ()
LocalPoint localPosition () const
 Position in chamber frame (x is the one of first traco in slave plane)
int nCellHit () const
 Number of cells with hits.
int nTrig (int step) const
 Number of triggers found.
int number () const
 Return DTBtiChip number.
DTBtiChipoperator= (const DTBtiChip &bti)
 Assignment operator.
void run ()
 Run DTBtiChip algorithm.
int sector () const
 Return sector number.
int station () const
 Return station number.
int superlayer () const
 Return superlayer.
DTBtiTrigtrigger (int step, unsigned n) const
 Return the requested trigger.
DTBtiTrigData triggerData (int step, unsigned n) const
 Return the data part of the requested trigger.
std::vector< DTBtiTrig * > trigList (int step) const
int wheel () const
 Return wheel number.
 ~DTBtiChip ()
 Destructor.

Private Member Functions

void acceptMask (BitArray< 80 > *BitArrPtr, int k, int accep)
void computeEqs ()
void computeSums ()
int currentIntStep () const
int currentStep () const
void doLTS ()
void eraseTrigger (int step, unsigned n)
void findTrig ()
void init ()
int keepTrig (const int eq, const int acp, const int code)
int keepTrigPatt (int flag, const int eq, const int pattType, int hlflag)
bool matchEq (float eqA, float eqB, int AC)
int reSum (int a, int b)
int reSum23 (int a, int b)
void reSumSet ()
void setSnap ()
int store (const int eq, const int code, const int K, const int X, float KeqAB=0., float KeqBC=0., float KeqCD=0., float KeqAC=0., float KeqBD=0., float KeqAD=0.)
void sum (const int s, const int a, const int b)
void tick ()

Private Attributes

int _busyStart_clock [9]
DTBtiCard_card
DTConfigBti_config
int _curStep
float _difs [25]
std::vector< const DTDigi * > _digis [9]
std::vector< int > _digis_clock [9]
DTTrigGeom_geom
std::vector< DTBtiHit * > _hits [9]
DTBtiId _id
float _JTR [32][3]
float _Keq [32][6]
float _KTR [32][2]
int _MaxKAcc
int _MaxKcenterTraco
int _MaxKleftTraco
int _MaxKrightTraco
int _MinKAcc
int _MinKcenterTraco
int _MinKleftTraco
int _MinKrightTraco
int _nStepUsedHits
float _sums [25]
DTBtiHit_thisStepUsedHit [9]
int _thisStepUsedTimes [9]
std::vector< DTBtiTrig * > _trigs [DTConfig::NSTEPL-DTConfig::NSTEPF+1]
float _Xeq [32][2]
float _XeqAB_patt0
float _XeqAC_patt0
float _XeqBD_patt0
float _XeqCD_patt0
int init_done
int RE23
int RE43
int reSumAr [3][5]
int reSumAr23 [3][5]
int ST
int ST2
int ST23
int ST3
int ST4
int ST43
int ST5
int ST7

Detailed Description

Implementation of DTBtiChip trigger algorithm Internally uses DTBtiHit to store muon digis

Date:
2010/01/21 10:22:12
Revision:
1.8
Author:
S. Vanini

Definition at line 48 of file DTBtiChip.h.


Constructor & Destructor Documentation

DTBtiChip::DTBtiChip ( DTBtiCard card,
DTTrigGeom geom,
int  supl,
int  n,
DTConfigBti _config 
)

original constructor

new constructor with configuration

Definition at line 48 of file DTBtiChip.cc.

References _busyStart_clock, _card, _digis, _geom, _hits, _id, _MaxKAcc, _MinKAcc, _trigs, DTTrigGeom::cellH(), DTTrigGeom::cellPitch(), DTConfigBti::CH(), DTConfigBti::CL(), CMSPosition(), DTTrigGeom::CMSPosition(), config(), gather_cfg::cout, DTConfigBti::DEADpar(), debug, i, init_done, DTConfigBti::KAccTheta(), n, DTConfig::NSTEPF, DTConfig::NSTEPL, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), reSumSet(), setSnap(), evf::utils::sid, DTConfigBti::ST(), DTTrigGeom::statId(), DTBtiId::superlayer(), funct::tan(), theta(), DTBtiCard::useAcceptParamFlag(), and PV3DBase< T, PVType, FrameType >::z().

                                                                                         : _card(card), _geom(geom), _config(conf) {


 // original constructor
 setSnap();
 reSumSet(); 

 // Debugging...
  if(config()->debug()>2){
    cout << "DTBtiChip constructor called for BTI number " << n;
    cout << " in superlayer " << supl << endl;
  }

  // reserve the appropriate amount of space for vectors
  int i=0;
  for(i=0;i<DTConfig::NSTEPL - DTConfig::NSTEPF;i++) {
    _trigs[i].reserve(2);
  }

  for(i=0;i<9;i++) {
    _digis[i].reserve(10);
    _hits[i].reserve(10);
  }

  //SV wire dead time init
  int DEAD = config()->DEADpar();
  for(int cell=1; cell<=9; cell++){
    _busyStart_clock[cell-1] = - DEAD -1;
  }

  // Identifier
  DTChamberId sid = _geom->statId();
  _id = DTBtiId(sid, supl, n);

  //if(config()->trigSetupGeom() == 0){
    // set K acceptance in theta view for this BTI: 6 bit resolution....  
    _MinKAcc = 0;
    _MaxKAcc = 63;
        
/*         DTBtiId _id1 = DTBtiId(sid,supl,1);
           
           cout <<"superlayer" << _id.superlayer()<< "BTI1   " <<  _id1.bti()  << " BTICur " << _id.bti()<< endl;
           cout <<endl;
           GlobalPoint gp1 = _geom->CMSPosition(_id1);
           cout << "pos of BTI "<<  _id1.bti()  << gp1 <<endl;
           // K of tracks from vertex
           GlobalPoint gp = CMSPosition();
           cout << "pos of BTI" << _id.bti()  << gp <<endl;        
           cout << endl ; */
           
           
//     // theta bti acceptance cut is in bti chip (no traco in theta!)
//     // acceptance from orca geom: bti theta angle in CMS frame +-2 in K units 
//     if(_id.superlayer()==2){
//       float distp2 = (int)(2*_geom->cellH()*config()->ST()/_geom->cellPitch());
//       float K0 = config()->ST();

// /*      DTBtiId _id1 = DTBtiId(sid,supl,1);
      
//       cout << "BTI1   " <<  _id1.bti() << endl;
//       cout << "BTICur " << _id.bti() <<endl;
//       GlobalPoint gp1 = _geom->CMSPosition(_id1);
//       cout << "pos of BTI 1 " << gp1 <<endl;*/
          
//       // K of tracks from vertex
//       GlobalPoint gp = CMSPosition();
//       if(config()->debug()>3){
//         cout << "Position: R=" << gp.perp() << "cm, Phi=" << gp.phi()*180/3.14159;
//         cout << " deg, Z=" << gp.z() << " cm" << endl;
//       }
//       // CB TEST WITH NEW GEOMETRY
//       // new geometry: modified wrt old due to specularity of theta SLs (still to understand on wheel zero) 19/06/06
//       float theta;
//       if (_id.wheel()==0){ 
//      if(_id.sector()%4>1) theta = atan( gp.z()/gp.perp() );
//      else theta = atan( -gp.z()/gp.perp() );
//       }
//       else theta = atan( fabs(gp.z())/gp.perp() );
//       // .11 =TAN(6.3 deg) ==> k=2 (e' ancora vero? forse questa parte va aggiornata sena ripassare per gli angoli) 19/6/06
//       float thetamin = theta-config()->KAccTheta()*0.055;
//       float thetamax = theta+config()->KAccTheta()*0.055;

//       float fktmin = tan(thetamin)*distp2 + K0;
//       int ktmin = (fktmin>0) ? (int)(fktmin+0.5) : (int)(fktmin-0.5);
//       float fktmax = tan(thetamax)*distp2 + K0;
//       int ktmax = (fktmax>0) ? (int)(fktmax+0.5) : (int)(fktmax-0.5);
// //      float fkbti = -gp.z()/gp.perp()*distp2;
// //      int kbti = (fkbti>0) ? (int)(fkbti+0.5) : (int)(fkbti-0.5);
// //      // K acceptance to point to vertex
// //      int ktmin = kbti-config()->KAccTheta();  // minimum
// //      int ktmax = kbti+config()->KAccTheta();  // maximum
//       if(ktmin>_MinKAcc)_MinKAcc=ktmin;
//       if(ktmax<_MaxKAcc)_MaxKAcc=ktmax;
//     }

//     // debugging
//     if(config()->debug()>2){
//       cout << "CMS position:" << CMSPosition() << endl;
//       cout << "K acceptance:" << _MinKAcc << "," << _MaxKAcc << endl;
//     }
//     // end debugging
// theta bti acceptance cut is in bti chip (no traco in theta!)
    // acceptance is determined about BTI angle wrt vertex with programmable value 
    if(_id.superlayer()==2){
      // 091105 SV theta bti trigger angular acceptance in CMSSW is computed from geometry 
      // (theta of the bti) +- a given tolerance config()->KAccTheta(): tolerance NOT in 
      // hardware configuration. The hw tolerance is given in the system and the 
      // overall acceptance is computed "before" data (CH,CL) is given to the MC
      // or written in the DB. No way to "extract" the tolerance from DB yet.

      if(_card->useAcceptParamFlag()==0){

        //float distp2 = (int)(2*_geom->cellH()*config()->ST()/_geom->cellPitch());   SV fix 17/III/07
        float distp2 = 2*_geom->cellH()*config()->ST()/_geom->cellPitch();
        float K0 = config()->ST();

        // position of BTI 1 and of current one
        DTBtiId _id1 = DTBtiId(sid,supl,1);
        GlobalPoint gp1 = _geom->CMSPosition(_id1); 
        GlobalPoint gp = CMSPosition();
        if(config()->debug()>3){
                cout << "Position: R=" << gp.perp() << "cm, Phi=" << gp.phi()*180/3.14159;
                cout << " deg, Z=" << gp.z() << " cm" << endl;
        }
        // new geometry: modified wrt old due to specularity of theta SLs --> fixed 6/9/06 
        float theta;
        if(gp1.z() < 0.0) 
                theta = atan( -(gp.z())/gp.perp() );                            
        else 
                theta = atan( (gp.z())/gp.perp() );

        // set BTI acceptance window : fixed wrt ORCA on 6/9/06  
        float fktmin = tan(theta)*distp2+K0 ;
        int ktmin = static_cast<int>(fktmin)-config()->KAccTheta();
        float fktmax = tan(theta)*distp2+K0+1;
        int ktmax = static_cast<int>(fktmax)+config()->KAccTheta();
        if(ktmin>_MinKAcc)
                _MinKAcc=ktmin;
        if(ktmax<_MaxKAcc)
                _MaxKAcc=ktmax;
      }
      // 091105 SV acceptance is taken simply from CH, CL parameters
      else {
        _MinKAcc = config()->CL();
        _MaxKAcc = config()->CH();
      } 

      // debugging
      if(config()->debug()>2){
        cout << "CMS position:" << CMSPosition() << endl;
        cout << "K acceptance (theta view):" << _MinKAcc << "," << _MaxKAcc  << endl;
      }// end debugging
         
    }//end theta acceptance computation 

  //}// end if trigSetupGeom=0


  //SV flag for initialization....
  init_done = 0; 

}
DTBtiChip::DTBtiChip ( const DTBtiChip bti)

Copy constructor.

Definition at line 212 of file DTBtiChip.cc.

References _difs, _digis, _hits, _JTR, _Keq, _KTR, _MaxKAcc, _MinKAcc, _sums, _thisStepUsedHit, _thisStepUsedTimes, _trigs, _Xeq, i, j, DTConfig::NSTEPF, DTConfig::NSTEPL, AlCaHLTBitMon_ParallelJobs::p, p1, reSumSet(), and setSnap().

                                         :
  _geom(bti._geom), _id(bti._id),
  _curStep(bti._curStep), _nStepUsedHits(bti._nStepUsedHits){

  setSnap();
  reSumSet();

  int i=0;
  for(i=0;i<DTConfig::NSTEPL - DTConfig::NSTEPF;i++) {
    _trigs[i].reserve(2);
    vector<DTBtiTrig*>::const_iterator p;
    for(p=bti._trigs[i].begin();p<bti._trigs[i].end();p++){
      _trigs[i].push_back(*p);
    }
  }
  for(i=0;i<9;i++) {
    _digis[i].reserve(10);
    vector<const DTDigi*>::const_iterator p;
    for(p=bti._digis[i].begin();p<bti._digis[i].end();p++){
      _digis[i].push_back(*p);
    }
    _hits[i].reserve(10);
    vector<DTBtiHit*>::const_iterator p1;
    for(p1=bti._hits[i].begin();p1<bti._hits[i].end();p1++){
      _hits[i].push_back(*p1);
    }
    _thisStepUsedTimes[i] = bti._thisStepUsedTimes[i];
    _thisStepUsedHit[i] = _thisStepUsedHit[i];
  }
  for(i=0;i<25;i++){
    _sums[i] = bti._sums[i];
    _difs[i] = bti._difs[i];
  }
  for(i=0;i<26;i++){
    int j = 0;
    for(j=0;j<6;j++){
      _Keq[i][j] = bti._Keq[i][j];
    }
    for(j=0;j<3;j++){
      _JTR[i][j] = bti._JTR[i][j];
    }
    for(j=0;j<2;j++){
      _Xeq[i][j] = bti._Xeq[i][j];
      _KTR[i][j] = bti._KTR[i][j];
    }
  }
  _MinKAcc = bti._MinKAcc;
  _MaxKAcc = bti._MaxKAcc;



}
DTBtiChip::~DTBtiChip ( )

Destructor.

Definition at line 267 of file DTBtiChip.cc.

References clear().

                     {
  clear();
}

Member Function Documentation

void DTBtiChip::acceptMask ( BitArray< 80 > *  BitArrPtr,
int  k,
int  accep 
) [private]

Definition at line 678 of file DTBtiChipSelTrig.cc.

References HDQMDatabaseProducer::config, gather_cfg::cout, debug, and BitArray< N >::set().

{
   if(k>=0&&k<78){
     if(config()->debug()>4)
       cout<<"DTBtiChip::acceptMask ->  Setting acceptance for k="<<k<<endl;

     if(accep==0){ //code 00
       if(k>=1) 
         BitArrPtr->set(k-1);
       BitArrPtr->set(k);
       BitArrPtr->set(k+1);
     }
     if(accep==1){ //code 01
       BitArrPtr->set(k);
       BitArrPtr->set(k+1);
       BitArrPtr->set(k+2);
     }
     if(accep==2){ //code 10
       if(k>1)
         BitArrPtr->set(k-2);
       if(k>=1)
         BitArrPtr->set(k-1);
       BitArrPtr->set(k);
     }
     if(accep==3){ //code 11
       if(k>1)
         BitArrPtr->set(k-2);
       if(k>=1)
         BitArrPtr->set(k-1);
       BitArrPtr->set(k);
       BitArrPtr->set(k+1);
       BitArrPtr->set(k+2);
     }
   }


  if(config()->debug()>4)
    cout<<"DTBtiChip::acceptMask ->  END "<<endl;

}
void DTBtiChip::add_digi ( int  cell,
const DTDigi digi 
)

Add a digi to the DTBtiChip.

Definition at line 327 of file DTBtiChip.cc.

References _busyStart_clock, _digis, _geom, _id, DTBtiHit::_stepTimeTdc, DTBtiId::bti(), config(), DTDigi::countsTDC(), gather_cfg::cout, DTConfigBti::DEADpar(), debug, DTTrigGeom::nCell(), DTDigi::print(), and superlayer().

Referenced by DTBtiCard::loadBTI().

                                                {

  if(_id.bti()<1 || _id.bti() >_geom->nCell(superlayer()))return;
  if(cell<1 || cell>9){
    cout << "DTBtiChip::add_digi : wrong cell number: " << cell;
    cout << ". Digi not added!" << endl;
    return;
  }

  int DEAD = config()->DEADpar();
  float stepTimeTdc = DTBtiHit::_stepTimeTdc;


  if( int(digi->countsTDC()/stepTimeTdc) - _busyStart_clock[cell-1] > DEAD ){
    _busyStart_clock[cell-1] = int(digi->countsTDC()/stepTimeTdc);
    _digis[cell-1].push_back(digi);

    // debugging
    if(config()->debug()>1){
    cout << "DTBtiChip::add_digi: DTBtiChip # " <<_id.bti() <<
    " cell " << cell << " --> drift time (tdc units)= " << digi->countsTDC()<< endl;
    digi->print();
    }
  }
  else {
  // debugging
  if(config()->debug()>1)
    cout << "DTBtiChip::add_digi: DTBtiChip # " <<_id.bti() <<
     " cell " << cell << " in dead time -> digi not added! " << endl;
  }

}
void DTBtiChip::add_digi_clock ( int  cell,
int  clock_digi 
)

Add a clock digi to the DTBtiChip.

Definition at line 362 of file DTBtiChip.cc.

References _busyStart_clock, _digis_clock, config(), gather_cfg::cout, DTConfigBti::DEADpar(), debug, and number().

                                            {

  if(cell<1 || cell>9){
    cout << "DTBtiChip::add_digi_clock : wrong cell number: " << cell;
    cout << ". Digi not added!" << endl;
    return;
  }

  int DEAD = config()->DEADpar();

  if( digi - _busyStart_clock[cell-1] > DEAD ){
    _busyStart_clock[cell-1] = digi;
    _digis_clock[cell-1].push_back(digi);
    // debugging
    if(config()->debug()>1)
      cout << "DTBtiChip::add_digi_clock: DTBtiChip # " <<number() <<
      " cell " << cell << " --> clock time = " << digi << endl;
  }
  else{
  // debugging
  if(config()->debug()>1)
    cout << "DTBtiChip::add_digi_clock: DTBtiChip # " << number() <<
     " cell " << cell << " in dead time -> digi not added! " << endl;
  }
}
void DTBtiChip::addTrig ( int  step,
DTBtiTrig btitrig 
)

Add a DTBtiChip trigger (normally used by DTBtiChip itself - may be used for debugging by other classes)

Definition at line 441 of file DTBtiChip.cc.

References _trigs, config(), gather_cfg::cout, debug, DTConfig::NSTEPF, DTConfig::NSTEPL, and launcher::step.

Referenced by store(), and DTBtiCard::storeTrigger().

                                               { 
  if(step>=DTConfig::NSTEPF&&step<=DTConfig::NSTEPL){
    if(config()->debug()>3) 
      cout << "DTBtiChip: adding trigger..." <<endl;
    _trigs[step-DTConfig::NSTEPF].push_back(btitrig);
  } else {
    if(config()->debug()>3){    
      cout << "DTBtiChip::addTrig: step " << step ;
      cout << " outside range. Trigger not added" << endl;
    }
  } 
}
void DTBtiChip::clear ( void  )

delete hits and triggers

Definition at line 522 of file DTBtiChip.cc.

References _digis, _digis_clock, _hits, _trigs, begin, trackerHits::c, config(), gather_cfg::cout, debug, DTConfig::NSTEPF, DTConfig::NSTEPL, AlCaHLTBitMon_ParallelJobs::p, and p1.

Referenced by ~DTBtiChip().

                 {

  if(config()->debug()>3)
    cout << "DTBtiChip::clear()" << endl;

  for(int c=0;c<9;c++) {

    _digis[c].clear();
    _digis_clock[c].clear();

    vector<DTBtiHit*>::iterator p;
    for(p=_hits[c].begin();p<_hits[c].end();p++){
      delete (*p);
    }
    _hits[c].clear();
  }

  vector<DTBtiTrig*>::iterator p1;
  for(int is=0;is<DTConfig::NSTEPL-DTConfig::NSTEPF+1;is++){
    for(p1=_trigs[is].begin();p1<_trigs[is].end();p1++){
      delete (*p1);
    }
    _trigs[is].clear();
  }
}
GlobalPoint DTBtiChip::CMSPosition ( ) const [inline]

Position in CMS frame.

Definition at line 98 of file DTBtiChip.h.

References _geom, _id, and DTTrigGeom::CMSPosition().

Referenced by DTBtiChip().

{ return _geom->CMSPosition(_id); }
void DTBtiChip::computeEqs ( ) [private]

Definition at line 145 of file DTBtiChipEquations.cc.

References begin, HDQMDatabaseProducer::config, gather_cfg::cout, i, j, and findQualityFiles::size.

Referenced by run().

                     {
  //
  // Compute all K and X equations of DTBtiChip algorithm
  // NB now Keq=Kman

  float K0 = config()->ST();
  //cout <<"K0="<<K0<<endl;

  //enabled patterns....
  int PTMS[32];
  for(int i=0; i<32; i++){
    PTMS[i] = config()->PTMSflag(i);
  }

    int i;
  // redundant patterns added by Sara Vanini
  i=0;  //  1324A  --> 1L3L2R4L
  if(PTMS[i] ){
  _Keq[i][0] =  _difs[1]          + 2.*K0;                  //eq. AB
  _Keq[i][1] = -_sums[5]          + 2.*K0;                  //eq. BC
  _Keq[i][2] =  _sums[6];                                   //eq. CD
  _Keq[i][3] = -(_sums[0]/2.)  + 2.*K0 + 0.01;              //eq. AC
  _Keq[i][4] =  (_difs[8]/2.)  +    K0 + 0.01 ;             //eq. BD
  //_Keq[i][5] =  (_difs[2]/3.) + 4.*K0/3. + 0.51;                 //eq. AD
  _Keq[i][5] =  ST43 + 
                reSum( RE43 , int(fmod(double(_difs[2]),3.)) ) + 
                int( (double(_difs[2])/3.) );                        //eq. AD

  //patt 0 always uses Xbc, because Xad could be negative...
  //when wire B is missing,  TshiftB=0
  //when hit B is gone out of shift register, Tshift=K0+1
  float _difs_p0 = _difs[5]; 

  float TshiftB = 0;
  float TshiftC = 0;
  if(_thisStepUsedHit[3-1]==0){
    if(_hits[3-1].size()==0 )
      TshiftB = 0;
    if(_hits[3-1].size()>0 && (*(_hits[3-1].begin()))->clockTime()<=-K0 )
      TshiftB = K0+1; 
  }
  else
   TshiftB = _thisStepUsedHit[3-1]->jtrig();  

  if(_thisStepUsedHit[2-1]==0){
    if(_hits[2-1].size()==0 )
      TshiftC = 0;
    if(_hits[2-1].size()>0 && (*(_hits[2-1].begin()))->clockTime()<=-K0 )
      TshiftC = K0+1; 
  }
  else
    TshiftC = _thisStepUsedHit[2-1]->jtrig();  

  _difs_p0 = (float)(TshiftB - TshiftC);

// Zotto's
  _XeqAB_patt0 = (_sums[1] - K0) / 4.;                       //eq. AB
  _Xeq[i][0]   = (_difs_p0 + K0) / 4.;                       //eq. BC
  _XeqCD_patt0 = (_difs[6] + K0) / 4.;                        //eq. CD
  _XeqAC_patt0 = -(_difs[0])   / 4.;                         //eq. AC
  _XeqBD_patt0 =  (_sums[8])   / 4.;                         //eq. BD
  _Xeq[i][1] = (_sums[2] - K0) / 4.;                         //eq. AD
  
/*
// my eq
  _XeqAB_patt0 = (_sums[1] - K0) / 4.;                       //eq. AB
  _Xeq[i][0]   = (_difs[5] + K0) / 4.;                       //eq. BC
  _XeqCD_patt0 = (_difs[6] + K0) / 4.;                        //eq. CD
  _XeqAC_patt0 = -(_difs[0])   / 4.;                         //eq. AC
  _XeqBD_patt0 =  (_sums[8])   / 4.;                         //eq. BD
  _Xeq[i][1] = (_sums[2] - K0) / 4.;                         //eq. AD
*/
   
  }
 

  i=1;  //  1324B  --> 1L3L2R4R
  if(PTMS[i] ){
  _Keq[i][0] =  _difs[1]        + 2.*K0;
  _Keq[i][1] = -(_sums[5])  + 2.*K0;
  _Keq[i][2] = -_difs[6]        + 2.*K0;
  _Keq[i][3] = -(_sums[0]/2.) + 2.*K0 + 0.01;
  _Keq[i][4] = -(_sums[8]/2.) + 2.*K0 + 0.01;
  //_Keq[i][5] = -(_sums[2]/3.)     + 2.*K0 + 0.51;
  _Keq[i][5] = ST2 +
               reSum23( 0 , int(fmod(double(-_sums[2]),3.)) ) +
               int( (double(-_sums[2])/3.) );   

  _Xeq[i][0] = ( _difs[5] + K0) / 4.;
  _Xeq[i][1] = (-_difs[2] + K0) / 4.;
  }
 
  i=2;  //  1324C  --> 1R3L2R4L
  if(PTMS[i] ){
  _Keq[i][0] =  _sums[1];
  _Keq[i][1] = -_sums[5]       + 2.*K0;
  _Keq[i][2] =  _sums[6];
  _Keq[i][3] = -(_difs[0]/2.) +   K0 + 0.01;
  _Keq[i][4] =  (_difs[8]/2.) +   K0 + 0.01;
  //_Keq[i][5] =  (_sums[2]/3.)    + 2.*K0/3. + 0.51;
  _Keq[i][5] =  ST23 + 
                reSum23( RE23 , int(fmod(double(_sums[2]),3.)) ) + 
                int( (double(_sums[2])/3.) );                        //eq. AD
/*  
cout << "ST23 =" << ST23 << endl;
cout << "RE23 =" << RE23 << endl;
cout << "fmod(double(_sums[2]),3.) =" << fmod(double(_sums[2]),3.) << endl;
cout << "reSum23 = "<< reSum23( RE23 , fmod(double(_sums[2]),3.) ) << endl;
cout << "double(_sums[2])/3.="<<double(_sums[2])/3.<< endl;
cout << "int('') = " << int( (double(_sums[2])/3.) ) << endl;
*/
  _Xeq[i][0] = (_difs[5] + K0) / 4.;
  _Xeq[i][1] = (_difs[2] + K0) / 4.;
  }
 
  i=3;  //  1324D  --> 1R3L2R4R
  if(PTMS[i] ){
  _Keq[i][0] =  _sums[1];
  _Keq[i][1] = -_sums[5]      + 2.*K0;
  _Keq[i][2] = -_difs[6]      + 2.*K0;
  _Keq[i][3] = -(_difs[0]/2.) +    K0 + 0.01;
  _Keq[i][4] = -(_sums[8]/2.) + 2.*K0 + 0.01;
  //_Keq[i][5] = -(_difs[2]/3.) + 4.*K0/3.;
  _Keq[i][5] =  ST43 + 
                reSum( RE43 , int(fmod(double(-_difs[2]),3.)) ) + 
                int( (double(-_difs[2])/3.) );                        //eq. AD


  _Xeq[i][0] = ( _difs[5] +   K0) / 4.;
  _Xeq[i][1] = (-_sums[2] + 3.*K0) / 4.;
  }
 

  i=4;  //  i = DTBtiChipEQMAP->index("1364A");  --> 1L3L6L4R
  if(PTMS[i] ){
  _Keq[i][0] =  _difs[1]        + 2.*K0;
  _Keq[i][1] =  _difs[10]       + 2.*K0;
  _Keq[i][2] = -(_sums[13]) + 2.*K0;
  _Keq[i][3] =  (_difs[3]/2.)   + 2.*K0 + 0.01;
  _Keq[i][4] = -(_sums[8]/2.)   + 2.*K0 + 0.01;
  //_Keq[i][5] = -(_sums[2]/3.)   + 2.*K0 + 0.51;
  _Keq[i][5] = ST2 +
               reSum23( 0 , int(fmod(double(-_sums[2]),3.)) ) +
               int( (double(-_sums[2])/3.) );   

  _Xeq[i][0] = ( _sums[10] + K0) / 4.;
  _Xeq[i][1] = (-_difs[2]  + K0) / 4.;
  }
 
  i=5;  //  i = DTBtiChipEQMAP->index("1364B");  --> 1R3L6L4R
  if(PTMS[i] ){
  _Keq[i][0] =  _sums[1];
  _Keq[i][1] =  _difs[10]      + 2.*K0;
  _Keq[i][2] = -_sums[13]      + 2.*K0;
  _Keq[i][3] =  (_sums[3]/2.)  +   K0 + 0.01;
  _Keq[i][4] = -(_sums[8]/2.)  + 2.*K0 + 0.01;
  //_Keq[i][5] = -(_difs[2]/3.)  + 4.*K0/3.;
  _Keq[i][5] =  ST43 + 
                reSum( RE43 , int(fmod(double(-_difs[2]),3.)) ) + 
                int( (double(-_difs[2])/3.) );                        //eq. AD

  _Xeq[i][0] = ( _sums[10]+   K0) / 4.;
  _Xeq[i][1] = (-_sums[2] + 3.*K0) / 4.;
  }

  i=6;  //  i = DTBtiChipEQMAP->index("1364C");  --> 1R3R6L4R
  if(PTMS[i] ){
  _Keq[i][0] = -_difs[1]       + 2.*K0;
  _Keq[i][1] =  _sums[10];
  _Keq[i][2] = -_sums[13]      + 2.*K0;
  _Keq[i][3] =  (_sums[3]/2.)  +    K0 + 0.01;
  _Keq[i][4] = -(_difs[8]/2.)  +    K0 + 0.01;
  //_Keq[i][5] = -(_difs[2]/3.)  + 4.*K0/3.;
  _Keq[i][5] =  ST43 + 
                reSum( RE43 , int(fmod(double(-_difs[2]),3.)) ) + 
                int( (double(-_difs[2])/3.) );                        //eq. AD

  _Xeq[i][0] = ( _difs[10]+ 3.*K0) / 4.;
  _Xeq[i][1] = (-_sums[2] + 3.*K0) / 4.;
  }
 
  i=7;  //  i = DTBtiChipEQMAP->index("1368A");  --> 1R3R6L8L
  if(PTMS[i] ){
  _Keq[i][0] = -_difs[1]        + 2.*K0;
  _Keq[i][1] =  (_sums[10]);
  _Keq[i][2] =  _difs[20]       + 2.*K0;
  _Keq[i][3] =  (_sums[3]/2.)   +    K0 + 0.01;
  _Keq[i][4] =  (_sums[11]/2.)  +    K0 + 0.01;
  //_Keq[i][5] =  (_sums[4]/3.)   + 4.*K0/3. + 0.51;
  _Keq[i][5] =  ST43 + 
                reSum( RE43 , int(fmod(double(_sums[4]),3.)) ) + 
                int( (double(_sums[4])/3.) );                        //eq. AD

  _Xeq[i][0] =  (_difs[10]+ 3.*K0) / 4.;
  _Xeq[i][1] =  (_difs[4] + 3.*K0) / 4.;
  }
 
  i=8;  //  i = DTBtiChipEQMAP->index("1368B");  --> 1R3R6R8L
  if(PTMS[i] ){
  _Keq[i][0] = -_difs[1]          + 2.*K0;
  _Keq[i][1] = -_difs[10]         + 2.*K0;
  _Keq[i][2] =  (_sums[20]);
  _Keq[i][3] = -(_difs[3]/2.)     + 2.*K0 + 0.01;
  _Keq[i][4] =  (_sums[11]/2.)    +    K0 + 0.01;
  //_Keq[i][5] =  (_sums[4]/3.)     + 4.*K0/3.;
  _Keq[i][5] =  ST43 + 
                reSum( RE43 , int(fmod(double(_sums[4]),3.)) ) + 
                int( (double(_sums[4])/3.) );                        //eq. AD


  _Xeq[i][0] = (-_sums[10]+ 5.*K0) / 4.;
  _Xeq[i][1] = ( _difs[4] + 3.*K0) / 4.;
  }

  i=9;  //  i = DTBtiChipEQMAP->index("1368C");  --> 1R3L6L8L
  if(PTMS[i] ){
  _Keq[i][0] =  (_sums[1]);
  _Keq[i][1] =  _difs[10]        + 2.*K0;
  _Keq[i][2] =  _difs[20]        + 2.*K0;
  _Keq[i][3] =  (_sums[3]/2.)    +    K0 + 0.01;
  _Keq[i][4] =  (_difs[11]/2.)   + 2.*K0 + 0.01;
  //_Keq[i][5] =  (_sums[4]/3.)    + 4.*K0/3.;
  _Keq[i][5] =  ST43 + 
                reSum( RE43 , int(fmod(double(_sums[4]),3.)) ) + 
                int( (double(_sums[4])/3.) );                        //eq. AD


  _Xeq[i][0] =  (_sums[10]+  K0) / 4.;
  _Xeq[i][1] =  (_difs[4] + 3.*K0) / 4.;
  }
  
  i=10;  //  i = DTBtiChipEQMAP->index("5324A");  --> 5L3L2R4L
  if(PTMS[i] ){
  _Keq[i][0] = -_difs[9];
  _Keq[i][1] = -_sums[5]       + 2.*K0;
  _Keq[i][2] =  _sums[6];
  _Keq[i][3] = -(_sums[7]/2.)  +    K0 + 0.01;
  _Keq[i][4] =  (_difs[8]/2.)  +    K0 + 0.01;
  //_Keq[i][5] = -(_difs[12]/3.) + 2.*K0/3.;
  _Keq[i][5] =  ST23 + 
                reSum23( RE23 , int(fmod(double(-_difs[12]),3.)) ) + 
                int( (double(-_difs[12])/3.) );                        //eq. AD

  _Xeq[i][0] =  (_difs[5] + K0) / 4.;
  _Xeq[i][1] =  (_sums[12]+ K0) / 4.;
  }

  i=11;  //  i = DTBtiChipEQMAP->index("5324B");  --> 5L3R2R4L
  if(PTMS[i] ){
  _Keq[i][0] = -_sums[9]       + 2.*K0;
  _Keq[i][1] =  _difs[5];
  _Keq[i][2] =  _sums[6];
  _Keq[i][3] = -(_sums[7]/2.)  +    K0 + 0.01;
  _Keq[i][4] =  (_sums[8]/2.   + 0.01);
  //_Keq[i][5] = -(_difs[12]/3.) + 2.*K0/3.;
  _Keq[i][5] =  ST23 + 
                reSum23( RE23 , int(fmod(double(-_difs[12]),3.)) ) + 
                int( (double(-_difs[12])/3.) );                        //eq. AD

  _Xeq[i][0] = (-_sums[5] + 3.*K0) / 4.;
  _Xeq[i][1] = ( _sums[12]+   K0) / 4.;
  }

  i=12;  //  i = DTBtiChipEQMAP->index("5324C");  --> 5R3R2R4L
  if(PTMS[i] ){
  _Keq[i][0] =  _difs[9];
  _Keq[i][1] =  _difs[5];
  _Keq[i][2] =  (_sums[6]);
  _Keq[i][3] =  (_difs[7]/2.) + 0.01;
  _Keq[i][4] =  (_sums[8]/2.)  + 0.01;
  _Keq[i][5] =  (_sums[12]/3.) + 0.51;

  _Xeq[i][0] = (-_sums[5] + 3. * K0) / 4.;
  _Xeq[i][1] = (-_difs[12]+ 3. * K0) / 4.;
  }

  i=13;  //  i = DTBtiChipEQMAP->index("5364A");  --> 5L3R6L4L
  if(PTMS[i] ){
  _Keq[i][0] = -_sums[9]        + 2.*K0;
  _Keq[i][1] =  _sums[10];
  _Keq[i][2] = -_difs[13];
  _Keq[i][3] =  (_difs[16]/2.)  +    K0 + 0.01;
  _Keq[i][4] =  (_sums[8]/2.    + 0.01);
  //_Keq[i][5] = -(_difs[12]/3.)  +  2.*K0/3.;
  _Keq[i][5] =  ST23 + 
                reSum23( RE23 , int(fmod(double(-_difs[12]),3.)) ) + 
                int( (double(-_difs[12])/3.) );                        //eq. AD

  _Xeq[i][0] =  (_difs[10]+ 3.*K0) / 4.;
  _Xeq[i][1] =  (_sums[12]+   K0) / 4.;
  }
 
  i=14;  //  i = DTBtiChipEQMAP->index("5364B");  --> 5L3R6L4R
  if(PTMS[i] ){
  _Keq[i][0] = -_sums[9]        + 2.*K0;
  _Keq[i][1] =  _sums[10];
  _Keq[i][2] = -_sums[13]       + 2.*K0;
  _Keq[i][3] =  (_difs[16]/2.)  +    K0 + 0.01;
  _Keq[i][4] = -(_difs[8]/2.)   +    K0 + 0.01;
  //_Keq[i][5] = -(_sums[12]/3.)  + 4.*K0/3.;
  _Keq[i][5] =  ST43 + 
                reSum( RE43 , int(fmod(double(-_sums[12]),3.)) ) + 
                int( (double(-_sums[12])/3.) ); 

  _Xeq[i][0] =  (_difs[10]+ 3.*K0) / 4.;
  _Xeq[i][1] =  (_difs[12]+ 3.*K0) / 4.;
  }
 
  i=15;  //  i = DTBtiChipEQMAP->index("5364C");  --> 5R3R6L4L
  if(PTMS[i] ){
  _Keq[i][0] =  _difs[9];
  _Keq[i][1] =  (_sums[10]);
  _Keq[i][2] = -_difs[13];
  _Keq[i][3] =  (_sums[16]/2.  + 0.01);
  _Keq[i][4] =  (_sums[8]/2.   + 0.01);
  _Keq[i][5] =  (_sums[12]/3.) + 0.51;

  _Xeq[i][0] = ( _difs[10]+ 3.*K0) / 4.;
  _Xeq[i][1] = (-_difs[12]+ 3.*K0) / 4.;
  }
 
  i=16;  //  i = DTBtiChipEQMAP->index("5364D");  --> 5R3R6L4R
  if(PTMS[i] ){
  _Keq[i][0] =  _difs[9];
  _Keq[i][1] =  _sums[10];
  _Keq[i][2] = -_sums[13]      + 2.*K0;
  _Keq[i][3] =  (_sums[16]/2.  + 0.01);
  _Keq[i][4] = -(_difs[8]/2.)  +    K0 + 0.01;
  //_Keq[i][5] =  (_difs[12]/3.) + 2.*K0/3.;
  _Keq[i][5] =  ST23 + 
                reSum23( RE23 , int(fmod(double(_difs[12]),3.)) ) + 
                int( (double(_difs[12])/3.) );                        //eq. AD

  _Xeq[i][0] = ( _difs[10]+ 3.*K0) / 4.;
  _Xeq[i][1] = (-_sums[12]+ 5.*K0) / 4.;
  }
 
  i=17;  //  i = DTBtiChipEQMAP->index("5368A");  --> 5L3R6L8L
  if(PTMS[i] ){
  _Keq[i][0] = -_sums[9]        + 2.*K0;
  _Keq[i][1] =  _sums[10];
  _Keq[i][2] =  _difs[20]       + 2.*K0;
  _Keq[i][3] =  (_difs[16]/2.)  +    K0 + 0.01;
  _Keq[i][4] =  (_sums[11]/2.)  +    K0 + 0.01;
  //_Keq[i][5] =  (_difs[18]/3.)  + 4.*K0/3.;
  _Keq[i][5] =  ST43 + 
                reSum( RE43 , int(fmod(double(_difs[18]),3.)) ) + 
                int( (double(_difs[18])/3.) );                        //eq. AD

  _Xeq[i][0] =  (_difs[10]+ 3.*K0) / 4.;
  _Xeq[i][1] =  (_sums[18]+ 3.*K0) / 4.;
  }
 
  i=18;  //  i = DTBtiChipEQMAP->index("5368B");  --> 5L3R6R8L
  if(PTMS[i] ){
  _Keq[i][0] = -_sums[9]        + 2.*K0;
  _Keq[i][1] = -_difs[10]       + 2.*K0;
  _Keq[i][2] =  _sums[20];
  _Keq[i][3] = -(_sums[16]/2.)  + 2.*K0 + 0.01;
  _Keq[i][4] =  (_sums[11]/2.)  +    K0 + 0.01;
  //_Keq[i][5] =  (_difs[18]/3.)  + 4.*K0/3.;
  _Keq[i][5] =  ST43 + 
                reSum( RE43 , int(fmod(double(_difs[18]),3.)) ) + 
                int( (double(_difs[18])/3.) );                        //eq. AD

  _Xeq[i][0] = (-_sums[10]+ 5.*K0) / 4.;
  _Xeq[i][1] = ( _sums[18]+ 3.*K0) / 4.;
  }
 
  i=19;  //  i = DTBtiChipEQMAP->index("5368C");  --> 5L3R6R8R
  if(PTMS[i] ){
  _Keq[i][0] = -(_sums[9])  + 2.*K0;
  _Keq[i][1] = -_difs[10]       + 2.*K0;
  _Keq[i][2] = -_difs[20]       + 2.*K0;
  _Keq[i][3] = -(_sums[16]/2.)  + 2.*K0 + 0.01;
  _Keq[i][4] = -(_difs[11]/2.)  + 2.*K0 + 0.01;
  //_Keq[i][5] = -(_sums[18]/3.)  + 2.*K0 + 0.51;
  _Keq[i][5] = ST2 +
               reSum23( 0 , int(fmod(double(-_sums[18]),3.)) ) +
               int( (double(-_sums[18])/3.) );   

  _Xeq[i][0] = (-_sums[10]+ 5.*K0) / 4.;
  _Xeq[i][1] = (-_difs[18]+ 5.*K0) / 4.;
  }
 
  i=20;  //  i = DTBtiChipEQMAP->index("5764A");  --> 5R7L6L4R
  if(PTMS[i] ){
  _Keq[i][0] =  _sums[17];
  _Keq[i][1] = -_difs[19];
  _Keq[i][2] = -_sums[13]       + 2.*K0;
  _Keq[i][3] =  (_sums[16]/2.   + 0.01);
  _Keq[i][4] = -(_sums[14]/2.)  +    K0 + 0.01;
  //_Keq[i][5] =  (_difs[12]/3.)  + 2.*K0/3.;
  _Keq[i][5] =  ST23 + 
                reSum23( RE23 , int(fmod(double(_difs[12]),3.)) ) + 
                int( (double(_difs[12])/3.) );                        //eq. AD

  _Xeq[i][0] = ( _sums[19]+ 3.*K0) / 4.;
  _Xeq[i][1] = (-_sums[12]+ 5.*K0) / 4.;
  }
 
  i=21;  //  i = DTBtiChipEQMAP->index("5764B");  --> 5R7L6R4R
  if(PTMS[i] ){
  _Keq[i][0] =  _sums[17];
  _Keq[i][1] = -_sums[19]      + 2.*K0;
  _Keq[i][2] =  _difs[13];
  _Keq[i][3] = -(_difs[16]/2.) +    K0 + 0.01;
  _Keq[i][4] = -(_sums[14]/2.) +    K0 + 0.01;
  //_Keq[i][5] =  (_difs[12]/3.) + 2.*K0/3.;
  _Keq[i][5] =  ST23 + 
                reSum23( RE23 , int(fmod(double(_difs[12]),3.)) ) + 
                int( (double(_difs[12])/3.) );                        //eq. AD

  _Xeq[i][0] = ( _difs[19]+ 5.*K0) / 4.;
  _Xeq[i][1] = (-_sums[12]+ 5.*K0) / 4.;
  }
 
  i=22;  //  i = DTBtiChipEQMAP->index("5764C");  --> 5R7L6L4L
  if(PTMS[i] ){
  _Keq[i][0] =  (_sums[17]);
  _Keq[i][1] = -_difs[19];
  _Keq[i][2] = -_difs[13];
  _Keq[i][3] =  (_sums[16]/2.  + 0.01);
  _Keq[i][4] = -(_difs[14]/2.) + 0.01;
  _Keq[i][5] =  (_sums[12]/3.) + 0.51;

  _Xeq[i][0] = ( _sums[19]+ 3.*K0) / 4.;
  _Xeq[i][1] = (-_difs[12]+ 3.*K0) / 4.;
  }
 
  i=23;  //  i = DTBtiChipEQMAP->index("9764A");  --> 9L7L6L4R
  if(PTMS[i] ){
  _Keq[i][0] = -_difs[23];
  _Keq[i][1] = -_difs[19];
  _Keq[i][2] = -(_sums[13]) + 2.*K0;
  _Keq[i][3] = -(_difs[21]/2.) + 0.01;
  _Keq[i][4] = -(_sums[14]/2.)  +    K0 + 0.01;
  //_Keq[i][5] = -(_sums[15]/3.)  + 2.*K0/3.;
  _Keq[i][5] =  ST23 + 
                reSum23( RE23 , int(fmod(double(-_sums[15]),3.)) ) + 
                int( (double(-_sums[15])/3.) );                        //eq. AD

  _Xeq[i][0] =  (_sums[19]+ 3.*K0) / 4.;
  _Xeq[i][1] =  (_difs[15]+ 5.*K0) / 4.;
  }
 
  i=24;  //  i = DTBtiChipEQMAP->index("9764B");  --> 9L7L6R4R
  if(PTMS[i] ){
  _Keq[i][0] = -_difs[23];
  _Keq[i][1] = -(_sums[19])   + 2.*K0;
  _Keq[i][2] =  _difs[13];
  _Keq[i][3] = -(_sums[21]/2.)    +    K0 + 0.01;
  _Keq[i][4] = -(_sums[14]/2.)    +    K0 + 0.01;
  //_Keq[i][5] = -(_sums[15]/3.)    + 2.*K0/3.;
  _Keq[i][5] =  ST23 + 
                reSum23( RE23 , int(fmod(double(-_sums[15]),3.)) ) + 
                int( (double(-_sums[15])/3.) );                        //eq. AD

  _Xeq[i][0] =  (_difs[19]+ 5.*K0) / 4.;
  _Xeq[i][1] =  (_difs[15]+ 5.*K0) / 4.;
  }
 
  i=25;  //  i = DTBtiChipEQMAP->index("9764C");  --> 9L7R6R4R
  if(PTMS[i] ){
  _Keq[i][0] = -(_sums[23])   + 2.*K0;
  _Keq[i][1] =  _difs[19];
  _Keq[i][2] =  _difs[13];
  _Keq[i][3] = -(_sums[21]/2.)    +   K0 + 0.01;
  _Keq[i][4] =  (_difs[14]/2.) + 0.01;
  //_Keq[i][5] = -(_sums[15]/3.)    + 2.*K0/3.;
  _Keq[i][5] =  ST23 + 
                reSum23( RE23 , int(fmod(double(-_sums[15]),3.)) ) + 
                int( (double(-_sums[15])/3.) );                        //eq. AD

  _Xeq[i][0] = (-_sums[19]+ 7.*K0) / 4.;
  _Xeq[i][1] = ( _difs[15]+ 5.*K0) / 4.;
  }

  i=26;  //  int i = DTBtiChipEQMAP->index("5768A") --> 5L7L6R8L
  if(PTMS[i] ){
  _Keq[i][0] =  _difs[17]       + 2.*K0;
  _Keq[i][1] = -_sums[19]       + 2.*K0;
  _Keq[i][2] =  _sums[20];
  _Keq[i][3] = -(_sums[16]/2.)  + 2.*K0 + 0.01;
  _Keq[i][4] =  (_difs[22]/2.)  +    K0 + 0.01;
  //_Keq[i][5] =  (_difs[18]/3.)  + 4.*K0/3.;
  _Keq[i][5] =  ST43 + 
                reSum( RE43 , int(fmod(double(_difs[18]),3.)) ) + 
                int( (double(_difs[18])/3.) );                        //eq. AD

  _Xeq[i][0] =  (_difs[19] + 5.*K0) / 4.;
  _Xeq[i][1] =  (_sums[18] + 3.*K0) / 4.;
  }
 
  i=27;  //  i = DTBtiChipEQMAP->index("5768B");  --> 5L7L6R8R
  if(PTMS[i] ){
  _Keq[i][0] =  _difs[17]       + 2.*K0;
  _Keq[i][1] = -(_sums[19]) + 2.*K0;
  _Keq[i][2] = -_difs[20]       + 2.*K0;
  _Keq[i][3] = -(_sums[16]/2.)  + 2.*K0 + 0.01;
  _Keq[i][4] = -(_sums[22]/2.)  + 2.*K0 + 0.01;
  //_Keq[i][5] = -(_sums[18]/3.)  + 2.*K0 + 0.51;
  _Keq[i][5] = ST2 +
               reSum23( 0 , int(fmod(double(-_sums[18]),3.)) ) +
               int( (double(-_sums[18])/3.) );   
  
  _Xeq[i][0] = ( _difs[19] + 5.*K0) / 4.;
  _Xeq[i][1] = (-_difs[18] + 5.*K0) / 4.;
  }
 
  i=28;  //  i = DTBtiChipEQMAP->index("5768C");  --> 5R7L6R8L
  if(PTMS[i] ){
  _Keq[i][0] =  _sums[17];
  _Keq[i][1] = -_sums[19]       + 2.*K0;
  _Keq[i][2] =  _sums[20];
  _Keq[i][3] = -(_difs[16]/2.)  +   K0 + 0.01;
  _Keq[i][4] =  (_difs[22]/2.)  +   K0 + 0.01;
  //_Keq[i][5] =  (_sums[18]/3.)  + 2.*K0/3.;
  _Keq[i][5] =  ST23 + 
                reSum23( RE23 , int(fmod(double(_sums[18]),3.)) ) + 
                int( (double(_sums[18])/3.) );                        //eq. AD

  _Xeq[i][0] =  (_difs[19] + 5.*K0) / 4.;
  _Xeq[i][1] =  (_difs[18] + 5.*K0) / 4.;
  }

  i=29;  //  i = DTBtiChipEQMAP->index("5768D");  --> 5R7L6R8R
  if(PTMS[i] ){
  _Keq[i][0] =  _sums[17];
  _Keq[i][1] = -_sums[19]       + 2.*K0;
  _Keq[i][2] = -_difs[20]       + 2.*K0;
  _Keq[i][3] = -(_difs[16]/2.)  +    K0 + 0.01;
  _Keq[i][4] = -(_sums[22]/2.)  + 2.*K0 + 0.01;
  //_Keq[i][5] = -(_difs[18]/3.)  + 4.*K0/3. ;
  _Keq[i][5] =  ST43 + 
                reSum( RE43 , int(fmod(double(-_difs[18]),3.)) ) + 
                int( (double(-_difs[18])/3.) );                        //eq. AD

  _Xeq[i][0] = ( _difs[19] + 5.*K0) / 4.;
  _Xeq[i][1] = (-_sums[18] + 7.*K0) / 4.;
  }

  i=30;  //  9768A  --> 9L7L6R8L
  if(PTMS[i] ){
  _Keq[i][0] = -_difs[23];
  _Keq[i][1] = -_sums[19]       + 2.*K0;
  _Keq[i][2] =  _sums[20];
  _Keq[i][3] = -(_sums[21]/2.)  +    K0 + 0.01;
  _Keq[i][4] =  (_difs[22]/2.)  +    K0 + 0.01;
  //_Keq[i][5] = -(_difs[24]/3.)  + 2.*K0/3. ;
  _Keq[i][5] =  ST23 + 
                reSum23( RE23 , int(fmod(double(-_difs[24]),3.)) ) + 
                int( (double(-_difs[24])/3.) );                        //eq. AD

  _Xeq[i][0] = (_difs[19] + 5.*K0) / 4.;
  _Xeq[i][1] = (_sums[24] + 5.*K0) / 4.;
  }
 
  i=31;  //  9768B  --> 9L7R6R8L
  if(PTMS[i] ){
  _Keq[i][0] = -_sums[23]       + 2.*K0;
  _Keq[i][1] =  _difs[19];
  _Keq[i][2] =  _sums[20];
  _Keq[i][3] = -(_sums[21]/2.)  +   K0 + 0.01;
  _Keq[i][4] =  (_sums[22]/2.) + 0.01;
  //_Keq[i][5] = -(_difs[24]/3.)  + 2.*K0/3.;
  _Keq[i][5] =  ST23 + 
                reSum23( RE23 , int(fmod(double(-_difs[24]),3.)) ) + 
                int( (double(-_difs[24])/3.) );                        //eq. AD

  _Xeq[i][0] = (-_sums[19] + 7.*K0) / 4.;
  _Xeq[i][1] = ( _sums[24] + 5.*K0) / 4.;
  }
 
  // debugging
  if(config()->debug()>3){
    cout << endl << " Step: " << currentStep() << endl;
    for(i=0;i<32;i++){
      if(PTMS[i] ){
        cout << "K Equation " << i << " --> ";
        int j=0;
        for(j=0;j<6;j++){
          cout << _Keq[i][j] << " ";
        }
        cout << endl;
        cout << "X Equation " << i << " --> ";
        for(j=0;j<2;j++){
          cout << _Xeq[i][j] << " ";
        }
        if( i==0 ){
          cout << _XeqAB_patt0 << " " << _XeqCD_patt0 << " ";
          cout << _XeqAC_patt0 << " " << _XeqBD_patt0 << " ";
        }
        cout << endl;
      }
    }
  }
  // end debugging
  
}
void DTBtiChip::computeSums ( ) [private]

Definition at line 39 of file DTBtiChipEquations.cc.

References HDQMDatabaseProducer::config, gather_cfg::cout, and debug.

Referenced by run().

                      {
  //
  // compute all sums and diffs
  // nothing more than a table...
  // numbering convention here is the same as the fortran version:
  //   sum number in the range [1,25]
  //   cell numbers in the range [1,9]
  //     --> sum(int,int,int) decreases the indices by 1
  // sum (sum_number, first_cell, second_cell)
  //
  
  if(config()->debug()>3){
    cout << "DTBtiChip::computeSums called" << endl; 
  }

  sum( 1,2,1);
  sum( 2,3,1);
  sum( 3,4,1);
  sum( 4,6,1);
  sum( 5,8,1);
  sum( 6,3,2);
  sum( 7,4,2);
  sum( 8,5,2);
  sum( 9,4,3);
  sum(10,5,3);
  sum(11,6,3);
  sum(12,8,3);
  sum(13,5,4);
  sum(14,6,4);
  sum(15,7,4);
  sum(16,9,4);
  sum(17,6,5);
  sum(18,7,5);
  sum(19,8,5);
  sum(20,7,6);
  sum(21,8,6);
  sum(22,9,6);
  sum(23,8,7);
  sum(24,9,7);
  sum(25,9,8);
}
DTConfigBti* DTBtiChip::config ( void  ) const [inline]

Configuration set.

testing DTConfigBti

Definition at line 119 of file DTBtiChip.h.

References _config.

Referenced by add_digi(), add_digi_clock(), addTrig(), clear(), doLTS(), DTBtiChip(), init(), init_clock(), nCellHit(), run(), setSnap(), store(), and tick().

{ return _config; }
int DTBtiChip::currentIntStep ( ) const [inline, private]

Definition at line 147 of file DTBtiChip.h.

References _curStep.

Referenced by run(), and tick().

{ return _curStep; } // int. step (80MHz)
int DTBtiChip::currentStep ( ) const [inline, private]

Definition at line 146 of file DTBtiChip.h.

References _curStep.

Referenced by run(), and store().

{ return (int)(((float)(_curStep)+0.5)/2); }
void DTBtiChip::doLTS ( ) [private]

Definition at line 741 of file DTBtiChip.cc.

References DTBtiTrig::code(), config(), gather_cfg::cout, debug, DTConfigBti::debug(), eraseTrigger(), DTConfigBti::LTS(), DTConfig::NSTEPF, DTConfig::NSTEPL, nTrig(), DTConfigBti::SET(), and trigger().

Referenced by run().

                 {
 
  if(config()->debug()>2)
    cout<<"Do LTS"<<endl;
  int lts = config()->LTS();
  int nbxlts = config()->SET();

  // Do LTS only on the requested SL
  //if (superlayer()==2 && lts==1) return;
  //if (superlayer()!=2 && lts==2) return;
  //new DTConfig: do LTS only is LTS!=0  --> somewhat redundant !
  if (lts==0) return;

  // loop on steps
  for(int is=DTConfig::NSTEPF; is<=DTConfig::NSTEPL; is++) {
    if(nTrig(is)>0) { // non empty step
      if( trigger(is,1)->code()==8 ) { // HTRIG at this step
        // do LTS on nbxLTS[superlayer] following steps
        for(int js=is+1;(js<=is+nbxlts&&js<=DTConfig::NSTEPL);js++){
          if(nTrig(js)>0) { // non empty step
            DTBtiTrig* tr = trigger(js,1);
            if( tr->code()<8 && (lts==1 || lts==3)) {
              if(config()->debug()>3)
                cout<<"LTS: erasing trigger!"<<endl; 
              eraseTrigger(js,1); // delete trigger
            }
          }
        }
        // do LTS on previous step
        if(is>DTConfig::NSTEPF && nTrig(is-1)>0) { // non empty step
          DTBtiTrig* tr = trigger(is-1,1);
          if( tr->code()<8 && (lts==2 || lts==3) ) {
            if(config()->debug()>3)
                cout<<"LTS: erasing trigger!"<<endl;                                
            eraseTrigger(is-1,1); // delete trigger
          }
        }

      }
    }
  }
}
void DTBtiChip::eraseTrigger ( int  step,
unsigned  n 
) [private]

Definition at line 507 of file DTBtiChip.cc.

References _trigs, gather_cfg::cout, n, DTConfig::NSTEPF, DTConfig::NSTEPL, AlCaHLTBitMon_ParallelJobs::p, findQualityFiles::size, and launcher::step.

Referenced by doLTS().

                                            {
  if(step<DTConfig::NSTEPF||step>DTConfig::NSTEPL){
    cout << "DTBtiChip::eraseTrigger: step out of range: " << step ;
    cout << " trigger not deleted!" << endl;
  } 
  if(n<1 || n>_trigs[step-DTConfig::NSTEPF].size()) {
    cout << "DTBtiChip::trigger: requested trigger does not exist: " << n;
    cout << " trigger not deleted!" << endl;
  }
  vector<DTBtiTrig*>::iterator p = _trigs[step-DTConfig::NSTEPF].begin()+n-1;
  if(&(*p))delete (*p);
  _trigs[step-DTConfig::NSTEPF].erase(p);
}
void DTBtiChip::findTrig ( ) [private]

Definition at line 40 of file DTBtiChipSelTrig.cc.

References HDQMDatabaseProducer::config, gather_cfg::cout, debug, and i.

Referenced by run().

                   {

  if(config()->debug()>3){
    cout << "DTBtiChip::findTrig called" << endl; 
  }

  //pattern type:       1 = normal
  //                    2 = 1L1
  //                    3 = 11L
  //                    4 = L11
  //                    5 = 1H1
  //                    6 = 11H
  //                    7 = H11

//  int accpatB = config()->AccPattB(); //default +-1
//  int accpatA = config()->AccPattA(); //default +-2
//  int tiKes = config()->XON();
  int RON = config()->RONflag();  //default 1, redundant patterns enabled
  int PTMS[32];
  for(int i=0; i<32; i++){
    PTMS[i] = config()->PTMSflag(i);
  }

  //Triggers (same order as manual):
  for(int hl=0;hl<2;hl++){  //hl=0 high   hl=1 low
  if( RON==1 ){
    if( keepTrigPatt(PTMS[0],0,1,hl) ) return;   // 1324A --> 0 - 1L3L2R4L: nor
  }
  if( keepTrigPatt(PTMS[1],1,2,hl) ) return;   // 1324B --> 1 - 1L3L2R4R: 1L1
  if( keepTrigPatt(PTMS[2],2,1,hl) ) return;   // 1324C --> 2 - 1R3L2R4L: nor
  if( keepTrigPatt(PTMS[3],3,1,hl) ) return;   // 1324D --> 3 - 1R3L2R4R: nor
  if( keepTrigPatt(PTMS[4],4,3,hl) ) return;   // 1364A -->  4 - 1L3L6L4R: 11L
  if( keepTrigPatt(PTMS[5],5,1,hl) ) return;   // 1364B -->  5 - 1R3L6L4R: nor
  if( keepTrigPatt(PTMS[6],6,1,hl) ) return;   // 1364C -->  6 - 1R3R6L4R: nor
  if( keepTrigPatt(PTMS[7],7,5,hl) ) return;   // 1368A -->  7 - 1R3R6L8L: 1H1
  if( keepTrigPatt(PTMS[8],8,6,hl) ) return;   // 1368B -->  8 - 1R3R6R8L: 11H
  if( keepTrigPatt(PTMS[9],9,7,hl) ) return;   // 1368C -->  9 - 1R3L6L8L: H11
  if( keepTrigPatt(PTMS[10],10,1,hl) ) return;   // 5324A --> 10 - 5L3L2R4L: nor
  if( keepTrigPatt(PTMS[11],11,1,hl) ) return;   // 5324B --> 11 - 5L3R2R4L: nor
  if( keepTrigPatt(PTMS[12],12,6,hl) ) return;   // 5324C --> 12 - 5R3R2R4L: 11H
  if( keepTrigPatt(PTMS[13],13,1,hl) ) return;   // 5364A --> 13 - 5L3R6L4L: nor
  if( keepTrigPatt(PTMS[14],14,1,hl) ) return;   // 5364B --> 14 - 5L3R6L4R: nor
  if( keepTrigPatt(PTMS[15],15,5,hl) ) return;   // 5364C --> 15 - 5R3R6L4L: 1H1
  if( keepTrigPatt(PTMS[16],16,1,hl) ) return;   // 5364D --> 16 - 5R3R6L4R: nor
  if( keepTrigPatt(PTMS[17],17,1,hl) ) return;   // 5368A --> 17 - 5L3R6L8L: nor
  if( keepTrigPatt(PTMS[18],18,1,hl) ) return;   // 5368B --> 18 - 5L3R6R8L: nor
  if( keepTrigPatt(PTMS[19],19,4,hl) ) return;   // 5368C --> 19 - 5L3R6R8R: L11
  if( keepTrigPatt(PTMS[20],20,1,hl) ) return;   // 5764A --> 20 - 5R7L6L4R: nor
  if( keepTrigPatt(PTMS[21],21,1,hl) ) return;   // 5764B --> 21 - 5R7L6R4R: nor
  if( keepTrigPatt(PTMS[22],22,7,hl) ) return;   // 5764C --> 22 - 5R7L6L4L: H11
  if( keepTrigPatt(PTMS[23],23,3,hl) ) return;   // 9764A --> 23 - 9L7L6L4R: 11L
  if( keepTrigPatt(PTMS[24],24,2,hl) ) return;   // 9764B --> 24 - 9L7L6R4R: 1L1
  if( keepTrigPatt(PTMS[25],25,4,hl) ) return;   // 9764C --> 25 - 9L7R6R4R: L11
  if( keepTrigPatt(PTMS[26],26,1,hl) ) return;   // 5768A -->  26 - 5L7L6R8L: nor   
  if( RON==1 ){
    if( keepTrigPatt(PTMS[27],27,2,hl) ) return;   // 5768B --> 27 - 5L7L6R8R: 1L1
    if( keepTrigPatt(PTMS[28],28,1,hl) ) return;   // 5768C --> 28 - 5R7L6R8L: nor
    if( keepTrigPatt(PTMS[29],29,1,hl) ) return;   // 5768D --> 29 - 5R7L6R8R: nor
    if( keepTrigPatt(PTMS[30],30,1,hl) ) return;   // 9768A --> 30 - 9L7L6R8L: nor
    if( keepTrigPatt(PTMS[31],31,1,hl) ) return;   // 9768B --> 31 - 9L7R6R8L: nor 
  }
 
  }//end h/l loop



/*
  for(int hl=0;hl<2;hl++){  //hl=0 high   hl=1 low
  if( keepTrigPatt(PTMS[0],0,1,hl) ) return;   // 5768A -->  0 - 5L7L6R8L: nor   
  if( RON==1 ){
    if( keepTrigPatt(PTMS[1],1,2,hl) ) return;   // 5768B -->  1 - 5L7L6R8R: 1L1
    if( keepTrigPatt(PTMS[2],2,1,hl) ) return;   // 5768C -->  2 - 5R7L6R8L: nor
    if( keepTrigPatt(PTMS[3],3,1,hl) ) return;   // 5768D -->  3 - 5R7L6R8R: nor
  }
  if( keepTrigPatt(PTMS[4],4,3,hl) ) return;   // 1364A -->  4 - 1L3L6L4R: 11L
  if( keepTrigPatt(PTMS[5],5,1,hl) ) return;   // 1364B -->  5 - 1R3L6L4R: nor
  if( keepTrigPatt(PTMS[6],6,1,hl) ) return;   // 1364C -->  6 - 1R3R6L4R: nor
  if( keepTrigPatt(PTMS[7],7,5,hl) ) return;   // 1368A -->  7 - 1R3R6L8L: 1H1
  if( keepTrigPatt(PTMS[8],8,6,hl) ) return;   // 1368B -->  8 - 1R3R6R8L: 11H
  if( keepTrigPatt(PTMS[9],9,7,hl) ) return;   // 1368C -->  9 - 1R3L6L8L: H11
  if( keepTrigPatt(PTMS[10],10,1,hl) ) return;   // 5324A --> 10 - 5L3L2R4L: nor
  if( keepTrigPatt(PTMS[11],11,1,hl) ) return;   // 5324B --> 11 - 5L3R2R4L: nor
  if( keepTrigPatt(PTMS[12],12,6,hl) ) return;   // 5324C --> 12 - 5R3R2R4L: 11H
  if( keepTrigPatt(PTMS[13],13,1,hl) ) return;   // 5364A --> 13 - 5L3R6L4L: nor
  if( keepTrigPatt(PTMS[14],14,1,hl) ) return;   // 5364B --> 14 - 5L3R6L4R: nor
  if( keepTrigPatt(PTMS[15],15,5,hl) ) return;   // 5364C --> 15 - 5R3R6L4L: 1H1
  if( keepTrigPatt(PTMS[16],16,1,hl) ) return;   // 5364D --> 16 - 5R3R6L4R: nor
  if( keepTrigPatt(PTMS[17],17,1,hl) ) return;   // 5368A --> 17 - 5L3R6L8L: nor
  if( keepTrigPatt(PTMS[18],18,1,hl) ) return;   // 5368B --> 18 - 5L3R6R8L: nor
  if( keepTrigPatt(PTMS[19],19,4,hl) ) return;   // 5368C --> 19 - 5L3R6R8R: L11
  if( keepTrigPatt(PTMS[20],20,1,hl) ) return;   // 5764A --> 20 - 5R7L6L4R: nor
  if( keepTrigPatt(PTMS[21],21,1,hl) ) return;   // 5764B --> 21 - 5R7L6R4R: nor
  if( keepTrigPatt(PTMS[22],22,7,hl) ) return;   // 5764C --> 22 - 5R7L6L4L: H11
  if( keepTrigPatt(PTMS[23],23,3,hl) ) return;   // 9764A --> 23 - 9L7L6L4R: 11L
  if( keepTrigPatt(PTMS[24],24,2,hl) ) return;   // 9764B --> 24 - 9L7L6R4R: 1L1
  if( keepTrigPatt(PTMS[25],25,4,hl) ) return;   // 9764C --> 25 - 9L7R6R4R: L11
  if( RON==1 ){
    if( keepTrigPatt(PTMS[26],26,1,hl) ) return;   // 1324A --> 26 - 1L3L2R4L: nor
  }
  if( keepTrigPatt(PTMS[27],27,2,hl) ) return;   // 1324B --> 27 - 1L3L2R4R: 1L1
  if( keepTrigPatt(PTMS[28],28,1,hl) ) return;   // 1324C --> 28 - 1R3L2R4L: nor
  if( keepTrigPatt(PTMS[29],29,1,hl) ) return;   // 1324D --> 29 - 1R3L2R4R: nor
  if( RON==1 ){
    if( keepTrigPatt(PTMS[30],30,1,hl) ) return;   // 9768A --> 30 - 9L7L6R8L: nor
  }
  if( keepTrigPatt(PTMS[31],31,1,hl) ) return;   // 9768B --> 31 - 9L7R6R8L: nor 

  }//end h/l loop

*/
  
/* 
  // High level triggers:
  if( keepTrig( 1,accpatB,8) ) return;   // 5768B -->  1 - acc. patt. B
  if( keepTrig( 2,accpatA,8) ) return;   // 5768C -->  2 - acc. patt. A
  if( keepTrig( 3,accpatA,8) ) return;   // 5768D -->  3 - acc. patt. A
  if( keepTrig( 4,accpatB,8) ) return;   // 1364A -->  4 - acc. patt. B
  if( keepTrig( 5,accpatA,8) ) return;   // 1364B -->  5 - acc. patt. A
  if( keepTrig( 6,accpatA,8) ) return;   // 1364C -->  6 - acc. patt. A
  if( keepTrig( 7,accpatB,8) ) return;   // 1368A -->  7 - acc. patt. B
  if( keepTrig( 8,accpatB,8) ) return;   // 1368B -->  8 - acc. patt. B
  if( keepTrig( 9,accpatB,8) ) return;   // 1368C -->  9 - acc. patt. B
  if( keepTrig(10,accpatA,8) ) return;   // 5324A --> 10 - acc. patt. A
  if( keepTrig(11,accpatA,8) ) return;   // 5324B --> 11 - acc. patt. A
  if( keepTrig(12,accpatB,8) ) return;   // 5324C --> 12 - acc. patt. B
  if( keepTrig(13,accpatA,8) ) return;   // 5364A --> 13 - acc. patt. A
  if( keepTrig(14,accpatA,8) ) return;   // 5364B --> 14 - acc. patt. A
  if( keepTrig(15,accpatB,8) ) return;   // 5364C --> 15 - acc. patt. B
  if( keepTrig(16,accpatA,8) ) return;   // 5364D --> 16 - acc. patt. A
  if( keepTrig(17,accpatA,8) ) return;   // 5368A --> 17 - acc. patt. A
  if( keepTrig(18,accpatA,8) ) return;   // 5368B --> 18 - acc. patt. A
  if( keepTrig(19,accpatB,8) ) return;   // 5368C --> 19 - acc. patt. B
  if( keepTrig(20,accpatA,8) ) return;   // 5764A --> 20 - acc. patt. A
  if( keepTrig(21,accpatA,8) ) return;   // 5764B --> 21 - acc. patt. A
  if( keepTrig(22,accpatB,8) ) return;   // 5764C --> 22 - acc. patt. B
  if( keepTrig(23,accpatB,8) ) return;   // 9764A --> 23 - acc. patt. B
  if( keepTrig(24,accpatB,8) ) return;   // 9764B --> 24 - acc. patt. B
  if( keepTrig(25,accpatB,8) ) return;   // 9764C --> 25 - acc. patt. B
  if( keepTrig( 0,accpatA,8) ) return;   // 5768A -->  0 - acc. patt. A
  */ 
 /* 
  // Low level triggers -B
  if( keepTrig( 1,accpatB,2) ) return;   // 5768B -->  1 - acc. patt. B
  if( keepTrig( 2,accpatA,2) ) return;   // 5768C -->  2 - acc. patt. A
  if(tiKes==1) {
    if( keepTrig( 3,accpatA,2) ) return; // 5768D -->  3 - acc. patt. A
  }
  if( keepTrig( 4,accpatB,2) ) return;   // 1364A -->  4 - acc. patt. B
  if( keepTrig( 5,accpatA,2) ) return;   // 1364B -->  5 - acc. patt. A
  if( keepTrig( 6,accpatA,2) ) return;   // 1364C -->  6 - acc. patt. A
  if( keepTrig( 7,accpatB,2) ) return;   // 1368A -->  7 - acc. patt. B
  if( keepTrig( 8,accpatB,2) ) return;   // 1368B -->  8 - acc. patt. B
  if( keepTrig( 9,accpatB,2) ) return;   // 1368C -->  9 - acc. patt. B
  if( keepTrig(10,accpatA,2) ) return;   // 5324A --> 10 - acc. patt. A
  if( keepTrig(11,accpatA,2) ) return;   // 5324B --> 11 - acc. patt. A
  if( keepTrig(12,accpatB,2) ) return;   // 5324C --> 12 - acc. patt. B
  if(tiKes==1) {
    if( keepTrig(13,accpatA,2) ) return; // 5364A --> 13 - acc. patt. A
  }
  if( keepTrig(14,accpatA,2) ) return;   // 5364B --> 14 - acc. patt. A
  if( keepTrig(15,accpatB,2) ) return;   // 5364C --> 15 - acc. patt. B
  if( keepTrig(16,accpatA,2) ) return;   // 5364D --> 16 - acc. patt. A
  if(tiKes==1) {
    if( keepTrig(17,accpatA,2) ) return; // 5368A --> 17 - acc. patt. A
  }
  if( keepTrig(18,accpatA,2) ) return;   // 5368B --> 18 - acc. patt. A
  if( keepTrig(19,accpatB,2) ) return;   // 5368C --> 19 - acc. patt. B
  if( keepTrig(20,accpatA,2) ) return;   // 5764A --> 20 - acc. patt. A
  if(tiKes==1) {
    if( keepTrig(21,accpatA,2) ) return; // 5764B --> 21 - acc. patt. A
  }
  if( keepTrig(22,accpatB,2) ) return;   // 5764C --> 22 - acc. patt. B
  if( keepTrig(23,accpatB,2) ) return;   // 9764A --> 23 - acc. patt. B
  if( keepTrig(24,accpatB,2) ) return;   // 9764B --> 24 - acc. patt. B
  if( keepTrig(25,accpatB,2) ) return;   // 9764C --> 25 - acc. patt. B
  if( keepTrig( 0,accpatA,2) ) return;   // 5768A -->  0 - acc. patt. A

  // Low level triggers -C
  if( keepTrig( 1,accpatB,3) ) return;   // 5768B -->  1 - acc. patt. B
  if( keepTrig( 2,accpatA,3) ) return;   // 5768C -->  2 - acc. patt. A
  if( keepTrig( 3,accpatA,3) ) return;   // 5768D -->  3 - acc. patt. A
  if( keepTrig( 4,accpatB,3) ) return;   // 1364A -->  4 - acc. patt. B
  if( keepTrig( 5,accpatA,3) ) return;   // 1364B -->  5 - acc. patt. A
  if(tiKes==1) {
    if( keepTrig( 6,accpatA,3) ) return; // 1364C -->  6 - acc. patt. A
  }
  if( keepTrig( 7,accpatB,3) ) return;   // 1368A -->  7 - acc. patt. B
  if( keepTrig( 8,accpatB,3) ) return;   // 1368B -->  8 - acc. patt. B
  if( keepTrig( 9,accpatB,3) ) return;   // 1368C -->  9 - acc. patt. B
  if(tiKes==1) {
    if( keepTrig(10,accpatA,3) ) return; // 5324A --> 10 - acc. patt. A
  }
  if( keepTrig(11,accpatA,3) ) return;   // 5324B --> 11 - acc. patt. A
  if( keepTrig(12,accpatB,3) ) return;   // 5324C --> 12 - acc. patt. B
  if( keepTrig(13,accpatA,3) ) return;   // 5364A --> 13 - acc. patt. A
  if( keepTrig(14,accpatA,3) ) return;   // 5364B --> 14 - acc. patt. A
  if( keepTrig(15,accpatB,3) ) return;   // 5364C --> 15 - acc. patt. B
  if(tiKes==1) {
    if( keepTrig(16,accpatA,3) ) return; // 5364D --> 16 - acc. patt. A
  }
  if( keepTrig(17,accpatA,3) ) return;   // 5368A --> 17 - acc. patt. A
  if( keepTrig(18,accpatA,3) ) return;   // 5368B --> 18 - acc. patt. A
  if( keepTrig(19,accpatB,3) ) return;   // 5368C --> 19 - acc. patt. B
  if( keepTrig(20,accpatA,3) ) return;   // 5764A --> 20 - acc. patt. A
  if( keepTrig(21,accpatA,3) ) return;   // 5764B --> 21 - acc. patt. A
  if( keepTrig(22,accpatB,3) ) return;   // 5764C --> 22 - acc. patt. B
  if( keepTrig(23,accpatB,3) ) return;   // 9764A --> 23 - acc. patt. B
  if( keepTrig(24,accpatB,3) ) return;   // 9764B --> 24 - acc. patt. B
  if( keepTrig(25,accpatB,3) ) return;   // 9764C --> 25 - acc. patt. B
  if(tiKes==1) {
    if( keepTrig( 0,accpatA,3) ) return; // 5768A -->  0 - acc. patt. A
  }

  // Low level triggers -A
  if( keepTrig( 1,accpatB,1) ) return;   // 5768B -->  1 - acc. patt. B
  if( keepTrig( 2,accpatA,1) ) return;   // 5768C -->  2 - acc. patt. A
  if( keepTrig( 3,accpatA,1) ) return;   // 5768D -->  3 - acc. patt. A
  if( keepTrig( 4,accpatB,1) ) return;   // 1364A -->  4 - acc. patt. B
  if( keepTrig( 5,accpatA,1) ) return;   // 1364B -->  5 - acc. patt. A
  if( keepTrig( 6,accpatA,1) ) return;   // 1364C -->  6 - acc. patt. A
  if( keepTrig( 7,accpatB,1) ) return;   // 1368A -->  7 - acc. patt. B
  if( keepTrig( 8,accpatB,1) ) return;   // 1368B -->  8 - acc. patt. B
  if(tiKes==1) {
    if( keepTrig( 9,accpatB,1) ) return; // 1368C -->  9 - acc. patt. B
  }
  if( keepTrig(10,accpatA,1) ) return;   // 5324A --> 10 - acc. patt. A
  if( keepTrig(11,accpatA,1) ) return;   // 5324B --> 11 - acc. patt. A
  if( keepTrig(12,accpatB,1) ) return;   // 5324C --> 12 - acc. patt. B
  if( keepTrig(13,accpatA,1) ) return;   // 5364A --> 13 - acc. patt. A
  if( keepTrig(14,accpatA,1) ) return;   // 5364B --> 14 - acc. patt. A
  if( keepTrig(15,accpatB,1) ) return;   // 5364C --> 15 - acc. patt. B
  if( keepTrig(16,accpatA,1) ) return;   // 5364D --> 16 - acc. patt. A
  if( keepTrig(17,accpatA,1) ) return;   // 5368A --> 17 - acc. patt. A
  if( keepTrig(18,accpatA,1) ) return;   // 5368B --> 18 - acc. patt. A
  if(tiKes==1) {
    if( keepTrig(19,accpatB,1) ) return; // 5368C --> 19 - acc. patt. B
  }
  if( keepTrig(20,accpatA,1) ) return;   // 5764A --> 20 - acc. patt. A
  if( keepTrig(21,accpatA,1) ) return;   // 5764B --> 21 - acc. patt. A
  if(tiKes==1) {
    if( keepTrig(22,accpatB,1) ) return; // 5764C --> 22 - acc. patt. B
  }
  if( keepTrig(23,accpatB,1) ) return;   // 9764A --> 23 - acc. patt. B
  if( keepTrig(24,accpatB,1) ) return;   // 9764B --> 24 - acc. patt. B
  if(tiKes==1) {
    if( keepTrig(25,accpatB,1) ) return; // 9764C --> 25 - acc. patt. B
  }
  if( keepTrig( 0,accpatA,1) ) return;   // 5768A -->  0 - acc. patt. A

  // Low level triggers -D
  if( keepTrig( 0,accpatA,4) ) return;   // 5768A -->  0 - acc. patt. A
  if( keepTrig( 1,accpatB,4) ) return;   // 5768B -->  1 - acc. patt. B
  if( keepTrig( 2,accpatA,4) ) return;   // 5768C -->  2 - acc. patt. A
  if( keepTrig( 3,accpatA,4) ) return;   // 5768D -->  3 - acc. patt. A
  if(tiKes==1) {
    if( keepTrig( 4,accpatB,4) ) return; // 1364A -->  4 - acc. patt. B
  }
  if( keepTrig( 5,accpatA,4) ) return;   // 1364B -->  5 - acc. patt. A
  if( keepTrig( 6,accpatA,4) ) return;   // 1364C -->  6 - acc. patt. A
  if( keepTrig( 7,accpatB,4) ) return;   // 1368A -->  7 - acc. patt. B
  if(tiKes==1) {
    if( keepTrig( 8,accpatB,4) ) return; // 1368B -->  8 - acc. patt. B
  }
  if( keepTrig( 9,accpatB,4) ) return;   // 1368C -->  9 - acc. patt. B
  if( keepTrig(10,accpatA,4) ) return;   // 5324A --> 10 - acc. patt. A
  if( keepTrig(11,accpatA,4) ) return;   // 5324B --> 11 - acc. patt. A
  if(tiKes==1) {
    if( keepTrig(12,accpatB,4) ) return; // 5324C --> 12 - acc. patt. B
  }
  if( keepTrig(13,accpatA,4) ) return;   // 5364A --> 13 - acc. patt. A
  if( keepTrig(14,accpatA,4) ) return;   // 5364B --> 14 - acc. patt. A
  if( keepTrig(15,accpatB,4) ) return;   // 5364C --> 15 - acc. patt. B
  if( keepTrig(16,accpatA,4) ) return;   // 5364D --> 16 - acc. patt. A
  if( keepTrig(17,accpatA,4) ) return;   // 5368A --> 17 - acc. patt. A
  if( keepTrig(18,accpatA,4) ) return;   // 5368B --> 18 - acc. patt. A
  if( keepTrig(19,accpatB,4) ) return;   // 5368C --> 19 - acc. patt. B
  if( keepTrig(20,accpatA,4) ) return;   // 5764A --> 20 - acc. patt. A
  if( keepTrig(21,accpatA,4) ) return;   // 5764B --> 21 - acc. patt. A
  if( keepTrig(22,accpatB,4) ) return;   // 5764C --> 22 - acc. patt. B
  if(tiKes==1) {
    if( keepTrig(23,accpatB,4) ) return; // 9764A --> 23 - acc. patt. B
  }
  if( keepTrig(24,accpatB,4) ) return;   // 9764B --> 24 - acc. patt. B
  if( keepTrig(25,accpatB,4) ) return;   // 9764C --> 25 - acc. patt. B
*/
}
DTTrigGeom* DTBtiChip::geom ( ) const [inline]

Return trigger geometry.

Definition at line 123 of file DTBtiChip.h.

References _geom.

{ return _geom; }
std::vector<const DTDigi*> DTBtiChip::get_CellDigis ( int  cell) [inline]

get digi vector - SV 28/XI/02

Definition at line 74 of file DTBtiChip.h.

References _digis.

{ return _digis[cell];}
DTBtiId DTBtiChip::id ( void  ) const [inline]

Return the DTBtiChip Id.

Definition at line 126 of file DTBtiChip.h.

References _id.

Referenced by DTBtiTrig::DTBtiTrig().

{ return _id; }
void DTBtiChip::init ( void  ) [private]

Definition at line 549 of file DTBtiChip.cc.

References _curStep, _difs, _digis, _hits, _sums, _thisStepUsedHit, begin, config(), gather_cfg::cout, debug, i, AlCaHLTBitMon_ParallelJobs::p, p1, and DTConfigBti::WENflag().

Referenced by run().

                {

  if(config()->debug()>3)
    cout << "DTBtiChip::init() -> initializing bti chip" << endl;

  _curStep=0;
  for(int i=0;i<25;i++) {
    _sums[i] = 1000;
    _difs[i] = 1000;
  } 

  for(int cell=0;cell<9;cell++) {
    int WEN = config()->WENflag(cell+1);
    if( WEN==1 ){
      _thisStepUsedHit[cell]=0;
      vector<const DTDigi*>::const_iterator p;
      for(p=_digis[cell].begin();p<_digis[cell].end();p++){
        DTBtiHit* hit = new DTBtiHit(*p,config());
        //int clockTime = (int)(fabs(((*p)->time()+config()->SetupTime())/12.5));
        //DTBtiHit* hit = new DTBtiHit(clockTime,config());
        _hits[cell].push_back(hit);
      }

      //debugging
      if(config()->debug()>2){
        vector<DTBtiHit*>::const_iterator p1;
        for(p1=_hits[cell].begin();p1<_hits[cell].end();p1++){
                cout << " Filling hit in cell " << cell+1;
                if((*p1)->curTime()!=4000) 
                  cout << " raw time in trigger: " << (*p1)->curTime() << endl;
                cout << " time (clock units): " << (*p1)->clockTime() << endl; 
        }
      }
      // end debugging
    }
  }
}
void DTBtiChip::init_clock ( )

Definition at line 589 of file DTBtiChip.cc.

References _curStep, _difs, _digis_clock, _hits, _sums, _thisStepUsedHit, begin, config(), gather_cfg::cout, debug, i, init_done, p1, and DTConfigBti::WENflag().

                      {

  if(config()->debug()>3)
    cout << "DTBtiChip::init_clock() -> initializing bti chip" << endl;

  init_done = 1;
  _curStep=0;

  for(int i=0;i<25;i++) {
    _sums[i] = 1000;
    _difs[i] = 1000;
  } 

  for(int cell=0;cell<9;cell++) {
    int WEN = config()->WENflag(cell+1);
    if( WEN==1 ){
      _thisStepUsedHit[cell]=0;
    for(unsigned int i=0; i<_digis_clock[cell].size(); i++){
      const int clockTime = (_digis_clock[cell])[i];
      DTBtiHit* hit = new DTBtiHit(clockTime,config());
      _hits[cell].push_back(hit);
    }
        
    //debugging
    if(config()->debug()>2){
      vector<DTBtiHit*>::const_iterator p1;
      for(p1=_hits[cell].begin();p1<_hits[cell].end();p1++){
        cout << " Filling hit in cell " << cell+1;
        if((*p1)->curTime()!=4000) 
          cout << " time: " << (*p1)->curTime() << endl;
        else
          cout << " time (clock units): " << (*p1)->clockTime() << endl; 
        }
      }
      // end debugging
    }
  }
}
int DTBtiChip::keepTrig ( const int  eq,
const int  acp,
const int  code 
) [private]

Definition at line 722 of file DTBtiChipSelTrig.cc.

References abs, HDQMDatabaseProducer::config, gather_cfg::cout, debug, BitArray< N >::element(), i, BitArray< N >::print(), and BitArray< N >::set().

                                                               {

  if(config()->debug()>4){
    cout << "DTBtiChip::keepTrig called with arguments: ";
    cout << eq << ", " << acp << ", " << code << endl; 
  }

  int const KCen = 40; // Arrays will start from 0 --> use 40 instead of 41
  BitArray<80> val0, val1, val2, val3, val4, val5;
  int mm[6];

  int i=0;
  for(i=0;i<6;i++){
    mm[i]=0;
    int mk = (int)(2*_Keq[eq][i]);
    if(abs(mk) > config()->KCut() )
        continue;
    mm[i]=(int)(_Keq[eq][i]*2)+KCen;
    //    if(_Keq[eq][i]<0){
    //      mm[i]=_Keq[eq][i]*2-0.5+KCen;
    //    } else {
    //      mm[i]=_Keq[eq][i]*2+KCen;
    //    }
  }

  if(mm[0]>0 && (code==8 || code==3 || code==4) ){
    val0.set(mm[0]-1);
    val0.set(mm[0]);
    val0.set(mm[0]+1);
    if(acp==2 && (code==8 || code==3) ) {
      val0.set(mm[0]-2);
      val0.set(mm[0]+2);
    }
  }

  if(mm[1]>0 && (code==8 || code==1 || code==4) ){
    val1.set(mm[1]-1);
    val1.set(mm[1]);
    val1.set(mm[1]+1);
    if(acp==2 && code==8 ) {
      val1.set(mm[1]-2);
      val1.set(mm[1]+2);
    }
  }

  if(mm[2]>0 && (code==8 || code==1 || code==2) ){
    val2.set(mm[2]-1);
    val2.set(mm[2]);
    val2.set(mm[2]+1);
    if(acp==2 && (code==8 || code==2) ) {
      val2.set(mm[2]-2);
      val2.set(mm[2]+2);
    }
  }

  if(mm[3]>0 && (code==8 || code==2 || code==4) ){
    val3.set(mm[3]-1);
    val3.set(mm[3]);
    val3.set(mm[3]+1);
  }

  if(mm[4]>0 && (code==8 || code==1 || code==3) ){
    val4.set(mm[4]-1);
    val4.set(mm[4]);
    val4.set(mm[4]+1);
  }

  if(mm[5]>0 && (code==8 || code==2 || code==3) ){
    val5.set(mm[5]);
  }

  // debugging
  if(config()->debug()>4){
    cout << " dump of val arrays: " << endl;
    //    cout << val0.to_string() << endl;
    //    cout << val1.to_string() << endl;
    //    cout << val2.to_string() << endl;
    //    cout << val3.to_string() << endl;
    //    cout << val4.to_string() << endl;
    //    cout << val5.to_string() << endl;
    val0.print();
    cout << endl;
    val1.print();
    cout << endl;
    val2.print();
    cout << endl;
    val3.print();
    cout << endl;
    val4.print();
    cout << endl;
    val5.print();
    cout << endl;
  }
  // end debugging

  int KMax = 0;
  int LKMax = -1;
  for(i=0;i<80;i++){
    int val = val0.element(i)+val1.element(i)+val2.element(i)+
              val3.element(i)+val4.element(i)+val5.element(i);
    //    int val = val0.test(i)+val1.test(i)+val2.test(i)+
    //              val3.test(i)+val4.test(i)+val5.test(i);
    if(val>KMax) {
      KMax=val;
      LKMax=i;
    }
  }
  
  // Note that all bits in val are shifted by one w.r.t. FORTRAN version
  // The output K will be the same because of the different value of Kcen

  if        (KMax==6 && code==8) {
    store(eq,8,LKMax-KCen,int(_Xeq[eq][1]));
    return 1;
  } else if (KMax==3 && code!=8) {
    if(code==1 || code==4) {
      store(eq,code,LKMax-KCen,int(_Xeq[eq][0]));
    } else {
      store(eq,code,LKMax-KCen,int(_Xeq[eq][1]));
    }
    return 1;
  }
  return 0; 
  // return value is ITFL of FORTRAN version
}
int DTBtiChip::keepTrigPatt ( int  flag,
const int  eq,
const int  pattType,
int  hlflag 
) [private]

Definition at line 327 of file DTBtiChipSelTrig.cc.

References abs, HDQMDatabaseProducer::config, gather_cfg::cout, debug, BitArray< N >::element(), python::Vispa::Plugins::EdmBrowser::EdmDataAccessor::eq(), i, BitArray< N >::print(), BitArray< N >::reset(), BitArray< N >::set(), and X.

                                                                                      {
  //if pattern is not enabled, return
  if(flag==0)
    return  0;

  int AC1 = config()->AccPattAC1(); //default 0
  int AC2 = config()->AccPattAC2(); //default 3
  int ACH = config()->AccPattACH(); //default 1
  int ACL = config()->AccPattACL(); //default 2
  int tiKes = config()->XON();

  if(config()->debug()>4){
    cout << "DTBtiChip::keepTrigPatt called with arguments: ";
    cout << eq << ", " << pattType << ", " << hlflag << endl; 
    cout<<"AC1,AC2,ACH,ACL="<<AC1<<" "<<AC2<<" "<<ACH<<" "<<ACL<<endl;
  }

  BitArray<80> val0, val1, val2, val3, val4, val5;
  int mm[6];

  //NB _Keq = (Kman - K0)/2   where K0=tmax*2  --->OBSOLETE, now Keq=Kman
  //int K0 = 2 * (config()->ST()/2.); 
  int K0 = int (config()->ST());

  int i=0;
  float Keqfloat[6] = {0,0,0,0,0,0};
  for(i=0;i<6;i++){
    mm[i] = -1;
    int mk = (int)(_Keq[eq][i] - K0);
    //if(abs(mk) > config()->KCut(_id.superlayer()-1))continue;
    if(abs(mk) > 2*K0)  continue;
    Keqfloat[i]=_Keq[eq][i];
    mm[i]=(int)(_Keq[eq][i]);
    //    if(_Keq[eq][i]<0){
    //      mm[i]=_Keq[eq][i]*2-0.5+KCen;
    //    } else {
    //      mm[i]=_Keq[eq][i]*2+KCen;
    //    }
  }

  switch(pattType)
    {
      case 1: //normal pattern
        //if(hlflag==1 && (eq!=2 && eq!=14 && eq!=28) ){  //test for L
/*      if(hlflag==1){  //test for L
          acceptMask(&val0,mm[0],AC1); //eqAB
          acceptMask(&val1,mm[1],AC1); //eqBC
          acceptMask(&val2,mm[2],AC1); //eqCD
        }
        else
*/
        {
          acceptMask(&val0,mm[0],AC2); //eqAB
          acceptMask(&val1,mm[1],AC2); //eqBC
          acceptMask(&val2,mm[2],AC2); //eqCD
        }
        break;

      case 2: //1L1 pattern
        acceptMask(&val0,mm[0],AC1); //eqAB
        acceptMask(&val1,mm[1],ACL); //eqBC
        acceptMask(&val2,mm[2],AC1); //eqCD
        break;

      case 3: //11L pattern
        acceptMask(&val0,mm[0],AC1); //eqAB
        acceptMask(&val1,mm[1],AC1); //eqBC
        acceptMask(&val2,mm[2],ACL); //eqCD
        break;

      case 4: //L11 pattern
        acceptMask(&val0,mm[0],ACL); //eqAB
        acceptMask(&val1,mm[1],AC1); //eqBC
        acceptMask(&val2,mm[2],AC1); //eqCD
        break;

      case 5: //1H1 pattern
        acceptMask(&val0,mm[0],AC1); //eqAB
        acceptMask(&val1,mm[1],ACH); //eqBC
        acceptMask(&val2,mm[2],AC1); //eqCD
        break;

      case 6: //11H pattern
        acceptMask(&val0,mm[0],AC1); //eqAB
        acceptMask(&val1,mm[1],AC1); //eqBC
        acceptMask(&val2,mm[2],ACH); //eqCD
        break;

      case 7: //H11 pattern
        acceptMask(&val0,mm[0],ACH); //eqAB
        acceptMask(&val1,mm[1],AC1); //eqBC
        acceptMask(&val2,mm[2],AC1); //eqCD
        break;
 
      default:
        acceptMask(&val0,mm[0],AC2); //eqAB
        acceptMask(&val1,mm[1],AC2); //eqBC
        acceptMask(&val2,mm[2],AC2); //eqCD
        break;
    }   

  //eq. AC and BD acceptance are always +-1 ->code 00
  int acc = 0;
  acceptMask(&val3,mm[3],acc); //eq.AC
  acceptMask(&val4,mm[4],acc); //eq.BD

  //eq. AD is the reference value!
  if(mm[5]>0){
    val5.set(mm[5]);
  }

  // debugging: print() method prints from last to first bit!
  if(config()->debug()>4){
    cout << " dump of val arrays: " << endl;
    //    cout << val0.to_string() << endl;
    //    cout << val1.to_string() << endl;
    //    cout << val2.to_string() << endl;
    //    cout << val3.to_string() << endl;
    //    cout << val4.to_string() << endl;
    //    cout << val5.to_string() << endl;
    val0.print(); 
    cout << endl;
    val1.print();
    cout << endl;
    val2.print();
    cout << endl;
    val3.print();
    cout << endl;
    val4.print();
    cout << endl;
    val5.print();
    cout << endl;
   }
  // end debugging

  //search for High trigger:
  if(hlflag==0){
    int code = 0;
    int KMax = 0;
    int LKMax = -1;
    for(i=0;i<80;i++){
      int val = val0.element(i)+val1.element(i)+val2.element(i)+
                val3.element(i)+val4.element(i)+val5.element(i);
      if(val>KMax) {
        KMax=val;
        LKMax=i;
      }
    }
  
    //SV: K value is stored in 6 bits, so K=64->0, etc
    if(LKMax>63)
      LKMax-=64;

    if(KMax==6) {
      code=8;
      int X;
      if( eq==0 )  //store Xbc only for patt 0, else store Xad
        X=int(_Xeq[eq][0]);
      else
        X=int(_Xeq[eq][1]);
      store(eq,code,LKMax,X,Keqfloat[0],Keqfloat[1],
           Keqfloat[2],Keqfloat[3],Keqfloat[4],Keqfloat[5]);
      return 1;
    }
    return 0;
  } //end H 

  //search for Low triggers:
  if(hlflag==1){
    int code = 0;
    int RON = config()->RONflag();


    //hit in B is missing
    if(config()->debug()>4)
      cout << "SelTrig: searching low-B" << endl;
    int LKMax = -1;
    for(i=0;i<80;i++){
      int val = val2.element(i)+val3.element(i)+val5.element(i);
      if(val==3){ //Ref. is eqAD
        code=2;
        LKMax=i;
        int storefg = 1; 

        //SV - XON time-ind.Keq suppr. XON=0 do not abilitate patterns 
        if(tiKes==0) {
          if(eq==3 || eq==13 || eq==17 || eq==21 || eq==29){  
            if(config()->debug()>3)
              cout << "SelTrig: doing XON suppression!"<<endl;
            storefg = 0;
          }
        }

        //SV - RON suppression for low triggers
        if( RON==0 ){
          if( eq==19 ){
            if(config()->debug()>3)
              cout << "SelTrig: doing RON low triggers suppression!"<<endl;
            storefg = 0;
          }
        }

        if(storefg){ 
          //SV: K value is stored in 6 bits, so K=64->0, etc
          if(LKMax>63)
            LKMax-=64;
          int X;
          if( eq==0 )
            X=int(_Xeq[eq][0]);
          else
            X=int(_Xeq[eq][1]);
          store(eq,code,LKMax,X,Keqfloat[0],Keqfloat[1],
           Keqfloat[2],Keqfloat[3],Keqfloat[4],Keqfloat[5]);
          return 1;
        }  
      }
    } //end -B Low

    //hit in C is missing
    if(config()->debug()>3)
      cout << "SelTrig: searching low-C" << endl;
     for(i=0;i<80;i++){
      int val = val0.element(i)+val4.element(i)+val5.element(i);
      if(val==3){ //Ref. is eqAD
        code=3;
        LKMax=i;
        int storefg = 1;
 
        //SV - XON time-ind.Keq suppr.
        if(tiKes==0) {
          if(eq==0 || eq==6 || eq==10 || eq==16 || eq==26 || eq==30){  
            if(config()->debug()>3)
              cout << "SelTrig: doing XON suppression!"<<endl;
            storefg = 0;
          }
        }

        if(storefg){
          //SV: K value is stored in 6 bits, so K=64->0, etc
          if(LKMax>63)
            LKMax-=64;

          int X;
          if( eq==0 )
            X=int(_Xeq[eq][0]);
          else
            X=int(_Xeq[eq][1]);
          store(eq,code,LKMax,X,Keqfloat[0],Keqfloat[1],
           Keqfloat[2],Keqfloat[3],Keqfloat[4],Keqfloat[5]);
          return 1;
        }
      }
    } // end -C Low

    //for -A and -D low acceptance is +-1
//    if(pattType==1){
      val0.reset();
      val1.reset();
      val2.reset();
      acceptMask(&val0,mm[0],AC1); //eqAB
      acceptMask(&val1,mm[1],AC1); //eqBC
      acceptMask(&val2,mm[2],AC1); //eqCD
//    }

    //hit in A is missing
    if(config()->debug()>4)
      cout << "SelTrig: searching low-A" << endl;
    for(i=0;i<80;i++){
      int val = val1.element(i)+val2.element(i)+val4.element(i);
      if(val==3 && i==mm[4]){ //Ref. is eqBD
        code=1;
        LKMax=i;
        int storefg = 1;

        //SV - XON time-ind.Keq suppr.
        if(tiKes==0) {
          if(eq==9 || eq==19 || eq==22 || eq==25 ){  
            if(config()->debug()>3)
              cout << "SelTrig: doing low-A XON suppression!"<<endl;
          storefg = 0;
          }
        }

        if( RON==0 ){ //SV - RON suppression
          if( eq==26 ){
            if(config()->debug()>3)
              cout << "SelTrig: doing RON low triggers suppression!"<<endl;
            storefg = 0;
          }
        }

        if(storefg){
          //SV: K value is stored in 6 bits, so K=64->0, etc
          if(LKMax>63)
            LKMax-=64;

          store(eq,code,LKMax,int(_Xeq[eq][0]),Keqfloat[0],Keqfloat[1],
           Keqfloat[2],Keqfloat[3],Keqfloat[4],Keqfloat[5]);
          return 1;
        }
      }
    } //end -A Low
 

    //hit in D is missing
    if(config()->debug()>4)
      cout << "SelTrig: searching low-D" << endl;
    for(i=0;i<80;i++){
      int val = val0.element(i)+val1.element(i)+val3.element(i);
      if(val==3 && i==mm[3]){ //Ref. is eqAC
        code=4;
        LKMax=i;
        int storefg = 1;

        //SV - XON time-ind.Keq suppr.
        if(tiKes==0){
          if(eq==4 || eq==8 || eq==12 || eq==23){  
            if(config()->debug()>3)
              cout << "SelTrig: doing XON suppression!"<<endl;
            storefg = 0;
          }
        }

        //SV - RON suppression for low triggers
        if( RON==0 ){
          if(eq==1 || eq==2 || eq==3 || eq==24 || eq==25){
            if(config()->debug()>3)
              cout << "SelTrig: doing RON low triggers suppression!"<<endl;
            storefg = 0;
          }
        }

        if(storefg){ // && _Xeq[eq][1] >=0){
          //SV: K value is stored in 6 bits, so K=64->0, etc
          if(LKMax>63)
            LKMax-=64;

          store(eq,code,LKMax,int(_Xeq[eq][0]),Keqfloat[0],Keqfloat[1],
           Keqfloat[2],Keqfloat[3],Keqfloat[4],Keqfloat[5]);
          return 1;
        }
      }
    } //end -D Low
 
    return 0; 
  } //end Low
  return 0;
}
LocalPoint DTBtiChip::localPosition ( ) const [inline]

Position in chamber frame (x is the one of first traco in slave plane)

Definition at line 95 of file DTBtiChip.h.

References _geom, _id, and DTTrigGeom::localPosition().

{ return _geom->localPosition(_id); }
bool DTBtiChip::matchEq ( float  eqA,
float  eqB,
int  AC 
) [private]
int DTBtiChip::nCellHit ( ) const

Number of cells with hits.

Definition at line 390 of file DTBtiChip.cc.

References _digis, _id, begin, DTBtiId::bti(), config(), gather_cfg::cout, debug, i, n, AlCaHLTBitMon_ParallelJobs::p, and findQualityFiles::size.

Referenced by run().

                          {
  int n=0;
  int i=0;
  for(i=0;i<9;i++) {
    if( _digis[i].size() >0 ) n++;
  }
  if(config()->debug()>2) {
    cout << n << " cells with hits found:" << endl;
  }
  if(config()->debug()>2) {
    for(i=0;i<9;i++) {
      vector<const DTDigi*>::const_iterator p;
      for(p=_digis[i].begin();p<_digis[i].end();p++) {
        cout << "DTBtiChip # " << 
        _id.bti() << 
        " cell " << i+1;
        cout << " --> drift time (tdc units): " << (*p)->countsTDC() << endl;
        (*p)->print();
      }
    }
  }
  return n;
/*
 //SV 2/IV/03 counting hits from _hits
  int n=0;
  int i=0;
  for(i=0;i<9;i++) {
    if( _hits[i].size() >0 ) n++;
  }
  if(config()->debug()>2) {
    cout << n << " cells with hits found:" << endl;
  }
  if(config()->debug()>2) {
    for(i=0;i<9;i++) {
      vector<const DTBtiHit*>::const_iterator p;
      for(p=_hits[i].begin();p<_hits[i].end();p++) {
        cout << "DTBtiChip # " << 
        number() << 
        " cell " << i+1;
        if((*p)->curTime()!=4000)
          cout << " --> drift time: " << (*p)->curTime() << endl;
        else
          cout << " --> clock time: " << (*p)->clockTime() << endl;
      }
    }
  }
  return n;
*/
}
int DTBtiChip::nTrig ( int  step) const

Number of triggers found.

Definition at line 455 of file DTBtiChip.cc.

References _trigs, gather_cfg::cout, DTConfig::NSTEPF, DTConfig::NSTEPL, and launcher::step.

Referenced by doLTS(), and DTBtiCard::runBTI().

                               {
  if(step<DTConfig::NSTEPF||step>DTConfig::NSTEPL){
    cout << "DTBtiChip::nTrig: step out of range: " << step ;
    cout << " 0 returned" << endl;
    return 0;
  }
  return _trigs[step-DTConfig::NSTEPF].size(); 
}
int DTBtiChip::number ( ) const [inline]

Return DTBtiChip number.

Definition at line 89 of file DTBtiChip.h.

References _id, and DTBtiId::bti().

Referenced by add_digi_clock(), and DTBtiCard::runBTI().

{ return _id.bti(); }
DTBtiChip & DTBtiChip::operator= ( const DTBtiChip bti)

Assignment operator.

Definition at line 275 of file DTBtiChip.cc.

References _curStep, _difs, _digis, _geom, _hits, _id, _JTR, _Keq, _KTR, _MaxKAcc, _MinKAcc, _nStepUsedHits, _sums, _thisStepUsedHit, _thisStepUsedTimes, _trigs, _Xeq, i, j, DTConfig::NSTEPF, DTConfig::NSTEPL, AlCaHLTBitMon_ParallelJobs::p, and p1.

                                         {
  if(this != &bti){
    _geom = bti._geom;
    _id = bti._id;
    _curStep = bti._curStep;
    _nStepUsedHits = bti._nStepUsedHits;
    int i=0;
    for(i=0;i<DTConfig::NSTEPL - DTConfig::NSTEPF;i++) {
      _trigs[i].reserve(2);
      vector<DTBtiTrig*>::const_iterator p;
      for(p=bti._trigs[i].begin();p<bti._trigs[i].end();p++){
        _trigs[i].push_back(*p);
      }
    }
    for(i=0;i<9;i++) {
      _digis[i].reserve(10);
      vector<const DTDigi*>::const_iterator p;
      for(p=bti._digis[i].begin();p<bti._digis[i].end();p++){
        _digis[i].push_back(*p);
      }
      _hits[i].reserve(10);
      vector<DTBtiHit*>::const_iterator p1;
      for(p1=bti._hits[i].begin();p1<bti._hits[i].end();p1++){
        _hits[i].push_back(*p1);
      }
      _thisStepUsedTimes[i] = bti._thisStepUsedTimes[i];
      _thisStepUsedHit[i] = _thisStepUsedHit[i];
    }
    for(i=0;i<25;i++){
      _sums[i] = bti._sums[i];
      _difs[i] = bti._difs[i];
    }
    for(i=0;i<26;i++){
      int j = 0;
      for(j=0;j<6;j++){
        _Keq[i][j] = bti._Keq[i][j];
      }
      for(j=0;j<3;j++){
        _JTR[i][j] = bti._JTR[i][j];
      }
      for(j=0;j<2;j++){
        _Xeq[i][j] = bti._Xeq[i][j];
        _KTR[i][j] = bti._KTR[i][j];
      }
    }
    _MinKAcc = bti._MinKAcc;
    _MaxKAcc = bti._MaxKAcc;
  }
  return *this;
}
int DTBtiChip::reSum ( int  a,
int  b 
) [inline, private]

Definition at line 163 of file DTBtiChip.h.

References a, and reSumAr.

{ return reSumAr[a][b+2];}
int DTBtiChip::reSum23 ( int  a,
int  b 
) [inline, private]

Definition at line 164 of file DTBtiChip.h.

References a, and reSumAr23.

{ return reSumAr23[a][b+2];}
void DTBtiChip::reSumSet ( ) [private]

Definition at line 103 of file DTBtiChipEquations.cc.

Referenced by DTBtiChip().

                   {

  reSumAr[2][ 2 +2]=0;
  reSumAr[2][ 1 +2]=0;
  reSumAr[2][ 0 +2]=0;
  reSumAr[2][-1 +2]=-1;
  reSumAr[2][-2 +2]=-1;

  reSumAr[1][ 2 +2]=1;
  reSumAr[1][ 1 +2]=1;
  reSumAr[1][ 0 +2]=0;
  reSumAr[1][-1 +2]=0;
  reSumAr[1][-2 +2]=0;

  reSumAr[0][ 2 +2]=1;
  reSumAr[0][ 1 +2]=0;
  reSumAr[0][ 0 +2]=0;
  reSumAr[0][-1 +2]=0;
  reSumAr[0][-2 +2]=-1;

  reSumAr23[2][ 2 +2]=1;
  reSumAr23[2][ 1 +2]=1;
  reSumAr23[2][ 0 +2]=1;
  reSumAr23[2][-1 +2]=0;
  reSumAr23[2][-2 +2]=0;

  reSumAr23[1][ 2 +2]=1;
  reSumAr23[1][ 1 +2]=1;
  reSumAr23[1][ 0 +2]=0;
  reSumAr23[1][-1 +2]=0;
  reSumAr23[1][-2 +2]=0;

  reSumAr23[0][ 2 +2]=1;
  reSumAr23[0][ 1 +2]=0;
  reSumAr23[0][ 0 +2]=0;
  reSumAr23[0][-1 +2]=0;
  reSumAr23[0][-2 +2]=-1;
 }
void DTBtiChip::run ( void  )

Run DTBtiChip algorithm.

Definition at line 630 of file DTBtiChip.cc.

References _geom, _id, _nStepUsedHits, DTBtiId::bti(), computeEqs(), computeSums(), config(), gather_cfg::cout, currentIntStep(), currentStep(), debug, DTConfigBti::debug(), doLTS(), findTrig(), init(), init_done, DTTrigGeom::nCell(), nCellHit(), DTConfig::NSTEPF, DTConfig::NSTEPL, superlayer(), DTBtiId::superlayer(), and tick().

Referenced by DTBtiCard::runBTI().

               {

  // Debugging...
  if(config()->debug()>2){
    cout << "DTBtiChip::run: Processing BTI " << _id.bti() << endl;
    cout << " in SL " << _id.superlayer() << endl;
  }
  // End debugging

  if(_id.bti()<1 || _id.bti() >_geom->nCell(superlayer())) {
    if(config()->debug()>1)
      cout << "DTBtiChip::run : wrong BTI number: " << _id.bti() << endl;
    return;
  }

  // run algorithm
  if(!init_done)
    init();
  if( nCellHit()<3 ) return;   // check that at least 3 cell have hits

  for(int ints=0; ints<2*DTConfig::NSTEPL; ints++) { // 80 MHz 
    tick(); // Do a 12.5 ns step

    // In electronics equations are computed every 12.5 ns
    // but since triggers are searched for only every 25 ns, skip
    // also equation's computing at odd values of internal step
    if((currentIntStep()/2)*2!=currentIntStep())continue;
    //if((currentIntStep()/2)*2==currentIntStep())continue; 


    if(config()->debug()>2){
      cout << "DTBtiChip::run : internal step " << currentIntStep();
      cout << " number of JTRIG hits is " << _nStepUsedHits << endl;
    }
    if(currentStep()>=DTConfig::NSTEPF && _nStepUsedHits>2) { 
      // at least 3 good hits in this step -> run algorithm
      computeSums();
      computeEqs();
      findTrig();
    }
  }
  if( config()->LTS()>0 ) doLTS(); // low trigger suppression
}
int DTBtiChip::sector ( void  ) const [inline]

Return sector number.

Definition at line 135 of file DTBtiChip.h.

References _geom, and DTTrigGeom::sector().

{ return _geom->sector(); }
void DTBtiChip::setSnap ( ) [private]

Definition at line 852 of file DTBtiChip.cc.

References config(), gather_cfg::cout, debug, RE23, RE43, DTConfigBti::RE43(), ST, ST2, ST23, ST3, ST4, DTConfigBti::ST43(), ST43, ST5, and ST7.

Referenced by DTBtiChip().

                  {

 //set the internally calculated drift velocity parameters
  ST43 = config()->ST43();
  RE43 = config()->RE43();
  ST23 = int(double(ST43)/2.);
  RE23 = (RE43==1) ? 2 : int(double(RE43)/2.);


  ST =  int(  double(ST43) * 3./4. + double(RE43) * 1./4.     );
  ST2 = int( (double(ST43) * 3./4. + double(RE43) * 1./4.)*2. );
  ST3 = int( (double(ST43) * 3./4. + double(RE43) * 1./4.)*3. );
  ST4 = int( (double(ST43) * 3./4. + double(RE43) * 1./4.)*4. );
  ST5 = int( (double(ST43) * 3./4. + double(RE43) * 1./4.)*5. );
  ST7 = int( (double(ST43) * 3./4. + double(RE43) * 1./4.)*7. );

  if(config()->debug()>3){
    cout << "Snap register dump: " << endl;
    cout << "ST43 = " << ST43 << endl;
    cout << "RE43 = " << RE43 << endl;
    cout << "ST23 = " << ST23 << endl;
    cout << "RE23 = " << RE23 << endl;
    cout << "ST = " << ST << endl;
    cout << "ST2 = " << ST2 << endl;
    cout << "ST3 = " << ST3 << endl;
    cout << "ST4 = " << ST4 << endl;
    cout << "ST5 = " << ST5 << endl;
    cout << "ST7 = " << ST7 << endl;
  }
}
int DTBtiChip::station ( ) const [inline]

Return station number.

Definition at line 132 of file DTBtiChip.h.

References _geom, and DTTrigGeom::station().

{ return _geom->station(); }
int DTBtiChip::store ( const int  eq,
const int  code,
const int  K,
const int  X,
float  KeqAB = 0.,
float  KeqBC = 0.,
float  KeqCD = 0.,
float  KeqAC = 0.,
float  KeqBD = 0.,
float  KeqAD = 0. 
) [private]

Definition at line 785 of file DTBtiChip.cc.

References _MaxKAcc, _MinKAcc, _thisStepUsedHit, DTBtiTrig::addDigi(), addTrig(), trackerHits::c, config(), gather_cfg::cout, currentStep(), debug, DTBtiHit::hitDigi(), DTBtiTrig::print(), and generateDummyData::trg().

                                                            {

  // remove negative position triggers
  if(X<0)return 0;

  
  // accept in range triggers (acceptances defined in constructor)
  if(K>=_MinKAcc && K<=_MaxKAcc) 
  {
    int trig_step = currentStep();

/*
    //SV test 27/I/2003 1-clock delay for critical patterns in default ACx configuration 
    int AC1 = config()->AccPattAC1(); //default 0
    int AC2 = config()->AccPattAC2(); //default 3
    int ACH = config()->AccPattACH(); //default 1
    int ACL = config()->AccPattACL(); //default 2     

    if(AC1==0 && AC2==3 && ACH==1 && ACL==2){
      if(eq==1 || eq==4 || eq==7 || eq==8 || eq==9 || eq==12 || eq==15
        || eq==19 || eq==22 || eq==23 || eq==24 || eq==25 || eq==27 )
           trig_step = currentStep()+1;
    }
*/     
    //store strobe: SV no strobe defined for this setup SV 15/I/2007
    int strobe=-1;

    // create a new trigger
    float Keq[6] = {KeqAB,KeqBC,KeqCD,KeqAC,KeqBD,KeqAD};
    //DTBtiTrig* trg = new DTBtiTrig(this,code,K,X,currentStep(),eq);
    DTBtiTrig* trg = new DTBtiTrig(this,code,K,X,trig_step,eq,strobe,Keq);

    // store also the digis
    for(int c=0; c<9; c++) {
      if(_thisStepUsedHit[c]) {
        const DTDigi* digi = _thisStepUsedHit[c]->hitDigi();
        if(digi)
          trg->addDigi(digi);
      }
    }

    //addTrig(currentStep(),trg);
    addTrig(trig_step,trg);

    // Debugging...
    if(config()->debug()>1)
      trg->print();
    // end debugging
    
    return 1;
  }
  else{
    // remove out of range triggers (acceptances defined in constructor)
    if(config()->debug()>2){
      cout << "DTBtiChip::store, REJECTED TRIGGER at step "<< currentStep();
      cout << " allowed K range in theta view is: [";
      cout << _MinKAcc << ","<< _MaxKAcc << "]";
      cout << "K value is " << K << endl; 
    }
    return 0;
  }//end else
}//end store
void DTBtiChip::sum ( const int  s,
const int  a,
const int  b 
) [private]

Definition at line 82 of file DTBtiChipEquations.cc.

                                                    {
  //
  // fill the sums and difs arrays
  // a and b are the cell numbers (in the range [1,9])
  // s is the sum number (in the range [1,25])
  //

  if( _thisStepUsedHit[a-1]!=0 && _thisStepUsedHit[b-1]!=0 ){
    _sums[s-1] = (float)(_thisStepUsedHit[a-1]->jtrig() +
                         _thisStepUsedHit[b-1]->jtrig()  );
    _difs[s-1] = (float)(_thisStepUsedHit[a-1]->jtrig() -
                         _thisStepUsedHit[b-1]->jtrig()  );
  } else {
    _sums[s-1] = 1000;
    _difs[s-1] = 1000;
  }

}
int DTBtiChip::superlayer ( ) const [inline]

Return superlayer.

Definition at line 92 of file DTBtiChip.h.

References _id, and DTBtiId::superlayer().

Referenced by add_digi(), and run().

{ return _id.superlayer(); }
void DTBtiChip::tick ( ) [private]

Definition at line 675 of file DTBtiChip.cc.

References _curStep, _hits, _nStepUsedHits, _thisStepUsedHit, begin, config(), gather_cfg::cout, currentIntStep(), DTBtiHit::curTime(), debug, DTConfigBti::debug(), DTBtiHit::jtrig(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by run().

                {
  //
  // fills the DTBtiChip registers ( _thisStepUsedHit[cell] )
  // for a given clock (Syncronizer and Shaper functionalities)
  //

  _curStep++; // increase internal step (12.5 ns --> 80 MHz)

  // debugging
  if(config()->debug()>2){
    cout << "DTBtiChip::tick: internal step is now " << currentIntStep()<< endl; 
  }
  // end debugging

  // Loop on cells
  _nStepUsedHits=0;
  for(int cell=0;cell<9;cell++) {

    // decrease drift time by 12.5 ns for each hit
    vector<DTBtiHit*>::const_iterator p;
    for(p=_hits[cell].begin();p<_hits[cell].end();p++){
      (*p)->stepDownTime();
    }

    // loop on hits
    _thisStepUsedHit[cell]=0;
    for(p=_hits[cell].begin();p<_hits[cell].end();p++){
      if       ( (*p)->isDrifting() ) { // hit is drifting
        break;                          //   --> don't consider others
      } else if( (*p)->isInsideReg() ) {  // hit is already in registers
        _thisStepUsedHit[cell]=(*p);
        _nStepUsedHits++;
        // debugging
        if(config()->debug()>2){
          if((*p)->curTime() != 4000)
            cout << "DTBtiChip::tick: hit in register: time=" << (*p)->curTime();
          else
            cout << "DTBtiChip::tick: hit in register! " << endl;
          cout <<                           " jtrig=" << (*p)->jtrig() << endl;

        }
        // end debugging
        break;                          //   --> don't consider other triggers
      }
      // hit is not drifting and not in registers: it is gone out of register, but
      // jtrig value is still=ST ; save in array and consider next one if exists
    } // end loop on cell hits

    // debugging...
    if(config()->debug()>2){
      if(_thisStepUsedHit[cell]!=0){
        cout << "int. step=" << currentIntStep() << " cell=" << cell+1;
        cout << " jtrig=" << _thisStepUsedHit[cell]->jtrig();
        if( _thisStepUsedHit[cell]->curTime() != 4000 )  
          cout << " (time=" << _thisStepUsedHit[cell]->curTime() << ")" << endl;
        else 
          cout << endl;
      }
    } 
    // end debugging

  } // end loop on cells

}
DTBtiTrig * DTBtiChip::trigger ( int  step,
unsigned  n 
) const

Return the requested trigger.

Definition at line 475 of file DTBtiChip.cc.

References _trigs, gather_cfg::cout, n, DTConfig::NSTEPF, DTConfig::NSTEPL, AlCaHLTBitMon_ParallelJobs::p, findQualityFiles::size, and launcher::step.

Referenced by doLTS().

                                             {
  if(step<DTConfig::NSTEPF||step>DTConfig::NSTEPL){
    cout << "DTBtiChip::trigger: step out of range: " << step ;
    cout << " empty pointer returned" << endl;
    return 0;
  } 
  if(n<1 || n>_trigs[step-DTConfig::NSTEPF].size()) {
    cout << "DTBtiChip::trigger: requested trigger does not exist: " << n;
    cout << " empty pointer returned!" << endl;
    return 0;
  }
  vector<DTBtiTrig*>::const_iterator p = _trigs[step-DTConfig::NSTEPF].begin();
  return (*(p+n-1));
}
DTBtiTrigData DTBtiChip::triggerData ( int  step,
unsigned  n 
) const

Return the data part of the requested trigger.

Definition at line 491 of file DTBtiChip.cc.

References _trigs, gather_cfg::cout, n, DTConfig::NSTEPF, DTConfig::NSTEPL, AlCaHLTBitMon_ParallelJobs::p, findQualityFiles::size, and launcher::step.

Referenced by DTBtiCard::runBTI().

                                                 {
  if(step<DTConfig::NSTEPF||step>DTConfig::NSTEPL){
    cout << "DTBtiChip::triggerData: step out of range: " << step ;
    cout << " dummy trigger returned" << endl;
    return DTBtiTrigData();
  } 
  if(n<1 || n>_trigs[step-DTConfig::NSTEPF].size()) {
    cout << "DTBtiChip::triggerData: requested trig. doesn't exist: " << n;
    cout << " dummy trigger returned!" << endl;
    return DTBtiTrigData();
  }
  vector<DTBtiTrig*>::const_iterator p = _trigs[step-DTConfig::NSTEPF].begin();
  return (*(p+n-1))->data();
}
vector< DTBtiTrig * > DTBtiChip::trigList ( int  step) const

Definition at line 465 of file DTBtiChip.cc.

References _trigs, gather_cfg::cout, DTConfig::NSTEPF, DTConfig::NSTEPL, and launcher::step.

                                  {
  if(step<DTConfig::NSTEPF||step>DTConfig::NSTEPL){
    cout << "DTBtiChip::trigList: step out of range: " << step ;
    cout << " empty pointer returned" << endl;
    //return 0;
  } 
  return _trigs[step-DTConfig::NSTEPF]; 
}
int DTBtiChip::wheel ( ) const [inline]

Return wheel number.

Definition at line 129 of file DTBtiChip.h.

References _geom, and DTTrigGeom::wheel().

{ return _geom->wheel(); }

Member Data Documentation

int DTBtiChip::_busyStart_clock[9] [private]

Definition at line 208 of file DTBtiChip.h.

Referenced by add_digi(), add_digi_clock(), and DTBtiChip().

Definition at line 169 of file DTBtiChip.h.

Referenced by DTBtiChip().

Definition at line 172 of file DTBtiChip.h.

Referenced by config().

int DTBtiChip::_curStep [private]

Definition at line 185 of file DTBtiChip.h.

Referenced by currentIntStep(), currentStep(), init(), init_clock(), operator=(), and tick().

float DTBtiChip::_difs[25] [private]

Definition at line 190 of file DTBtiChip.h.

Referenced by DTBtiChip(), init(), init_clock(), and operator=().

std::vector<const DTDigi*> DTBtiChip::_digis[9] [private]

Definition at line 177 of file DTBtiChip.h.

Referenced by add_digi(), clear(), DTBtiChip(), get_CellDigis(), init(), nCellHit(), and operator=().

std::vector<int > DTBtiChip::_digis_clock[9] [private]

Definition at line 179 of file DTBtiChip.h.

Referenced by add_digi_clock(), clear(), and init_clock().

std::vector<DTBtiHit*> DTBtiChip::_hits[9] [private]

Definition at line 186 of file DTBtiChip.h.

Referenced by clear(), DTBtiChip(), init(), init_clock(), operator=(), and tick().

float DTBtiChip::_JTR[32][3] [private]

Definition at line 206 of file DTBtiChip.h.

Referenced by DTBtiChip(), and operator=().

float DTBtiChip::_Keq[32][6] [private]

Definition at line 191 of file DTBtiChip.h.

Referenced by DTBtiChip(), and operator=().

float DTBtiChip::_KTR[32][2] [private]

Definition at line 205 of file DTBtiChip.h.

Referenced by DTBtiChip(), and operator=().

int DTBtiChip::_MaxKAcc [private]

Definition at line 194 of file DTBtiChip.h.

Referenced by DTBtiChip(), operator=(), and store().

Definition at line 198 of file DTBtiChip.h.

Definition at line 196 of file DTBtiChip.h.

Definition at line 200 of file DTBtiChip.h.

int DTBtiChip::_MinKAcc [private]

Definition at line 193 of file DTBtiChip.h.

Referenced by DTBtiChip(), operator=(), and store().

Definition at line 197 of file DTBtiChip.h.

Definition at line 195 of file DTBtiChip.h.

Definition at line 199 of file DTBtiChip.h.

Definition at line 189 of file DTBtiChip.h.

Referenced by operator=(), run(), and tick().

float DTBtiChip::_sums[25] [private]

Definition at line 190 of file DTBtiChip.h.

Referenced by DTBtiChip(), init(), init_clock(), and operator=().

Definition at line 188 of file DTBtiChip.h.

Referenced by DTBtiChip(), init(), init_clock(), operator=(), store(), and tick().

Definition at line 187 of file DTBtiChip.h.

Referenced by DTBtiChip(), and operator=().

float DTBtiChip::_Xeq[32][2] [private]

Definition at line 192 of file DTBtiChip.h.

Referenced by DTBtiChip(), and operator=().

float DTBtiChip::_XeqAB_patt0 [private]

Definition at line 203 of file DTBtiChip.h.

float DTBtiChip::_XeqAC_patt0 [private]

Definition at line 202 of file DTBtiChip.h.

float DTBtiChip::_XeqBD_patt0 [private]

Definition at line 202 of file DTBtiChip.h.

float DTBtiChip::_XeqCD_patt0 [private]

Definition at line 203 of file DTBtiChip.h.

int DTBtiChip::init_done [private]

Definition at line 207 of file DTBtiChip.h.

Referenced by DTBtiChip(), init_clock(), and run().

int DTBtiChip::RE23 [private]

Definition at line 211 of file DTBtiChip.h.

Referenced by setSnap().

int DTBtiChip::RE43 [private]

Definition at line 211 of file DTBtiChip.h.

Referenced by setSnap().

int DTBtiChip::reSumAr[3][5] [private]

Definition at line 213 of file DTBtiChip.h.

Referenced by reSum().

int DTBtiChip::reSumAr23[3][5] [private]

Definition at line 214 of file DTBtiChip.h.

Referenced by reSum23().

int DTBtiChip::ST [private]

Definition at line 211 of file DTBtiChip.h.

Referenced by setSnap().

int DTBtiChip::ST2 [private]

Definition at line 211 of file DTBtiChip.h.

Referenced by setSnap().

int DTBtiChip::ST23 [private]

Definition at line 211 of file DTBtiChip.h.

Referenced by setSnap().

int DTBtiChip::ST3 [private]

Definition at line 211 of file DTBtiChip.h.

Referenced by setSnap().

int DTBtiChip::ST4 [private]

Definition at line 211 of file DTBtiChip.h.

Referenced by setSnap().

int DTBtiChip::ST43 [private]

Definition at line 211 of file DTBtiChip.h.

Referenced by setSnap().

int DTBtiChip::ST5 [private]

Definition at line 211 of file DTBtiChip.h.

Referenced by setSnap().

int DTBtiChip::ST7 [private]

Definition at line 211 of file DTBtiChip.h.

Referenced by setSnap().