All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
sbndaq::BernCRTAna Class Reference
Inheritance diagram for sbndaq::BernCRTAna:

Public Member Functions

 BernCRTAna (fhicl::ParameterSet const &pset)
 
virtual ~BernCRTAna ()
 
virtual void analyze (art::Event const &evt)
 

Private Member Functions

bool IsSideCRT (icarus::crt::BernCRTTranslator &hit)
 
bool IsTopCRT (icarus::crt::BernCRTTranslator &hit)
 

Private Attributes

TTree * hits
 
uint8_t mac5
 
uint16_t flags
 
uint16_t lostcpu
 
uint16_t lostfpga
 
uint32_t ts0
 
uint32_t ts1
 
uint16_t adc [32]
 
uint32_t coinc
 
int subSys
 
uint64_t run_start_time
 
uint64_t this_poll_start
 
uint64_t this_poll_end
 
uint64_t last_poll_start
 
uint64_t last_poll_end
 
int32_t system_clock_deviation
 
uint32_t feb_hits_in_poll
 
uint32_t feb_hit_number
 
uint32_t sequence_id
 
uint64_t fragment_timestamp
 
uint64_t last_accepted_timestamp
 
uint16_t lost_hits
 
uint16_t hits_in_fragment
 

Detailed Description

Definition at line 32 of file BernCRTAna_module.cc.

Constructor & Destructor Documentation

sbndaq::BernCRTAna::BernCRTAna ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 76 of file BernCRTAna_module.cc.

77  : EDAnalyzer(pset)
78 {
79 
80  art::ServiceHandle<art::TFileService> tfs; //pointer to a file named tfs
81 
82  hits = tfs->make<TTree>("hits", "FEB hits");
83 
84  hits->Branch("mac5", &mac5, "mac5/b");
85  hits->Branch("flags", &flags, "flags/s");
86  hits->Branch("lostcpu", &lostcpu, "lostcpu/s");
87  hits->Branch("lostfpga", &lostfpga, "lostfpga/s");
88  hits->Branch("ts0", &ts0, "ts0/i");
89  hits->Branch("ts1", &ts1, "ts1/i");
90  hits->Branch("adc", &adc, "adc[32]/s");
91  hits->Branch("coinc", &coinc, "coinc/i");
92  hits->Branch("subSys", &subSys, "subSys/i");
93 
94  hits->Branch("run_start_time", &run_start_time, "run_start_time/l");
95  hits->Branch("this_poll_start", &this_poll_start, "this_poll_start/l");
96  hits->Branch("this_poll_end", &this_poll_end, "this_poll_end/l");
97  hits->Branch("last_poll_start", &last_poll_start, "last_poll_start/l");
98  hits->Branch("last_poll_end", &last_poll_end, "last_poll_end/l");
99  hits->Branch("system_clock_deviation", &system_clock_deviation, "system_clock_deviation/I");
100  hits->Branch("feb_hits_in_poll", &feb_hits_in_poll, "feb_hits_in_poll/i");
101  hits->Branch("feb_hit_number", &feb_hit_number, "feb_hit_number/i");
102 
103  hits->Branch("sequence_id", &sequence_id, "sequence_id/i");
104  hits->Branch("fragment_timestamp", &fragment_timestamp, "fragment_timestamp/l");
105 
106  hits->Branch("last_accepted_timestamp", &last_accepted_timestamp, "last_accepted_timestamp/l");
107  hits->Branch("lost_hits", &lost_hits, "lost_hits/s");
108  hits->Branch("hits_in_fragment", &hits_in_fragment, "hits_in_fragment/s");
109 
110 }
art::ServiceHandle< art::TFileService > tfs
uint64_t last_accepted_timestamp
sbndaq::BernCRTAna::~BernCRTAna ( )
virtual

Definition at line 125 of file BernCRTAna_module.cc.

126 {
127 }

Member Function Documentation

void sbndaq::BernCRTAna::analyze ( art::Event const &  evt)
virtual

Definition at line 129 of file BernCRTAna_module.cc.

