Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
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, 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::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 695 of file RawDataDrawer.cxx.

696  : digit_cache(new details::RawDigitCacheDataClass)
697  , fStartTick(0)
698  , fTicks(2048)
700  , fDrawingRange(new details::CellGridClass)
701  {
703 
705  geo::TPCID tpcid(rawopt->fCryostat, rawopt->fTPC);
706 
707  fStartTick = rawopt->fStartTick;
708  fTicks = rawopt->fTicks;
709 
710  // set the list of bad channels in this detector
711  unsigned int nplanes = geo->Nplanes(tpcid);
712  fWireMin.resize(nplanes, -1);
713  fWireMax.resize(nplanes, -1);
714  fTimeMin.resize(nplanes, -1);
715  fTimeMax.resize(nplanes, -1);
716  fRawCharge.resize(nplanes, 0);
717  fConvertedCharge.resize(nplanes, 0);
718  }
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:386
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.
LArSoft geometry interface.
Definition: ChannelGeo.h:16
std::vector< double > fConvertedCharge
Sum of Charge Converted using Birks&#39; formula.
evd::RawDataDrawer::~RawDataDrawer ( )

Definition at line 721 of file RawDataDrawer.cxx.

722  {
723  delete digit_cache;
724  delete fDrawingRange;
725  delete fCacheID;
726  }
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 762 of file RawDataDrawer.cxx.

763  {
764  mf::LogDebug log("RawDataDrawer");
765  log << "ExtractRange() on pad '" << pPad->GetName() << "'";
766 
767  TFrame const* pFrame = pPad->GetFrame();
768  if (pFrame) {
769  // these coordinates are used to find the actual extent of pad in pixels
770  double low_wire = pFrame->GetX1(), high_wire = pFrame->GetX2();
771  double low_tdc = pFrame->GetY1(), high_tdc = pFrame->GetY2();
772  double const wire_pixels = pPad->XtoAbsPixel(high_wire) - pPad->XtoAbsPixel(low_wire);
773  double const tdc_pixels = -(pPad->YtoAbsPixel(high_tdc) - pPad->YtoAbsPixel(low_tdc));
774 
775  PadResolution.width = (unsigned int)wire_pixels;
776  PadResolution.height = (unsigned int)tdc_pixels;
777 
778  log << "\n frame window is " << PadResolution.width << "x" << PadResolution.height
779  << " pixel big and";
780  // those coordinates also are a (unreliable) estimation of the zoom;
781  // if we have a better one, let's use it
782  // (this does not change the size of the window in terms of pixels)
783  if (zoom) {
784  log << ", from external source,";
785  low_wire = (*zoom)[0];
786  high_wire = (*zoom)[1];
787  low_tdc = (*zoom)[2];
788  high_tdc = (*zoom)[3];
789  }
790 
791  log << " spans wires " << low_wire << "-" << high_wire << " and TDC " << low_tdc << "-"
792  << high_tdc;
793 
794  // TODO support swapping axes here:
795  // if (rawopt.fAxisOrientation < 1) { normal ; } else { swapped; }
796 
797  fDrawingRange->SetWireRange(low_wire, high_wire, (unsigned int)wire_pixels, 1.0);
798  fDrawingRange->SetTDCRange(low_tdc, high_tdc, (unsigned int)tdc_pixels, 1.0);
799  }
800  else {
801  // keep the old frame (if any)
802  log << "\n no frame!";
803  }
804 
805  } // RawDataDrawer::ExtractRange()
void SetWireRange(unsigned int nWires)
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 1484 of file RawDataDrawer.cxx.

