CMS 3D CMS Logo

DTTSTheta Class Reference

Implementation of TS Theta L1Trigger algorithm. More...

#include <L1Trigger/DTTriggerServerTheta/interface/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().

00037                                                          : 
00038   DTGeomSupplier(geom),  _bticard(bticard) {
00039 
00040   for(int i=0;i<DTConfigTSTheta::NSTEPL-DTConfigTSTheta::NSTEPF+1;i++){
00041     _trig[i].zero();
00042     _Htrig[i].zero();
00043     _ntrig[i] = 0;
00044     _nHtrig[i] = 0;
00045   }
00046 
00047 }

DTTSTheta::~DTTSTheta (  ) 

Destructor.

Definition at line 53 of file DTTSTheta.cc.

00053                      {
00054   //delete _config;
00055 }


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(), GenMuonPlsPt100GeV_cfg::cout, debug, lat::endl(), DTGeomSupplier::geom(), n, DTConfig::NSTEPF, DTConfig::NSTEPL, and BitArray< N >::set().

Referenced by loadDTTSTheta().

00107                                                          {
00108   int n = btitrig->btiNumber();
00109 
00110 /*
00111 OBSOLETE! in NEWGEO the bti number order is the correct one!
00112   // check where the BTI is, and reverse the order in stat 1 and 2 and 3 (only for some sectors)
00113 
00114   if( (wheel()==0 && (sector()==1 ||  sector()==4 || sector()==5 ||
00115                       sector()==8 || sector()==9 || sector()==12))
00116       || wheel()==-1 
00117       || wheel()==-2)
00118     {n=DTConfigTSTheta::NCELLTH + 1 - n; }
00119   
00120 */
00121 
00122   if( n<1 || n>geom()->nCell(2) ) {
00123     std::cout << "DTTSTheta::add_btiT: BTI out of range: " << n;
00124     std::cout << " trigger not added!" << std::endl;
00125     return;
00126   }
00127   if(step<DTConfigTSTheta::NSTEPF||step>DTConfigTSTheta::NSTEPL){
00128     std::cout << "DTTSTheta::add_btiT: step out of range: " << step;
00129     std::cout << " trigger not added!" << std::endl;
00130     return;
00131   }
00132   _trig[step-DTConfigTSTheta::NSTEPF].set(n-1);
00133   _ntrig[step-DTConfigTSTheta::NSTEPF]++;
00134 
00135   if(btitrig->code()==8){
00136     _Htrig[step-DTConfigTSTheta::NSTEPF].set(n-1);
00137     _nHtrig[step-DTConfigTSTheta::NSTEPF]++;
00138   }
00139 
00140   if(config()->debug()){
00141     std::cout << "BTI Trigger added at step " << step;
00142     std::cout << " to DTTSTheta at position " << n <<  std::endl;
00143   }
00144   return;
00145 }

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, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), DTConfig::NSTEPF, and DTConfig::NSTEPL.

Referenced by runDTTSTheta().

00254                                  {
00255   if(step<DTConfigTSTheta::NSTEPF||step>DTConfigTSTheta::NSTEPL){
00256     std::cout << "DTTSTheta::btiMask: step out of range " << step;
00257     std::cout << " empty pointer returned" << std::endl;
00258     return 0;
00259   }
00260   return (BitArray<DTConfigTSTheta::NCELLTH>*)&_trig[step-DTConfigTSTheta::NSTEPF]; 
00261 }

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, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), DTConfig::NSTEPF, and DTConfig::NSTEPL.

Referenced by runDTTSTheta().

00264                                  {
00265   if(step<DTConfigTSTheta::NSTEPF||step>DTConfigTSTheta::NSTEPL){
00266     std::cout << "DTTSTheta::btiQual: step out of range " << step;
00267     std::cout << " empty pointer returned" << std::endl;
00268     return 0;
00269   }
00270   return (BitArray<DTConfigTSTheta::NCELLTH>*)&_Htrig[step-DTConfigTSTheta::NSTEPF]; 
00271 }

DTConfigTSTheta* DTTSTheta::config (  )  const [inline]

Return configuration.

Definition at line 58 of file DTTSTheta.h.

References _config.

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

