26 if(reverseViews.size() != 3){
27 std::cout <<
"Expected three views for view reversals... using defaults." <<
std::endl;
50 std::vector<float> v0pe = pm.
fPEX;
51 std::vector<float> v1pe = pm.
fPEY;
52 std::vector<float> v2pe = pm.
fPEZ;
80 for (
unsigned int view = 0; view <
fNViews; ++view){
84 std::vector<float> wireTDCVec;
89 unsigned int element =
time + fPixelMapTDCs * wire;
91 if (
time < fPixelMapTDCs && wire < fPixelMapWires){
97 wireTDCVec.push_back(val);
99 wireTDCVec.push_back(0.);
102 viewChargeVec.push_back(wireTDCVec);
104 if(view == 0) view0 = viewChargeVec;
105 if(view == 1) view1 = viewChargeVec;
106 if(view == 2) view2 = viewChargeVec;
116 std::vector<float> vecCopy(peVec.size(),0.);
121 unsigned int newPlane = fPixelMapWires -
w - 1;
125 float val = peVec[
t + fPixelMapTDCs *
w];
126 vecCopy[
t + fPixelMapTDCs * newPlane] =
val;
131 for(
unsigned int e = 0;
e < peVec.size(); ++
e){
132 float val = vecCopy[
e];
143 for(
unsigned int w = 0;
w < v0.size(); ++
w){
144 std::vector<std::vector<float> > wireVec;
145 for(
unsigned int t = 0;
t < v0[0].size(); ++
t){
146 std::vector<float> timeVec;
147 timeVec.push_back(v0[
w][
t]);
148 timeVec.push_back(v1[
w][t]);
149 timeVec.push_back(v2[
w][t]);
150 wireVec.push_back(timeVec);
152 image.push_back(wireVec);
void ConvertChargeVectorsToViewVectors(std::vector< float > &v0pe, std::vector< float > &v1pe, std::vector< float > &v2pe, ViewVectorF &view0, ViewVectorF &view1, ViewVectorF &view2)
Base function for conversion of the Pixel Map to our required output format.
std::vector< bool > fViewReverse
Vector of bools to decide if any views need to be reversed.
void ReverseView(std::vector< float > &peVec)
Funtion to actually reverse the view.
unsigned int fNTdc
Number of tdcs, width of pixel map.
RegPixelMap, basic input to CNN neural net.
unsigned int fNWire
Number of wires, length of pixel map.
std::vector< float > fPEZ
Vector of Y PE measurements for pixels.
void SetPixelMapSize(unsigned int nWires, unsigned int nTDCs)
Set the input pixel map size.
std::vector< std::vector< float > > ViewVectorF
Useful typedefs.
void SetViewReversal(bool reverseX, bool reverseY, bool reverseZ)
Function to set any views that need reversing.
unsigned int fPixelMapWires
Input pixel map sizes.
std::vector< ViewVectorF > ImageVectorF
std::vector< float > fPEX
Vector of X PE measurements for pixels.
float ConvertToScaledCharge(float charge)
std::vector< float > fPEY
Vector of Y PE measurements for pixels.
Utilities for producing images for the RegCNN.
void ConvertPixelMapToImageVectorF(const RegPixelMap &pm, ImageVectorF &imageVec)
Convert a pixel map into an image vector (float version)
ImageVectorF BuildImageVectorF(ViewVectorF v0, ViewVectorF v1, ViewVectorF v2)
Make the image vector from the view vectors.
unsigned int fNViews
Number of views of each event.
unsigned int fPixelMapTDCs
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.
QTextStream & endl(QTextStream &s)