1485  {
1486 
1487  // Check if we're supposed to draw raw hits at all
1489  if (rawopt->fDrawRawDataOrCalibWires == 1) return;
1490 
1492 
1493  geo::PlaneID const pid(rawopt->CurrentTPC(), plane);
1494 
1495  for (const auto& rawDataLabel : rawopt->fRawDataLabels) {
1496  details::CacheID_t NewCacheID(evt, rawDataLabel, pid);
1497  GetRawDigits(evt, NewCacheID);
1498 
1499  lariov::ChannelStatusProvider const& channelStatus =
1501 
1502  //get pedestal conditions
1503  const lariov::DetPedestalProvider& pedestalRetrievalAlg =
1505 
1506  for (evd::details::RawDigitInfo_t const& digit_info : *digit_cache) {
1507  raw::RawDigit const& hit = digit_info.Digit();
1508  raw::ChannelID_t const channel = hit.Channel();
1509 
1510  if (!channelStatus.IsPresent(channel)) continue;
1511 
1512  // The following test is meant to be temporary until the "correct" solution is implemented
1513  if (!ProcessChannelWithStatus(channelStatus.Status(channel))) continue;
1514 
1515  // to be explicit: we don't cound bad channels in
1516  if (!rawopt->fSeeBadChannels && channelStatus.IsBad(channel)) continue;
1517 
1518  std::vector<geo::WireID> wireids = geo->ChannelToWire(channel);
1519  for (auto const& wid : wireids) {
1520  // check that the plane and tpc are the correct ones to draw
1521  if (wid.planeID() != pid) continue;
1522 
1523  raw::RawDigit::ADCvector_t const& uncompressed = digit_info.Data();
1524 
1525  //float const pedestal = pedestalRetrievalAlg.PedMean(channel);
1526  // recover the pedestal
1527  float pedestal = 0;
1528  if (rawopt->fPedestalOption == 0) { pedestal = pedestalRetrievalAlg.PedMean(channel); }
1529  else if (rawopt->fPedestalOption == 1) {
1530  pedestal = hit.GetPedestal();
1531  }
1532  else if (rawopt->fPedestalOption == 2) {
1533  pedestal = 0;
1534  }
1535  else {
1536  mf::LogWarning("RawDataDrawer")
1537  << " PedestalOption is not understood: " << rawopt->fPedestalOption
1538  << ". Pedestals not subtracted.";
1539  }
1540 
1541  for (short d : uncompressed)
1542  histo->Fill(float(d) - pedestal); //pedestals[plane]); //hit.GetPedestal());
1543 
1544  // this channel is on the correct plane, don't double count the raw signal
1545  // if there are more than one wids for the channel
1546  break;
1547  } // end loop over wids
1548  } //end loop over raw hits
1549  } //end loop over labels
1550  }
virtual bool IsBad(raw::ChannelID_t channel) const =0
Returns whether the specified channel is bad in the current run.
float GetPedestal() const
Definition: RawDigit.h:214
Collection of charge vs time digitized from a single readout channel.
Definition: RawDigit.h:69
int fDrawRawDataOrCalibWires
0 for raw
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
ChannelID_t Channel() const
DAQ channel this raw data was read from.
Definition: RawDigit.h:212
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
Definition: RawDigit.h:73
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
uint8_t channel
Definition: CRTFragment.hh:201
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.
void GetRawDigits(art::Event const &evt)
Reads raw::RawDigits; also triggers Reset()
virtual Status_t Status(raw::ChannelID_t channel) const
Returns a status integer with arbitrary meaning.
geo::TPCID CurrentTPC() const
Returns the current TPC as a TPCID.
Class providing information about the quality of channels.
Detector simulation of raw signals on wires.
virtual bool IsPresent(raw::ChannelID_t channel) const =0
Returns whether the specified channel is physical and connected to wire.
bool fSeeBadChannels
Allow "bad" channels to be viewed.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::vector< art::InputTag > fRawDataLabels
module label that made the raw digits, default is daq
virtual float PedMean(raw::ChannelID_t ch) const =0
Retrieve pedestal information.
::util::PlaneDataChangeTracker_t CacheID_t
Definition: RawDataDrawer.h:35
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
evd::details::RawDigitCacheDataClass * digit_cache
Cache of raw digits.
int fPedestalOption
0: use DetPedestalService; 1: Use pedestal in raw::RawDigt; 2: no ped subtraction ...
LArSoft geometry interface.
Definition: ChannelGeo.h:16
void evd::RawDataDrawer::FillTQHisto ( const art::Event evt,
unsigned int  plane,
unsigned int  wire,
TH1F *  histo 
)

Definition at line 1554 of file RawDataDrawer.cxx.

