CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

DTTSTheta Class Reference

#include <DTTSTheta.h>

Inheritance diagram for DTTSTheta:
DTCache< T, Coll > DTGeomSupplier

List of all members.

Public Member Functions

DTConfigTSThetaconfig () const
 Return configuration.
 DTTSTheta (DTTrigGeom *, DTBtiCard *)
 Constructor.
LocalVector localDirection (const DTTrigData *) const
 Local direction in chamber of a L1Trigger-data object.
LocalPoint localPosition (const DTTrigData *) const
 Local position in chamber of a L1Trigger-data object.
int nHTrig (int step)
 Return number of DTBtiChip fired with a HTRIG (used by DTTracoChip)
int nSegm (int step)
 Return number of TStheta segments (just 1)
int nTrig (int step)
 Return number of DTBtiChip fired (used by DTTracoChip)
void print (const DTTrigData *trig) const
 Print a L1Trigger-data object with also local and global position/direction.
void reconstruct ()
 Load BTIs triggers and run TSTheta algoritm.
const DTChambThSegmsegment (int step, unsigned n)
 Return the requested DTTSTheta segment (only the first)
void setConfig (const DTConfigManager *conf)
 Set configuration.
 ~DTTSTheta ()
 Destructor.

Private Member Functions

void add_btiT (int step, const DTBtiTrigData *btitrig)
 Add a DTBtiChip L1Trigger to the DTTSTheta.
BitArray
< DTConfigTSTheta::NCELLTH > * 
btiMask (int step) const
 Return the BitArray of DTBtiChip fired.
BitArray
< DTConfigTSTheta::NCELLTH > * 
btiQual (int step) const
 Return the BitArray of DTBtiChip fired with a HTRIG.
void loadDTTSTheta ()
 store DTBtiChip L1Triggers in the TST
void localClear ()
 Clear.
void runDTTSTheta ()
 run DTTSTheta algorithm (build the mask)

Private Attributes

DTBtiCard_bticard
DTConfigTSTheta_config
BitArray
< DTConfigTSTheta::NCELLTH
_Htrig [DTConfigTSTheta::NSTEPL-DTConfigTSTheta::NSTEPF+1]
int _nHtrig [DTConfigTSTheta::NSTEPL-DTConfigTSTheta::NSTEPF+1]
int _ntrig [DTConfigTSTheta::NSTEPL-DTConfigTSTheta::NSTEPF+1]
BitArray
< DTConfigTSTheta::NCELLTH
_trig [DTConfigTSTheta::NSTEPL-DTConfigTSTheta::NSTEPF+1]

Detailed Description

Implementation of TS Theta L1Trigger algorithm

Date:
2008/09/05 15:57:29
Revision:
1.7
Author:
C.Grandi

Definition at line 46 of file DTTSTheta.h.


Constructor & Destructor Documentation

DTTSTheta::DTTSTheta ( DTTrigGeom geom,
DTBtiCard bticard 
)

Constructor.

Definition at line 37 of file DTTSTheta.cc.

References _Htrig, _nHtrig, _ntrig, _trig, i, DTConfig::NSTEPF, DTConfig::NSTEPL, and BitArray< N >::zero().

                                                         : 
  DTGeomSupplier(geom),  _bticard(bticard) {

  for(int i=0;i<DTConfigTSTheta::NSTEPL-DTConfigTSTheta::NSTEPF+1;i++){
    _trig[i].zero();
    _Htrig[i].zero();
    _ntrig[i] = 0;
    _nHtrig[i] = 0;
  }

}
DTTSTheta::~DTTSTheta ( )

Destructor.

Definition at line 53 of file DTTSTheta.cc.

                     {
  //delete _config;
}

Member Function Documentation

void DTTSTheta::add_btiT ( int  step,
const DTBtiTrigData btitrig 
) [private]

Add a DTBtiChip L1Trigger to the DTTSTheta.

Definition at line 107 of file DTTSTheta.cc.

References _Htrig, _nHtrig, _ntrig, _trig, DTBtiTrigData::btiNumber(), DTBtiTrigData::code(), config(), gather_cfg::cout, debug, DTGeomSupplier::geom(), n, DTConfig::NSTEPF, DTConfig::NSTEPL, BitArray< N >::set(), and relval_parameters_module::step.

