CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
RPCDigiL1Link Class Reference

#include <RPCDigiL1Link.h>

Public Member Functions

int bx (unsigned int layer) const
 
bool empty () const
 
bool empty (unsigned int layer) const
 
unsigned int nlayer () const
 
unsigned int rawdetId (unsigned int layer) const
 
 RPCDigiL1Link ()
 
void setLink (unsigned int layer, unsigned int rpcdetId, int strip, int bx)
 
int strip (unsigned int layer) const
 
 ~RPCDigiL1Link ()
 

Private Member Functions

void checklayer (unsigned int layer) const
 

Private Attributes

std::vector< std::pair< unsigned int, int > > _link
 

Detailed Description

Definition at line 7 of file RPCDigiL1Link.h.

Constructor & Destructor Documentation

RPCDigiL1Link::RPCDigiL1Link ( )

Definition at line 4 of file RPCDigiL1Link.cc.

References _link, EnergyCorrector::c, and mps_fire::i.

5 {
6  for (unsigned int i=0;i<7;i++){
7  std::pair<unsigned int, int > c(0,0);
8  _link.push_back(c);
9  }
10 }
RPCDigiL1Link::~RPCDigiL1Link ( )

Definition at line 13 of file RPCDigiL1Link.cc.

14 {}

Member Function Documentation

int RPCDigiL1Link::bx ( unsigned int  layer) const

Definition at line 52 of file RPCDigiL1Link.cc.

References _link, and checklayer().

53 {
54  this->checklayer(layer);
55  return _link[layer-1].second/1000;
56 }
void RPCDigiL1Link::checklayer ( unsigned int  layer) const
private

Definition at line 81 of file RPCDigiL1Link.cc.

References Exception.

Referenced by bx(), empty(), rawdetId(), setLink(), and strip().

81  {
82  if (layer == 0 || layer > 6)
83  throw cms::Exception("RPCException")
84  <<"RPCDigiL1Link: layer must be in the range from 1 to 6"
85 <<std::endl;
86 }
bool RPCDigiL1Link::empty ( ) const

Definition at line 18 of file RPCDigiL1Link.cc.

References MillePedeFileConverter_cfg::e, and checklumidiff::l.

Referenced by Vispa.Gui.VispaWidget.TextField::setAutosizeFont(), and Vispa.Gui.VispaWidget.TextField::setAutotruncate().

19 {
20  bool e=true;
21  for (unsigned int l=1;l<=6;l++){
22  if (!this->empty(l)) e=false;
23  }
24  return e;
25 }
bool RPCDigiL1Link::empty ( unsigned int  layer) const

Definition at line 29 of file RPCDigiL1Link.cc.

References checklayer(), and rawdetId().

Referenced by Vispa.Gui.VispaWidget.TextField::setAutosizeFont(), and Vispa.Gui.VispaWidget.TextField::setAutotruncate().

30 {
31  this->checklayer(layer);
32  return this->rawdetId(layer)==0;
33 }
unsigned int RPCDigiL1Link::nlayer ( ) const

Definition at line 59 of file RPCDigiL1Link.cc.

References _link.

60 {
61  return _link.size()-1;
62 }
unsigned int RPCDigiL1Link::rawdetId ( unsigned int  layer) const

Definition at line 37 of file RPCDigiL1Link.cc.

References _link, and checklayer().

Referenced by empty().

38 {
39  this->checklayer(layer);
40  return _link[layer-1].first;
41 }
void RPCDigiL1Link::setLink ( unsigned int  layer,
unsigned int  rpcdetId,
int  strip,
int  bx 
)

Definition at line 66 of file RPCDigiL1Link.cc.

References _link, funct::abs(), checklayer(), DigiAPD_cff::pdigi, and strip().

Referenced by RPCTrigger::produce().

69 {
70  this->checklayer(layer);
71  int pdigi=abs(bx)*1000+strip;
72  if (bx<0)
73  pdigi*=-1;
74  std::pair<unsigned int, int> digi(rpcdetId,pdigi);
75  _link[layer-1]=digi;
76 
77 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int RPCDigiL1Link::strip ( unsigned int  layer) const

Definition at line 45 of file RPCDigiL1Link.cc.

References _link, funct::abs(), checklayer(), and edm::second().

Referenced by setLink().

46 {
47  this->checklayer(layer);
48  return abs(_link[layer-1].second)%1000;
49 }
U second(std::pair< T, U > const &p)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

std::vector< std::pair<unsigned int, int> > RPCDigiL1Link::_link
private

Definition at line 28 of file RPCDigiL1Link.h.

Referenced by bx(), nlayer(), rawdetId(), RPCDigiL1Link(), setLink(), and strip().