Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
dune::PdspChannelMapService Class Reference

#include <PdspChannelMapService.h>

Public Types

enum  _FelixOrRCE { kRCE, kFELIX }
 
typedef enum dune::PdspChannelMapService::_FelixOrRCE FelixOrRCE
 

Public Member Functions

 PdspChannelMapService (fhicl::ParameterSet const &pset)
 
 PdspChannelMapService (fhicl::ParameterSet const &pset, art::ActivityRegistry &)
 
unsigned int GetOfflineNumberFromDetectorElements (unsigned int crate, unsigned int slot, unsigned int fiber, unsigned int fembchannel, FelixOrRCE frswitch)
 
unsigned int APAFromOfflineChannel (unsigned int offlineChannel) const
 Returns APA/crate. More...
 
unsigned int InstalledAPAFromOfflineChannel (unsigned int offlineChannel) const
 Returns APA/crate in installation notation. More...
 
unsigned int WIBFromOfflineChannel (unsigned int offlineChannel) const
 Returns WIB/slot. More...
 
unsigned int FEMBFromOfflineChannel (unsigned int offlineChannel) const
 Returns FEMB/fiber. More...
 
unsigned int FEMBChannelFromOfflineChannel (unsigned int offlineChannel) const
 Returns FEMB channel. More...
 
unsigned int StreamChannelFromOfflineChannel (unsigned int offlineChannel, FelixOrRCE frswitch) const
 Returns RCE(FELIX) stream(frame) channel. More...
 
unsigned int SlotIdFromOfflineChannel (unsigned int offlineChannel) const
 Returns global slot ID. More...
 
unsigned int FiberIdFromOfflineChannel (unsigned int offlineChannel) const
 Returns global fiber ID. More...
 
unsigned int ChipFromOfflineChannel (unsigned int offlineChannel) const
 Returns chip number. More...
 
unsigned int ChipChannelFromOfflineChannel (unsigned int offlineChannel) const
 Returns chip channel number. More...
 
unsigned int ASICFromOfflineChannel (unsigned int offlineChannel)
 Returns ASIC number – to be deprecated. More...
 
unsigned int ASICChannelFromOfflineChannel (unsigned int offlineChannel)
 Returns ASIC channel number – to be deprecated. More...
 
unsigned int AsicFromOfflineChannel (unsigned int offlineChannel) const
 
unsigned int AsicChannelFromOfflineChannel (unsigned int offlineChannel) const
 
unsigned int AsicLinkFromOfflineChannel (unsigned int offlineChannel) const
 
unsigned int PlaneFromOfflineChannel (unsigned int offlineChannel) const
 Returns plane. More...
 
unsigned int SSPOfflineChannelFromOnlineChannel (unsigned int onlineChannel)
 
unsigned int SSPOnlineChannelFromOfflineChannel (unsigned int offlineChannel) const
 
unsigned int SSPAPAFromOfflineChannel (unsigned int offlineChannel) const
 
unsigned int SSPWithinAPAFromOfflineChannel (unsigned int offlineChannel) const
 
unsigned int SSPGlobalFromOfflineChannel (unsigned int offlineChannel) const
 
unsigned int SSPChanWithinSSPFromOfflineChannel (unsigned int offlineChannel) const
 
unsigned int OpDetNoFromOfflineChannel (unsigned int offlineChannel) const
 

Private Member Functions

size_t count_bits (size_t i)
 
void check_offline_channel (unsigned int offlineChannel) const
 
void SSP_check_offline_channel (unsigned int offlineChannel) const
 

Private Attributes

const size_t fNChans = 15360
 
const size_t fNCrates = 6
 
const size_t fNSlots = 5
 
const size_t fNFibers = 4
 
const size_t fNFEMBChans = 128
 
const size_t fNSSPChans = 288
 
const size_t fNChansPerSSP = 12
 
const size_t fNAPAs = 6
 
size_t fBadCrateNumberWarningsIssued
 
size_t fBadSlotNumberWarningsIssued
 
size_t fBadFiberNumberWarningsIssued
 
size_t fSSPBadChannelNumberWarningsIssued
 
size_t fASICWarningsIssued
 
size_t fASICChanWarningsIssued
 
unsigned int farrayCsfcToOffline [6][5][4][128]
 
unsigned int fvAPAMap [15360]
 
unsigned int fvWIBMap [15360]
 
unsigned int fvFEMBMap [15360]
 
unsigned int fvFEMBChannelMap [15360]
 
unsigned int fvStreamChannelMap [15360]
 
unsigned int fvSlotIdMap [15360]
 
unsigned int fvFiberIdMap [15360]
 
unsigned int fvChipMap [15360]
 
unsigned int fvChipChannelMap [15360]
 
unsigned int fvASICMap [15360]
 
unsigned int fvASICChannelMap [15360]
 
unsigned int fvPlaneMap [15360]
 
unsigned int fFELIXarrayCsfcToOffline [6][5][4][128]
 
unsigned int fFELIXvAPAMap [15360]
 
unsigned int fFELIXvWIBMap [15360]
 
unsigned int fFELIXvFEMBMap [15360]
 
unsigned int fFELIXvFEMBChannelMap [15360]
 
unsigned int fFELIXvStreamChannelMap [15360]
 
unsigned int fFELIXvSlotIdMap [15360]
 
unsigned int fFELIXvFiberIdMap [15360]
 
unsigned int fFELIXvChipMap [15360]
 
unsigned int fFELIXvChipChannelMap [15360]
 
unsigned int fFELIXvASICMap [15360]
 
unsigned int fFELIXvASICChannelMap [15360]
 
unsigned int fFELIXvPlaneMap [15360]
 
unsigned int fvInstalledAPA [6]
 
unsigned int fvTPCSet_VsInstalledAPA [6]
 
unsigned int farraySSPOnlineToOffline [288]
 
unsigned int farraySSPOfflineToOnline [288]
 
unsigned int fvSSPAPAMap [288]
 
unsigned int fvSSPWithinAPAMap [288]
 
unsigned int fvSSPGlobalMap [288]
 
unsigned int fvSSPChanWithinSSPMap [288]
 
unsigned int fvOpDetNoMap [288]
 

Detailed Description

Definition at line 27 of file PdspChannelMapService.h.

Member Typedef Documentation

Member Enumeration Documentation

Enumerator
kRCE 
kFELIX 

Definition at line 34 of file PdspChannelMapService.h.

Constructor & Destructor Documentation

dune::PdspChannelMapService::PdspChannelMapService ( fhicl::ParameterSet const &  pset)

Definition at line 19 of file PdspChannelMapService_service.cc.

