Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
spacecharge::SpaceCharge3x1x1dphase Class Reference

#include <SpaceCharge3x1x1dphase.h>

Inheritance diagram for spacecharge::SpaceCharge3x1x1dphase:
spacecharge::SpaceCharge

Public Member Functions

 SpaceCharge3x1x1dphase (fhicl::ParameterSet const &pset)
 
 SpaceCharge3x1x1dphase (SpaceCharge3x1x1dphase const &)=delete
 
virtual ~SpaceCharge3x1x1dphase ()=default
 
bool Configure (fhicl::ParameterSet const &pset)
 
bool Update (uint64_t ts=0)
 
bool EnableSimSpatialSCE () const override
 
bool EnableSimEfieldSCE () const override
 
bool EnableCalSpatialSCE () const override
 Return boolean indicating whether or not to apply SCE corrections. More...
 
bool EnableCalEfieldSCE () const override
 Return boolean indicating whether or not to apply SCE corrections. More...
 
bool EnableCorrSCE () const override
 
geo::Vector_t GetPosOffsets (geo::Point_t const &point) const override
 
geo::Vector_t GetEfieldOffsets (geo::Point_t const &point) const override
 
geo::Vector_t GetCalPosOffsets (geo::Point_t const &point, int const &TPCid) const override
 
geo::Vector_t GetCalEfieldOffsets (geo::Point_t const &point, int const &TPCid) const override
 
- Public Member Functions inherited from spacecharge::SpaceCharge
 SpaceCharge (const SpaceCharge &)=delete
 
 SpaceCharge (SpaceCharge &&)=delete
 
SpaceChargeoperator= (const SpaceCharge &)=delete
 
SpaceChargeoperator= (SpaceCharge &&)=delete
 
virtual ~SpaceCharge ()=default
 

Protected Member Functions

std::vector< double > GetPosOffsetsParametric (double xVal, double yVal, double zVal) const
 Provides position offsets using a parametric representation. More...
 
double GetOnePosOffsetParametric (double xVal, double yVal, double zVal, std::string axis) const
 
std::vector< double > GetEfieldOffsetsParametric (double xVal, double yVal, double zVal) const
 Provides E field offsets using a parametric representation. More...
 
double GetOneEfieldOffsetParametric (double xVal, double yVal, double zVal, std::string axis) const
 
double TransformX (double xVal) const
 Transform X to SCE X coordinate: [0.0,3.6] –> [0.0,3.6]. More...
 
double TransformY (double yVal) const
 Transform Y to SCE Y coordinate: [0.0,6.08] –> [0.0,6.0]. More...
 
double TransformZ (double zVal) const
 Transform Z to SCE Z coordinate: [0.0,6.97] –> [0.0,7.2]. More...
 
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) More...
 
- Protected Member Functions inherited from spacecharge::SpaceCharge
 SpaceCharge ()=default
 

Protected Attributes

bool fEnableSimSpatialSCE
 
bool fEnableSimEfieldSCE
 
bool fEnableCalSpatialSCE
 
bool fEnableCalEfieldSCE
 
bool fEnableCorrSCE
 
std::string fRepresentationType
 
std::string fInputFilename
 
TGraph ** g1_x = new TGraph*[7]
 
TGraph ** g2_x = new TGraph*[7]
 
TGraph ** g3_x = new TGraph*[7]
 
TGraph ** g4_x = new TGraph*[7]
 
TGraph ** g5_x = new TGraph*[7]
 
TGraph ** g1_y = new TGraph*[7]
 
TGraph ** g2_y = new TGraph*[7]
 
TGraph ** g3_y = new TGraph*[7]
 
TGraph ** g4_y = new TGraph*[7]
 
TGraph ** g5_y = new TGraph*[7]
 
TGraph ** g6_y = new TGraph*[7]
 
TGraph ** g1_z = new TGraph*[7]
 
TGraph ** g2_z = new TGraph*[7]
 
TGraph ** g3_z = new TGraph*[7]
 
TGraph ** g4_z = new TGraph*[7]
 
TF1 * f1_x = new TF1("f1_x","pol6")
 
TF1 * f2_x = new TF1("f2_x","pol6")
 
TF1 * f3_x = new TF1("f3_x","pol6")
 
TF1 * f4_x = new TF1("f4_x","pol6")
 
TF1 * f5_x = new TF1("f5_x","pol6")
 
TF1 * fFinal_x = new TF1("fFinal_x","pol4")
 
TF1 * f1_y = new TF1("f1_y","pol5")
 
TF1 * f2_y = new TF1("f2_y","pol5")
 
TF1 * f3_y = new TF1("f3_y","pol5")
 
TF1 * f4_y = new TF1("f4_y","pol5")
 
TF1 * f5_y = new TF1("f5_y","pol5")
 
TF1 * f6_y = new TF1("f6_y","pol5")
 
TF1 * fFinal_y = new TF1("fFinal_y","pol5")
 
TF1 * f1_z = new TF1("f1_z","pol4")
 
TF1 * f2_z = new TF1("f2_z","pol4")
 
TF1 * f3_z = new TF1("f3_z","pol4")
 
TF1 * f4_z = new TF1("f4_z","pol4")
 
TF1 * fFinal_z = new TF1("fFinal_z","pol3")
 
