19 std::cerr <<
"FATAL: PhotonLibraryHybrid: " << msg <<
std::endl;
31 TFile
f(fname.c_str());
32 !
f.IsZombie() ||
fatal(
"Could not open PhotonLibrary "+fname);
34 for(
int opdetIdx = 0;
true; ++opdetIdx){
36 TDirectory*
dir = (TDirectory*)
f.Get(dirname.c_str());
41 TVectorD* fit = (TVectorD*)dir->Get(
"fit");
42 fit ||
fatal(
"Didn't find "+dirname+
"/fit in "+fname);
45 TTree* tr = (TTree*)dir->Get(
"tr");
46 tr ||
fatal(
"Didn't find "+dirname+
"/tr in "+fname);
49 tr->SetBranchAddress(
"vox", &vox);
50 tr->SetBranchAddress(
"vis", &vis);
53 for(
int i = 0; i < tr->GetEntries(); ++i){
66 !
fRecords.empty() ||
fatal(
"No opdet_*/ directories in "+fname);
105 auto it2 = std::lower_bound(rec.
exceptions.begin(),
108 if(it2->vox == vox)
return it2->vis;
Definitions of voxel data structures.
OpDetGeo const & OpDetGeoFromOpDet(unsigned int OpDet) const
Returns the geo::OpDetGeo object for the given detector number.
virtual const float * GetCounts(size_t Voxel) const override
Returns a pointer to NOpChannels() visibility values, one per channel.
void msg(const char *fmt,...)
Representation of a region of space diced into voxels.
double Eval(double x) const
PhotonLibraryHybrid(const std::string &fname, const sim::PhotonVoxelDef &voxdef)
art framework interface to geometry description
virtual ~PhotonLibraryHybrid()
virtual int NVoxels() const override
counts_as<> counts
Number of ADC counts, represented by signed short int.
std::vector< Exception > exceptions
void fatal(const char *msg,...)
const sim::PhotonVoxelDef & fVoxDef
virtual int NOpChannels() const override
unsigned int NOpDets() const
Number of OpDets in the whole detector.
double DistanceToPoint(geo::Point_t const &point) const
Returns the distance of the specified point from detector center [cm].
General LArSoft Utilities.
virtual float GetCount(size_t Voxel, size_t OpChannel) const override
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
Point GetCenter() const
Returns the center of the voxel (type Point).
unsigned int GetNVoxels() const
Returns the total number of voxels in the volume.
std::vector< OpDetRecord > fRecords
QTextStream & endl(QTextStream &s)
PhotonVoxel GetPhotonVoxel(int ID) const