All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
spacecharge::SpaceChargeStandard Class Reference

#include <SpaceChargeStandard.h>

Inheritance diagram for spacecharge::SpaceChargeStandard:
spacecharge::SpaceCharge

Public Member Functions

 SpaceChargeStandard (fhicl::ParameterSet const &pset)
 
 SpaceChargeStandard (SpaceChargeStandard const &)=delete
 
virtual ~SpaceChargeStandard ()=default
 
bool Configure (fhicl::ParameterSet const &pset)
 
bool Update (uint64_t ts=0)
 
bool EnableSimSpatialSCE () const override
 
bool EnableSimEfieldSCE () const override
 
bool EnableCorrSCE () const override
 Return boolean indicating whether or not to apply SCE corrections. More...
 
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...
 
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 - redefine this in experiment-specific implementation! More...
 
double TransformY (double yVal) const
 Transform Y to SCE Y coordinate - redefine this in experiment-specific implementation! More...
 
double TransformZ (double zVal) const
 Transform Z to SCE Z coordinate - redefine this in experiment-specific implementation! More...
 
bool IsInsideBoundaries (double xVal, double yVal, double zVal) const
 Check to see if point is inside boundaries of map - redefine this in experiment-specific implementation! 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 30 of file SpaceChargeStandard.h.

Constructor & Destructor Documentation

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

Definition at line 26 of file SpaceChargeStandard.cxx.

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

Member Function Documentation

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