1558  {
1559 
1560  // Check if we're supposed to draw raw hits at all
1562  if (rawopt->fDrawRawDataOrCalibWires == 1) return;
1563 
1564  // make sure we have the raw digits cached
1565  geo::PlaneID const pid(rawopt->CurrentTPC(), plane);
1566 
1567  // loop over labels
1568  for (const auto& rawDataLabel : rawopt->fRawDataLabels) {
1569  details::CacheID_t NewCacheID(evt, rawDataLabel, pid);
1570  GetRawDigits(evt, NewCacheID);
1571 
1572  if (digit_cache->empty()) return;
1573 
1574  geo::WireID const wireid(pid, wire);
1575 
1576  // find the channel
1578  raw::ChannelID_t const channel = geom->PlaneWireToChannel(wireid);
1579  if (!raw::isValidChannelID(channel)) { // no channel, empty histogram
1580  mf::LogError("RawDataDrawer")
1581  << __func__ << ": no channel associated to " << std::string(wireid);
1582  return;
1583  } // if no channel
1584 
1585  // check the channel status; bad channels are still ok.
1586  lariov::ChannelStatusProvider const& channelStatus =
1588 
1589  if (!channelStatus.IsPresent(channel)) return;
1590 
1591  // The following test is meant to be temporary until the "correct" solution is implemented
1592  if (!ProcessChannelWithStatus(channelStatus.Status(channel))) return;
1593 
1594  // we accept to see the content of a bad channel, so this is commented out:
1595  if (!rawopt->fSeeBadChannels && channelStatus.IsBad(channel)) return;
1596 
1597  //get pedestal conditions
1598  const lariov::DetPedestalProvider& pedestalRetrievalAlg =
1600 
1601  // find the raw digit
1602  // (iDigit is an iterator to a evd::details::RawDigitInfo_t)
1603  evd::details::RawDigitInfo_t const* pDigit = digit_cache->FindChannel(channel);
1604 
1605  if (
1606  !pDigit) { // this is weird... actually no, this can happen if the RawDigits are per TPC (or something)
1607  // mf::LogWarning("RawDataDrawer") << __func__
1608  // << ": can't find raw digit for channel #" << channel
1609  // << " (" << std::string(wireid) << ")";
1610  continue;
1611  }
1612 
1613  raw::RawDigit::ADCvector_t const& uncompressed = pDigit->Data();
1614 
1615  // recover the pedestal
1616  float pedestal = 0;
1617  if (rawopt->fPedestalOption == 0) { pedestal = pedestalRetrievalAlg.PedMean(channel); }
1618  else if (rawopt->fPedestalOption == 1) {
1619  pedestal = pDigit->DigitPtr()->GetPedestal();
1620  }
1621  else if (rawopt->fPedestalOption == 2) {
1622  pedestal = 0;
1623  }
1624  else {
1625  mf::LogWarning("RawDataDrawer")
1626  << " PedestalOption is not understood: " << rawopt->fPedestalOption
1627  << ". Pedestals not subtracted.";
1628  }
1629 
1630  for (size_t j = 0; j < uncompressed.size(); ++j)
1631  histo->Fill(float(j),
1632  float(uncompressed[j]) - pedestal); //pedestals[plane]); //hit.GetPedestal());
1633  }
1634 
1635  } // RawDataDrawer::FillTQHisto()
virtual bool IsBad(raw::ChannelID_t channel) const =0
Returns whether the specified channel is bad in the current run.
float GetPedestal() const
Definition: RawDigit.h:214
std::string string
Definition: nybbler.cc:12
int fDrawRawDataOrCalibWires
0 for raw
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
Definition: RawDigit.h:73
uint8_t channel
Definition: CRTFragment.hh:201
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:37
void GetRawDigits(art::Event const &evt)
Reads raw::RawDigits; also triggers Reset()
virtual Status_t Status(raw::ChannelID_t channel) const
Returns a status integer with arbitrary meaning.
geo::TPCID CurrentTPC() const
Returns the current TPC as a TPCID.
Class providing information about the quality of channels.
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.
virtual bool IsPresent(raw::ChannelID_t channel) const =0
Returns whether the specified channel is physical and connected to wire.
bool fSeeBadChannels
Allow "bad" channels to be viewed.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::vector< art::InputTag > fRawDataLabels
module label that made the raw digits, default is daq
virtual float PedMean(raw::ChannelID_t ch) const =0
Retrieve pedestal information.
::util::PlaneDataChangeTracker_t CacheID_t
Definition: RawDataDrawer.h:35
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
evd::details::RawDigitCacheDataClass * digit_cache
Cache of raw digits.
int fPedestalOption
0: use DetPedestalService; 1: Use pedestal in raw::RawDigt; 2: no ped subtraction ...
art::Ptr< raw::RawDigit > DigitPtr() const
Returns an art pointer to the actual digit.
void evd::RawDataDrawer::GetChargeSum ( int  plane,
double &  charge,
double &  convcharge 
)

Definition at line 1476 of file RawDataDrawer.cxx.

1477  {
1478  charge = fRawCharge[plane];
1479  convcharge = fConvertedCharge[plane];
1480  }
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()

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 1753 of file RawDataDrawer.cxx.

1754  {
1755  MF_LOG_DEBUG("RawDataDrawer") << "GetRawDigits() for " << new_timestamp
1756  << " (last for: " << *fCacheID << ")";
1757 
1758  // update cache
1759  digit_cache->Update(evt, new_timestamp);
1760 
1761  // if time stamp is changing, we want to reconsider which region is
1762  // interesting
1763  if (!fCacheID->sameTPC(new_timestamp)) ResetRegionOfInterest();
1764 
1765  // all the caches have been properly updated or invalidated;
1766  // we are now on a new cache state
1767  *fCacheID = new_timestamp;
1768 
1769  } // RawDataDrawer::GetRawDigits()
bool Update(art::Event const &evt, CacheID_t const &new_timestamp)
details::CacheID_t * fCacheID
information about the last processed plane
#define MF_LOG_DEBUG(id)
void ResetRegionOfInterest()
Forgets about the current region of interest.
TCEvent evt
Definition: DataStructs.cxx:7
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 1447 of file RawDataDrawer.cxx.

