Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
dune Namespace Reference

Namespaces

 apa
 
 detail
 
 frame14
 
 HDF5Utils
 
 HDFFileReader
 
 tde
 
 testing
 Namespace including DUNE-specific testing.
 

Classes

class  AnalysisTree
 Creates a simple ROOT tree with tracking and calorimetry information. More...
 
class  AnalysisTreeDataStruct
 
class  AnaRootParser
 Creates a simple ROOT tree with tracking and calorimetry information. More...
 
class  AnaRootParserDataStruct
 
class  CalibrationdEdXPDSP
 
class  ChannelInformation
 
class  CheckAuxDet
 
class  CheckGeometry
 
class  CheckRecoEnergy
 
struct  ColdataBlock
 
struct  ColdataHeader
 
struct  ColdataSegment
 
struct  ContainerValueType
 Class whose "type" contains the base data type of the container. More...
 
struct  ContainerValueType< std::vector< AnalysisTreeDataStruct::BoxedArray< A > > >
 
struct  ContainerValueType< std::vector< AnaRootParserDataStruct::BoxedArray< A > > >
 
struct  ContainerValueType< std::vector< T > >
 
class  CounterFilter
 
class  CTBFragment
 
class  dEdxcalibration
 
class  DisambigAlg35t
 
class  DisambigAlgProtoDUNESP
 
class  DisambigFromSpacePoints
 
class  DPChannelId
 
class  DUNEGeometryHelper
 
class  EmLikeHits
 
class  EnergyReco
 
class  EnergyRecoOutput
 
class  FelixCompressor
 
class  FelixDecoder
 
class  FelixFragment
 
class  FelixFragmentBase
 
class  FelixFragmentCompressed
 
class  FelixFragmentReordered
 
class  FelixFragmentUnordered
 
class  FelixFrame
 
class  FelixIntegrityTest
 
class  FelixRawDecoder
 
class  FelixReorder
 
class  Frame14Fragment
 
class  Frame14FragmentUnordered
 
class  HDF5RawInputDetail
 
class  HitFinder35t
 
class  HitFinderProtoDUNESP
 
class  HitInformation
 
class  HitLineFitAlg
 
class  HitRepeater
 
struct  HuffTree
 
class  IcebergChannelMapService
 
struct  IndexCrate
 
struct  IndexCrateCard
 
struct  IndexCrateCardChan
 
struct  IndexCrateCardChanHash
 
struct  IndexCrp
 
struct  IndexCrpView
 
struct  IndexCrpViewChan
 
struct  IndexCrpViewChanHash
 
struct  IndexRawSeqn
 
struct  IndexRawSeqnHash
 
struct  MetaData
 
class  michelremoving
 
class  MicroSlice
 
class  MicroSliceWriter
 
class  MilliSlice
 
class  MilliSliceFragment
 
class  MilliSliceFragmentWriter
 
class  MilliSliceWriter
 
class  NanoSlice
 
class  NanoSliceWriter
 
class  NeutrinoEnergyRecoAlg
 NeutrinoEnergyRecoAlg class. More...
 
class  PDDPChannelMap
 
class  PdspChannelMapService
 
struct  PdspHDFFileReader
 The PdspHDFFileReader is a class which implements the methods needed by art::Source. More...
 
class  PennMicroSlice
 
class  PennMicroSliceWriter
 
class  PennMilliSlice
 
class  PennMilliSliceFragment
 
class  PennMilliSliceWriter
 
class  PFPEfficiency
 
class  ProtoDUNETimeStamp
 
class  protonanalysis
 
class  RceFragment
 
class  RceRawDecoder
 
class  ReorderFacility
 
class  RMSHitFinderAlg
 
struct  ROOTTreeCode
 Contains ROOTTreeCode<>::code, ROOT tree character for branch of type T. More...
 
struct  ROOTTreeCode< Double_t >
 
struct  ROOTTreeCode< Int_t >
 
struct  ROOTTreeCode< Short_t >
 
class  SignalToNoise
 
class  SlidingAverage
 
class  SSPFragment
 
class  SSPFragmentWriter
 
class  SSPRawDecoder
 
class  T0Counter
 
class  TimeBasedDisambig
 
class  TimingFragment
 
class  TimingRawDecoder
 
class  ToyFragment
 
class  ToyFragmentWriter
 
class  VDColdboxChannelMapService
 