Definition at line 34 of file SpaceChargeStandard.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  // check that the old obsoleted parameter is not in configuration:
43  if (pset.has_key("EnableSimulationSCE")) {
44  throw art::Exception(art::errors::Configuration)
45  << "Configuration parameter 'EnableSimulationSCE' has been replaced by 'EnableSimSpatialSCE'.\n";
46  }
47 
48  if((fEnableSimSpatialSCE == true) | (fEnableSimEfieldSCE == true))
49  {
50  fRepresentationType = pset.get<std::string>("RepresentationType");
51  fInputFilename = pset.get<std::string>("InputFilename");
52 
53  std::string fname;
54  cet::search_path sp("FW_SEARCH_PATH");
55  sp.find_file(fInputFilename,fname);
56 
57  auto infile = std::make_unique<TFile>(fname.c_str(), "READ");
58  if(!infile->IsOpen()) throw art::Exception(art::errors::Configuration) << "Could not find the space charge effect file '" << fname << "'!\n";
59 
60  if(fRepresentationType == "Parametric")
61  {
62  for(int i = 0; i < 5; i++)
63  {
64  g1_x[i] = (TGraph*)infile->Get(Form("deltaX/g1_%d",i));
65  g2_x[i] = (TGraph*)infile->Get(Form("deltaX/g2_%d",i));
66  g3_x[i] = (TGraph*)infile->Get(Form("deltaX/g3_%d",i));
67  g4_x[i] = (TGraph*)infile->Get(Form("deltaX/g4_%d",i));
68  g5_x[i] = (TGraph*)infile->Get(Form("deltaX/g5_%d",i));
69 
70  g1_y[i] = (TGraph*)infile->Get(Form("deltaY/g1_%d",i));
71  g2_y[i] = (TGraph*)infile->Get(Form("deltaY/g2_%d",i));
72  g3_y[i] = (TGraph*)infile->Get(Form("deltaY/g3_%d",i));
73  g4_y[i] = (TGraph*)infile->Get(Form("deltaY/g4_%d",i));
74  g5_y[i] = (TGraph*)infile->Get(Form("deltaY/g5_%d",i));
75  g6_y[i] = (TGraph*)infile->Get(Form("deltaY/g6_%d",i));
76 
77  g1_z[i] = (TGraph*)infile->Get(Form("deltaZ/g1_%d",i));
78  g2_z[i] = (TGraph*)infile->Get(Form("deltaZ/g2_%d",i));
79  g3_z[i] = (TGraph*)infile->Get(Form("deltaZ/g3_%d",i));
80  g4_z[i] = (TGraph*)infile->Get(Form("deltaZ/g4_%d",i));
81 
82  g1_Ex[i] = (TGraph*)infile->Get(Form("deltaExOverE/g1_%d",i));
83  g2_Ex[i] = (TGraph*)infile->Get(Form("deltaExOverE/g2_%d",i));
84  g3_Ex[i] = (TGraph*)infile->Get(Form("deltaExOverE/g3_%d",i));
85  g4_Ex[i] = (TGraph*)infile->Get(Form("deltaExOverE/g4_%d",i));
86  g5_Ex[i] = (TGraph*)infile->Get(Form("deltaExOverE/g5_%d",i));
87 
88  g1_Ey[i] = (TGraph*)infile->Get(Form("deltaEyOverE/g1_%d",i));
89  g2_Ey[i] = (TGraph*)infile->Get(Form("deltaEyOverE/g2_%d",i));
90  g3_Ey[i] = (TGraph*)infile->Get(Form("deltaEyOverE/g3_%d",i));
91  g4_Ey[i] = (TGraph*)infile->Get(Form("deltaEyOverE/g4_%d",i));
92  g5_Ey[i] = (TGraph*)infile->Get(Form("deltaEyOverE/g5_%d",i));
93  g6_Ey[i] = (TGraph*)infile->Get(Form("deltaEyOverE/g6_%d",i));
94 
95  g1_Ez[i] = (TGraph*)infile->Get(Form("deltaEzOverE/g1_%d",i));
96  g2_Ez[i] = (TGraph*)infile->Get(Form("deltaEzOverE/g2_%d",i));
97  g3_Ez[i] = (TGraph*)infile->Get(Form("deltaEzOverE/g3_%d",i));
98  g4_Ez[i] = (TGraph*)infile->Get(Form("deltaEzOverE/g4_%d",i));
99  }
100 
101  g1_x[5] = (TGraph*)infile->Get("deltaX/g1_5");
102  g2_x[5] = (TGraph*)infile->Get("deltaX/g2_5");
103  g3_x[5] = (TGraph*)infile->Get("deltaX/g3_5");
104  g4_x[5] = (TGraph*)infile->Get("deltaX/g4_5");
105  g5_x[5] = (TGraph*)infile->Get("deltaX/g5_5");
106 
107  g1_y[5] = (TGraph*)infile->Get("deltaY/g1_5");
108  g2_y[5] = (TGraph*)infile->Get("deltaY/g2_5");
109  g3_y[5] = (TGraph*)infile->Get("deltaY/g3_5");
110  g4_y[5] = (TGraph*)infile->Get("deltaY/g4_5");
111  g5_y[5] = (TGraph*)infile->Get("deltaY/g5_5");
112  g6_y[5] = (TGraph*)infile->Get("deltaY/g6_5");
113 
114  g1_x[6] = (TGraph*)infile->Get("deltaX/g1_6");
115  g2_x[6] = (TGraph*)infile->Get("deltaX/g2_6");
116  g3_x[6] = (TGraph*)infile->Get("deltaX/g3_6");
117  g4_x[6] = (TGraph*)infile->Get("deltaX/g4_6");
118  g5_x[6] = (TGraph*)infile->Get("deltaX/g5_6");
119 
120  g1_Ex[5] = (TGraph*)infile->Get("deltaExOverE/g1_5");
121  g2_Ex[5] = (TGraph*)infile->Get("deltaExOverE/g2_5");
122  g3_Ex[5] = (TGraph*)infile->Get("deltaExOverE/g3_5");
123  g4_Ex[5] = (TGraph*)infile->Get("deltaExOverE/g4_5");
124  g5_Ex[5] = (TGraph*)infile->Get("deltaExOverE/g5_5");
125 
126  g1_Ey[5] = (TGraph*)infile->Get("deltaEyOverE/g1_5");
127  g2_Ey[5] = (TGraph*)infile->Get("deltaEyOverE/g2_5");
128  g3_Ey[5] = (TGraph*)infile->Get("deltaEyOverE/g3_5");
129  g4_Ey[5] = (TGraph*)infile->Get("deltaEyOverE/g4_5");
130  g5_Ey[5] = (TGraph*)infile->Get("deltaEyOverE/g5_5");
131  g6_Ey[5] = (TGraph*)infile->Get("deltaEyOverE/g6_5");
132 
133  g1_Ex[6] = (TGraph*)infile->Get("deltaExOverE/g1_6");
134  g2_Ex[6] = (TGraph*)infile->Get("deltaExOverE/g2_6");
135  g3_Ex[6] = (TGraph*)infile->Get("deltaExOverE/g3_6");
136  g4_Ex[6] = (TGraph*)infile->Get("deltaExOverE/g4_6");
137  g5_Ex[6] = (TGraph*)infile->Get("deltaExOverE/g5_6");
138  }
139 
140  infile->Close();
141  }
142 
143  if(fEnableCorrSCE == true)
144  {
145  // Grab other parameters from pset
146  }
147 
148  return true;
149 }
string fname
Definition: demo.py:5
bool spacecharge::SpaceChargeStandard::EnableCalEfieldSCE ( ) const
overridevirtual

Return boolean indicating whether or not to apply SCE corrections.

Implements spacecharge::SpaceCharge.

Definition at line 189 of file SpaceChargeStandard.cxx.

190 {
191  return fEnableCalEfieldSCE;
192 }
bool spacecharge::SpaceChargeStandard::EnableCalSpatialSCE ( ) const
overridevirtual

Return boolean indicating whether or not to apply SCE corrections.

Implements spacecharge::SpaceCharge.

Definition at line 183 of file SpaceChargeStandard.cxx.

184 {
185  return fEnableCalSpatialSCE;
186 }
bool spacecharge::SpaceChargeStandard::EnableCorrSCE ( ) const
overridevirtual

Return boolean indicating whether or not to apply SCE corrections.

Implements spacecharge::SpaceCharge.

Definition at line 177 of file SpaceChargeStandard.cxx.

178 {
179  return fEnableCorrSCE;
180 }
bool spacecharge::SpaceChargeStandard::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 170 of file SpaceChargeStandard.cxx.

171 {
172  return fEnableSimEfieldSCE;
173 }
bool spacecharge::SpaceChargeStandard::EnableSimSpatialSCE ( ) const
overridevirtual

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

Implements spacecharge::SpaceCharge.

Definition at line 162 of file SpaceChargeStandard.cxx.

163 {
164  return fEnableSimSpatialSCE;
165 }
geo::Vector_t spacecharge::SpaceChargeStandard::GetCalEfieldOffsets ( geo::Point_t const &  point,
int const &  TPCid 
) const
overridevirtual

Implements spacecharge::SpaceCharge.

Definition at line 374 of file SpaceChargeStandard.cxx.

375 {
376 
377  return {0., 0., 0.};
378 }
geo::Vector_t spacecharge::SpaceChargeStandard::GetCalPosOffsets ( geo::Point_t const &  point,
int const &  TPCid 
) const
overridevirtual

Implements spacecharge::SpaceCharge.

Definition at line 216 of file SpaceChargeStandard.cxx.

217 {
218 
219  return{ 0., 0., 0.};
220 }
geo::Vector_t spacecharge::SpaceChargeStandard::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 362 of file SpaceChargeStandard.cxx.

363 {
364  std::vector<double> theEfieldOffsets;
365 
366  if(fRepresentationType == "Parametric")
367  theEfieldOffsets = GetEfieldOffsetsParametric(point.X(), point.Y(), point.Z());
368  else
369  theEfieldOffsets.resize(3,0.0);
370 
371  return { -theEfieldOffsets[0], -theEfieldOffsets[1], -theEfieldOffsets[2] };
372 }
std::vector< double > GetEfieldOffsetsParametric(double xVal, double yVal, double zVal) const
Provides E field offsets using a parametric representation.
std::vector< double > spacecharge::SpaceChargeStandard::GetEfieldOffsetsParametric ( double  xVal,
double  yVal,
double  zVal 
) const
protected

Provides E field offsets using a parametric representation.

Definition at line 382 of file SpaceChargeStandard.cxx.

383 {
384  std::vector<double> theEfieldOffsetsParametric;
385 
386  double xValNew = TransformX(xVal);
387  double yValNew = TransformY(yVal);
388  double zValNew = TransformZ(zVal);
389 
390  theEfieldOffsetsParametric.push_back(GetOneEfieldOffsetParametric(xValNew,yValNew,zValNew,"X"));
391  theEfieldOffsetsParametric.push_back(GetOneEfieldOffsetParametric(xValNew,yValNew,zValNew,"Y"));
392  theEfieldOffsetsParametric.push_back(GetOneEfieldOffsetParametric(xValNew,yValNew,zValNew,"Z"));
393 
394  return theEfieldOffsetsParametric;
395 }
double TransformY(double yVal) const
Transform Y to SCE Y coordinate - redefine this in experiment-specific implementation! ...
double TransformX(double xVal) const
Transform X to SCE X coordinate - redefine this in experiment-specific implementation! ...
double TransformZ(double zVal) const
Transform Z to SCE Z coordinate - redefine this in experiment-specific implementation! ...
double GetOneEfieldOffsetParametric(double xVal, double yVal, double zVal, std::string axis) const
double spacecharge::SpaceChargeStandard::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, with returned E field offsets normalized to nominal drift E field

Definition at line 400 of file SpaceChargeStandard.cxx.

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

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

198 {
199  std::vector<double> thePosOffsets;
200 
201  if(IsInsideBoundaries(point.X(), point.Y(), point.Z()) == false)
202  {
203  thePosOffsets.resize(3,0.0);
204  }
205  else
206  {
207  if(fRepresentationType == "Parametric")
208  thePosOffsets = GetPosOffsetsParametric(point.X(), point.Y(), point.Z());
209  else
210  thePosOffsets.resize(3,0.0);
211  }
212 
213  return { thePosOffsets[0], thePosOffsets[1], thePosOffsets[2] };
214 }
bool IsInsideBoundaries(double xVal, double yVal, double zVal) const
Check to see if point is inside boundaries of map - redefine this in experiment-specific implementati...
std::vector< double > GetPosOffsetsParametric(double xVal, double yVal, double zVal) const
Provides position offsets using a parametric representation.
std::vector< double > spacecharge::SpaceChargeStandard::GetPosOffsetsParametric ( double  xVal,
double  yVal,
double  zVal 
) const
protected

Provides position offsets using a parametric representation.

Definition at line 224 of file SpaceChargeStandard.cxx.

225 {
226  std::vector<double> thePosOffsetsParametric;
227 
228  double xValNew = TransformX(xVal);
229  double yValNew = TransformY(yVal);
230  double zValNew = TransformZ(zVal);
231 
232  thePosOffsetsParametric.push_back(GetOnePosOffsetParametric(xValNew,yValNew,zValNew,"X"));
233  thePosOffsetsParametric.push_back(GetOnePosOffsetParametric(xValNew,yValNew,zValNew,"Y"));
234  thePosOffsetsParametric.push_back(GetOnePosOffsetParametric(xValNew,yValNew,zValNew,"Z"));
235 
236  return thePosOffsetsParametric;
237 }
double GetOnePosOffsetParametric(double xVal, double yVal, double zVal, std::string axis) const
double TransformY(double yVal) const
Transform Y to SCE Y coordinate - redefine this in experiment-specific implementation! ...
double TransformX(double xVal) const
Transform X to SCE X coordinate - redefine this in experiment-specific implementation! ...
double TransformZ(double zVal) const
Transform Z to SCE Z coordinate - redefine this in experiment-specific implementation! ...
bool spacecharge::SpaceChargeStandard::IsInsideBoundaries ( double  xVal,
double  yVal,
double  zVal 
) const
protected

Check to see if point is inside boundaries of map - redefine this in experiment-specific implementation!

Definition at line 549 of file SpaceChargeStandard.cxx.

550 {
551  bool isInside = false;
552 
553  return isInside;
554 }
double spacecharge::SpaceChargeStandard::TransformX ( double  xVal) const
protected

Transform X to SCE X coordinate - redefine this in experiment-specific implementation!

Definition at line 519 of file SpaceChargeStandard.cxx.

520 {
521  double xValNew;
522  xValNew = xVal/100.0;
523 
524  return xValNew;
525 }
double spacecharge::SpaceChargeStandard::TransformY ( double  yVal) const
protected

Transform Y to SCE Y coordinate - redefine this in experiment-specific implementation!

Definition at line 529 of file SpaceChargeStandard.cxx.

530 {
531  double yValNew;
532  yValNew = yVal/100.0;
533 
534  return yValNew;
535 }
double spacecharge::SpaceChargeStandard::TransformZ ( double  zVal) const
protected

Transform Z to SCE Z coordinate - redefine this in experiment-specific implementation!

Definition at line 539 of file SpaceChargeStandard.cxx.

540 {
541  double zValNew;
542  zValNew = zVal/100.0;
543 
544  return zValNew;
545 }
bool spacecharge::SpaceChargeStandard::Update ( uint64_t  ts = 0)

Definition at line 152 of file SpaceChargeStandard.cxx.

153 {
154  if (ts == 0) return false;
155 
156  return true;
157 }

Member Data Documentation

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

Definition at line 130 of file SpaceChargeStandard.h.

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

Definition at line 137 of file SpaceChargeStandard.h.

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

Definition at line 145 of file SpaceChargeStandard.h.

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

Definition at line 91 of file SpaceChargeStandard.h.

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

Definition at line 98 of file SpaceChargeStandard.h.

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

Definition at line 106 of file SpaceChargeStandard.h.

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

Definition at line 131 of file SpaceChargeStandard.h.

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

Definition at line 138 of file SpaceChargeStandard.h.

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

Definition at line 146 of file SpaceChargeStandard.h.

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

Definition at line 92 of file SpaceChargeStandard.h.

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

Definition at line 99 of file SpaceChargeStandard.h.

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

Definition at line 107 of file SpaceChargeStandard.h.

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