19  {
20 
27 
28  std::string channelMapFile = pset.get<std::string>("FileName");
29 
30  std::string fullname;
31  cet::search_path sp("FW_SEARCH_PATH");
32  sp.find_file(channelMapFile, fullname);
33 
34  if (fullname.empty()) {
35  std::cout << "Input file " << channelMapFile << " not found" << std::endl;
36  throw cet::exception("File not found");
37  }
38  else
39  std::cout << "PDSP Channel Map: Building RCE TPC wiremap from file " << channelMapFile << std::endl;
40 
41  std::ifstream inFile(fullname, std::ios::in);
43 
44  while (std::getline(inFile,line)) {
45  unsigned int crateNo, slotNo, fiberNo, FEMBChannel, StreamChannel, slotID, fiberID, chipNo, chipChannel, asicNo, asicChannel, planeType, offlineChannel;
46  std::stringstream linestream(line);
47  linestream >> crateNo >> slotNo >> fiberNo>> FEMBChannel >> StreamChannel >> slotID >> fiberID >> chipNo >> chipChannel >> asicNo >> asicChannel >> planeType >> offlineChannel;
48 
49  // fill lookup tables. Throw an exception if any number is out of expected bounds.
50  // checking for negative values produces compiler warnings as these are unsigned ints
51 
52  if (offlineChannel >= fNChans)
53  {
54  throw cet::exception("PdspChannelMapService") << "Ununderstood Offline Channel: " << offlineChannel << "\n";
55  }
56  if (crateNo >= fNCrates)
57  {
58  throw cet::exception("PdspChannelMapService") << "Ununderstood Crate Number: " << crateNo << "\n";
59  }
60  if (slotNo >= fNSlots)
61  {
62  throw cet::exception("PdspChannelMapService") << "Ununderstood Slot Number: " << slotNo << "\n";
63  }
64  if (fiberNo >= fNFibers)
65  {
66  throw cet::exception("PdspChannelMapService") << "Ununderstood Fiber Number: " << fiberNo << "\n";
67  }
68  if (StreamChannel >= fNFEMBChans)
69  {
70  throw cet::exception("PdspChannelMapService") << "Ununderstood FEMB (Stream) Channel Number: " << StreamChannel << "\n";
71  }
72 
73  farrayCsfcToOffline[crateNo][slotNo][fiberNo][StreamChannel] = offlineChannel;
74  fvAPAMap[offlineChannel] = crateNo;
75  fvWIBMap[offlineChannel] = slotNo;
76  fvFEMBMap[offlineChannel] = fiberNo;
77  fvFEMBChannelMap[offlineChannel] = FEMBChannel;
78  fvStreamChannelMap[offlineChannel] = StreamChannel;
79  fvSlotIdMap[offlineChannel] = slotID;
80  fvFiberIdMap[offlineChannel] = fiberID;
81  fvChipMap[offlineChannel] = chipNo;
82  fvChipChannelMap[offlineChannel] = chipChannel;
83  fvASICMap[offlineChannel] = asicNo;
84  fvASICChannelMap[offlineChannel] = asicChannel;
85  fvPlaneMap[offlineChannel] = planeType;
86 
87  }
88  inFile.close();
89 
90 
91 
92  std::string FELIXchannelMapFile = pset.get<std::string>("FELIXFileName");
93  sp.find_file(FELIXchannelMapFile, fullname);
94 
95  if (fullname.empty()) {
96  std::cout << "Input file " << FELIXchannelMapFile << " not found" << std::endl;
97  throw cet::exception("File not found");
98  }
99  else
100  std::cout << "PDSP Channel Map: Building FELIX TPC wiremap from file " << channelMapFile << std::endl;
101 
102  std::ifstream FELIXinFile(fullname, std::ios::in);
103 
104  while (std::getline(FELIXinFile,line)) {
105  unsigned int crateNo, slotNo, fiberNo, FEMBChannel, StreamChannel, slotID, fiberID, chipNo, chipChannel, asicNo, asicChannel, planeType, offlineChannel;
106  std::stringstream linestream(line);
107  linestream >> crateNo >> slotNo >> fiberNo>> FEMBChannel >> StreamChannel >> slotID >> fiberID >> chipNo >> chipChannel >> asicNo >> asicChannel >> planeType >> offlineChannel;
108 
109  // fill lookup tables. Throw an exception if any number is out of expected bounds.
110  // checking for negative values produces compiler warnings as these are unsigned ints
111 
112  if (offlineChannel >= fNChans)
113  {
114  throw cet::exception("PdspChannelMapService") << "Ununderstood Offline Channel: " << offlineChannel << "\n";
115  }
116  if (crateNo >= fNCrates)
117  {
118  throw cet::exception("PdspChannelMapService") << "Ununderstood Crate Number: " << crateNo << "\n";
119  }
120  if (slotNo >= fNSlots)
121  {
122  throw cet::exception("PdspChannelMapService") << "Ununderstood Slot Number: " << slotNo << "\n";
123  }
124  if (fiberNo >= fNFibers)
125  {
126  throw cet::exception("PdspChannelMapService") << "Ununderstood Fiber Number: " << fiberNo << "\n";
127  }
128  if (StreamChannel >= fNFEMBChans)
129  {
130  throw cet::exception("PdspChannelMapService") << "Ununderstood FEMB (Stream) Channel Number: " << StreamChannel << "\n";
131  }
132 
133  fFELIXarrayCsfcToOffline[crateNo][slotNo][fiberNo][StreamChannel] = offlineChannel;
134  fFELIXvAPAMap[offlineChannel] = crateNo;
135  fFELIXvWIBMap[offlineChannel] = slotNo;
136  fFELIXvFEMBMap[offlineChannel] = fiberNo;
137  fFELIXvFEMBChannelMap[offlineChannel] = FEMBChannel;
138  fFELIXvStreamChannelMap[offlineChannel] = StreamChannel;
139  fFELIXvSlotIdMap[offlineChannel] = slotID;
140  fFELIXvFiberIdMap[offlineChannel] = fiberID;
141  fFELIXvChipMap[offlineChannel] = chipNo;
142  fFELIXvChipChannelMap[offlineChannel] = chipChannel;
143  fFELIXvASICMap[offlineChannel] = asicNo;
144  fFELIXvASICChannelMap[offlineChannel] = asicChannel;
145  fFELIXvPlaneMap[offlineChannel] = planeType;
146 
147  }
148  inFile.close();
149 
150  // APA numbering -- hardcoded here.
151  // Installation numbering:
152  // APA5 APA6 APA4
153  // beam -->
154  // APA3 APA2 APA1
155  //
156  // The Offline numbering:
157  // APA1 APA3 APA5
158  // beam -->
159  // APA0 APA2 APA4
160  //
161  fvInstalledAPA[0] = 3;
162  fvInstalledAPA[1] = 5;
163  fvInstalledAPA[2] = 2;
164  fvInstalledAPA[3] = 6;
165  fvInstalledAPA[4] = 1;
166  fvInstalledAPA[5] = 4;
167 
168  // and the inverse map -- shifted by 1 -- the above list must start counting at 1.
169 
170  for (size_t i=0; i<6; ++i)
171  {
173  }
174 
175  std::string SSPchannelMapFile = pset.get<std::string>("SSPFileName");
176 
177  std::string SSPfullname;
178  sp.find_file(SSPchannelMapFile, SSPfullname);
179 
180  if (SSPfullname.empty()) {
181  std::cout << "Input file for SSP Channel Map " << SSPchannelMapFile << " not found in FW_SEARCH_PATH " << std::endl;
182  throw cet::exception("File not found");
183  }
184  else
185  std::cout << "PDSP Channel Map: Building SSP channel map from file " << SSPchannelMapFile << std::endl;
186 
187  std::ifstream SSPinFile(SSPfullname, std::ios::in);
188 
189  while (std::getline(SSPinFile,line)) {
190  unsigned int onlineChannel, APA, SSP, SSPGlobal, ChanWithinSSP, OpDetNo, offlineChannel;
191  std::stringstream linestream(line);
192  linestream >> onlineChannel >> APA >> SSP >> SSPGlobal >> ChanWithinSSP >> OpDetNo >> offlineChannel;
193 
194  // fill lookup tables. Throw an exception if any number is out of expected bounds.
195  // checking for negative values produces compiler warnings as these are unsigned ints
196 
197  if (onlineChannel >= fNSSPChans)
198  {
199  throw cet::exception("PdspChannelMapService") << "Ununderstood SSP Online Channel: " << onlineChannel << "\n";
200  }
201  if (offlineChannel >= fNSSPChans)
202  {
203  throw cet::exception("PdspChannelMapService") << "Ununderstood SSP Offline Channel: " << offlineChannel << "\n";
204  }
205  if (APA > fNAPAs) // APAs count from 1
206  {
207  throw cet::exception("PdspChannelMapService") << "Ununderstood APA Number in SSP map file: " << APA << "\n";
208  }
209  //if (SSP >= fNSSPsPerAPA) -- These checks don't make sense
210  // {
211  // throw cet::exception("PdspChannelMapService") << "Ununderstood SSP number within this APA: " << SSP << " " << APA << "\n";
212  // }
213  //if (SSPGlobal >= fNSSPs)
214  // {
215  // throw cet::exception("PdspChannelMapService") << "Ununderstood Global SSP number: " << SSPGlobal << "\n";
216  // }
217  if (ChanWithinSSP >= fNChansPerSSP)
218  {
219  throw cet::exception("PdspChannelMapService") << "Ununderstood Channel within SSP Number: " << ChanWithinSSP << " " << SSPGlobal << "\n";
220  }
221  if (OpDetNo >= 60)
222  {
223  throw cet::exception("PdspChannelMapService") << "Ununderstood SSP Module Number: " << OpDetNo << "\n";
224  }
225 
226  farraySSPOnlineToOffline[onlineChannel] = offlineChannel;
227  farraySSPOfflineToOnline[offlineChannel] = onlineChannel;
228  fvSSPAPAMap[offlineChannel] = APA;
229  fvSSPWithinAPAMap[offlineChannel] = SSP;
230  fvSSPGlobalMap[offlineChannel] = SSPGlobal;
231  fvSSPChanWithinSSPMap[offlineChannel] = ChanWithinSSP;
232  fvOpDetNoMap[offlineChannel] = OpDetNo;
233  }
234  SSPinFile.close();
235 }
unsigned int fvStreamChannelMap[15360]
std::string string
Definition: nybbler.cc:12
unsigned int fFELIXvASICChannelMap[15360]
unsigned int fFELIXarrayCsfcToOffline[6][5][4][128]
unsigned int fvASICChannelMap[15360]
unsigned int fFELIXvChipChannelMap[15360]
unsigned int farraySSPOnlineToOffline[288]
unsigned int farraySSPOfflineToOnline[288]
unsigned int fFELIXvFEMBChannelMap[15360]
unsigned int fvFEMBChannelMap[15360]
unsigned int farrayCsfcToOffline[6][5][4][128]
unsigned int fFELIXvSlotIdMap[15360]
TFile * inFile
Definition: makeDST.cxx:36
void line(double t, double *p, double &x, double &y, double &z)
unsigned int fvChipChannelMap[15360]
unsigned int fFELIXvStreamChannelMap[15360]
unsigned int fFELIXvFiberIdMap[15360]
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
dune::PdspChannelMapService::PdspChannelMapService ( fhicl::ParameterSet const &  pset,
art::ActivityRegistry  
)