class  VDColdboxPDSDecoder
 
class  VDColdboxTDEChannelMapService
 
struct  WIBHeader
 
class  XYZcalibration
 

Typedefs

typedef uint32_t word_t
 
typedef uint16_t adc_t
 
typedef std::vector< uint16_t > adc_v
 
typedef std::vector< dune::RceFragmentRceFragments
 
using HDF5RawInputSource = art::Source< HDF5RawInputDetail >
 
typedef multi_index_container< DPChannelId, indexed_by< ordered_unique< tag< IndexRawSeqn >, const_mem_fun< DPChannelId, const unsigned,&DPChannelId::seqn > >, hashed_unique< tag< IndexRawSeqnHash >, const_mem_fun< DPChannelId, const unsigned,&DPChannelId::seqn > >, hashed_non_unique< tag< IndexCrate >, const_mem_fun< DPChannelId, const unsigned short,&DPChannelId::crate > >, hashed_non_unique< tag< IndexCrateCard >, composite_key< DPChannelId, const_mem_fun< DPChannelId, const unsigned short,&DPChannelId::crate >, const_mem_fun< DPChannelId, const unsigned short,&DPChannelId::card > > >, ordered_unique< tag< IndexCrateCardChan >, composite_key< DPChannelId, const_mem_fun< DPChannelId, const unsigned short,&DPChannelId::crate >, const_mem_fun< DPChannelId, const unsigned short,&DPChannelId::card >, const_mem_fun< DPChannelId, const unsigned short,&DPChannelId::cardch > > >, hashed_unique< tag< IndexCrateCardChanHash >, composite_key< DPChannelId, const_mem_fun< DPChannelId, const unsigned short,&DPChannelId::crate >, const_mem_fun< DPChannelId, const unsigned short,&DPChannelId::card >, const_mem_fun< DPChannelId, const unsigned short,&DPChannelId::cardch > > >, hashed_non_unique< tag< IndexCrp >, const_mem_fun< DPChannelId, const unsigned short,&DPChannelId::crp > >, hashed_non_unique< tag< IndexCrpView >, composite_key< DPChannelId, const_mem_fun< DPChannelId, const unsigned short,&DPChannelId::crp >, const_mem_fun< DPChannelId, const unsigned short,&DPChannelId::view > > >, ordered_unique< tag< IndexCrpViewChan >, composite_key< DPChannelId, const_mem_fun< DPChannelId, const unsigned short,&DPChannelId::crp >, const_mem_fun< DPChannelId, const unsigned short,&DPChannelId::view >, const_mem_fun< DPChannelId, const unsigned short,&DPChannelId::viewch > > >, hashed_unique< tag< IndexCrpViewChanHash >, composite_key< DPChannelId, const_mem_fun< DPChannelId, const unsigned short,&DPChannelId::crp >, const_mem_fun< DPChannelId, const unsigned short,&DPChannelId::view >, const_mem_fun< DPChannelId, const unsigned short,&DPChannelId::viewch > > > > > DPChannelTable
 
typedef std::map< unsigned int, std::vector< size_t > > plane_keymap
 
typedef std::map< unsigned int, plane_keymaptpc_plane_keymap
 
typedef std::map< unsigned int, tpc_plane_keymapcryo_tpc_plane_keymap
 
typedef std::vector< HitInformationHitVec_t
 
typedef std::map< int, ChannelInformationChanMap_t
 

Enumerations

enum  TimingCommand {
  TimingCommand::TimeSync = 0x0, TimingCommand::Echo = 0x1, TimingCommand::SpillStart = 0x2, TimingCommand::SpillStop = 0x3,
  TimingCommand::RunStart = 0x4, TimingCommand::RunStop = 0x5, TimingCommand::WibCalib = 0x6, TimingCommand::SSPCalib = 0x7,
  TimingCommand::FakeTrig0 = 0x8, TimingCommand::FakeTrig1 = 0x9, TimingCommand::FakeTrig2 = 0xa, TimingCommand::FakeTrig3 = 0xb,
  TimingCommand::BeamTrig = 0xc, TimingCommand::NoBeamTrig = 0xd, TimingCommand::ExtFakeTrig = 0xe
}
 
