38 fTracks{new
TClonesArray(
"THaTrack", kInitTrackMultiplicity)},
39 fTrackPID{new
TClonesArray(
"THaPIDinfo", kInitTrackMultiplicity)},
40 fTrackingDetectors{new
TList},
41 fNonTrackingDetectors{new
TList},
44 fGoldenTrack{nullptr},
45 fThetaGeo{0.0}, fPhiGeo{0.0}, fThetaSph{0.0}, fPhiSph{0.0},
46 fSinThGeo{0.0}, fCosThGeo{1.0}, fSinPhGeo{0.0}, fCosPhGeo{1.0},
47 fSinThSph{0.0}, fCosThSph{1.0}, fSinPhSph{0.0}, fCosPhSph{1.0},
97 Error(
"AddDetector",
"Detector is not a THaSpectrometerDetector. "
98 "Detector not added. Detector object deleted.");
107 if( sdet->IsTracking() )
140 assert(
dynamic_cast<THaTrack*
>(theTrack));
141 if(
THaPIDinfo* pid = theTrack->GetPIDinfo() ) {
211 {
"tr.n",
"Number of tracks",
"GetNTracks()" },
212 {
"tr.x",
"Track x coordinate (m)",
"fTracks.THaTrack.fX" },
213 {
"tr.y",
"Track x coordinate (m)",
"fTracks.THaTrack.fY" },
214 {
"tr.th",
"Tangent of track theta angle",
"fTracks.THaTrack.fTheta" },
215 {
"tr.ph",
"Tangent of track phi angle",
"fTracks.THaTrack.fPhi" },
216 {
"tr.p",
"Track momentum (GeV)",
"fTracks.THaTrack.fP" },
217 {
"tr.flag",
"Track status flag",
"fTracks.THaTrack.fFlag" },
218 {
"tr.chi2",
"Track's chi2 from hits",
"fTracks.THaTrack.fChi2" },
219 {
"tr.ndof",
"Track's NDoF",
"fTracks.THaTrack.fNDoF" },
220 {
"tr.d_x",
"Detector x coordinate (m)",
"fTracks.THaTrack.fDX" },
221 {
"tr.d_y",
"Detector y coordinate (m)",
"fTracks.THaTrack.fDY" },
222 {
"tr.d_th",
"Detector tangent of theta",
"fTracks.THaTrack.fDTheta" },
223 {
"tr.d_ph",
"Detector tangent of phi",
"fTracks.THaTrack.fDPhi" },
224 {
"tr.r_x",
"Rotated x coordinate (m)",
"fTracks.THaTrack.fRX" },
225 {
"tr.r_y",
"Rotated y coordinate (m)",
"fTracks.THaTrack.fRY" },
226 {
"tr.r_th",
"Rotated tangent of theta",
"fTracks.THaTrack.fRTheta" },
227 {
"tr.r_ph",
"Rotated tangent of phi",
"fTracks.THaTrack.fRPhi" },
228 {
"tr.tg_y",
"Target y coordinate",
"fTracks.THaTrack.fTY"},
229 {
"tr.tg_th",
"Tangent of target theta angle",
"fTracks.THaTrack.fTTheta"},
230 {
"tr.tg_ph",
"Tangent of target phi angle",
"fTracks.THaTrack.fTPhi"},
231 {
"tr.tg_dp",
"Target delta",
"fTracks.THaTrack.fDp"},
232 {
"tr.px",
"Lab momentum x (GeV)",
"fTracks.THaTrack.GetLabPx()"},
233 {
"tr.py",
"Lab momentum y (GeV)",
"fTracks.THaTrack.GetLabPy()"},
234 {
"tr.pz",
"Lab momentum z (GeV)",
"fTracks.THaTrack.GetLabPz()"},
235 {
"tr.vx",
"Vertex x (m)",
"fTracks.THaTrack.GetVertexX()"},
236 {
"tr.vy",
"Vertex y (m)",
"fTracks.THaTrack.GetVertexY()"},
237 {
"tr.vz",
"Vertex z (m)",
"fTracks.THaTrack.GetVertexZ()"},
238 {
"tr.pathl",
"Pathlength from tg to fp (m)",
"fTracks.THaTrack.GetPathLen()"},
239 {
"tr.time",
"Time of track@Ref Plane (s)",
"fTracks.THaTrack.GetTime()"},
240 {
"tr.dtime",
"uncer of time (s)",
"fTracks.THaTrack.GetdTime()"},
241 {
"tr.beta",
"Beta of track",
"fTracks.THaTrack.GetBeta()"},
242 {
"tr.dbeta",
"uncertainty of beta",
"fTracks.THaTrack.GetdBeta()"},
243 {
"status",
"Bits of completed analysis stages",
"fStagesDone" },
277 if( theDetector->IsTracking() )
282 if( theDetector->IsPid() )
301 new( (*fTrackPID)[i])
THaPIDinfo(ndet, npart);
313 while(
auto* theTrackDetector =
317 if(
fDebug>1 ) cout <<
"Call CoarseTrack() for "
318 << theTrackDetector->GetName() <<
"... ";
320 theTrackDetector->CoarseTrack( *
fTracks );
322 if(
fDebug>1 ) cout <<
"done.\n";
342 while(
auto* theNonTrackDetector =
346 if(
fDebug>1 ) cout <<
"Call CoarseProcess() for "
347 << theNonTrackDetector->GetName() <<
"... ";
349 theNonTrackDetector->CoarseProcess( *
fTracks );
351 if(
fDebug>1 ) cout <<
"done.\n";
370 while(
auto* theTrackDetector =
374 if(
fDebug>1 ) cout <<
"Call FineTrack() for "
375 << theTrackDetector->GetName() <<
"... ";
377 theTrackDetector->FineTrack( *
fTracks );
379 if(
fDebug>1 ) cout <<
"done.\n";
424 while(
auto* theNonTrackDetector =
428 if(
fDebug>1 ) cout <<
"Call FineProcess() for "
429 << theNonTrackDetector->GetName() <<
"... ";
431 theNonTrackDetector->FineProcess( *
fTracks );
433 if(
fDebug>1 ) cout <<
"done.\n";
510 if(
pt.Z() != 0.0 ) {
511 ray[1] =
pt.X() /
pt.Z();
512 ray[3] =
pt.Y() /
pt.Z();
514 ray[0] = tvertex.
X() - tvertex.
Z() * ray[1];
515 ray[2] = tvertex.
Y() - tvertex.
Z() * ray[3];
517 ray[0] = ray[1] = ray[2] = ray[3] = 0.0;
545 TVector3 nx( st*st*sp*cp/norm, -norm, st*ct*sp/norm );
546 TVector3 ny( ct/norm, 0.0, -st*cp/norm );
548 if( bend_down ) { nx *= -1.0; ny *= -1.0; }
560 if( err )
return err;
566 Double_t off_x = 0.0, off_y = 0.0, off_z = 0.0;
568 const DBRequest req[] = {
570 {
"phi", &ph,
kDouble, 0,
true },
573 {
"off_x", &off_x,
kDouble, 0,
true },
574 {
"off_y", &off_y,
kDouble, 0,
true },
575 {
"off_z", &off_z,
kDouble, 0,
true },
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char mode
void Clear(Option_t *option="") override
static void GeoToSph(Double_t th_geo, Double_t ph_geo, Double_t &th_sph, Double_t &ph_sph)
virtual Int_t ReadRunDatabase(const TDatime &date)
static Int_t LoadDB(FILE *file, const TDatime &date, const DBRequest *request, const char *prefix, Int_t search=0, const char *here="THaAnalysisObject::LoadDB")
static Int_t DefineVarsFromList(const void *list, EType type, EMode mode, const char *def_prefix, const TObject *obj, const char *prefix, const char *here, const char *comment_subst="")
virtual FILE * OpenRunDBFile(const TDatime &date)
virtual Int_t AddDetector(THaDetector *det, Bool_t quiet=false, Bool_t first=false)
virtual void Clear(Option_t *opt="")
Bool_t IsDone(UInt_t stage) const
virtual Int_t AddDetector(THaDetector *det, Bool_t quiet=false, Bool_t first=false)
TList * fTrackingDetectors
virtual Bool_t HasVertex() const
virtual Int_t CoarseReconstruct()
virtual void DefinePidParticles()
Int_t GetNpidDetectors() const
void SetCentralAngles(Double_t th, Double_t ph, Bool_t bend_down)
Int_t GetNpidParticles() const
virtual void LabToTransport(const TVector3 &vertex, const TVector3 &pvect, TVector3 &tvertex, Double_t *ray) const
virtual Int_t TrackCalc()=0
virtual Int_t AddPidParticle(const char *shortname, const char *name, Double_t mass, Int_t charge=0)
virtual Int_t ReadRunDatabase(const TDatime &date)
virtual void TransportToLab(Double_t p, Double_t th, Double_t ph, TVector3 &pvect) const
virtual void Clear(Option_t *opt="")
virtual Int_t CoarseTrack()
static const Int_t kInitTrackMultiplicity
TObjArray * fPidDetectors
virtual Int_t Reconstruct()
virtual Int_t FindVertices(TClonesArray &tracks)=0
virtual const TVector3 & GetVertex() const
virtual Int_t DefineVariables(EMode mode=kDefine)
THaSpectrometer(const char *name, const char *description)
TList * fNonTrackingDetectors
virtual void TrackToLab(THaTrack &track, TVector3 &pvect) const
TObjArray * fPidParticles
virtual ~THaSpectrometer()
void SetSpectrometer(THaSpectrometer *s)
Double_t GetTTheta() const
virtual void VertexClear()
void Clear(Option_t *option="") override
void Add(TObject *obj) override
void Clear(Option_t *option="") override
void Delete(Option_t *option="") override
TObject * At(Int_t idx) const override
Bool_t IsEmpty() const override
Int_t GetLast() const override
void Add(TObject *obj) override
virtual void Error(const char *method, const char *msgfmt,...) const
TRotation & SetToIdentity()
TRotation Inverse() const
TRotation & RotateAxes(const TVector3 &newX, const TVector3 &newY, const TVector3 &newZ)
void SetXYZ(Double_t x, Double_t y, Double_t z)
constexpr Double_t DegToRad()
Double_t Sqrt(Double_t x)