#include <CRTFragment.hh>
Definition at line 15 of file CRTFragment.hh.
CRT::Fragment::Fragment |
( |
artdaq::Fragment const & |
f | ) |
|
|
inlineexplicit |
int16_t Fragment::adc |
( |
const int |
i | ) |
const |
Definition at line 41 of file CRTFragment.cc.
const hit_t * hit(const int i) const
uint8_t Fragment::channel |
( |
const int |
i | ) |
const |
Definition at line 35 of file CRTFragment.cc.
const hit_t * hit(const int i) const
uint64_t Fragment::fifty_mhz_time |
( |
| ) |
const |
bool Fragment::good_event |
( |
| ) |
const |
Definition at line 178 of file CRTFragment.cc.
184 for(
unsigned int i = 0; i <
header()->
nhit; i++)
bool good_hit(const int i) const
const header_t * header() const
bool Fragment::good_header |
( |
| ) |
const |
Definition at line 93 of file CRTFragment.cc.
95 const header_t *
const h =
header();
97 std::cerr <<
"CRT header has wrong magic: " << h->magic <<
"\n";
101 std::cerr <<
"CRT event has no hits\n";
105 std::cerr <<
"CRT event has more hits (" << h->nhit <<
") than channels (64)\n";
const header_t * header() const
bool Fragment::good_hit |
( |
const int |
i | ) |
const |
Definition at line 114 of file CRTFragment.cc.
116 const hit_t *
const h =
hit(i);
118 std::cerr <<
"CRT hit has wrong magic: " << h->magic <<
"\n";
121 if(h->channel >= 64){
122 std::cerr <<
"CRT hit has bad channel " << h->channel <<
" >= 64\n";
129 std::cerr <<
"CRT hit has bad ADC value " << h->adc <<
" >= 4096\n";
const hit_t * hit(const int i) const
bool Fragment::good_size |
( |
| ) |
const |
Definition at line 145 of file CRTFragment.cc.
147 if(
size() <
sizeof(header_t)){
148 std::cerr <<
"CRT fragment isn't as big (" <<
size() <<
"B) as header (" <<
sizeof(header_t) <<
"B)\n";
152 const unsigned int expect_size =
153 (
sizeof(header_t) +
header()->
nhit *
sizeof(hit_t)
154 +
sizeof(artdaq::RawDataType) - 1)
155 /
sizeof(artdaq::RawDataType)
156 *
sizeof(artdaq::RawDataType);
158 if(
size() != expect_size){
159 std::cerr <<
"CRT fragment: N hit (" <<
header()->
nhit <<
" -> " << expect_size <<
"B) mismatches size " 161 for(
char *
c = (
char *)
thefrag.dataBeginBytes();
164 std::cerr << (
unsigned char)*
c <<
"/" 165 << (isprint((
unsigned char)*
c)?(
unsigned char)*
c:
'.');
166 if((
c - (
char*)
thefrag.dataBeginBytes())%0x08 == 0x07)
168 if((
c - (
char*)
thefrag.dataBeginBytes())%0x10 == 0x0f)
unsigned int size() const
const header_t * header() const
artdaq::Fragment const & thefrag
Definition at line 199 of file CRTFragment.cc.
201 return reinterpret_cast<const header_t *
>(
thefrag.dataBeginBytes());
artdaq::Fragment const & thefrag
Definition at line 192 of file CRTFragment.cc.
194 return reinterpret_cast<const hit_t *
> 195 (
thefrag.dataBeginBytes() +
sizeof(header_t) + i*
sizeof(hit_t));
artdaq::Fragment const & thefrag
uint16_t Fragment::module_num |
( |
| ) |
const |
size_t Fragment::num_hits |
( |
| ) |
const |
void Fragment::print_header |
( |
| ) |
const |
Definition at line 48 of file CRTFragment.cc.
50 if(
size() <
sizeof(header_t)){
51 std::cerr <<
"CRT fragment smaller (" <<
size() <<
"B) than header (" 52 <<
sizeof(header_t) <<
"B), can't print\n";
56 std::cout <<
"CRT header: Magic = '" <<
header()->
magic <<
"'\n"
unsigned int size() const
QTextStream & hex(QTextStream &s)
QTextStream & dec(QTextStream &s)
const header_t * header() const
void Fragment::print_hit |
( |
const int |
i | ) |
const |
Definition at line 67 of file CRTFragment.cc.
72 if((uint8_t *)
hit(i) +
sizeof(hit_t) >
thefrag.dataEndBytes()){
73 std::cerr <<
"Hit " << i <<
" would be past end of fragment, can't print\n";
77 std::cout <<
"CRT hit " << i <<
": Magic = '" <<
hit(i)->
magic <<
"'\n" 79 <<
" ADC = " <<
hit(i)->
adc <<
"\n";
artdaq::Fragment const & thefrag
const hit_t * hit(const int i) const
void Fragment::print_hits |
( |
| ) |
const |
Definition at line 83 of file CRTFragment.cc.
void print_hit(const int i) const
const header_t * header() const
uint64_t Fragment::raw_backend_time |
( |
| ) |
const |
unsigned int Fragment::size |
( |
| ) |
const |
artdaq::Fragment const& CRT::Fragment::thefrag |
|
private |
The documentation for this class was generated from the following files: