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 70 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 73 of file TotemSampicFrame.h.

References controlBits3, controlBits3_Position, status_, and totemSampicInfoPtr_.

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

Definition at line 79 of file TotemSampicFrame.h.

79 {}

Member Function Documentation

uint16_t TotemSampicFrame::getBunchNumber ( ) const
inline

Definition at line 202 of file TotemSampicFrame.h.

References bunchNumber_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

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

Definition at line 151 of file TotemSampicFrame.h.

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

Referenced by print().

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

Definition at line 226 of file TotemSampicFrame.h.

References channelMap_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

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

Definition at line 165 of file TotemSampicFrame.h.

References planeChannelId_Position, status_, tmp, and totemSampicInfoPtr_.

Referenced by print().

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

Definition at line 158 of file TotemSampicFrame.h.

References planeChannelId_Position, status_, tmp, and totemSampicInfoPtr_.

Referenced by print().

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

Definition at line 187 of file TotemSampicFrame.h.

References boardId_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

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

Definition at line 218 of file TotemSampicFrame.h.

References eventNumber_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

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

Definition at line 126 of file TotemSampicFrame.h.

References fpgaTime_Position, status_, tmp, and totemSampicInfoPtr_.

Referenced by print().

126  {
127  uint64_t tmp = 0;
128  if ( status_ ) {
129  tmp = *( ( const uint64_t* ) ( totemSampicInfoPtr_ + TotemSampicConstant::fpgaTime_Position ) ) & 0xFFFFFFFFFF;
130  }
131  return tmp;
132  }
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 262 of file TotemSampicFrame.h.

References fwVersion_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

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

Definition at line 120 of file TotemSampicFrame.h.

References hwId_Position, status_, tmp, and totemSampicInfoPtr_.

Referenced by print().

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

Definition at line 234 of file TotemSampicFrame.h.

References l1ALatency_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

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

Definition at line 194 of file TotemSampicFrame.h.

References l1ATimestamp_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

194  {
195  uint64_t tmp = 0;
196  if ( status_ ) {
197  tmp = *( ( const uint64_t* ) ( totemSampicEventInfoPtr_ + TotemSampicConstant::l1ATimestamp_Position ) ) & 0xFFFFFFFFFF;
198  }
199  return tmp;
200  }
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 182 of file TotemSampicFrame.h.

References numberOfSamples, and status_.

uint8_t TotemSampicFrame::getNumberOfSentSamples ( ) const
inline

Definition at line 242 of file TotemSampicFrame.h.

References numberOfSamples_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

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

Definition at line 249 of file TotemSampicFrame.h.

References offsetOfSamples_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

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

Definition at line 210 of file TotemSampicFrame.h.

References orbitNumber_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

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

Definition at line 256 of file TotemSampicFrame.h.

References pllInfo_Position, status_, tmp, and totemSampicEventInfoPtr_.

Referenced by print().

256  {
257  uint8_t tmp = 0;
259  return tmp;
260  }
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 172 of file TotemSampicFrame.h.

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

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

Definition at line 134 of file TotemSampicFrame.h.

References status_, timestampA_Position, tmp, and totemSampicInfoPtr_.

Referenced by print().

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

Definition at line 143 of file TotemSampicFrame.h.

References status_, timestampB_Position, tmp, and totemSampicInfoPtr_.

Referenced by print().

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

Definition at line 94 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.

94  {
95  std::bitset<16> bitsChannelMap( getChannelMap() );
96  std::bitset<16> bitsPLLInfo( getPLLInfo() );
97  std::cout << "TotemSampicFrame:\nEvent:"
98  << "\nHardwareId (Event):\t" << std::hex << (unsigned int) getEventHardwareId()
99  << "\nL1A Timestamp:\t" << std::dec << getL1ATimestamp()
100  << "\nL1A Latency:\t" << std::dec << getL1ALatency()
101  << "\nBunch Number:\t" << std::dec << getBunchNumber()
102  << "\nOrbit Number:\t" << std::dec << getOrbitNumber()
103  << "\nEvent Number:\t" << std::dec << getEventNumber()
104  << "\nChannels fired:\t" << std::hex << bitsChannelMap.to_string()
105  << "\nNumber of Samples:\t" << std::dec << getNumberOfSentSamples()
106  << "\nOffset of Samples:\t" << std::dec << (int) getOffsetOfSamples()
107  << "\nFW Version:\t" << std::hex << (int) getFWVersion()
108  << "\nChannel:\nHardwareId:\t" << std::hex << (unsigned int) getHardwareId()
109  << "\nFPGATimestamp:\t" << std::dec << getFPGATimestamp()
110  << "\nTimestampA:\t" << std::dec << getTimestampA()
111  << "\nTimestampB:\t" << std::dec << getTimestampB()
112  << "\nCellInfo:\t" << std::dec << getCellInfo()
113  << "\nPlane:\t" << std::dec << getDetPlane()
114  << "\nChannel:\t" << std::dec << getDetChannel()
115  << "\nPLL Info:\t" << bitsPLLInfo.to_string()
116  << std::endl << std::endl;
117  }
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 83 of file TotemSampicFrame.h.

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

83  {
84  std::cout << "Event Info: " << std::endl;
86 
87  std::cout << "Channel Info: " << std::endl;
88  printRawBuffer( (uint16_t*) totemSampicInfoPtr_ );
89 
90  std::cout << "Channel Data: " << std::endl;
91  printRawBuffer( (uint16_t*) totemSampicDataPtr_ );
92  }
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 279 of file TotemSampicFrame.h.

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

Referenced by printRaw().

279  {
280  for ( unsigned int i = 0; i < size; i++ ) {
281  if ( binary ) {
282  std::bitset<16> bits( *( buffer++ ) );
283  std::cout << bits.to_string() << std::endl;
284  }
285  else
286  std::cout << std::setfill( '0' ) << std::setw( 4 ) << std::hex << *( buffer++ ) << std::endl;
287  }
288  std::cout << std::endl;
289  }
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 268 of file TotemSampicFrame.h.

References status_.

268  {
269  return status_ != 0;
270  }

Member Data Documentation

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

Definition at line 274 of file TotemSampicFrame.h.

Referenced by getSamples(), and printRaw().

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