CbmRoot
Loading...
Searching...
No Matches
CbmStsHit.cxx
Go to the documentation of this file.
1/* Copyright (C) 2006-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese [committer], Florian Uhlig, Andrey Lebedev */
4
14#include "CbmStsHit.h"
15
16#include <TVector3.h> // for TVector3
17
18#include <iomanip> // for operator<<, setprecision
19#include <sstream> // for operator<<, basic_ostream, char_traits
20
21using namespace std;
22
23// ----- Default constructor
24CbmStsHit::CbmStsHit() : CbmPixelHit(), fFrontClusterId(-1), fBackClusterId(-1), fDu(-1.), fDv(-1.)
25{
26 SetTime(-1.);
27 SetTimeError(-1.);
28}
29
30
31// ----- Constructor with parameters
32CbmStsHit::CbmStsHit(int32_t address, const TVector3& pos, const TVector3& dpos, double dxy, int32_t frontClusterId,
33 int32_t backClusterId, double time, double timeError, double du, double dv)
34 : CbmPixelHit(address, pos, dpos, dxy, -1)
35 , fFrontClusterId(frontClusterId)
36 , fBackClusterId(backClusterId)
37 , fDu(du)
38 , fDv(dv)
39{
40 SetTime(time);
41 SetTimeError(timeError);
42}
43
44
45// ----- Destructor
47
48
49// --- String output
50string CbmStsHit::ToString() const
51{
52 stringstream ss;
53 ss << "StsHit: address " << GetAddress() << " | time " << GetTime() << " +- " << GetTimeError() << " | Position ("
54 << std::setprecision(6) << GetX() << ", " << GetY() << ", " << GetZ() << ") cm | Error (" << GetDx() << ", "
55 << GetDy() << ", " << GetDz() << ") cm | Cluster (" << fFrontClusterId << ", " << fBackClusterId << ")";
56 return ss.str();
57}
58
59
ClassImp(CbmConverterManager)
TVector3 dpos
Data class for a reconstructed hit in the STS.
void SetTimeError(double error)
Definition CbmHit.h:91
double GetTimeError() const
Definition CbmHit.h:77
double GetDz() const
Definition CbmHit.h:72
double GetTime() const
Definition CbmHit.h:76
int32_t GetAddress() const
Definition CbmHit.h:74
double GetZ() const
Definition CbmHit.h:71
void SetTime(double time)
Definition CbmHit.h:85
double GetDy() const
Definition CbmPixelHit.h:76
double GetDx() const
Definition CbmPixelHit.h:75
double GetY() const
Definition CbmPixelHit.h:74
double GetX() const
Definition CbmPixelHit.h:73
data class for a reconstructed 3-d hit in the STS
Definition CbmStsHit.h:35
int32_t fFrontClusterId
Cluster index front side.
Definition CbmStsHit.h:124
virtual std::string ToString() const
Definition CbmStsHit.cxx:50
int32_t fBackClusterId
Cluster index back side.
Definition CbmStsHit.h:125
virtual ~CbmStsHit()
Definition CbmStsHit.cxx:46
Hash for CbmL1LinkKey.