Referenced by loadDTTSTheta().

                                                         {
  int n = btitrig->btiNumber();

/*
OBSOLETE! in NEWGEO the bti number order is the correct one!
  // check where the BTI is, and reverse the order in stat 1 and 2 and 3 (only for some sectors)

  if( (wheel()==0 && (sector()==1 ||  sector()==4 || sector()==5 ||
                      sector()==8 || sector()==9 || sector()==12))
      || wheel()==-1 
      || wheel()==-2)
    {n=DTConfigTSTheta::NCELLTH + 1 - n; }
  
*/

  if( n<1 || n>geom()->nCell(2) ) {
    std::cout << "DTTSTheta::add_btiT: BTI out of range: " << n;
    std::cout << " trigger not added!" << std::endl;
    return;
  }
  if(step<DTConfigTSTheta::NSTEPF||step>DTConfigTSTheta::NSTEPL){
    std::cout << "DTTSTheta::add_btiT: step out of range: " << step;
    std::cout << " trigger not added!" << std::endl;
    return;
  }
  _trig[step-DTConfigTSTheta::NSTEPF].set(n-1);
  _ntrig[step-DTConfigTSTheta::NSTEPF]++;

  if(btitrig->code()==8){
    _Htrig[step-DTConfigTSTheta::NSTEPF].set(n-1);
    _nHtrig[step-DTConfigTSTheta::NSTEPF]++;
  }

  if(config()->debug()){
    std::cout << "BTI Trigger added at step " << step;
    std::cout << " to DTTSTheta at position " << n <<  std::endl;
  }
  return;
}
BitArray< DTConfigTSTheta::NCELLTH > * DTTSTheta::btiMask ( int  step) const [private]

Return the BitArray of DTBtiChip fired.

Definition at line 254 of file DTTSTheta.cc.

References _trig, gather_cfg::cout, DTConfig::NSTEPF, DTConfig::NSTEPL, and relval_parameters_module::step.

Referenced by runDTTSTheta().

                                 {
  if(step<DTConfigTSTheta::NSTEPF||step>DTConfigTSTheta::NSTEPL){
    std::cout << "DTTSTheta::btiMask: step out of range " << step;
    std::cout << " empty pointer returned" << std::endl;
    return 0;
  }
  return (BitArray<DTConfigTSTheta::NCELLTH>*)&_trig[step-DTConfigTSTheta::NSTEPF]; 
}
BitArray< DTConfigTSTheta::NCELLTH > * DTTSTheta::btiQual ( int  step) const [private]

Return the BitArray of DTBtiChip fired with a HTRIG.

Definition at line 264 of file DTTSTheta.cc.

References _Htrig, gather_cfg::cout, DTConfig::NSTEPF, DTConfig::NSTEPL, and relval_parameters_module::step.

Referenced by runDTTSTheta().

                                 {
  if(step<DTConfigTSTheta::NSTEPF||step>DTConfigTSTheta::NSTEPL){
    std::cout << "DTTSTheta::btiQual: step out of range " << step;
    std::cout << " empty pointer returned" << std::endl;
    return 0;
  }
  return (BitArray<DTConfigTSTheta::NCELLTH>*)&_Htrig[step-DTConfigTSTheta::NSTEPF]; 
}
DTConfigTSTheta* DTTSTheta::config ( void  ) const [inline]

Return configuration.

Definition at line 58 of file DTTSTheta.h.

References _config.

Referenced by add_btiT(), loadDTTSTheta(), and runDTTSTheta().

{ return _config; }
void DTTSTheta::loadDTTSTheta ( ) [private]

store DTBtiChip L1Triggers in the TST

Definition at line 82 of file DTTSTheta.cc.

References _bticard, add_btiT(), DTCache< T, Coll >::begin(), config(), gather_cfg::cout, debug, DTCache< T, Coll >::end(), localClear(), AlCaHLTBitMon_ParallelJobs::p, DTGeomSupplier::sector(), DTGeomSupplier::station(), relval_parameters_module::step, and DTGeomSupplier::wheel().

Referenced by reconstruct().

                         {
  localClear();
  if(station()==4)return;
 
  if(config()->debug()){
    std::cout << "DTTSTheta::loadDTTSTheta called for wheel=" << wheel() ;
    std::cout <<                                ", station=" << station();
    std::cout <<                                ", sector="  << sector() << std::endl;
  }

  // loop on all BTI triggers
  std::vector<DTBtiTrigData>::const_iterator p;
  std::vector<DTBtiTrigData>::const_iterator pend=_bticard->end();
  for(p=_bticard->begin();p!=pend;p++){
    // Look only to BTIs in SL 2
    if (p->btiSL() == 2) {
      // BTI number
      int step = p->step();
      add_btiT( step, &(*p) );
    }
  }

}
void DTTSTheta::localClear ( ) [private]

Clear.

Definition at line 63 of file DTTSTheta.cc.

References _Htrig, _nHtrig, _ntrig, _trig, DTConfig::NSTEPF, DTConfig::NSTEPL, and BitArray< N >::zero().