00058 { 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(), GenMuonPlsPt100GeV_cfg::cout, debug, DTCache< T, Coll >::end(), lat::endl(), localClear(), p, DTGeomSupplier::sector(), DTGeomSupplier::station(), cmsRelvalreportInput::step, and DTGeomSupplier::wheel().

Referenced by reconstruct().

00082                          {
00083   localClear();
00084   if(station()==4)return;
00085  
00086   if(config()->debug()){
00087     std::cout << "DTTSTheta::loadDTTSTheta called for wheel=" << wheel() ;
00088     std::cout <<                                ", station=" << station();
00089     std::cout <<                                ", sector="  << sector() << std::endl;
00090   }
00091 
00092   // loop on all BTI triggers
00093   std::vector<DTBtiTrigData>::const_iterator p;
00094   std::vector<DTBtiTrigData>::const_iterator pend=_bticard->end();
00095   for(p=_bticard->begin();p!=pend;p++){
00096     // Look only to BTIs in SL 2
00097     if (p->btiSL() == 2) {
00098       // BTI number
00099       int step = p->step();
00100       add_btiT( step, &(*p) );
00101     }
00102   }
00103 
00104 }

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().

00063                       {
00064   for(int is=0;is<DTConfigTSTheta::NSTEPL-DTConfigTSTheta::NSTEPF+1;is++){
00065     // clear input bit masks
00066     _trig[is].zero();
00067     _Htrig[is].zero();
00068     _ntrig[is] = 0;
00069     _nHtrig[is] = 0;
00070   }
00071 }

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.

00281                                                      {
00282   //const DTChambThSegm* trig = dynamic_cast<const DTChambThSegm*>(tr);
00283   //@@ Not implemented yet
00284   return LocalVector(0,0,0);
00285 }

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.

00274                                                    {
00275   //const DTChambThSegm* trig = dynamic_cast<const DTChambThSegm*>(tr);
00276   //@@ Not implemented yet
00277   return LocalPoint(0,0,0);
00278 }

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, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), DTConfig::NSTEPF, DTConfig::NSTEPL, and DTCache< T, Coll >::size().

Referenced by DTTracoChip::storeUncorr().

00243                           { 
00244   if(step<DTConfigTSTheta::NSTEPF||step>DTConfigTSTheta::NSTEPL){
00245     std::cout << "DTTSTheta::nHTrig: step out of range " << step;
00246     std::cout << " 0 returned" << std::endl;
00247     return 0;
00248   }
00249   if(size()>0) return _nHtrig[step-DTConfigTSTheta::NSTEPF]; 
00250   return 0;
00251 }

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, and p.

Referenced by DTSCTrigUnit::nThetaSegm().

00212                          {
00213   int n=0;
00214   std::vector<DTChambThSegm>::const_iterator p;
00215   for(p=begin(); p<end(); p++) {
00216     if(p->step()==step)n++;
00217   }
00218   return n;
00219 }

int DTTSTheta::nTrig ( int  step  ) 

Return number of DTBtiChip fired (used by DTTracoChip).

Definition at line 232 of file DTTSTheta.cc.

References _ntrig, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), DTConfig::NSTEPF, DTConfig::NSTEPL, and DTCache< T, Coll >::size().

Referenced by DTTracoChip::storeUncorr().

00232                          {
00233   if(step<DTConfigTSTheta::NSTEPF||step>DTConfigTSTheta::NSTEPL){
00234     std::cout << "DTTSTheta::nTrig: step out of range " << step;
00235     std::cout << " 0 returned" << std::endl;
00236     return 0;
00237   }
00238   if(size()>0) return _ntrig[step-DTConfigTSTheta::NSTEPF];
00239   return 0;
00240 }

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().

00288                                              {
00289   trig->print();
00290   //@@ coordinate printing not implemented yet
00291   //@@ rermove this method as soon as the local coordinates are meaningful
00292   
00293 }

