CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
TotemSampicFrame Class Reference

#include <TotemSampicFrame.h>

Public Member Functions

uint16_t getBunchNumber () const
 
uint16_t getCellInfo () const
 
uint16_t getChannelMap () const
 
int getDetChannel () const
 
int getDetPlane () const
 
uint8_t getEventHardwareId () const
 
uint32_t getEventNumber () const
 
uint64_t getFPGATimestamp () const
 
uint8_t getFWVersion () const
 
uint8_t getHardwareId () const
 
uint16_t getL1ALatency () const
 
uint64_t getL1ATimestamp () const
 
unsigned int getNumberOfSamples () const
 
uint8_t getNumberOfSentSamples () const
 
uint8_t getOffsetOfSamples () const
 
uint32_t getOrbitNumber () const
 
uint8_t getPLLInfo () const
 
const std::vector< uint8_t > getSamples () const
 
uint16_t getTimestampA () const
 
uint16_t getTimestampB () const
 
void print () const
 
void printRaw (bool binary=false) const
 
 TotemSampicFrame (const uint8_t *chInfoPtr, const uint8_t *chDataPtr, const uint8_t *eventInfoPtr)
 
bool valid () const
 
 ~TotemSampicFrame ()
 

Protected Member Functions

void printRawBuffer (const uint16_t *buffer, const bool binary=false, const unsigned int size=12) const
 

Protected Attributes

int status_
 
const uint8_t * totemSampicDataPtr_
 
const uint8_t * totemSampicEventInfoPtr_
 
const uint8_t * totemSampicInfoPtr_
 

Detailed Description

This class is intended to handle the timing infromation of SAMPIC in the TOTEM implementation

Definition at line 71 of file TotemSampicFrame.h.

Constructor & Destructor Documentation

TotemSampicFrame::TotemSampicFrame ( const uint8_t *  chInfoPtr,
const uint8_t *  chDataPtr,
const uint8_t *  eventInfoPtr 
)
inline

Definition at line 74 of file TotemSampicFrame.h.

References controlBits3, controlBits3_Position, status_, and totemSampicInfoPtr_.

74  :
75  totemSampicInfoPtr_( chInfoPtr ), totemSampicDataPtr_( chDataPtr ), totemSampicEventInfoPtr_( eventInfoPtr ),
76  status_( 0 ) {
77  if ( chInfoPtr != nullptr && chDataPtr != nullptr && eventInfoPtr != nullptr && totemSampicInfoPtr_[ TotemSampicConstant::controlBits3_Position ] == TotemSampicConstant::controlBits3 )
78  status_ = 1;
79  }
const uint8_t * totemSampicInfoPtr_
const uint8_t * totemSampicEventInfoPtr_
const uint8_t * totemSampicDataPtr_
TotemSampicFrame::~TotemSampicFrame ( )
inline

Definition at line 80 of file TotemSampicFrame.h.

80 {}

Member Function Documentation

uint16_t TotemSampicFrame::getBunchNumber ( ) const
inline

Definition at line 203 of file TotemSampicFrame.h.

References bunchNumber_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

204  {
205  uint16_t tmp = 0;
206  if ( status_ )
207  tmp = *( ( const uint16_t* ) ( totemSampicEventInfoPtr_ + TotemSampicConstant::bunchNumber_Position ) );
208  return tmp;
209  }
const uint8_t * totemSampicEventInfoPtr_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
uint16_t TotemSampicFrame::getCellInfo ( ) const
inline

Definition at line 152 of file TotemSampicFrame.h.

References cellInfo_Mask, cellInfo_Position, status_, tmp, and totemSampicInfoPtr_.

Referenced by print().

152  {
153  uint16_t tmp = 0;
154  if ( status_ )
155  tmp = *( ( const uint16_t* ) ( totemSampicInfoPtr_ + TotemSampicConstant::cellInfo_Position ) );
157  }
const uint8_t * totemSampicInfoPtr_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
uint16_t TotemSampicFrame::getChannelMap ( ) const
inline

Definition at line 227 of file TotemSampicFrame.h.

References channelMap_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

228  {
229  uint16_t tmp = 0;
230  if ( status_ )
231  tmp = *( ( const uint16_t* ) ( totemSampicEventInfoPtr_ + TotemSampicConstant::channelMap_Position ) );
232  return tmp;
233  }
const uint8_t * totemSampicEventInfoPtr_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
int TotemSampicFrame::getDetChannel ( ) const
inline