TGraph ** g1_Ex = new TGraph*[7]
 
TGraph ** g2_Ex = new TGraph*[7]
 
TGraph ** g3_Ex = new TGraph*[7]
 
TGraph ** g4_Ex = new TGraph*[7]
 
TGraph ** g5_Ex = new TGraph*[7]
 
TGraph ** g1_Ey = new TGraph*[7]
 
TGraph ** g2_Ey = new TGraph*[7]
 
TGraph ** g3_Ey = new TGraph*[7]
 
TGraph ** g4_Ey = new TGraph*[7]
 
TGraph ** g5_Ey = new TGraph*[7]
 
TGraph ** g6_Ey = new TGraph*[7]
 
TGraph ** g1_Ez = new TGraph*[7]
 
TGraph ** g2_Ez = new TGraph*[7]
 
TGraph ** g3_Ez = new TGraph*[7]
 
TGraph ** g4_Ez = new TGraph*[7]
 
TF1 * f1_Ex = new TF1("f1_Ex","pol6")
 
TF1 * f2_Ex = new TF1("f2_Ex","pol6")
 
TF1 * f3_Ex = new TF1("f3_Ex","pol6")
 
TF1 * f4_Ex = new TF1("f4_Ex","pol6")
 
TF1 * f5_Ex = new TF1("f5_Ex","pol6")
 
TF1 * fFinal_Ex = new TF1("fFinal_Ex","pol4")
 
TF1 * f1_Ey = new TF1("f1_Ey","pol5")
 
TF1 * f2_Ey = new TF1("f2_Ey","pol5")
 
TF1 * f3_Ey = new TF1("f3_Ey","pol5")
 
TF1 * f4_Ey = new TF1("f4_Ey","pol5")
 
TF1 * f5_Ey = new TF1("f5_Ey","pol5")
 
TF1 * f6_Ey = new TF1("f6_Ey","pol5")
 
TF1 * fFinal_Ey = new TF1("fFinal_Ey","pol5")
 
TF1 * f1_Ez = new TF1("f1_Ez","pol4")
 
TF1 * f2_Ez = new TF1("f2_Ez","pol4")
 
TF1 * f3_Ez = new TF1("f3_Ez","pol4")
 
TF1 * f4_Ez = new TF1("f4_Ez","pol4")
 
TF1 * fFinal_Ez = new TF1("fFinal_Ez","pol3")
 

Detailed Description

Definition at line 31 of file SpaceCharge3x1x1dphase.h.

Constructor & Destructor Documentation

spacecharge::SpaceCharge3x1x1dphase::SpaceCharge3x1x1dphase ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 26 of file SpaceCharge3x1x1dphase.cxx.

29 {
30  Configure(pset);
31 }
bool Configure(fhicl::ParameterSet const &pset)
spacecharge::SpaceCharge3x1x1dphase::SpaceCharge3x1x1dphase ( SpaceCharge3x1x1dphase const &  )
delete
virtual spacecharge::SpaceCharge3x1x1dphase::~SpaceCharge3x1x1dphase ( )
virtualdefault

Member Function Documentation

bool spacecharge::SpaceCharge3x1x1dphase::Configure ( fhicl::ParameterSet const &  pset)

Definition at line 34 of file SpaceCharge3x1x1dphase.cxx.

