LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Class containing some utility functions for all things CVN. More...
#include "CVNImageUtils.h"
Public Member Functions | |
CVNImageUtils () | |
CVNImageUtils (unsigned int nWires, unsigned int nTDCs, unsigned int nViews) | |
void | DisableRegionSelection () |
Disable the selection of the wire region and just use the first 500 wires. More... | |
void | EnableRegionSelection () |
Enable the selection of the wire region. More... | |
unsigned char | ConvertChargeToChar (float charge) |
Convert the hit charge into the range 0 to 255 required by the CVN. More... | |
void | SetImageSize (unsigned int nWires, unsigned int nTDCs, unsigned int nViews) |
Set up the image size that we want to have. More... | |
void | SetViewReversal (bool reverseX, bool reverseY, bool reverseZ) |
Function to set any views that need reversing. More... | |
void | SetViewReversal (std::vector< bool > reverseViews) |
void | SetLogScale (bool setLog) |
Set the log scale for charge. More... | |
void | SetPixelMapSize (unsigned int nWires, unsigned int nTDCs) |
Set the input pixel map size. More... | |
void | ConvertPixelMapToPixelArray (const PixelMap &pm, std::vector< unsigned char > &pix) |
Convert a Pixel Map object into a single pixel array with an image size nWire x nTDC. More... | |
void | ConvertChargeVectorsToPixelArray (std::vector< float > &v0pe, std::vector< float > &v1pe, std::vector< float > &v2pe, std::vector< unsigned char > &pix) |
void | ConvertPixelMapToImageVector (const PixelMap &pm, ImageVector &imageVec) |
Convert a pixel map into an image vector (contains all three views) More... | |
void | ConvertPixelMapToImageVectorF (const PixelMap &pm, ImageVectorF &imageVec) |
Convert a pixel map into an image vector (float version) More... | |
void | ConvertChargeVectorsToImageVector (std::vector< float > &v0pe, std::vector< float > &v1pe, std::vector< float > &v2pe, ImageVector &imageVec) |
Convert three adc vectors into an image vector (contains all three views) More... | |
void | ConvertChargeVectorsToImageVectorF (std::vector< float > &v0pe, std::vector< float > &v1pe, std::vector< float > &v2pe, ImageVectorF &imageVec) |
Float version of conversion for convenience of TF interface. More... | |
void | ConvertPixelArrayToImageVectorF (const std::vector< unsigned char > &pixelArray, ImageVectorF &imageVec) |
Convert a pixel array into a ImageVectorF. More... | |
Private Member Functions | |
void | ConvertChargeVectorsToViewVectors (std::vector< float > &v0pe, std::vector< float > &v1pe, std::vector< float > &v2pe, ViewVector &view0, ViewVector &view1, ViewVector &view2) |
Base function for conversion of the Pixel Map to our required output format. More... | |
ImageVector | BuildImageVector (ViewVector &v0, ViewVector &v1, ViewVector &v2) |
Make the image vector from the view vectors. More... | |
ImageVectorF | BuildImageVectorF (ViewVectorF &v0, ViewVectorF &v1, ViewVectorF &v2) |
void | GetMinMaxWires (std::vector< float > &wireCharges, unsigned int &minWire, unsigned int &maxWire) |
Get the minimum and maximum wires from the pixel map needed to make the image. More... | |
void | GetMinMaxTDCs (std::vector< float > &tdcCharges, unsigned int &minTDC, unsigned int &maxTDC) |
Get the minimum and maximum tdcs from the pixel map needed to make the image. More... | |
void | ReverseView (std::vector< float > &peVec) |
Funtion to actually reverse the view. More... | |
ViewVectorF | ConvertViewVecToViewVecF (ViewVector &view) |
Convert a ViewVector into a ViewVectorF. More... | |
ImageVectorF | ConvertImageVecToImageVecF (ImageVector &image) |
Convert a ImageVector into a ImageVectorF. More... | |
Private Attributes | |
unsigned int | fNViews |
Number of views of each event. More... | |
unsigned int | fNWires |
Number of wires to use for the image width. More... | |
unsigned int | fNTDCs |
Number of TDCs to use for the image height. More... | |
unsigned int | fPixelMapWires |
Input pixel map sizes. More... | |
unsigned int | fPixelMapTDCs |
std::vector< bool > | fViewReverse |
Vector of bools to decide if any views need to be reversed. More... | |
bool | fDisableRegionSelection |
Disable the region finding? More... | |
bool | fUseLogScale |
Use a log scale for charge? More... | |
Class containing some utility functions for all things CVN.
Definition at line 23 of file CVNImageUtils.h.
lcvn::CVNImageUtils::CVNImageUtils | ( | ) |
Definition at line 6 of file CVNImageUtils.cxx.
References fDisableRegionSelection, fUseLogScale, fViewReverse, SetImageSize(), and SetPixelMapSize().
lcvn::CVNImageUtils::CVNImageUtils | ( | unsigned int | nWires, |
unsigned int | nTDCs, | ||
unsigned int | nViews | ||
) |
Definition at line 18 of file CVNImageUtils.cxx.
References fDisableRegionSelection, fUseLogScale, SetImageSize(), and SetPixelMapSize().
|
private |
Make the image vector from the view vectors.
Definition at line 490 of file CVNImageUtils.cxx.
References util::size(), and w.
Referenced by ConvertChargeVectorsToImageVector().
|
private |
Definition at line 514 of file CVNImageUtils.cxx.
References util::size(), and w.
Referenced by ConvertChargeVectorsToImageVectorF(), and ConvertPixelArrayToImageVectorF().
unsigned char lcvn::CVNImageUtils::ConvertChargeToChar | ( | float | charge | ) |
Convert the hit charge into the range 0 to 255 required by the CVN.
Definition at line 36 of file CVNImageUtils.cxx.
References fUseLogScale.
Referenced by ConvertChargeVectorsToViewVectors().
void lcvn::CVNImageUtils::ConvertChargeVectorsToImageVector | ( | std::vector< float > & | v0pe, |
std::vector< float > & | v1pe, | ||
std::vector< float > & | v2pe, | ||
lcvn::ImageVector & | imageVec | ||
) |
Convert three adc vectors into an image vector (contains all three views)
Definition at line 165 of file CVNImageUtils.cxx.
References BuildImageVector(), and ConvertChargeVectorsToViewVectors().
Referenced by ConvertPixelMapToImageVector().
void lcvn::CVNImageUtils::ConvertChargeVectorsToImageVectorF | ( | std::vector< float > & | v0pe, |
std::vector< float > & | v1pe, | ||
std::vector< float > & | v2pe, | ||
lcvn::ImageVectorF & | imageVec | ||
) |
Float version of conversion for convenience of TF interface.
Definition at line 182 of file CVNImageUtils.cxx.
References BuildImageVectorF(), ConvertChargeVectorsToViewVectors(), and ConvertViewVecToViewVecF().
Referenced by ConvertPixelMapToImageVectorF().
void lcvn::CVNImageUtils::ConvertChargeVectorsToPixelArray | ( | std::vector< float > & | v0pe, |
std::vector< float > & | v1pe, | ||
std::vector< float > & | v2pe, | ||
std::vector< unsigned char > & | pix | ||
) |
Convert three vectors (sorted in the same way as the vectors in the PixelMap object) into a single pixel array with an image size nWire x nTDC
Definition at line 104 of file CVNImageUtils.cxx.
References ConvertChargeVectorsToViewVectors(), fNTDCs, fNViews, and fNWires.
Referenced by ConvertPixelMapToPixelArray().
|
private |
Base function for conversion of the Pixel Map to our required output format.
Definition at line 204 of file CVNImageUtils.cxx.
References ConvertChargeToChar(), fDisableRegionSelection, fNTDCs, fNViews, fNWires, fPixelMapTDCs, fPixelMapWires, fViewReverse, GetMinMaxTDCs(), GetMinMaxWires(), and ReverseView().
Referenced by ConvertChargeVectorsToImageVector(), ConvertChargeVectorsToImageVectorF(), and ConvertChargeVectorsToPixelArray().
|
private |
Convert a ImageVector into a ImageVectorF.
Definition at line 468 of file CVNImageUtils.cxx.
References util::size(), and w.
void lcvn::CVNImageUtils::ConvertPixelArrayToImageVectorF | ( | const std::vector< unsigned char > & | pixelArray, |
lcvn::ImageVectorF & | imageVec | ||
) |
Convert a pixel array into a ImageVectorF.
Definition at line 313 of file CVNImageUtils.cxx.
References BuildImageVectorF(), fNTDCs, fNViews, fNWires, and w.
void lcvn::CVNImageUtils::ConvertPixelMapToImageVector | ( | const PixelMap & | pm, |
lcvn::ImageVector & | imageVec | ||
) |
Convert a pixel map into an image vector (contains all three views)
Definition at line 137 of file CVNImageUtils.cxx.
References ConvertChargeVectorsToImageVector(), lcvn::PixelMap::fPEX, lcvn::PixelMap::fPEY, lcvn::PixelMap::fPEZ, lcvn::PixelMap::NTdc(), lcvn::PixelMap::NWire(), and SetPixelMapSize().
void lcvn::CVNImageUtils::ConvertPixelMapToImageVectorF | ( | const PixelMap & | pm, |
lcvn::ImageVectorF & | imageVec | ||
) |
Convert a pixel map into an image vector (float version)
Definition at line 151 of file CVNImageUtils.cxx.
References ConvertChargeVectorsToImageVectorF(), lcvn::PixelMap::fPEX, lcvn::PixelMap::fPEY, lcvn::PixelMap::fPEZ, lcvn::PixelMap::NTdc(), lcvn::PixelMap::NWire(), and SetPixelMapSize().
void lcvn::CVNImageUtils::ConvertPixelMapToPixelArray | ( | const PixelMap & | pm, |
std::vector< unsigned char > & | pix | ||
) |
Convert a Pixel Map object into a single pixel array with an image size nWire x nTDC.
Definition at line 90 of file CVNImageUtils.cxx.
References ConvertChargeVectorsToPixelArray(), lcvn::PixelMap::fPEX, lcvn::PixelMap::fPEY, lcvn::PixelMap::fPEZ, lcvn::PixelMap::NTdc(), lcvn::PixelMap::NWire(), and SetPixelMapSize().
Referenced by lcvn::LArNuCVNZlibMaker::write_files().
|
private |
Convert a ViewVector into a ViewVectorF.
Definition at line 451 of file CVNImageUtils.cxx.
References util::size(), and w.
Referenced by ConvertChargeVectorsToImageVectorF().
void lcvn::CVNImageUtils::DisableRegionSelection | ( | ) |
Disable the selection of the wire region and just use the first 500 wires.
Definition at line 26 of file CVNImageUtils.cxx.
References fDisableRegionSelection.
void lcvn::CVNImageUtils::EnableRegionSelection | ( | ) |
Enable the selection of the wire region.
Definition at line 31 of file CVNImageUtils.cxx.
References fDisableRegionSelection.
|
private |
Get the minimum and maximum tdcs from the pixel map needed to make the image.
Definition at line 386 of file CVNImageUtils.cxx.
References fNTDCs.
Referenced by ConvertChargeVectorsToViewVectors().
|
private |
Get the minimum and maximum wires from the pixel map needed to make the image.
Definition at line 340 of file CVNImageUtils.cxx.
References fNWires.
Referenced by ConvertChargeVectorsToViewVectors().
|
private |
Funtion to actually reverse the view.
Definition at line 432 of file CVNImageUtils.cxx.
References fPixelMapTDCs, fPixelMapWires, and w.
Referenced by ConvertChargeVectorsToViewVectors().
void lcvn::CVNImageUtils::SetImageSize | ( | unsigned int | nWires, |
unsigned int | nTDCs, | ||
unsigned int | nViews | ||
) |
Set up the image size that we want to have.
Definition at line 56 of file CVNImageUtils.cxx.
References fNTDCs, fNViews, and fNWires.
Referenced by CVNImageUtils().
void lcvn::CVNImageUtils::SetLogScale | ( | bool | setLog | ) |
Set the log scale for charge.
Definition at line 79 of file CVNImageUtils.cxx.
References fUseLogScale.
Referenced by lcvn::ICVNZlibMaker::beginJob().
void lcvn::CVNImageUtils::SetPixelMapSize | ( | unsigned int | nWires, |
unsigned int | nTDCs | ||
) |
Set the input pixel map size.
Definition at line 84 of file CVNImageUtils.cxx.
References fPixelMapTDCs, and fPixelMapWires.
Referenced by ConvertPixelMapToImageVector(), ConvertPixelMapToImageVectorF(), ConvertPixelMapToPixelArray(), CVNImageUtils(), and lcvn::LArNuCVNZlibMaker::write_files().
void lcvn::CVNImageUtils::SetViewReversal | ( | bool | reverseX, |
bool | reverseY, | ||
bool | reverseZ | ||
) |
Function to set any views that need reversing.
Definition at line 63 of file CVNImageUtils.cxx.
References fViewReverse.
Referenced by lcvn::ICVNZlibMaker::beginJob(), and SetViewReversal().
void lcvn::CVNImageUtils::SetViewReversal | ( | std::vector< bool > | reverseViews | ) |
Definition at line 68 of file CVNImageUtils.cxx.
References SetViewReversal().
|
private |
Disable the region finding?
Definition at line 128 of file CVNImageUtils.h.
Referenced by ConvertChargeVectorsToViewVectors(), CVNImageUtils(), DisableRegionSelection(), and EnableRegionSelection().
|
private |
Number of TDCs to use for the image height.
Definition at line 118 of file CVNImageUtils.h.
Referenced by ConvertChargeVectorsToPixelArray(), ConvertChargeVectorsToViewVectors(), ConvertPixelArrayToImageVectorF(), GetMinMaxTDCs(), and SetImageSize().
|
private |
Number of views of each event.
Definition at line 112 of file CVNImageUtils.h.
Referenced by ConvertChargeVectorsToPixelArray(), ConvertChargeVectorsToViewVectors(), ConvertPixelArrayToImageVectorF(), and SetImageSize().
|
private |
Number of wires to use for the image width.
Definition at line 115 of file CVNImageUtils.h.
Referenced by ConvertChargeVectorsToPixelArray(), ConvertChargeVectorsToViewVectors(), ConvertPixelArrayToImageVectorF(), GetMinMaxWires(), and SetImageSize().
|
private |
Definition at line 122 of file CVNImageUtils.h.
Referenced by ConvertChargeVectorsToViewVectors(), ReverseView(), and SetPixelMapSize().
|
private |
Input pixel map sizes.
Definition at line 121 of file CVNImageUtils.h.
Referenced by ConvertChargeVectorsToViewVectors(), ReverseView(), and SetPixelMapSize().
|
private |
Use a log scale for charge?
Definition at line 131 of file CVNImageUtils.h.
Referenced by ConvertChargeToChar(), CVNImageUtils(), and SetLogScale().
|
private |
Vector of bools to decide if any views need to be reversed.
Definition at line 125 of file CVNImageUtils.h.
Referenced by ConvertChargeVectorsToViewVectors(), CVNImageUtils(), and SetViewReversal().