enum  ProtoDUNETimingCommand {
  ProtoDUNETimingCommand::TimeSync = 0x0, ProtoDUNETimingCommand::Echo = 0x1, ProtoDUNETimingCommand::SpillStart = 0x2, ProtoDUNETimingCommand::SpillStop = 0x3,
  ProtoDUNETimingCommand::RunStart = 0x4, ProtoDUNETimingCommand::RunStop = 0x5, ProtoDUNETimingCommand::WibCalib = 0x6, ProtoDUNETimingCommand::SSPCalib = 0x7,
  ProtoDUNETimingCommand::FakeTrig0 = 0x8, ProtoDUNETimingCommand::FakeTrig1 = 0x9, ProtoDUNETimingCommand::FakeTrig2 = 0xa, ProtoDUNETimingCommand::FakeTrig3 = 0xb,
  ProtoDUNETimingCommand::BeamTrig = 0xc, ProtoDUNETimingCommand::NoBeamTrig = 0xd, ProtoDUNETimingCommand::ExtFakeTrig = 0xe
}
 

Functions

std::ostream & operator<< (std::ostream &out, CTBFragment const &f)
 
std::vector< char > FelixCompress (const dune::FelixFragment &frag)
 
artdaq::Fragment FelixDecompress (const std::vector< char > &buff)
 
artdaq::Fragment FelixReorder (const uint8_t *src, const uint16_t &num_frames=6000)
 
FragmentType toFragmentType (std::string t_string)
 
std::string fragmentTypeToString (FragmentType val)
 
std::map< artdaq::Fragment::type_t, std::stringmakeFragmentTypeMap ()
 
const Frame14FragmentParseFrame14Fragment (const artdaq::Fragment &fragment)
 
std::ostream & operator<< (std::ostream &, SSPFragment const &)
 
std::ostream & operator<< (std::ostream &, TimingFragment const &)
 
std::ostream & operator<< (std::ostream &, ToyFragment const &)
 
void display_bits (void *memstart, size_t nbytes, std::string sourcename)
 
template<typename S , typename T >
S reinterpret_cast_checked (T inptr)
 
artdaq::Fragments getHandleChecked (const art::Event &evt, const std::string &label, const std::string &fragtype, const bool &inContainer)
 

Variables

static std::vector< std::string > const names
 
class dune::Frame14Fragmentstruct dune::frame14::__attribute__ aligned
 

Typedef Documentation

typedef uint16_t dune::adc_t

Definition at line 18 of file FelixFormat.hh.

typedef std::vector<uint16_t> dune::adc_v

Definition at line 19 of file FelixFormat.hh.

typedef std::map<int,ChannelInformation> dune::ChanMap_t

Definition at line 82 of file RobustHitFinderSupport.h.

typedef std::map< unsigned int, tpc_plane_keymap > dune::cryo_tpc_plane_keymap

Definition at line 48 of file DisambigFromSpacePoints_module.cc.

typedef multi_index_container< DPChannelId, indexed_by< ordered_unique< tag<IndexRawSeqn>, const_mem_fun< DPChannelId, const unsigned, &DPChannelId::seqn > >, hashed_unique< tag<IndexRawSeqnHash>, const_mem_fun< DPChannelId, const unsigned, &DPChannelId::seqn > >, hashed_non_unique< tag<IndexCrate>, const_mem_fun< DPChannelId, const unsigned short, &DPChannelId::crate > >, hashed_non_unique< tag<IndexCrateCard>, composite_key< DPChannelId, const_mem_fun< DPChannelId, const unsigned short, &DPChannelId::crate >, const_mem_fun< DPChannelId, const unsigned short, &DPChannelId::card > > >, ordered_unique< tag<IndexCrateCardChan>, composite_key< DPChannelId, const_mem_fun< DPChannelId, const unsigned short, &DPChannelId::crate >, const_mem_fun< DPChannelId, const unsigned short, &DPChannelId::card >, const_mem_fun< DPChannelId, const unsigned short, &DPChannelId::cardch > > >, hashed_unique< tag<IndexCrateCardChanHash>, composite_key< DPChannelId, const_mem_fun< DPChannelId, const unsigned short, &DPChannelId::crate >, const_mem_fun< DPChannelId, const unsigned short, &DPChannelId::card >, const_mem_fun< DPChannelId, const unsigned short, &DPChannelId::cardch > > >, hashed_non_unique< tag<IndexCrp>, const_mem_fun< DPChannelId, const unsigned short, &DPChannelId::crp > >, hashed_non_unique< tag<IndexCrpView>, composite_key< DPChannelId, const_mem_fun< DPChannelId, const unsigned short, &DPChannelId::crp >, const_mem_fun< DPChannelId, const unsigned short, &DPChannelId::view > > >, ordered_unique< tag<IndexCrpViewChan>, composite_key< DPChannelId, const_mem_fun< DPChannelId, const unsigned short, &DPChannelId::crp >, const_mem_fun< DPChannelId, const unsigned short, &DPChannelId::view >, const_mem_fun< DPChannelId, const unsigned short, &DPChannelId::viewch > > >, hashed_unique< tag<IndexCrpViewChanHash>, composite_key< DPChannelId, const_mem_fun< DPChannelId, const unsigned short, &DPChannelId::crp >, const_mem_fun< DPChannelId, const unsigned short, &DPChannelId::view >, const_mem_fun< DPChannelId, const unsigned short, &DPChannelId::viewch > > > > > dune::DPChannelTable