35 {
36  fEnableSimSpatialSCE = pset.get<bool>("EnableSimSpatialSCE");
37  fEnableSimEfieldSCE = pset.get<bool>("EnableSimEfieldSCE");
38  fEnableCalSpatialSCE = pset.get<bool>("EnableCalSpatialSCE");
39  fEnableCalEfieldSCE = pset.get<bool>("EnableCalEfieldSCE");
40  //fEnableCorrSCE = pset.get<bool>("EnableCorrSCE");
41 
42  if((fEnableSimSpatialSCE == true) || (fEnableSimEfieldSCE == true))
43  {
44  fRepresentationType = pset.get<std::string>("RepresentationType");
45  fInputFilename = pset.get<std::string>("InputFilename");
46 
48  cet::search_path sp("FW_SEARCH_PATH");
49  sp.find_file(fInputFilename,fname);
50 
51  std::unique_ptr<TFile> infile(new TFile(fname.c_str(), "READ"));
52  if(!infile->IsOpen()) throw cet::exception("SpaceCharge3x1x1dphase") << "Could not find the space charge effect file '" << fname << "'!\n";
53 
54  if(fRepresentationType == "Parametric")
55  {
56  for(int i = 0; i < 5; i++)
57  {
58  g1_x[i] = (TGraph*)infile->Get(Form("deltaX/g1_%d",i));
59  g2_x[i] = (TGraph*)infile->Get(Form("deltaX/g2_%d",i));
60  g3_x[i] = (TGraph*)infile->Get(Form("deltaX/g3_%d",i));
61  g4_x[i] = (TGraph*)infile->Get(Form("deltaX/g4_%d",i));
62  g5_x[i] = (TGraph*)infile->Get(Form("deltaX/g5_%d",i));
63 
64  g1_y[i] = (TGraph*)infile->Get(Form("deltaY/g1_%d",i));
65  g2_y[i] = (TGraph*)infile->Get(Form("deltaY/g2_%d",i));
66  g3_y[i] = (TGraph*)infile->Get(Form("deltaY/g3_%d",i));
67  g4_y[i] = (TGraph*)infile->Get(Form("deltaY/g4_%d",i));
68  g5_y[i] = (TGraph*)infile->Get(Form("deltaY/g5_%d",i));
69  g6_y[i] = (TGraph*)infile->Get(Form("deltaY/g6_%d",i));
70 
71  g1_z[i] = (TGraph*)infile->Get(Form("deltaZ/g1_%d",i));
72  g2_z[i] = (TGraph*)infile->Get(Form("deltaZ/g2_%d",i));
73  g3_z[i] = (TGraph*)infile->Get(Form("deltaZ/g3_%d",i));
74  g4_z[i] = (TGraph*)infile->Get(Form("deltaZ/g4_%d",i));
75 
76  g1_Ex[i] = (TGraph*)infile->Get(Form("deltaExOverE/g1_%d",i));
77  g2_Ex[i] = (TGraph*)infile->Get(Form("deltaExOverE/g2_%d",i));
78  g3_Ex[i] = (TGraph*)infile->Get(Form("deltaExOverE/g3_%d",i));
79  g4_Ex[i] = (TGraph*)infile->Get(Form("deltaExOverE/g4_%d",i));
80  g5_Ex[i] = (TGraph*)infile->Get(Form("deltaExOverE/g5_%d",i));
81 
82  g1_Ey[i] = (TGraph*)infile->Get(Form("deltaEyOverE/g1_%d",i));
83  g2_Ey[i] = (TGraph*)infile->Get(Form("deltaEyOverE/g2_%d",i));
84  g3_Ey[i] = (TGraph*)infile->Get(Form("deltaEyOverE/g3_%d",i));
85  g4_Ey[i] = (TGraph*)infile->Get(Form("deltaEyOverE/g4_%d",i));
86  g5_Ey[i] = (TGraph*)infile->Get(Form("deltaEyOverE/g5_%d",i));
87  g6_Ey[i] = (TGraph*)infile->Get(Form("deltaEyOverE/g6_%d",i));
88 
89  g1_Ez[i] = (TGraph*)infile->Get(Form("deltaEzOverE/g1_%d",i));
90  g2_Ez[i] = (TGraph*)infile->Get(Form("deltaEzOverE/g2_%d",i));
91  g3_Ez[i] = (TGraph*)infile->Get(Form("deltaEzOverE/g3_%d",i));
92  g4_Ez[i] = (TGraph*)infile->Get(Form("deltaEzOverE/g4_%d",i));
93  }
94 
95  g1_x[5] = (TGraph*)infile->Get("deltaX/g1_5");
96  g2_x[5] = (TGraph*)infile->Get("deltaX/g2_5");
97  g3_x[5] = (TGraph*)infile->Get("deltaX/g3_5");
98  g4_x[5] = (TGraph*)infile->Get("deltaX/g4_5");
99  g5_x[5] = (TGraph*)infile->Get("deltaX/g5_5");
100 
101  g1_y[5] = (TGraph*)infile->Get("deltaY/g1_5");
102  g2_y[5] = (TGraph*)infile->Get("deltaY/g2_5");
103  g3_y[5] = (TGraph*)infile->Get("deltaY/g3_5");
104  g4_y[5] = (TGraph*)infile->Get("deltaY/g4_5");
105  g5_y[5] = (TGraph*)infile->Get("deltaY/g5_5");
106  g6_y[5] = (TGraph*)infile->Get("deltaY/g6_5");
107 
108  g1_x[6] = (TGraph*)infile->Get("deltaX/g1_6");
109  g2_x[6] = (TGraph*)infile->Get("deltaX/g2_6");
110  g3_x[6] = (TGraph*)infile->Get("deltaX/g3_6");
111  g4_x[6] = (TGraph*)infile->Get("deltaX/g4_6");
112  g5_x[6] = (TGraph*)infile->Get("deltaX/g5_6");
113 
114  g1_Ex[5] = (TGraph*)infile->Get("deltaExOverE/g1_5");
115  g2_Ex[5] = (TGraph*)infile->Get("deltaExOverE/g2_5");
116  g3_Ex[5] = (TGraph*)infile->Get("deltaExOverE/g3_5");
117  g4_Ex[5] = (TGraph*)infile->Get("deltaExOverE/g4_5");
118  g5_Ex[5] = (TGraph*)infile->Get("deltaExOverE/g5_5");
119 
120  g1_Ey[5] = (TGraph*)infile->Get("deltaEyOverE/g1_5");
121  g2_Ey[5] = (TGraph*)infile->Get("deltaEyOverE/g2_5");
122  g3_Ey[5] = (TGraph*)infile->Get("deltaEyOverE/g3_5");
123  g4_Ey[5] = (TGraph*)infile->Get("deltaEyOverE/g4_5");
124  g5_Ey[5] = (TGraph*)infile->Get("deltaEyOverE/g5_5");
125  g6_Ey[5] = (TGraph*)infile->Get("deltaEyOverE/g6_5");
126 
127  g1_Ex[6] = (TGraph*)infile->Get("deltaExOverE/g1_6");
128  g2_Ex[6] = (TGraph*)infile->Get("deltaExOverE/g2_6");
129  g3_Ex[6] = (TGraph*)infile->Get("deltaExOverE/g3_6");
130  g4_Ex[6] = (TGraph*)infile->Get("deltaExOverE/g4_6");
131  g5_Ex[6] = (TGraph*)infile->Get("deltaExOverE/g5_6");
132  }
133 
134  infile->Close();
135  }
136 
137  if(fEnableCorrSCE == true)
138  {
139  // Grab other parameters from pset
140  }
141 
142  return true;
143 }
std::string string
Definition: nybbler.cc:12
string infile
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
bool spacecharge::SpaceCharge3x1x1dphase::EnableCalEfieldSCE ( ) const
overridevirtual