1448  {
1450 
1451  if ((unsigned int)plane >= fWireMin.size()) {
1452  mf::LogWarning("RawDataDrawer")
1453  << " Requested plane " << plane << " is larger than those available " << std::endl;
1454  return -1;
1455  }
1456 
1457  minw = fWireMin[plane];
1458  maxw = fWireMax[plane];
1459  mint = fTimeMin[plane];
1460  maxt = fTimeMax[plane];
1461 
1462  if ((minw == maxw) || (mint == maxt)) return 1;
1463 
1464  //make values a bit larger, but make sure they don't go out of bounds
1465  minw = (minw - 30 < 0) ? 0 : minw - 30;
1466  mint = (mint - 10 < 0) ? 0 : mint - 10;
1467 
1468  maxw = (maxw + 10 > (int)geo->Nwires(plane)) ? geo->Nwires(plane) : maxw + 10;
1469  maxt = (maxt + 10 > TotalClockTicks()) ? TotalClockTicks() : maxt + 10;
1470 
1471  return 0;
1472  }
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:82
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::vector< int > fTimeMin
lowest time in interesting region for each plane
LArSoft geometry interface.
Definition: ChannelGeo.h:16
QTextStream & endl(QTextStream &s)
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 1728 of file RawDataDrawer.cxx.

1729  {
1730 
1731  return (fWireMax[plane] != -1) && (fTimeMax[plane] != -1);
1732 
1733  } // 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 1773 of file RawDataDrawer.cxx.

1775  {
1776  // if we don't have a valid status, we can't reject the channel
1777  if (!lariov::ChannelStatusProvider::IsValidStatus(channel_status)) return true;
1778 
1779  // is the status "too bad"?
1781  if (channel_status > drawopt->fMaxChannelStatus) return false;
1782  if (channel_status < drawopt->fMinChannelStatus) return false;
1783 
1784  // no reason to reject it...
1785  return true;
1786  } // RawDataDrawer::ProcessChannel()
unsigned int fMaxChannelStatus
Display channels with this status and below.
static bool IsValidStatus(Status_t status)
Returns whether the specified status is a valid one.
void evd::RawDataDrawer::QueueDrawingBoxes ( evdb::View2D *  view,
geo::PlaneID const &  pid,
std::vector< BoxInfo_t > const &  BoxInfo 
)
private

Definition at line 1159 of file RawDataDrawer.cxx.

1162  {
1163  //
1164  // All the information is now collected in BoxInfo.
1165  // Make boxes out of it.
1166  //
1168 
1169  MF_LOG_DEBUG("RawDataDrawer") << "Filling " << BoxInfo.size() << " boxes to be rendered";
1170 
1171  // drawing options:
1172  float const MinSignal = rawopt.fMinSignal;
1173  bool const bScaleDigitsByCharge = rawopt.fScaleDigitsByCharge;
1174 
1176 
1178  geo::SigType_t const sigType = geom.SignalType(pid);
1179  evdb::ColorScale const& ColorSet = cst->RawQ(sigType);
1180  size_t const nBoxes = BoxInfo.size();
1181  unsigned int nDrawnBoxes = 0;
1182  for (size_t iBox = 0; iBox < nBoxes; ++iBox) {
1183  BoxInfo_t const& info = BoxInfo[iBox];
1184 
1185  // too little signal, don't bother drawing
1186  if (info.good && (std::abs(info.adc) < MinSignal)) continue;
1187 
1188  // skip the bad cells
1189  if (!info.good) continue;
1190 
1191  // box color, proportional to the ADC count
1192  int const color = ColorSet.GetColor(info.adc);
1193 
1194  // scale factor, proportional to ADC count (optional)
1195  constexpr float q0 = 1000.;
1196  float const sf = bScaleDigitsByCharge ? std::min(std::sqrt((float)info.adc / q0), 1.0F) : 1.;
1197 
1198  // coordinates of the cell box
1199  float min_wire, max_wire, min_tick, max_tick;
1200  std::tie(min_wire, min_tick, max_wire, max_tick) = fDrawingRange->GetCellBox(iBox);
1201  /*
1202  MF_LOG_TRACE("RawDataDrawer")
1203  << "Wires ( " << min_wire << " - " << max_wire << " ) ticks ("
1204  << min_tick << " - " << max_tick << " ) for cell " << iBox;
1205  */
1206  if (sf != 1.) { // need to shrink the box
1207  float const nsf = 1. - sf; // negation of scale factor
1208  float const half_box_wires = (max_wire - min_wire) / 2.,
1209  half_box_ticks = (max_tick - min_tick) / 2.;
1210 
1211  // shrink the box:
1212  min_wire += nsf * half_box_wires;
1213  max_wire -= nsf * half_box_wires;
1214  min_tick += nsf * half_box_ticks;
1215  max_tick -= nsf * half_box_ticks;
1216  } // if scaling
1217 
1218  // allocate the box on the view;
1219  // the order of the coordinates depends on the orientation
1220  TBox* pBox;
1221  if (rawopt.fAxisOrientation < 1)
1222  pBox = &(view->AddBox(min_wire, min_tick, max_wire, max_tick));
1223  else
1224  pBox = &(view->AddBox(min_tick, min_wire, max_tick, max_wire));
1225 
1226  pBox->SetFillStyle(1001);
1227  pBox->SetFillColor(color);
1228  pBox->SetBit(kCannotPick);
1229 
1230  ++nDrawnBoxes;
1231  } // for (iBox)
1232 
1233  MF_LOG_DEBUG("RawDataDrawer") << "Sent " << nDrawnBoxes << "/" << BoxInfo.size()
1234  << " boxes to be rendered";
1235  } // RawDataDrawer::QueueDrawingBoxes()
int fScaleDigitsByCharge
scale the size of the digit by the charge
Display parameters for the raw data.
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
T abs(T value)
const evdb::ColorScale & RawQ(geo::SigType_t st) const
enum geo::_plane_sigtype SigType_t
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)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
#define MF_LOG_DEBUG(id)
int fAxisOrientation
0 = TDC values on y-axis, wire number on x-axis, 1 = swapped
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,
detinfo::DetectorPropertiesData const &  detProp,
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 1333 of file RawDataDrawer.cxx.