Definition at line 237 of file PdspChannelMapService_service.cc.

237  : PdspChannelMapService(pset) {
238 }
PdspChannelMapService(fhicl::ParameterSet const &pset)

Member Function Documentation

unsigned int dune::PdspChannelMapService::APAFromOfflineChannel ( unsigned int  offlineChannel) const

Returns APA/crate.

Definition at line 302 of file PdspChannelMapService_service.cc.

302  {
303  check_offline_channel(offlineChannel);
304  return fvAPAMap[offlineChannel];
305  // return fFELIXvAPAMap[offlineChannel]; // -- FELIX one -- should be the same
306 }
void check_offline_channel(unsigned int offlineChannel) const
unsigned int dune::PdspChannelMapService::ASICChannelFromOfflineChannel ( unsigned int  offlineChannel)

Returns ASIC channel number – to be deprecated.

Definition at line 414 of file PdspChannelMapService_service.cc.

414  {
416  {
417  mf::LogWarning("PdspChannelMapService: Deprecated call to ASICChannelFromOfflineChannel. Not a meaningful number -- channels are grouped by 16's not 8's");
418  }
420  check_offline_channel(offlineChannel);
421  return fvASICChannelMap[offlineChannel];
422 }
unsigned int fvASICChannelMap[15360]
void check_offline_channel(unsigned int offlineChannel) const
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
unsigned int dune::PdspChannelMapService::AsicChannelFromOfflineChannel ( unsigned int  offlineChannel) const