Referenced by loadDTTSTheta().

                      {
  for(int is=0;is<DTConfigTSTheta::NSTEPL-DTConfigTSTheta::NSTEPF+1;is++){
    // clear input bit masks
    _trig[is].zero();
    _Htrig[is].zero();
    _ntrig[is] = 0;
    _nHtrig[is] = 0;
  }
}
LocalVector DTTSTheta::localDirection ( const DTTrigData tr) const [virtual]

Local direction in chamber of a L1Trigger-data object.

Implements DTGeomSupplier.

Definition at line 281 of file DTTSTheta.cc.

                                                     {
  //const DTChambThSegm* trig = dynamic_cast<const DTChambThSegm*>(tr);
  //@@ Not implemented yet
  return LocalVector(0,0,0);
}
LocalPoint DTTSTheta::localPosition ( const DTTrigData tr) const [virtual]

Local position in chamber of a L1Trigger-data object.

Implements DTGeomSupplier.

Definition at line 274 of file DTTSTheta.cc.

                                                   {
  //const DTChambThSegm* trig = dynamic_cast<const DTChambThSegm*>(tr);
  //@@ Not implemented yet
  return LocalPoint(0,0,0);
}
int DTTSTheta::nHTrig ( int  step)

Return number of DTBtiChip fired with a HTRIG (used by DTTracoChip)

Definition at line 243 of file DTTSTheta.cc.

References _nHtrig, gather_cfg::cout, DTConfig::NSTEPF, DTConfig::NSTEPL, DTCache< T, Coll >::size(), and relval_parameters_module::step.

Referenced by DTTracoChip::storeUncorr().

                          { 
  if(step<DTConfigTSTheta::NSTEPF||step>DTConfigTSTheta::NSTEPL){
    std::cout << "DTTSTheta::nHTrig: step out of range " << step;
    std::cout << " 0 returned" << std::endl;
    return 0;
  }
  if(size()>0) return _nHtrig[step-DTConfigTSTheta::NSTEPF]; 
  return 0;
}
int DTTSTheta::nSegm ( int  step)

Return number of TStheta segments (just 1)

Definition at line 212 of file DTTSTheta.cc.

References DTCache< T, Coll >::begin(), DTCache< T, Coll >::end(), n, AlCaHLTBitMon_ParallelJobs::p, and relval_parameters_module::step.

Referenced by DTSCTrigUnit::nThetaSegm().

                         {
  int n=0;
  std::vector<DTChambThSegm>::const_iterator p;
  for(p=begin(); p<end(); p++) {
    if(p->step()==step)n++;
  }
  return n;
}
int DTTSTheta::nTrig ( int  step)

Return number of DTBtiChip fired (used by DTTracoChip)

Definition at line 232 of file DTTSTheta.cc.

References _ntrig, gather_cfg::cout, DTConfig::NSTEPF, DTConfig::NSTEPL, DTCache< T, Coll >::size(), and relval_parameters_module::step.

Referenced by DTTracoChip::storeUncorr().

                         {
  if(step<DTConfigTSTheta::NSTEPF||step>DTConfigTSTheta::NSTEPL){
    std::cout << "DTTSTheta::nTrig: step out of range " << step;
    std::cout << " 0 returned" << std::endl;
    return 0;
  }
  if(size()>0) return _ntrig[step-DTConfigTSTheta::NSTEPF];
  return 0;
}
void DTTSTheta::print ( const DTTrigData trig) const [virtual]

Print a L1Trigger-data object with also local and global position/direction.

Reimplemented from DTGeomSupplier.

Definition at line 288 of file DTTSTheta.cc.

References DTTrigData::print().

                                             {
  trig->print();
  //@@ coordinate printing not implemented yet
  //@@ rermove this method as soon as the local coordinates are meaningful
  
}
void DTTSTheta::reconstruct ( ) [inline, virtual]

Load BTIs triggers and run TSTheta algoritm.

Reimplemented from DTCache< T, Coll >.

Definition at line 85 of file DTTSTheta.h.

References loadDTTSTheta(), and runDTTSTheta().

Referenced by DTTrig::triggerReco().

void DTTSTheta::runDTTSTheta ( ) [private]

run DTTSTheta algorithm (build the mask)

Definition at line 148 of file DTTSTheta.cc.

References DTCache< T, Coll >::_cache, _ntrig, BitArray< N >::any(), btiMask(), btiQual(), BitArray< N >::byte(), DTGeomSupplier::ChamberId(), config(), gather_cfg::cout, debug, i, DTConfig::NSTEPF, DTConfig::NSTEPL, AlCaHLTBitMon_ParallelJobs::p, pos, DTGeomSupplier::sector(), DTGeomSupplier::station(), and DTGeomSupplier::wheel().

