Public Member Functions | Private Attributes | List of all members
cmap::dataprov::CMap Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-09-23/CMap/CMap.h"

Inheritance diagram for cmap::dataprov::CMap:
cmap::CMap

Public Member Functions

 CMap ()
 
 CMap (const daqchannelmap::DAQChannelMap *)
 
 ~CMap ()
 
void SetStdMap (const daqchannelmap::DAQChannelMap *m)
 
daqchannelmap::lchan encodeLChan (int detId, int plane, int cell)
 
daqchannelmap::dchan encodeDChan (daqchannelmap::lchan)
 
int computeBlock (daqchannelmap::lchan)
 
int getDetector (daqchannelmap::dchan)
 
int getDiBlock (daqchannelmap::dchan)
 
int getDCM (daqchannelmap::dchan)
 
int getFEB (daqchannelmap::dchan)
 
int getPixel (daqchannelmap::dchan)
 
int getView (daqchannelmap::dchan)
 
int getPlane (daqchannelmap::lchan)
 
int getCell (daqchannelmap::lchan)
 
unsigned short GetPlane (const rawdata::RawDigit *dig)
 
unsigned short GetPlane (const rb::CellHit *dig)
 
unsigned short GetCell (const rawdata::RawDigit *dig)
 
unsigned short GetCell (const rb::CellHit *dig)
 
const daqchannelmap::DAQChannelMapMap () const
 
void AddException (int idet, geo::OfflineChan chan1, geo::OfflineChan chan2)
 
void AddException (int idet, std::string chan1, std::string chan2)
 
void AddException (daqchannelmap::dchan chan1, daqchannelmap::dchan chan2)
 
int NExceptions ()
 
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchanExceptionsMap ()
 
void ClearExceptions ()
 
void SetCurrentRun (int run)
 
int CurrentRun ()
 
void SetUseExceptions (bool v)
 
bool UseExceptions ()
 
void SetVerbosity (int v)
 
int Verbosity ()
 

Private Attributes

int fCurrentRun
 
int fVerbosity
 
bool fUseExceptions
 
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchanfExceptionsMap
 
const daqchannelmap::DAQChannelMapfStdMap
 

Detailed Description

Definition at line 29 of file CMap.h.

Constructor & Destructor Documentation

cmap::dataprov::CMap::CMap ( )

Definition at line 21 of file CMap.cxx.

References fCurrentRun, fExceptionsMap, fStdMap, fUseExceptions, and fVerbosity.

22  {
23  fVerbosity = 0;
24  fCurrentRun = 0;
25  fUseExceptions = false;
26  fExceptionsMap.clear();
27  fStdMap = 0;
28  }
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
bool fUseExceptions
Definition: CMap.h:84
const daqchannelmap::DAQChannelMap * fStdMap
Definition: CMap.h:86
cmap::dataprov::CMap::CMap ( const daqchannelmap::DAQChannelMap map)

Definition at line 31 of file CMap.cxx.

References fCurrentRun, fExceptionsMap, fStdMap, fUseExceptions, and fVerbosity.

32  {
33  fVerbosity = 0;
34  fCurrentRun = 0;
35  fUseExceptions = false;
36  fExceptionsMap.clear();
37  fStdMap = map;
38  }
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
bool fUseExceptions
Definition: CMap.h:84
const daqchannelmap::DAQChannelMap * fStdMap
Definition: CMap.h:86
cmap::dataprov::CMap::~CMap ( )

Definition at line 41 of file CMap.cxx.

42  {
43 
44  }

Member Function Documentation

void cmap::dataprov::CMap::AddException ( int  idet,
geo::OfflineChan  chan1,
geo::OfflineChan  chan2 
)

Definition at line 102 of file CMap.cxx.

References geo::OfflineChan::Cell(), daqchannelmap::DAQChannelMap::encodeDChan(), daqchannelmap::DAQChannelMap::encodeLChan(), Map(), and geo::OfflineChan::Plane().

Referenced by AddException(), and cmap::CMap::LoadExceptions().

103  {
104  daqchannelmap::lchan logChan = this->Map()->encodeLChan(idet,chan1.Plane(),chan1.Cell());
105  daqchannelmap::dchan daqChan1 = this->Map()->encodeDChan(logChan);
106  logChan = this->Map()->encodeLChan(idet,chan2.Plane(),chan2.Cell());
107  daqchannelmap::dchan daqChan2 = this->Map()->encodeDChan(logChan);
108  this->AddException(daqChan1,daqChan2);
109 
110  }
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
lchan encodeLChan(int detId, plane_t plane, cell_t cell) const
void AddException(int idet, geo::OfflineChan chan1, geo::OfflineChan chan2)
Definition: CMap.cxx:102
unsigned short Plane() const
Definition: OfflineChan.h:31
unsigned short Cell() const
Definition: OfflineChan.h:32
dchan encodeDChan(int detID, diblock_t diblock, dcm_id_t dcm, feb_t feb, pixel_t pixel) const
uint32_t dchan
< DAQ Channel Map Package
void cmap::dataprov::CMap::AddException ( int  idet,
std::string  chan1,
std::string  chan2 
)

Definition at line 47 of file CMap.cxx.

References AddException(), getBrightness::cell, febshutoff_auto::db, febshutoff_auto::dcm, daqchannelmap::DAQChannelMap::encodeDChan(), daqchannelmap::DAQChannelMap::encodeLChan(), APDHVSetting::feb, MECModelEnuComparisons::i, LOG_ERROR, LOG_INFO, Map(), and NDAPDHVSetting::plane.

48  {
49  LOG_INFO("CMap") << "Adding exception " << chan1 << "->" << chan2;
50 
51  int ndashes1=0;
52  int ndashes2=0;
53 
54  for (size_t i=0; i<chan1.length(); ++i) {
55  if (chan1[i] == '-') ndashes1++;
56  }
57  for (size_t i=0; i<chan2.length(); ++i) {
58  if (chan2[i] == '-') ndashes2++;
59  }
60 
61  if ((ndashes1 != ndashes2) || ndashes1==0) {
62  LOG_ERROR("CMap") << "Mismatch in string formats for the two channels! Please use either [diblock]-[dcm]-[feb], [diblock]-[dcm]-[feb]-[pixel], or [plane]-[cell].";
63  return;
64  }
65 
66  int plane, cell;
67  int db, dcm, feb, pixel;
68 
69  if (ndashes1 == 1) {
70  sscanf(chan1.c_str(),"%d-%d",&plane,&cell);
71  daqchannelmap::lchan logChan = this->Map()->encodeLChan(idet,plane,cell);
72  daqchannelmap::dchan daqChan1 = this->Map()->encodeDChan(logChan);
73  sscanf(chan2.c_str(),"%d-%d",&plane,&cell);
74  logChan = this->Map()->encodeLChan(idet,plane,cell);
75  daqchannelmap::dchan daqChan2 = this->Map()->encodeDChan(logChan);
76  this->AddException(daqChan1,daqChan2);
77  }
78  else if (ndashes1==3) {
79  sscanf(chan1.c_str(),"%d-%d-%d-%d",&db,&dcm,&feb,&pixel);
80  daqchannelmap::dchan daqChan1 = this->Map()->encodeDChan(idet,db,dcm,feb,pixel);
81  sscanf(chan2.c_str(),"%d-%d-%d-%d",&db,&dcm,&feb,&pixel);
82  daqchannelmap::dchan daqChan2 = this->Map()->encodeDChan(idet,db,dcm,feb,pixel);
83  this->AddException(daqChan1,daqChan2);
84  }
85  else if (ndashes1==2) { // handle case for an entire FEB
86  sscanf(chan1.c_str(),"%d-%d-%d",&db,&dcm,&feb);
87  daqchannelmap::dchan daqChan1 = this->Map()->encodeDChan(idet,db,dcm,feb,0);
88  sscanf(chan2.c_str(),"%d-%d-%d",&db,&dcm,&feb);
89  daqchannelmap::dchan daqChan2 = this->Map()->encodeDChan(idet,db,dcm,feb,0);
90  for (int i=0; i<32; ++i) {
91  this->AddException(daqChan1+i,daqChan2+i);
92  }
93  }
94  else {
95  LOG_ERROR("CMap") << "Channel string format unsupported. Please use either [diblock]-[dcm]-[feb], [diblock]-[dcm]-[feb]-[pixel], or [plane]-[cell].";
96  return;
97  }
98 
99  }
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
lchan encodeLChan(int detId, plane_t plane, cell_t cell) const
void AddException(int idet, geo::OfflineChan chan1, geo::OfflineChan chan2)
Definition: CMap.cxx:102
dchan encodeDChan(int detID, diblock_t diblock, dcm_id_t dcm, feb_t feb, pixel_t pixel) const
#define LOG_INFO(stream)
Definition: Messenger.h:144
uint32_t dchan
< DAQ Channel Map Package
#define LOG_ERROR(stream)
Definition: Messenger.h:129
void cmap::dataprov::CMap::AddException ( daqchannelmap::dchan  chan1,
daqchannelmap::dchan  chan2 
)
inline

Definition at line 61 of file CMap.h.

61  {
62  fExceptionsMap[chan1] = chan2;
63  }
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
void cmap::dataprov::CMap::ClearExceptions ( )
inline

Definition at line 69 of file CMap.h.

Referenced by cmap::CMap::LoadExceptions().

69 { fExceptionsMap.clear(); }
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
int cmap::dataprov::CMap::computeBlock ( daqchannelmap::lchan  lchan)

Definition at line 145 of file CMap.cxx.

References elec2geo::block, daqchannelmap::DAQChannelMap::computeBlock(), daqchannelmap::DAQChannelMap::encodeDChan(), encodeLChan(), fExceptionsMap, fUseExceptions, fVerbosity, LOG_DEBUG, and Map().

146  {
147  int block = this->Map()->computeBlock(lchan);
148  if (fUseExceptions) {
149  if (fVerbosity)
150  LOG_DEBUG("CMap") << "Exceptions enabled.";
151  daqchannelmap::dchan dc = this->Map()->encodeDChan(lchan);
152  if (fExceptionsMap.find(dc) != fExceptionsMap.end()) {
153  dc = fExceptionsMap[dc];
154  block = this->Map()->computeBlock(this->Map()->encodeLChan(dc));
155  }
156  }
157  return block;
158  }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
daqchannelmap::lchan encodeLChan(int detId, int plane, int cell)
Definition: CMap.cxx:113
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
bool fUseExceptions
Definition: CMap.h:84
block
print "ROW IS " print row
Definition: elec2geo.py:31
dchan encodeDChan(int detID, diblock_t diblock, dcm_id_t dcm, feb_t feb, pixel_t pixel) const
virtual block_t computeBlock(lchan logicalchan) const =0
Which block is this lchan in?
uint32_t dchan
< DAQ Channel Map Package
int cmap::dataprov::CMap::CurrentRun ( )
inline

Definition at line 72 of file CMap.h.

Referenced by cmap::CMap::LoadExceptions().

72 { return fCurrentRun; }
daqchannelmap::dchan cmap::dataprov::CMap::encodeDChan ( daqchannelmap::lchan  lchan)

Definition at line 130 of file CMap.cxx.

References daqchannelmap::DAQChannelMap::encodeDChan(), fExceptionsMap, fUseExceptions, fVerbosity, LOG_DEBUG, and Map().

131  {
132  daqchannelmap::dchan dc = this->Map()->encodeDChan(lchan);
133  if (fUseExceptions) {
134  if (fVerbosity)
135  LOG_DEBUG("CMap") << "Exceptions enabled.";
136  if (fExceptionsMap.find(dc) != fExceptionsMap.end()) {
137  dc = fExceptionsMap[dc];
138  }
139  }
140 
141  return dc;
142  }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
bool fUseExceptions
Definition: CMap.h:84
dchan encodeDChan(int detID, diblock_t diblock, dcm_id_t dcm, feb_t feb, pixel_t pixel) const
uint32_t dchan
< DAQ Channel Map Package
daqchannelmap::lchan cmap::dataprov::CMap::encodeLChan ( int  detId,
int  plane,
int  cell 
)

Definition at line 113 of file CMap.cxx.

References daqchannelmap::DAQChannelMap::encodeDChan(), daqchannelmap::DAQChannelMap::encodeLChan(), fExceptionsMap, fUseExceptions, fVerbosity, g4zmq::lc(), LOG_DEBUG, and Map().

Referenced by computeBlock(), getCell(), and getPlane().

114  {
116  if (fUseExceptions) {
117  if (fVerbosity)
118  LOG_DEBUG("CMap") << "Exceptions enabled.";
119  daqchannelmap::dchan dchan = this->Map()->encodeDChan(lc);
120  if (fExceptionsMap.find(dchan) != fExceptionsMap.end()) {
121  dchan = fExceptionsMap[dchan];
122  lc = this->Map()->encodeLChan(dchan);
123  }
124  }
125 
126  return lc;
127  }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
lchan encodeLChan(int detId, plane_t plane, cell_t cell) const
bool fUseExceptions
Definition: CMap.h:84
def lc(target="")
Definition: g4zmq.py:63
dchan encodeDChan(int detID, diblock_t diblock, dcm_id_t dcm, feb_t feb, pixel_t pixel) const
uint32_t dchan
< DAQ Channel Map Package
std::unordered_map<daqchannelmap::dchan,daqchannelmap::dchan> cmap::dataprov::CMap::ExceptionsMap ( )
inline

Definition at line 66 of file CMap.h.

67  { return fExceptionsMap; }
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
int cmap::dataprov::CMap::getCell ( daqchannelmap::lchan  lc)

Definition at line 269 of file CMap.cxx.

References getBrightness::cell, daqchannelmap::DAQChannelMap::encodeDChan(), encodeLChan(), fExceptionsMap, fUseExceptions, fVerbosity, daqchannelmap::DAQChannelMap::getCell(), LOG_DEBUG, and Map().

270  {
271  int cell = this->Map()->getCell(lc);
272  if (fUseExceptions) {
273  if (fVerbosity)
274  LOG_DEBUG("CMap") << "Exceptions enabled.";
275  daqchannelmap::dchan dc = this->Map()->encodeDChan(lc);
276  if (fExceptionsMap.find(dc) != fExceptionsMap.end()) {
277  dc = fExceptionsMap[dc];
278  cell = this->Map()->getCell(this->Map()->encodeLChan(dc));
279  }
280  }
281  return cell;
282  }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
daqchannelmap::lchan encodeLChan(int detId, int plane, int cell)
Definition: CMap.cxx:113
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
cell_t getCell(lchan logicalchan) const
Decode the cell number from an lchan.
bool fUseExceptions
Definition: CMap.h:84
def lc(target="")
Definition: g4zmq.py:63
dchan encodeDChan(int detID, diblock_t diblock, dcm_id_t dcm, feb_t feb, pixel_t pixel) const
uint32_t dchan
< DAQ Channel Map Package
unsigned short cmap::dataprov::CMap::GetCell ( const rawdata::RawDigit dig)

Definition at line 327 of file CMap.cxx.

References rawdata::RawDigit::Channel(), rawdata::RawDigit::DaqChannel(), daqchannelmap::DAQChannelMap::encodeLChan(), fExceptionsMap, fUseExceptions, fVerbosity, daqchannelmap::DAQChannelMap::getCell(), rawdata::RawDigit::IsRealData(), LOG_DEBUG, and Map().

Referenced by comi::ChanOcc::analyze(), mcchk::DetAna::analyze(), sn::SupernovaAna::analyze(), tbana::DetectorRateShutOff::analyze(), LightLevels::analyze(), comi::Leana::AnaNHit(), chaninfo::BadChanList::Apply(), murem::CompareDigitsByPlaneAndCell(), evd::RawDataDrawer::Draw3DHitBoxes(), calib::MakeAttenuationProfiles::event(), util::EventBox(), calib::CosmicCalib::filter(), calib::Calibrator::MakeCellHit(), evtsum::EventSummary::MakeOutput(), comi::Cana::produce(), calhit::CalHit::produce(), rsim::ReadoutSim::produce(), evd::RawDataDrawer::RawDigit2D(), and trk::RLFit::RLFit().

328  {
329  if (!dig) return 30000;
330 
331  // const
332  daqchannelmap::lchan local_channel = dig->Channel();
333 
334  if (dig->IsRealData() && fUseExceptions) {
335  if (fVerbosity)
336  LOG_DEBUG("CMap") << "Exceptions enabled.";
338  if (fExceptionsMap.find(dchan) != fExceptionsMap.end()) {
339  dchan = fExceptionsMap[dchan];
340  local_channel = this->Map()->encodeLChan(dchan);
341  }
342  }
343 
344  return this->Map()->getCell(local_channel);
345  }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
cell_t getCell(lchan logicalchan) const
Decode the cell number from an lchan.
lchan encodeLChan(int detId, plane_t plane, cell_t cell) const
bool fUseExceptions
Definition: CMap.h:84
uint32_t DaqChannel() const
Definition: RawDigit.h:85
uint32_t Channel() const
Definition: RawDigit.h:84
uint32_t dchan
< DAQ Channel Map Package
bool IsRealData() const
Definition: RawDigit.h:107
unsigned short cmap::dataprov::CMap::GetCell ( const rb::CellHit dig)