Return boolean indicating whether or not to apply SCE corrections.

Implements spacecharge::SpaceCharge.

Definition at line 183 of file SpaceCharge3x1x1dphase.cxx.

bool spacecharge::SpaceCharge3x1x1dphase::EnableCalSpatialSCE ( ) const
overridevirtual

Return boolean indicating whether or not to apply SCE corrections.

Return boolean indicating whether or not to apply SCE corrections

Implements spacecharge::SpaceCharge.

Definition at line 177 of file SpaceCharge3x1x1dphase.cxx.

bool spacecharge::SpaceCharge3x1x1dphase::EnableCorrSCE ( ) const
inlineoverridevirtual

Implements spacecharge::SpaceCharge.

Definition at line 47 of file SpaceCharge3x1x1dphase.h.

bool EnableCalSpatialSCE() const override
Return boolean indicating whether or not to apply SCE corrections.
bool EnableCalEfieldSCE() const override
Return boolean indicating whether or not to apply SCE corrections.
bool spacecharge::SpaceCharge3x1x1dphase::EnableSimEfieldSCE ( ) const
overridevirtual

Return boolean indicating whether or not to turn simulation of SCE on for E field distortions

Implements spacecharge::SpaceCharge.

Definition at line 164 of file SpaceCharge3x1x1dphase.cxx.

bool spacecharge::SpaceCharge3x1x1dphase::EnableSimSpatialSCE ( ) const
overridevirtual

Return boolean indicating whether or not to turn simulation of SCE on for spatial distortions

Implements spacecharge::SpaceCharge.

Definition at line 156 of file SpaceCharge3x1x1dphase.cxx.

geo::Vector_t spacecharge::SpaceCharge3x1x1dphase::GetCalEfieldOffsets ( geo::Point_t const &  point,
int const &  TPCid 
) const
overridevirtual

Implements spacecharge::SpaceCharge.

Definition at line 374 of file SpaceCharge3x1x1dphase.cxx.

375 {
376  return { 0.0, 0.0, 0.0 };
377 }
geo::Vector_t spacecharge::SpaceCharge3x1x1dphase::GetCalPosOffsets ( geo::Point_t const &  point,
int const &  TPCid 
) const
overridevirtual

Implements spacecharge::SpaceCharge.

Definition at line 210 of file SpaceCharge3x1x1dphase.cxx.

211 {
212  return { 0.0, 0.0, 0.0 };
213 }
geo::Vector_t spacecharge::SpaceCharge3x1x1dphase::GetEfieldOffsets ( geo::Point_t const &  point) const
overridevirtual

Primary working method of service that provides E field offsets to be used in charge/light yield calculation (e.g.)

Implements spacecharge::SpaceCharge.

Definition at line 355 of file SpaceCharge3x1x1dphase.cxx.

356 {
357  std::vector<double> theEfieldOffsets;
358 
359  if(IsInsideBoundaries(point.X(), point.Y(), point.Z()) == false)
360  {
361  theEfieldOffsets.resize(3,0.0);
362  }
363  else
364  {
365  if(fRepresentationType == "Parametric")
366  theEfieldOffsets = GetEfieldOffsetsParametric(point.X(), point.Y(), point.Z());
367  else
368  theEfieldOffsets.resize(3,0.0);
369  }
370 
371  return { -theEfieldOffsets[0], -theEfieldOffsets[1], -theEfieldOffsets[2] };
372 }
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) ...
std::vector< double > GetEfieldOffsetsParametric(double xVal, double yVal, double zVal) const
Provides E field offsets using a parametric representation.
std::vector< double > spacecharge::SpaceCharge3x1x1dphase::GetEfieldOffsetsParametric ( double  xVal,
double  yVal,
double  zVal 
) const
protected

Provides E field offsets using a parametric representation.

Definition at line 381 of file SpaceCharge3x1x1dphase.cxx.

382 {
383  std::vector<double> theEfieldOffsetsParametric;
384 
385  double xValNew = TransformX(xVal);
386  double yValNew = TransformY(yVal);
387  double zValNew = TransformZ(zVal);
388 
389  theEfieldOffsetsParametric.push_back(GetOneEfieldOffsetParametric(xValNew,yValNew,zValNew,"X"));
390  theEfieldOffsetsParametric.push_back(GetOneEfieldOffsetParametric(xValNew,yValNew,zValNew,"Y"));
391  theEfieldOffsetsParametric.push_back(GetOneEfieldOffsetParametric(xValNew,yValNew,zValNew,"Z"));
392 
393  return theEfieldOffsetsParametric;
394 }
double TransformZ(double zVal) const
Transform Z to SCE Z coordinate: [0.0,6.97] –> [0.0,7.2].
double GetOneEfieldOffsetParametric(double xVal, double yVal, double zVal, std::string axis) const
double TransformY(double yVal) const
Transform Y to SCE Y coordinate: [0.0,6.08] –> [0.0,6.0].
double TransformX(double xVal) const
Transform X to SCE X coordinate: [0.0,3.6] –> [0.0,3.6].
double spacecharge::SpaceCharge3x1x1dphase::GetOneEfieldOffsetParametric ( double  xValNew,
double  yValNew,
double  zValNew,
std::string  axis 
) const
protected

Provides one E field offset using a parametric representation, for a given axis

Definition at line 399 of file SpaceCharge3x1x1dphase.cxx.

400 {
401  double parA[6][7];
402  double parB[6];
403 
404  for(int j = 0; j < 6; j++)
405  {
406  for(int i = 0; i < 7; i++)
407  parA[j][i] = 0.0;
408 
409  parB[j] = 0.0;
410  }
411 
412  if(axis == "X")
413  {
414  for(int j = 0; j < 7; j++)
415  {
416  parA[0][j] = g1_Ex[j]->Eval(zValNew);
417  parA[1][j] = g2_Ex[j]->Eval(zValNew);
418  parA[2][j] = g3_Ex[j]->Eval(zValNew);
419  parA[3][j] = g4_Ex[j]->Eval(zValNew);
420  parA[4][j] = g5_Ex[j]->Eval(zValNew);
421  }
422 
423  f1_Ex->SetParameters(parA[0]);
424  f2_Ex->SetParameters(parA[1]);
425  f3_Ex->SetParameters(parA[2]);
426  f4_Ex->SetParameters(parA[3]);
427  f5_Ex->SetParameters(parA[4]);
428  }
429  else if(axis == "Y")
430  {
431  for(int j = 0; j < 6; j++)
432  {
433  parA[0][j] = g1_Ey[j]->Eval(zValNew);
434  parA[1][j] = g2_Ey[j]->Eval(zValNew);
435  parA[2][j] = g3_Ey[j]->Eval(zValNew);
436  parA[3][j] = g4_Ey[j]->Eval(zValNew);
437  parA[4][j] = g5_Ey[j]->Eval(zValNew);
438  parA[5][j] = g6_Ey[j]->Eval(zValNew);
439  }
440 
441  f1_Ey->SetParameters(parA[0]);
442  f2_Ey->SetParameters(parA[1]);
443  f3_Ey->SetParameters(parA[2]);
444  f4_Ey->SetParameters(parA[3]);
445  f5_Ey->SetParameters(parA[4]);
446  f6_Ey->SetParameters(parA[5]);
447  }
448  else if(axis == "Z")
449  {
450  for(int j = 0; j < 5; j++)
451  {
452  parA[0][j] = g1_Ez[j]->Eval(zValNew);
453  parA[1][j] = g2_Ez[j]->Eval(zValNew);
454  parA[2][j] = g3_Ez[j]->Eval(zValNew);
455  parA[3][j] = g4_Ez[j]->Eval(zValNew);
456  }
457 
458  f1_Ez->SetParameters(parA[0]);
459  f2_Ez->SetParameters(parA[1]);
460  f3_Ez->SetParameters(parA[2]);
461  f4_Ez->SetParameters(parA[3]);
462  }
463 
464  double aValNew;
465  double bValNew;
466 
467  if(axis == "Y")
468  {
469  aValNew = xValNew;
470  bValNew = yValNew;
471  }
472  else
473  {
474  aValNew = yValNew;
475  bValNew = xValNew;
476  }
477 
478  double offsetValNew = 0.0;
479  if(axis == "X")
480  {
481  parB[0] = f1_Ex->Eval(aValNew);
482  parB[1] = f2_Ex->Eval(aValNew);
483  parB[2] = f3_Ex->Eval(aValNew);
484  parB[3] = f4_Ex->Eval(aValNew);
485  parB[4] = f5_Ex->Eval(aValNew);
486 
487  fFinal_Ex->SetParameters(parB);
488  offsetValNew = fFinal_Ex->Eval(bValNew);
489  }
490  else if(axis == "Y")
491  {
492  parB[0] = f1_Ey->Eval(aValNew);
493  parB[1] = f2_Ey->Eval(aValNew);
494  parB[2] = f3_Ey->Eval(aValNew);
495  parB[3] = f4_Ey->Eval(aValNew);
496  parB[4] = f5_Ey->Eval(aValNew);
497  parB[5] = f6_Ey->Eval(aValNew);
498 
499  fFinal_Ey->SetParameters(parB);
500  offsetValNew = fFinal_Ey->Eval(bValNew);
501  }
502  else if(axis == "Z")
503  {
504  parB[0] = f1_Ez->Eval(aValNew);
505  parB[1] = f2_Ez->Eval(aValNew);
506  parB[2] = f3_Ez->Eval(aValNew);
507  parB[3] = f4_Ez->Eval(aValNew);
508 
509  fFinal_Ez->SetParameters(parB);
510  offsetValNew = fFinal_Ez->Eval(bValNew);
511  }
512 
513  return offsetValNew;
514 }
double spacecharge::SpaceCharge3x1x1dphase::GetOnePosOffsetParametric ( double  xValNew,
double  yValNew,
double  zValNew,
std::string  axis 
) const
protected

Provides one position offset using a parametric representation, for a given axis

Definition at line 235 of file SpaceCharge3x1x1dphase.cxx.

236 {
237  double parA[6][7];
238  double parB[6];
239 
240  for(int j = 0; j < 6; j++)
241  {
242  for(int i = 0; i < 7; i++)
243  parA[j][i] = 0.0;
244 
245  parB[j] = 0.0;
246  }
247 
248  if(axis == "X")
249  {
250  for(int j = 0; j < 7; j++)
251  {
252  parA[0][j] = g1_x[j]->Eval(zValNew);
253  parA[1][j] = g2_x[j]->Eval(zValNew);
254  parA[2][j] = g3_x[j]->Eval(zValNew);
255  parA[3][j] = g4_x[j]->Eval(zValNew);
256  parA[4][j] = g5_x[j]->Eval(zValNew);
257  }
258 
259  f1_x->SetParameters(parA[0]);
260  f2_x->SetParameters(parA[1]);
261  f3_x->SetParameters(parA[2]);
262  f4_x->SetParameters(parA[3]);
263  f5_x->SetParameters(parA[4]);
264  }
265  else if(axis == "Y")
266  {
267  for(int j = 0; j < 6; j++)
268  {
269  parA[0][j] = g1_y[j]->Eval(zValNew);
270  parA[1][j] = g2_y[j]->Eval(zValNew);
271  parA[2][j] = g3_y[j]->Eval(zValNew);
272  parA[3][j] = g4_y[j]->Eval(zValNew);
273  parA[4][j] = g5_y[j]->Eval(zValNew);
274  parA[5][j] = g6_y[j]->Eval(zValNew);
275  }
276 
277  f1_y->SetParameters(parA[0]);
278  f2_y->SetParameters(parA[1]);
279  f3_y->SetParameters(parA[2]);
280  f4_y->SetParameters(parA[3]);
281  f5_y->SetParameters(parA[4]);
282  f6_y->SetParameters(parA[5]);
283  }
284  else if(axis == "Z")
285  {
286  for(int j = 0; j < 5; j++)
287  {
288  parA[0][j] = g1_z[j]->Eval(zValNew);
289  parA[1][j] = g2_z[j]->Eval(zValNew);
290  parA[2][j] = g3_z[j]->Eval(zValNew);
291  parA[3][j] = g4_z[j]->Eval(zValNew);
292  }
293 
294  f1_z->SetParameters(parA[0]);
295  f2_z->SetParameters(parA[1]);
296  f3_z->SetParameters(parA[2]);
297  f4_z->SetParameters(parA[3]);
298  }
299 
300  double aValNew;
301  double bValNew;
302 
303  if(axis == "Y")
304  {
305  aValNew = xValNew;
306  bValNew = yValNew;
307  }
308  else
309  {
310  aValNew = yValNew;
311  bValNew = xValNew;
312  }
313 
314  double offsetValNew = 0.0;
315  if(axis == "X")
316  {
317  parB[0] = f1_x->Eval(aValNew);
318  parB[1] = f2_x->Eval(aValNew);
319  parB[2] = f3_x->Eval(aValNew);
320  parB[3] = f4_x->Eval(aValNew);
321  parB[4] = f5_x->Eval(aValNew);
322 
323  fFinal_x->SetParameters(parB);
324  offsetValNew = fFinal_x->Eval(bValNew);
325  }
326  else if(axis == "Y")
327  {
328  parB[0] = f1_y->Eval(aValNew);
329  parB[1] = f2_y->Eval(aValNew);
330  parB[2] = f3_y->Eval(aValNew);
331  parB[3] = f4_y->Eval(aValNew);
332  parB[4] = f5_y->Eval(aValNew);
333  parB[5] = f6_y->Eval(aValNew);
334 
335  fFinal_y->SetParameters(parB);
336  offsetValNew = fFinal_y->Eval(bValNew);
337  }
338  else if(axis == "Z")
339  {
340  parB[0] = f1_z->Eval(aValNew);
341  parB[1] = f2_z->Eval(aValNew);
342  parB[2] = f3_z->Eval(aValNew);
343  parB[3] = f4_z->Eval(aValNew);
344 
345  fFinal_z->SetParameters(parB);
346  offsetValNew = fFinal_z->Eval(bValNew);
347  }
348 
349  return offsetValNew;
350 }
geo::Vector_t spacecharge::SpaceCharge3x1x1dphase::GetPosOffsets ( geo::Point_t const &  point) const
overridevirtual

Primary working method of service that provides position offsets to be used in ionization electron drift

Implements spacecharge::SpaceCharge.

Definition at line 191 of file SpaceCharge3x1x1dphase.cxx.