1339  {
1341  geo::PlaneID const pid(rawopt->CurrentTPC(), plane);
1342 
1343  bool const bDraw = (rawopt->fDrawRawDataOrCalibWires != 1);
1344  // if we don't need to draw, don't bother doing anything;
1345  // if the region of interest is required, RunRoIextractor() should be called
1346  // (ok, now it's private, but it could be exposed)
1347  if (!bDraw) return;
1348 
1350 
1351  // Need to loop over the labels, but we don't want to zap existing cached RawDigits that are valid
1352  // So... do the painful search to make sure the RawDigits we recover at those we are searching for.
1353  bool theDroidIAmLookingFor = false;
1354 
1355  // Loop over labels
1356  for (const auto& rawDataLabel : rawopt->fRawDataLabels) {
1357  // make sure we reset what needs to be reset
1358  // before the operations are initialized;
1359  // we call for reading raw digits; they will be cached, so it's not a waste
1360  details::CacheID_t NewCacheID(evt, rawDataLabel, pid);
1361  GetRawDigits(evt, NewCacheID);
1362 
1363  // Painful check to see if these RawDigits contain the droids we are looking for
1364  for (const auto& rawDigit : digit_cache->Digits()) {
1365  std::vector<geo::WireID> WireIDs = geom->ChannelToWire(rawDigit.Channel());
1366 
1367  for (geo::WireID const& wireID : WireIDs) {
1368  if (wireID.planeID() != pid) continue; // not us!
1369  theDroidIAmLookingFor = true;
1370  break;
1371  } // for wires
1372 
1373  if (theDroidIAmLookingFor) break;
1374  }
1375 
1376  if (theDroidIAmLookingFor) break;
1377  }
1378 
1379  if (!theDroidIAmLookingFor) return;
1380 
1381  bool const hasRoI = hasRegionOfInterest(plane);
1382 
1383  // - if we don't have a RoI yet, we want to get it while we draw
1384  // * if we are zooming into it now, we have to extract it first, then draw
1385  // * if we are not zooming, we can do both at the same time
1386  // - if we have a RoI, we don't want to extract it again
1387  if (!bZoomToRoI) { // we are not required to zoom to the RoI
1388 
1389  std::unique_ptr<OperationBaseClass> operation;
1390 
1391  // we will do the drawing in one pass
1392  MF_LOG_DEBUG("RawDataDrawer") << __func__ << "() setting up one-pass drawing";
1393  operation.reset(new BoxDrawer(detProp, pid, this, view));
1394 
1395  if (!hasRoI) { // we don't have any RoI; since it's cheap, let's get it
1396  MF_LOG_DEBUG("RawDataDrawer") << __func__ << "() adding RoI extraction";
1397 
1398  // swap cards: operation becomes a multiple operation:
1399  // - prepare the two operations (one is there already, somehow)
1400  std::unique_ptr<OperationBaseClass> drawer(std::move(operation));
1401  std::unique_ptr<OperationBaseClass> extractor(new RoIextractorClass(pid, this));
1402  // - create a new composite operation and give it the sub-ops
1403  operation.reset(new ManyOperations(pid, this));
1404  ManyOperations* pManyOps = static_cast<ManyOperations*>(operation.get());
1405  pManyOps->AddOperation(std::move(drawer));
1406  pManyOps->AddOperation(std::move(extractor));
1407  }
1408 
1409  if (!RunOperation(evt, operation.get())) {
1410  throw art::Exception(art::errors::Unknown) << "RawDataDrawer::RunDrawOperation(): "
1411  "somewhere something went somehow wrong";
1412  }
1413  }
1414  else { // we are zooming to RoI
1415  // first, we want the RoI extracted; the extractor will update this object
1416  if (!hasRoI) {
1417  MF_LOG_DEBUG("RawDataDrawer") << __func__ << "() setting up RoI extraction for " << pid;
1418  RoIextractorClass extractor(pid, this);
1419  if (!RunOperation(evt, &extractor)) {
1421  << "RawDataDrawer::RunDrawOperation():"
1422  " something went somehow wrong while extracting RoI";
1423  }
1424  }
1425  else {
1426  MF_LOG_DEBUG("RawDataDrawer")
1427  << __func__ << "() using existing RoI for " << pid << ": wires ( " << fWireMin[plane]
1428  << " - " << fWireMax[plane] << " ), ticks ( " << fTimeMin[plane] << " - "
1429  << fTimeMax[plane] << " )";
1430  }
1431 
1432  // adopt the drawing limits information from the wire/time limits
1434 
1435  // then we draw
1436  MF_LOG_DEBUG("RawDataDrawer") << __func__ << "() setting up drawing";
1437  BoxDrawer drawer(detProp, pid, this, view);
1438  if (!RunOperation(evt, &drawer)) {
1439  throw art::Exception(art::errors::Unknown) << "RawDataDrawer::RunDrawOperation():"
1440  " something went somehow wrong while drawing";
1441  }
1442  }
1443  } // RawDataDrawer::RawDigit2D()
int fDrawRawDataOrCalibWires
0 for raw
void SetDrawingLimitsFromRoI(geo::PlaneID::PlaneID_t plane)
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
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
def move(depos, offset)
Definition: depos.py:107
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.
std::vector< RawDigitInfo_t > const & Digits() const
Returns the list of digit info.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
bool hasRegionOfInterest(geo::PlaneID::PlaneID_t plane) const
friend class BoxDrawer
#define MF_LOG_DEBUG(id)
std::vector< art::InputTag > fRawDataLabels
module label that made the raw digits, default is daq
std::vector< int > fTimeMin
lowest time in interesting region for each plane
::util::PlaneDataChangeTracker_t CacheID_t
Definition: RawDataDrawer.h:35
TCEvent evt
Definition: DataStructs.cxx:7
evd::details::RawDigitCacheDataClass * digit_cache
Cache of raw digits.
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 1737 of file RawDataDrawer.cxx.