void DTTSTheta::reconstruct ( void   )  [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().

00085 { loadDTTSTheta(); runDTTSTheta(); }

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(), code, config(), GenMuonPlsPt100GeV_cfg::cout, debug, lat::endl(), i, DTConfig::NSTEPF, DTConfig::NSTEPL, p, DTGeomSupplier::sector(), DTGeomSupplier::station(), and DTGeomSupplier::wheel().

Referenced by reconstruct().

00148                         {
00149   // Just make a DTChambThSegm for each step and store it
00150   for(int is=DTConfigTSTheta::NSTEPF;is<DTConfigTSTheta::NSTEPL+1;is++) {
00151     if(_ntrig[is-DTConfigTSTheta::NSTEPF]>0) {
00152       int i=0;
00153       int code[8];
00154       int pos[8];
00155       int qual[8];
00156       for(i=0;i<8;i++) {
00157         //@@ MULT not implemented:
00158         pos[i]=btiMask(is)->byte(i).any();
00159         qual[i]=btiQual(is)->byte(i).any();
00160         code[i]=pos[i]+qual[i];
00161       }
00162 
00163       // SM .OR. response of BTI number 57 in previous group of 8 BTIs 
00164 
00165       if(pos[7] > pos[6])    pos[6]=pos[7];
00166       if(qual[7] > qual[6])   qual[6]=qual[7]; 
00167       if(code[7] > code[6])   code[6]=code[7]; 
00168 
00169       
00170       if(config()->debug()){
00171       std::cout  << " wheel = " << wheel() << " station = " << station() << " sector = " << sector() << std::endl;
00172         std::cout << " pos :  ";
00173         for(i=0;i<8;i++) {
00174           std::cout << pos[i] << " ";
00175         }
00176         std::cout << std::endl;
00177         std::cout << " qual :  ";
00178         for(i=0;i<8;i++) {
00179           std::cout << qual[i] << " ";
00180         }
00181         std::cout << std::endl;
00182         std::cout << " code :  ";
00183         for(i=0;i<8;i++) {
00184           std::cout << code[i] << " ";
00185 
00186         }
00187         std::cout << std::endl;
00188         std::cout << std::endl;
00189       }
00190 
00191       _cache.push_back(DTChambThSegm(ChamberId(),is,pos,qual));
00192     }
00193   }
00194 
00195   // debugging...
00196   if(config()->debug()){
00197     if(_cache.size()>0){
00198       std::cout << "====================================================" << std::endl;
00199       std::cout << "                 Theta segments                     " << std::endl;
00200       std::vector<DTChambThSegm>::const_iterator p;
00201       for(p=_cache.begin();p<_cache.end();p++) {
00202         p->print();
00203       }
00204       std::cout << "====================================================" << std::endl;
00205     }
00206   }
00207   // end debugging
00208   
00209 }

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 p.

Referenced by DTSCTrigUnit::thetaSegment().

00222                                        {
00223   std::vector<DTChambThSegm>::const_iterator p;
00224   for(p=begin();p<end();p++){
00225     if(p->step()==step&&n==1)
00226       return &(*p);
00227   }
00228   return 0;
00229 }

void DTTSTheta::setConfig ( const DTConfigManager conf  ) 

Set configuration.

Definition at line 74 of file DTTSTheta.cc.

References _config, DTGeomSupplier::ChamberId(), and DTConfigManager::getDTConfigTSTheta().

Referenced by DTSCTrigUnit::setConfig().

00074                                                {
00075   
00076         DTChamberId sid = ChamberId();
00077         _config = conf->getDTConfigTSTheta(sid);
00078 
00079 }


Member Data Documentation

DTBtiCard* DTTSTheta::_bticard [private]

Definition at line 109 of file DTTSTheta.h.

Referenced by loadDTTSTheta().

DTConfigTSTheta* DTTSTheta::_config [private]

Definition at line 111 of file DTTSTheta.h.

Referenced by config(), and setConfig().

BitArray<DTConfigTSTheta::NCELLTH> DTTSTheta::_Htrig[DTConfigTSTheta::NSTEPL-DTConfigTSTheta::NSTEPF+1] [private]

Definition at line 115 of file DTTSTheta.h.

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

int DTTSTheta::_nHtrig[DTConfigTSTheta::NSTEPL-DTConfigTSTheta::NSTEPF+1] [private]

Definition at line 117 of file DTTSTheta.h.

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

int DTTSTheta::_ntrig[DTConfigTSTheta::NSTEPL-DTConfigTSTheta::NSTEPF+1] [private]

Definition at line 116 of file DTTSTheta.h.

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

BitArray<DTConfigTSTheta::NCELLTH> DTTSTheta::_trig[DTConfigTSTheta::NSTEPL-DTConfigTSTheta::NSTEPF+1] [private]

Definition at line 114 of file DTTSTheta.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:19:10 2009 for CMSSW by  doxygen 1.5.4