Definition at line 348 of file CMap.cxx.

References rawdata::RawDigit::Channel(), rawdata::RawDigit::DaqChannel(), daqchannelmap::DAQChannelMap::encodeLChan(), fExceptionsMap, fUseExceptions, fVerbosity, daqchannelmap::DAQChannelMap::getCell(), rawdata::RawDigit::IsRealData(), LOG_DEBUG, and Map().

349  {
350  if (!dig) return 30000;
351 
352  // const
353  daqchannelmap::lchan local_channel = dig->Channel();
354 
355  if (dig->IsRealData() && fUseExceptions) {
356  if (fVerbosity)
357  LOG_DEBUG("CMap") << "Exceptions enabled.";
359  if (fExceptionsMap.find(dchan) != fExceptionsMap.end()) {
360  dchan = fExceptionsMap[dchan];
361  local_channel = this->Map()->encodeLChan(dchan);
362  }
363  }
364 
365  return this->Map()->getCell(local_channel);
366  }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
cell_t getCell(lchan logicalchan) const
Decode the cell number from an lchan.
lchan encodeLChan(int detId, plane_t plane, cell_t cell) const
bool fUseExceptions
Definition: CMap.h:84
uint32_t DaqChannel() const
Definition: RawDigit.h:85
uint32_t Channel() const
Definition: RawDigit.h:84
uint32_t dchan
< DAQ Channel Map Package
bool IsRealData() const
Definition: RawDigit.h:107
int cmap::dataprov::CMap::getDCM ( daqchannelmap::dchan  dc)

Definition at line 191 of file CMap.cxx.

References febshutoff_auto::dcm, fExceptionsMap, fUseExceptions, fVerbosity, daqchannelmap::DAQChannelMap::getDCM(), LOG_DEBUG, and Map().

Referenced by tbana::DetectorRateShutOff::analyze().

192  {
193  int dcm = this->Map()->getDCM(dc);
194  if (fUseExceptions) {
195  if (fVerbosity)
196  LOG_DEBUG("CMap") << "Exceptions enabled.";
197  if (fExceptionsMap.find(dc) != fExceptionsMap.end()) {
198  dc = fExceptionsMap[dc];
199  dcm = this->Map()->getDCM(dc);
200  }
201  }
202  return dcm;
203  }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
bool fUseExceptions
Definition: CMap.h:84
dcm_id_t getDCM(dchan daqchan) const
Decode the dcm ID from a dchan.
int cmap::dataprov::CMap::getDetector ( daqchannelmap::dchan  dc)

Definition at line 161 of file CMap.cxx.

References fillBadChanDBTables::det, fExceptionsMap, fUseExceptions, fVerbosity, daqchannelmap::DAQChannelMap::getDetector(), LOG_DEBUG, and Map().

162  {
163  int det = this->Map()->getDetector(dc);
164  if (fUseExceptions) {
165  if (fVerbosity)
166  LOG_DEBUG("CMap") << "Exceptions enabled.";
167  if (fExceptionsMap.find(dc) != fExceptionsMap.end()) {
168  dc = fExceptionsMap[dc];
169  det = this->Map()->getDetector(dc);
170  }
171  }
172  return det;
173  }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
int getDetector(uint32_t anychan) const
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
bool fUseExceptions
Definition: CMap.h:84
int cmap::dataprov::CMap::getDiBlock ( daqchannelmap::dchan  dc)

Definition at line 176 of file CMap.cxx.

References elec2geo::block, fExceptionsMap, fUseExceptions, fVerbosity, daqchannelmap::DAQChannelMap::getDiBlock(), LOG_DEBUG, and Map().