1738  {
1739 
1740  MF_LOG_DEBUG("RawDataDrawer") << "RawDataDrawer[" << ((void*)this)
1741  << "]: resetting the region of interest";
1742 
1743  std::fill(fWireMin.begin(), fWireMin.end(), -1);
1744  std::fill(fWireMax.begin(), fWireMax.end(), -1);
1745  std::fill(fTimeMin.begin(), fTimeMin.end(), -1);
1746  std::fill(fTimeMax.begin(), fTimeMax.end(), -1);
1747 
1748  } // 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
def fill(s)
Definition: translator.py:93
#define MF_LOG_DEBUG(id)
std::vector< int > fTimeMin
lowest time in interesting region for each plane
void evd::RawDataDrawer::RunDrawOperation ( art::Event const &  evt,
detinfo::DetectorPropertiesData const &  detProp,
evdb::View2D *  view,
unsigned int  plane 
)
private

Definition at line 1238 of file RawDataDrawer.cxx.

1242  {
1243 
1244  // Check if we're supposed to draw raw hits at all
1246  if (rawopt->fDrawRawDataOrCalibWires == 1) return;
1247 
1248  geo::PlaneID const pid(rawopt->CurrentTPC(), plane);
1249  BoxDrawer drawer(detProp, pid, this, view);
1250  if (!RunOperation(evt, &drawer)) {
1251  throw art::Exception(art::errors::Unknown) << "RawDataDrawer::RunDrawOperation(): "
1252  "somewhere something went somehow wrong";
1253  }
1254 
1255  } // RawDataDrawer::RunDrawOperation()
int fDrawRawDataOrCalibWires
0 for raw
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
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
TCEvent evt
Definition: DataStructs.cxx:7
bool RunOperation(art::Event const &evt, OperationBaseClass *operation)
bool evd::RawDataDrawer::RunOperation ( art::Event const &  evt,
OperationBaseClass operation 
)
private

Definition at line 964 of file RawDataDrawer.cxx.