Definition at line 129 of file PDDPChannelMap.h.

Definition at line 130 of file HDF5RawInput_source.cc.

Definition at line 59 of file RobustHitFinderSupport.h.

typedef std::map< unsigned int, std::vector< size_t > > dune::plane_keymap

Definition at line 46 of file DisambigFromSpacePoints_module.cc.

Definition at line 13 of file RceFragment.hh.

typedef std::map< unsigned int, plane_keymap > dune::tpc_plane_keymap

Definition at line 47 of file DisambigFromSpacePoints_module.cc.

typedef uint32_t dune::word_t

Definition at line 17 of file FelixFormat.hh.

Enumeration Type Documentation

Enumerator
TimeSync 
Echo 
SpillStart 
SpillStop 
RunStart 
RunStop 
WibCalib 
SSPCalib 
FakeTrig0 
FakeTrig1 
FakeTrig2 
FakeTrig3 
BeamTrig 
NoBeamTrig 
ExtFakeTrig 

Definition at line 19 of file ProtoDUNETimeStamp.h.

19  {
20  // From https://twiki.cern.ch/twiki/bin/view/CENF/TimingSystemAdvancedOp retrieved on 2018-09-07
21  // The 'sync' bus has the following commands at the moment:
22  TimeSync = 0x0,
23  Echo = 0x1,
24  SpillStart = 0x2,
25  SpillStop = 0x3,
26  RunStart = 0x4,
27  RunStop = 0x5,
28  WibCalib = 0x6,
29  SSPCalib = 0x7,
30  FakeTrig0 = 0x8,
31  FakeTrig1 = 0x9,
32  FakeTrig2 = 0xa,
33  FakeTrig3 = 0xb,
34  BeamTrig = 0xc,
35  NoBeamTrig = 0xd,
36  ExtFakeTrig= 0xe
37  };
enum dune::TimingCommand
strong
Enumerator
TimeSync 
Echo 
SpillStart 
SpillStop 
RunStart 
RunStop 
WibCalib 
SSPCalib 
FakeTrig0 
FakeTrig1 
FakeTrig2 
FakeTrig3 
BeamTrig 
NoBeamTrig 
ExtFakeTrig 

Definition at line 29 of file TimingFragment.hh.

29  {
30  // From https://twiki.cern.ch/twiki/bin/view/CENF/TimingSystemAdvancedOp retrieved on 2018-10-02
31  // The 'sync' bus has the following commands at the moment:
32  TimeSync = 0x0,
33  Echo = 0x1,
34  SpillStart = 0x2,
35  SpillStop = 0x3,
36  RunStart = 0x4,
37  RunStop = 0x5,
38  WibCalib = 0x6,
39  SSPCalib = 0x7,
40  FakeTrig0 = 0x8,
41  FakeTrig1 = 0x9,
42  FakeTrig2 = 0xa,
43  FakeTrig3 = 0xb,
44  BeamTrig = 0xc,
45  NoBeamTrig = 0xd,
46  ExtFakeTrig = 0xe
47  };

Function Documentation

void dune::display_bits ( void *  memstart,
size_t  nbytes,
std::string  sourcename 
)

Definition at line 10 of file Utilities.cc.

