LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
evd::RawDataDrawer Class Reference

Aid in the rendering of RawData objects. More...

#include "RawDataDrawer.h"

Classes

class  BoxDrawer
 
struct  BoxInfo_t
 
class  ManyOperations
 
class  OperationBaseClass
 
struct  PadResolution_t
 
class  RoIextractorClass
 

Public Member Functions

 RawDataDrawer ()
 
 ~RawDataDrawer ()
 
void RawDigit2D (art::Event const &evt, 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, 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::RawDigitCacheDataClassdigit_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_tfCacheID
 information about the last processed plane More...
 
details::CellGridClassfDrawingRange
 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
 

Detailed Description

Aid in the rendering of RawData objects.

Definition at line 40 of file RawDataDrawer.h.

Constructor & Destructor Documentation

evd::RawDataDrawer::RawDataDrawer ( )

Definition at line 568 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().

569  : digit_cache(new details::RawDigitCacheDataClass)
570  , fStartTick(0),fTicks(2048)
572  , fDrawingRange(new details::CellGridClass)
573  {
575 
577  geo::TPCID tpcid(rawopt->fCryostat, rawopt->fTPC);
578 
579  fStartTick = rawopt->fStartTick;
580  fTicks = rawopt->fTicks;
581 
582  // set the list of bad channels in this detector
583  unsigned int nplanes=geo->Nplanes(tpcid);
584  fWireMin.resize(nplanes,-1);
585  fWireMax.resize(nplanes,-1);
586  fTimeMin.resize(nplanes,-1);
587  fTimeMax.resize(nplanes,-1);
588  fRawCharge.resize(nplanes,0);
589  fConvertedCharge.resize(nplanes,0);
590  }
unsigned int fTPC
TPC number to draw, typically set by TWQProjectionView.
double fStartTick
low tick
details::CacheID_t * fCacheID
information about the last processed plane
std::vector< double > fRawCharge
Sum of Raw Charge.
std::vector< int > fWireMin
lowest wire in interesting region for each plane
std::vector< int > fTimeMax
highest time in interesting region for each plane
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
double fTicks
number of ticks of the clock
unsigned int fCryostat
Cryostat number to draw, typically set by TWQProjectionView.
std::vector< int > fWireMax
highest wire in interesting region for each plane
double fTicks
number of TDC ticks to display, ie # fTicks past fStartTick
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
double fStartTick
Starting tick for the display.
details::CellGridClass * fDrawingRange
information about the viewport
std::vector< int > fTimeMin
lowest time in interesting region for each plane
::util::PlaneDataChangeTracker_t CacheID_t
Definition: RawDataDrawer.h:35
evd::details::RawDigitCacheDataClass * digit_cache
Cache of raw digits.
Namespace collecting geometry-related classes utilities.
std::vector< double > fConvertedCharge
Sum of Charge Converted using Birks&#39; formula.
evd::RawDataDrawer::~RawDataDrawer ( )

Definition at line 593 of file RawDataDrawer.cxx.

References digit_cache, fCacheID, fDrawingRange, and SetDrawingLimits().

594  {
595  delete digit_cache;
596  delete fDrawingRange;
597  delete fCacheID;
598  }
details::CacheID_t * fCacheID
information about the last processed plane
details::CellGridClass * fDrawingRange
information about the viewport
evd::details::RawDigitCacheDataClass * digit_cache
Cache of raw digits.

Member Function Documentation

void evd::RawDataDrawer::DrawRawDigit2D ( art::Event const &  evt,
evdb::View2D view,
unsigned int  plane 
)
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 640 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 SetDrawingLimitsFromRoI().

641  {
642  mf::LogDebug log("RawDataDrawer");
643  log << "ExtractRange() on pad '" << pPad->GetName() << "'";
644 
645  TFrame const* pFrame = pPad->GetFrame();
646  if (pFrame) {
647  // these coordinates are used to find the actual extent of pad in pixels
648  double low_wire = pFrame->GetX1(), high_wire = pFrame->GetX2();
649  double low_tdc = pFrame->GetY1(), high_tdc = pFrame->GetY2();
650  double const wire_pixels = pPad->XtoAbsPixel(high_wire) - pPad->XtoAbsPixel(low_wire);
651  double const tdc_pixels = -(pPad->YtoAbsPixel(high_tdc) - pPad->YtoAbsPixel(low_tdc));
652 
653  PadResolution.width = (unsigned int) wire_pixels;
654  PadResolution.height = (unsigned int) tdc_pixels;
655 
656  log << "\n frame window is "
658  << " pixel big and";
659  // those coordinates also are a (unreliable) estimation of the zoom;
660  // if we have a better one, let's use it
661  // (this does not change the size of the window in terms of pixels)
662  if (zoom) {
663  log << ", from external source,";
664  low_wire = (*zoom)[0];
665  high_wire = (*zoom)[1];
666  low_tdc = (*zoom)[2];
667  high_tdc = (*zoom)[3];
668  }
669 
670  log << " spans wires "
671  << low_wire << "-" << high_wire << " and TDC " << low_tdc << "-" << high_tdc;
672 
673  // TODO support swapping axes here:
674  // if (rawopt.fAxisOrientation < 1) { normal ; } else { swapped; }
675 
676  fDrawingRange->SetWireRange(low_wire, high_wire, (unsigned int) wire_pixels, 1.0);
677  fDrawingRange->SetTDCRange(low_tdc, high_tdc, (unsigned int) tdc_pixels, 1.0);
678  }
679  else {
680  // keep the old frame (if any)
681  log << "\n no frame!";
682  }
683 
684  } // RawDataDrawer::ExtractRange()
void SetWireRange(unsigned int nWires)
Sets the wire range, leaving the number of wire cells unchanged.
PadResolution_t PadResolution
stored pad resolution
details::CellGridClass * fDrawingRange
information about the viewport
void SetTDCRange(unsigned int nTDC)
Sets a simple TDC range: all the ticks, one cell per tick.
void evd::RawDataDrawer::FillQHisto ( const art::Event evt,
unsigned int  plane,
TH1F *  histo 
)

Definition at line 1307 of file RawDataDrawer.cxx.

References raw::RawDigit::Channel(), geo::GeometryCore::ChannelToWire(), evd::RawDrawingOptions::CurrentTPC(), d, digit_cache, evd::RawDrawingOptions::fDrawRawDataOrCalibWires, evd::RawDrawingOptions::fRawDataLabel, evd::RawDrawingOptions::fSeeBadChannels, GetRawDigits(), and ProcessChannelWithStatus().

1310  {
1311 
1312  // Check if we're supposed to draw raw hits at all
1314  if (rawopt->fDrawRawDataOrCalibWires==1) return;
1315 
1317 
1318  geo::PlaneID const pid(rawopt->CurrentTPC(), plane);
1319  details::CacheID_t NewCacheID(evt, rawopt->fRawDataLabel, pid);
1320  GetRawDigits(evt, NewCacheID);
1321 
1322  lariov::ChannelStatusProvider const& channelStatus
1324 
1325  //get pedestal conditions
1326  const lariov::DetPedestalProvider& pedestalRetrievalAlg = art::ServiceHandle<lariov::DetPedestalService>()->GetPedestalProvider();
1327 
1328  for (evd::details::RawDigitInfo_t const& digit_info: *digit_cache) {
1329  raw::RawDigit const& hit = digit_info.Digit();
1330  raw::ChannelID_t const channel = hit.Channel();
1331 
1332  if (!channelStatus.IsPresent(channel)) continue;
1333 
1334  // The following test is meant to be temporary until the "correct" solution is implemented
1335  if (!ProcessChannelWithStatus(channelStatus.Status(channel))) continue;
1336 
1337  // to be explicit: we don't cound bad channels in
1338  if (!rawopt->fSeeBadChannels && channelStatus.IsBad(channel)) continue;
1339 
1340  std::vector<geo::WireID> wireids = geo->ChannelToWire(channel);
1341  for(auto const& wid : wireids){
1342  // check that the plane and tpc are the correct ones to draw
1343  if (wid.planeID() != pid) continue;
1344 
1345  raw::RawDigit::ADCvector_t const& uncompressed = digit_info.Data();
1346 
1347  float const pedestal = pedestalRetrievalAlg.PedMean(channel);
1348 
1349  for(short d: uncompressed)
1350  histo->Fill(float(d) - pedestal); //pedestals[plane]); //hit.GetPedestal());
1351 
1352  // this channel is on the correct plane, don't double count the raw signal
1353  // if there are more than one wids for the channel
1354  break;
1355  }// end loop over wids
1356  }//end loop over raw hits
1357 
1358  }
Collection of charge vs time digitized from a single readout channel.
Definition: RawDigit.h:68
int fDrawRawDataOrCalibWires
0 for raw
art::InputTag fRawDataLabel
module label that made the raw digits, default is daq
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
ChannelID_t Channel() const
DAQ channel this raw data was read from.
Definition: RawDigit.h:211
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
Definition: RawDigit.h:72
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
bool ProcessChannelWithStatus(lariov::ChannelStatusProvider::Status_t channel_status) const
Returns whether a channel with the specified status should be processed.
Information about a RawDigit; may contain uncompressed duplicate of data.
Float_t d
Definition: plot.C:237
void GetRawDigits(art::Event const &evt)
Reads raw::RawDigits; also triggers Reset()
geo::TPCID CurrentTPC() const
Returns the current TPC as a TPCID.
Detector simulation of raw signals on wires.
bool fSeeBadChannels
Allow "bad" channels to be viewed.
::util::PlaneDataChangeTracker_t CacheID_t
Definition: RawDataDrawer.h:35
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:27
evd::details::RawDigitCacheDataClass * digit_cache
Cache of raw digits.
Namespace collecting geometry-related classes utilities.
void evd::RawDataDrawer::FillTQHisto ( const art::Event evt,
unsigned int  plane,
unsigned int  wire,
TH1F *  histo 
)

Definition at line 1361 of file RawDataDrawer.cxx.

References evd::RawDrawingOptions::CurrentTPC(), evd::details::RawDigitInfo_t::Data(), digit_cache, evd::details::RawDigitCacheDataClass::empty(), evd::RawDrawingOptions::fDrawRawDataOrCalibWires, evd::details::RawDigitCacheDataClass::FindChannel(), evd::RawDrawingOptions::fRawDataLabel, evd::RawDrawingOptions::fSeeBadChannels, GetRawDigits(), raw::isValidChannelID(), geo::GeometryCore::PlaneWireToChannel(), and ProcessChannelWithStatus().

Referenced by evd::TQPad::Draw().

1365  {
1366 
1367  // Check if we're supposed to draw raw hits at all
1369  if (rawopt->fDrawRawDataOrCalibWires==1) return;
1370 
1371  // make sure we have the raw digits cached
1372  geo::PlaneID const pid(rawopt->CurrentTPC(), plane);
1373  details::CacheID_t NewCacheID(evt, rawopt->fRawDataLabel, pid);
1374  GetRawDigits(evt, NewCacheID);
1375 
1376  if (digit_cache->empty()) return;
1377 
1378  geo::WireID const wireid(pid, wire);
1379 
1380  // find the channel
1382  raw::ChannelID_t const channel = geom->PlaneWireToChannel(wireid);
1383  if (!raw::isValidChannelID(channel)) { // no channel, empty histogram
1384  mf::LogError("RawDataDrawer") << __func__ << ": no channel associated to "
1385  << std::string(wireid);
1386  return;
1387  } // if no channel
1388 
1389  // check the channel status; bad channels are still ok.
1390  lariov::ChannelStatusProvider const& channelStatus
1392 
1393  if (!channelStatus.IsPresent(channel)) return;
1394 
1395  // The following test is meant to be temporary until the "correct" solution is implemented
1396  if (!ProcessChannelWithStatus(channelStatus.Status(channel))) return;
1397 
1398 
1399  // we accept to see the content of a bad channel, so this is commented out:
1400  if (!rawopt->fSeeBadChannels && channelStatus.IsBad(channel)) return;
1401 
1402  //get pedestal conditions
1403  const lariov::DetPedestalProvider& pedestalRetrievalAlg = art::ServiceHandle<lariov::DetPedestalService>()->GetPedestalProvider();
1404 
1405  // find the raw digit
1406  // (iDigit is an iterator to a evd::details::RawDigitInfo_t)
1407  evd::details::RawDigitInfo_t const* pDigit
1408  = digit_cache->FindChannel(channel);
1409  if (!pDigit) { // this is weird...
1410  mf::LogWarning("RawDataDrawer") << __func__
1411  << ": can't find raw digit for channel #" << channel
1412  << " (" << std::string(wireid) << ")";
1413  return;
1414  }
1415 
1416  raw::RawDigit::ADCvector_t const& uncompressed = pDigit->Data();
1417 
1418  float const pedestal = pedestalRetrievalAlg.PedMean(channel);
1419 
1420  for(size_t j = 0; j < uncompressed.size(); ++j)
1421  histo->Fill(float(j), float(uncompressed[j]) - pedestal); //pedestals[plane]); //hit.GetPedestal());
1422 
1423  } // RawDataDrawer::FillTQHisto()
int fDrawRawDataOrCalibWires
0 for raw
art::InputTag fRawDataLabel
module label that made the raw digits, default is daq
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
Definition: RawDigit.h:72
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
bool ProcessChannelWithStatus(lariov::ChannelStatusProvider::Status_t channel_status) const
Returns whether a channel with the specified status should be processed.
Information about a RawDigit; may contain uncompressed duplicate of data.
raw::RawDigit::ADCvector_t const & Data() const
average charge
constexpr bool isValidChannelID(raw::ChannelID_t channel)
Definition: RawTypes.h:36
void GetRawDigits(art::Event const &evt)
Reads raw::RawDigits; also triggers Reset()
geo::TPCID CurrentTPC() const
Returns the current TPC as a TPCID.
bool empty() const
Returns whether the cache is empty() (STL-like interface)
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
RawDigitInfo_t const * FindChannel(raw::ChannelID_t channel) const
Returns a pointer to the digit info of given channel, nullptr if none.
bool fSeeBadChannels
Allow "bad" channels to be viewed.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
::util::PlaneDataChangeTracker_t CacheID_t
Definition: RawDataDrawer.h:35
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:27
evd::details::RawDigitCacheDataClass * digit_cache
Cache of raw digits.
void evd::RawDataDrawer::GetChargeSum ( int  plane,
double &  charge,
double &  convcharge 
)

Definition at line 1299 of file RawDataDrawer.cxx.

References fConvertedCharge, and fRawCharge.

1300  {
1301  charge=fRawCharge[plane];
1302  convcharge=fConvertedCharge[plane];
1303 
1304  }
std::vector< double > fRawCharge
Sum of Raw Charge.
std::vector< double > fConvertedCharge
Sum of Charge Converted using Birks&#39; formula.
void evd::RawDataDrawer::GetRawDigits ( art::Event const &  evt)
private

Reads raw::RawDigits; also triggers Reset()

Referenced by FillQHisto(), FillTQHisto(), RawDigit2D(), ResetRegionOfInterest(), and RunOperation().

void evd::RawDataDrawer::GetRawDigits ( art::Event const &  evt,
details::CacheID_t const &  new_timestamp 
)
private

Makes sure raw::RawDigit's are available for the current settings.

Parameters
evtevent to read the digits from
tsa 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 1540 of file RawDataDrawer.cxx.

References digit_cache, fCacheID, LOG_DEBUG, ProcessChannelWithStatus(), ResetRegionOfInterest(), and evd::details::RawDigitCacheDataClass::Update().

1541  {
1542  LOG_DEBUG("RawDataDrawer") << "GetRawDigits() for " << new_timestamp
1543  << " (last for: " << *fCacheID << ")";
1544 
1545  // update cache
1546  digit_cache->Update(evt, new_timestamp);
1547 
1548  // if time stamp is changing, we want to reconsider which region is
1549  // interesting
1550  if (!fCacheID->sameTPC(new_timestamp)) ResetRegionOfInterest();
1551 
1552  // all the caches have been properly updated or invalidated;
1553  // we are now on a new cache state
1554  *fCacheID = new_timestamp;
1555 
1556  } // RawDataDrawer::GetRawDigits()
bool Update(art::Event const &evt, CacheID_t const &new_timestamp)
details::CacheID_t * fCacheID
information about the last processed plane
#define LOG_DEBUG(id)
void ResetRegionOfInterest()
Forgets about the current region of interest.
evd::details::RawDigitCacheDataClass * digit_cache
Cache of raw digits.
int evd::RawDataDrawer::GetRegionOfInterest ( int  plane,
int &  minw,
int &  maxw,
int &  mint,
int &  maxt 
)

Definition at line 1272 of file RawDataDrawer.cxx.

References fTimeMax, fTimeMin, fWireMax, fWireMin, geo::GeometryCore::Nwires(), and TotalClockTicks().

Referenced by evd::TWireProjPad::ShowFull().

1273  {
1275 
1276  if((unsigned int)plane>=fWireMin.size())
1277  {mf::LogWarning ("RawDataDrawer") << " Requested plane " << plane <<" is larger than those available " << std::endl;
1278  return -1;
1279  }
1280 
1281  minw=fWireMin[plane];
1282  maxw=fWireMax[plane];
1283  mint=fTimeMin[plane];
1284  maxt=fTimeMax[plane];
1285 
1286  if ((minw == maxw) || (mint == maxt)) return 1;
1287 
1288  //make values a bit larger, but make sure they don't go out of bounds
1289  minw= (minw-30<0) ? 0 : minw-30;
1290  mint= (mint-10<0) ? 0 : mint-10;
1291 
1292  maxw= (maxw+10>(int)geo->Nwires(plane)) ? geo->Nwires(plane) : maxw+10;
1293  maxt= (maxt+10>TotalClockTicks()) ? TotalClockTicks() : maxt+10;
1294 
1295  return 0;
1296  }
unsigned int Nwires(unsigned int p, unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wires in the specified plane.
std::vector< int > fWireMin
lowest wire in interesting region for each plane
std::vector< int > fTimeMax
highest time in interesting region for each plane
std::vector< int > fWireMax
highest wire in interesting region for each plane
double TotalClockTicks() const
Definition: RawDataDrawer.h:85
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::vector< int > fTimeMin
lowest time in interesting region for each plane
Namespace collecting geometry-related classes utilities.
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 1516 of file RawDataDrawer.cxx.

References fTimeMax, and fWireMax.

Referenced by RawDigit2D(), and RunRoIextractor().

1516  {
1517 
1518  return (fWireMax[plane] != -1) && (fTimeMax[plane] != -1);
1519 
1520  } // RawDataDrawer::hasRegionOfInterest()
std::vector< int > fTimeMax
highest time in interesting region for each plane
std::vector< int > fWireMax
highest wire in interesting region for each plane
bool evd::RawDataDrawer::ProcessChannelWithStatus ( lariov::ChannelStatusProvider::Status_t  channel_status) const
private

Returns whether a channel with the specified status should be processed.

Definition at line 1561 of file RawDataDrawer.cxx.

References evd::RawDrawingOptions::fMaxChannelStatus.

Referenced by FillQHisto(), FillTQHisto(), GetRawDigits(), and RunOperation().

1562  {
1563  // if we don't have a valid status, we can't reject the channel
1564  if (!lariov::ChannelStatusProvider::IsValidStatus(channel_status))
1565  return true;
1566 
1567  // is the status "too bad"?
1569  if (channel_status > drawopt->fMaxChannelStatus) return false;
1570  if (channel_status < drawopt->fMinChannelStatus) return false;
1571 
1572  // no reason to reject it...
1573  return true;
1574  } // RawDataDrawer::ProcessChannel()
unsigned int fMaxChannelStatus
Display channels with this status and below.
void evd::RawDataDrawer::QueueDrawingBoxes ( evdb::View2D view,
geo::PlaneID const &  pid,
std::vector< BoxInfo_t > const &  BoxInfo 
)
private

Definition at line 993 of file RawDataDrawer.cxx.

References 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, LOG_DEBUG, min, evd::ColorDrawingOptions::RawQ(), RunDrawOperation(), and geo::GeometryCore::SignalType().

998  {
999  //
1000  // All the information is now collected in BoxInfo.
1001  // Make boxes out of it.
1002  //
1003  evd::RawDrawingOptions const& rawopt
1005 
1006  LOG_DEBUG("RawDataDrawer")
1007  << "Filling " << BoxInfo.size() << " boxes to be rendered";
1008 
1009  // drawing options:
1010  float const MinSignal = rawopt.fMinSignal;
1011  bool const bScaleDigitsByCharge = rawopt.fScaleDigitsByCharge;
1012 
1014 
1016  geo::SigType_t const sigType = geom.SignalType(pid);
1017  evdb::ColorScale const& ColorSet = cst->RawQ(sigType);
1018  size_t const nBoxes = BoxInfo.size();
1019  unsigned int nDrawnBoxes = 0;
1020  for (size_t iBox = 0; iBox < nBoxes; ++iBox) {
1021  BoxInfo_t const& info = BoxInfo[iBox];
1022 
1023  // too little signal, don't bother drawing
1024  if(info.good && (std::abs(info.adc) < MinSignal)) continue;
1025 
1026  // skip the bad cells
1027  if (!info.good) continue;
1028 
1029  // box color, proportional to the ADC count
1030  int const color = ColorSet.GetColor(info.adc);
1031 
1032  // scale factor, proportional to ADC count (optional)
1033  constexpr float q0 = 1000.;
1034  float const sf = bScaleDigitsByCharge
1035  ? std::min(std::sqrt((float) info.adc / q0), 1.0F)
1036  : 1.;
1037 
1038  // coordinates of the cell box
1039  float min_wire, max_wire, min_tick, max_tick;
1040  std::tie(min_wire, min_tick, max_wire, max_tick)
1041  = fDrawingRange->GetCellBox(iBox);
1042  /*
1043  LOG_TRACE("RawDataDrawer")
1044  << "Wires ( " << min_wire << " - " << max_wire << " ) ticks ("
1045  << min_tick << " - " << max_tick << " ) for cell " << iBox;
1046  */
1047  if (sf != 1.) { // need to shrink the box
1048  float const nsf = 1. - sf; // negation of scale factor
1049  float const half_box_wires = (max_wire - min_wire) / 2.,
1050  half_box_ticks = (max_tick - min_tick) / 2.;
1051 
1052  // shrink the box:
1053  min_wire += nsf * half_box_wires;
1054  max_wire -= nsf * half_box_wires;
1055  min_tick += nsf * half_box_ticks;
1056  max_tick -= nsf * half_box_ticks;
1057  } // if scaling
1058 
1059  // allocate the box on the view;
1060  // the order of the coordinates depends on the orientation
1061  TBox* pBox;
1062  if (rawopt.fAxisOrientation < 1)
1063  pBox = &(view->AddBox(min_wire, min_tick, max_wire, max_tick));
1064  else
1065  pBox = &(view->AddBox(min_tick, min_wire, max_tick, max_wire));
1066 
1067  pBox->SetFillStyle(1001);
1068  pBox->SetFillColor(color);
1069  pBox->SetBit(kCannotPick);
1070 
1071  ++nDrawnBoxes;
1072  } // for (iBox)
1073 
1074  LOG_DEBUG("RawDataDrawer")
1075  << "Sent " << nDrawnBoxes << "/" << BoxInfo.size()
1076  << " boxes to be rendered";
1077  } // RawDataDrawer::QueueDrawingBoxes()
int fScaleDigitsByCharge
scale the size of the digit by the charge
Display parameters for the raw data.
int GetColor(double x) const
Definition: ColorScale.cxx:126
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
TBox & AddBox(double x1, double y1, double x2, double y2)
Definition: View2D.cxx:263
Build an association between a numerical range and a ROOT color index for use in, eg...
Definition: ColorScale.h:44
const evdb::ColorScale & RawQ(geo::SigType_t st) const
enum geo::_plane_sigtype SigType_t
Enumerate the possible plane projections.
double fMinSignal
minimum ADC count to display a time bin
Description of geometry of one entire detector.
std::size_t color(std::string const &procname)
Int_t min
Definition: plot.C:26
int fAxisOrientation
0 = TDC values on y-axis, wire number on x-axis, 1 = swapped
#define LOG_DEBUG(id)
details::CellGridClass * fDrawingRange
information about the viewport
std::tuple< float, float, float, float > GetCellBox(std::ptrdiff_t iCell) const
Returns the coordinates { w1, t1, w2, t2 } of specified cell.
void evd::RawDataDrawer::RawDigit2D ( art::Event const &  evt,
evdb::View2D view,
unsigned int  plane,
bool  bZoomToRoI = false 
)

Draws raw digit content in 2D wire plane representation.

Parameters
evtsource for raw digits
viewtarget rendered object
planenumber of the plane to be drawn
bZoomToRoIwhether 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 1178 of file RawDataDrawer.cxx.

References evd::RawDataDrawer::ManyOperations::AddOperation(), BoxDrawer, evd::RawDrawingOptions::CurrentTPC(), evd::RawDrawingOptions::fDrawRawDataOrCalibWires, evd::RawDrawingOptions::fRawDataLabel, fTimeMax, fTimeMin, fWireMax, fWireMin, GetRawDigits(), hasRegionOfInterest(), LOG_DEBUG, RoIextractorClass, RunOperation(), SetDrawingLimitsFromRoI(), and art::errors::Unknown.

1182  {
1183 
1185  geo::PlaneID const pid(rawopt->CurrentTPC(), plane);
1186 
1187  bool const bDraw = (rawopt->fDrawRawDataOrCalibWires != 1);
1188  // if we don't need to draw, don't bother doing anything;
1189  // if the region of interest is required, RunRoIextractor() should be called
1190  // (ok, now it's private, but it could be exposed)
1191  if (!bDraw) return;
1192 
1193  // make sure we reset what needs to be reset
1194  // before the operations are initialized;
1195  // we call for reading raw digits; they will be cached, so it's not a waste
1196  details::CacheID_t NewCacheID(evt, rawopt->fRawDataLabel, pid);
1197  GetRawDigits(evt, NewCacheID);
1198 
1199  bool const hasRoI = hasRegionOfInterest(plane);
1200 
1201  // - if we don't have a RoI yet, we want to get it while we draw
1202  // * if we are zooming into it now, we have to extract it first, then draw
1203  // * if we are not zooming, we can do both at the same time
1204  // - if we have a RoI, we don't want to extract it again
1205  if (!bZoomToRoI) { // we are not required to zoom to the RoI
1206 
1207  std::unique_ptr<OperationBaseClass> operation;
1208 
1209  // we will do the drawing in one pass
1210  LOG_DEBUG("RawDataDrawer")
1211  << __func__ << "() setting up one-pass drawing";
1212  operation.reset(new BoxDrawer(pid, this, view));
1213 
1214  if (!hasRoI) { // we don't have any RoI; since it's cheap, let's get it
1215  LOG_DEBUG("RawDataDrawer") << __func__ << "() adding RoI extraction";
1216 
1217  // swap cards: operation becomes a multiple operation:
1218  // - prepare the two operations (one is there already, somehow)
1219  std::unique_ptr<OperationBaseClass> drawer(std::move(operation));
1220  std::unique_ptr<OperationBaseClass> extractor
1221  (new RoIextractorClass(pid, this));
1222  // - create a new composite operation and give it the sub-ops
1223  operation.reset(new ManyOperations(pid, this));
1224  ManyOperations* pManyOps
1225  = static_cast<ManyOperations*>(operation.get());
1226  pManyOps->AddOperation(std::move(drawer));
1227  pManyOps->AddOperation(std::move(extractor));
1228  }
1229 
1230  if (!RunOperation(evt, operation.get())) {
1232  << "RawDataDrawer::RunDrawOperation(): "
1233  "somewhere something went somehow wrong";
1234  }
1235  }
1236  else { // we are zooming to RoI
1237  // first, we want the RoI extracted; the extractor will update this object
1238  if (!hasRoI) {
1239  LOG_DEBUG("RawDataDrawer") << __func__
1240  << "() setting up RoI extraction for " << pid;
1241  RoIextractorClass extractor(pid, this);
1242  if (!RunOperation(evt, &extractor)) {
1244  << "RawDataDrawer::RunDrawOperation():"
1245  " something went somehow wrong while extracting RoI";
1246  }
1247  }
1248  else {
1249  LOG_DEBUG("RawDataDrawer") << __func__
1250  << "() using existing RoI for " << pid
1251  << ": wires ( " << fWireMin[plane] << " - " << fWireMax[plane]
1252  << " ), ticks ( " << fTimeMin[plane] << " - " << fTimeMax[plane]
1253  << " )";
1254  }
1255 
1256  // adopt the drawing limits information from the wire/time limits
1258 
1259  // then we draw
1260  LOG_DEBUG("RawDataDrawer") << __func__ << "() setting up drawing";
1261  BoxDrawer drawer(pid, this, view);
1262  if (!RunOperation(evt, &drawer)) {
1264  << "RawDataDrawer::RunDrawOperation():"
1265  " something went somehow wrong while drawing";
1266  }
1267  }
1268  } // RawDataDrawer::RawDigit2D()
int fDrawRawDataOrCalibWires
0 for raw
void SetDrawingLimitsFromRoI(geo::PlaneID::PlaneID_t plane)
art::InputTag fRawDataLabel
module label that made the raw digits, default is daq
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
std::vector< int > fWireMin
lowest wire in interesting region for each plane
friend class RoIextractorClass
std::vector< int > fTimeMax
highest time in interesting region for each plane
std::vector< int > fWireMax
highest wire in interesting region for each plane
void GetRawDigits(art::Event const &evt)
Reads raw::RawDigits; also triggers Reset()
geo::TPCID CurrentTPC() const
Returns the current TPC as a TPCID.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
bool hasRegionOfInterest(geo::PlaneID::PlaneID_t plane) const
friend class BoxDrawer
#define LOG_DEBUG(id)
std::vector< int > fTimeMin
lowest time in interesting region for each plane
::util::PlaneDataChangeTracker_t CacheID_t
Definition: RawDataDrawer.h:35
bool RunOperation(art::Event const &evt, OperationBaseClass *operation)
void evd::RawDataDrawer::Reset ( art::Event const &  event)
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 1524 of file RawDataDrawer.cxx.

References trkf::fill(), fTimeMax, fTimeMin, fWireMax, fWireMin, GetRawDigits(), and LOG_DEBUG.

Referenced by GetRawDigits().

1524  {
1525 
1526  LOG_DEBUG("RawDataDrawer") << "RawDataDrawer[" << ((void*) this)
1527  << "]: resetting the region of interest";
1528 
1529  std::fill(fWireMin.begin(), fWireMin.end(), -1);
1530  std::fill(fWireMax.begin(), fWireMax.end(), -1);
1531  std::fill(fTimeMin.begin(), fTimeMin.end(), -1);
1532  std::fill(fTimeMax.begin(), fTimeMax.end(), -1);
1533 
1534  } // RawDataDrawer::ResetRegionOfInterest()
std::vector< int > fWireMin
lowest wire in interesting region for each plane
std::vector< int > fTimeMax
highest time in interesting region for each plane
std::vector< int > fWireMax
highest wire in interesting region for each plane
void fill(const art::PtrVector< recob::Hit > &hits, int only_plane)
#define LOG_DEBUG(id)
std::vector< int > fTimeMin
lowest time in interesting region for each plane
void evd::RawDataDrawer::RunDrawOperation ( art::Event const &  evt,
evdb::View2D view,
unsigned int  plane 
)
private

Definition at line 1081 of file RawDataDrawer.cxx.

References evd::RawDrawingOptions::CurrentTPC(), evd::RawDrawingOptions::fDrawRawDataOrCalibWires, RunOperation(), and art::errors::Unknown.

Referenced by QueueDrawingBoxes().

1082  {
1083 
1084  // Check if we're supposed to draw raw hits at all
1086  if (rawopt->fDrawRawDataOrCalibWires == 1) return;
1087 
1088  geo::PlaneID const pid(rawopt->CurrentTPC(), plane);
1089  BoxDrawer drawer(pid, this, view);
1090  if (!RunOperation(evt, &drawer)) {
1092  << "RawDataDrawer::RunDrawOperation(): "
1093  "somewhere something went somehow wrong";
1094  }
1095 
1096  } // RawDataDrawer::RunDrawOperation()
int fDrawRawDataOrCalibWires
0 for raw
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
geo::TPCID CurrentTPC() const
Returns the current TPC as a TPCID.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
friend class BoxDrawer
bool RunOperation(art::Event const &evt, OperationBaseClass *operation)
bool evd::RawDataDrawer::RunOperation ( art::Event const &  evt,
OperationBaseClass operation 
)
private

Definition at line 811 of file RawDataDrawer.cxx.

References raw::RawDigit::Channel(), geo::GeometryCore::ChannelToWire(), digit_cache, evd::details::RawDigitCacheDataClass::empty(), evd::RawDataDrawer::OperationBaseClass::Finish(), evd::RawDrawingOptions::fRawDataLabel, evd::RawDrawingOptions::fSeeBadChannels, fStartTick, fTicks, GetRawDigits(), evd::RawDataDrawer::OperationBaseClass::Initialize(), LOG_DEBUG, min, evd::RawDataDrawer::OperationBaseClass::Name(), evd::RawDataDrawer::OperationBaseClass::Operate(), evd::RawDataDrawer::OperationBaseClass::PlaneID(), ProcessChannelWithStatus(), evd::RawDataDrawer::OperationBaseClass::ProcessTick(), and evd::RawDataDrawer::OperationBaseClass::ProcessWire().

Referenced by evd::RawDataDrawer::ManyOperations::AddOperation(), RawDigit2D(), RunDrawOperation(), and RunRoIextractor().

812  {
813  geo::PlaneID const& pid = operation->PlaneID();
814 
816  details::CacheID_t NewCacheID(evt, rawopt->fRawDataLabel, pid);
817  GetRawDigits(evt, NewCacheID);
818 
819  if(digit_cache->empty()) return true;
820 
821  LOG_DEBUG("RawDataDrawer") << "RawDataDrawer::RunOperation() running "
822  << operation->Name();
823 
824  // if we have an initialization failure, return false immediately;
825  // but it's way better if the failure throws an exception
826  if (!operation->Initialize()) return false;
827 
828  lariov::ChannelStatusProvider const& channelStatus
830 
831  //get pedestal conditions
832  const lariov::DetPedestalProvider& pedestalRetrievalAlg = *(lar::providerFrom<lariov::DetPedestalService>());
833 
834  geo::GeometryCore const& geom = *(lar::providerFrom<geo::Geometry>());
835 
836  // loop over all the channels/raw digits
837  for (evd::details::RawDigitInfo_t const& digit_info: *digit_cache) {
838  raw::RawDigit const& hit = digit_info.Digit();
839  raw::ChannelID_t const channel = hit.Channel();
840 
841  // skip the bad channels
842  if (!channelStatus.IsPresent(channel)) continue;
843  // The following test is meant to be temporary until the "correct" solution is implemented
844  if (!ProcessChannelWithStatus(channelStatus.Status(channel))) continue;
845 
846  // we have a list of all channels, but we are drawing only on one plane;
847  // most of the channels will not contribute to this plane,
848  // and before we start querying databases, unpacking data etc.
849  // we want to know it's for something
850 
851  std::vector<geo::WireID> WireIDs = geom.ChannelToWire(channel);
852 
853  bool bDrawChannel = false;
854  for (geo::WireID const& wireID: WireIDs){
855  if (wireID.planeID() != pid) continue; // not us!
856  bDrawChannel = true;
857  break;
858  } // for wires
859  if (!bDrawChannel) continue;
860 
861  // collect bad channels
862  bool const bGood = rawopt->fSeeBadChannels || !channelStatus.IsBad(channel);
863 
864  // nothing else to be done if the channel is not good:
865  // cells are marked bad by default and if any good channel falls in any of
866  // them, they become good
867  if (!bGood) continue;
868 
869  // at this point we know we have to process this channel
870  raw::RawDigit::ADCvector_t const& uncompressed = digit_info.Data();
871 
872  // recover the pedestal
873  float const pedestal = pedestalRetrievalAlg.PedMean(channel);
874 
875  // loop over all the wires that are covered by this channel;
876  // without knowing better, we have to draw into all of them
877  for (geo::WireID const& wireID: WireIDs){
878  // check that the plane and tpc are the correct ones to draw
879  if (wireID.planeID() != pid) continue; // not us!
880 
881  // do we have anything to do with this wire?
882  if (!operation->ProcessWire(wireID)) continue;
883 
884  // get an iterator over the adc values
885  // accumulate all the data of this wire in our "cells"
886  size_t const max_tick = std::min({
887  uncompressed.size(),
888  size_t(fStartTick + fTicks)
889  });
890 
891  for (size_t iTick = fStartTick; iTick < max_tick; ++iTick) {
892 
893  // do we have anything to do with this wire?
894  if (!operation->ProcessTick(iTick)) continue;
895 
896  float const adc = uncompressed[iTick] - pedestal;
897 
898  if (!operation->Operate(wireID, iTick, adc)) return false;
899 
900  } // if good
901  } // for wires
902  } // for channels
903 
904  return operation->Finish();
905  } // ChannelLooper()
Collection of charge vs time digitized from a single readout channel.
Definition: RawDigit.h:68
double fStartTick
low tick
art::InputTag fRawDataLabel
module label that made the raw digits, default is daq
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
ChannelID_t Channel() const
DAQ channel this raw data was read from.
Definition: RawDigit.h:211
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
Definition: RawDigit.h:72
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
bool ProcessChannelWithStatus(lariov::ChannelStatusProvider::Status_t channel_status) const
Returns whether a channel with the specified status should be processed.
Information about a RawDigit; may contain uncompressed duplicate of data.
double fTicks
number of ticks of the clock
void GetRawDigits(art::Event const &evt)
Reads raw::RawDigits; also triggers Reset()
Description of geometry of one entire detector.
Detector simulation of raw signals on wires.
bool empty() const
Returns whether the cache is empty() (STL-like interface)
bool fSeeBadChannels
Allow "bad" channels to be viewed.
Int_t min
Definition: plot.C:26
#define LOG_DEBUG(id)
::util::PlaneDataChangeTracker_t CacheID_t
Definition: RawDataDrawer.h:35
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:27
evd::details::RawDigitCacheDataClass * digit_cache
Cache of raw digits.
void evd::RawDataDrawer::RunRoIextractor ( art::Event const &  evt,
unsigned int  plane 
)
private

Definition at line 1155 of file RawDataDrawer.cxx.

References evd::RawDrawingOptions::CurrentTPC(), hasRegionOfInterest(), LOG_TRACE, and RunOperation().

1156  {
1158  geo::PlaneID const pid(rawopt->CurrentTPC(), plane);
1159 
1160  // if we have no region of interest, prepare to extract it
1161  bool const bExtractRoI = !hasRegionOfInterest(plane);
1162  LOG_TRACE("RawDataDrawer") << "Region of interest for " << pid
1163  << (bExtractRoI? " extracted": " not extracted") << " on this draw";
1164 
1165  if (!bExtractRoI) return;
1166 
1167  RoIextractorClass Extractor(pid, this);
1168  if (!RunOperation(evt, &Extractor)) {
1169  throw std::runtime_error
1170  ("RawDataDrawer::RunRoIextractor(): somewhere something went somehow wrong");
1171  }
1172 
1173  } // RawDataDrawer::RunRoIextractor()
The data type to uniquely identify a Plane.
Definition: geo_types.h:250
friend class RoIextractorClass
geo::TPCID CurrentTPC() const
Returns the current TPC as a TPCID.
bool hasRegionOfInterest(geo::PlaneID::PlaneID_t plane) const
bool RunOperation(art::Event const &evt, OperationBaseClass *operation)
#define LOG_TRACE(id)
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 603 of file RawDataDrawer.cxx.

References fDrawingRange, evd::RawDataDrawer::PadResolution_t::height, LOG_DEBUG, PadResolution, SetDrawingLimitsFromRoI(), 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(), and ~RawDataDrawer().

604  {
605  LOG_DEBUG("RawDataDrawer") << __func__
606  << "() setting drawing range as wires ( "
607  << low_wire << " - " << high_wire
608  << " ), ticks ( " << low_tdc << " - " << high_tdc << " )";
609 
610  // we need to set the minimum cell size to 1, otherwise some cell will not
611  // cover any wire/tick and they will be always empty
612  if (PadResolution) {
613  // TODO implement support for swapping axes here
614  unsigned int wire_pixels = PadResolution.width;
615  unsigned int tdc_pixels = PadResolution.height;
616  fDrawingRange->SetWireRange(low_wire, high_wire, wire_pixels, 1.F);
617  fDrawingRange->SetTDCRange(low_tdc, high_tdc, tdc_pixels, 1.F);
618  }
619  else {
620  LOG_DEBUG("RawDataDrawer")
621  << "Pad size not available -- using existing cell size";
622  fDrawingRange->SetWireRange(low_wire, high_wire);
624  fDrawingRange->SetTDCRange(low_tdc, high_tdc);
626  }
627 
628  } // RawDataDrawer::SetDrawingLimits()
void SetWireRange(unsigned int nWires)
Sets the wire range, leaving the number of wire cells unchanged.
bool SetMinTDCCellSize(float min_size)
Sets the minimum size for TDC cells.
PadResolution_t PadResolution
stored pad resolution
bool SetMinWireCellSize(float min_size)
Sets the minimum size for wire cells.
#define LOG_DEBUG(id)
details::CellGridClass * fDrawingRange
information about the viewport
void SetTDCRange(unsigned int nTDC)
Sets a simple TDC range: all the ticks, one cell per tick.
void evd::RawDataDrawer::SetDrawingLimitsFromRoI ( geo::PlaneID::PlaneID_t  plane)
private

Definition at line 632 of file RawDataDrawer.cxx.

References ExtractRange(), fTimeMax, fTimeMin, fWireMax, fWireMin, and SetDrawingLimits().

Referenced by RawDigit2D(), and SetDrawingLimits().

633  {
635  (fWireMin[plane], fWireMax[plane], fTimeMin[plane], fTimeMax[plane]);
636  } // RawDataDrawer::SetDrawingLimitsFromRoI()
std::vector< int > fWireMin
lowest wire in interesting region for each plane
void SetDrawingLimits(float low_wire, float high_wire, float low_tdc, float high_tdc)
Fills the viewport borders from the specified extremes.
std::vector< int > fTimeMax
highest time in interesting region for each plane
std::vector< int > fWireMax
highest wire in interesting region for each plane
std::vector< int > fTimeMin
lowest time in interesting region for each plane
void evd::RawDataDrawer::SetDrawingLimitsFromRoI ( geo::PlaneID const  pid)
inlineprivate

Definition at line 211 of file RawDataDrawer.h.

References geo::PlaneID::Plane.

212  { SetDrawingLimitsFromRoI(pid.Plane); }
void SetDrawingLimitsFromRoI(geo::PlaneID::PlaneID_t plane)
double evd::RawDataDrawer::StartTick ( ) const
inline

Definition at line 84 of file RawDataDrawer.h.

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

84 { return fStartTick; }
double fStartTick
low tick
double evd::RawDataDrawer::TotalClockTicks ( ) const
inline

Definition at line 85 of file RawDataDrawer.h.

Referenced by evd::TQPad::BookHistogram(), GetRegionOfInterest(), and evd::TWireProjPad::TWireProjPad().

85 { return fTicks; }
double fTicks
number of ticks of the clock

Friends And Related Function Documentation

friend class BoxDrawer
friend

Definition at line 134 of file RawDataDrawer.h.

Referenced by RawDigit2D().

friend class RoIextractorClass
friend

Definition at line 144 of file RawDataDrawer.h.

Referenced by RawDigit2D().

Member Data Documentation

evd::details::RawDigitCacheDataClass* evd::RawDataDrawer::digit_cache
private

Cache of raw digits.

Definition at line 148 of file RawDataDrawer.h.

Referenced by FillQHisto(), FillTQHisto(), GetRawDigits(), RunOperation(), and ~RawDataDrawer().

std::vector< raw::RawDigit > const evd::RawDataDrawer::EmptyRawDigits
staticprivate

Empty collection, used in return value of invalid digits.

Definition at line 215 of file RawDataDrawer.h.

details::CacheID_t* evd::RawDataDrawer::fCacheID
private

information about the last processed plane

Definition at line 175 of file RawDataDrawer.h.

Referenced by GetRawDigits(), and ~RawDataDrawer().

std::vector<double> evd::RawDataDrawer::fConvertedCharge
private

Sum of Charge Converted using Birks' formula.

Definition at line 171 of file RawDataDrawer.h.

Referenced by GetChargeSum(), and RawDataDrawer().

details::CellGridClass* evd::RawDataDrawer::fDrawingRange
private

information about the viewport

Definition at line 178 of file RawDataDrawer.h.

Referenced by ExtractRange(), QueueDrawingBoxes(), SetDrawingLimits(), and ~RawDataDrawer().

std::vector<double> evd::RawDataDrawer::fRawCharge
private

Sum of Raw Charge.

Definition at line 170 of file RawDataDrawer.h.

Referenced by GetChargeSum(), and RawDataDrawer().

double evd::RawDataDrawer::fStartTick
private

low tick

Definition at line 162 of file RawDataDrawer.h.

Referenced by RawDataDrawer(), and RunOperation().

double evd::RawDataDrawer::fTicks
private

number of ticks of the clock

Definition at line 163 of file RawDataDrawer.h.

Referenced by RawDataDrawer(), and RunOperation().

std::vector<int> evd::RawDataDrawer::fTimeMax
private

highest time in interesting region for each plane

Definition at line 168 of file RawDataDrawer.h.

Referenced by GetRegionOfInterest(), hasRegionOfInterest(), RawDataDrawer(), RawDigit2D(), ResetRegionOfInterest(), and SetDrawingLimitsFromRoI().

std::vector<int> evd::RawDataDrawer::fTimeMin
private

lowest time in interesting region for each plane

Definition at line 167 of file RawDataDrawer.h.

Referenced by GetRegionOfInterest(), RawDataDrawer(), RawDigit2D(), ResetRegionOfInterest(), and SetDrawingLimitsFromRoI().

std::vector<int> evd::RawDataDrawer::fWireMax
private

highest wire in interesting region for each plane

Definition at line 166 of file RawDataDrawer.h.

Referenced by GetRegionOfInterest(), hasRegionOfInterest(), RawDataDrawer(), RawDigit2D(), ResetRegionOfInterest(), and SetDrawingLimitsFromRoI().

std::vector<int> evd::RawDataDrawer::fWireMin
private

lowest wire in interesting region for each plane

Definition at line 165 of file RawDataDrawer.h.

Referenced by GetRegionOfInterest(), RawDataDrawer(), RawDigit2D(), ResetRegionOfInterest(), and SetDrawingLimitsFromRoI().

PadResolution_t evd::RawDataDrawer::PadResolution
private

stored pad resolution

Definition at line 173 of file RawDataDrawer.h.

Referenced by ExtractRange(), and SetDrawingLimits().


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