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

Channel masks are defined in DAQChannelMap package. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-28/CMap/service/CMapService.h"

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

Classes

struct  Params
 

Public Types

using Parameters = art::ServiceTable< Params >
 

Public Member Functions

 CMap (const Parameters &params, art::ActivityRegistry &reg)
 
virtual ~CMap ()
 
void postBeginRun (const art::Run &run)
 
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 Member Functions

void LoadExceptions ()
 

Private Attributes

bool fGotExceptions
 
bool fAbortIfLoadFails
 

Detailed Description

Channel masks are defined in DAQChannelMap package.

Definition at line 19 of file CMapService.h.

Member Typedef Documentation

Definition at line 29 of file CMapService.h.

Constructor & Destructor Documentation

cmap::CMap::CMap ( const Parameters params,
art::ActivityRegistry reg 
)

Definition at line 24 of file CMap_service.cc.

References fGotExceptions, postBeginRun(), cmap::dataprov::CMap::SetCurrentRun(), cmap::dataprov::CMap::SetUseExceptions(), cmap::dataprov::CMap::SetVerbosity(), art::ActivityRegistry::sPostBeginRun, cmap::dataprov::CMap::UseExceptions(), and cmap::dataprov::CMap::Verbosity().

25  : fAbortIfLoadFails(params().AbortIfLoadFails())
26  {
27  this->SetCurrentRun(0);
28  fGotExceptions = false;
29  SetUseExceptions(params().UseExceptions());
30  SetVerbosity(params().Verbosity());
31  reg.sPostBeginRun.watch(this, &CMap::postBeginRun);
32  }
void SetVerbosity(int v)
Definition: CMap.h:77
void SetUseExceptions(bool v)
Definition: CMap.h:74
int Verbosity()
Definition: CMap.h:78
GlobalSignal< detail::SignalResponseType::LIFO, void(Run const &)> sPostBeginRun
void postBeginRun(const art::Run &run)
Definition: CMap_service.cc:41
void SetCurrentRun(int run)
Definition: CMap.h:71
bool fAbortIfLoadFails
Definition: CMapService.h:40
bool UseExceptions()
Definition: CMap.h:75
bool fGotExceptions
Definition: CMapService.h:39
cmap::CMap::~CMap ( )
virtual

Definition at line 35 of file CMap_service.cc.

36  {
37  }

Member Function Documentation

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

Definition at line 102 of file CMap.cxx.

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

Referenced by cmap::dataprov::CMap::AddException(), and 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 
)
inherited

Definition at line 47 of file CMap.cxx.

References cmap::dataprov::CMap::AddException(), getBrightness::cell, febshutoff_auto::db, febshutoff_auto::dcm, daqchannelmap::DAQChannelMap::encodeDChan(), daqchannelmap::DAQChannelMap::encodeLChan(), APDHVSetting::feb, MECModelEnuComparisons::i, LOG_ERROR, LOG_INFO, cmap::dataprov::CMap::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 
)
inlineinherited

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 ( )
inlineinherited

Definition at line 69 of file CMap.h.

Referenced by LoadExceptions().

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

Definition at line 145 of file CMap.cxx.

References elec2geo::block, daqchannelmap::DAQChannelMap::computeBlock(), daqchannelmap::DAQChannelMap::encodeDChan(), cmap::dataprov::CMap::encodeLChan(), cmap::dataprov::CMap::fExceptionsMap, cmap::dataprov::CMap::fUseExceptions, cmap::dataprov::CMap::fVerbosity, LOG_DEBUG, and cmap::dataprov::CMap::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 ( )
inlineinherited

Definition at line 72 of file CMap.h.

Referenced by LoadExceptions().

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

Definition at line 130 of file CMap.cxx.