Definition at line 392 of file PdspChannelMapService_service.cc.

392  {
393  check_offline_channel(offlineChannel);
394  return fvChipChannelMap[offlineChannel];
395 }
void check_offline_channel(unsigned int offlineChannel) const
unsigned int fvChipChannelMap[15360]
unsigned int dune::PdspChannelMapService::ASICFromOfflineChannel ( unsigned int  offlineChannel)

Returns ASIC number – to be deprecated.

Definition at line 399 of file PdspChannelMapService_service.cc.

399  {
401  {
402  mf::LogWarning("PdspChannelMapService: Deprecated call to ASICFromOfflineChannel. Use AsicLinkFromOfflineChannel");
403  }
405  check_offline_channel(offlineChannel);
406  return fvASICMap[offlineChannel];
407 }
void check_offline_channel(unsigned int offlineChannel) const
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
unsigned int dune::PdspChannelMapService::AsicFromOfflineChannel ( unsigned int  offlineChannel) const

Definition at line 380 of file PdspChannelMapService_service.cc.

380  {
381  check_offline_channel(offlineChannel);
382  return fvChipMap[offlineChannel];
383 }
void check_offline_channel(unsigned int offlineChannel) const
unsigned int dune::PdspChannelMapService::AsicLinkFromOfflineChannel ( unsigned int  offlineChannel) const

Definition at line 409 of file PdspChannelMapService_service.cc.

409  {
410  check_offline_channel(offlineChannel);
411  return fvASICMap[offlineChannel];
412 }
void check_offline_channel(unsigned int offlineChannel) const
void dune::PdspChannelMapService::check_offline_channel ( unsigned int  offlineChannel) const
inlineprivate

Definition at line 192 of file PdspChannelMapService.h.

193  {
194  if (offlineChannel >= fNChans)
195  {
196  throw cet::exception("PdspChannelMapService") << "Offline TPC Channel Number out of range: " << offlineChannel << "\n";
197  }
198  };
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int dune::PdspChannelMapService::ChipChannelFromOfflineChannel ( unsigned int  offlineChannel) const

Returns chip channel number.

Definition at line 385 of file PdspChannelMapService_service.cc.

385  {
386  check_offline_channel(offlineChannel);
387  return fvChipChannelMap[offlineChannel];
388 }
void check_offline_channel(unsigned int offlineChannel) const
unsigned int fvChipChannelMap[15360]
unsigned int dune::PdspChannelMapService::ChipFromOfflineChannel ( unsigned int  offlineChannel) const

Returns chip number.

Definition at line 375 of file PdspChannelMapService_service.cc.

375  {
376  check_offline_channel(offlineChannel);
377  return fvChipMap[offlineChannel];
378 }
void check_offline_channel(unsigned int offlineChannel) const
size_t dune::PdspChannelMapService::count_bits ( size_t  i)
private

Definition at line 429 of file PdspChannelMapService_service.cc.

430 {
431  size_t result=0;
432  size_t s = sizeof(size_t)*8;
433  for (size_t j=0; j<s; ++j)
434  {
435  if (i & 1) ++result;
436  i >>= 1;
437  }
438  return result;
439 }
static QCString result
static QCString * s
Definition: config.cpp:1042
unsigned int dune::PdspChannelMapService::FEMBChannelFromOfflineChannel ( unsigned int  offlineChannel) const

Returns FEMB channel.

Definition at line 336 of file PdspChannelMapService_service.cc.