Definition at line 166 of file TotemSampicFrame.h.

References planeChannelId_Position, status_, tmp, and totemSampicInfoPtr_.

Referenced by print().

166  {
167  int tmp = 0;
168  if ( status_ )
170  return tmp;
171  }
const uint8_t * totemSampicInfoPtr_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
int TotemSampicFrame::getDetPlane ( ) const
inline

Definition at line 159 of file TotemSampicFrame.h.

References planeChannelId_Position, status_, tmp, and totemSampicInfoPtr_.

Referenced by print().

159  {
160  int tmp = 0;
161  if ( status_ )
162  tmp = ( totemSampicInfoPtr_[ planeChannelId_Position ] & 0xF0 ) >> 4;
163  return tmp;
164  }
const uint8_t * totemSampicInfoPtr_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
uint8_t TotemSampicFrame::getEventHardwareId ( ) const
inline

Definition at line 188 of file TotemSampicFrame.h.

References boardId_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

188  {
189  uint8_t tmp = 0;
190  if ( status_ )
192  return tmp;
193  }
const uint8_t * totemSampicEventInfoPtr_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
uint32_t TotemSampicFrame::getEventNumber ( ) const
inline

Definition at line 219 of file TotemSampicFrame.h.

References eventNumber_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

220  {
221  uint32_t tmp = 0;
222  if ( status_ )
223  tmp = *( ( const uint32_t* ) ( totemSampicEventInfoPtr_ + TotemSampicConstant::eventNumber_Position ) );
224  return tmp;
225  }
const uint8_t * totemSampicEventInfoPtr_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
uint64_t TotemSampicFrame::getFPGATimestamp ( ) const
inline

Definition at line 127 of file TotemSampicFrame.h.

References fpgaTime_Position, status_, tmp, and totemSampicInfoPtr_.

Referenced by print().

127  {
128  uint64_t tmp = 0;
129  if ( status_ ) {
130  tmp = *( ( const uint64_t* ) ( totemSampicInfoPtr_ + TotemSampicConstant::fpgaTime_Position ) ) & 0xFFFFFFFFFF;
131  }
132  return tmp;
133  }
const uint8_t * totemSampicInfoPtr_
unsigned long long uint64_t
Definition: Time.h:15
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
uint8_t TotemSampicFrame::getFWVersion ( ) const
inline

Definition at line 263 of file TotemSampicFrame.h.

References fwVersion_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

263  {
264  uint8_t tmp = 0;
266  return tmp;
267  }
const uint8_t * totemSampicEventInfoPtr_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
uint8_t TotemSampicFrame::getHardwareId ( ) const
inline

Definition at line 121 of file TotemSampicFrame.h.

References hwId_Position, status_, tmp, and totemSampicInfoPtr_.

Referenced by print().

121  {
122  uint8_t tmp = 0;
124  return tmp;
125  }
const uint8_t * totemSampicInfoPtr_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
uint16_t TotemSampicFrame::getL1ALatency ( ) const
inline

Definition at line 235 of file TotemSampicFrame.h.

References l1ALatency_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

236  {
237  uint16_t tmp = 0;
238  if ( status_ )
239  tmp = *( ( const uint16_t* ) ( totemSampicEventInfoPtr_ + TotemSampicConstant::l1ALatency_Position ) );
240  return tmp;
241  }
const uint8_t * totemSampicEventInfoPtr_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
uint64_t TotemSampicFrame::getL1ATimestamp ( ) const
inline

Definition at line 195 of file TotemSampicFrame.h.

References l1ATimestamp_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

195  {
196  uint64_t tmp = 0;
197  if ( status_ ) {
198  tmp = *( ( const uint64_t* ) ( totemSampicEventInfoPtr_ + TotemSampicConstant::l1ATimestamp_Position ) ) & 0xFFFFFFFFFF;
199  }
200  return tmp;
201  }
const uint8_t * totemSampicEventInfoPtr_
unsigned long long uint64_t
Definition: Time.h:15
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
unsigned int TotemSampicFrame::getNumberOfSamples ( ) const
inline

Definition at line 183 of file TotemSampicFrame.h.

