SpaceChargeDUNE35t.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // \file SpaceChargeDUNE35t.h
3 //
4 // \brief header of class for storing/accessing space charge distortions for DUNE 35ton
5 //
6 // \author mrmooney@bnl.gov
7 //
8 ////////////////////////////////////////////////////////////////////////
9 #ifndef SPACECHARGE_SPACECHARGEDUNE35T_H
10 #define SPACECHARGE_SPACECHARGEDUNE35T_H
11 
12 // LArSoft libraries
14 
15 // FHiCL libraries
16 #include "fhiclcpp/ParameterSet.h"
17 
18 // ROOT includes
19 #include "TGraph.h"
20 #include "TF1.h"
21 #include "TFile.h"
22 
23 // C/C++ standard libraries
24 #include <string>
25 #include <vector>
26 
27 
28 namespace spacecharge {
29 
31 
32  public:
33 
34  explicit SpaceChargeDUNE35t(fhicl::ParameterSet const& pset);
35  SpaceChargeDUNE35t(SpaceChargeDUNE35t const&) = delete;
36  virtual ~SpaceChargeDUNE35t() = default;
37 
38  bool Configure(fhicl::ParameterSet const& pset);
39  bool Update(uint64_t ts=0);
40 
41  bool EnableSimSpatialSCE() const override;
42  bool EnableSimEfieldSCE() const override;
43  bool EnableCalSpatialSCE() const override;
44  bool EnableCalEfieldSCE() const override;
45 
46  bool EnableCorrSCE() const override {return (EnableCalSpatialSCE()||EnableCalEfieldSCE()) ;}
47 
48  geo::Vector_t GetPosOffsets(geo::Point_t const& point) const override;
49  geo::Vector_t GetEfieldOffsets(geo::Point_t const& point) const override;
50  geo::Vector_t GetCalPosOffsets(geo::Point_t const& point, int const& TPCid) const override;
51  geo::Vector_t GetCalEfieldOffsets(geo::Point_t const& point, int const& TPCid) const override;
52 
53  private:
54  protected:
55 
56  std::vector<double> GetPosOffsetsParametric(double xVal, double yVal, double zVal) const;
57  double GetOnePosOffsetParametric(double xVal, double yVal, double zVal, std::string axis) const;
58  std::vector<double> GetEfieldOffsetsParametric(double xVal, double yVal, double zVal) const;
59  double GetOneEfieldOffsetParametric(double xVal, double yVal, double zVal, std::string axis) const;
60  double TransformX(double xVal) const;
61  double TransformY(double yVal) const;
62  double TransformZ(double zVal) const;
63  bool IsInsideBoundaries(double xVal, double yVal, double zVal) const;
64 
70 
73 
74  TGraph **g1_x = new TGraph*[7];
75  TGraph **g2_x = new TGraph*[7];
76  TGraph **g3_x = new TGraph*[7];
77  TGraph **g4_x = new TGraph*[7];
78  TGraph **g5_x = new TGraph*[7];
79 
80  TGraph **g1_y = new TGraph*[7];
81  TGraph **g2_y = new TGraph*[7];
82  TGraph **g3_y = new TGraph*[7];
83  TGraph **g4_y = new TGraph*[7];
84  TGraph **g5_y = new TGraph*[7];
85  TGraph **g6_y = new TGraph*[7];
86 
87  TGraph **g1_z = new TGraph*[7];
88  TGraph **g2_z = new TGraph*[7];
89  TGraph **g3_z = new TGraph*[7];
90  TGraph **g4_z = new TGraph*[7];
91 
92  TF1 *f1_x = new TF1("f1_x","pol6");
93  TF1 *f2_x = new TF1("f2_x","pol6");
94  TF1 *f3_x = new TF1("f3_x","pol6");
95  TF1 *f4_x = new TF1("f4_x","pol6");
96  TF1 *f5_x = new TF1("f5_x","pol6");
97  TF1 *fFinal_x = new TF1("fFinal_x","pol4");
98 
99  TF1 *f1_y = new TF1("f1_y","pol5");
100  TF1 *f2_y = new TF1("f2_y","pol5");
101  TF1 *f3_y = new TF1("f3_y","pol5");
102  TF1 *f4_y = new TF1("f4_y","pol5");
103  TF1 *f5_y = new TF1("f5_y","pol5");
104  TF1 *f6_y = new TF1("f6_y","pol5");
105  TF1 *fFinal_y = new TF1("fFinal_y","pol5");
106 
107  TF1 *f1_z = new TF1("f1_z","pol4");
108  TF1 *f2_z = new TF1("f2_z","pol4");
109  TF1 *f3_z = new TF1("f3_z","pol4");
110  TF1 *f4_z = new TF1("f4_z","pol4");
111  TF1 *fFinal_z = new TF1("fFinal_z","pol3");
112 
113  TGraph **g1_Ex = new TGraph*[7];
114  TGraph **g2_Ex = new TGraph*[7];
115  TGraph **g3_Ex = new TGraph*[7];
116  TGraph **g4_Ex = new TGraph*[7];
117  TGraph **g5_Ex = new TGraph*[7];
118 
119  TGraph **g1_Ey = new TGraph*[7];
120  TGraph **g2_Ey = new TGraph*[7];
121  TGraph **g3_Ey = new TGraph*[7];
122  TGraph **g4_Ey = new TGraph*[7];
123  TGraph **g5_Ey = new TGraph*[7];
124  TGraph **g6_Ey = new TGraph*[7];
125 
126  TGraph **g1_Ez = new TGraph*[7];
127  TGraph **g2_Ez = new TGraph*[7];
128  TGraph **g3_Ez = new TGraph*[7];
129  TGraph **g4_Ez = new TGraph*[7];
130 
131  TF1 *f1_Ex = new TF1("f1_Ex","pol6");
132  TF1 *f2_Ex = new TF1("f2_Ex","pol6");
133  TF1 *f3_Ex = new TF1("f3_Ex","pol6");
134  TF1 *f4_Ex = new TF1("f4_Ex","pol6");
135  TF1 *f5_Ex = new TF1("f5_Ex","pol6");
136  TF1 *fFinal_Ex = new TF1("fFinal_Ex","pol4");
137 
138  TF1 *f1_Ey = new TF1("f1_Ey","pol5");
139  TF1 *f2_Ey = new TF1("f2_Ey","pol5");
140  TF1 *f3_Ey = new TF1("f3_Ey","pol5");
141  TF1 *f4_Ey = new TF1("f4_Ey","pol5");
142  TF1 *f5_Ey = new TF1("f5_Ey","pol5");
143  TF1 *f6_Ey = new TF1("f6_Ey","pol5");
144  TF1 *fFinal_Ey = new TF1("fFinal_Ey","pol5");
145 
146  TF1 *f1_Ez = new TF1("f1_Ez","pol4");
147  TF1 *f2_Ez = new TF1("f2_Ez","pol4");
148  TF1 *f3_Ez = new TF1("f3_Ez","pol4");
149  TF1 *f4_Ez = new TF1("f4_Ez","pol4");
150  TF1 *fFinal_Ez = new TF1("fFinal_Ez","pol3");
151 
152  }; // class SpaceChargeDUNE35t
153 } //namespace spacecharge
154 #endif // SPACECHARGE_SPACECHARGEDUNE35T_H
double TransformX(double xVal) const
Transform X to SCE X coordinate: [2.275,-0.3] –> [0.0,2.25].
virtual ~SpaceChargeDUNE35t()=default
double TransformY(double yVal) const
Transform Y to SCE Y coordinate: [0.0,2.0] –> [0.0,2.0].
std::string string
Definition: nybbler.cc:12
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
bool EnableSimEfieldSCE() const override
std::vector< double > GetPosOffsetsParametric(double xVal, double yVal, double zVal) const
Provides position offsets using a parametric representation.
bool Configure(fhicl::ParameterSet const &pset)
geo::Vector_t GetEfieldOffsets(geo::Point_t const &point) const override
bool EnableSimSpatialSCE() const override
double GetOnePosOffsetParametric(double xVal, double yVal, double zVal, std::string axis) const
SpaceChargeDUNE35t(fhicl::ParameterSet const &pset)
std::vector< double > GetEfieldOffsetsParametric(double xVal, double yVal, double zVal) const
Provides E field offsets using a parametric representation.
bool EnableCorrSCE() const override
geo::Vector_t GetPosOffsets(geo::Point_t const &point) const override
bool EnableCalSpatialSCE() const override
Return boolean indicating whether or not to apply SCE corrections.
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
double GetOneEfieldOffsetParametric(double xVal, double yVal, double zVal, std::string axis) const
geo::Vector_t GetCalPosOffsets(geo::Point_t const &point, int const &TPCid) const override
bool EnableCalEfieldSCE() const override
Return boolean indicating whether or not to apply SCE corrections.
bool IsInsideBoundaries(double xVal, double yVal, double zVal) const
Check to see if point is inside boundaries of map (allow to go slightly out of range) ...
geo::Vector_t GetCalEfieldOffsets(geo::Point_t const &point, int const &TPCid) const override
double TransformZ(double zVal) const
Transform Z to SCE Z coordinate: [0.0,1.6] –> [0.0,1.6].