15 #include "FairRootManager.h"
17 #include "TClonesArray.h"
21 , fDigiScheme(nullptr)
26 , fStsClusters(nullptr)
30 if (vec.empty()) {
return 0.; }
32 auto mid = vec.size() / 2;
33 std::nth_element(vec.begin(), vec.begin() + mid, vec.end());
34 auto median = vec[mid];
35 if (!(vec.size() & 1)) {
36 auto max_it = std::max_element(vec.begin(), vec.begin() + mid);
37 median = (*max_it + median) / 2.0;
44 FairRootManager* ioman = FairRootManager::Instance();
47 fStsClusters = (TClonesArray*) ioman->GetObject(
"StsCluster");
53 std::vector<double> dEdxAllveto;
56 for (
int iHit = 0; iHit < cbmStsTrack->
GetNofStsHits(); ++iHit) {
57 bool frontVeto = kFALSE, backVeto = kFALSE;
61 double x,
y, z, xNext, yNext, zNext;
69 xNext = stsHitNext->
GetX();
70 yNext = stsHitNext->
GetY();
71 zNext = stsHitNext->
GetZ();
72 dr =
sqrt((xNext -
x) * (xNext -
x) + (yNext -
y) * (yNext -
y)
73 + (zNext - z) * (zNext - z))
82 if (!frontCluster || !backCluster) {
84 <<
"CbmStsTrackFinder::CalculateEloss: no front or back cluster";
89 for (
int iDigi = 0; iDigi < frontCluster->
GetNofDigis(); ++iDigi) {
95 for (
int iDigi = 0; iDigi < backCluster->
GetNofDigis(); ++iDigi) {
102 if (!frontVeto) dEdxAllveto.push_back((frontCluster->
GetCharge()) / dr);
103 if (!backVeto) dEdxAllveto.push_back((backCluster->
GetCharge()) / dr);
107 if (dEdxAllveto.size() != 0) dEdXSTS =
VecMedian(dEdxAllveto);
112 Int_t nStsTracks =
fTracks->GetEntriesFast();
113 for (Int_t stsTrackIndex = 0; stsTrackIndex < nStsTracks; stsTrackIndex++) {