965  {
966  geo::PlaneID const& pid = operation->PlaneID();
968 
969  if (digit_cache->empty()) return true;
970 
971  MF_LOG_DEBUG("RawDataDrawer") << "RawDataDrawer::RunOperation() running " << operation->Name();
972 
973  // if we have an initialization failure, return false immediately;
974  // but it's way better if the failure throws an exception
975  if (!operation->Initialize()) return false;
976 
977  lariov::ChannelStatusProvider const& channelStatus =
979 
980  //get pedestal conditions
981  const lariov::DetPedestalProvider& pedestalRetrievalAlg =
982  *(lar::providerFrom<lariov::DetPedestalService>());
983 
984  geo::GeometryCore const& geom = *(lar::providerFrom<geo::Geometry>());
985 
986  // loop over all the channels/raw digits
987  for (evd::details::RawDigitInfo_t const& digit_info : *digit_cache) {
988  raw::RawDigit const& hit = digit_info.Digit();
989  raw::ChannelID_t const channel = hit.Channel();
990 
991  // skip the bad channels
992  if (!channelStatus.IsPresent(channel)) continue;
993  // The following test is meant to be temporary until the "correct" solution is implemented
994  if (!ProcessChannelWithStatus(channelStatus.Status(channel))) continue;
995 
996  // we have a list of all channels, but we are drawing only on one plane;
997  // most of the channels will not contribute to this plane,
998  // and before we start querying databases, unpacking data etc.
999  // we want to know it's for something
1000 
1001  std::vector<geo::WireID> WireIDs = geom.ChannelToWire(channel);
1002 
1003  bool bDrawChannel = false;
1004  for (geo::WireID const& wireID : WireIDs) {
1005  if (wireID.planeID() != pid) continue; // not us!
1006  bDrawChannel = true;
1007  break;
1008  } // for wires
1009  if (!bDrawChannel) continue;
1010 
1011  // collect bad channels
1012  bool const bGood = rawopt->fSeeBadChannels || !channelStatus.IsBad(channel);
1013 
1014  // nothing else to be done if the channel is not good:
1015  // cells are marked bad by default and if any good channel falls in any of
1016  // them, they become good
1017  if (!bGood) continue;
1018 
1019  // at this point we know we have to process this channel
1020  raw::RawDigit::ADCvector_t const& uncompressed = digit_info.Data();
1021 
1022  // recover the pedestal
1023  float pedestal = 0;
1024  if (rawopt->fPedestalOption == 0) { pedestal = pedestalRetrievalAlg.PedMean(channel); }
1025  else if (rawopt->fPedestalOption == 1) {
1026  pedestal = hit.GetPedestal();
1027  }
1028  else if (rawopt->fPedestalOption == 2) {
1029  pedestal = 0;
1030  }
1031  else {
1032  mf::LogWarning("RawDataDrawer")
1033  << " PedestalOption is not understood: " << rawopt->fPedestalOption
1034  << ". Pedestals not subtracted.";
1035  }
1036 
1037  // loop over all the wires that are covered by this channel;
1038  // without knowing better, we have to draw into all of them
1039  for (geo::WireID const& wireID : WireIDs) {
1040  // check that the plane and tpc are the correct ones to draw
1041  if (wireID.planeID() != pid) continue; // not us!
1042 
1043  // do we have anything to do with this wire?
1044  if (!operation->ProcessWire(wireID)) continue;
1045 
1046  // get an iterator over the adc values
1047  // accumulate all the data of this wire in our "cells"
1048  size_t const max_tick = std::min({uncompressed.size(), size_t(fStartTick + fTicks)});
1049 
1050  for (size_t iTick = fStartTick; iTick < max_tick; ++iTick) {
1051 
1052  // do we have anything to do with this wire?
1053  if (!operation->ProcessTick(iTick)) continue;
1054 
1055  float const adc = uncompressed[iTick] - pedestal;
1056  //std::cout << "adc, pedestal: " << adc << " " << pedestal << std::endl;
1057 
1058  if (!operation->Operate(wireID, iTick, adc)) return false;
1059 
1060  } // if good
1061  } // for wires
1062  } // for channels
1063 
1064  return operation->Finish();
1065  } // ChannelLooper()
virtual bool IsBad(raw::ChannelID_t channel) const =0
Returns whether the specified channel is bad in the current run.
float GetPedestal() const
Definition: RawDigit.h:214
Collection of charge vs time digitized from a single readout channel.
Definition: RawDigit.h:69
double fStartTick
low tick
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
ChannelID_t Channel() const
DAQ channel this raw data was read from.
Definition: RawDigit.h:212
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
Definition: RawDigit.h:73
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
int16_t adc
Definition: CRTFragment.hh:202
uint8_t channel
Definition: CRTFragment.hh:201
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
virtual Status_t Status(raw::ChannelID_t channel) const
Returns a status integer with arbitrary meaning.
Class providing information about the quality of channels.
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)
virtual bool IsPresent(raw::ChannelID_t channel) const =0
Returns whether the specified channel is physical and connected to wire.
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
bool fSeeBadChannels
Allow "bad" channels to be viewed.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
#define MF_LOG_DEBUG(id)
virtual float PedMean(raw::ChannelID_t ch) const =0
Retrieve pedestal information.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28
evd::details::RawDigitCacheDataClass * digit_cache
Cache of raw digits.
int fPedestalOption
0: use DetPedestalService; 1: Use pedestal in raw::RawDigt; 2: no ped subtraction ...
void evd::RawDataDrawer::RunRoIextractor ( art::Event const &  evt,
unsigned int  plane 
)
private