References daqchannelmap::DAQChannelMap::encodeDChan(), cmap::dataprov::CMap::fExceptionsMap, cmap::dataprov::CMap::fUseExceptions, cmap::dataprov::CMap::fVerbosity, LOG_DEBUG, and cmap::dataprov::CMap::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 
)
inherited

Definition at line 113 of file CMap.cxx.

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

Referenced by cmap::dataprov::CMap::computeBlock(), cmap::dataprov::CMap::getCell(), and cmap::dataprov::CMap::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 ( )
inlineinherited

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)
inherited

Definition at line 269 of file CMap.cxx.

References getBrightness::cell, daqchannelmap::DAQChannelMap::encodeDChan(), cmap::dataprov::CMap::encodeLChan(), cmap::dataprov::CMap::fExceptionsMap, cmap::dataprov::CMap::fUseExceptions, cmap::dataprov::CMap::fVerbosity, daqchannelmap::DAQChannelMap::getCell(), LOG_DEBUG, and cmap::dataprov::CMap::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)
inherited

Definition at line 327 of file CMap.cxx.

References rawdata::RawDigit::Channel(), rawdata::RawDigit::DaqChannel(), daqchannelmap::DAQChannelMap::encodeLChan(), cmap::dataprov::CMap::fExceptionsMap, cmap::dataprov::CMap::fUseExceptions, cmap::dataprov::CMap::fVerbosity, daqchannelmap::DAQChannelMap::getCell(), rawdata::RawDigit::IsRealData(), LOG_DEBUG, and cmap::dataprov::CMap::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)
inherited

Definition at line 348 of file CMap.cxx.

References rawdata::RawDigit::Channel(), rawdata::RawDigit::DaqChannel(), daqchannelmap::DAQChannelMap::encodeLChan(), cmap::dataprov::CMap::fExceptionsMap, cmap::dataprov::CMap::fUseExceptions, cmap::dataprov::CMap::fVerbosity, daqchannelmap::DAQChannelMap::getCell(), rawdata::RawDigit::IsRealData(), LOG_DEBUG, and cmap::dataprov::CMap::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)
inherited

Definition at line 191 of file CMap.cxx.

References febshutoff_auto::dcm, cmap::dataprov::CMap::fExceptionsMap, cmap::dataprov::CMap::fUseExceptions, cmap::dataprov::CMap::fVerbosity, daqchannelmap::DAQChannelMap::getDCM(), LOG_DEBUG, and cmap::dataprov::CMap::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)
inherited

Definition at line 161 of file CMap.cxx.

References fillBadChanDBTables::det, cmap::dataprov::CMap::fExceptionsMap, cmap::dataprov::CMap::fUseExceptions, cmap::dataprov::CMap::fVerbosity, daqchannelmap::DAQChannelMap::getDetector(), LOG_DEBUG, and cmap::dataprov::CMap::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)
inherited

Definition at line 176 of file CMap.cxx.

References elec2geo::block, cmap::dataprov::CMap::fExceptionsMap, cmap::dataprov::CMap::fUseExceptions, cmap::dataprov::CMap::fVerbosity, daqchannelmap::DAQChannelMap::getDiBlock(), LOG_DEBUG, and cmap::dataprov::CMap::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)
inherited

Definition at line 206 of file CMap.cxx.

References APDHVSetting::feb, cmap::dataprov::CMap::fExceptionsMap, cmap::dataprov::CMap::fUseExceptions, cmap::dataprov::CMap::fVerbosity, daqchannelmap::DAQChannelMap::getFEB(), LOG_DEBUG, and cmap::dataprov::CMap::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)
inherited

Definition at line 221 of file CMap.cxx.

References cmap::dataprov::CMap::fExceptionsMap, cmap::dataprov::CMap::fUseExceptions, cmap::dataprov::CMap::fVerbosity, daqchannelmap::DAQChannelMap::getPixel(), LOG_DEBUG, and cmap::dataprov::CMap::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)
inherited

Definition at line 253 of file CMap.cxx.

