6 loc_w.SetX(loc_w.X() + xsign * offset.X());
7 loc_w.SetY(loc_w.Y() + offset.Y());
8 loc_w.SetZ(loc_w.Z() + offset.Z());
16 double EField = dprop.
Efield();
25 EFieldOffsets = EField * EFieldOffsets;
27 EField = EFieldOffsets.r();
39 loc.SetX(loc.X() + corr * xsign * offset.X());
40 loc.SetY(loc.Y() + offset.Y());
41 loc.SetZ(loc.Z() + offset.Z());
51 bool correct_sce,
bool track_is_sce_corrected,
float xsign) {
60 if (correct_sce && track_is_sce_corrected) {
69 dir_w = (loc_pdx - loc_mdx).Unit();
77 double cosgamma =
std::abs(std::sin(angleToVert)*dir_w.Y() + std::cos(angleToVert)*dir_w.Z());
88 if (correct_sce && track_is_sce_corrected) {
95 pitch = (locw_traj - locw_pdx_traj).R();
105 for (
const art::Ptr<recob::Hit> &
h: A.
hits) {
122 float vert_w = A.
vhit->vtxw;
123 float vert_x = A.
vhit->vtxx;;
131 float Amag = sqrt(Ahit_w*Ahit_w + Ahit_x*Ahit_x);
132 float Bmag = sqrt(Bhit_w*Bhit_w + Bhit_x*Bhit_x);
134 return(Ahit_w*Bhit_w + Ahit_x*Bhit_x) / (Amag*Bmag);
150 static constexpr
bool VERBOSE =
false;
178 std::cout <<
"Output Y: " << y <<
" Z: " << z << std::endl;
186 std::cout <<
"Output X: " << x << std::endl;
189 std::cout <<
"Final x: " << pos.x() <<
" y: " << pos.y() <<
" z: " << pos.z() << std::endl;
202 return abs(ACharge - BCharge);
224 return abs(A.
vhit->charge / Apitch - B.
vhit->charge / Bpitch);
float StubChargeOffset(const sbn::StubInfo &A, const sbn::StubInfo &B)
Difference of the total charge between two stubs.
geo::Length_t WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeid) const
Returns the index of the nearest wire to the specified position.
float StubTimeOffset(const sbn::StubInfo &A, const sbn::StubInfo &B, const detinfo::DetectorClocksData &dclock, const detinfo::DetectorPropertiesData &dprop)
process_name opflash particleana ie ie ie z
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
virtual geo::Vector_t GetCalPosOffsets(geo::Point_t const &point, int const &TPCid) const =0
Vector DriftDir() const
Returns the direction of the drift (vector pointing toward the planes).
BEGIN_PROLOG TPC Trig offset(g4 rise time) ProjectToHeight
float StubPeakdQdxOffset(const sbn::StubInfo &A, const sbn::StubInfo &B, const geo::GeometryCore *geo, const spacecharge::SpaceCharge *sce, const detinfo::DetectorPropertiesData &dprop)
Difference of the endpoint dQ/dx between two stubs.
process_name opflash particleana ie x
ElecClock const & TPCClock() const noexcept
Borrow a const TPC clock with time set to Trigger time [us].
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
float StubDirectionDot(const sbn::StubInfo &A, const sbn::StubInfo &B, const geo::GeometryCore *geo, const detinfo::DetectorPropertiesData &dprop)
Computes the dot product of two stubs.
std::vector< std::vector< StubHit > > hits
Hits on each plane. Ordered vtx->end.
geo::Point_t end
End of Stub. Space charge corrected. [cm].
bool OnCore(const geo::WireID &w) const
Returns whether the input wire-ID is on the core of the stub.
geo::Point_t GetLocation(const spacecharge::SpaceCharge *sce, geo::Point_t loc_w, geo::TPCID TPC, float xsign=1.)
Get the location in the presence of space charge.
Internal struct: contains information on stub and other associated data products. ...
float CoreCharge(unsigned plane_index=0) const
Helper functions.
geo::Point_t vtx
Interaction Vertex / Start of Stub. Space charge corrected. [cm].
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
geo::Point_t GetLocationAtWires(const spacecharge::SpaceCharge *sce, const geo::GeometryCore *geo, geo::Point_t loc, geo::TPCID TPC, float xsign=1.)
Get the SCE-distorted location (i.e. the location "seen" by the wireplanes)
double Efield(unsigned int planegap=0) const
kV/cm
constexpr double TickPeriod() const noexcept
A single tick period in microseconds.
std::vector< art::Ptr< recob::Hit > > hits
process_name opflash particleana ie ie y
virtual geo::Vector_t GetEfieldOffsets(geo::Point_t const &point) const =0
auto end(FixedBins< T, C > const &) noexcept
bool StubContains(const sbn::StubInfo &A, const sbn::StubInfo &B)
Returns whether stub A contains stub B.
constexpr Vector Xaxis()
Returns a x axis vector of the specified type.
art::Ptr< recob::Hit > vhit_hit
double GetPitch(const geo::GeometryCore *geo, const spacecharge::SpaceCharge *sce, geo::Point_t loc, geo::Vector_t dir, geo::View_t view, geo::TPCID tpc, bool correct_sce, bool track_is_sce_corrected, float xsign=1.)
Computes the track-pitch on a plane given an input direction and location.
double DriftVelocity(double efield=0., double temperature=0.) const
cm/us
The data type to uniquely identify a TPC.
Description of geometry of one entire detector.
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
double ConvertTicksToX(double ticks, int p, int t, int c) const
art::Ptr< sbn::VertexHit > vhit
bool WireIDsIntersect(WireID const &wid1, WireID const &wid2, geo::Point_t &intersection) const
Computes the intersection between two wires.
WireGeo const & Wire(geo::WireID const &wireid) const
Returns the specified wire.
virtual geo::Vector_t GetPosOffsets(geo::Point_t const &point) const =0
Contains all timing reference information for the detector.
geo::Point_t TwoStubEndPosition(const sbn::StubInfo &A, const sbn::StubInfo &B, const geo::GeometryCore *geo, const spacecharge::SpaceCharge *sce, const detinfo::DetectorPropertiesData &dprop)
Returns an updated end position of a stub after merging across two planes.
double GetEfield(const detinfo::DetectorPropertiesData &dprop, const spacecharge::SpaceCharge *sce, geo::Point_t loc, geo::TPCID TPC, bool correct_loc_sce, float xsign=1.)
Get the E-Field in the presence of space charge.
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
float StubPeakChargeOffset(const sbn::StubInfo &A, const sbn::StubInfo &B)
Difference of the endpoint charge between two stubs.
TPCID_t TPC
Index of the TPC within its cryostat.
virtual bool EnableCalSpatialSCE() const =0
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
double WireAngleToVertical(geo::View_t view, geo::TPCID const &tpcid) const
Returns the angle of the wires in the specified view from vertical.
virtual bool EnableSimEfieldSCE() const =0
BEGIN_PROLOG could also be cout