10  {
11 
12  std::stringstream bitstr;
13  bitstr << "The " << nbytes << "-byte chunk of memory beginning at " << static_cast<void*>(memstart) << " is : ";
14 
15  // -- NFB : Nov-20-2015
16  // reversed the order of the bits when printing, so that the msb remain on the left
17  for(unsigned int i = 0; i < nbytes; i++) {
18  // bitstr << std::bitset<8>(*((dune::reinterpret_cast_checked<uint8_t*>(memstart))+(nbytes-i-1))) << " ";
19  bitstr << std::bitset<8>(*((dune::reinterpret_cast_checked<uint8_t*>(memstart))+i)) << " ";
20  }
21 
22  mf::LogInfo(sourcename.c_str()) << bitstr.str();
23 }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::vector<char> dune::FelixCompress ( const dune::FelixFragment frag)

Definition at line 435 of file FelixCompress.hh.

435  {
436  FelixCompressor compressor(frag);
437  std::vector<char> result;
438  compressor.compress_copy(result);
439 
440  return result;
441 }
static QCString result
artdaq::Fragment dune::FelixDecompress ( const std::vector< char > &  buff)

Definition at line 445 of file FelixCompress.hh.

445  {
446  artdaq::Fragment result;
447  const char* src = buff.data();
448 
449  // Read metadata and apply to fragment.
450  const MetaData* meta = reinterpret_cast<MetaData const*>(src);
451  size_t num_frames = meta->num_frames;
452  uint16_t unique_values = meta->unique_values;
453  result.resizeBytes(num_frames * sizeof(FelixFrame));
454  src += sizeof(MetaData);
455 
456  // Handle for filling fragment data.
457  FelixFrame* frame = reinterpret_cast<FelixFrame*>(result.dataBeginBytes());
458 
459  // Access error frames field.
460  std::vector<uint8_t> bad_headers(num_frames/8+1);
461  memcpy(&bad_headers[0], src, num_frames/8+1);
462  src += num_frames / 8 + 1;
463 
464  // Access saved headers and generate headers.
465  unsigned sizeof_header_set = sizeof(WIBHeader) + 4 * sizeof(ColdataHeader);
466  const WIBHeader* whead = reinterpret_cast<WIBHeader const*>(src);
467  std::vector<const ColdataHeader*> chead(4);
468  for(unsigned i = 0; i < 4; ++i) {
469  chead[i] = reinterpret_cast<ColdataHeader const*>(
470  src + sizeof(WIBHeader) + i * sizeof(ColdataHeader));
471  }
472  size_t bad_header_counter = 0;
473  for (unsigned i = 0; i < num_frames; ++i) {
474  const WIBHeader* curr_whead;
475  std::vector<const ColdataHeader*> curr_chead(4);
476  // See if the current headers were bad.
477  bool bad_header = (bad_headers[i / 8] >> (7 - (1 % 8))) & 1;
478  if(bad_header) {
479  ++bad_header_counter;
480  // Set current headers to be the bad one.
481  std::cout << "BAD HEADER\n";
482  curr_whead = reinterpret_cast<WIBHeader const*>(
483  src + bad_header_counter * sizeof_header_set);
484  for (unsigned j = 0; j < 4; ++j) {
485  curr_chead[j] = reinterpret_cast<ColdataHeader const*>(
486  src + bad_header_counter * sizeof_header_set +
487  sizeof(WIBHeader) + j * sizeof(ColdataHeader));
488  }
489  } else {
490  // Set current headers to be the first.
491  curr_whead = whead;
492  for(unsigned j = 0; j < 4; ++j) {
493  curr_chead[j] = chead[j];
494  }
495  }
496  // Assign header fields.
497  (frame + i)->set_sof(curr_whead->sof);
498  (frame + i)->set_version(curr_whead->version);
499  (frame + i)->set_fiber_no(curr_whead->fiber_no);
500  (frame + i)->set_crate_no(curr_whead->crate_no);
501  (frame + i)->set_slot_no(curr_whead->slot_no);
502  (frame + i)->set_mm(curr_whead->mm);
503  (frame + i)->set_oos(curr_whead->oos);
504  (frame + i)->set_wib_errors(curr_whead->wib_errors);
505  (frame + i)->set_timestamp(curr_whead->timestamp() + i * 25);
506  (frame + i)->set_wib_counter(curr_whead->wib_counter());
507  (frame + i)->set_z(curr_whead->z);
508  for(unsigned j = 0; j < 4; ++j) {
509  (frame + i)->set_s1_error(j, curr_chead[j]->s1_error);
510  (frame + i)->set_s2_error(j, curr_chead[j]->s2_error);
511  (frame + i)->set_coldata_convert_count(
512  j, curr_chead[j]->coldata_convert_count + i * 25);
513  (frame + i)->set_error_register(j, curr_chead[j]->error_register);
514  }
515  }
516  src += (bad_header_counter+1) * sizeof_header_set;
517 
518  // Read frequency table and generate a Huffman tree.
519  std::unordered_map<uint16_t, unsigned> freq_table;
520  for (unsigned i = 0; i < unique_values; ++i) {
521  const uint16_t* v = reinterpret_cast<uint16_t const*>(src);
522  const uint32_t* f =
523  reinterpret_cast<uint32_t const*>(src + sizeof(uint16_t));
524  freq_table[*v] = *f;
525  src += sizeof(uint16_t) + sizeof(uint32_t);
526  }
527  std::vector<HuffTree::Node> nodes;
528  for (auto p : freq_table) {
529  HuffTree::Node curr_node;
530  curr_node.value = p.first;
531  curr_node.frequency = p.second;
532  nodes.push_back(curr_node);
533  }
534  HuffTree hufftree;
535  hufftree.make_tree(nodes);
536 
537  // Read ADC values from the buffer.
538  size_t bits_read = 0;
539  for (unsigned i = 0; i < num_frames * 256; ++i) {
540  // Pointer to walk through the tree.
541  HuffTree::Node* pnode = hufftree.root;
542  while (pnode->left != NULL) {
543  if (*src >> (bits_read % 8) & 1) { // Next bit is 1.
544  pnode = pnode->right;
545  } else { // Next bit is 0.
546  pnode = pnode->left;
547  }
548  // Increment bits read and possibly the source pointer.
549  ++bits_read;
550  if (bits_read % 8 == 0) {
551  ++src; // Next byte reached.
552  }
553  }
554  // Value reached.
555  adc_t found_val = pnode->value;
556 #ifdef PREV
557  if (i % num_frames != 0) {
558  found_val += (frame + i % num_frames - 1)->channel(i / num_frames);
559  }
560 #endif
561  (frame + i % num_frames)->set_channel(i / num_frames, found_val);
562  }
563 
564  return result;
565 }
uint16_t adc_t
Definition: FelixFormat.hh:18
QMapNodeBase * left
Definition: qmap.h:51
static QCString result
QMapNodeBase Node
Definition: qmap.cpp:41
uint8_t channel
Definition: CRTFragment.hh:201
#define nodes
p
Definition: test.py:223
QMapNodeBase * right
Definition: qmap.h:52
artdaq::Fragment dune::FelixReorder ( const uint8_t *  src,
const uint16_t &  num_frames = 6000 
)

