Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
evd::RawDrawingOptions Class Reference

Global drawing options that apply to all displays. More...

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-30/EventDisplayServices/RawDrawingOptions.h"

Inheritance diagram for evd::RawDrawingOptions:
evdb::Reconfigurable

Public Member Functions

 RawDrawingOptions (fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
 
 ~RawDrawingOptions ()
 
void reconfigure (fhicl::ParameterSet const &pset) override
 
void do_reconfigure (fhicl::ParameterSet const &pset)
 

Public Attributes

int fColor
 
int fWhichHits
 
int fWhichQ
 
int fRawDrawingOpt
 
float fScaleFactor
 
std::vector< float > fTimeRange
 
float fTimeBinSize
 
int fTimeAutoZoomTruth
 
int fTHistogram
 
std::vector< std::stringfRawDigitsModules
 
std::vector< std::stringfRawDigitsInstances
 
std::vector< std::stringfCellHitsModules
 
std::vector< std::stringfCellHitsInstances
 
std::vector< float > fADCRange
 
float fADCBinSize
 
int fHit3DStyle
 

Static Public Attributes

static const int kCOLOR_BY_CHARGE = 0
 
static const int kCOLOR_BY_TIME = 1
 
static const int kRAW_HITS = 0
 
static const int kCAL_HITS = 1
 
static const int kPE = 0
 
static const int kPECOR = 1
 
static const int kMASK_BAD_CHANNELS = 1<<0
 
static const int kSCALE_HITS_BY_CHARGE = 1<<1
 
static const int kSUPPRESS_GHOSTED_HITS = 1<<2
 
static const int kSUPPRESS_DIMMED_HITS = 1<<3
 
static const int kHIT3D_BOXES = 1<<0
 
static const int kHIT3D_TOWERS = 1<<1
 
static const int kHIT3D_CROSSINGS = 1<<2
 

Protected Member Functions

void ParseModuleInstanceString (std::string &mod, std::string &inst) const
 Parse apart a "module_instance" string. Input the joined string as mod. If there is no underscore, mod is unaltered and inst is set to the empty string (""). If there is an underscore, mod is set to the part before the underscore, and inst to the part after. More...
 
void ModuleList (fhicl::ParameterSet const &pset, std::vector< std::string > &modules, std::vector< std::string > &instances, const char *object)
 

Detailed Description

Global drawing options that apply to all displays.

Definition at line 23 of file RawDrawingOptions.h.

Constructor & Destructor Documentation

evd::RawDrawingOptions::RawDrawingOptions ( fhicl::ParameterSet const &  pset,
art::ActivityRegistry reg 
)
explicit

Definition at line 12 of file RawDrawingOptions_service.cc.

References reconfigure().

14  : evdb::Reconfigurable{pset}
15  {
16  this->reconfigure(pset);
17  }
void reconfigure(fhicl::ParameterSet const &pset) override
evd::RawDrawingOptions::~RawDrawingOptions ( )

Definition at line 20 of file RawDrawingOptions_service.cc.

21  {
22  }

Member Function Documentation

void evdb::Reconfigurable::do_reconfigure ( fhicl::ParameterSet const &  pset)
inlineinherited

Definition at line 17 of file Reconfigurable.h.

17 { reconfigure(pset); }
virtual void reconfigure(fhicl::ParameterSet const &)=0
void evd::RawDrawingOptions::ModuleList ( fhicl::ParameterSet const &  pset,
std::vector< std::string > &  modules,
std::vector< std::string > &  instances,
const char *  object 
)
protected

Definition at line 31 of file RawDrawingOptions_service.cc.

References genie::units::A, a, b, fhicl::ParameterSet::get(), MECModelEnuComparisons::i, evd::is_empty(), ParseModuleInstanceString(), and string.

Referenced by reconfigure().

35  {
36  unsigned int i;
37 
38  std::string A(object);
39  std::string B(object);
40 
41  A += ".val";
42  B += "Add.val";
43 
44  std::vector<std::string> a=pset.get<std::vector<std::string> >(A.c_str());
45  std::vector<std::string> b=pset.get<std::vector<std::string> >(B.c_str());
46 
47  modules.clear();
48  modules.insert(modules.end(), a.begin(), a.end());
49  modules.insert(modules.end(), b.begin(), b.end());
50 
51  auto newEnd = std::remove_if(modules.begin(), modules.end(), is_empty);
52  modules.erase(newEnd, modules.end());
53 
54  instances.resize(modules.size());
55  for(i=0; i<modules.size(); ++i) {
56  ParseModuleInstanceString(modules[i], instances[i]);
57  }
58  }
void ParseModuleInstanceString(std::string &mod, std::string &inst) const
Parse apart a "module_instance" string. Input the joined string as mod. If there is no underscore...
static bool is_empty(const std::string &s)
const double a
static const double A
Definition: Units.h:82
const hit & b
Definition: hits.cxx:21
enum BeamMode string
void evd::RawDrawingOptions::ParseModuleInstanceString ( std::string mod,
std::string inst 
) const
protected

Parse apart a "module_instance" string. Input the joined string as mod. If there is no underscore, mod is unaltered and inst is set to the empty string (""). If there is an underscore, mod is set to the part before the underscore, and inst to the part after.

Definition at line 90 of file RawDrawingOptions_service.cc.

References DEFINE_ART_SERVICE.

Referenced by ModuleList().

92  {
93  const size_t splitPos = mod.find_first_of('_');
94  if(splitPos == std::string::npos){
95  inst = "";
96  return;
97  }
98  inst = mod.substr(splitPos+1);
99  mod.resize(splitPos);
100  }
void evd::RawDrawingOptions::reconfigure ( fhicl::ParameterSet const &  pset)
overridevirtual

Implements evdb::Reconfigurable.

Definition at line 61 of file RawDrawingOptions_service.cc.

References fADCBinSize, fADCRange, fCellHitsInstances, fCellHitsModules, fColor, fHit3DStyle, fRawDigitsInstances, fRawDigitsModules, fRawDrawingOpt, fScaleFactor, fTHistogram, fTimeAutoZoomTruth, fTimeBinSize, fTimeRange, fWhichHits, fWhichQ, fhicl::ParameterSet::get(), and ModuleList().

Referenced by RawDrawingOptions().

62  {
63  fColor = pset.get<int>("Color.val");
64  fWhichHits = pset.get<int>("WhichHits.val");
65  fWhichQ = pset.get<int>("WhichQ.val");
66  fRawDrawingOpt = pset.get<int>("RawDrawingOpt.val");
67  fScaleFactor = pset.get<float>("ScaleFactor.val");
68  fTimeRange = pset.get< std::vector<float> >("TimeRange.val");
69  fTimeBinSize = pset.get<float>("TimeBinSize.val");
70  fTimeAutoZoomTruth = pset.get<int>("TimeAutoZoomTruth.val");
71  fADCRange = pset.get< std::vector<float> >("ADCRange.val");
72  fADCBinSize = pset.get<float>("ADCBinSize.val");
73  fHit3DStyle = pset.get<int>("Hit3DStyle.val");
74  fTHistogram = pset.get<int>("THistogram.val");
75 
76  // Ensure sensical ranges and bin size.
77  if ( fTimeBinSize <= 0 ) fTimeBinSize = 0.01; //10 ns
78  if ( fTimeRange[0] >= (fTimeRange[1]-fTimeBinSize)) fTimeRange[1] = fTimeRange[0] + 10*fTimeBinSize;
79  if ( (fTimeRange[1]-fTimeRange[0]) < fTimeBinSize ) fTimeBinSize = fTimeRange[1]-fTimeRange[2];
80 
81  if ( fADCBinSize < 1) fADCBinSize = 1;
82  if ( fADCRange[0] >= (fADCRange[1]-fADCBinSize)) fADCRange[1] = fADCRange[0] + 10*fADCBinSize;
83  if ( (fADCRange[1]-fADCRange[0]) < fADCBinSize ) fADCBinSize = fADCRange[1]-fADCRange[2];
84 
85  this->ModuleList(pset, fRawDigitsModules, fRawDigitsInstances, "RawDigitsModules");
86  this->ModuleList(pset, fCellHitsModules, fCellHitsInstances, "CellHitsModules");
87  }
std::vector< float > fTimeRange
std::vector< std::string > fCellHitsModules
std::vector< std::string > fRawDigitsModules
std::vector< std::string > fRawDigitsInstances
void ModuleList(fhicl::ParameterSet const &pset, std::vector< std::string > &modules, std::vector< std::string > &instances, const char *object)
std::vector< float > fADCRange
std::vector< std::string > fCellHitsInstances

Member Data Documentation

float evd::RawDrawingOptions::fADCBinSize

Definition at line 65 of file RawDrawingOptions.h.

Referenced by evd::TQPad::BookHistogram(), and reconfigure().

std::vector<float> evd::RawDrawingOptions::fADCRange

Definition at line 64 of file RawDrawingOptions.h.

Referenced by evd::TQPad::BookHistogram(), and reconfigure().

std::vector<std::string> evd::RawDrawingOptions::fCellHitsInstances

Definition at line 62 of file RawDrawingOptions.h.

Referenced by evd::RawDataDrawer::GetRawDigitsAllLabels(), and reconfigure().

std::vector<std::string> evd::RawDrawingOptions::fCellHitsModules

Definition at line 61 of file RawDrawingOptions.h.

Referenced by evd::RawDataDrawer::GetRawDigitsAllLabels(), and reconfigure().

int evd::RawDrawingOptions::fColor
int evd::RawDrawingOptions::fHit3DStyle

Definition at line 67 of file RawDrawingOptions.h.

Referenced by reconfigure().

std::vector<std::string> evd::RawDrawingOptions::fRawDigitsInstances

Definition at line 60 of file RawDrawingOptions.h.

Referenced by evd::RawDataDrawer::GetRawDigitsAllLabels(), and reconfigure().

std::vector<std::string> evd::RawDrawingOptions::fRawDigitsModules

Definition at line 59 of file RawDrawingOptions.h.

Referenced by evd::RawDataDrawer::GetRawDigitsAllLabels(), and reconfigure().

int evd::RawDrawingOptions::fRawDrawingOpt
float evd::RawDrawingOptions::fScaleFactor
int evd::RawDrawingOptions::fTHistogram

Definition at line 56 of file RawDrawingOptions.h.

Referenced by evd::TQPad::Draw(), and reconfigure().

int evd::RawDrawingOptions::fTimeAutoZoomTruth

Definition at line 54 of file RawDrawingOptions.h.

Referenced by evd::TQPad::Draw(), and reconfigure().

float evd::RawDrawingOptions::fTimeBinSize

Definition at line 53 of file RawDrawingOptions.h.

Referenced by evd::TQPad::BookHistogram(), and reconfigure().

std::vector<float> evd::RawDrawingOptions::fTimeRange
int evd::RawDrawingOptions::fWhichHits
int evd::RawDrawingOptions::fWhichQ

Definition at line 41 of file RawDrawingOptions.h.

Referenced by reconfigure().

const int evd::RawDrawingOptions::kCAL_HITS = 1
static
const int evd::RawDrawingOptions::kCOLOR_BY_CHARGE = 0
static
const int evd::RawDrawingOptions::kCOLOR_BY_TIME = 1
static
const int evd::RawDrawingOptions::kHIT3D_BOXES = 1<<0
static

Definition at line 68 of file RawDrawingOptions.h.

const int evd::RawDrawingOptions::kHIT3D_CROSSINGS = 1<<2
static

Definition at line 70 of file RawDrawingOptions.h.

const int evd::RawDrawingOptions::kHIT3D_TOWERS = 1<<1
static

Definition at line 69 of file RawDrawingOptions.h.

const int evd::RawDrawingOptions::kMASK_BAD_CHANNELS = 1<<0
static
const int evd::RawDrawingOptions::kPE = 0
static

Definition at line 42 of file RawDrawingOptions.h.

const int evd::RawDrawingOptions::kPECOR = 1
static

Definition at line 43 of file RawDrawingOptions.h.

const int evd::RawDrawingOptions::kRAW_HITS = 0
static
const int evd::RawDrawingOptions::kSCALE_HITS_BY_CHARGE = 1<<1
static
const int evd::RawDrawingOptions::kSUPPRESS_DIMMED_HITS = 1<<3
static

Definition at line 49 of file RawDrawingOptions.h.

Referenced by evd::RawDataDrawer::HitColor().

const int evd::RawDrawingOptions::kSUPPRESS_GHOSTED_HITS = 1<<2
static

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