177  {
178  int block = this->Map()->getDiBlock(dc);
179  if (fUseExceptions) {
180  if (fVerbosity)
181  LOG_DEBUG("CMap") << "Exceptions enabled.";
182  if (fExceptionsMap.find(dc) != fExceptionsMap.end()) {
183  dc = fExceptionsMap[dc];
184  block = this->Map()->getDiBlock(dc);
185  }
186  }
187  return block;
188  }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
bool fUseExceptions
Definition: CMap.h:84
block
print "ROW IS " print row
Definition: elec2geo.py:31
diblock_t getDiBlock(dchan daqchan) const
Decode the diblock ID from a dchan.
int cmap::dataprov::CMap::getFEB ( daqchannelmap::dchan  dc)

Definition at line 206 of file CMap.cxx.

References APDHVSetting::feb, fExceptionsMap, fUseExceptions, fVerbosity, daqchannelmap::DAQChannelMap::getFEB(), LOG_DEBUG, and Map().

Referenced by tbana::DetectorRateShutOff::analyze().

207  {
208  int feb = this->Map()->getFEB(dc);
209  if (fUseExceptions) {
210  if (fVerbosity)
211  LOG_DEBUG("CMap") << "Exceptions enabled.";
212  if (fExceptionsMap.find(dc) != fExceptionsMap.end()) {
213  dc = fExceptionsMap[dc];
214  feb = this->Map()->getFEB(dc);
215  }
216  }
217  return feb;
218  }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
bool fUseExceptions
Definition: CMap.h:84
feb_t getFEB(dchan daqchan) const
Decode the feb id from a dchan.
int cmap::dataprov::CMap::getPixel ( daqchannelmap::dchan  dc)

Definition at line 221 of file CMap.cxx.

References fExceptionsMap, fUseExceptions, fVerbosity, daqchannelmap::DAQChannelMap::getPixel(), LOG_DEBUG, and Map().

222  {
223  int pixel = this->Map()->getPixel(dc);
224 
225  if (fUseExceptions) {
226  if (fVerbosity)
227  LOG_DEBUG("CMap") << "Exceptions enabled.";
228  if (fExceptionsMap.find(dc) != fExceptionsMap.end()) {
229  dc = fExceptionsMap[dc];
230  pixel = this->Map()->getPixel(dc);
231  }
232  }
233  return pixel;
234  }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
bool fUseExceptions
Definition: CMap.h:84
pixel_t getPixel(dchan daqchan) const
Decode the pixel id from a dchan.
int cmap::dataprov::CMap::getPlane ( daqchannelmap::lchan  lc)

Definition at line 253 of file CMap.cxx.

References daqchannelmap::DAQChannelMap::encodeDChan(), encodeLChan(), fExceptionsMap, fUseExceptions, fVerbosity, daqchannelmap::DAQChannelMap::getPlane(), LOG_DEBUG, Map(), and NDAPDHVSetting::plane.

254  {
255  int plane = this->Map()->getPlane(lc);
256  if (fUseExceptions) {
257  if (fVerbosity)
258  LOG_DEBUG("CMap") << "Exceptions enabled.";
259  daqchannelmap::dchan dc = this->Map()->encodeDChan(lc);
260  if (fExceptionsMap.find(dc) != fExceptionsMap.end()) {
261  dc = fExceptionsMap[dc];
262  plane = this->Map()->getPlane(this->Map()->encodeLChan(dc));
263  }
264  }
265  return plane;
266  }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
daqchannelmap::lchan encodeLChan(int detId, int plane, int cell)
Definition: CMap.cxx:113
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
bool fUseExceptions
Definition: CMap.h:84
def lc(target="")
Definition: g4zmq.py:63
plane_t getPlane(lchan logicalchan) const
Decode the plane number from an lchan.
dchan encodeDChan(int detID, diblock_t diblock, dcm_id_t dcm, feb_t feb, pixel_t pixel) const
uint32_t dchan
< DAQ Channel Map Package
unsigned short cmap::dataprov::CMap::GetPlane ( const rawdata::RawDigit dig)

Definition at line 285 of file CMap.cxx.

References rawdata::RawDigit::Channel(), rawdata::RawDigit::DaqChannel(), daqchannelmap::DAQChannelMap::encodeLChan(), fExceptionsMap, fUseExceptions, fVerbosity, daqchannelmap::DAQChannelMap::getPlane(), rawdata::RawDigit::IsRealData(), LOG_DEBUG, and Map().

