39 Int_t index = cluster.
GetDigi(0);
46 auto& asic =
module->GetParAsic(digi->GetChannel());
48 Double_t time = digi->GetTime();
49 Double_t timeError = asic.GetTimeResol();
50 Double_t charge = asic.AdcToCharge(digi->GetCharge());
51 Double_t xError = 1. /
sqrt(24.);
63 Int_t index1 = cluster.
GetDigi(0);
64 Int_t index2 = cluster.
GetDigi(1);
71 auto& asic2 = modPar->
GetParAsic(digi2->GetChannel());
74 Double_t eNoiseSq = 0.5 * (asic1.GetNoise() * asic1.GetNoise() + asic2.GetNoise() * asic2.GetNoise());
75 Double_t chargePerAdc =
76 0.5 * (asic1.GetDynRange() / Double_t(asic1.GetNofAdc()) + asic2.GetDynRange() / Double_t(asic2.GetNofAdc()));
77 Double_t eDigitSq = chargePerAdc * chargePerAdc / 12.;
80 UInt_t chan2 = digi2->GetChannel();
81 assert(chan2 == chan1 + 1 || chan2 == chan1 - modPar->
GetNofChannels() / 2 + 1);
84 Double_t x1 = Double_t(chan1);
85 Double_t q1 = asic1.AdcToCharge(digi1->GetCharge());
86 Double_t q2 = asic2.AdcToCharge(digi2->GetCharge());
93 Double_t eq1sq = width1 * width1 + eNoiseSq + eDigitSq;
95 Double_t eq2sq = width2 * width2 + eNoiseSq + eDigitSq;
98 Double_t time = 0.5 * (digi1->GetTime() + digi2->GetTime());
99 Double_t timeError = 0.5 * (asic1.GetTimeResol() + asic2.GetTimeResol()) * 0.70710678;
103 Double_t
x = x1 + 0.5 + (q2 - q1) / 3. / TMath::Max(q1, q2);
113 ex0sq = (q2 - q1) * (q2 - q1) / q2 / q2 / 72.;
114 ex1sq = eq1sq / q2 / q2 / 9.;
115 ex2sq = eq2sq * q1 * q1 / q2 / q2 / q2 / q2 / 9.;
118 ex0sq = (q2 - q1) * (q2 - q1) / q1 / q1 / 72.;
119 ex1sq = eq1sq * q2 * q2 / q1 / q1 / q1 / q1 / 9.;
120 ex2sq = eq2sq / q1 / q1 / 9.;
122 Double_t xError = TMath::Sqrt(ex0sq + ex1sq + ex2sq);
126 Double_t charge = q1 + q2;
139 Int_t chanF = 9999999;
147 Double_t prevChannel = 0;
148 Double_t tResolSum = 0.;
150 for (Int_t iDigi = 0; iDigi < cluster.
GetNofDigis(); iDigi++) {
152 Int_t index = cluster.
GetDigi(iDigi);
161 Double_t eNoiseSq = asic.
GetNoise() * asic.GetNoise();
162 Double_t chargePerAdc = asic.GetDynRange() / Double_t(asic.GetNofAdc());
163 Double_t eDigitSq = chargePerAdc * chargePerAdc / 12.;
164 tResolSum += asic.GetTimeResol();
166 tSum += digi->GetTime();
167 Double_t charge = asic.AdcToCharge(digi->GetCharge());
169 Double_t eChargeSq = lWidth * lWidth + eNoiseSq + eDigitSq;
172 if (iDigi > 0) assert(channel == prevChannel + 1 || channel == prevChannel - modPar->
GetNofChannels() / 2 + 1);
173 prevChannel = channel;
198 Double_t tError = (tResolSum / Double_t(cluster.
GetNofDigis())) / TMath::Sqrt(Double_t(cluster.
GetNofDigis()));
199 Double_t qSum = qF + qM + qL;
206 Double_t
x = 0.5 * (Double_t(chanF + chanL) + (qL - qF) / qM);
212 Double_t exFsq = eqFsq / qM / qM / 4.;
213 Double_t exMsq = eqMsq * (qL - qF) * (qL - qF) / qM / qM / qM / qM / 4.;
214 Double_t exLsq = eqLsq / qM / qM / 4.;
215 Double_t xError = TMath::Sqrt(exFsq + exMsq + exLsq);
220 assert(
x >= chanF &&
x <= chanL);
223 cluster.
SetSize(chanL - chanF + 1);
238 case 1:
AnaSize1(cluster, modPar);
break;
239 case 2:
AnaSize2(cluster, modPar);
break;
240 default:
AnaSizeN(cluster, modPar);
break;
253 for (Int_t iDigi = 0; iDigi < cluster.
GetNofDigis(); iDigi++) {
254 Int_t index = cluster.
GetDigi(iDigi);
259 Double_t charge = asic.
AdcToCharge(digi->GetCharge());
261 xSum += charge * Double_t(channel);
ClassImp(CbmStsAlgoAnaCluster) CbmStsAlgoAnaCluster
Data class for STS clusters.
CbmDigiManager * fDigiMan
friend fvec sqrt(const fvec &a)
int32_t GetDigi(int32_t index) const
Get digi at position index.
int32_t GetNofDigis() const
Number of digis in cluster.
const Digi * Get(Int_t index) const
Get a digi object.
Determination of cluster parameters.
CbmStsPhysics * fPhysics
Interface to digi data.
void AnaSize2(CbmStsCluster &cluster, const CbmStsParModule *modPar)
Analyse two-digi cluster.
CbmDigiManager * fDigiMan
Double_t WeightedMean(CbmStsCluster &cluster, const CbmStsParModule *modPar)
Weighted mean cluster position.
void Exec(CbmStsCluster &cluster, const CbmStsParModule *module)
Algorithm execution.
void AnaSize1(CbmStsCluster &cluster, const CbmStsParModule *modPar)
Analyse single-digi cluster.
CbmStsAlgoAnaCluster()
Constructor.
void AnaSizeN(CbmStsCluster &cluster, const CbmStsParModule *modPar)
Analyse cluster with more than two digis.
Data class for STS clusters.
void SetSize(int32_t size)
Set size of the cluster (number of channels)
void SetProperties(double charge, double position, double positionError, double time=0., double timeError=0.)
Data class for a single-channel message in the STS.
XPU_D uint16_t GetChannel() const
Channel number in module @value Channel number.
double AdcToCharge(uint16_t adc) const
Charge from ADC channel (mean)
double GetNoise() const
Electronic noise RMS.
Parameters for one STS module.
uint32_t GetNofChannels() const
Number of channels.
const CbmStsParAsic & GetParAsic(uint32_t channel) const
ASIC parameters for a given channel.
Auxiliary class for physics processes in Silicon.
Double_t LandauWidth(Double_t mostProbableCharge)
Half width at half max of Landau distribution in ultra-relativistic case.