Definition at line 91 of file FelixReordererFacility.hh.

92  {
93  artdaq::Fragment result;
94  dune::FelixFragmentBase::Metadata meta = {0xabc, 1, 1, 0, num_frames, 0, num_frames};
95  result.setMetadata(meta);
96  result.resizeBytes(num_frames * (256*sizeof(adc_t) + sizeof(WIBHeader) + 4*sizeof(ColdataHeader))+ (num_frames+7)/8);
97  uint8_t *dest = result.dataBeginBytes();
98 
99  ReorderFacility facility(false);
100  facility.do_reorder_start(num_frames);
101  facility.do_reorder(dest, src, num_frames);
102  std::cout << "INFO: " << facility.get_info() << '\n';
103  unsigned size = facility.reorder_final_size();
104  result.resizeBytes(size);
105 
106  return result;
107 }
uint16_t adc_t
Definition: FelixFormat.hh:18
static QCString result
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
std::string dune::fragmentTypeToString ( FragmentType  val)

Definition at line 24 of file FragmentType.cc.

25 {
26  if (val < FragmentType::INVALID) {
27  return names[val - FragmentType::MISSED];
28  }
29  else {
30  return "INVALID/UNKNOWN";
31  }
32 }
static std::vector< std::string > const names
Definition: FragmentType.hh:8
artdaq::Fragments dune::getHandleChecked ( const art::Event evt,
const std::string label,
const std::string fragtype,
const bool inContainer 
)

Definition at line 14 of file RawDecodingUtils.cc.

