58 std::cout<<
"Efield : "<<fEfield<<
std::endl;
92 std::unique_ptr<TFile>
infile(
new TFile(fname.c_str(),
"READ"));
93 if(!
infile->IsOpen())
throw cet::exception(
"SpaceChargeProtoDUNEdp") <<
"Could not find the space charge effect file '" << fname <<
"'!\n";
100 TH3F* hEndPoint_sim_orig;
102 hDx_sim_orig= (TH3F*)
infile->Get(
"hDeltaLength");
103 hDy_sim_orig = (TH3F*)
infile->Get(
"hEndPointDY");
104 hEndPoint_sim_orig = (TH3F*)
infile->Get(
"hEndPointX");
105 Anodebin = hEndPoint_sim_orig->GetXaxis()->GetXmax();
108 hDx_sim_orig= (TH3F*)
infile->Get(
"hEndPointDX");
109 hDy_sim_orig = (TH3F*)
infile->Get(
"hDeltaLength");
110 hEndPoint_sim_orig = (TH3F*)
infile->Get(
"hEndPointY");
111 Anodebin = hEndPoint_sim_orig->GetYaxis()->GetXmax();
116 TH3F* hDz_sim_orig = (TH3F*)
infile->Get(
"hEndPointDZ");
117 TH3F* hEx_sim_orig = (TH3F*)
infile->Get(
"hEx");
118 TH3F* hEy_sim_orig = (TH3F*)
infile->Get(
"hEy");
119 TH3F* hEz_sim_orig = (TH3F*)
infile->Get(
"hEz");
123 TH3F* hEndPointDrift_sim = (TH3F*) hEndPoint_sim_orig->Clone(
"hEndPointDrift");
125 TH3F* hDx_sim = (TH3F*)hDx_sim_orig->Clone(
"hDx_sim");
126 TH3F* hDy_sim = (TH3F*)hDy_sim_orig->Clone(
"hDy_sim");
127 TH3F* hDz_sim = (TH3F*)hDz_sim_orig->Clone(
"hDz_sim");
128 TH3F* hEx_sim = (TH3F*)hEx_sim_orig->Clone(
"hEx_sim");
129 TH3F* hEy_sim = (TH3F*)hEy_sim_orig->Clone(
"hEy_sim");
130 TH3F* hEz_sim = (TH3F*)hEz_sim_orig->Clone(
"hEz_sim");
132 hEndPointDrift_sim->SetDirectory(0);
134 hDx_sim->SetDirectory(0);
135 hDy_sim->SetDirectory(0);
136 hDz_sim->SetDirectory(0);
137 hEx_sim->SetDirectory(0);
138 hEy_sim->SetDirectory(0);
139 hEz_sim->SetDirectory(0);
143 SCEhistograms = {hDx_sim, hDy_sim, hDz_sim, hEx_sim, hEy_sim, hEz_sim, hEndPointDrift_sim};
148 fEnableCalEfieldSCE =
false;
149 fEnableCalSpatialSCE =
false;
151 if((fEnableCalSpatialSCE ==
true) || (fEnableCalEfieldSCE ==
true))
162 std::unique_ptr<TFile> calinfile(
new TFile(fname.c_str(),
"READ"));
163 if(!calinfile->IsOpen())
throw cet::exception(
"SpaceChargeProtoDUNEdp") <<
"Could not find the space charge effect calibration file '" << fname <<
"'!\n";
165 TH3F* hDx_cal_orig = (TH3F*)calinfile->Get(
"hoffsetX");
166 TH3F* hDy_cal_orig = (TH3F*)calinfile->Get(
"hoffsetY");
167 TH3F* hDz_cal_orig = (TH3F*)calinfile->Get(
"hoffsetZ");
169 TH3F* hEx_cal_orig = (TH3F*)calinfile->Get(
"hEx");
170 TH3F* hEy_cal_orig = (TH3F*)calinfile->Get(
"hEy");
171 TH3F* hEz_cal_orig = (TH3F*)calinfile->Get(
"hEz");
175 TH3F* hDx_cal = (TH3F*)hDx_cal_orig->Clone(
"hDx_cal");
176 TH3F* hDy_cal = (TH3F*)hDy_cal_orig->Clone(
"hDy_cal");
177 TH3F* hDz_cal = (TH3F*)hDz_cal_orig->Clone(
"hDz_cal");
178 TH3F* hEx_cal = (TH3F*)hEx_cal_orig->Clone(
"hEx_cal");
179 TH3F* hEy_cal = (TH3F*)hEy_cal_orig->Clone(
"hEy_cal");
180 TH3F* hEz_cal = (TH3F*)hEz_cal_orig->Clone(
"hEz_cal");
182 hDx_cal->SetDirectory(0);
183 hDy_cal->SetDirectory(0);
184 hDz_cal->SetDirectory(0);
185 hEx_cal->SetDirectory(0);
186 hEy_cal->SetDirectory(0);
187 hEz_cal->SetDirectory(0);
short int driftcoordinate
std::string fInputFilename
bool fEnableCalSpatialSCE
short int DetectDriftDirection() const
Returns the expected drift direction based on geometry.
bool fEnableSimSpatialSCE
std::string fCalInputFilename
std::vector< TH3F * > SCEhistograms
std::vector< TH3F * > CalSCEhistograms
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)