Referenced by comi::ChanOcc::analyze(), mcchk::DetAna::analyze(), sn::SupernovaAna::analyze(), tbana::DetectorRateShutOff::analyze(), LightLevels::analyze(), comi::Leana::AnaNHit(), chaninfo::BadChanList::Apply(), murem::CompareDigitsByPlaneAndCell(), util::CountXY(), evd::RawDataDrawer::Draw3DHitBoxes(), calib::MakeAttenuationProfiles::event(), util::EventBox(), calib::CosmicCalib::filter(), calib::Calibrator::MakeCellHit(), evtsum::EventSummary::MakeOutput(), comi::Cana::produce(), calhit::CalHit::produce(), rsim::ReadoutSim::produce(), evd::RawDataDrawer::RawDigit2D(), and trk::RLFit::RLFit().

286  {
287  if (!dig) return 30000;
288 
289  daqchannelmap::lchan local_channel = dig->Channel();
290 
291  if (dig->IsRealData() && fUseExceptions) {
292  if (fVerbosity)
293  LOG_DEBUG("CMap") << "Exceptions enabled.";
295  if (fExceptionsMap.find(dchan) != fExceptionsMap.end()) {
296  dchan = fExceptionsMap[dchan];
297  local_channel = this->Map()->encodeLChan(dchan);
298  }
299  }
300 
301  return this->Map()->getPlane(local_channel);
302 
303  }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
lchan encodeLChan(int detId, plane_t plane, cell_t cell) const
bool fUseExceptions
Definition: CMap.h:84
uint32_t DaqChannel() const
Definition: RawDigit.h:85
uint32_t Channel() const
Definition: RawDigit.h:84
plane_t getPlane(lchan logicalchan) const
Decode the plane number from an lchan.
uint32_t dchan
< DAQ Channel Map Package
bool IsRealData() const
Definition: RawDigit.h:107
unsigned short cmap::dataprov::CMap::GetPlane ( const rb::CellHit dig)

Definition at line 306 of file CMap.cxx.

References rawdata::RawDigit::Channel(), rawdata::RawDigit::DaqChannel(), daqchannelmap::DAQChannelMap::encodeLChan(), fExceptionsMap, fUseExceptions, fVerbosity, daqchannelmap::DAQChannelMap::getPlane(), rawdata::RawDigit::IsRealData(), LOG_DEBUG, and Map().

307  {
308  if (!dig) return 30000;
309 
310  daqchannelmap::lchan local_channel = dig->Channel();
311 
312  if (dig->IsRealData() && fUseExceptions) {
313  if (fVerbosity)
314  LOG_DEBUG("CMap") << "Exceptions enabled.";
316  if (fExceptionsMap.find(dchan) != fExceptionsMap.end()) {
317  dchan = fExceptionsMap[dchan];
318  local_channel = this->Map()->encodeLChan(dchan);
319  }
320  }
321 
322  return this->Map()->getPlane(local_channel);
323 
324  }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
lchan encodeLChan(int detId, plane_t plane, cell_t cell) const
bool fUseExceptions
Definition: CMap.h:84
uint32_t DaqChannel() const
Definition: RawDigit.h:85
uint32_t Channel() const
Definition: RawDigit.h:84
plane_t getPlane(lchan logicalchan) const
Decode the plane number from an lchan.
uint32_t dchan
< DAQ Channel Map Package
bool IsRealData() const
Definition: RawDigit.h:107
int cmap::dataprov::CMap::getView ( daqchannelmap::dchan  dc)

Definition at line 237 of file CMap.cxx.

References fExceptionsMap, fUseExceptions, fVerbosity, daqchannelmap::DAQChannelMap::getView(), LOG_DEBUG, Map(), and POTSpillRate::view.

238  {
239  int view = this->Map()->getView(dc);
240 
241  if (fUseExceptions) {
242  if (fVerbosity)
243  LOG_DEBUG("CMap") << "Exceptions enabled.";
244  if (fExceptionsMap.find(dc) != fExceptionsMap.end()) {
245  dc = fExceptionsMap[dc];
246  view = this->Map()->getView(dc);
247  }
248  }
249  return view;
250  }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
virtual DetView_TYPE getView(dchan daqchan) const =0
Which view (X or Y) does this daq channel readout?
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
bool fUseExceptions
Definition: CMap.h:84
const daqchannelmap::DAQChannelMap* cmap::dataprov::CMap::Map ( ) const
inline

