CMS 3D CMS Logo

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

#include <EcalTBHodoscopePlaneRawHits.h>

Public Member Functions

void addHit (unsigned int i)
 
unsigned int channels () const
 Get Methods. More...
 
 EcalTBHodoscopePlaneRawHits ()
 
 EcalTBHodoscopePlaneRawHits (unsigned int channels)
 
const std::vector< bool > & hits () const
 
bool isChannelFired (unsigned int i) const
 
unsigned int numberOfFiredHits () const
 
bool operator[] (unsigned int i) const
 
void setChannels (unsigned int size)
 Set methods. More...
 
void setHit (unsigned int i, bool status)
 

Private Attributes

std::vector< bool > rawChannelHits_
 

Detailed Description

Simple container for rawHits

Definition at line 15 of file EcalTBHodoscopePlaneRawHits.h.

Constructor & Destructor Documentation

EcalTBHodoscopePlaneRawHits::EcalTBHodoscopePlaneRawHits ( )
inline

Definition at line 17 of file EcalTBHodoscopePlaneRawHits.h.

17 : rawChannelHits_(0) {};
EcalTBHodoscopePlaneRawHits::EcalTBHodoscopePlaneRawHits ( unsigned int  channels)
inline

Definition at line 19 of file EcalTBHodoscopePlaneRawHits.h.

References channels(), mps_fire::i, and rawChannelHits_.

20  {
21  rawChannelHits_.reserve(channels);
22  for (unsigned int i=0;i<channels;i++)
23  rawChannelHits_[i]=0;
24  }
unsigned int channels() const
Get Methods.

Member Function Documentation

void EcalTBHodoscopePlaneRawHits::addHit ( unsigned int  i)
inline

Definition at line 48 of file EcalTBHodoscopePlaneRawHits.h.

References mps_fire::i, and rawChannelHits_.

Referenced by FakeTBHodoscopeRawInfoProducer::produce().

49  {
50  if (rawChannelHits_.size() < i+1 )
51  rawChannelHits_.resize(i+1);
52  rawChannelHits_[i]=true;
53  };
unsigned int EcalTBHodoscopePlaneRawHits::channels ( ) const
inline

Get Methods.

Definition at line 27 of file EcalTBHodoscopePlaneRawHits.h.

References rawChannelHits_.

Referenced by EcalTBHodoscopePlaneRawHits(), and operator<<().

27 { return rawChannelHits_.size(); }
const std::vector<bool>& EcalTBHodoscopePlaneRawHits::hits ( void  ) const
inline
bool EcalTBHodoscopePlaneRawHits::isChannelFired ( unsigned int  i) const
inline

Definition at line 40 of file EcalTBHodoscopePlaneRawHits.h.

References mps_fire::i, and rawChannelHits_.

40 { return rawChannelHits_[i]; }
unsigned int EcalTBHodoscopePlaneRawHits::numberOfFiredHits ( ) const
inline

Definition at line 30 of file EcalTBHodoscopePlaneRawHits.h.

References mps_fire::i, and rawChannelHits_.

31  {
32  int numberOfHits=0;
33  for (unsigned int i=0;i<rawChannelHits_.size();i++)
34  if (rawChannelHits_[i])
35  numberOfHits++;
36  return numberOfHits;
37  }
bool EcalTBHodoscopePlaneRawHits::operator[] ( unsigned int  i) const
inline

Definition at line 39 of file EcalTBHodoscopePlaneRawHits.h.

References mps_fire::i, and rawChannelHits_.

39 { return rawChannelHits_[i]; }
void EcalTBHodoscopePlaneRawHits::setChannels ( unsigned int  size)
inline

Set methods.

Definition at line 43 of file EcalTBHodoscopePlaneRawHits.h.

References rawChannelHits_.

Referenced by CamacTBDataFormatter::interpretRawData().

44  {
45  rawChannelHits_.resize(size);
46  };
size
Write out results.
void EcalTBHodoscopePlaneRawHits::setHit ( unsigned int  i,
bool  status 
)
inline

Member Data Documentation

std::vector<bool> EcalTBHodoscopePlaneRawHits::rawChannelHits_
private