192 {
193  std::vector<double> thePosOffsets;
194 
195  if(IsInsideBoundaries(point.X(), point.Y(), point.Z()) == false)
196  {
197  thePosOffsets.resize(3,0.0);
198  }
199  else
200  {
201  if(fRepresentationType == "Parametric")
202  thePosOffsets = GetPosOffsetsParametric(point.X(), point.Y(), point.Z());
203  else
204  thePosOffsets.resize(3,0.0);
205  }
206 
207  return { thePosOffsets[0], thePosOffsets[1], thePosOffsets[2] };
208 }
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) ...
std::vector< double > GetPosOffsetsParametric(double xVal, double yVal, double zVal) const
Provides position offsets using a parametric representation.
std::vector< double > spacecharge::SpaceCharge3x1x1dphase::GetPosOffsetsParametric ( double  xVal,
double  yVal,
double  zVal 
) const
protected

Provides position offsets using a parametric representation.

Definition at line 217 of file SpaceCharge3x1x1dphase.cxx.

218 {
219  std::vector<double> thePosOffsetsParametric;
220 
221  double xValNew = TransformX(xVal);
222  double yValNew = TransformY(yVal);
223  double zValNew = TransformZ(zVal);
224 
225  thePosOffsetsParametric.push_back(GetOnePosOffsetParametric(xValNew,yValNew,zValNew,"X"));
226  thePosOffsetsParametric.push_back(GetOnePosOffsetParametric(xValNew,yValNew,zValNew,"Y"));
227  thePosOffsetsParametric.push_back(GetOnePosOffsetParametric(xValNew,yValNew,zValNew,"Z"));
228 
229  return thePosOffsetsParametric;
230 }
double TransformZ(double zVal) const
Transform Z to SCE Z coordinate: [0.0,6.97] –> [0.0,7.2].
double TransformY(double yVal) const
Transform Y to SCE Y coordinate: [0.0,6.08] –> [0.0,6.0].
double GetOnePosOffsetParametric(double xVal, double yVal, double zVal, std::string axis) const
double TransformX(double xVal) const
Transform X to SCE X coordinate: [0.0,3.6] –> [0.0,3.6].
bool spacecharge::SpaceCharge3x1x1dphase::IsInsideBoundaries ( double  xVal,
double  yVal,
double  zVal 
) const
protected

Check to see if point is inside boundaries of map (allow to go slightly out of range)

Definition at line 545 of file SpaceCharge3x1x1dphase.cxx.

546 {
547  bool isInside = true;
548 
549  if((xVal < -50.0) || (xVal > 50.0) || (yVal < -50.0) || (yVal > 50.0) || (zVal < 0.0) || (zVal > 300.0))
550  {
551  isInside = false;
552  }
553 
554  return isInside;
555 }
double spacecharge::SpaceCharge3x1x1dphase::TransformX ( double  xVal) const
protected

Transform X to SCE X coordinate: [0.0,3.6] –> [0.0,3.6].

Definition at line 518 of file SpaceCharge3x1x1dphase.cxx.

519 {
520  double xValNew = xVal;
521 
522  return xValNew;
523 }
double spacecharge::SpaceCharge3x1x1dphase::TransformY ( double  yVal) const
protected

Transform Y to SCE Y coordinate: [0.0,6.08] –> [0.0,6.0].

Definition at line 527 of file SpaceCharge3x1x1dphase.cxx.

528 {
529  double yValNew = yVal;
530 
531  return yValNew;
532 }
double spacecharge::SpaceCharge3x1x1dphase::TransformZ ( double  zVal) const
protected

Transform Z to SCE Z coordinate: [0.0,6.97] –> [0.0,7.2].

Definition at line 536 of file SpaceCharge3x1x1dphase.cxx.

537 {
538  double zValNew = zVal;
539 
540  return zValNew;
541 }
bool spacecharge::SpaceCharge3x1x1dphase::Update ( uint64_t  ts = 0)

Definition at line 146 of file SpaceCharge3x1x1dphase.cxx.

147 {
148  if (ts == 0) return false;
149 
150  return true;
151 }

Member Data Documentation

TF1* spacecharge::SpaceCharge3x1x1dphase::f1_Ex = new TF1("f1_Ex","pol6")
protected

Definition at line 132 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f1_Ey = new TF1("f1_Ey","pol5")
protected

Definition at line 139 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f1_Ez = new TF1("f1_Ez","pol4")
protected

Definition at line 147 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f1_x = new TF1("f1_x","pol6")
protected

Definition at line 93 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f1_y = new TF1("f1_y","pol5")
protected

Definition at line 100 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f1_z = new TF1("f1_z","pol4")
protected

Definition at line 108 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f2_Ex = new TF1("f2_Ex","pol6")
protected

Definition at line 133 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f2_Ey = new TF1("f2_Ey","pol5")
protected

Definition at line 140 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f2_Ez = new TF1("f2_Ez","pol4")
protected

Definition at line 148 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f2_x = new TF1("f2_x","pol6")
protected

Definition at line 94 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f2_y = new TF1("f2_y","pol5")
protected

Definition at line 101 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f2_z = new TF1("f2_z","pol4")
protected

Definition at line 109 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f3_Ex = new TF1("f3_Ex","pol6")
protected

Definition at line 134 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f3_Ey = new TF1("f3_Ey","pol5")
protected

Definition at line 141 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f3_Ez = new TF1("f3_Ez","pol4")
protected

Definition at line 149 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f3_x = new TF1("f3_x","pol6")
protected

Definition at line 95 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f3_y = new TF1("f3_y","pol5")
protected

Definition at line 102 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f3_z = new TF1("f3_z","pol4")
protected