15  {
16 
17  artdaq::Fragments fragments;
18 
19 /*
20  art::Handle<artdaq::Fragments> handleFragments;
21 
22  if (expectFragsInContainer) {
23  art::InputTag itag1(label, "Container");
24  handleFragments = evt.getHandle<artdaq::Fragments>(itag1);
25  }
26  else {
27  art::inputTag itag2(label, fragtype);
28  handleFragments = evt.getHandle<artdaq::Fragments>(itag2);
29  }
30 
31  if(!handleFragments.isValid()) {
32  std::cerr << "Run: " << evt.run()
33  << ", SubRun: " << evt.subRun()
34  << ", Event: " << evt.event()
35  << " is NOT VALID" << std::endl;
36 
37  if (expectFragsInContainer) {
38  //throw cet::exception("getHandleChecked") << "getHandle call for fragments of type \"Container\" NOT VALID";
39  throw std::runtime_error("(THIS SHOULD BE CHANGED TO A cet::exception) getHandle call for fragments NOT VALID");
40  } else {
41  // throw cet::exception("getHandleChecked") << "getHandle call for fragments of type \"" << fragtype << "\" NOT VALID";
42  throw std::runtime_error("(THIS SHOULD BE CHANGED TO A cet::exception) getHandle call for fragments NOT VALID");
43  }
44  }
45  if (expectFragsInContainer) {
46 
47  for (auto cont : *handleFragments)
48  {
49  artdaq::ContainerFragment contf(cont);
50 
51  for (size_t ii = 0; ii < contf.block_count(); ++ii)
52  {
53  size_t fragSize = contf.fragSize(ii);
54  artdaq::Fragment thisfrag;
55  thisfrag.resizeBytes(fragSize);
56 
57  std::cout << "Copying " << fragSize << " bytes from " << contf.at(ii) << " to " << thisfrag.headerAddress() << std::endl;
58  memcpy(thisfrag.headerAddress(), contf.at(ii), fragSize);
59 
60  std::cout << "Putting new fragment into output vector" << std::endl;
61  fragments.emplace_back(thisfrag);
62  }
63  }
64  } else {
65 
66  for(auto const& frag: *handleFragments){
67  fragments.emplace_back( frag );
68  }
69  }
70 */
71  // C++11 will move, rather than copy, a vector on return
72  return fragments;
73 }
std::vector< Fragment > Fragments
Definition: HDF5Utils.h:57
std::map< artdaq::Fragment::type_t, std::string > dune::makeFragmentTypeMap ( )

Definition at line 35 of file FragmentType.cc.

36 {
37  auto output = artdaq::Fragment::MakeSystemTypeMap();
38  for (auto name : names)
39  {
41  }
42  return output;
43 }
static QCString name
Definition: declinfo.cpp:673
FragmentType toFragmentType(std::string t_string)
Definition: FragmentType.cc:10
static std::vector< std::string > const names
Definition: FragmentType.hh:8
std::ostream& dune::operator<< ( std::ostream &  out,
CTBFragment const &  f 
)

Definition at line 6 of file CTBFragment.cc.

6  {
7 
8  out << "Fragment size: " << f.artdaq_Fragment_.dataSizeBytes() << " -> " << f._n_words << " words" << std::endl ;
9 
10  for ( unsigned int i = 0; i < f.NWords() ; ++i ) {
11 
12  if ( f.Trigger(i) ) {
13  out << "Trigger word " << std::hex << f.Trigger(i) -> word_type
14  << ", payload: " << f.Trigger(i) -> trigger_word
15  << ", TS: " << f.Trigger(i) -> timestamp << std::dec << std::endl ;
16  }
17  else if ( f.ChStatus(i) ) {
18  out << "Check Status word " << std::hex
19  << " PDS " << f.ChStatus(i) -> get_pds()
20  << ", CRT: " << f.ChStatus(i) -> get_crt()
21  << ", Beam: " << f.ChStatus(i) -> get_beam()
22  << ", TS: " << f.ChStatus(i) -> timestamp
23  << std::dec << std::endl ;
24 
25  }
26  else if ( f.Feedback(i) ) {
27  out << "Feedback word " << std::hex
28  << ", Padding: " << f.Feedback(i) -> padding
29  << ", Source: " << f.Feedback(i) -> source
30  << ", Code: " << f.Feedback(i) -> code
31  << ", TS: " << f.Feedback(i) -> timestamp << std::dec << std::endl ;
32 
33  }
34  else {
35  out << "type: " << std::hex << f.Word(i) -> word_type
36  << ", payload: " << f.Word(i) -> payload
37  << ", TS: " << f.Word(i) -> timestamp << std::dec << std::endl ;
38  }
39 
40  }
41 
42 
43  return out ;
44  }
QTextStream & hex(QTextStream &s)
CodeOutputInterface * code
QTextStream & dec(QTextStream &s)
QTextStream & endl(QTextStream &s)
std::ostream & dune::operator<< ( std::ostream &  os,
ToyFragment const &  f 
)