129  {
130 
131  //WK 09/02/21. Update to BernCRTTranslator in sbndaq_artdaq_core
132  std::vector<icarus::crt::BernCRTTranslator> hit_vector;
133 
134  auto fragmentHandles = evt.getMany<artdaq::Fragments>();
135  for (auto handle : fragmentHandles) {
136  if (!handle.isValid() || handle->size() == 0)
137  continue;
138 
139  auto this_hit_vector = icarus::crt::BernCRTTranslator::getCRTData(*handle);
140 
141  hit_vector.insert(hit_vector.end(),this_hit_vector.begin(),this_hit_vector.end());
142 
143  }
144 
145  for(auto & hit : hit_vector) {
146  // TLOG(TLVL_INFO)<<hit;
147 
148  if(IsSideCRT(hit)){
149  subSys = 1;
150  }
151  else if(IsTopCRT(hit)){
152  subSys = 0;
153  }
154  else{
155  subSys = 2;
156  }
157  fragment_timestamp = hit.timestamp;
158  sequence_id = hit.sequence_id;
159 
160  mac5 = hit.mac5;
161  flags = hit.flags;
162  lostcpu = hit.lostcpu;
163  lostfpga = hit.lostfpga;
164  ts0 = hit.ts0;
165  ts1 = hit.ts1;
166  coinc = hit.coinc;
167 
168  for(int ch=0; ch<32; ch++) adc[ch] = hit.adc[ch];
169 
170  run_start_time = hit.run_start_time;
171  this_poll_start = hit.this_poll_start;
172  this_poll_end = hit.this_poll_end;
173  last_poll_start = hit.last_poll_start;
174  last_poll_end = hit.last_poll_end;
175  system_clock_deviation = hit.system_clock_deviation;
176  feb_hits_in_poll = hit.hits_in_poll;
177  feb_hit_number = hit.feb_hit_number;
178 
179  last_accepted_timestamp = hit.last_accepted_timestamp;
180  lost_hits = hit.lost_hits;
181  hits_in_fragment = hit.hits_in_fragment;
182 
183  hits->Fill();
184  }
185 } //analyze
process_name hit
Definition: cheaterreco.fcl:51
bool IsTopCRT(icarus::crt::BernCRTTranslator &hit)
bool IsSideCRT(icarus::crt::BernCRTTranslator &hit)
TCEvent evt
Definition: DataStructs.cxx:8
uint64_t last_accepted_timestamp
bool sbndaq::BernCRTAna::IsSideCRT ( icarus::crt::BernCRTTranslator &  hit)
private
  • Fragment ID described in SBN doc 16111

Definition at line 112 of file BernCRTAna_module.cc.

112  {
113  /**
114  * * Fragment ID described in SBN doc 16111
115  * */
116  return (hit.fragment_ID & 0x3100) == 0x3100;
117 }
process_name hit
Definition: cheaterreco.fcl:51
bool sbndaq::BernCRTAna::IsTopCRT ( icarus::crt::BernCRTTranslator &  hit)
private
  • * Fragment ID described in SBN doc 16111

Definition at line 118 of file BernCRTAna_module.cc.

118  {
119  /**
120  * * * Fragment ID described in SBN doc 16111
121  * * */
122  return (hit.fragment_ID & 0x3200) == 0x3200;
123 }
process_name hit
Definition: cheaterreco.fcl:51

Member Data Documentation

uint16_t sbndaq::BernCRTAna::adc[32]
private

Definition at line 52 of file BernCRTAna_module.cc.

uint32_t sbndaq::BernCRTAna::coinc
private

Definition at line 53 of file BernCRTAna_module.cc.

uint32_t sbndaq::BernCRTAna::feb_hit_number
private

Definition at line 65 of file BernCRTAna_module.cc.

uint32_t sbndaq::BernCRTAna::feb_hits_in_poll
private

Definition at line 64 of file BernCRTAna_module.cc.

uint16_t sbndaq::BernCRTAna::flags
private

Definition at line 47 of file BernCRTAna_module.cc.

uint64_t sbndaq::BernCRTAna::fragment_timestamp
private

Definition at line 69 of file BernCRTAna_module.cc.

TTree* sbndaq::BernCRTAna::hits
private

Definition at line 42 of file BernCRTAna_module.cc.

uint16_t sbndaq::BernCRTAna::hits_in_fragment
private

Definition at line 72 of file BernCRTAna_module.cc.

uint64_t sbndaq::BernCRTAna::last_accepted_timestamp
private

Definition at line 70 of file BernCRTAna_module.cc.

uint64_t sbndaq::BernCRTAna::last_poll_end
private

Definition at line 62 of file BernCRTAna_module.cc.

uint64_t sbndaq::BernCRTAna::last_poll_start
private

Definition at line 61 of file BernCRTAna_module.cc.

uint16_t sbndaq::BernCRTAna::lost_hits
private

Definition at line 71 of file BernCRTAna_module.cc.

uint16_t sbndaq::BernCRTAna::lostcpu
private

Definition at line 48 of file BernCRTAna_module.cc.

uint16_t sbndaq::BernCRTAna::lostfpga
private

Definition at line 49 of file BernCRTAna_module.cc.

uint8_t sbndaq::BernCRTAna::mac5
private

Definition at line 46 of file BernCRTAna_module.cc.

uint64_t sbndaq::BernCRTAna::run_start_time
private

Definition at line 58 of file BernCRTAna_module.cc.

uint32_t sbndaq::BernCRTAna::sequence_id
private

Definition at line 68 of file BernCRTAna_module.cc.

int sbndaq::BernCRTAna::subSys
private

Definition at line 54 of file BernCRTAna_module.cc.

int32_t sbndaq::BernCRTAna::system_clock_deviation
private

Definition at line 63 of file BernCRTAna_module.cc.

uint64_t sbndaq::BernCRTAna::this_poll_end
private

Definition at line 60 of file BernCRTAna_module.cc.

uint64_t sbndaq::BernCRTAna::this_poll_start
private

Definition at line 59 of file BernCRTAna_module.cc.

uint32_t sbndaq::BernCRTAna::ts0
private

Definition at line 50 of file BernCRTAna_module.cc.

uint32_t sbndaq::BernCRTAna::ts1
private

Definition at line 51 of file BernCRTAna_module.cc.


The documentation for this class was generated from the following file: