Changes in general code and added class energyhisto for
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
//
|
||||
// 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/numberZBins;
|
||||
EBinWidth = (maxEBin-minEBin)/numberEBins;
|
||||
|
||||
ZBinBoarders.resize(numberZBins+1);
|
||||
for (int i=0;i<numberZBins+1;i++) {
|
||||
ZBinBoarders[i] = ZBinWidth*i; //More fancy with blitz functions?
|
||||
}
|
||||
|
||||
EBinBoarders.resize(numberEBins+3);
|
||||
for (int i=0;i<numberEBins+1;i++) {
|
||||
EBinBoarders[i+1] = minEBin + i*EBinWidth; //More fancy with blitz functions?
|
||||
}
|
||||
};
|
||||
|
||||
int getZBin(double z);
|
||||
|
||||
int getEBin(double E);
|
||||
|
||||
void addContent(double zLow, double zUp, double Energy);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
double ZBinWidth, EBinWidth;
|
||||
blitz::Array <double,1> ZBinBoarders, EBinBoarders;
|
||||
|
||||
blitz::Array<int,2> data;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user