336  {
337  check_offline_channel(offlineChannel);
338  return fvFEMBChannelMap[offlineChannel];
339  // return fFELIXvFEMBChannelMap[offlineChannel]; // -- FELIX one -- should be the same
340 }
void check_offline_channel(unsigned int offlineChannel) const
unsigned int fvFEMBChannelMap[15360]
unsigned int dune::PdspChannelMapService::FEMBFromOfflineChannel ( unsigned int  offlineChannel) const

Returns FEMB/fiber.

Definition at line 328 of file PdspChannelMapService_service.cc.

328  {
329  check_offline_channel(offlineChannel);
330  return fvFEMBMap[offlineChannel]+1;
331  //return fFELIXvFEMBMap[offlineChannel];
332 }
void check_offline_channel(unsigned int offlineChannel) const
unsigned int dune::PdspChannelMapService::FiberIdFromOfflineChannel ( unsigned int  offlineChannel) const

Returns global fiber ID.

Definition at line 368 of file PdspChannelMapService_service.cc.

368  {
369  check_offline_channel(offlineChannel);
370  return fvFiberIdMap[offlineChannel];
371 }
void check_offline_channel(unsigned int offlineChannel) const
unsigned int dune::PdspChannelMapService::GetOfflineNumberFromDetectorElements ( unsigned int  crate,
unsigned int  slot,
unsigned int  fiber,
unsigned int  fembchannel,
FelixOrRCE  frswitch 
)

Definition at line 245 of file PdspChannelMapService_service.cc.

245  {
246 
247  unsigned int offlineChannel=0;
248  unsigned int lcrate = crate;
249  unsigned int lslot = slot;
250  unsigned int lfiber = fiber;
251 
252  if (crate > fNCrates || crate == 0)
253  {
255  {
256  mf::LogWarning("PdspChannelMapService: Bad Crate Number, expecting a number between 1 and 6. Falling back to 1. Ununderstood crate number=") << crate;
257  }
259  lcrate = 1;
260  }
261 
262  if (slot >= fNSlots)
263  {
265  {
266  mf::LogWarning("PdspChannelMapService: Bad slot number, using slot number zero as a fallback. Ununderstood slot number: ") << slot;
267  }
269  lslot = 0;
270  }
271 
272  if (fiber > fNFibers || fiber == 0)
273  {
275  {
276  mf::LogWarning("PdspChannelMapService: Bad fiber number, falling back to 1. Ununderstood fiber number: ") << fiber;
277  }
279  lfiber = 1;
280  }
281 
282  if (streamchannel >= fNFEMBChans)
283  {
284  throw cet::exception("PdspChannelMapService") << "Ununderstood Stream (FEMB) chan: "
285  << crate << " " << slot << " " << fiber << " " << streamchannel << "\n";
286  }
287 
288  if (frswitch == kRCE)
289  {
290  offlineChannel = farrayCsfcToOffline[fvTPCSet_VsInstalledAPA[lcrate-1]][lslot][lfiber-1][streamchannel];
291  }
292  else
293  {
294  offlineChannel = fFELIXarrayCsfcToOffline[fvTPCSet_VsInstalledAPA[lcrate-1]][lslot][lfiber-1][streamchannel];
295  }
296 
297  return offlineChannel;
298 }
unsigned int fFELIXarrayCsfcToOffline[6][5][4][128]
struct dune::tde::crate crate
unsigned int farrayCsfcToOffline[6][5][4][128]
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int dune::PdspChannelMapService::InstalledAPAFromOfflineChannel ( unsigned int  offlineChannel) const

Returns APA/crate in installation notation.

Definition at line 308 of file PdspChannelMapService_service.cc.

308  {
309  check_offline_channel(offlineChannel);
310  unsigned int offlineAPA = fvAPAMap[offlineChannel];
311  if (offlineAPA > 5)
312  {
313  throw cet::exception("PdspChannelMapService") << "Offline APA Number out of range: " << offlineAPA << "\n";
314  }
315  return fvInstalledAPA[fvAPAMap[offlineChannel]];
316 }
void check_offline_channel(unsigned int offlineChannel) const
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int dune::PdspChannelMapService::OpDetNoFromOfflineChannel ( unsigned int  offlineChannel) const

Definition at line 487 of file PdspChannelMapService_service.cc.

488 {
489  SSP_check_offline_channel(offlineChannel);
490  return fvOpDetNoMap[offlineChannel];
491 }
void SSP_check_offline_channel(unsigned int offlineChannel) const
unsigned int dune::PdspChannelMapService::PlaneFromOfflineChannel ( unsigned int  offlineChannel) const

Returns plane.

Definition at line 424 of file PdspChannelMapService_service.cc.

424  {
425  check_offline_channel(offlineChannel);
426  return fvPlaneMap[offlineChannel];
427 }
void check_offline_channel(unsigned int offlineChannel) const
unsigned int dune::PdspChannelMapService::SlotIdFromOfflineChannel ( unsigned int  offlineChannel) const

Returns global slot ID.

Definition at line 358 of file PdspChannelMapService_service.cc.

358  {
359  check_offline_channel(offlineChannel);
360  return fvSlotIdMap[offlineChannel];
361  // return fFELIXvSlotIdMap[offlineChannel]; // -- FELIX one -- should be the same
362 }
void check_offline_channel(unsigned int offlineChannel) const
void dune::PdspChannelMapService::SSP_check_offline_channel ( unsigned int  offlineChannel) const
inlineprivate

Definition at line 200 of file PdspChannelMapService.h.

201  {
202  if (offlineChannel >= fNSSPChans)
203  {
204  throw cet::exception("PdspChannelMapService") << "Offline SSP Channel Number out of range: " << offlineChannel << "\n";
205  }
206  };
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned int dune::PdspChannelMapService::SSPAPAFromOfflineChannel ( unsigned int  offlineChannel) const

Definition at line 463 of file PdspChannelMapService_service.cc.

464 {
465  SSP_check_offline_channel(offlineChannel);
466  return fvSSPAPAMap[offlineChannel];
467 }
void SSP_check_offline_channel(unsigned int offlineChannel) const
unsigned int dune::PdspChannelMapService::SSPChanWithinSSPFromOfflineChannel ( unsigned int  offlineChannel) const

Definition at line 481 of file PdspChannelMapService_service.cc.

482 {
483  SSP_check_offline_channel(offlineChannel);
484  return fvSSPChanWithinSSPMap[offlineChannel];
485 }
void SSP_check_offline_channel(unsigned int offlineChannel) const
unsigned int dune::PdspChannelMapService::SSPGlobalFromOfflineChannel ( unsigned int  offlineChannel) const

Definition at line 475 of file PdspChannelMapService_service.cc.

476 {
477  SSP_check_offline_channel(offlineChannel);
478  return fvSSPGlobalMap[offlineChannel];
479 }
void SSP_check_offline_channel(unsigned int offlineChannel) const
unsigned int dune::PdspChannelMapService::SSPOfflineChannelFromOnlineChannel ( unsigned int  onlineChannel)

Definition at line 441 of file PdspChannelMapService_service.cc.

442 {
443  unsigned int lchannel = onlineChannel;
444 
445  if (onlineChannel > fNSSPChans)
446  {
448  {
449  mf::LogWarning("PdspChannelMapService: Online Channel Number too high, using zero as a fallback: ") << onlineChannel;
450  }
452  lchannel = 0;
453  }
454  return farraySSPOnlineToOffline[lchannel];
455 }
unsigned int farraySSPOnlineToOffline[288]
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
unsigned int dune::PdspChannelMapService::SSPOnlineChannelFromOfflineChannel ( unsigned int  offlineChannel) const

Definition at line 457 of file PdspChannelMapService_service.cc.

458 {
459  SSP_check_offline_channel(offlineChannel);
460  return farraySSPOfflineToOnline[offlineChannel];
461 }
unsigned int farraySSPOfflineToOnline[288]
void SSP_check_offline_channel(unsigned int offlineChannel) const
unsigned int dune::PdspChannelMapService::SSPWithinAPAFromOfflineChannel ( unsigned int  offlineChannel) const

Definition at line 469 of file PdspChannelMapService_service.cc.

470 {
471  SSP_check_offline_channel(offlineChannel);
472  return fvSSPWithinAPAMap[offlineChannel];
473 }
void SSP_check_offline_channel(unsigned int offlineChannel) const
unsigned int dune::PdspChannelMapService::StreamChannelFromOfflineChannel ( unsigned int  offlineChannel,
FelixOrRCE  frswitch 
) const

Returns RCE(FELIX) stream(frame) channel.

Definition at line 344 of file PdspChannelMapService_service.cc.

344  {
345  check_offline_channel(offlineChannel);
346  if (frswitch == kRCE)
347  {
348  return fvStreamChannelMap[offlineChannel];
349  }
350  else
351  {
352  return fFELIXvStreamChannelMap[offlineChannel];
353  }
354 }
unsigned int fvStreamChannelMap[15360]
void check_offline_channel(unsigned int offlineChannel) const
unsigned int fFELIXvStreamChannelMap[15360]
unsigned int dune::PdspChannelMapService::WIBFromOfflineChannel ( unsigned int  offlineChannel) const

Returns WIB/slot.

Definition at line 320 of file PdspChannelMapService_service.cc.

