124 const char*
const here =
"SetRefDet";
145 const char*
const here =
"SetRefDet";
157 "Is it a THaNonTrackingDetector?");
172 while(
auto* theTrackDetector =
175 if(
fDebug>1 ) cout <<
"Call FineTrack() for "
176 << theTrackDetector->GetName() <<
"... ";
178 theTrackDetector->FindVertices(
tracks );
180 if(
fDebug>1 ) cout <<
"done.\n";
191 theTrack->SetIndex(i);
235 if ( !Tracks || !
fRefDet )
return -1;
243 for (
Int_t i=0; i < ntrack; i++ ) {
244 auto* track =
static_cast<THaTrack*
>(Tracks->
At(i));
249 Double_t wgt_sum=0.,wx2=0.,wx=0.,wxy=0.,wy=0.;
258 const auto* trh =
static_cast<THaTrackProj*
>(sc->GetTrackHits()->At(i));
261 if (pad<0 || pad>=sc->GetNelem())
continue;
262 Double_t pathl = (trh->GetPathLen()-pathlref);
263 const auto& padinfo = sc->GetPad(pad);
268 if (wgt>0) wgt = 1./(wgt*wgt);
272 wx2 += wgt*pathl*pathl;
274 wxy += wgt*pathl*
time;
287 time = (wx2*wy-wx*wxy)/delta;
289 Double_t invbeta = (wgt_sum*wxy-wx*wy)/delta;
292 beta = 1./(
c*invbeta);
297 track->SetBeta(
beta);
298 track->SetdBeta(dbeta);
299 track->SetTime(
time);
static const char *const here
void Sort(Int_t upto=kMaxInt) override
virtual Int_t GetSize() const
virtual const char * Here(const char *) const
virtual THaDetector * GetDetector(const char *name)
virtual Int_t SetRefDet(const char *name)
Bool_t GetTrSorting() const
Bool_t SetTrSorting(Bool_t set=false)
Bool_t AutoStandardDetectors(Bool_t set=true)
THaNonTrackingDetector * fRefDet
THaHRS(const char *name, const char *description)
virtual Int_t FindVertices(TClonesArray &tracks)
virtual Int_t TrackCalc()
virtual Int_t TrackTimes(TClonesArray *tracks)
const TClonesArray * GetTrackHits() const
virtual Int_t AddDetector(THaDetector *det, Bool_t quiet=false, Bool_t first=false)
TList * fTrackingDetectors
TList * fNonTrackingDetectors
Double_t GetPathLen() const
TObject * FindObject(const char *name) const override
TObject * At(Int_t idx) const override
Int_t GetLast() const override
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void Error(const char *method, const char *msgfmt,...) const
double beta(double x, double y)
Double_t Sqrt(Double_t x)