AttenCache.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \brief Helper for AttenCurve
3 /// \author Chris Backhouse - bckhouse@caltech.edu
4 ///
5 ////////////////////////////////////////////////////////////////////////
7 
13 #ifdef NOVACMAKE
14 #include "Database/cxx/include/Table.h"
15 #else
16 #include "Database/Table.h"
17 #endif
18 
19 namespace calib
20 {
21  //......................................................................
22  AttenCache::AttenCache( bool is_data, int brightness_bin )
23  : fUseEpochs(false),
24  fReadEpochsFromCSV(false),
25  fInitializedData(false), fInitializedMC(false),
26  fInitializedUncalibratedMask(false),
27  fGainSetting(0),
28  fBrightnessBin(brightness_bin),
29  fIsData(is_data)
30  {
31  }
32 
33  //......................................................................
35  {
36  for(auto it: fMapMC) delete it.second;
37  for(auto it: fMapData) delete it.second;
38  }
39 
40  //......................................................................
42  {
43  if(fIsData){
44  fMapData[Key_t(res->det, res->chan)] = res;
45  }
46  else{
47  fMapMC[Key_t(res->det, res->chan)] = res;
48  }
49  }
50 
51  //......................................................................
54  {
55  // TODO - this won't behave right if we ask for more than one detector
56  if(!fInitializedData){
57  fInitializedData = true;
58  LoadFromDatabase(geom);
59  }
60 
61  return Get(TranslateChannelData(chan, geom));
62  }
63 
64  //......................................................................
66  geo::OfflineChan chan, bool maskUncalibratedChannels)
67  {
68  // TODO - this won't behave right if we ask for more than one detector
69  if(!fInitializedMC){
70  fInitializedMC = true;
71  LoadFromDatabase(geom);
72  }
73 
74  if(!fInitializedUncalibratedMask && maskUncalibratedChannels){
77  }
78 
79  if(maskUncalibratedChannels &&
80  fMapUncalibratedMask.count(TranslateChannelData(chan, geom))){
81  return 0;
82  }
83 
84  return Get(TranslateChannelMC(chan, geom));
85  }
86 
87  //......................................................................
89  {
90  if(fIsData){
91  auto it = fMapData.find(key);
92  if(it != fMapData.end()) return it->second;
93  }
94  else{
95  auto it = fMapMC.find(key);
96  if(it != fMapMC.end()) return it->second;
97  }
98 
99  return 0;
100  }
101 
102  //......................................................................
103  void AttenCache::GetEpochFromDB(int idet, bool forceData)
104  {
105  nova::dbi::Table tbl("Calibration/tables/CalibAttenEpochs.xml");
106  if (fIsData || forceData)
108  else
110  tbl.SetTag(fEpochTag);
111  tbl.SetDetector(idet);
112  tbl.SetMinTSVld(fRun);
113  tbl.SetMaxTSVld(fRun);
114  tbl.SetVerbosity(100);
115  assert(tbl.Load());
116  assert(tbl.NRow() == 1);
117 
118  int epochIdx = tbl.GetColIndex("epoch");
119  tbl.GetRow(0)->Col(epochIdx).Get(fEpoch);
120  }
121 
122 
123 
124  //......................................................................
126  bool points,
127  bool forceData)
128  {
129  // necessary components of path
130  const char* ups_path = getenv("CALIBCSVS_CSV_PATH");
131  assert(ups_path);
132  const char* pointsStr = points ? "points" : "consts";
133 
134  const char* detStr = calib::getDetString(det);
135  //(det == novadaq::cnv::kFARDET) ? "fd" : "nd";
136  const char* mcStr = (fIsData || forceData) ? "data" : "mc";
137 
138  // extra specifiers depending on epoch, gain, and brightness settings
139  std::string gainStr, epStr, fbStr;
140  fbStr = (forceData || fIsData || fBrightnessBin<0) ? "" : ".fb"+std::to_string(fBrightnessBin);
141 
142  //RJN check that directory exists
143  std::string dirString=TString::Format("%s/%s",ups_path, fTag.c_str()).Data();
144  if(!doesDirectoryExist(dirString)) {
145  LOG_ERROR("AttenCache") << dirString << " is not a directory is there a mismatch between the CALIBCSVS_CSV_PATH and the calibration tag in Calibration.fcl ?\nCALIBCSVS_CSV_PATH is" << ups_path << "\nTag is " << fTag << "\n" ;
146  abort();
147  // assert(!"Can't find the right calibration directory");
148  }
149 
150 
151  if(fReadEpochsFromCSV) {
152  //Need to read the epochs and then assign things correctly
153  //Currently this won't work unles fUseCSVsFromUPS is set RJN should fix this soon.
154  std::string prePattern=TString::Format("%s/%s/calib_atten_%s.%s.%s.%s%s",
155  ups_path, fTag.c_str(), // -Path
156  pointsStr, detStr, mcStr, fTag.c_str(), // -CSV types
157  gainStr.c_str()).Data();
158  std::string postPattern=TString::Format("%s.csv",fbStr.c_str() ).Data();
159 
160  LOG_DEBUG ("AttenCache") << "In GetCSVPath prePattern "
161  << prePattern.c_str()
162  << "\t postPattern " << postPattern.c_str() << "\n";
163 
164  return getCSVFilenameByParsingDirectory(fRun,prePattern,postPattern);
165 
166 
167  }
168  else if (fUseEpochs) {
169  GetEpochFromDB(det,forceData);
170  assert(!fEpoch.empty());
171  epStr="."+fEpoch; gainStr="";
172  }
173  else {
174  epStr="";
175  if (!fGainSetting) gainStr="";
176  else gainStr=TString::Format(".g%d",fGainSetting);
177  }
178 
179 
180  // if configured to provide own path
181  if(!fUseCSVsFromUPS){
182  return TString::Format("%s/calib_atten_%s%s.csv",
183  fCSVSourceDir.c_str(),
184  pointsStr,
185  fbStr.c_str() ).Data();
186 
187  }
188 
189 
190  // Return final path |----| last 3 could be empty
191  return TString::Format("%s/%s/calib_atten_%s.%s.%s.%s%s%s%s.csv",
192  ups_path, fTag.c_str(), // -Path
193  pointsStr, detStr, mcStr, fTag.c_str(), // -CSV types
194  gainStr.c_str(), epStr.c_str(), // -Extra specifiers which
195  fbStr.c_str() ).Data(); // could be empty
196  }
197 
198  //......................................................................
200  {
201  // For the FD this will make a cache ~80MB. That's OK, but denser LOWESS
202  // points would increase this rapidly.
203 
204  LOG_VERBATIM("AttenCache") << "Initializing attenuation cache for "
206  << "\t fReadEpochsFromCSV:\t" << fReadEpochsFromCSV << "\n";
207 
208  const std::string constsCSVSource = GetCSVPath(geom->DetId(), false);
209  LOG_VERBATIM("AttenCache") << "Loading attenuation cache consts from "
210  << constsCSVSource;
211 
212  FILE* fconsts = fopen(constsCSVSource.c_str(), "r");
213  if(!fconsts){
214  std::cerr << "Couldn't open " << constsCSVSource << std::endl;
215  if( constsCSVSource.find(".fb") != std::string::npos )
216  std::cerr << " Note: cannot model fiber brightness while using"
217  << " UPS CVS constants tagged v9 or before." << std::endl;
218  abort();
219  }
220 
221  char hdr[4096];
222  fscanf(fconsts, "%s", hdr);
223  // Expect the file to start with this exact header
224  if(hdr != std::string("#coeff_exp,atten_length,background,edge_low,edge_high,coeff_low,coeff_high,chisq,channel,tv")){
225  std::cerr << "Bad header in " << constsCSVSource
226  << " : '" << hdr << "'" << std::endl;
227  abort();
228  }
229 
230  unsigned int line=0;
231  while(!feof(fconsts)){
232  line++;
234  geo::OfflineChan(-1, -1));
235 
236  int channel, tv;
237  const int n = fscanf(fconsts, "%f,%f,%f,%f,%f,%f,%f,%f,%d,%d",
238  &res->coeff_exp, &res->atten_length, &res->background,
239  &res->edge_low, &res->edge_high,
240  &res->coeff_low, &res->coeff_high,
241  &res->chisq,
242  &channel, &tv);
243  if(n == EOF){
244  delete res;
245  break;
246  }
247 
248  if(n != 10){
249  std::cerr << "Bad row in " << constsCSVSource
250  << "\n Read " << n << " columns on line "
251  << line+1 << std::endl;
252  abort();
253  }
254 
256 
257  bool inMuonCatcher = false;
258  const geo::PlaneGeo* geoplane = 0;
259 
260  const int plane = res->chan.Plane();
261  if(fIsData && plane < 1000){
262  // Normal data just has regular channel numbers
263  geoplane = geom->Plane(plane);
264  if(geom->DetId() == novadaq::cnv::kNEARDET &&
265  plane >= int(geom->FirstPlaneInMuonCatcher())){
266  inMuonCatcher = true;
267  }
268  }
269  else{
270  // Otherwise is merged views or MC
271  geoplane = RepresentativePlane(geom, plane, inMuonCatcher);
272  }
273 
274  if(!geoplane) continue;
275  const geo::CellGeo* geocell = geoplane->Cell(res->chan.Cell());
276  if(!geocell) continue;
277 
278  res->cell_length = 2*geocell->HalfL();
279 
280  if(inMuonCatcher){
281  // Find a plane from the same view that's not in the muon catcher, to
282  // find out how much the muon catcher cell must be displaced.
283  int i = 0;
284  const geo::PlaneGeo* regularPlane = geom->Plane(i);
285  while(regularPlane->View() != geoplane->View())
286  regularPlane = geom->Plane(++i);
287  const geo::CellGeo* regularCell = regularPlane->Cell(res->chan.Cell());
288 
289  // Assume that the cells are aligned on the readout side
290  res->center_offset = regularCell->HalfL()-geocell->HalfL();
291  }
292 
293  res->initialized = true;
294 
295  Add(res);
296 
297  // Figure out which diblock, mark it calibrated
298  const int db = plane/64+1;
299  fDiblocks.insert(db);
300  } // end while
301 
302  fclose(fconsts);
303 
304 
305  // Now fetch the LOWESS points and add them to the curves we've just
306  // created.
307 
308  const std::string pointsCSVSource = GetCSVPath(geom->DetId(), true);
309  mf::LogInfo("AttenCache") << "Loading attenuation cache points from "
310  << pointsCSVSource;
311 
312  FILE* fpoints = fopen(pointsCSVSource.c_str(), "r");
313  if(!fpoints){
314  std::cerr << "Couldn't open " << pointsCSVSource << std::endl;
315  abort();
316  }
317 
318  // Expect the file to start with this exact header
319  fscanf(fpoints, "%s", hdr);
320 
321  // Expect the file to start with this exact header
322  if(hdr != std::string("#w,factor,channel,tv")){
323  std::cerr << "Bad header in " << pointsCSVSource
324  << " : '" << hdr << "'" << std::endl;
325  abort();
326  }
327 
328  int totPoints = 0;
329  line = 0;
330  while(!feof(fpoints)){
331  line++;
332  float w, factor;
333  int channel, tv;
334 
335  const int n = fscanf(fpoints, "%f,%f,%d,%d", &w, &factor, &channel, &tv);
336  if(n == EOF) break;
337 
338  if(n != 4){
339  std::cerr << "Bad row in " << pointsCSVSource
340  << "\n Read " << n << " columns on line "
341  << line+1 << std::endl;
342  abort();
343  }
344 
345  ++totPoints;
346 
348 
349  AttenCurve* curve;
350 
351  if(fIsData){
352  auto it = fMapData.find(Key_t(geom->DetId(), chan));
353  if(it == fMapData.end()){
354  std::cerr << "Couldn't find appropriate curve for atten point. "
355  << "Chan = " << chan << std::endl;
356  std::abort();
357  }
358  curve = it->second;
359  }
360  else{
361  auto it = fMapMC.find(Key_t(geom->DetId(), chan));
362  if(it == fMapMC.end()){
363  std::cerr << "Couldn't find appropriate curve for attenp point. "
364  << "Chan = " << chan << std::endl;
365  std::abort();
366  }
367  curve = it->second;
368  }
369 
370  const unsigned int interpIdx = channel%1000;
371  if(curve->interp_pts.size() <= interpIdx)
372  curve->interp_pts.resize(interpIdx+1);
373  curve->interp_pts[interpIdx] = {w, factor};
374  } // end while
375 
376  fclose(fpoints);
377 
378  // Save a little memory
379  for(auto it: fMapData) it.second->interp_pts.shrink_to_fit();
380  for(auto it: fMapMC) it.second->interp_pts.shrink_to_fit();
381 
382  // Check that the number of points we got from the DB is the same as the
383  // total in all the AttenCurves. If these numbers don't match, it means
384  // there were duplicates or gaps.
385  int pointsCount = 0;
386  if(fIsData){
387  for(auto it: fMapData) pointsCount += it.second->interp_pts.size();
388  }
389  else{
390  for(auto it: fMapMC) pointsCount += it.second->interp_pts.size();
391  }
392 
393  if(pointsCount != totPoints){
394  std::cerr << "Mismatch between DB and AttenCurve counts. "
395  << pointsCount << " vs "<< totPoints << std::endl;
396  std::abort();
397  }
398  }
399 
400  //......................................................................
402  {
403  mf::LogInfo("AttenCache")
404  << "Initializing data attentuation fit chisq values for "
406  << " from database to mask uncalibrated channels...\n";
407 
408  nova::dbi::Table tblConsts("Calibration/tables/CalibAttenConstsVld.xml");
409  tblConsts.SetDetector(geom->DetId());
410  tblConsts.SetDataTypeMask(nova::dbi::kDataOnly);
411 
412  if(!fTag.empty()) tblConsts.SetTag(fTag);
413  tblConsts.SetVerbosity(100);
414 
415  tblConsts.SetMinTSVld(1);
416  tblConsts.SetMaxTSVld(100);
417 
418  bool ok = true;
419 
420  if(!fCSVSourceDir.empty()){
421  mf::LogInfo("AttenCache")
422  << "Trying to get data constants from the MC CSV file, "
423  << "no good way to handle this if you want to use masking. Aborting."
424  << std::endl;
425  std::abort();
426  }
427  else{
428  if(fUseCSVsFromUPS){
429  // Always ask for data, because we're masking the MC to match real data
430  // conditions.
431  const std::string constsCSVSource = GetCSVPath(geom->DetId(), false, true);
432  mf::LogInfo("AttenCache") << "Loading attenuation cache from "
433  << constsCSVSource << std::endl;
434  ok = ok && (tblConsts.LoadFromCSV(constsCSVSource) > 0);
435  mf::LogInfo("AttenCache") << "Got " << tblConsts.NRow() << " rows from CSV" << std::endl;
436  }
437  else{
438  ok = ok && tblConsts.Load();
439  }
440  }
441 
442  if(!ok){
443  // No safe way to handle this
444  mf::LogError("AttenCache") << "Unable to load attenuation tables. Aborting"
445  << std::endl;
446  // I've definitely seen mf lose races with shutdown
447  std::cerr << "Unable to load attenuation tables. Aborting"
448  << std::endl;
449  std::abort();
450  }
451 
452  const int chisqCol = tblConsts.GetColIndex("chisq");
453 
454  const int Nconsts = tblConsts.NRow();
455  for(int nconsts = 0; nconsts < Nconsts; ++nconsts){
456  nova::dbi::Row* row = tblConsts.GetRow(nconsts);
457 
458  double chisq;
459  ok = ok && row->Col(chisqCol).Get(chisq);
460 
461  if(!ok) std::abort();
462 
464 
465  if(chisq <= 0 || chisq > 0.2){
466  fMapUncalibratedMask.insert(Key_t(geom->DetId(), chan));
467  }
468 
469  // Figure out which diblock, mark it calibrated
470  const int db = chan.Plane()/64+1;
471  fDiblocks.insert(db);
472  } // end for nconsts
473  }
474 
475  //......................................................................
477  {
478  if(geom->DetId() == novadaq::cnv::kNEARDET){
479  const int firstPlane = geom->FirstPlaneInMuonCatcher();
480  const int isMuonCatcher = (firstPlane <= plane);
481  return geom->Plane(plane)->View()+(2*isMuonCatcher);
482  }
483 
484  return geom->Plane(plane)->View();
485  }
486 
487  //......................................................................
490  int view,
491  bool& inMuonCatcher) const
492  {
493  // Unfortunately a bunch of different conventions competing here
494 
495  // View-merged MC, or average constants data
496  if(view == 0 || view == 1 || view == 1000 || view == 1001){
497  inMuonCatcher = false;
498  return geom->Plane(*geom->GetPlanesByView(geo::View_t(view)).begin());
499  }
500 
501  // View-merged MC, or some scheme I'm not sure is still in use, or
502  // averaged-constants MC
503  if(view == 2 || view == 3 || view == 10 || view == 11 ||
504  view == 1002 || view == 1003){
505 
506  if(geom->DetId() != novadaq::cnv::kNEARDET){
507  std::cerr << "Muon catcher constants in non-ND detector" << std::endl;
508  std::abort();
509  }
510 
511  inMuonCatcher = true;
512  view = view%2;
513 
514  const int mcp = geom->FirstPlaneInMuonCatcher();
515  const geo::PlaneGeo* geoplane = geom->Plane(mcp);
516  if(geoplane->View() != geo::View_t(view))
517  geoplane = geom->Plane(geom->NextPlaneOtherView(mcp, +1));
518 
519  return geoplane;
520  }
521 
522  std::cerr << "Bad encoded view " << view << std::endl;
523  std::abort();
524  }
525 
526  //......................................................................
529  const geo::GeometryBase* geom) const
530  {
531  const int db = chan.Plane()/64+1;
532  if(!fDiblocks.count(db)){
533  // No calibration for this diblock, use the averages instead.
534  // Stored at channel 1,000,000+1000*view+cell
535  const int view = GetView(chan.Plane(), geom);
536  return Key_t(geom->DetId(),
537  geo::OfflineChan(1000+int(view), chan.Cell()));
538  }
539 
540  return Key_t(geom->DetId(), chan);
541  }
542 
543  //......................................................................
546  const geo::GeometryBase* geom) const
547  {
548  // If it's a muon catcher plane, check to see if there is a special entry
549  // for it
550  if(geom->DetId() == novadaq::cnv::kNEARDET &&
551  chan.Plane() >= int(geom->FirstPlaneInMuonCatcher())){
552  const int viewInt = GetView(chan.Plane(), geom);
553  const Key_t ret(geom->DetId(), geo::OfflineChan(viewInt, chan.Cell()));
554  if(Get(ret)) return ret;
555  }
556  // If not, fall back to the non-muon-catcher constants
557 
558  // This is the way we encode the MC parameters. Plane represents the view.
559  // TODO, we should move to plane+1000 like the data?
560  return Key_t(geom->DetId(),
561  geo::OfflineChan(geom->Plane(chan.Plane())->View(),
562  chan.Cell()));
563  }
564 
565  //......................................................................
566  bool AttenCache::Key_t::operator<(const Key_t& rhs) const
567  {
568  if(fDet < rhs.fDet) return true;
569  if(fDet > rhs.fDet) return false;
570  return fChan < rhs.fChan;
571  }
572 
573  //......................................................................
575  {
576  fInitializedData = false;
577  fInitializedMC = false;
579 
580  // delete the pointers one by one from the data and MC maps
581  for(auto it : fMapData) delete it.second;
582  for(auto it : fMapMC ) delete it.second;
583 
584  fMapData.clear();
585  fMapMC.clear();
586  fMapUncalibratedMask.clear();
587  fDiblocks.clear();
588  }
589 
590 } // end namespace calib
591 ////////////////////////////////////////////////////////////////////////
void SetTag(std::string s)
Definition: Table.h:290
static std::string GetName(int id)
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
const geo::PlaneGeo * RepresentativePlane(const geo::GeometryBase *geom, int view, bool &inMuonCatcher) const
Definition: AttenCache.cxx:489
double HalfL() const
Definition: CellGeo.cxx:198
std::string GetCSVPath(novadaq::cnv::DetId det, bool points, bool forceData=false)
Definition: AttenCache.cxx:125
Key_t TranslateChannelMC(geo::OfflineChan chan, const geo::GeometryBase *geom) const
Deal with merged views, muon catcher, etc.
Definition: AttenCache.cxx:545
Column & Col(int i)
Find index of column with name. Suitable for passing to Col.
Definition: Row.h:63
bool doesDirectoryExist(std::string dirSting)
Return true if the path in dirString points to a directory.
Definition: CalibUtil.cxx:759
set< int >::iterator it
std::string fEpoch
Definition: AttenCache.h:110
Row *const GetRow(int i)
Definition: Table.cpp:492
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
static AttenCurve * Uninitialized(int det, geo::OfflineChan chan)
Return a new AttenCurve objects with fields uninitialized.
Definition: AttenCurve.cxx:25
const CellGeo * Cell(int icell) const
Definition: PlaneGeo.h:48
void Add(AttenCurve *res)
Definition: AttenCache.cxx:41
OStream cerr
Definition: OStream.cxx:7
bool operator<(const Key_t &rhs) const
Definition: AttenCache.cxx:566
float center_offset
Nonzero in short muon-catcher cells. Positive is closer to readout.
Definition: AttenCurve.h:51
const PlaneGeo * Plane(unsigned int i) const
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
bool Get(T &val) const
Definition: Column.h:85
std::set< Key_t > fMapUncalibratedMask
Definition: AttenCache.h:127
AttenCache(bool is_data, int brightness_bin)
Definition: AttenCache.cxx:22
std::string fTag
Definition: AttenCache.h:109
fclose(fg1)
int GetView(int plane, const geo::GeometryBase *geom) const
Get the view for the current combination of view and plane (x,y,mux, or muy)
Definition: AttenCache.cxx:476
bool fIsData
this is a cache for data calibrations or not
Definition: AttenCache.h:123
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:53
CDPStorage service.
std::string getCSVFilenameByParsingDirectory(int fCurrentRun, std::string prePattern, std::string postPattern)
Definition: CalibUtil.cxx:706
int GetColIndex(std::string cname)
Definition: Table.cpp:952
void SetDataTypeMask(int mask)
Definition: Table.h:74
bool fInitializedUncalibratedMask
Definition: AttenCache.h:118
std::set< int > fDiblocks
Diblocks with calibrations.
Definition: AttenCache.h:129
Encapsulate the geometry of one entire detector (near, far, ndos)
void SetMinTSVld(time_t t)
Definition: Table.h:284
std::string getenv(std::string const &name)
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Definition: GeometryBase.h:243
void GetEpochFromDB(int idet, bool forceData=false)
Definition: AttenCache.cxx:103
Geometry information for a single readout plane.
Definition: PlaneGeo.h:36
std::string fEpochTag
Definition: AttenCache.h:111
bool SetDetector(std::string det)
Definition: Table.cpp:839
Near Detector in the NuMI cavern.
Key_t TranslateChannelData(geo::OfflineChan chan, const geo::GeometryBase *geom) const
Deal with averaged constants etc.
Definition: AttenCache.cxx:528
std::map< Key_t, AttenCurve * > fMapMC
Definition: AttenCache.h:126
Definition: View.py:1
unsigned short Plane() const
Definition: OfflineChan.h:31
std::string fCSVSourceDir
Definition: AttenCache.h:105
geo::OfflineChan chan
Definition: AttenCurve.h:53
const AttenCurve * Get(Key_t key) const
NULL if entry isn&#39;t in the cache. Do not delete the returned pointer.
Definition: AttenCache.cxx:88
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
unsigned short Cell() const
Definition: OfflineChan.h:32
const char * getDetString(novadaq::cnv::DetId det)
Utility function to get detector name as a string for file manipulations.
Definition: CalibUtil.cxx:29
A (plane, cell) pair.
Definition: OfflineChan.h:17
void SetMaxTSVld(time_t t)
Definition: Table.h:285
const std::set< unsigned int > & GetPlanesByView(View_t v=kXorY) const
void geom(int which=0)
Definition: geom.C:163
unsigned long long Channel()
Definition: Row.h:68
assert(nhit_max >=nhit_nbins)
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Definition: Style.cxx:154
void LoadFromDatabaseUncalibratedMask(const geo::GeometryBase *geom)
Definition: AttenCache.cxx:401
#define LOG_VERBATIM(category)
The geometry of one entire detector (near, far, ipnd)
Definition: GeometryBase.h:49
std::string to_string(ModuleType mt)
Definition: ModuleType.h:32
void SetVerbosity(int i)
Definition: Table.h:98
Encapsulate the cell geometry.
Definition: CellGeo.h:25
void LoadFromDatabase(const geo::GeometryBase *geom)
Definition: AttenCache.cxx:199
int NRow()
Definition: Table.h:101
const AttenCurve * ForMC(const geo::GeometryBase *geom, geo::OfflineChan chan, bool maskUncalibratedChannels)
Definition: AttenCache.cxx:65
Float_t w
Definition: plot.C:20
geo::OfflineChan fChan
Definition: AttenCache.h:79
static OfflineChan FromDBValidityChan(int chan)
Definition: OfflineChan.cxx:13
#define LOG_ERROR(stream)
Definition: Messenger.h:129
virtual ~AttenCache()
Definition: AttenCache.cxx:34
std::map< Key_t, AttenCurve * > fMapData
Definition: AttenCache.h:125
const unsigned int NextPlaneOtherView(unsigned int p, int d=+1) const
const AttenCurve * ForData(const geo::GeometryBase *geom, geo::OfflineChan chan)
Definition: AttenCache.cxx:52
std::vector< Pt > interp_pts
Definition: AttenCurve.h:43
const unsigned int FirstPlaneInMuonCatcher() const
Returns the index of the first plane contained in the muon catcher.