References daqchannelmap::DAQChannelMap::encodeDChan(), cmap::dataprov::CMap::encodeLChan(), cmap::dataprov::CMap::fExceptionsMap, cmap::dataprov::CMap::fUseExceptions, cmap::dataprov::CMap::fVerbosity, daqchannelmap::DAQChannelMap::getPlane(), LOG_DEBUG, cmap::dataprov::CMap::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)
inherited

Definition at line 285 of file CMap.cxx.

References rawdata::RawDigit::Channel(), rawdata::RawDigit::DaqChannel(), daqchannelmap::DAQChannelMap::encodeLChan(), cmap::dataprov::CMap::fExceptionsMap, cmap::dataprov::CMap::fUseExceptions, cmap::dataprov::CMap::fVerbosity, daqchannelmap::DAQChannelMap::getPlane(), rawdata::RawDigit::IsRealData(), LOG_DEBUG, and cmap::dataprov::CMap::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)
inherited

Definition at line 306 of file CMap.cxx.

References rawdata::RawDigit::Channel(), rawdata::RawDigit::DaqChannel(), daqchannelmap::DAQChannelMap::encodeLChan(), cmap::dataprov::CMap::fExceptionsMap, cmap::dataprov::CMap::fUseExceptions, cmap::dataprov::CMap::fVerbosity, daqchannelmap::DAQChannelMap::getPlane(), rawdata::RawDigit::IsRealData(), LOG_DEBUG, and cmap::dataprov::CMap::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)
inherited

Definition at line 237 of file CMap.cxx.

References cmap::dataprov::CMap::fExceptionsMap, cmap::dataprov::CMap::fUseExceptions, cmap::dataprov::CMap::fVerbosity, daqchannelmap::DAQChannelMap::getView(), LOG_DEBUG, cmap::dataprov::CMap::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
void cmap::CMap::LoadExceptions ( )
private

Definition at line 51 of file CMap_service.cc.

References cmap::dataprov::CMap::AddException(), nova::dbi::Row::Channel(), cmap::dataprov::CMap::ClearExceptions(), nova::dbi::Row::Col(), cmap::dataprov::CMap::CurrentRun(), DEFINE_ART_SERVICE, fillBadChanDBTables::det, ds::DetectorService::DetId(), runNovaSAM::detId, fAbortIfLoadFails, fGotExceptions, nova::dbi::Column::Get(), MECModelEnuComparisons::i, check_grl::row, string, and nova::dbi::Row::VldTime().

Referenced by postBeginRun().

52  {
53  fGotExceptions = true;
54  this->ClearExceptions();
55  std::unique_ptr<nova::dbi::Table> eTable;
56  eTable.reset(new nova::dbi::Table("CMap/CMapExceptions.xml"));
57  // eTable->SetDetector("FarDet");
58  int chan1Idx = eTable->GetColIndex("chan1");
59  int chan2Idx = eTable->GetColIndex("chan2");
60  if (! eTable->LoadFromCSV("CMap/CMapExceptions.csv")) {
61  if (fAbortIfLoadFails) std::abort();
62  return;
63  }
64  else {
66  int detId = det->DetId();
68  std::string chan1, chan2;
69  for (int i = 0; i<eTable->NRow(); ++i) {
70  row = eTable->GetRow(i);
71  if (int(row->Channel()) == detId) { // add exceptions for the approp. detector
72  if (row->VldTime() >= this->CurrentRun()) {
73  row->Col(chan1Idx).Get(chan1);
74  row->Col(chan2Idx).Get(chan2);
75  this->AddException(detId,chan1,chan2);
76  }
77  }
78  }
79  }
80 
81  }
novadaq::cnv::DetId DetId() const
What detector are we in?
Column & Col(int i)
Find index of column with name. Suitable for passing to Col.
Definition: Row.h:63
time_t VldTime()
Definition: Row.h:69
void ClearExceptions()
Definition: CMap.h:69
bool Get(T &val) const
Definition: Column.h:85
bool fAbortIfLoadFails
Definition: CMapService.h:40
void AddException(int idet, geo::OfflineChan chan1, geo::OfflineChan chan2)
Definition: CMap.cxx:102
unsigned long long Channel()
Definition: Row.h:68
int CurrentRun()
Definition: CMap.h:72
bool fGotExceptions
Definition: CMapService.h:39
enum BeamMode string
const daqchannelmap::DAQChannelMap* cmap::dataprov::CMap::Map ( ) const
inlineinherited