Referenced by reconstruct().

                        {
  // Just make a DTChambThSegm for each step and store it
  for(int is=DTConfigTSTheta::NSTEPF;is<DTConfigTSTheta::NSTEPL+1;is++) {
    if(_ntrig[is-DTConfigTSTheta::NSTEPF]>0) {
      int i=0;
      int code[8];
      int pos[8];
      int qual[8];
      for(i=0;i<8;i++) {
        //@@ MULT not implemented:
        pos[i]=btiMask(is)->byte(i).any();
        qual[i]=btiQual(is)->byte(i).any();
        code[i]=pos[i]+qual[i];
      }

      // SM .OR. response of BTI number 57 in previous group of 8 BTIs 

      if(pos[7] > pos[6])    pos[6]=pos[7];
      if(qual[7] > qual[6])   qual[6]=qual[7]; 
      if(code[7] > code[6])   code[6]=code[7]; 

      
      if(config()->debug()){
      std::cout  << " wheel = " << wheel() << " station = " << station() << " sector = " << sector() << std::endl;
        std::cout << " pos :  ";
        for(i=0;i<8;i++) {
          std::cout << pos[i] << " ";
        }
        std::cout << std::endl;
        std::cout << " qual :  ";
        for(i=0;i<8;i++) {
          std::cout << qual[i] << " ";
        }
        std::cout << std::endl;
        std::cout << " code :  ";
        for(i=0;i<8;i++) {
          std::cout << code[i] << " ";

        }
        std::cout << std::endl;
        std::cout << std::endl;
      }

      _cache.push_back(DTChambThSegm(ChamberId(),is,pos,qual));
    }
  }

  // debugging...
  if(config()->debug()){
    if(_cache.size()>0){
      std::cout << "====================================================" << std::endl;
      std::cout << "                 Theta segments                     " << std::endl;
      std::vector<DTChambThSegm>::const_iterator p;
      for(p=_cache.begin();p<_cache.end();p++) {
        p->print();
      }
      std::cout << "====================================================" << std::endl;
    }
  }
  // end debugging
  
}
const DTChambThSegm * DTTSTheta::segment ( int  step,
unsigned  n 
)

Return the requested DTTSTheta segment (only the first)

Definition at line 222 of file DTTSTheta.cc.

References DTCache< T, Coll >::begin(), DTCache< T, Coll >::end(), and AlCaHLTBitMon_ParallelJobs::p.

Referenced by DTSCTrigUnit::thetaSegment().

                                       {
  std::vector<DTChambThSegm>::const_iterator p;
  for(p=begin();p<end();p++){
    if(p->step()==step&&n==1)
      return &(*p);
  }
  return 0;
}
void DTTSTheta::setConfig ( const DTConfigManager conf)

Set configuration.

Definition at line 110 of file DTLocalTriggerBaseTest.cc.

References python::rootplot::argparse::category, edm::ParameterSet::getUntrackedParameter(), LogTrace, mergeVDriftHistosByStation::name, nevents, cppFunctionSkipper::operator, Parameters::parameters, and dtDQMClient_cfg::prescaleFactor.

Referenced by DTSCTrigUnit::setConfig().

                                                                            {

  testName=name;

  LogTrace(category()) << "[" << testName << "Test]: Constructor";

  sourceFolder = ps.getUntrackedParameter<string>("folderRoot", ""); 
  runOnline = ps.getUntrackedParameter<bool>("runOnline",true);
  hwSources = ps.getUntrackedParameter<vector<string> >("hwSources");

  if (ps.getUntrackedParameter<bool>("localrun",true)) {
    trigSources.push_back("");
  }
  else {
    trigSources = ps.getUntrackedParameter<vector<string> >("trigSources");
  }

  parameters = ps;
  nevents = 0;
  dbe = edm::Service<DQMStore>().operator->();

  prescaleFactor = parameters.getUntrackedParameter<int>("diagnosticPrescale", 1);

}

Member Data Documentation

Definition at line 109 of file DTTSTheta.h.

Referenced by loadDTTSTheta().

Definition at line 111 of file DTTSTheta.h.

Referenced by config().

Definition at line 115 of file DTTSTheta.h.

Referenced by add_btiT(), btiQual(), DTTSTheta(), and localClear().

Definition at line 117 of file DTTSTheta.h.

Referenced by add_btiT(), DTTSTheta(), localClear(), and nHTrig().

Definition at line 116 of file DTTSTheta.h.

Referenced by add_btiT(), DTTSTheta(), localClear(), nTrig(), and runDTTSTheta().

Definition at line 114 of file DTTSTheta.h.

Referenced by add_btiT(), btiMask(), DTTSTheta(), and localClear().