References numberOfSamples, and status_.

uint8_t TotemSampicFrame::getNumberOfSentSamples ( ) const
inline

Definition at line 243 of file TotemSampicFrame.h.

References numberOfSamples_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

244  {
245  uint8_t tmp = 0;
247  return tmp;
248  }
const uint8_t * totemSampicEventInfoPtr_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
uint8_t TotemSampicFrame::getOffsetOfSamples ( ) const
inline

Definition at line 250 of file TotemSampicFrame.h.

References offsetOfSamples_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

251  {
252  uint8_t tmp = 0;
254  return tmp;
255  }
const uint8_t * totemSampicEventInfoPtr_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
uint32_t TotemSampicFrame::getOrbitNumber ( ) const
inline

Definition at line 211 of file TotemSampicFrame.h.

References orbitNumber_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

212  {
213  uint32_t tmp = 0;
214  if ( status_ )
215  tmp = *( ( const uint32_t* ) ( totemSampicEventInfoPtr_ + TotemSampicConstant::orbitNumber_Position ) );
216  return tmp;
217  }
const uint8_t * totemSampicEventInfoPtr_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
uint8_t TotemSampicFrame::getPLLInfo ( ) const
inline

Definition at line 257 of file TotemSampicFrame.h.

References pllInfo_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

257  {
258  uint8_t tmp = 0;
260  return tmp;
261  }
const uint8_t * totemSampicEventInfoPtr_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
const std::vector<uint8_t> TotemSampicFrame::getSamples ( ) const
inline

Definition at line 173 of file TotemSampicFrame.h.

References numberOfSamples, hcalTTPDigis_cfi::samples, status_, and totemSampicDataPtr_.

173  {
174  std::vector<uint8_t> samples;
175  if ( status_ ) {
177  for ( auto it = samples.begin(); it != samples.end(); ++it )
178  *it = grayToBinary<uint8_t>( *it );
179  }
180  return samples;
181  }
const uint8_t * totemSampicDataPtr_
uint16_t TotemSampicFrame::getTimestampA ( ) const
inline

Definition at line 135 of file TotemSampicFrame.h.

References status_, timestampA_Position, tmp, and totemSampicInfoPtr_.

Referenced by print().

135  {
136  uint16_t tmp = 0;
137  if ( status_ ) {
138  tmp = *( ( const uint16_t* ) ( totemSampicInfoPtr_ + TotemSampicConstant::timestampA_Position ) );
139  }
140  tmp = 0xFFF - tmp;
141  return grayToBinary<uint16_t> ( tmp );
142  }
const uint8_t * totemSampicInfoPtr_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
uint16_t TotemSampicFrame::getTimestampB ( ) const
inline

Definition at line 144 of file TotemSampicFrame.h.

References status_, timestampB_Position, tmp, and totemSampicInfoPtr_.

Referenced by print().

144  {
145  uint16_t tmp = 0;
146  if ( status_ ) {
147  tmp = *( ( const uint16_t* ) ( totemSampicInfoPtr_ + TotemSampicConstant::timestampB_Position ) );
148  }
149  return grayToBinary<uint16_t> ( tmp );
150  }
const uint8_t * totemSampicInfoPtr_
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
void TotemSampicFrame::print ( void  ) const
inline

Definition at line 95 of file TotemSampicFrame.h.

References gather_cfg::cout, TauDecayModes::dec, getBunchNumber(), getCellInfo(), getChannelMap(), getDetChannel(), getDetPlane(), getEventHardwareId(), getEventNumber(), getFPGATimestamp(), getFWVersion(), getHardwareId(), getL1ALatency(), getL1ATimestamp(), getNumberOfSentSamples(), getOffsetOfSamples(), getOrbitNumber(), getPLLInfo(), getTimestampA(), getTimestampB(), and createfilelist::int.