Definition at line 57 of file CMap.h.

References string.

Referenced by cmap::dataprov::CMap::AddException(), febstat::FEBShutoff::analyze(), align::AlignInspect::analyze(), dprf::ChannelPlots::analyze(), dprf::TrackPlots::analyze(), febstat::EventFEBStatus::analyze(), align::SplitTracks::analyze(), sn::SupernovaAna::analyze(), comi::DataCheck::analyze(), comi::NearlineAna::analyze(), dprf::ChannelPlots::beginRun(), calib::DriftResponseCalc::beginRun(), chaninfo::FindSwappedChannels::beginSubRun(), slicer::Slicer::BlockSlice(), cmap::dataprov::CMap::computeBlock(), rsim::ReadoutSim::CreateRawDigits(), cmap::dataprov::CMap::encodeDChan(), cmap::dataprov::CMap::encodeLChan(), raw2daq::RawDigit2DAQHit::FillDAQHits(), dprf::ChannelPlots::FillFebRawPlots(), mcdatadaq::DAQSimulator::fillMicroSlices(), daq2raw::DAQHit2Raw::FillRawDigits(), DataCheck::HardwareStatusCheck::filter(), mcdatadaq::DCMSimulator::generateNanoSlice(), cmap::dataprov::CMap::getCell(), cmap::dataprov::CMap::GetCell(), calib::DriftResponseCalc::GetChanID(), cmap::dataprov::CMap::getDCM(), evd::GeometryDrawer::GetDCMBoxes(), cmap::dataprov::CMap::getDetector(), cmap::dataprov::CMap::getDiBlock(), cmap::dataprov::CMap::getFEB(), calib::Calibrator::getFebType(), mcdatadaq::DAQSimulator::getNanoSliceOrder(), calib::Calibrator::GetPECorrToGeVScale(), cmap::dataprov::CMap::getPixel(), cmap::dataprov::CMap::getPlane(), cmap::dataprov::CMap::GetPlane(), calib::Calibrator::GetTimingOffset(), cmap::dataprov::CMap::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 ( )
inlineinherited

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::CMap::postBeginRun ( const art::Run run)
void cmap::dataprov::CMap::SetCurrentRun ( int  run)
inlineinherited

Definition at line 71 of file CMap.h.

References updateRunHistoryTables::run.

Referenced by CMap(), and postBeginRun().

void cmap::dataprov::CMap::SetStdMap ( const daqchannelmap::DAQChannelMap m)
inlineinherited

Definition at line 36 of file CMap.h.

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

Referenced by postBeginRun().

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

Definition at line 74 of file CMap.h.

References registry_explorer::v.

Referenced by CMap().

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

Definition at line 77 of file CMap.h.

References registry_explorer::v.

Referenced by CMap().

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

Definition at line 75 of file CMap.h.

Referenced by CMap(), and postBeginRun().

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

Definition at line 78 of file CMap.h.

Referenced by CMap().

78 { return fVerbosity; }

Member Data Documentation

bool cmap::CMap::fAbortIfLoadFails
private

Definition at line 40 of file CMapService.h.

Referenced by LoadExceptions().

bool cmap::CMap::fGotExceptions
private

Definition at line 39 of file CMapService.h.

Referenced by CMap(), LoadExceptions(), and postBeginRun().


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