Definition at line 57 of file CMap.h.

Referenced by AddException(), febstat::FEBShutoff::analyze(), align::AlignInspect::analyze(), dprf::ChannelPlots::analyze(), dprf::TrackPlots::analyze(), febstat::EventFEBStatus::analyze(), sn::SupernovaAna::analyze(), align::SplitTracks::analyze(), comi::DataCheck::analyze(), comi::NearlineAna::analyze(), dprf::ChannelPlots::beginRun(), calib::DriftResponseCalc::beginRun(), chaninfo::FindSwappedChannels::beginSubRun(), slicer::Slicer::BlockSlice(), computeBlock(), rsim::ReadoutSim::CreateRawDigits(), encodeDChan(), encodeLChan(), raw2daq::RawDigit2DAQHit::FillDAQHits(), dprf::ChannelPlots::FillFebRawPlots(), mcdatadaq::DAQSimulator::fillMicroSlices(), daq2raw::DAQHit2Raw::FillRawDigits(), DataCheck::HardwareStatusCheck::filter(), mcdatadaq::DCMSimulator::generateNanoSlice(), getCell(), GetCell(), calib::DriftResponseCalc::GetChanID(), getDCM(), evd::GeometryDrawer::GetDCMBoxes(), getDetector(), getDiBlock(), getFEB(), calib::Calibrator::getFebType(), mcdatadaq::DAQSimulator::getNanoSliceOrder(), calib::Calibrator::GetPECorrToGeVScale(), getPixel(), getPlane(), GetPlane(), calib::Calibrator::GetTimingOffset(), getView(), mcdatadaq::DAQSimulator::init(), chaninfo::BadChanList::LoadNewData(), calib::Calibrator::MakeCellHit(), evtsum::EventSummary::MakeOutput(), mcdatadaq::DAQSimulator::print(), MergeTBDaqCollections::MergeTBDaqCollections::produce(), rsim::ReadoutSim::produce(), lem::GenFromLib::readNext(), and calib::DriftCorrection::respondToCloseOutputFiles().

57 { return fStdMap; }
const daqchannelmap::DAQChannelMap * fStdMap
Definition: CMap.h:86
int cmap::dataprov::CMap::NExceptions ( )
inline

Definition at line 65 of file CMap.h.

65 { return fExceptionsMap.size(); }
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
void cmap::dataprov::CMap::SetCurrentRun ( int  run)
inline
void cmap::dataprov::CMap::SetStdMap ( const daqchannelmap::DAQChannelMap m)
inline

Definition at line 36 of file CMap.h.

References getBrightness::cell, runNovaSAM::detId, m, and NDAPDHVSetting::plane.

Referenced by cmap::CMap::postBeginRun().

36  {
37  fStdMap = m;
38  }
const daqchannelmap::DAQChannelMap * fStdMap
Definition: CMap.h:86
void cmap::dataprov::CMap::SetUseExceptions ( bool  v)
inline

Definition at line 74 of file CMap.h.

References registry_explorer::v.

Referenced by cmap::CMap::CMap().

void cmap::dataprov::CMap::SetVerbosity ( int  v)
inline

Definition at line 77 of file CMap.h.

References registry_explorer::v.

Referenced by cmap::CMap::CMap().

bool cmap::dataprov::CMap::UseExceptions ( )
inline

Definition at line 75 of file CMap.h.

Referenced by cmap::CMap::CMap(), and cmap::CMap::postBeginRun().

75 { return fUseExceptions; }
bool fUseExceptions
Definition: CMap.h:84
int cmap::dataprov::CMap::Verbosity ( )
inline

Definition at line 78 of file CMap.h.

Referenced by cmap::CMap::CMap().

78 { return fVerbosity; }

Member Data Documentation

int cmap::dataprov::CMap::fCurrentRun
private

Definition at line 82 of file CMap.h.

Referenced by CMap().

std::unordered_map<daqchannelmap::dchan,daqchannelmap::dchan> cmap::dataprov::CMap::fExceptionsMap
private
const daqchannelmap::DAQChannelMap* cmap::dataprov::CMap::fStdMap
private

Definition at line 86 of file CMap.h.

Referenced by CMap().

bool cmap::dataprov::CMap::fUseExceptions
private
int cmap::dataprov::CMap::fVerbosity
private

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