PennToOffline.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // File: PennToOffline.cc
3 // Author: Karl Warburton (Oct 2015)
4 //
5 // Utility to provide methods for reformatting the raw online PENN data
6 // into a structure which can be used in the splitter.
7 // Heavily uses lbne-artdaq/OnlineMonitoring/DataReformatter.cxx as a
8 // template (written by N. Barros, D. Brailsford, M. Wallbank, )
9 ////////////////////////////////////////////////////////////////////////
10 
11 #include "PennToOffline.h"
12 #include <map>
13 #include <iostream>
14 #include <iomanip>
15 //=======================================================================================
16 std::vector<raw::ExternalTrigger>
17 DAQToOffline::PennFragmentToExternalTrigger( artdaq::Fragments const& Fragments, std::map<int,int>& channelMap, lbne::PennMicroSlice::Payload_Timestamp *&FirstPTBTimestamp ) {
18 
19  std::vector<raw::ExternalTrigger> ExternTrigs;
20 
21  std::vector<lbne::PennMicroSlice::Payload_Trigger::trigger_type_t> trigger_types = {lbne::PennMicroSlice::Payload_Trigger::TA, // The 'telescope' coincidence...........110
22  lbne::PennMicroSlice::Payload_Trigger::TB, // North upper, South lower coincidence..112
23  lbne::PennMicroSlice::Payload_Trigger::TC, // North lower, South upper coincidence..113
24  lbne::PennMicroSlice::Payload_Trigger::TD};// East lower, West upper coincidence....111
25  std::vector<lbne::PennMicroSlice::Payload_Trigger::trigger_type_t> calib_types = {lbne::PennMicroSlice::Payload_Trigger::C1,
26  lbne::PennMicroSlice::Payload_Trigger::C2,
27  lbne::PennMicroSlice::Payload_Trigger::C3,
28  lbne::PennMicroSlice::Payload_Trigger::C4};
29  std::vector<lbne::PennMicroSlice::Payload_Timestamp::timestamp_t> fCounterTimes;
30  std::vector<lbne::PennMicroSlice::Payload_Timestamp::timestamp_t> fMuonTriggerTimes;
31  std::vector<lbne::PennMicroSlice::Payload_Timestamp::timestamp_t> fSSPTriggerTimes;
32  //std::vector<lbne::PennMicroSlice::Payload_Timestamp::timestamp_t> fRCETriggerTimes;
33  std::vector<lbne::PennMicroSlice::Payload_Timestamp::timestamp_t> fCalibrationTriggerTimes;
34 
35  std::vector<lbne::PennMicroSlice::Payload_Counter> fCounterWords;
36  std::vector<lbne::PennMicroSlice::Payload_Trigger> fMuonTriggers;
37  std::vector<lbne::PennMicroSlice::Payload_Trigger> fSSPTriggers;
38  //std::vector<lbne::PennMicroSlice::Payload_Trigger> fRCETriggers;
39  std::vector<lbne::PennMicroSlice::Payload_Trigger> fCalibrationTriggers;
40 
41  //std::cout << "There are " << Fragments.size() << " fragments" << std::endl;
42  for ( size_t idx = 0; idx < Fragments.size(); ++idx ) {
43  const auto& frag(Fragments[idx]);
44 
45  //Get the PennMilliSliceFragment from the artdaq fragment
46  lbne::PennMilliSliceFragment msf(frag);
47 
48  lbne::PennMicroSlice::Payload_Header *word_header = nullptr;
49  lbne::PennMicroSlice::Payload_Counter *word_p_counter = nullptr;
50  lbne::PennMicroSlice::Payload_Trigger *word_p_trigger = nullptr;
51  lbne::PennMicroSlice::Payload_Timestamp *previous_timestamp = nullptr;
52  lbne::PennMicroSlice::Payload_Header *future_timestamp_header = nullptr;
53  lbne::PennMicroSlice::Payload_Timestamp *future_timestamp = nullptr;
54  uint8_t* payload_data = nullptr;
55  uint32_t payload_index = 0;
56 
57  uint16_t counter, trigger, timestamp, payloadCount;
58  payloadCount = msf.payloadCount(counter, trigger, timestamp);
59 
60  //std::cout << "There are a total of " << counter << " counters, " << trigger << " triggers, " << timestamp << " timestamps, giving a total of " << payloadCount << std::endl;
61 
62  while (payload_index < uint32_t(payloadCount-1) ) {
63  payload_data = msf.get_next_payload(payload_index,word_header);
64  //std::cout << "\nGot payload data " << payload_data << " for index " << payload_index << std::endl;
65  if (payload_data == nullptr)
66  continue;
67  switch(word_header->data_packet_type) {
68 
69  case lbne::PennMicroSlice::DataTypeCounter:
70  word_p_counter = reinterpret_cast<lbne::PennMicroSlice::Payload_Counter*>(payload_data);
71  fCounterWords.push_back(*word_p_counter);
72  GetTimestamp( msf, word_header, previous_timestamp, future_timestamp, future_timestamp_header, fCounterTimes );
73  //std::cout << "Got a counter " << word_p_counter << " with timestamp " << fCounterTimes.back() << std::endl;
74  break; // Counter Type
75 
76  case lbne::PennMicroSlice::DataTypeTrigger:
77  word_p_trigger = reinterpret_cast<lbne::PennMicroSlice::Payload_Trigger*>(payload_data);
78 
79  if (word_p_trigger->has_muon_trigger()) { // If a 'Muon Trigger' ie counter coincidence
80  fMuonTriggers.push_back(*word_p_trigger);
81  GetTimestamp( msf, word_header, previous_timestamp, future_timestamp, future_timestamp_header, fMuonTriggerTimes );
82  //std::cout << "It is a Muon Trigger " << word_p_trigger << " with timestamp " << fMuonTriggerTimes.back() << std::endl;
83  }
84  if (word_p_trigger->has_ssp_trigger()) { // If an 'SSP Trigger'
85  fSSPTriggers.push_back(*word_p_trigger);
86  GetTimestamp( msf, word_header, previous_timestamp, future_timestamp, future_timestamp_header, fSSPTriggerTimes );
87  //std::cout << "It is an SSP Trigger " << word_p_trigger << " with timestamp " << fSSPTriggerTimes.back() << std::endl;
88  }
89  /*
90  if (word_p_trigger->has_rce_trigger() ) { // If an 'RCE Trigger'
91  fRCETriggers.push_back(*word_p_trigger);
92  GetTimestamp( msf, word_header, previous_timestamp, future_timestamp, future_timestamp_header, fRCETriggerTimes );
93  //std::cout << "It is an RCE Trigger " << word_p_trigger << " with timestamp " << fRCETriggerTimes.back() << std::endl;
94  }
95  */
96  if (word_p_trigger->has_calibration()) { // If a 'Calibration Trigger'
97  fCalibrationTriggers.push_back(*word_p_trigger);
98  GetTimestamp( msf, word_header, previous_timestamp, future_timestamp, future_timestamp_header, fCalibrationTriggerTimes );
99  //std::cout << "It is a Calibration Trigger " << word_p_trigger << " with timestamp " << fCalibrationTriggerTimes.back() << std::endl;
100  }
101 
102  break; // Trigger Type
103 
104  case lbne::PennMicroSlice::DataTypeTimestamp:
105  previous_timestamp = reinterpret_cast<lbne::PennMicroSlice::Payload_Timestamp*>(payload_data);
106  if (FirstPTBTimestamp == nullptr) FirstPTBTimestamp = previous_timestamp;
107  //std::cout << "Got a timestamp " << previous_timestamp << " " << previous_timestamp->nova_timestamp << ", the first timestamp in this event is " << FirstPTBTimestamp << " " << FirstPTBTimestamp->nova_timestamp << std::endl;
108  break; // Timestamp Type
109 
110  default:
111  //std::cout << "It isn't a counter, trigger or timestamp. It is a " << std::bitset<3>(word_header->data_packet_type) << std::endl;
112  break; // Default case - do nothing.
113  } // switch/case
114  }
115  } // NumFragments
116 
117  // *************** Now I want to loop over all counters and find out when they turned on to make ExternalTriggers ****************
118  for (int counter_index=0; counter_index<98; ++counter_index ) {
119  bool counter_previously_on = true;
120  for (uint32_t pos = 0; pos < fCounterWords.size(); ++pos) {
121  bool counter_currently_on = fCounterWords.at(pos).get_counter_status(counter_index);
122  //std::cout << "Looking at counter " << counter_index << " which in the map is channel " << channelMap[counter_index]
123  // << ", position " << pos << ", PrevOn? " << counter_previously_on << ", NowOn? " << counter_currently_on << std::endl;
124  bool MakeNewExtCount = MakeNewExtTrig(pos, counter_previously_on, counter_currently_on);
125  if (MakeNewExtCount) {
126  raw::ExternalTrigger counter( channelMap[counter_index], fCounterTimes.at(pos) );
127  ExternTrigs.push_back(counter);
128  //std::cout << "Made my new trigger, TrigID " << ExternTrigs.back().GetTrigID() << " (" << counter.GetTrigID() << ") TrigTime "
129  // << ExternTrigs.back().GetTrigTime() << " (" << counter.GetTrigTime() << ")" << std::endl;
130  }
131  } // Loop over counter word size
132  } // Loop over channels.
133 
134  // *************** Now to loop through 'MUON TRIGGERS' ****************
135  bool trigA_previously_on = false, trigB_previously_on = false, trigC_previously_on = false, trigD_previously_on = false;
136  for (uint32_t pos = 0; pos < fMuonTriggers.size(); ++pos) {
137  bool trigA_currently_on = fMuonTriggers.at(pos).has_muon_TA();
138  bool trigB_currently_on = fMuonTriggers.at(pos).has_muon_TB();
139  bool trigC_currently_on = fMuonTriggers.at(pos).has_muon_TC();
140  bool trigD_currently_on = fMuonTriggers.at(pos).has_muon_TD();
141  lbne::PennMicroSlice::Payload_Timestamp::timestamp_t current_trigger_time = fMuonTriggerTimes.at(pos);
142  bool MakeNewExtTrigA, MakeNewExtTrigB, MakeNewExtTrigC, MakeNewExtTrigD;
143  if (pos == 0) {
144  MakeNewExtTrigA = trigA_previously_on = trigA_currently_on;
145  MakeNewExtTrigB = trigA_previously_on = trigB_currently_on;
146  MakeNewExtTrigC = trigA_previously_on = trigC_currently_on;
147  MakeNewExtTrigD = trigA_previously_on = trigD_currently_on;
148  } else {
149  MakeNewExtTrigA = MakeNewExtTrig( pos, trigA_previously_on, trigA_currently_on );
150  MakeNewExtTrigB = MakeNewExtTrig( pos, trigB_previously_on, trigB_currently_on );
151  MakeNewExtTrigC = MakeNewExtTrig( pos, trigC_previously_on, trigC_currently_on );
152  MakeNewExtTrigD = MakeNewExtTrig( pos, trigD_previously_on, trigD_currently_on );
153  }
154  //std::cout << "Looking at element " << pos << " of " << fMuonTriggers.size() << "." << std::endl;
155  //std::cout << "Trigs prev on (A,B,C,D) (" << trigA_previously_on <<","<< trigB_previously_on <<","<< trigC_previously_on <<","<< trigD_previously_on <<")." << std::endl;
156  //std::cout << "And now (" << trigA_currently_on <<","<< trigB_currently_on <<","<< trigC_currently_on <<","<< trigD_currently_on << ")." << std::endl;;
157  //std::cout << "So do I make a trigger? (" << MakeNewExtTrigA <<","<< MakeNewExtTrigB <<","<< MakeNewExtTrigC <<","<< MakeNewExtTrigD <<")."<< std::endl;
158  if (MakeNewExtTrigA) {
159  //std::cout << "Making an external trigger from Trigger A!!" << std::endl;
160  raw::ExternalTrigger counter( 110, current_trigger_time );
161  ExternTrigs.push_back(counter);
162  }
163  if (MakeNewExtTrigB) {
164  //std::cout << "Making an external trigger from Trigger B!!" << std::endl;
165  raw::ExternalTrigger counter( 112, current_trigger_time );
166  ExternTrigs.push_back(counter);
167  }
168  if (MakeNewExtTrigC) {
169  //std::cout << "Making an external trigger from Trigger C!!" << std::endl;
170  raw::ExternalTrigger counter( 113, current_trigger_time );
171  ExternTrigs.push_back(counter);
172  }
173  if (MakeNewExtTrigD) {
174  //std::cout << "Making an external trigger from Trigger D!!" << std::endl;
175  raw::ExternalTrigger counter( 111, current_trigger_time );
176  ExternTrigs.push_back(counter);
177  }
178  } // Loop over Muon Triggers
179 
180  // *************** Now to loop through 'SSP TRIGGERS' ****************
181  for (uint32_t pos = 0; pos < fSSPTriggers.size(); ++pos) {
182  //std::cout << "Making an external trigger from SSP trigger!!" << std::endl;
183  lbne::PennMicroSlice::Payload_Timestamp::timestamp_t current_trigger_time = fSSPTriggerTimes.at(pos);
184  raw::ExternalTrigger counter( 115, current_trigger_time );
185  }
186 
187  // *************** Now to loop through 'RCE TRIGGERS' ****************
188  /*
189  for (uint32_t pos = 0; pos < fRCETriggers.size(); ++pos) {
190  //std::cout << "Making an external trigger from RCE trigger!!" << std::endl;
191  lbne::PennMicroSlice::Payload_Timestamp::timestamp_t current_trigger_time = fRCETriggerTimes.at(pos);
192  raw::ExternalTrigger counter( 116, current_trigger_time ); // WHAT CHANNEL DOES AN RCE TRIGGER GO ON!!!????
193  }
194  */
195 
196  //std::cout << "\n\nAll done, lets loop through ExternTrigs...." << std::endl;
197  for ( std::vector<raw::ExternalTrigger>::const_iterator TrigIt = ExternTrigs.begin(); TrigIt != ExternTrigs.end(); TrigIt++ ) {
198  //std::cout << "Looking at index " << std::distance((std::vector<raw::ExternalTrigger>::const_iterator)ExternTrigs.begin(), TrigIt) << " which has indexes " << TrigIt->GetTrigID() << ", " << TrigIt->GetTrigTime() << std::endl;
199  }
200 
201  return ExternTrigs;
202 }
203 //=======================================================================================
204 void DAQToOffline::GetTimestamp( lbne::PennMilliSliceFragment msf,
205  lbne::PennMicroSlice::Payload_Header*& word_header,
206  lbne::PennMicroSlice::Payload_Timestamp* const& previous_timestamp,
207  lbne::PennMicroSlice::Payload_Timestamp*& future_timestamp,
208  lbne::PennMicroSlice::Payload_Header*& future_timestamp_header,
209  std::vector<lbne::PennMicroSlice::Payload_Timestamp::timestamp_t> &TimeVector ) {
210 
211  if (previous_timestamp != nullptr) {
212  TimeVector.push_back(word_header->get_full_timestamp_post(previous_timestamp->nova_timestamp));
213  } else {
214  if (future_timestamp == nullptr) {
215  future_timestamp = reinterpret_cast<lbne::PennMicroSlice::Payload_Timestamp*>(msf.get_next_timestamp(future_timestamp_header));
216  if (future_timestamp == nullptr) {
217  std::cerr << "CAN'T FIND PTB TIMESTAMP WORDS IN MILLISLICE FRAGMENT!!! Logic will fail." << std::endl;
218  return;
219  }
220  }
221  TimeVector.push_back(word_header->get_full_timestamp_pre(future_timestamp->nova_timestamp));
222  }
223  return;
224 }
225 //=======================================================================================
226 bool DAQToOffline::MakeNewExtTrig( uint32_t pos, bool &PrevOn, bool NowOn ) {
227  if (pos == 0 && NowOn )
228  return false;
229  else if (PrevOn && NowOn )
230  return false;
231  else if (PrevOn && !NowOn) {
232  PrevOn = false;
233  return false;
234  } else if (!PrevOn && !NowOn )
235  return false;
236  else if (!PrevOn && NowOn) {
237  PrevOn = true;
238  return true;
239  } else {
240  std::cout<<"ERROR IN PTBFORMATTER'S LOGIC IN COUNTER ANALYSIS"<<std::endl; //We should never get here
241  return false;
242  }
243 }
244 //=======================================================================================
245 void DAQToOffline::BuildPTBChannelMap(std::string MapDir, std::string MapFile, std::map<int,int>& channelMap) {
246  /// Builds PTB channel map from the map txt file
247  channelMap.clear();
248 
249  int onlineChannel;
250  int offlineChannel;
251 
252  std::ostringstream LocStream;
253  LocStream << MapDir << MapFile;
254  std::string fullname = LocStream.str();
255 
256  std::string FileLoc;
257  cet::search_path sp("FW_SEARCH_PATH");
258  if (sp.find_file(MapFile, FileLoc)) fullname = FileLoc;
259 
260  if (fullname.empty())
261  mf::LogWarning("DAQToOffline") << "Input PTB channel map file " << MapFile << " not found in FW_SEARCH_PATH, or in location " << LocStream.str() << ". Using online channel numbers!" << std::endl;
262 
263  else {
264  mf::LogVerbatim("DAQToOffline") << "Build PTB Online->Offline channel Map from " << fullname;
265  std::ifstream infile(fullname);
266  if (!infile.good()) std::cout << "Not finding " << fullname << std::endl;
267  while (infile.good()) {
268  infile >> onlineChannel >> offlineChannel;
269  channelMap.insert(std::make_pair(onlineChannel,offlineChannel));
270  mf::LogVerbatim("DAQToOffline") << " " << onlineChannel << " -> " << offlineChannel;
271  }
272  mf::LogVerbatim("DAQToOffline")<< "channelMap has size " << channelMap.size();
273  }
274 }
275 //=======================================================================================
276 void DAQToOffline::MakeCounterPositionMap( std::string CounterDir, std::string CounterFile, std::map< unsigned int, std::pair < TVector3, std::vector< TVector3 > > >& CounterPositionMap, double fExtendCountersX, double fExtendCountersY, double fExtendCountersZ ) {
277 
278  if ( fExtendCountersY == 0 ) fExtendCountersY = fExtendCountersX;
279  if ( fExtendCountersZ == 0 ) fExtendCountersZ = fExtendCountersX;
280  // A function to make a map of counter corners and their centres.
281  // Until the LArSoft counters are changed this is the preferred way to get their centres.
282  // A text file is loaded in from pardata, though a user defined one can be uploaded instead.
283  // The geometries of the LArSoft counters ( which are correct ) are used to determine the size of the corners
284  // of the counters from the loaded centres.
285  // NOTE. The counters are assumed to rectangular as this make the maths much simpler.
286  // In truth the short width is 27.06 cm, whilst the long width is 32.5 cm.
287  // This means that there an overlap of counter corner produced though is relatively insignificant.
288  // The Map is structured as follows:
289  // Key - Counter Index, numbered 0 - 92
290  // Value - a pair of TVector3 and vector of TVector3
291  // Value.first - The centre position of the counter
292  // Value.second[0] - The Top Left corner of the counter
293  // Value.second[1] - The Top Right corner of the counter
294  // Value.second[2] - The Bottom Left corner of the counter
295  // Value.second[3] - The Bottom Right corner of the counter
296  CounterPositionMap.clear();
297 
298  auto fGeom = lar::providerFrom<geo::Geometry>();
299 
300  std::ostringstream CountStream;
301  CountStream << CounterDir << CounterFile;
302  std::string CountPath = CountStream.str();
303 
304  std::string CountLoc;
305  cet::search_path sp("FW_SEARCH_PATH");
306  if (sp.find_file(CounterFile, CountLoc)) CountPath = CountLoc;
307 
308  if (CountPath.empty()) {
309  mf::LogWarning("DAQToOffline") << "ERROR::Cannot find the counter position map file " << CounterFile << " in FW_SEARCH_PATH or " << CounterDir << std::endl;
310  return;
311  } else {
312  std::cout << "Loading the counter position map from " << CountPath << std::endl;
313  std::ifstream infile(CountPath);
314  while (infile.good()) {
315  int CountInd;
316  double CentreX, CentreY, CentreZ;
317  char Type, Side, Orientation;
318  infile >> CountInd >> CentreX >> CentreY >> CentreZ >> Type >> Side >> Orientation;
319  //std::cout << "Read in new line " << CountInd << " " << CentreX << " " << CentreY << " " << CentreZ << " " << Type << " " << Side << " " << Orientation << std::endl;
320 
321  geo::AuxDetGeo const& auxDet = fGeom->AuxDet(CountInd);
322 
323  // Make my TVector3's
324  TVector3 Centre( CentreX, CentreY, CentreZ );
325  TVector3 TL, TR, BL, BR;
326 
327  // Access the counter dimensions from the geometry
328  double HalfLength = 0.5 * auxDet.Length();
329  double HalfWidth1 = auxDet.HalfWidth1();
330  double HalfWidth2 = auxDet.HalfWidth2();
331 
332  // Call the counter corner alg.
333  MakeCounterCorners( CountInd, HalfLength, HalfWidth1, HalfWidth2, Centre, TL, TR, BL, BR, fExtendCountersX, fExtendCountersY, fExtendCountersZ );
334 
335  // Make my vector of TVector3's
336  std::vector<TVector3> Corners;
337  Corners.push_back( TL );
338  Corners.push_back( TR );
339  Corners.push_back( BL );
340  Corners.push_back( BR );
341 
342  // Add this counter to my map.
343  CounterPositionMap.insert( std::make_pair( CountInd, std::make_pair( Centre, Corners ) ) );
344  } // Loading in CountPath.
345  } // If found CountPath
346 } // MakeCounterPositionMap
347 //=======================================================================================
348 void DAQToOffline::MakeCounterCorners( int CountInd, double HalfLength, double HalfWidth1, double HalfWidth2, TVector3 Centre, TVector3& TL, TVector3& TR, TVector3& BL, TVector3& BR, double fExtendCountersX, double fExtendCountersY, double fExtendCountersZ ) {
349  // The actual corners are calculated. As above:
350  // NOTE: The corners are calculated as if the counters were rectangular I pass both widths incase somebody wishes to correct this...
351  // The telescope corners are not yet calculated...
352 
353  if ( fExtendCountersY == 0 ) fExtendCountersY = fExtendCountersX;
354  if ( fExtendCountersZ == 0 ) fExtendCountersZ = fExtendCountersX;
355  //std::cout << "Extending counters by " << fExtendCountersX << " " << fExtendCountersY << " " << fExtendCountersZ << std::endl;
356 
357  if ( CountInd < 44 ) {
358  if ( (CountInd >=6 && CountInd <=15) || (CountInd >=28 && CountInd <=37) ) { // For the East / West counters
359  //std::cout << "Looking at an East West counter " << std::endl;
360  // Top Left
361  TL[0] = Centre[0] - fExtendCountersX - HalfWidth1;
362  TL[1] = Centre[1] + fExtendCountersY + HalfLength;
363  TL[2] = Centre[2];
364  // Top Right
365  TR[0] = Centre[0] + fExtendCountersX + HalfWidth1;
366  TR[1] = Centre[1] + fExtendCountersY + HalfLength;
367  TR[2] = Centre[2];
368  // Bottom Left
369  BL[0] = Centre[0] - fExtendCountersX - HalfWidth1;
370  BL[1] = Centre[1] - fExtendCountersY - HalfLength;
371  BL[2] = Centre[2];
372  // Bottom Right
373  BR[0] = Centre[0] + fExtendCountersX + HalfWidth1;
374  BR[1] = Centre[1] - fExtendCountersY - HalfLength;
375  BR[2] = Centre[2];
376  } else { // For the North / South counters
377  //std::cout << "Looking at a North South counter " << std::endl;
378  // Top Left
379  TL[0] = Centre[0];
380  TL[1] = Centre[1] + fExtendCountersY + HalfLength;
381  TL[2] = Centre[2] - fExtendCountersZ - HalfWidth1;
382  // Top Right
383  TR[0] = Centre[0];
384  TR[1] = Centre[1] + fExtendCountersY + HalfLength;
385  TR[2] = Centre[2] + fExtendCountersZ + HalfWidth1;
386  // Bottom Left
387  BL[0] = Centre[0];
388  BL[1] = Centre[1] - fExtendCountersY - HalfLength;
389  BL[2] = Centre[2] - fExtendCountersZ - HalfWidth1;
390  // Bottom Right
391  BR[0] = Centre[0];
392  BR[1] = Centre[1] - fExtendCountersY - HalfLength;
393  BR[2] = Centre[2] + fExtendCountersZ + HalfWidth1;
394  }
395  } else { // For the telescope counters.
396  if ( (CountInd >= 44 && CountInd <= 56) || (CountInd >= 67 && CountInd <= 82) ) { // For one group of Telescope counters
397  //std::cout << "Looking at a Telescope 1 counter " << std::endl;
398  for (int ww=0; ww<3; ++ww )
399  TL[ww] = TR[ww] = BL[ww] = BR[ww] = Centre[ww];
400  } else { // For the other group of Telescope counters
401  //std::cout << "Looking at a Telescope 2 counter " << std::endl;
402  for (int ww=0; ww<3; ++ww )
403  TL[ww] = TR[ww] = BL[ww] = BR[ww] = Centre[ww];
404  }
405  }
406 }
void MakeCounterCorners(int CountInd, double HalfLength, double HalfWidth1, double HalfWidth2, TVector3 Centre, TVector3 &TL, TVector3 &TR, TVector3 &BL, TVector3 &BR, double fExtendCountersX=0, double fExtendCountersY=0, double fExtendCountersZ=0)
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
std::string string
Definition: nybbler.cc:12
void BuildPTBChannelMap(std::string MapDir, std::string MapFile, std::map< int, int > &channelMap)
unsigned short uint16_t
Definition: stdint.h:125
intermediate_table::const_iterator const_iterator
unsigned char uint8_t
Definition: stdint.h:124
void GetTimestamp(lbne::PennMilliSliceFragment msf, lbne::PennMicroSlice::Payload_Header *&word_header, lbne::PennMicroSlice::Payload_Timestamp *const &previous_timestamp, lbne::PennMicroSlice::Payload_Timestamp *&future_timestamp, lbne::PennMicroSlice::Payload_Header *&future_timestamp_header, std::vector< lbne::PennMicroSlice::Payload_Timestamp::timestamp_t > &TimeVector)
bool MakeNewExtTrig(uint32_t pos, bool &PrevOn, bool NowOn)
double HalfWidth2() const
Definition: AuxDetGeo.h:104
auto counter(T begin, T end)
Returns an object to iterate values from begin to end in a range-for loop.
Definition: counter.h:285
string infile
unsigned int uint32_t
Definition: stdint.h:126
double Length() const
Definition: AuxDetGeo.h:102
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::string find_file(std::string const &filename) const
Definition: search_path.cc:94
void MakeCounterPositionMap(std::string CounterDir, std::string CounterFile, std::map< unsigned int, std::pair< TVector3, std::vector< TVector3 > > > &CounterPositionMap, double fExtendCountersX=0, double fExtendCountersY=0, double fExtendCountersZ=0)
double HalfWidth1() const
Definition: AuxDetGeo.h:103
std::vector< raw::ExternalTrigger > PennFragmentToExternalTrigger(artdaq::Fragments const &Fragments, std::map< int, int > &channelMap, lbne::PennMicroSlice::Payload_Timestamp *&FirstPTBTimestamp)
Type
Type of JSON value.
Definition: rapidjson.h:618
QTextStream & endl(QTextStream &s)