#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include "math.h"
#include "stdio.h"
#include "dunesim/SpaceCharge/SpaceChargeProtoDUNEdp.h"
#include "lardata/DetectorInfoServices/DetectorPropertiesService.h"
#include "larcore/CoreUtils/ServiceUtil.h"
#include "larcore/Geometry/Geometry.h"
#include "cetlib_except/exception.h"
#include "art/Framework/Services/Registry/ServiceHandle.h"
#include "TFile.h"
#include "TH3.h"
#include "TTree.h"
#include "TLeaf.h"
Go to the source code of this file.
double ExtrapolateAtEdge |
( |
TH3F * |
hist, |
|
|
double |
x, |
|
|
double |
y, |
|
|
double |
z |
|
) |
| |
Definition at line 318 of file SpaceChargeProtoDUNEdp.cxx.
330 int binx =
hist->GetXaxis()->FindBin(
x);
331 int biny =
hist->GetYaxis()->FindBin(
y);
332 int binz =
hist->GetZaxis()->FindBin(
z);
336 double xcenter =
IsBorder(
hist->GetXaxis(),
x) ?
hist->GetXaxis()->GetBinCenter(binx) :
x;
337 double ycenter =
IsBorder(
hist->GetYaxis(),
y) ?
hist->GetYaxis()->GetBinCenter(biny) :
y;
338 double zcenter =
IsBorder(
hist->GetZaxis(),
z) ?
hist->GetZaxis()->GetBinCenter(binz) :
z;
340 int Nx =
hist->GetXaxis()->GetNbins();
341 int Ny =
hist->GetYaxis()->GetNbins();
342 int Nz =
hist->GetZaxis()->GetNbins();
350 int binx2 = (binx==Nx) ? binx-1 : 2;
351 xcenter = 0.5*(
hist->GetXaxis()->GetBinCenter(binx2)+
x);
354 int biny2 = (biny==Ny) ? biny-1 : 2;
355 ycenter = 0.5*(
hist->GetYaxis()->GetBinCenter(biny2)+
y);
358 int binz2 = (binz==Nz) ? binz-1 : 2;
359 zcenter = 0.5*(
hist->GetZaxis()->GetBinCenter(binz2)+
z);
373 double valb =
hist->Interpolate(xb, yb, zb);
374 double vala =
hist->Interpolate(xa, ya, za);
384 double delta = vala - valb;
390 val =
x*delta/dx + (xa*valb - xb*vala)/dx
391 +
y*delta/dy + (ya*valb - yb*vala)/dy
392 +
z*delta/dz + (za*valb - zb*vala)/dz;
double GetSymmetric(double x, double xc)
bool IsBorder(TAxis *ax, double v)
double GetSymmetric |
( |
double |
x, |
|
|
double |
xc |
|
) |
| |
bool IsBorder |
( |
TAxis * |
ax, |
|
|
double |
v |
|
) |
| |
Definition at line 302 of file SpaceChargeProtoDUNEdp.cxx.
307 if(
ax->GetNbins()==1)
return true;
308 if( v<= ax->GetBinCenter(1) )
return true;
310 if( v>=
ax->GetBinCenter(
ax->GetNbins()) )
return true;
Definition at line 414 of file SpaceChargeProtoDUNEdp.cxx.
416 if(point.X()>
hist->GetXaxis()->GetBinCenter(1) &&
417 point.X()<
hist->GetXaxis()->GetBinCenter(
hist->GetXaxis()->GetNbins()) &&
418 point.Y()>
hist->GetYaxis()->GetBinCenter(1) &&
419 point.Y()<
hist->GetYaxis()->GetBinCenter(
hist->GetYaxis()->GetNbins()) &&
420 point.Z()>
hist->GetZaxis()->GetBinCenter(1) &&
421 point.Z()<
hist->GetZaxis()->GetBinCenter(
hist->GetZaxis()->GetNbins()) ){
Definition at line 400 of file SpaceChargeProtoDUNEdp.cxx.
402 if(point.X()>
hist->GetXaxis()->GetBinLowEdge(0) &&
403 point.X()<
hist->GetXaxis()->GetBinLowEdge(
hist->GetXaxis()->GetNbins()+1) &&
404 point.Y()>
hist->GetYaxis()->GetBinLowEdge(0) &&
405 point.Y()<
hist->GetYaxis()->GetBinLowEdge(
hist->GetYaxis()->GetNbins()+1) &&
406 point.Z()>
hist->GetZaxis()->GetBinLowEdge(0) &&
407 point.Z()<
hist->GetZaxis()->GetBinLowEdge(
hist->GetZaxis()->GetNbins()+1) ){