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) | |
~CVNImageUtils () | |
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 24 of file CVNImageUtils.h.
cvn::CVNImageUtils::CVNImageUtils | ( | ) |
Definition at line 6 of file CVNImageUtils.cxx.
cvn::CVNImageUtils::CVNImageUtils | ( | unsigned int | nWires, |
unsigned int | nTDCs, | ||
unsigned int | nViews | ||
) |
Definition at line 17 of file CVNImageUtils.cxx.
cvn::CVNImageUtils::~CVNImageUtils | ( | ) |
Definition at line 23 of file CVNImageUtils.cxx.
|
private |
|
private |
Definition at line 487 of file CVNImageUtils.cxx.
unsigned char cvn::CVNImageUtils::ConvertChargeToChar | ( | float | charge | ) |
Convert the hit charge into the range 0 to 255 required by the CVN.
Definition at line 35 of file CVNImageUtils.cxx.
void cvn::CVNImageUtils::ConvertChargeVectorsToImageVector | ( | std::vector< float > & | v0pe, |
std::vector< float > & | v1pe, | ||
std::vector< float > & | v2pe, | ||
cvn::ImageVector & | imageVec | ||
) |
Convert three adc vectors into an image vector (contains all three views)
Definition at line 152 of file CVNImageUtils.cxx.
void cvn::CVNImageUtils::ConvertChargeVectorsToImageVectorF | ( | std::vector< float > & | v0pe, |
std::vector< float > & | v1pe, | ||
std::vector< float > & | v2pe, | ||
cvn::ImageVectorF & | imageVec | ||
) |
Float version of conversion for convenience of TF interface.
Definition at line 166 of file CVNImageUtils.cxx.
void cvn::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 96 of file CVNImageUtils.cxx.
|
private |
Base function for conversion of the Pixel Map to our required output format.
Definition at line 186 of file CVNImageUtils.cxx.
|
private |
void cvn::CVNImageUtils::ConvertPixelArrayToImageVectorF | ( | const std::vector< unsigned char > & | pixelArray, |
cvn::ImageVectorF & | imageVec | ||
) |
Convert a pixel array into a ImageVectorF.
Definition at line 295 of file CVNImageUtils.cxx.
void cvn::CVNImageUtils::ConvertPixelMapToImageVector | ( | const PixelMap & | pm, |
cvn::ImageVector & | imageVec | ||
) |
Convert a pixel map into an image vector (contains all three views)
Definition at line 128 of file CVNImageUtils.cxx.
void cvn::CVNImageUtils::ConvertPixelMapToImageVectorF | ( | const PixelMap & | pm, |
cvn::ImageVectorF & | imageVec | ||
) |
Convert a pixel map into an image vector (float version)
Definition at line 140 of file CVNImageUtils.cxx.
void cvn::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 82 of file CVNImageUtils.cxx.
|
private |
void cvn::CVNImageUtils::DisableRegionSelection | ( | ) |
Disable the selection of the wire region and just use the first 500 wires.
Definition at line 27 of file CVNImageUtils.cxx.
void cvn::CVNImageUtils::EnableRegionSelection | ( | ) |
Enable the selection of the wire region.
Definition at line 31 of file CVNImageUtils.cxx.
|
private |
Get the minimum and maximum tdcs from the pixel map needed to make the image.
Definition at line 365 of file CVNImageUtils.cxx.
|
private |
Get the minimum and maximum wires from the pixel map needed to make the image.
Definition at line 320 of file CVNImageUtils.cxx.
|
private |
Funtion to actually reverse the view.
Definition at line 411 of file CVNImageUtils.cxx.
void cvn::CVNImageUtils::SetImageSize | ( | unsigned int | nWires, |
unsigned int | nTDCs, | ||
unsigned int | nViews | ||
) |
Set up the image size that we want to have.
Definition at line 53 of file CVNImageUtils.cxx.
void cvn::CVNImageUtils::SetLogScale | ( | bool | setLog | ) |
Set the log scale for charge.
Definition at line 73 of file CVNImageUtils.cxx.
void cvn::CVNImageUtils::SetPixelMapSize | ( | unsigned int | nWires, |
unsigned int | nTDCs | ||
) |
Set the input pixel map size.
Definition at line 77 of file CVNImageUtils.cxx.
Function to set any views that need reversing.
Definition at line 59 of file CVNImageUtils.cxx.
void cvn::CVNImageUtils::SetViewReversal | ( | std::vector< bool > | reverseViews | ) |
Definition at line 63 of file CVNImageUtils.cxx.
|
private |
Disable the region finding?
Definition at line 119 of file CVNImageUtils.h.
|
private |
Number of TDCs to use for the image height.
Definition at line 109 of file CVNImageUtils.h.
|
private |
Number of views of each event.
Definition at line 103 of file CVNImageUtils.h.
|
private |
Number of wires to use for the image width.
Definition at line 106 of file CVNImageUtils.h.
|
private |
Definition at line 113 of file CVNImageUtils.h.
|
private |
Input pixel map sizes.
Definition at line 112 of file CVNImageUtils.h.
|
private |
Use a log scale for charge?
Definition at line 122 of file CVNImageUtils.h.
|
private |
Vector of bools to decide if any views need to be reversed.
Definition at line 116 of file CVNImageUtils.h.