13 #include "nug4/MagneticFieldServices/MagneticFieldService.h" 14 #include "CoreUtils/ServiceUtil.h" 50 const float momentum_beg,
51 const float momentum_end,
71 auto const* magFieldService = gar::providerFrom<mag::MagneticFieldService>();
72 G4ThreeVector zerovec(0,0,0);
73 G4ThreeVector magfield = magFieldService->FieldAtPoint(zerovec);
91 for (
size_t i=0; i<15; ++i)
101 float Pt_beg = momentum_beg * TMath::Sqrt(
std::max(1
E-6,1-TMath::Sq(vtxDir[0])));
102 if (momentum_beg > 0)
112 if (vtxDir[1] != 0 || vtxDir[2] != 0)
114 fTrackParBeg[4] = TMath::ATan(vtxDir[0]/TMath::Sqrt(vtxDir[1]*vtxDir[1] + vtxDir[2]*vtxDir[2]));
123 float Pt_end = momentum_end * TMath::Sqrt(
std::max(1
E-6,1-TMath::Sq(endDir[0])));
124 if (momentum_end > 0)
134 if (endDir[1] != 0 || endDir[2] != 0)
136 fTrackParEnd[4] = TMath::ATan(endDir[0]/TMath::Sqrt(endDir[1]*endDir[1] + endDir[2]*endDir[2]));
148 const float lengthbackwards,
151 const float *trackparbeg,
152 const float *covmatbeg,
153 const float chisqforward,
155 const float *trackparend,
156 const float *covmatend,
157 const float chisqbackward,
169 auto const* magFieldService = gar::providerFrom<mag::MagneticFieldService>();
170 G4ThreeVector zerovec(0,0,0);
171 G4ThreeVector magfield = magFieldService->FieldAtPoint(zerovec);
174 for (
size_t i=0; i< 5; ++i)
178 for (
size_t j=i; j<5; ++j)
192 if (trackparbeg[2] != 0)
195 fMomentum_beg = poverpt * TMath::Abs((1.0
E-2)*0.3*magfield[0]/trackparbeg[2]);
203 fEnd[1] = trackparend[0];
204 fEnd[2] = trackparend[1];
208 if (trackparend[2] != 0)
211 fMomentum_end = poverpt * TMath::Abs((1.0
E-2)*0.3*magfield[0]/trackparend[2]);
233 return ( Xcross>0 ? -1 : +1 );
240 return ( Xcross>0 ? -1 : +1 );
248 for (
size_t i=0; i<5; ++i) {
249 for (
size_t j=i; j<5; ++j) {
259 for (
size_t i=0; i<5; ++i) {
260 for (
size_t j=i; j<5; ++j) {
270 const float thisXend,
const float farXend,
float *
dir) {
274 dir[0] = TMath::Tan(tparms[4]);
275 dir[1] = TMath::Sin(tparms[3]);
276 dir[2] = TMath::Cos(tparms[3]);
279 if ( dir[0]>0 && farXend<thisXend ) sigh = -1;
280 if ( dir[0]<0 && farXend>thisXend ) sigh = -1;
281 float norm = sigh * TMath::Sqrt( 1.0 + dir[0]*dir[0]);
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
float fChisqBackward
chisquared backward fit
bool operator!=(const Track &rhs) const
float fChisqForward
chisquared forward fit
float fCovMatBeg[15]
covariance matrix at beginning of track – packed in a 1D array, assuming symmetry ...
float fMomentum_beg
momentum of the track at the vertex in GeV/c
float fCovMatEnd[15]
covariance matrix at end of track
double fTime
time in ns from trigger
float fTrackParBeg[5]
Track parameters at beginning of track y, z, curvature, phi, lambda – 5-parameter track (cm...
float fLengthforwards
length of the track in cm from forwards fit
static gar::rec::IDNumber const FirstNumber
float fLengthbackwards
length of the track in cm from backwards fit
size_t fNHits
number of hits
static IDNumberGen * create(IDNumber iniValue=std::numeric_limits< IDNumber >::max())
float fMomentum_end
momentum of the track at the end in GeV/c
float fVertex[3]
track vertex position in cm – == "beginning" of track. Arbitrary choice made by patrec ...
static int max(int a, int b)
bool operator==(const Track &rhs) const
auto norm(Vector const &v)
Return norm of the specified vector.
float fEndDir[3]
track end direction
float fTrackParEnd[5]
Track parameters at end of track y, z, curvature, phi, lambda – 5-parameter track (cm...
General GArSoft Utilities.
float fEnd[3]
track end position in cm
float fVtxDir[3]
track vertex direction
void FindDirectionFromTrackParameters(const float *tparms, const float thisXend, const float farXend, float *dir)
gar::rec::IDNumber fIDnumero
gar::rec::IDNumber getIDNumber() const
void CovMatBegSymmetric(float *cmb) const
void CovMatEndSymmetric(float *cme) const