Definition at line 30 of file ToyFragment.cc.

30  {
31  os << "ToyFragment event size: "
32  << f.hdr_event_size()
33  << ", run number: "
34  << f.hdr_run_number()
35  << "\n";
36 
37  return os;
38 }
std::ostream & dune::operator<< ( std::ostream &  os,
SSPFragment const &  f 
)

Definition at line 21 of file SSPFragment.cc.

21  {
22  os << "SSPFragment event size: "
23  << f.hdr_event_size()
24  << ", run number: "
25  << f.hdr_run_number()
26  << "\n";
27 
28  return os;
29 }
std::ostream & dune::operator<< ( std::ostream &  os,
TimingFragment const &  f 
)

Definition at line 3 of file TimingFragment.cc.

3  {
4  os << "TimingFragment size=" << std::dec << f.size()
5  << ", cookie 0x" << std::hex << f.get_cookie()
6  << ", scmd 0x" << std::hex << f.get_scmd()
7  << ", tcmd 0x" << std::hex << f.get_tcmd()
8  << ", timestamp 0x" << std::hex << f.get_tstamp()
9  << ", evtctr=" << std::dec << f.get_evtctr()
10  << ", cksum 0x" << std::hex << f.get_cksum()
11  << ", last_run_start 0x" << std::hex << f.get_last_runstart_timestamp()
12  << ", last_spill_start 0x"<< std::hex << f.get_last_spillstart_timestamp()
13  << ", last_spill_end 0x" << std::hex << f.get_last_spillend_timestamp()
14 
15  << std::dec << "\n";
16 
17  return os;
18 }
QTextStream & hex(QTextStream &s)
QTextStream & dec(QTextStream &s)
const Frame14Fragment* dune::ParseFrame14Fragment ( const artdaq::Fragment &  fragment)

Definition at line 187 of file Frame14Fragment.hh.

187  {
188  // const Frame14Fragment::Metadata *meta = fragment.metadata<Frame14Fragment::Metadata>();
189  // Check meta and potentially return a different unpacker
190  return new Frame14FragmentUnordered(fragment);
191 }
template<typename S , typename T >
S dune::reinterpret_cast_checked ( inptr)

Definition at line 28 of file Utilities.hh.

28  {
29 
30  S outptr = reinterpret_cast<S>( inptr );
31 
32  const void* inptr_void = static_cast<const void*>( inptr );
33  const void* outptr_void = static_cast<const void*>( outptr );
34 
35  if ( inptr_void != outptr_void ) {
36  throw cet::exception("reinterpret_cast_checked") << "Error: reinterpret_cast casted " << inptr_void << " to " << outptr_void << " => results of the cast can't be trusted";
37  }
38 
39  return outptr;
40 }
Definition: 044_section.h:5
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
dune::FragmentType dune::toFragmentType ( std::string  t_string)

Definition at line 10 of file FragmentType.cc.

11 {
12  std::transform(t_string.begin(),
13  t_string.end(),
14  t_string.begin(),
15  toupper);
16  auto it = std::find(names.begin(), names.end(), t_string);
17  return (it == names.end()) ?
19  static_cast<FragmentType>(artdaq::Fragment::FirstUserFragmentType +
20  (it - names.begin()));
21 }
static std::vector< std::string > const names
Definition: FragmentType.hh:8

Variable Documentation

class dune::Frame14Fragmentstruct dune::frame14::__attribute__ dune::aligned
std::vector<std::string> const dune::names
static
Initial value:
{ "MISSED",
"TPC",
"PHOTON",
"TRIGGER",
"TIMING",
"TOY1",
"TOY2",
"FELIX",
"CRT",
"CTB",
"CPUHITS",
"DEVBOARDHITS",
"FRAME14",
"UNKNOWN" }

Definition at line 8 of file FragmentType.hh.