Definition at line 110 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f4_Ex = new TF1("f4_Ex","pol6")
protected

Definition at line 135 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f4_Ey = new TF1("f4_Ey","pol5")
protected

Definition at line 142 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f4_Ez = new TF1("f4_Ez","pol4")
protected

Definition at line 150 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f4_x = new TF1("f4_x","pol6")
protected

Definition at line 96 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f4_y = new TF1("f4_y","pol5")
protected

Definition at line 103 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f4_z = new TF1("f4_z","pol4")
protected

Definition at line 111 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f5_Ex = new TF1("f5_Ex","pol6")
protected

Definition at line 136 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f5_Ey = new TF1("f5_Ey","pol5")
protected

Definition at line 143 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f5_x = new TF1("f5_x","pol6")
protected

Definition at line 97 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f5_y = new TF1("f5_y","pol5")
protected

Definition at line 104 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f6_Ey = new TF1("f6_Ey","pol5")
protected

Definition at line 144 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::f6_y = new TF1("f6_y","pol5")
protected

Definition at line 105 of file SpaceCharge3x1x1dphase.h.

bool spacecharge::SpaceCharge3x1x1dphase::fEnableCalEfieldSCE
protected

Definition at line 69 of file SpaceCharge3x1x1dphase.h.

bool spacecharge::SpaceCharge3x1x1dphase::fEnableCalSpatialSCE
protected

Definition at line 68 of file SpaceCharge3x1x1dphase.h.

bool spacecharge::SpaceCharge3x1x1dphase::fEnableCorrSCE
protected

Definition at line 70 of file SpaceCharge3x1x1dphase.h.

bool spacecharge::SpaceCharge3x1x1dphase::fEnableSimEfieldSCE
protected

Definition at line 67 of file SpaceCharge3x1x1dphase.h.

bool spacecharge::SpaceCharge3x1x1dphase::fEnableSimSpatialSCE
protected

Definition at line 66 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::fFinal_Ex = new TF1("fFinal_Ex","pol4")
protected

Definition at line 137 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::fFinal_Ey = new TF1("fFinal_Ey","pol5")
protected

Definition at line 145 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::fFinal_Ez = new TF1("fFinal_Ez","pol3")
protected

Definition at line 151 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::fFinal_x = new TF1("fFinal_x","pol4")
protected

Definition at line 98 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::fFinal_y = new TF1("fFinal_y","pol5")
protected

Definition at line 106 of file SpaceCharge3x1x1dphase.h.

TF1* spacecharge::SpaceCharge3x1x1dphase::fFinal_z = new TF1("fFinal_z","pol3")
protected

Definition at line 112 of file SpaceCharge3x1x1dphase.h.

std::string spacecharge::SpaceCharge3x1x1dphase::fInputFilename
protected

Definition at line 73 of file SpaceCharge3x1x1dphase.h.

std::string spacecharge::SpaceCharge3x1x1dphase::fRepresentationType
protected

Definition at line 72 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g1_Ex = new TGraph*[7]
protected

Definition at line 114 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g1_Ey = new TGraph*[7]
protected

Definition at line 120 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g1_Ez = new TGraph*[7]
protected

Definition at line 127 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g1_x = new TGraph*[7]
protected

Definition at line 75 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g1_y = new TGraph*[7]
protected

Definition at line 81 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g1_z = new TGraph*[7]
protected

Definition at line 88 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g2_Ex = new TGraph*[7]
protected

Definition at line 115 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g2_Ey = new TGraph*[7]
protected

Definition at line 121 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g2_Ez = new TGraph*[7]
protected

Definition at line 128 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g2_x = new TGraph*[7]
protected

Definition at line 76 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g2_y = new TGraph*[7]
protected

Definition at line 82 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g2_z = new TGraph*[7]
protected

Definition at line 89 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g3_Ex = new TGraph*[7]
protected

Definition at line 116 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g3_Ey = new TGraph*[7]
protected

Definition at line 122 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g3_Ez = new TGraph*[7]
protected

Definition at line 129 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g3_x = new TGraph*[7]
protected

Definition at line 77 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g3_y = new TGraph*[7]
protected

Definition at line 83 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g3_z = new TGraph*[7]
protected

Definition at line 90 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g4_Ex = new TGraph*[7]
protected

Definition at line 117 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g4_Ey = new TGraph*[7]
protected

Definition at line 123 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g4_Ez = new TGraph*[7]
protected

Definition at line 130 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g4_x = new TGraph*[7]
protected

Definition at line 78 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g4_y = new TGraph*[7]
protected

Definition at line 84 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g4_z = new TGraph*[7]
protected

Definition at line 91 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g5_Ex = new TGraph*[7]
protected

Definition at line 118 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g5_Ey = new TGraph*[7]
protected

Definition at line 124 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g5_x = new TGraph*[7]
protected

Definition at line 79 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g5_y = new TGraph*[7]
protected

Definition at line 85 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g6_Ey = new TGraph*[7]
protected

Definition at line 125 of file SpaceCharge3x1x1dphase.h.

TGraph** spacecharge::SpaceCharge3x1x1dphase::g6_y = new TGraph*[7]
protected

Definition at line 86 of file SpaceCharge3x1x1dphase.h.


The documentation for this class was generated from the following files: