60 lines
1.2 KiB
C++
60 lines
1.2 KiB
C++
//
|
|
// energyhisto.h
|
|
// mc_electron
|
|
//
|
|
// Created by Christian Reiling on 20.09.18.
|
|
// Copyright © 2018 Christian Reiling. All rights reserved.
|
|
//
|
|
|
|
#ifndef energyhisto_h
|
|
#define energyhisto_h
|
|
|
|
#include <math.h>
|
|
#include <vector>
|
|
#include <iostream>
|
|
#include <fstream>
|
|
#include "blitz/array.h"
|
|
#include "blitz/tinyvec2.h"
|
|
|
|
#include "parameter.h"
|
|
|
|
|
|
class Energyhisto: public Parameter
|
|
{
|
|
public:
|
|
virtual ~Energyhisto(){};
|
|
Energyhisto(){
|
|
data.resize(numberZBins,numberEBins+2); // Under and Overflow Bins
|
|
data = 0;
|
|
|
|
ZBinWidth = wgtsLength_m/numberZBins;
|
|
EBinWidth = (maxEBin-minEBin)/numberEBins;
|
|
|
|
ZBinBoarders_m.resize(numberZBins+1);
|
|
for (int i=0;i<numberZBins+1;i++) {
|
|
ZBinBoarders_m[i] = ZBinWidth*i; //More fancy with blitz functions?
|
|
}
|
|
|
|
EBinBoarders_eV.resize(numberEBins+3);
|
|
for (int i=0;i<numberEBins+1;i++) {
|
|
EBinBoarders_eV[i+1] = minEBin + i*EBinWidth; //More fancy with blitz functions?
|
|
}
|
|
};
|
|
|
|
int getZBin(double z_m);
|
|
|
|
int getEBin(double E_eV);
|
|
|
|
void addContent(double zLow_m, double zUp_m, double Energy_eV);
|
|
|
|
|
|
|
|
private:
|
|
double ZBinWidth, EBinWidth;
|
|
blitz::Array <double,1> ZBinBoarders_m, EBinBoarders_eV;
|
|
|
|
blitz::Array<int,2> data;
|
|
};
|
|
|
|
#endif
|