Definition at line 1309 of file RawDataDrawer.cxx.

1310  {
1312  geo::PlaneID const pid(rawopt->CurrentTPC(), plane);
1313 
1314  // if we have no region of interest, prepare to extract it
1315  bool const bExtractRoI = !hasRegionOfInterest(plane);
1316  MF_LOG_TRACE("RawDataDrawer") << "Region of interest for " << pid
1317  << (bExtractRoI ? " extracted" : " not extracted")
1318  << " on this draw";
1319 
1320  if (!bExtractRoI) return;
1321 
1322  RoIextractorClass Extractor(pid, this);
1323  if (!RunOperation(evt, &Extractor)) {
1324  throw std::runtime_error(
1325  "RawDataDrawer::RunRoIextractor(): somewhere something went somehow wrong");
1326  }
1327 
1328  } // RawDataDrawer::RunRoIextractor()
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
friend class RoIextractorClass
#define MF_LOG_TRACE(id)
geo::TPCID CurrentTPC() const
Returns the current TPC as a TPCID.
bool hasRegionOfInterest(geo::PlaneID::PlaneID_t plane) const
TCEvent evt
Definition: DataStructs.cxx:7
bool RunOperation(art::Event const &evt, OperationBaseClass *operation)
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 730 of file RawDataDrawer.cxx.

731  {
732  MF_LOG_DEBUG("RawDataDrawer") << __func__ << "() setting drawing range as wires ( " << low_wire
733  << " - " << high_wire << " ), ticks ( " << low_tdc << " - "
734  << high_tdc << " )";
735 
736  // we need to set the minimum cell size to 1, otherwise some cell will not
737  // cover any wire/tick and they will be always empty
738  if (PadResolution) {
739  // TODO implement support for swapping axes here
740  unsigned int wire_pixels = PadResolution.width;
741  unsigned int tdc_pixels = PadResolution.height;
742  fDrawingRange->SetWireRange(low_wire, high_wire, wire_pixels, 1.F);
743  fDrawingRange->SetTDCRange(low_tdc, high_tdc, tdc_pixels, 1.F);
744  }
745  else {
746  MF_LOG_DEBUG("RawDataDrawer") << "Pad size not available -- using existing cell size";
747  fDrawingRange->SetWireRange(low_wire, high_wire);
749  fDrawingRange->SetTDCRange(low_tdc, high_tdc);
751  }
752 
753  } // RawDataDrawer::SetDrawingLimits()
void SetWireRange(unsigned int nWires)
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 MF_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 756 of file RawDataDrawer.cxx.

757  {
758  SetDrawingLimits(fWireMin[plane], fWireMax[plane], fTimeMin[plane], fTimeMax[plane]);
759  } // 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 205 of file RawDataDrawer.h.

206  {
208  }
void SetDrawingLimitsFromRoI(geo::PlaneID::PlaneID_t plane)
double evd::RawDataDrawer::StartTick ( ) const
inline

Definition at line 77 of file RawDataDrawer.h.

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

Definition at line 82 of file RawDataDrawer.h.

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

Friends And Related Function Documentation

friend class BoxDrawer
friend

Definition at line 130 of file RawDataDrawer.h.

friend class RoIextractorClass
friend

Definition at line 140 of file RawDataDrawer.h.

Member Data Documentation

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

Cache of raw digits.

Definition at line 144 of file RawDataDrawer.h.

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

Empty collection, used in return value of invalid digits.

Definition at line 211 of file RawDataDrawer.h.

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

information about the last processed plane

Definition at line 170 of file RawDataDrawer.h.

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

Sum of Charge Converted using Birks' formula.

Definition at line 166 of file RawDataDrawer.h.

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

information about the viewport

Definition at line 173 of file RawDataDrawer.h.

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

Sum of Raw Charge.

Definition at line 165 of file RawDataDrawer.h.

double evd::RawDataDrawer::fStartTick
private

low tick

Definition at line 157 of file RawDataDrawer.h.

double evd::RawDataDrawer::fTicks
private

number of ticks of the clock

Definition at line 158 of file RawDataDrawer.h.

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

highest time in interesting region for each plane

Definition at line 163 of file RawDataDrawer.h.

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

lowest time in interesting region for each plane

Definition at line 162 of file RawDataDrawer.h.

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

highest wire in interesting region for each plane

Definition at line 161 of file RawDataDrawer.h.

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

lowest wire in interesting region for each plane

Definition at line 160 of file RawDataDrawer.h.

PadResolution_t evd::RawDataDrawer::PadResolution
private

stored pad resolution

Definition at line 168 of file RawDataDrawer.h.


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