LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Aid in the rendering of RawData objects. More...
#include "RawDataDrawer.h"
Classes | |
class | BoxDrawer |
struct | BoxInfo_t |
class | ManyOperations |
class | OperationBaseClass |
struct | PadResolution_t |
Stores the information about the drawing area. More... | |
class | RoIextractorClass |
Public Member Functions | |
RawDataDrawer () | |
~RawDataDrawer () | |
void | RawDigit2D (art::Event const &evt, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane, bool bZoomToRoI=false) |
Draws raw digit content in 2D wire plane representation. More... | |
void | FillQHisto (const art::Event &evt, unsigned int plane, TH1F *histo) |
void | FillTQHisto (const art::Event &evt, unsigned int plane, unsigned int wire, TH1F *histo) |
double | StartTick () const |
double | TotalClockTicks () const |
void | ExtractRange (TVirtualPad *pPad, std::vector< double > const *zoom=nullptr) |
Fills the viewport information from the specified pad. More... | |
void | SetDrawingLimits (float low_wire, float high_wire, float low_tdc, float high_tdc) |
Fills the viewport borders from the specified extremes. More... | |
int | GetRegionOfInterest (int plane, int &minw, int &maxw, int &mint, int &maxt) |
void | ResetRegionOfInterest () |
Forgets about the current region of interest. More... | |
bool | hasRegionOfInterest (geo::PlaneID::PlaneID_t plane) const |
void | GetChargeSum (int plane, double &charge, double &convcharge) |
Private Member Functions | |
void | Reset (art::Event const &event) |
Prepares for a new event (if somebody tells it to) More... | |
void | GetRawDigits (art::Event const &evt) |
Reads raw::RawDigits; also triggers Reset() More... | |
bool | ProcessChannelWithStatus (lariov::ChannelStatusProvider::Status_t channel_status) const |
Returns whether a channel with the specified status should be processed. More... | |
void | DrawRawDigit2D (art::Event const &evt, evdb::View2D *view, unsigned int plane) |
Performs the 2D wire plane drawing. More... | |
void | GetRawDigits (art::Event const &evt, details::CacheID_t const &new_timestamp) |
Makes sure raw::RawDigit's are available for the current settings. More... | |
bool | RunOperation (art::Event const &evt, OperationBaseClass *operation) |
void | QueueDrawingBoxes (evdb::View2D *view, geo::PlaneID const &pid, std::vector< BoxInfo_t > const &BoxInfo) |
void | RunDrawOperation (art::Event const &evt, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane) |
void | RunRoIextractor (art::Event const &evt, unsigned int plane) |
void | SetDrawingLimitsFromRoI (geo::PlaneID::PlaneID_t plane) |
void | SetDrawingLimitsFromRoI (geo::PlaneID const pid) |
Private Attributes | |
evd::details::RawDigitCacheDataClass * | digit_cache |
Cache of raw digits. More... | |
double | fStartTick |
low tick More... | |
double | fTicks |
number of ticks of the clock More... | |
std::vector< int > | fWireMin |
lowest wire in interesting region for each plane More... | |
std::vector< int > | fWireMax |
highest wire in interesting region for each plane More... | |
std::vector< int > | fTimeMin |
lowest time in interesting region for each plane More... | |
std::vector< int > | fTimeMax |
highest time in interesting region for each plane More... | |
std::vector< double > | fRawCharge |
Sum of Raw Charge. More... | |
std::vector< double > | fConvertedCharge |
Sum of Charge Converted using Birks' formula. More... | |
PadResolution_t | PadResolution |
stored pad resolution More... | |
details::CacheID_t * | fCacheID |
information about the last processed plane More... | |
details::CellGridClass * | fDrawingRange |
information about the viewport More... | |
Static Private Attributes | |
static std::vector< raw::RawDigit > const | EmptyRawDigits |
Empty collection, used in return value of invalid digits. More... | |
Friends | |
class | BoxDrawer |
class | RoIextractorClass |
Aid in the rendering of RawData objects.
Definition at line 47 of file RawDataDrawer.h.
evd::RawDataDrawer::RawDataDrawer | ( | ) |
Definition at line 531 of file RawDataDrawer.cxx.
References fConvertedCharge, evd::RawDrawingOptions::fCryostat, fRawCharge, evd::RawDrawingOptions::fStartTick, fStartTick, evd::RawDrawingOptions::fTicks, fTicks, fTimeMax, fTimeMin, evd::RawDrawingOptions::fTPC, fWireMax, fWireMin, and geo::GeometryCore::Nplanes().
evd::RawDataDrawer::~RawDataDrawer | ( | ) |
Definition at line 557 of file RawDataDrawer.cxx.
References digit_cache, fCacheID, and fDrawingRange.
|
private |
Performs the 2D wire plane drawing.
void evd::RawDataDrawer::ExtractRange | ( | TVirtualPad * | pPad, |
std::vector< double > const * | zoom = nullptr |
||
) |
Fills the viewport information from the specified pad.
Definition at line 598 of file RawDataDrawer.cxx.
References fDrawingRange, evd::RawDataDrawer::PadResolution_t::height, PadResolution, evd::details::CellGridClass::SetTDCRange(), evd::details::CellGridClass::SetWireRange(), and evd::RawDataDrawer::PadResolution_t::width.
Referenced by evd::TWireProjPad::Draw().
void evd::RawDataDrawer::FillQHisto | ( | const art::Event & | evt, |
unsigned int | plane, | ||
TH1F * | histo | ||
) |
Definition at line 1264 of file RawDataDrawer.cxx.
References raw::RawDigit::Channel(), geo::GeometryCore::ChannelToWire(), evd::RawDrawingOptions::CurrentTPC(), d, digit_cache, evd::RawDrawingOptions::fDrawRawDataOrCalibWires, evd::RawDrawingOptions::fPedestalOption, evd::RawDrawingOptions::fRawDataLabels, evd::RawDrawingOptions::fSeeBadChannels, raw::RawDigit::GetPedestal(), GetRawDigits(), and ProcessChannelWithStatus().
void evd::RawDataDrawer::FillTQHisto | ( | const art::Event & | evt, |
unsigned int | plane, | ||
unsigned int | wire, | ||
TH1F * | histo | ||
) |
Definition at line 1333 of file RawDataDrawer.cxx.
References evd::RawDrawingOptions::CurrentTPC(), evd::details::RawDigitInfo_t::Data(), digit_cache, evd::details::RawDigitInfo_t::DigitPtr(), evd::details::RawDigitCacheDataClass::empty(), evd::RawDrawingOptions::fDrawRawDataOrCalibWires, evd::details::RawDigitCacheDataClass::FindChannel(), evd::RawDrawingOptions::fPedestalOption, evd::RawDrawingOptions::fRawDataLabels, evd::RawDrawingOptions::fSeeBadChannels, raw::RawDigit::GetPedestal(), GetRawDigits(), raw::isValidChannelID(), geo::GeometryCore::PlaneWireToChannel(), and ProcessChannelWithStatus().
void evd::RawDataDrawer::GetChargeSum | ( | int | plane, |
double & | charge, | ||
double & | convcharge | ||
) |
Definition at line 1257 of file RawDataDrawer.cxx.
References fConvertedCharge, and fRawCharge.
|
private |
Reads raw::RawDigits; also triggers Reset()
Referenced by FillQHisto(), FillTQHisto(), and RawDigit2D().
|
private |
Makes sure raw::RawDigit's are available for the current settings.
evt | event to read the digits from |
ts | a cache ID assessing the new state the cache should move to |
The function will ask the data cache for an update (RawDigitCacheDataClass::Update()). The cache will evaluate whether it is already in a state compatible with ts or if cache needs to be invalidated, in which case it will fill with new data. This method also triggers a Reset() if the target state differs from the old one.
Definition at line 1529 of file RawDataDrawer.cxx.
References digit_cache, fCacheID, MF_LOG_DEBUG, ResetRegionOfInterest(), and evd::details::RawDigitCacheDataClass::Update().
int evd::RawDataDrawer::GetRegionOfInterest | ( | int | plane, |
int & | minw, | ||
int & | maxw, | ||
int & | mint, | ||
int & | maxt | ||
) |
Definition at line 1228 of file RawDataDrawer.cxx.
References fTimeMax, fTimeMin, fWireMax, fWireMin, geo::GeometryCore::Nwires(), and TotalClockTicks().
Referenced by evd::TWireProjPad::ShowFull().
bool evd::RawDataDrawer::hasRegionOfInterest | ( | geo::PlaneID::PlaneID_t | plane | ) | const |
Returns whether there is currently a valid region of interest for the specified plane
Definition at line 1506 of file RawDataDrawer.cxx.
References fTimeMax, and fWireMax.
Referenced by RawDigit2D(), and RunRoIextractor().
|
private |
Returns whether a channel with the specified status should be processed.
Definition at line 1548 of file RawDataDrawer.cxx.
References evd::RawDrawingOptions::fMaxChannelStatus.
Referenced by FillQHisto(), FillTQHisto(), and RunOperation().
|
private |
Definition at line 946 of file RawDataDrawer.cxx.
References util::abs(), evd::RawDataDrawer::BoxInfo_t::adc, evdb::View2D::AddBox(), color(), evd::RawDrawingOptions::fAxisOrientation, fDrawingRange, evd::RawDrawingOptions::fMinSignal, evd::RawDrawingOptions::fScaleDigitsByCharge, evd::details::CellGridClass::GetCellBox(), evdb::ColorScale::GetColor(), evd::RawDataDrawer::BoxInfo_t::good, MF_LOG_DEBUG, evd::ColorDrawingOptions::RawQ(), and geo::GeometryCore::SignalType().
void evd::RawDataDrawer::RawDigit2D | ( | art::Event const & | evt, |
detinfo::DetectorPropertiesData const & | detProp, | ||
evdb::View2D * | view, | ||
unsigned int | plane, | ||
bool | bZoomToRoI = false |
||
) |
Draws raw digit content in 2D wire plane representation.
evt | source for raw digits |
view | target rendered object |
plane | number of the plane to be drawn |
bZoomToRoI | whether to render only te region of interest |
This function performs pre-rendering of the raw digit content into a 2D view of the wire plane as TDC vs. wire number. The material for rendering is created and sent to view object for actual rendering. The pre-rendering result currently depends on information from the current rendering canvas, and in particular on its viewport in the (wire, TDC) space.
If no zoom to the region of interest is required, the region itself is computed (only if not known yet) while the rendering is performed. If the zoom is required instead, rendering is performed in two steps; in the first, run only of no region of interest is known yet, the region is extracted. In the second, that information is used for rendering.
Definition at line 1115 of file RawDataDrawer.cxx.
References evd::RawDataDrawer::ManyOperations::AddOperation(), BoxDrawer, geo::GeometryCore::ChannelToWire(), evd::RawDrawingOptions::CurrentTPC(), digit_cache, evd::details::RawDigitCacheDataClass::Digits(), evd::RawDrawingOptions::fDrawRawDataOrCalibWires, evd::RawDrawingOptions::fRawDataLabels, fTimeMax, fTimeMin, fWireMax, fWireMin, GetRawDigits(), hasRegionOfInterest(), MF_LOG_DEBUG, RoIextractorClass, RunOperation(), SetDrawingLimitsFromRoI(), and art::errors::Unknown.
Referenced by evd::TWireProjPad::Draw().
|
private |
Prepares for a new event (if somebody tells it to)
void evd::RawDataDrawer::ResetRegionOfInterest | ( | ) |
Forgets about the current region of interest.
Definition at line 1514 of file RawDataDrawer.cxx.
References trkf::fill(), fTimeMax, fTimeMin, fWireMax, fWireMin, and MF_LOG_DEBUG.
Referenced by GetRawDigits().
|
private |
Definition at line 1024 of file RawDataDrawer.cxx.
References evd::RawDrawingOptions::CurrentTPC(), evd::RawDrawingOptions::fDrawRawDataOrCalibWires, RunOperation(), and art::errors::Unknown.
|
private |
Definition at line 760 of file RawDataDrawer.cxx.
References raw::RawDigit::Channel(), geo::GeometryCore::ChannelToWire(), digit_cache, evd::details::RawDigitCacheDataClass::empty(), evd::RawDataDrawer::OperationBaseClass::Finish(), evd::RawDrawingOptions::fPedestalOption, evd::RawDrawingOptions::fSeeBadChannels, fStartTick, fTicks, raw::RawDigit::GetPedestal(), evd::RawDataDrawer::OperationBaseClass::Initialize(), MF_LOG_DEBUG, evd::RawDataDrawer::OperationBaseClass::Name(), evd::RawDataDrawer::OperationBaseClass::Operate(), evd::RawDataDrawer::OperationBaseClass::PlaneID(), ProcessChannelWithStatus(), evd::RawDataDrawer::OperationBaseClass::ProcessTick(), and evd::RawDataDrawer::OperationBaseClass::ProcessWire().
Referenced by RawDigit2D(), RunDrawOperation(), and RunRoIextractor().
|
private |
Definition at line 1092 of file RawDataDrawer.cxx.
References evd::RawDrawingOptions::CurrentTPC(), hasRegionOfInterest(), MF_LOG_TRACE, and RunOperation().
void evd::RawDataDrawer::SetDrawingLimits | ( | float | low_wire, |
float | high_wire, | ||
float | low_tdc, | ||
float | high_tdc | ||
) |
Fills the viewport borders from the specified extremes.
Definition at line 565 of file RawDataDrawer.cxx.
References fDrawingRange, evd::RawDataDrawer::PadResolution_t::height, MF_LOG_DEBUG, PadResolution, evd::details::CellGridClass::SetMinTDCCellSize(), evd::details::CellGridClass::SetMinWireCellSize(), evd::details::CellGridClass::SetTDCRange(), evd::details::CellGridClass::SetWireRange(), and evd::RawDataDrawer::PadResolution_t::width.
Referenced by SetDrawingLimitsFromRoI().
|
private |
Definition at line 593 of file RawDataDrawer.cxx.
References fTimeMax, fTimeMin, fWireMax, fWireMin, and SetDrawingLimits().
Referenced by RawDigit2D().
|
inlineprivate |
Definition at line 199 of file RawDataDrawer.h.
References geo::PlaneID::Plane, and SetDrawingLimitsFromRoI().
Referenced by SetDrawingLimitsFromRoI().
|
inline |
Definition at line 83 of file RawDataDrawer.h.
Referenced by evd::TQPad::BookHistogram(), and evd::TWireProjPad::TWireProjPad().
|
inline |
Definition at line 84 of file RawDataDrawer.h.
Referenced by evd::TQPad::BookHistogram(), GetRegionOfInterest(), and evd::TWireProjPad::TWireProjPad().
|
friend |
Definition at line 125 of file RawDataDrawer.h.
Referenced by RawDigit2D().
|
friend |
Definition at line 135 of file RawDataDrawer.h.
Referenced by RawDigit2D().
|
private |
Cache of raw digits.
Definition at line 139 of file RawDataDrawer.h.
Referenced by FillQHisto(), FillTQHisto(), GetRawDigits(), RawDigit2D(), RunOperation(), and ~RawDataDrawer().
|
staticprivate |
Empty collection, used in return value of invalid digits.
Definition at line 202 of file RawDataDrawer.h.
|
private |
information about the last processed plane
Definition at line 165 of file RawDataDrawer.h.
Referenced by GetRawDigits(), and ~RawDataDrawer().
|
private |
Sum of Charge Converted using Birks' formula.
Definition at line 161 of file RawDataDrawer.h.
Referenced by GetChargeSum(), and RawDataDrawer().
|
private |
information about the viewport
Definition at line 168 of file RawDataDrawer.h.
Referenced by ExtractRange(), QueueDrawingBoxes(), SetDrawingLimits(), and ~RawDataDrawer().
|
private |
Sum of Raw Charge.
Definition at line 160 of file RawDataDrawer.h.
Referenced by GetChargeSum(), and RawDataDrawer().
|
private |
low tick
Definition at line 152 of file RawDataDrawer.h.
Referenced by RawDataDrawer(), and RunOperation().
|
private |
number of ticks of the clock
Definition at line 153 of file RawDataDrawer.h.
Referenced by RawDataDrawer(), and RunOperation().
|
private |
highest time in interesting region for each plane
Definition at line 158 of file RawDataDrawer.h.
Referenced by GetRegionOfInterest(), hasRegionOfInterest(), RawDataDrawer(), RawDigit2D(), ResetRegionOfInterest(), and SetDrawingLimitsFromRoI().
|
private |
lowest time in interesting region for each plane
Definition at line 157 of file RawDataDrawer.h.
Referenced by GetRegionOfInterest(), RawDataDrawer(), RawDigit2D(), ResetRegionOfInterest(), and SetDrawingLimitsFromRoI().
|
private |
highest wire in interesting region for each plane
Definition at line 156 of file RawDataDrawer.h.
Referenced by GetRegionOfInterest(), hasRegionOfInterest(), RawDataDrawer(), RawDigit2D(), ResetRegionOfInterest(), and SetDrawingLimitsFromRoI().
|
private |
lowest wire in interesting region for each plane
Definition at line 155 of file RawDataDrawer.h.
Referenced by GetRegionOfInterest(), RawDataDrawer(), RawDigit2D(), ResetRegionOfInterest(), and SetDrawingLimitsFromRoI().
|
private |
stored pad resolution
Definition at line 163 of file RawDataDrawer.h.
Referenced by ExtractRange(), and SetDrawingLimits().