95  {
96  std::bitset<16> bitsChannelMap( getChannelMap() );
97  std::bitset<16> bitsPLLInfo( getPLLInfo() );
98  std::cout << "TotemSampicFrame:\nEvent:"
99  << "\nHardwareId (Event):\t" << std::hex << (unsigned int) getEventHardwareId()
100  << "\nL1A Timestamp:\t" << std::dec << getL1ATimestamp()
101  << "\nL1A Latency:\t" << std::dec << getL1ALatency()
102  << "\nBunch Number:\t" << std::dec << getBunchNumber()
103  << "\nOrbit Number:\t" << std::dec << getOrbitNumber()
104  << "\nEvent Number:\t" << std::dec << getEventNumber()
105  << "\nChannels fired:\t" << std::hex << bitsChannelMap.to_string()
106  << "\nNumber of Samples:\t" << std::dec << getNumberOfSentSamples()
107  << "\nOffset of Samples:\t" << std::dec << (int) getOffsetOfSamples()
108  << "\nFW Version:\t" << std::hex << (int) getFWVersion()
109  << "\nChannel:\nHardwareId:\t" << std::hex << (unsigned int) getHardwareId()
110  << "\nFPGATimestamp:\t" << std::dec << getFPGATimestamp()
111  << "\nTimestampA:\t" << std::dec << getTimestampA()
112  << "\nTimestampB:\t" << std::dec << getTimestampB()
113  << "\nCellInfo:\t" << std::dec << getCellInfo()
114  << "\nPlane:\t" << std::dec << getDetPlane()
115  << "\nChannel:\t" << std::dec << getDetChannel()
116  << "\nPLL Info:\t" << bitsPLLInfo.to_string()
117  << std::endl << std::endl;
118  }
uint16_t getTimestampB() const
uint16_t getChannelMap() const
int getDetPlane() const
uint8_t getEventHardwareId() const
uint8_t getPLLInfo() const
uint8_t getHardwareId() const
uint32_t getEventNumber() const
uint16_t getTimestampA() const
uint64_t getL1ATimestamp() const
uint8_t getOffsetOfSamples() const
uint8_t getFWVersion() const
int getDetChannel() const
uint16_t getBunchNumber() const
uint8_t getNumberOfSentSamples() const
uint16_t getCellInfo() const
uint64_t getFPGATimestamp() const
uint16_t getL1ALatency() const
uint32_t getOrbitNumber() const
void TotemSampicFrame::printRaw ( bool  binary = false) const
inline

Prints the frame. If binary is true, binary format is used.

Definition at line 84 of file TotemSampicFrame.h.

References gather_cfg::cout, printRawBuffer(), totemSampicDataPtr_, totemSampicEventInfoPtr_, and totemSampicInfoPtr_.

84  {
85  std::cout << "Event Info: " << std::endl;
87 
88  std::cout << "Channel Info: " << std::endl;
89  printRawBuffer( (uint16_t*) totemSampicInfoPtr_ );
90 
91  std::cout << "Channel Data: " << std::endl;
92  printRawBuffer( (uint16_t*) totemSampicDataPtr_ );
93  }
const uint8_t * totemSampicInfoPtr_
const uint8_t * totemSampicEventInfoPtr_
const uint8_t * totemSampicDataPtr_
void printRawBuffer(const uint16_t *buffer, const bool binary=false, const unsigned int size=12) const
void TotemSampicFrame::printRawBuffer ( const uint16_t *  buffer,
const bool  binary = false,
const unsigned int  size = 12 
) const
inlineprotected

Definition at line 280 of file TotemSampicFrame.h.

References bits, gather_cfg::cout, mps_fire::i, and findQualityFiles::size.

Referenced by printRaw().

280  {
281  for ( unsigned int i = 0; i < size; i++ ) {
282  if ( binary ) {
283  std::bitset<16> bits( *( buffer++ ) );
284  std::cout << bits.to_string() << std::endl;
285  }
286  else
287  std::cout << std::setfill( '0' ) << std::setw( 4 ) << std::hex << *( buffer++ ) << std::endl;
288  }
289  std::cout << std::endl;
290  }
size
Write out results.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
bool TotemSampicFrame::valid ( ) const
inline

Definition at line 269 of file TotemSampicFrame.h.

References status_.

269  {
270  return status_ != 0;
271  }

Member Data Documentation

int TotemSampicFrame::status_
protected
const uint8_t* TotemSampicFrame::totemSampicDataPtr_
protected

Definition at line 275 of file TotemSampicFrame.h.

Referenced by getSamples(), and printRaw().

const uint8_t* TotemSampicFrame::totemSampicEventInfoPtr_
protected
const uint8_t* TotemSampicFrame::totemSampicInfoPtr_
protected