320  {
321  check_offline_channel(offlineChannel);
322  return fvWIBMap[offlineChannel];
323  // return fFELIXvWIBMap[offlineChannel]; // -- FELIX one -- should be the same
324 }
void check_offline_channel(unsigned int offlineChannel) const

Member Data Documentation

unsigned int dune::PdspChannelMapService::farrayCsfcToOffline[6][5][4][128]
private

Definition at line 144 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::farraySSPOfflineToOnline[288]
private

Definition at line 181 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::farraySSPOnlineToOffline[288]
private

Definition at line 180 of file PdspChannelMapService.h.

size_t dune::PdspChannelMapService::fASICChanWarningsIssued
private

Definition at line 141 of file PdspChannelMapService.h.

size_t dune::PdspChannelMapService::fASICWarningsIssued
private

Definition at line 140 of file PdspChannelMapService.h.

size_t dune::PdspChannelMapService::fBadCrateNumberWarningsIssued
private

Definition at line 135 of file PdspChannelMapService.h.

size_t dune::PdspChannelMapService::fBadFiberNumberWarningsIssued
private

Definition at line 137 of file PdspChannelMapService.h.

size_t dune::PdspChannelMapService::fBadSlotNumberWarningsIssued
private

Definition at line 136 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fFELIXarrayCsfcToOffline[6][5][4][128]
private

Definition at line 161 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fFELIXvAPAMap[15360]
private

Definition at line 162 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fFELIXvASICChannelMap[15360]
private

Definition at line 172 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fFELIXvASICMap[15360]
private

Definition at line 171 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fFELIXvChipChannelMap[15360]
private

Definition at line 170 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fFELIXvChipMap[15360]
private

Definition at line 169 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fFELIXvFEMBChannelMap[15360]
private

Definition at line 165 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fFELIXvFEMBMap[15360]
private

Definition at line 164 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fFELIXvFiberIdMap[15360]
private

Definition at line 168 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fFELIXvPlaneMap[15360]
private

Definition at line 173 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fFELIXvSlotIdMap[15360]
private

Definition at line 167 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fFELIXvStreamChannelMap[15360]
private

Definition at line 166 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fFELIXvWIBMap[15360]
private

Definition at line 163 of file PdspChannelMapService.h.

const size_t dune::PdspChannelMapService::fNAPAs = 6
private

Definition at line 131 of file PdspChannelMapService.h.

const size_t dune::PdspChannelMapService::fNChans = 15360
private

Definition at line 119 of file PdspChannelMapService.h.

const size_t dune::PdspChannelMapService::fNChansPerSSP = 12
private

Definition at line 130 of file PdspChannelMapService.h.

const size_t dune::PdspChannelMapService::fNCrates = 6
private

Definition at line 120 of file PdspChannelMapService.h.

const size_t dune::PdspChannelMapService::fNFEMBChans = 128
private

Definition at line 123 of file PdspChannelMapService.h.

const size_t dune::PdspChannelMapService::fNFibers = 4
private

Definition at line 122 of file PdspChannelMapService.h.

const size_t dune::PdspChannelMapService::fNSlots = 5
private

Definition at line 121 of file PdspChannelMapService.h.

const size_t dune::PdspChannelMapService::fNSSPChans = 288
private

Definition at line 127 of file PdspChannelMapService.h.

size_t dune::PdspChannelMapService::fSSPBadChannelNumberWarningsIssued
private

Definition at line 138 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fvAPAMap[15360]
private

Definition at line 148 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fvASICChannelMap[15360]
private

Definition at line 158 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fvASICMap[15360]
private

Definition at line 157 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fvChipChannelMap[15360]
private

Definition at line 156 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fvChipMap[15360]
private

Definition at line 155 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fvFEMBChannelMap[15360]
private

Definition at line 151 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fvFEMBMap[15360]
private

Definition at line 150 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fvFiberIdMap[15360]
private

Definition at line 154 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fvInstalledAPA[6]
private

Definition at line 175 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fvOpDetNoMap[288]
private

Definition at line 186 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fvPlaneMap[15360]
private

Definition at line 159 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fvSlotIdMap[15360]
private

Definition at line 153 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fvSSPAPAMap[288]
private

Definition at line 182 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fvSSPChanWithinSSPMap[288]
private

Definition at line 185 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fvSSPGlobalMap[288]
private

Definition at line 184 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fvSSPWithinAPAMap[288]
private

Definition at line 183 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fvStreamChannelMap[15360]
private

Definition at line 152 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fvTPCSet_VsInstalledAPA[6]
private

Definition at line 176 of file PdspChannelMapService.h.

unsigned int dune::PdspChannelMapService::fvWIBMap[15360]
private

Definition at line 149 of file PdspChannelMapService.h.


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