All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SpaceChargeSBND.h
Go to the documentation of this file.
1 #ifndef SPACECHARGE_SPACECHARGESBND_H
2 #define SPACECHARGE_SPACECHARGESBND_H
3 
4 // LArSoft libraries
6 
7 // FHiCL libraries
8 #include "fhiclcpp/ParameterSet.h"
9 
10 // Others
11 #include <string>
12 #include <vector>
13 #include <TGraph.h>
14 #include <TF1.h>
15 #include <TH3.h>
16 #include <TFile.h>
17 
18 namespace spacecharge
19 {
21  {
22 
23  public:
24  explicit SpaceChargeSBND(fhicl::ParameterSet const& pset);
25  SpaceChargeSBND(SpaceChargeSBND const&) = delete;
26  virtual ~SpaceChargeSBND() = default;
27 
28  bool Configure(fhicl::ParameterSet const& pset);
29  bool Update(uint64_t ts = 0);
30 
31  bool EnableSimSpatialSCE() const override;
32  bool EnableSimEfieldSCE() const override;
33  bool EnableCalSpatialSCE() const override;
34  bool EnableCalEfieldSCE() const override;
35 
36  bool EnableCorrSCE() const override {return (EnableCalSpatialSCE()||EnableCalEfieldSCE()) ;}
37 
38  geo::Vector_t GetPosOffsets(geo::Point_t const& point) const override;
39  geo::Vector_t GetEfieldOffsets(geo::Point_t const& point) const override;
40  geo::Vector_t GetCalPosOffsets(geo::Point_t const& point, int const& TPCid = 1) const override;
41  geo::Vector_t GetCalEfieldOffsets(geo::Point_t const& point, int const& TPCid = 1) const override { return {0.,0.,0.}; }
42 
43  private:
44  protected:
45 
46  int initialSpatialFitPolN[3] = {3, 4, 3};
47  int intermediateSpatialFitPolN[3] = {4, 4, 4};
48  int initialEFieldFitPolN[3] = {3, 3, 3};
49  int intermediateEFieldFitPolN[3] = {6, 4, 4};
50  double DriftField = 500.0; // 500 V/cm
51 
57 
58  std::string fRepresentationType;
59  std::string fInputFilename;
60 
61  std::vector<double> GetPosOffsetsParametric(double xVal, double yVal, double zVal) const;
62  double GetOnePosOffsetParametric(double xVal, double yVal, double zVal, std::string axis) const;
63  std::vector<double> GetEfieldOffsetsParametric(double xVal, double yVal, double zVal) const;
64  double GetOneEfieldOffsetParametric(double xVal, double yVal, double zVal, std::string axis) const;
65  double TransformX(double xVal) const;
66  double TransformY(double yVal) const;
67  double TransformZ(double zVal) const;
68  bool IsInsideBoundaries(double xVal, double yVal, double zVal) const;
69 
70  //to store Voxelized_TH3 histograms
71  std::vector<TH3F*> SCEhistograms = std::vector<TH3F*>(9);
72 
73  TGraph *gSpatialGraphX[99][99];
76  TGraph *gSpatialGraphY[99][99];
79  TGraph *gSpatialGraphZ[99][99];
82 
83  TGraph *gEFieldGraphX[99][99];
86  TGraph *gEFieldGraphY[99][99];
89  TGraph *gEFieldGraphZ[99][99];
92 }; // class SpaceChargeSBND
93 } //namespace spacecharge
94 #endif // SPACECHARGE_SPACECHARGESBND_H
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
std::vector< double > GetPosOffsetsParametric(double xVal, double yVal, double zVal) const
bool IsInsideBoundaries(double xVal, double yVal, double zVal) const
geo::Vector_t GetEfieldOffsets(geo::Point_t const &point) const override
bool Configure(fhicl::ParameterSet const &pset)
TGraph * gSpatialGraphY[99][99]
TGraph * gSpatialGraphX[99][99]
double TransformZ(double zVal) const
bool EnableSimEfieldSCE() const override
virtual ~SpaceChargeSBND()=default
bool EnableSimSpatialSCE() const override
SpaceChargeSBND(fhicl::ParameterSet const &pset)
std::vector< double > GetEfieldOffsetsParametric(double xVal, double yVal, double zVal) const
double TransformY(double yVal) const
double GetOneEfieldOffsetParametric(double xVal, double yVal, double zVal, std::string axis) const
double TransformX(double xVal) const
bool EnableCalEfieldSCE() const override
TGraph * gEFieldGraphZ[99][99]
geo::Vector_t GetCalEfieldOffsets(geo::Point_t const &point, int const &TPCid=1) const override
geo::Vector_t GetPosOffsets(geo::Point_t const &point) const override
TGraph * gEFieldGraphX[99][99]
geo::Vector_t GetCalPosOffsets(geo::Point_t const &point, int const &TPCid=1) const override
bool EnableCalSpatialSCE() const override
bool EnableCorrSCE() const override
TGraph * gSpatialGraphZ[99][99]
std::vector< TH3F * > SCEhistograms
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
TGraph * gEFieldGraphY[99][99]
double GetOnePosOffsetParametric(double xVal, double yVal, double zVal, std::string axis) const