16 #include "art_root_io/TFileService.h" 79 double driftv = detProp.DriftVelocity(detProp.Efield(),
80 detProp.Temperature());
81 double efield = detProp.Efield();
82 std::cout<<
"E field = "<<efield<<
" Nominal drift velocity = "<<driftv<<
std::endl;
85 const double e0 = 0.4;
86 const double e1 = 0.7;
87 std::vector<double> vecv;
88 std::vector<double> vece;
89 for (
int i = 0; i<
n; ++i){
90 double e_field = e0 + i*(e1-e0)/n;
91 double drift_v = detProp.DriftVelocity(e_field,
92 detProp.Temperature());
93 vecv.push_back(drift_v);
94 vece.push_back(e_field);
96 TGraph *gr =
new TGraph(n, &vecv[0], &vece[0]);
102 std::cout<<xyz[0]<<
" "<<xyz[1]<<
" "<<xyz[2]<<
std::endl;
103 double driftdis = 358.6 -
std::abs(xyz[0]);
104 double drifttime = driftdis/driftv;
107 auto const* SCE = lar::providerFrom<spacecharge::SpaceChargeService>();
108 if (SCE->EnableSimSpatialSCE() ==
true){
109 posOffsets = SCE->GetPosOffsets({ xyz[0], xyz[1], xyz[2] });
111 posOffsets.SetX(-posOffsets.X());
112 driftdis += posOffsets.X();
113 drifttime = driftdis/driftv;
117 if (xyz[0]<0) dir = -1;
125 geo::Vector_t fEfieldOffsets = SCE->GetEfieldOffsets({ xyz1[0], xyz1[1], xyz1[2] });
126 double EField = std::sqrt( (efield + efield*fEfieldOffsets.X())*(efield + efield*fEfieldOffsets.X()) +
127 (efield*fEfieldOffsets.Y()*efield*fEfieldOffsets.Y()) +
128 (efield*fEfieldOffsets.Z()*efield*fEfieldOffsets.Z()) );
129 double v = detProp.DriftVelocity(EField,
130 detProp.Temperature());
132 xyz1[0] += deltax*
dir;
136 geo::Vector_t fEfieldOffsets = SCE->GetEfieldOffsets({ xyz[0], xyz[1], xyz[2] });
137 double EField = std::sqrt( (efield + efield*fEfieldOffsets.X())*(efield + efield*fEfieldOffsets.X()) +
138 (efield*fEfieldOffsets.Y()*efield*fEfieldOffsets.Y()) +
139 (efield*fEfieldOffsets.Z()*efield*fEfieldOffsets.Z()) );
140 fEfield->SetBinContent(i, EField);
167 drifttimenosce = tfs->make<TH1D>(
"drifttimenosce",
";x (cm);Drift time (#mus)",120,-360,360);
168 drifttimeave = tfs->make<TH1D>(
"drifttimeave",
";x (cm);Drift time (#mus)",120,-360,360);
169 drifttimeint = tfs->make<TH1D>(
"drifttimeint",
";x (cm);Drift time (#mus)",120,-360,360);
170 fEfield = tfs->make<TH1D>(
"fEfield",
"E field; x (cm);E field (kV/cm)",120,-360,360);
172 fdeltatnosce = tfs->make<TH1D>(
"fdeltatnosce",
";x (cm);#Delta t (#mus)", 120, -360, 360);
173 fdeltatave = tfs->make<TH1D>(
"fdeltatave",
";x (cm);#Delta t (#mus)", 120, -360, 360);
174 fdeltatint = tfs->make<TH1D>(
"fdeltatint",
";x (cm);#Delta t (#mus)", 120, -360, 360);
176 fdriftvnosce = tfs->make<TH1D>(
"fdriftvnosce",
";x (cm);Drift velocity (cm/#mus)", 120, -360, 360);
177 fdriftvave = tfs->make<TH1D>(
"fdriftvave",
";x (cm);Drift velocity (cm/#mus)", 120, -360, 360);
178 fdriftvint = tfs->make<TH1D>(
"fdriftvint",
";x (cm);Drift velocity (cm/#mus)", 120, -360, 360);
180 fefieldnosce = tfs->make<TH1D>(
"fefieldnosce",
";x (cm);E field (kV/cm)", 120, -360, 360);
181 fefieldave = tfs->make<TH1D>(
"fefieldave",
";x (cm);E field (kV/cm)", 120, -360, 360);
182 fefieldint = tfs->make<TH1D>(
"fefieldint",
";x (cm);E field (kV/cm)", 120, -360, 360);
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
EDAnalyzer(fhicl::ParameterSet const &pset)
#define DEFINE_ART_MODULE(klass)
DriftAna & operator=(DriftAna const &)=delete
void analyze(art::Event const &e) override
DriftAna(fhicl::ParameterSet const &p)
QTextStream & endl(QTextStream &s)