Definition at line 132 of file SpaceChargeStandard.h.

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

Definition at line 139 of file SpaceChargeStandard.h.

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

Definition at line 147 of file SpaceChargeStandard.h.

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

Definition at line 93 of file SpaceChargeStandard.h.

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

Definition at line 100 of file SpaceChargeStandard.h.

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

Definition at line 108 of file SpaceChargeStandard.h.

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

Definition at line 133 of file SpaceChargeStandard.h.

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

Definition at line 140 of file SpaceChargeStandard.h.

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

Definition at line 148 of file SpaceChargeStandard.h.

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

Definition at line 94 of file SpaceChargeStandard.h.

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

Definition at line 101 of file SpaceChargeStandard.h.

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

Definition at line 109 of file SpaceChargeStandard.h.

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

Definition at line 134 of file SpaceChargeStandard.h.

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

Definition at line 141 of file SpaceChargeStandard.h.

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

Definition at line 95 of file SpaceChargeStandard.h.

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

Definition at line 102 of file SpaceChargeStandard.h.

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

Definition at line 142 of file SpaceChargeStandard.h.

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

Definition at line 103 of file SpaceChargeStandard.h.

bool spacecharge::SpaceChargeStandard::fEnableCalEfieldSCE
protected

Definition at line 67 of file SpaceChargeStandard.h.

bool spacecharge::SpaceChargeStandard::fEnableCalSpatialSCE
protected

Definition at line 66 of file SpaceChargeStandard.h.

bool spacecharge::SpaceChargeStandard::fEnableCorrSCE
protected

Definition at line 68 of file SpaceChargeStandard.h.

bool spacecharge::SpaceChargeStandard::fEnableSimEfieldSCE
protected

Definition at line 65 of file SpaceChargeStandard.h.

bool spacecharge::SpaceChargeStandard::fEnableSimSpatialSCE
protected

Definition at line 64 of file SpaceChargeStandard.h.

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

Definition at line 135 of file SpaceChargeStandard.h.

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

Definition at line 143 of file SpaceChargeStandard.h.

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

Definition at line 149 of file SpaceChargeStandard.h.

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

Definition at line 96 of file SpaceChargeStandard.h.

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

Definition at line 104 of file SpaceChargeStandard.h.

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

Definition at line 110 of file SpaceChargeStandard.h.

std::string spacecharge::SpaceChargeStandard::fInputFilename
protected

Definition at line 71 of file SpaceChargeStandard.h.

std::string spacecharge::SpaceChargeStandard::fRepresentationType
protected

Definition at line 70 of file SpaceChargeStandard.h.

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

Definition at line 112 of file SpaceChargeStandard.h.

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

Definition at line 118 of file SpaceChargeStandard.h.

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

Definition at line 125 of file SpaceChargeStandard.h.

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

Definition at line 73 of file SpaceChargeStandard.h.

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

Definition at line 79 of file SpaceChargeStandard.h.

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

Definition at line 86 of file SpaceChargeStandard.h.

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

Definition at line 113 of file SpaceChargeStandard.h.

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

Definition at line 119 of file SpaceChargeStandard.h.

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

Definition at line 126 of file SpaceChargeStandard.h.

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

Definition at line 74 of file SpaceChargeStandard.h.

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

Definition at line 80 of file SpaceChargeStandard.h.

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

Definition at line 87 of file SpaceChargeStandard.h.

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

Definition at line 114 of file SpaceChargeStandard.h.

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

Definition at line 120 of file SpaceChargeStandard.h.

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

Definition at line 127 of file SpaceChargeStandard.h.

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

Definition at line 75 of file SpaceChargeStandard.h.

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

Definition at line 81 of file SpaceChargeStandard.h.

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

Definition at line 88 of file SpaceChargeStandard.h.

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

Definition at line 115 of file SpaceChargeStandard.h.

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

Definition at line 121 of file SpaceChargeStandard.h.

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

Definition at line 128 of file SpaceChargeStandard.h.

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

Definition at line 76 of file SpaceChargeStandard.h.

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

Definition at line 82 of file SpaceChargeStandard.h.

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

Definition at line 89 of file SpaceChargeStandard.h.

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

Definition at line 116 of file SpaceChargeStandard.h.

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

Definition at line 122 of file SpaceChargeStandard.h.

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

Definition at line 77 of file SpaceChargeStandard.h.

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

Definition at line 83 of file SpaceChargeStandard.h.

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

Definition at line 123 of file SpaceChargeStandard.h.

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

Definition at line 84 of file SpaceChargeStandard.h.


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