9#include "CbmStsCluster.h"
10#include "CbmStsDigiMatch.h"
11#include "CbmStsDigiScheme.h"
13#include "CbmStsPoint.h"
14#include "CbmStsSector.h"
15#include "CbmStsStation.h"
16#include "CbmStsTrack.h"
17#include "FairRootManager.h"
18#include "FairRunAna.h"
19#include "TMVA/Tools.h"
21#include <TClonesArray.h>
25#include <TObjString.h>
40#include <TStopwatch.h>
44static Double_t workTime = 0.0;
48 : FairTask(
"STS Vector Finder V9")
65 , fMatBudgetFileName(
"")
72 fGemConfigFile(
"GemRun8.xml")
73 , fSilConfigFile(
"SiliconRun8.xml")
75 for (
int j = 0; j < 4; ++j)
76 fClusArray[j] =
nullptr;
90 FairRootManager* ioman = FairRootManager::Instance();
92 cout <<
"-E- BmnStsVectorFinderV9::Init: " <<
"RootManager not instantiated!" << endl;
97 fClusArray[0] = (TClonesArray*)ioman->GetObject(
"StsCluster");
102 fClusArray[0] = (TClonesArray*)ioman->GetObject(
"BmnSiliconUpperCluster");
103 fClusArray[1] = (TClonesArray*)ioman->GetObject(
"BmnSiliconLowerCluster");
104 fClusArray[2] = (TClonesArray*)ioman->GetObject(
"BmnGemUpperCluster");
105 fClusArray[3] = (TClonesArray*)ioman->GetObject(
"BmnGemLowerCluster");
106 for (
int j = 0; j < 4; ++j) {
108 if (!fClusArray[0] && !fClusArray[2]) {
109 cout <<
"-W- BmnStsVectorFinderV9::Init: " <<
"No BmnCluster array!" << j << endl;
115 fHitArray = (TClonesArray*)ioman->GetObject(
"StsHit");
122 fTrackArray = (TClonesArray*)ioman->GetObject(
"StsTrack");
129 fDigiMatches = (TClonesArray*)ioman->GetObject(
"StsDigiMatch");
136 fStsPoints = (TClonesArray*)ioman->GetObject(
"StsPoint");
143 fSilPoints = (TClonesArray*)ioman->GetObject(
"SiliconPoint");
148 fVspPoints = (TClonesArray*)ioman->GetObject(
"VSPPoint");
154 fVectorArray =
new TClonesArray(
"CbmStsTrack");
155 ioman->Register(
"StsVector",
"STS", fVectorArray, kTRUE);
161 fStream3out.open(
"triplets.txt", std::ofstream::out);
163 if (fOut && fOut % 2 == 0) {
167 fStream2out.open(
"doublets.txt", std::ofstream::out);
178 static Int_t nHitsMin[20] = {7, 5, 4, 4};
181 static Double_t dTanX[20] = {0.002, 0.003, 0.002, 0.008};
182 static Double_t dTanXTMVA[20] = {0.003, 0.0045, 0.003, 0.012};
183 static Double_t dTanXB0[20] = {0.001, 0.002, 0.002, 0.002};
186 static Double_t dTanY[20] = {0.02, 0.02, 0.02, 0.03};
187 static Double_t dTanYTMVA[20] = {0.015, 0.03, 0.03, 0.045};
188 static Double_t dTanYB0[20] = {0.01, 0.02, 0.02, 0.02};
190 static Double_t dTanY3[20] = {0.03, 0.02, 0.015, 0.015};
191 static Double_t dTanY3TMVA[20] = {0.015, 0.03, 0.03, 0.045};
192 static Double_t dTanY3B0[20] = {0.01, 0.02, 0.02, 0.02};
193 static Double_t dTanXzero[20] = {0.01, 0.02, 0.02, 0.02};
196 static Double_t ptCut[20] = {1.0, 0.7, 0.3, 0.1};
197 static Double_t ptCutB0[20] = {1., 1., 1., 1.};
199 static Double_t curvSta[20] = {
200 12.0, 12.0, 12.0, 7.5, 5.5, 4.5,
201 3.6, 3.0, 3.0, 3.0, 3.0};
202 static Double_t curvSta41[20] = {
203 12.0, 12.0, 12.0, 12.0, 7.5, 5.5, 4.5,
204 3.6, 3.0, 3.0, 3.0, 3.0};
207 static Double_t phiXZ[20] = {0.76, 0.69, 0.69, 0.95, 0.74, 0.60, 0.51, 0.44, 0.39, 0.35};
211 static Double_t phiXZ4[20] = {0.60, 0.63, 0.61, 0.62, 0.95, 0.74,
212 0.60, 0.51, 0.44, 0.39, 0.35};
213 static Double_t phiXZ41[20] = {1.00, 0.60, 0.63, 0.61, 0.62, 0.95,
214 0.74, 0.60, 0.51, 0.44, 0.39, 0.35};
215 static Double_t tanXmax[20] = {0.95, 0.83, 0.83, 1.40, 0.91,
216 0.68, 0.56, 0.47, 0.41, 0.37};
219 static Double_t tanXmax4[20] = {0.68, 0.73, 0.69, 0.71, 1.40, 0.91,
220 0.68, 0.56, 0.47, 0.41, 0.37};
221 static Double_t tanXmax41[20] = {1.50, 0.68, 0.73, 0.69, 0.71, 1.40,
222 0.91, 0.68, 0.56, 0.47, 0.41, 0.37};
223 static Double_t zMean[20] = {18.5, 27.2, 35.8, 60.9, 91.7,
224 123.4, 154.0, 185.8, 216.5, 248.0};
228 static Double_t zMean4[20] = {17.6, 26.4, 35.1, 43.7, 63.6, 94.2,
229 126.5, 156.8, 189.0, 219.2, 251.4};
230 static Double_t zMean41[20] = {7.6, 17.6, 26.4, 35.1, 43.7, 63.6,
231 94.2, 126.5, 156.8, 189.0, 219.2, 251.4};
234 FairField* magField = FairRunAna::Instance()->GetField();
235 if (magField ==
nullptr) {
236 LOG(error) <<
"BmnStsVectorFinderV9::Init: magField has null pointer";
239 fBy = TMath::Abs(magField->GetBy(0.0, 0.0, 135.0)) / 10;
241 fNhitsMin = nHitsMin;
242 fdTanX = (fUseTMVA) ? dTanXTMVA : dTanX;
243 fdTanY = (fUseTMVA) ? dTanYTMVA : dTanY;
244 fdTanY3 = (fUseTMVA) ? dTanY3TMVA : dTanY3;
253 fdTanXB0 = dTanXzero;
254 fPhiXZ = (fNSi == 4) ? phiXZ4 : phiXZ;
257 fTanXmax = (fNSi == 4) ? tanXmax4 : tanXmax;
259 fTanXmax = tanXmax41;
260 fZmean = (fNSi == 4) ? zMean4 : zMean;
266 fCurvSta = curvSta41;
268 for (
int j = 0; j < 20; ++j)
269 if (fPTcut[j] > 0.001)
270 fPTcut[j] = 1 / fPTcut[j];
280 for (Int_t j = 0; j < 20; ++j) {
289 for (
int j = 0; j < 20; ++j)
290 fCurvSta[j] *= (0.8 / fBy);
295 TString fileGraphs = gSystem->ExpandPathName(
"$VMCWORKDIR");
296 fileGraphs +=
"/parameters/reco/";
298 fileGraphs +=
"fitGraphs_8kG.txt";
300 fileGraphs +=
"fitGraphs_8kG_vsp.txt";
301 ReadTxInfo(fileGraphs);
303 if (fMatBudgetFileName !=
"")
314 TString pathConfig = gSystem->Getenv(
"VMCWORKDIR");
315 fGemStationSet =
new BmnGemStripStationSet(pathConfig +
"/parameters/gem/XMLConfigs/" + fGemConfigFile);
316 fSilStationSet =
new BmnSiliconStationSet(pathConfig +
"/parameters/silicon/XMLConfigs/" + fSilConfigFile);
318 cout <<
"-I- BmnStsVectorFinderV9: Intialisation successfull" << endl;
324void BmnStsVectorFinderV9::ReadTxInfo(TString fileName)
331 cout <<
" !!! Error opening Tx file " << fileName << endl;
335 TObjArray* tokens = NULL;
336 int ista0 = -1, ista2;
337 vector<Float_t> params(10);
340 chline.ReadLine(fin);
344 tokens = chline.Tokenize(
" ");
345 int ntok = tokens->GetEntriesFast();
350 ista0 = ((TObjString*)tokens->UncheckedAt(j++))->String().Atoi();
351 int ista1 = ((TObjString*)tokens->UncheckedAt(j++))->String().Atoi();
352 ista2 = 100 * ista0 + ista1;
353 if (fStatData.find(ista2) != fStatData.end())
356 fTxStep = ((TObjString*)tokens->UncheckedAt(j))->String().Atof();
357 unordered_map<int, vector<Float_t>> mstat;
358 fStatData[ista2] = mstat;
360 fTanXmax[ista0] = -9;
363 Float_t binc = ((TObjString*)tokens->UncheckedAt(0))->String().Atof();
364 int ilr = ((TObjString*)tokens->UncheckedAt(1))->String().Atoi();
365 Float_t binc1 = binc;
368 if (fTanXmax[ista0] < -8) {
369 fTanXmax[ista0] = TMath::Abs(binc1 - fTxStep / 2);
372 int ibin = FindBin(ista0, fTxStep, binc1);
375 for (
int j = 0; j < 5; ++j)
376 params[ilr * 5 + j] = ((TObjString*)tokens->UncheckedAt(j + 2))->String().Atof();
379 fStatData[ista2][ibin] = params;
388 cout <<
"-I- BmnStsVectorFinderV9: Station info has been read from " << fileName << endl;
401 Fatal(
"Exec",
"No StsHit array");
403 fVectorArray->Delete();
407 for (Int_t j = 0; j < 19; ++j) {
410 fCandCodes[j].clear();
417 nTracks = fTrackArray->GetEntriesFast();
422 const Int_t nPass = 4;
424 for (Int_t j = 0; j < nPass; ++j)
425 fNskips[j] = nsta - fNhitsMin[j];
427 Int_t nHits0 = fHitArray->GetEntriesFast(), idmaxP = 0;
431 fClusMaps[0].clear();
432 fClusMaps[1].clear();
435 for (Int_t ihit = 0; ihit < nHits0; ++ihit) {
437 if (hit->GetZ() > 400.0)
439 Int_t iclusF = hit->
GetDigi(0);
440 Int_t iclusB = hit->
GetDigi(1);
441 fClusMaps[0].insert(pair<Int_t, Int_t>(iclusF, ihit));
442 fClusMaps[1].insert(pair<Int_t, Int_t>(iclusB, ihit));
444 fNsta = TMath::Max(fNsta, ista);
447 set<Int_t> idset = GetHitId(hit, idmaxP);
448 for (set<Int_t>::iterator sit = idset.begin(); sit != idset.end(); ++sit)
449 fHit2id.insert(pair<Int_t, Int_t>(ihit, *sit));
458 for (Int_t ipass = 0; ipass < nPass; ++ipass) {
463 Int_t minHits = (ipass == 0) ? 15 : -fNhitsMin[ipass - 1];
464 TClonesArray* trArray = (ipass == 0) ? fTrackArray : fVectorArray;
465 nHitsOut += ExcludeHits(minHits, trArray);
468 cout <<
"-I- BmnStsVectorFinderV9: start - " << nHits0 <<
", end - " << nHits0 - nHitsOut << endl;
471 Int_t ntr0 = fVectorArray->GetEntriesFast();
490 cout <<
"\n ***** Pass " << ipass <<
": Number of found tracks = " << fVectorArray->GetEntriesFast() - ntr0
491 <<
" " << fVectorArray->GetEntriesFast() <<
"\n"
498 cout <<
"discarded " << discarded <<
" track candidates" << endl;
506 workTime += sw.RealTime();
511Int_t BmnStsVectorFinderV9::ExcludeHits(Int_t minHits, TClonesArray* trArray)
518 nTracks = trArray->GetEntriesFast();
525 unordered_multimap<Int_t, Int_t>::iterator mit;
526 pair<unordered_multimap<Int_t, Int_t>::iterator, unordered_multimap<Int_t, Int_t>::iterator> ret;
528 for (Int_t itra = 0; itra < nTracks; ++itra) {
531 trArray->Remove(track);
537 for (Int_t ihit = 0; ihit < nHitsTr; ++ihit) {
544 if (fNhitsMin[fPass] < -5) {
547 Int_t iclusF = hit->
GetDigi(0);
548 ret = fClusMaps[0].equal_range(iclusF);
549 for (mit = ret.first; mit != ret.second; ++mit) {
551 if (hit1->GetUniqueID() == 0)
553 hit1->SetUniqueID(1);
555 fmapHits[mit->second].used = 1;
557 Int_t iclusB = hit->
GetDigi(1);
558 ret = fClusMaps[1].equal_range(iclusB);
559 for (mit = ret.first; mit != ret.second; ++mit) {
561 if (hit1->GetUniqueID() == 0)
563 hit1->SetUniqueID(1);
565 fmapHits[mit->second].used = 1;
568 if (hit->GetUniqueID() == 0)
572 fmapHits[indx].used = 1;
577 ret = fMap2[ista].equal_range(indx);
578 fMap2[ista].erase(ret.first, ret.second);
580 ret = fMap3[ista].equal_range(indx);
581 for (mit = ret.first; mit != ret.second; ++mit) {
582 candvec cand = fCandVec3[ista][mit->second];
583 string code = MakeCode(cand);
584 fMapCode3[ista].erase(code);
586 fMap3[ista].erase(ret.first, ret.second);
597set<Int_t> BmnStsVectorFinderV9::GetHitId(
CbmStsHit* hit, Int_t& idmaxP)
603 return GetHitIdBmn(hit, idmaxP);
608 Int_t iclusF = hit->
GetDigi(0);
609 Int_t iclusB = hit->
GetDigi(1);
613 map<Int_t, Double_t> indF, indB;
619 for (Int_t j = 0; j < nDigis; ++j) {
621 for (Int_t j1 = 0; j1 < 3; ++j1) {
627 indF[p->GetTrackID()] = mom3.Mag();
633 for (Int_t j = 0; j < nDigis; ++j) {
635 for (Int_t j1 = 0; j1 < 3; ++j1) {
641 indB[p->GetTrackID()] = 1.0;
647 for (map<Int_t, Double_t>::iterator mit = indF.begin(); mit != indF.end(); ++mit) {
648 Int_t
id = (indB.count(mit->first) == 0) ? -mit->first : mit->first;
650 if (
id >= 0 && mit->second > pmax) {
657 if (hit->GetRefIndex() >= 0) {
659 idmaxP = p->GetTrackID();
663 for (map<Int_t, Double_t>::iterator mit = indB.begin(); mit != indB.end(); ++mit) {
664 if (ids.count(mit->first) > 0)
666 ids.insert(-mit->first);
674set<Int_t> BmnStsVectorFinderV9::GetHitIdBmn(
CbmStsHit* hit, Int_t& idmaxP)
682 if (hit->GetRefIndex() == -1 || fStsPoints ==
nullptr || fSilPoints ==
nullptr)
686 FairMCPoint* p =
nullptr;
688 p = (FairMCPoint*)fStsPoints->UncheckedAt(hit->GetRefIndex());
690 p = (FairMCPoint*)fVspPoints->UncheckedAt(hit->GetRefIndex());
692 p = (FairMCPoint*)fSilPoints->UncheckedAt(hit->GetRefIndex());
693 ids.insert(p->GetTrackID());
695 idmaxP = *ids.begin();
702void BmnStsVectorFinderV9::FillHitInfo()
706 for (Int_t ist = 0; ist < fNsta; ++ist) {
712 fSeedVec[ist].clear();
713 fCandVec[ist].clear();
716 fCandVec2[ist].clear();
718 fCandVec3[ist].clear();
720 fMapCode3[ist].clear();
721 fTxBins[ist].clear();
726 Int_t nHits = fHitArray->GetEntriesFast(), idmaxP = 0;
728 cout <<
"nHits " << nHits << endl;
731 for (Int_t ih = 0; ih < nHits; ++ih) {
733 if (hit->GetUniqueID())
735 if (hit->GetZ() > 400.0)
757 if (fExactSel >= 0) {
759 set<Int_t> ids = GetHitId(hit, idmaxP);
760 if (ids.count(fExactSel) == 0)
765 set<Int_t> ids = GetHitId(hit, idmaxP);
775 Double_t dx = hit->GetX() - fXyzv[0];
776 Double_t dy = hit->GetY() - fXyzv[1];
777 Double_t dz = hit->GetZ() - fXyzv[2];
778 Double_t by = (fBy < 0.2) ? 0.8 : fBy;
783 Double_t tanx = dx / dz;
786 fmapHits[ih] = hitinfo(pos, TMath::ATan2(dx, dz) / fPhiXZ[ista] / fZmean[ista] / by,
791 fmapX[ista].insert(pair<Double_t, Int_t>(pos[0], ih));
792 fmapY[ista].insert(pair<Double_t, Int_t>(pos[1], ih));
794 fmapTx[ista].insert(pair<Double_t, Int_t>(fmapHits[ih].tx, ih));
795 fmapTy[ista].insert(pair<Double_t, Int_t>(fmapHits[ih].ty, ih));
797 int ista2 = ista * 100 + ista + 1;
798 int bin = FindBin(ista, fTxBinw, fmapHits[ih].tx);
801 int binStat = FindBin(ista, fTxStep, BinCenterTx(ista, bin, fTxBinw));
804 if (fStatData[ista2].find(binStat) == fStatData[ista2].end())
810 fTxBins[ista].insert(pair<int, int>(bin, ih));
864void BmnStsVectorFinderV9::BuildDoublets()
871 const unordered_map<string, float> scaleMap4 = {
872 {
"01", 1.9}, {
"02", 2.8}, {
"12", 1.0}, {
"13", 1.5}, {
"23", 0.65}, {
"24", 1.4}, {
"34", 0.95},
873 {
"35", 1.5}, {
"45", 1.0}, {
"46", 1.5}, {
"56", 0.7}, {
"57", 1.0}, {
"67", 0.6}, {
"68", 0.7},
874 {
"78", 0.35}, {
"79", 0.5}, {
"89", 0.3}, {
"810", 0.35}, {
"910", 0.25}};
876 const unordered_map<string, float> scaleMap5 = {
877 {
"01", 11.5}, {
"02", 15.0}, {
"12", 1.9}, {
"13", 2.8}, {
"23", 1.0}, {
"24", 1.5}, {
"34", 0.65},
878 {
"35", 1.4}, {
"45", 0.95}, {
"46", 1.5}, {
"56", 1.0}, {
"57", 1.5}, {
"67", 0.7}, {
"68", 1.0},
879 {
"78", 0.6}, {
"79", 0.7}, {
"89", 0.35}, {
"810", 0.5}, {
"910", 0.3}, {
"911", 0.35}, {
"1011", 0.25}};
881 for (Int_t ist = 0; ist < fNsta; ++ist) {
882 fCandVec[ist].clear();
883 fCandVec2[ist].clear();
885 fCandVec3[ist].clear();
887 fMapCode3[ist].clear();
900 const unordered_map<string, float>& scaleMap = (fNSi == 4) ? scaleMap4 : scaleMap5;
904 for (Int_t ista = 0; ista < fNsta - 1; ++ista) {
905 int nHits = fTxBins[ista].size();
911 for (
int istanext = ista + 1; istanext < ista + 3; ++istanext) {
913 if (istanext > fNsta - 1)
915 if (fmapX[istanext].size() == 0)
917 Double_t dty = fdTanY[fPass];
920 int nskips = istanext - (ista + 1);
921 int ibin0 = -99, ista2 = ista * 100 + istanext;
924 string ssta2 = ssta0 +
to_string(istanext);
925 dty *= (scaleMap.find(ssta2)->second);
927 for (unordered_multimap<int, int>::iterator mit = fTxBins[ista].begin(); mit != fTxBins[ista].end(); ++mit)
930 int ih = mit->second;
931 if (fmapHits[ih].used)
936 aaa.stahit[ista] = mit->second;
937 aaa.code =
"-" +
to_string(aaa.stahit[ista]) +
"-";
938 set<Int_t> ids = GetHitId(mit->second, idmaxP);
941 int ibin = mit->first;
946 Float_t dtx[2] = {0};
947 tx = BinCenterTx(ista, ibin, fTxBinw);
950 dtx[0] = -fdTanXB0[fPass] * 2;
951 dtx[1] = fdTanXB0[fPass] * 2;
953 DTxWindow(ista2, tx, ibin / 1000, fPTcut[fPass], dtx);
955 if (istanext < fNSi) {
965 multimap<Double_t, Int_t>::iterator mitxb = fmapTx[istanext].lower_bound(tx + dtx[0]);
966 multimap<Double_t, Int_t>::iterator mitxe = fmapTx[istanext].upper_bound(tx + dtx[1]);
967 for (multimap<Double_t, Int_t>::iterator mit1 = mitxb; mit1 != mitxe; ++mit1)
968 if (fmapHits[mit1->second].used == 0)
969 setTx.insert(mit1->second);
972 Double_t ty = fmapHits[ih].ty;
976 multimap<Double_t, candvec> mapDoublets;
979 multimap<Double_t, Int_t>::iterator mityb = fmapTy[istanext].lower_bound(ty - dty);
980 multimap<Double_t, Int_t>::iterator mitye = fmapTy[istanext].upper_bound(ty + dty);
982 set<Int_t> setTy, intersect;
983 for (multimap<Double_t, Int_t>::iterator mit1 = mityb; mit1 != mitye; ++mit1)
984 if (fmapHits[mit1->second].used == 0)
985 setTy.insert(mit1->second);
986 set_intersection(setTx.begin(), setTx.end(), setTy.begin(), setTy.end(),
987 std::inserter(intersect, intersect.begin()));
990 Double_t xp = fmapHits[ih].xyz[0];
991 Double_t zp = fmapHits[ih].xyz[2];
994 for (set<Int_t>::iterator sit = intersect.begin(); sit != intersect.end(); ++sit) {
996 if (hit->GetUniqueID())
998 if (fmapHits[*sit].used)
1000 if (fBy < 0.2 && TMath::Abs(tx - fmapHits[*sit].tx) > fdTanXB0[fPass])
1004 set<Int_t> ids1 = GetHitId(*sit, idmaxP);
1006 if (idmaxP != aaa.idmaxP)
1010 aaa1.stahit[istanext] = *sit;
1011 Double_t dx = xp - fmapHits[*sit].xyz[0];
1012 Double_t dz = zp - fmapHits[*sit].xyz[2];
1013 aaa1.lengxz = TMath::Sqrt(dx * dx + dz * dz);
1015 Curv3(aaa1, aaa1, aaa1, 0);
1017 && (TMath::Abs(aaa1.momxz) > fPTcut[fPass] || TMath::Abs(aaa1.momxz) > fCurvSta[ista]))
1019 else if (fBy < 0.2 && TMath::Abs(aaa1.momxz) / fZmean[1] * fZmean[istanext] > fPTcut[fPass])
1023 aaa1.ty = (fmapHits[ih].xyz[1] - fmapHits[*sit].xyz[1]) / aaa1.lengxz;
1024 aaa1.tx = tx - fmapHits[*sit].tx;
1028 if (fOut && fOut % 2 == 0) {
1030 if (fMap2Out.find(code) == fMap2Out.end())
1031 fMap2Out[
code] = fPass;
1035 Double_t tmvaOut = 9.9;
1037 tmvaOut = TMVAOutput2(aaa1);
1042 aaa1.nskips = nskips;
1044 mapDoublets.insert(pair<Double_t, candvec>(-tmvaOut, aaa1));
1048 int n2tot = 0, n2max = (fUseTMVA == 2) ? fNbranches * 2 : 999;
1050 for (
auto ait = mapDoublets.begin(); ait != mapDoublets.end(); ++ait) {
1051 fCandVec2[ista].push_back(ait->second);
1052 fMap2[ista].insert(pair<int, int>(ih, fCandVec2[ista].size() - 1));
1061 Int_t ncand = fCandVec2[ista].size();
1062 if (fVerbose >= 1) {
1063 cout <<
" Doublet stat: " << ista <<
" " << ncand << endl;
1064 for (
int i2 = 0; i2 < ncand; ++i2)
1065 PrintHits(fCandVec2[ista][i2]);
1072int BmnStsVectorFinderV9::FindBin(
int ista, Float_t binw, Float_t tx)
1076 return (tx + fTanXmax[ista]) / binw;
1081Float_t BmnStsVectorFinderV9::BinCenterTx(
int ista,
int ibin, Float_t binw)
1085 return -fTanXmax[ista] + binw * (ibin % 1000 + 0.5);
1090void BmnStsVectorFinderV9::DTxWindow(
int ista2, Float_t tx,
int idu, Float_t curvCut, Float_t* dtx)
1098 TF1 ff(
"ff",
"pol3", -1, 1);
1101 int bintx = FindBin(ista2 / 100, fTxStep, tx) + 1000 * idu;
1104 vector<Float_t>& params = fStatData[ista2][bintx];
1105 Float_t tMinMax[2] = {params[4], params[9]};
1107 for (
int ilr = 0; ilr < 2; ++ilr) {
1109 ff.SetParameters(params[ip], params[ip + 1], params[ip + 2], params[ip + 3]);
1110 Float_t cmax = ff.Eval(tMinMax[ilr]);
1112 if (cmax <= curvCut) {
1113 dtx[ilr] = tMinMax[ilr];
1116 xyz[1][0] = tMinMax[ilr] * curvCut / cmax;
1117 xyz[1][1] = ff.Eval(xyz[1][0]);
1118 Float_t dx = tMinMax[ilr] / 10;
1119 for (
int j = -1; j < 2; j += 2) {
1120 xyz[j + 1][0] = xyz[1][0] + j * dx;
1121 xyz[j + 1][1] = ff.Eval(xyz[j + 1][0]);
1127 TVector3 cba = Parabola(xyz[0], xyz[1], xyz[2]);
1129 Float_t
d = cba[1] * cba[1] - 4 * cba[2] * (cba[0] - curvCut);
1131 Float_t x1 = (-cba[1] + TMath::Sqrt(
d)) / 2 / cba[2];
1132 Float_t x2 = (-cba[1] - TMath::Sqrt(
d)) / 2 / cba[2];
1135 if ((ilr == 0 && dthx > 0) || (ilr == 1 && dthx < 0))
1138 dthx = TMath::Sign(TMath::Min(TMath::Abs(x1), TMath::Abs(x2)), x1);
1141 dtx[ilr] = TMath::Min(dtx[ilr], -0.01f);
1143 dtx[ilr] = TMath::Max(dtx[ilr], 0.01f);
1150Bool_t BmnStsVectorFinderV9::CheckVarx(Double_t dx, Double_t dz, Double_t tx, Double_t distxz, Double_t& varx)
1154 varx = (dx / dz - tx) / distxz;
1161void BmnStsVectorFinderV9::BuildTriplets()
1169 pair<unordered_multimap<Int_t, int>::iterator, unordered_multimap<Int_t, int>::iterator> ret;
1170 unordered_multimap<Int_t, int>::iterator mit, mit1;
1178 const Float_t dtymax9[19] = {0.070, 0.095, 0.100, 0.080, 0.045, 0.035,
1179 0.035, 0.030, 0.030, 0.030, 0.03, 0.03};
1184 const Float_t beamWidth9[19] = {0.95, 0.60, 0.50, 0.45, 0.50, 0.50,
1185 0.55, 0.65, 0.75, 0.95, 1.0, 1.0};
1188 const Float_t *dtymax = dtymax9, *beamWidth = beamWidth9;
1191 dtymax = &dtymax9[1];
1192 beamWidth = &beamWidth9[1];
1195 for (Int_t ista = 0; ista < fNsta - 2; ++ista) {
1197 Int_t nTra = fCandVec2[ista].size();
1203 for (mit = fMap2[ista].begin(); mit != fMap2[ista].end(); ++mit) {
1204 candvec& aaa = fCandVec2[ista][mit->second];
1205 Int_t istanext = ista + 1 + aaa.nskips;
1206 if (fCandVec2[istanext].size() == 0)
1211 Double_t tanx = aaa.tx;
1213 ret = fMap2[istanext].equal_range(aaa.stahit.rbegin()->second);
1214 multimap<Double_t, candvec> mapDoublets;
1215 int nbr = 0, newtr = 0, newtr3 = 0;
1229 for (mit1 = ret.first; mit1 != ret.second; ++mit1) {
1235 candvec& aaa2 = fCandVec2[istanext][mit1->second];
1238 if (aaa.idmaxP != aaa2.idmaxP)
1248 if (fBy < 0.2 && TMath::Abs(tanx - aaa2.tx) > fdTanXB0[fPass])
1268 Double_t dtym = dtymax[ista];
1269 int dsta = aaa2.stahit.rbegin()->first - ista;
1271 dtym *= (2.0 / dsta);
1272 if (TMath::Abs(aaa.ty - aaa2.ty) > dtym)
1276 map<int, int>::iterator mitt = aaa.stahit.begin();
1278 points[0] = fmapHits[mitt->second].xyz;
1280 points[1] = fmapHits[mitt->second].xyz;
1281 points[2] = fmapHits[aaa2.stahit.rbegin()->second].xyz;
1282 for (
int j3 = 0; j3 < 3; ++j3)
1283 points[j3] -= fXyzv;
1284 TVector3 cba = Parabola(points[0], points[1], points[2], 2);
1285 Double_t
dist = TMath::Abs(cba[0]) / TMath::Sqrt(points[0].Z());
1288 Double_t beamW = beamWidth[ista] * 2;
1290 beamW *= (2.0 / dsta);
1294 aaa1.stahit[aaa2.stahit.rbegin()->first] = aaa2.stahit.rbegin()->second;
1296 Double_t tmvaOut = 9.9;
1305 map<Int_t, Int_t>& hitMap = aaa1.stahit;
1314 for (map<Int_t, Int_t>::iterator mit2 = hitMap.begin(); mit2 != hitMap.end(); ++mit2) {
1315 hits[indx++] = mit2->second;
1316 hit = (
CbmStsHit*)fHitArray->UncheckedAt(mit2->second);
1319 hit->SetDx(0.08 / TMath::Sqrt(12.0) * 1.2);
1325 hit->SetDx(0.02 / TMath::Sqrt(12.0));
1338 Double_t ty = aaa.ty;
1340 float chi2 = LinearFit(aaa, aaa2, &track, newtr, ty) / hit->GetDy() / hit->GetDy();
1356 aaa1.momxz = Curv3(aaa, aaa2, aaa1, newtr3);
1361 if (TMath::Abs(aaa1.momxz) > fPTcut[fPass]) {
1370 +
"-" +
to_string(aaa2.stahit.rbegin()->second);
1371 if (fMap3Out.find(code) == fMap3Out.end())
1372 fMap3Out[
code] = fPass;
1393 Double_t qual = (fUseTMVA) ? -tmvaOut : chi2;
1394 aaa1.nskips = aaa.nskips + aaa2.nskips;
1396 mapDoublets.insert(pair<Double_t, candvec>(qual, aaa1));
1398 nbr = mapDoublets.size();
1411 if (fUseTMVA && nbr > fNbranches) {
1412 multimap<Double_t, candvec> mapTmp;
1413 for (multimap<Double_t, candvec>::iterator it = mapDoublets.begin(); it != mapDoublets.end(); ++it) {
1414 auto aaa1 = it->second;
1417 Double_t tmvaOut = TMVAOutput3(aaa1, aaa, nbr);
1418 if (tmvaOut < -0.2) {
1422 mapTmp.insert(pair<Double_t, candvec>(-tmvaOut, aaa1));
1424 mapDoublets.clear();
1425 mapDoublets = mapTmp;
1431 for (multimap<Double_t, candvec>::iterator it = mapDoublets.begin(); it != mapDoublets.end(); ++it) {
1432 if (nok >= fNbranches)
1435 fCandVec3[ista].push_back(it->second);
1436 fMap3[ista].insert(pair<Int_t, int>(mit->first, fCandVec3[ista].size() - 1));
1437 map<Int_t, Int_t>& hitMap = it->second.stahit;
1439 for (map<Int_t, Int_t>::iterator mitr = hitMap.begin(); mitr != hitMap.end(); ++mitr)
1440 code += (
to_string(mitr->second) +
"-");
1441 fMapCode3[ista][
code] = fCandVec3[ista].size() - 1;
1446 Int_t ncand = fCandVec3[ista].size();
1448 cout <<
" Triplet stat: " << ista <<
" " << ncand <<
" " << discarded <<
" " << fPass << endl;
1454void BmnStsVectorFinderV9::BuildTracks()
1458 int istaEnd = fNsta - fNhitsMin[fPass] + 1;
1459 istaEnd = TMath::Min(istaEnd, fNsta - 3);
1465 for (Int_t ista = 0; ista < istaEnd; ++ista) {
1469 std::unordered_multimap<Int_t, int>* candMap = &fMap3[ista];
1470 vector<candvec>* candVec = &fCandVec3[ista];
1471 Int_t nTra = candMap->size();
1478 for (unordered_multimap<Int_t, int>::iterator mit = candMap->begin(); mit != candMap->end(); ++mit) {
1479 candvec& cand = (*candVec)[mit->second];
1480 if (fPass == 0 && cand.nskips > 0)
1482 map<int, int>::iterator it = cand.stahit.begin();
1483 int ista0 = it->first;
1485 int ista1 = it->first;
1486 if (ista1 - ista0 > 1)
1495void BmnStsVectorFinderV9::ExtendTrack(candvec cand)
1499 const Double_t c2ndfMax = 30.0;
1500 Double_t pxzCut = 0.3;
1504 const Float_t pxzCuts9pos[19] = {0.215, 0.230, 0.245, 0.300, 0.265,
1505 0.235, 0.250, 0.275, 0.320};
1508 const Float_t pxzCuts9neg[19] = {0.235, 0.215, 0.185, 0.170, 0.160,
1509 0.135, 0.125, 0.120, 0.145};
1510 const Float_t* pxzCutsPos = (fNSi == 5) ? pxzCuts9pos : &pxzCuts9pos[1];
1511 const Float_t* pxzCutsNeg = (fNSi == 5) ? pxzCuts9neg : &pxzCuts9neg[1];
1513 Int_t nTra = 0, ista = cand.stahit.rbegin()->first;
1517 if (ista == fNsta-2) {
1518 cand.stahit.erase(cand.stahit.rbegin()->first);
1519 ista = cand.stahit.rbegin()->first;
1528 std::unordered_multimap<Int_t, int>* pCandMap =
1529 (ista == fNsta - 2) ? &fMap2[ista] : &fMap2[ista];
1530 vector<candvec>* pCandVec = (ista == fNsta - 2) ? &fCandVec2[ista] : &fCandVec2[ista];
1532 unordered_multimap<Int_t, int>& candMap = *pCandMap;
1533 vector<candvec>& candVec = *pCandVec;
1535 if (ista < fNsta - 1) {
1543 nTra = candMap.count(cand.stahit.rbegin()->second);
1549 if (
int(cand.stahit.size()) < fNhitsMin[fPass])
1554 for (map<int, int>::iterator it = cand.stahit.begin(); it != cand.stahit.end(); ++it)
1557 if (fCandCodes[cand.stahit.size()].find(code) == fCandCodes[cand.stahit.size()].end()) {
1558 fCandCodes[cand.stahit.size()].insert(code);
1563 if (
int(cand.stahit.size()) >= fNhitsMin[fPass] && cand.stahit.rbegin()->first != ista
1564 && FitTrack(cand) > c2ndfMax)
1567 fCandVec[cand.stahit.begin()->first].push_back(cand);
1574 unordered_multimap<Int_t, int>::iterator mit;
1575 pair<unordered_multimap<Int_t, int>::iterator, unordered_multimap<Int_t, int>::iterator> ret;
1576 ret = candMap.equal_range(cand.stahit.rbegin()->second);
1587 for (mit = ret.first; mit != ret.second; ++mit) {
1589 candvec aaa = candVec[mit->second];
1590 if (fExact && aaa.idmaxP != cand.idmaxP)
1592 if (fPass == 0 && aaa.nskips > 0)
1599 map<Int_t, Int_t>::iterator mitr = aaa.stahit.begin();
1601 if (
code.size() == 1) {
1602 map<Int_t, Int_t>::reverse_iterator mit1 = cand.stahit.rbegin();
1604 istaMid = mit1->first;
1611 int pos =
code.rfind(
"-",
code.size() - 2);
1618 if (fMapCode3[istaMid].find(code) == fMapCode3[istaMid].end())
1622 candvec* bbb =
nullptr;
1624 bbb = &fCandVec3[istaMid][fMapCode3[istaMid][
code]];
1630 if ((fPass == 0 && bbb->nskips > 0) || (cand.nskips + bbb->nskips > 2))
1632 if (ok && cand.stahit.size() > 2) {
1633 Double_t dp = TMath::Abs(cand.momxz - bbb->momxz);
1639 int istabeg = cand.stahit.begin()->first;
1640 pxzCut = (cand.momxz > 0) ? pxzCutsPos[istabeg] : pxzCutsNeg[istabeg];
1641 int dsta = bbb->stahit.rbegin()->first - istabeg;
1643 pxzCut *= (3.0 / dsta);
1644 if (TMath::Abs(fBy) > 0.2
1645 && dp / (TMath::Abs(cand.momxz) + TMath::Abs(bbb->momxz)) / TMath::Sqrt(TMath::Abs(1 / cand.momxz))
1654 if ((fPass == 0 && aaa.nskips > 0) || (cand.nskips + aaa.nskips > 2))
1656 if (aaa.stahit.size() == 3) {
1659 Double_t dp = TMath::Abs(cand.momxz - aaa.momxz);
1665 int istabeg = cand.stahit.begin()->first;
1666 pxzCut = (cand.momxz > 0) ? pxzCutsPos[istabeg] : pxzCutsNeg[istabeg];
1667 int dsta = aaa.stahit.rbegin()->first - istabeg;
1669 pxzCut *= (3.0 / dsta);
1670 if (TMath::Abs(fBy) > 0.2
1671 && dp / (TMath::Abs(cand.momxz) + TMath::Abs(aaa.momxz))
1672 / TMath::Sqrt(TMath::Abs(1 / cand.momxz))
1683 if (
int(cand.stahit.size()) < fNhitsMin[fPass])
1686 string codeVec(
"-");
1687 for (map<int, int>::iterator it = cand.stahit.begin(); it != cand.stahit.end(); ++it)
1688 codeVec += (
to_string(it->second) +
"-");
1689 if (fCandCodes[cand.stahit.size()].find(codeVec) == fCandCodes[cand.stahit.size()].end()) {
1690 fCandCodes[cand.stahit.size()].insert(codeVec);
1691 if (cand.stahit.size() >= 4) {
1693 if (cand.stahit.rbegin()->first == ista)
1695 Double_t chi2 = FitTrack(cand);
1697 if (chi2 > c2ndfMax)
1701 fCandVec[cand.stahit.begin()->first].push_back(cand);
1707 candvec candext = cand;
1708 if (cand.stahit.size() < 3)
1709 candext.momxz = bbb->momxz;
1712 for (mitr = aaa.stahit.begin(); mitr != aaa.stahit.end(); ++mitr)
1713 candext.stahit[mitr->first] = mitr->second;
1714 candext.nskips += aaa.nskips;
1718 if (aaa.idmaxP != cand.idmaxP)
1719 candext.idmaxP = -1;
1721 if (candext.stahit.size() >= 4) {
1722 Double_t chi2ndf = FitTrack(candext);
1724 if (chi2ndf > c2ndfMax)
1734 ExtendTrack(candext);
1740Double_t BmnStsVectorFinderV9::FitTrack(candvec& cand)
1744 const Int_t gkChi2Cut = 5.0;
1750 MakeStsTrack(cand, hitcode, track);
1752 if (fCandSet[nhits].find(hitcode) != fCandSet[nhits].end())
1757 fitter.
DoFit(&track);
1759 FilterHit(cand, track);
1771 int ndf = TMath::Max(track.
GetNDF(), 1);
1772 Double_t chi2ndf = track.
GetChi2() / ndf;
1775 if (chi2ndf < gkChi2Cut && nhits >= fNhitsMin[fPass]) {
1779 if (track.
GetChi2() / ndf > gkChi2Cut) {
1785 Double_t qual = nhits;
1786 qual += (100.0 - TMath::Min(TMath::Abs(track.
GetChi2()), 100.0)) / 101.0;
1787 fTracks.insert(pair<Double_t, CbmStsTrack>(-qual, track));
1788 fCandSet[nhits].insert(hitcode);
1790 cout <<
" FitTrack: " << track.
GetChi2() <<
" ";
1800Double_t BmnStsVectorFinderV9::FilterHit(candvec& cand,
CbmStsTrack& track)
1812 Int_t nhits = cand.stahit.size();
1823 Bool_t downstream = kTRUE;
1836 Bool_t err = kFALSE;
1839 h = kftr.
GetHit(nhits - 1);
1840 err = err || h->
Filter(kftr, downstream, qp0);
1845 track.
SetNDF(2 * nhits - 5);
1870void BmnStsVectorFinderV9::MakeStsTrack(candvec& cand,
string& hitcode,
CbmStsTrack& track)
1874 map<Int_t, Int_t>& hitMap = cand.stahit;
1877 hits.Set(hitMap.size());
1882 for (map<Int_t, Int_t>::iterator mit2 = hitMap.begin(); mit2 != hitMap.end(); ++mit2) {
1883 hits[indx++] = mit2->second;
1884 hit = (
CbmStsHit*)fHitArray->UncheckedAt(mit2->second);
1886 hit->SetDx(0.08 / TMath::Sqrt(12.0));
1892 hit->SetDx(0.02 / TMath::Sqrt(12.0));
1902 hit->SetDx(dx / TMath::Sqrt(12.0));
1905 hitcode += (
to_string(mit2->second) +
"-");
1910 cand.code = hitcode;
1915void BmnStsVectorFinderV9::ExtendTracks(Int_t ista)
1939 if (fStream2out.is_open()) {
1940 fStream2out <<
" Event: " << fEvent <<
" " << fMap2Out.size() << endl;
1941 for (unordered_map<string, int>::iterator it = fMap2Out.begin(); it != fMap2Out.end(); ++it)
1942 fStream2out << it->first <<
" " << it->second <<
"\n";
1944 if (fStream3out.is_open()) {
1945 fStream3out <<
" Event: " << fEvent <<
" " << fMap3Out.size() << endl;
1946 for (unordered_map<string, int>::iterator it = fMap3Out.begin(); it != fMap3Out.end(); ++it)
1947 fStream3out << it->first <<
" " << it->second <<
"\n";
1956 printf(
"Work time of BmnStsVectorFinderV9: %4.2f sec.\n", workTime);
1957 if (fStream2out.is_open())
1958 fStream2out.close();
1959 if (fStream3out.is_open())
1960 fStream3out.close();
1966TVector3 BmnStsVectorFinderV9::Parabola(TVector3& pos0, TVector3& pos1, TVector3& pos2,
int ix)
1971 Double_t x2[3] = {pos0[2] - fXyzv[2], pos1[2] - fXyzv[2], pos2[2] - fXyzv[2]};
1972 Double_t y2[3] = {pos0[0] - fXyzv[0], pos1[0] - fXyzv[0], pos2[0] - fXyzv[0]};
1973 Double_t x0[3] = {pos0[0], pos1[0], pos2[0]};
1974 Double_t y0[3] = {pos0[1], pos1[1], pos2[1]};
1975 Double_t *x = x0, *y = y0;
1981 Double_t denom = (x[0] - x[1]) * (x[0] - x[2]) * (x[1] - x[2]);
1982 Double_t dy10 = y[1] - y[0];
1983 Double_t dy02 = y[0] - y[2];
1984 Double_t dy21 = y[2] - y[1];
1986 Double_t a = x[2] * dy10 + x[1] * dy02 + x[0] * dy21;
1990 Double_t b = -x[0] * x[0] * dy21 - x[2] * x[2] * dy10 - x[1] * x[1] * dy02;
1992 Double_t c = x[1] * x[1] * (x[2] * y[0] - x[0] * y[2]) + x[1] * (x[0] * x[0] * y[2] - x[2] * x[2] * y[0])
1993 + x[0] * x[2] * (x[2] - x[0]) * y[1];
1995 return TVector3(c, b, a);
2003void BmnStsVectorFinderV9::FitTracks()
2007 const Double_t gkChi2Cut = 5.0;
2012 for (Int_t ista = 0; ista < fNsta; ++ista) {
2013 Int_t ntra = fCandVec[ista].size();
2015 cout <<
" FitTracks: " << ista <<
" " << ntra << endl;
2017 for (Int_t itra = 0; itra < ntra; ++itra) {
2018 candvec& cand = fCandVec[ista][itra];
2021 map<Int_t, Int_t>& hitMap = cand.stahit;
2022 Int_t nhits = hitMap.size();
2024 if (nhits < fNhitsMin[fPass])
2029 Int_t indx = 0, iok = 1;
2032 string hitcode(
"-");
2033 for (map<Int_t, Int_t>::iterator mit = hitMap.begin(); mit != hitMap.end(); ++mit)
2034 hitcode += (
to_string(mit->second) +
"-");
2047 fCandSet[nhits].insert(hitcode);
2049 for (map<Int_t, Int_t>::iterator mit = hitMap.begin(); mit != hitMap.end(); ++mit) {
2050 hits[indx++] = mit->second;
2073 hit->SetDx(dx / TMath::Sqrt(12.0));
2101 cout <<
" aaaaaaa " << endl;
2103 cout << track.
GetChi2() <<
" " << nhits <<
" " << endl;
2160 for (Int_t
i = 0;
i < nhits;
i++)
2162 int imax = nhits - 1;
2164 if (indok.size() > 3) {
2171 for (set<Int_t>::iterator sit = indok.begin(); sit != indok.end(); ++sit) {
2172 hits[indx++] = hits[*sit];
2174 hitcode += (
to_string(hits[*sit]) +
"-");
2179 if (fCandSet[indok.size()].find(hitcode) != fCandSet[indok.size()].end())
2181 fCandSet[indok.size()].insert(hitcode);
2183 hits.Set(indok.size());
2190 cout <<
" bbbbbb " << track.
GetChi2() <<
" " << hits.GetSize() <<
" " << track.
GetChi2() / ndf
2226 xextr = param.GetX() - fXyzv[0];
2227 yextr = param.GetY() - fXyzv[1];
2229 TMath::Sqrt(xextr * xextr / 0.035 / 0.035 + yextr * yextr / 0.2 / 0.2);
2230 Double_t www = TMath::Min(TMath::Exp(-rad), 0.999);
2231 qual += TMath::Exp(-TMath::Abs(track.
GetChi2())) * www;
2233 qual += (100.0 - TMath::Min(TMath::Abs(track.
GetChi2()), 100.0)) / 101.0;
2234 fTracks.insert(pair<Double_t, CbmStsTrack>(-qual, track));
2236 pair<unordered_multimap<Int_t, Int_t>::iterator, unordered_multimap<Int_t, Int_t>::iterator>
2238 nhits = hits.GetSize();
2240 cout <<
" Good track: " << endl;
2244 for (Int_t j = nhits - 1; j >= 0; --j) {
2245 ret = fHit2id.equal_range(hits[j]);
2248 for (unordered_multimap<Int_t, Int_t>::iterator mit = ret.first; mit != ret.second; ++mit) {
2249 if (mit == ret.first)
2250 cout << mit->first <<
"*";
2253 cout << mit->second;
2267void BmnStsVectorFinderV9::RemoveDoubles()
2271 multimap<Double_t, CbmStsTrack>::iterator mit = fTracks.begin(), mit1;
2272 Int_t nOK = fTracks.size(), nOut = fVectorArray->GetEntriesFast();
2274 for (; mit != fTracks.end(); ++mit) {
2275 if (mit->second.GetFlag())
2280 for (; mit1 != fTracks.end(); ++mit1) {
2281 if (mit1->second.GetFlag())
2283 if (!AreTracksDoubles(mit1->second, mit->second))
2285 mit1->second.SetFlag(1);
2307 new ((*fVectorArray)[nOut++])
CbmStsTrack(mit->second);
2311 cout <<
" RemoveDoubles: " << fTracks.size() <<
" " << nOK << endl;
2321 Int_t limCommonPoint = (tr1.
GetNStsHits() + 1) / 2;
2323 limCommonPoint = TMath::Min(limCommonPoint, 1);
2325 Int_t nh1 = hits1.GetSize(), nh2 = hits2.GetSize(), nHitsCommon = 0, j = nh2 - 1;
2329 for (Int_t
i = nh1 - 1;
i >= 0;
i--) {
2333 for (; j >= 0; j--) {
2341 if (nHitsCommon > limCommonPoint)
2352 if (
i + nHitsCommon <= limCommonPoint)
2357 if (nHitsCommon <= limCommonPoint)
2387void BmnStsVectorFinderV9::RemoveFakes()
2391 multimap<Double_t, CbmStsTrack>::iterator mit = fTracks.begin();
2392 Int_t nOK = fTracks.size(), nOut = nOK;
2394 for (; mit != fTracks.end(); ++mit) {
2395 if (mit->second.GetFlag())
2414 cout <<
" Remove fakes: " << nOK <<
" " << nOut << endl;
2419void BmnStsVectorFinderV9::ExcludeFakes()
2423 Int_t ncand = fVectorArray->GetEntriesFast();
2425 map<Int_t, set<Int_t>> mClusTr;
2426 map<Int_t, Double_t> mWeight;
2428 for (Int_t j = 0; j < ncand; ++j) {
2432 for (Int_t jh = 0; jh < nhits; ++jh) {
2436 for (Int_t side = 0; side < 2; ++side) {
2437 Int_t iclus = hit->
GetDigi(side);
2438 if (mClusTr.count(iclus) == 0) {
2440 mClusTr[iclus] = aaa;
2442 mClusTr[iclus].insert(j);
2451 Double_t xextr = param.GetX() - fXyzv[0];
2452 Double_t yextr = param.GetY() - fXyzv[1];
2454 TMath::Sqrt(xextr * xextr / 0.035 / 0.035 + yextr * yextr / 0.2 / 0.2);
2455 www *= TMath::Exp(-rad);
2461 multimap<Double_t, pair<Int_t, Int_t>> mapQual;
2462 set<Int_t> set2kill, set2kill1;
2464 for (Int_t j = 0; j < ncand; ++j) {
2471 for (Int_t jh = 0; jh < nhits; ++jh) {
2476 for (Int_t side = 0; side < 2; ++side) {
2477 Int_t iclus = hit->
GetDigi(side);
2478 if (mClusTr[iclus].size() > 1)
2484 Double_t quality = nhits * 1000;
2485 Double_t www = TMath::Exp(-Double_t(nover) / nhits / 2) * mWeight[j];
2486 mapQual.insert(pair<Double_t, pair<Int_t, Int_t>>(quality + www, pair<Int_t, Int_t>(j, nover)));
2490 if (nhits <= 5 && Double_t(nover) / nhits / 2 > 0.6)
2492 else if (!fExact && nhits <= 3 && www < 1.e-8)
2493 set2kill1.insert(j);
2496 if (set2kill.size())
2498 if (set2kill.size() || set2kill1.size()) {
2501 for (multimap<Double_t, pair<Int_t, Int_t>>::iterator mit = mapQual.begin(); mit != mapQual.end(); ++mit) {
2502 Int_t itr = mit->second.first;
2505 if (set2kill.count(itr) == 0 && set2kill1.count(itr) == 0)
2508 for (Int_t jh = 0; jh < nhits; ++jh) {
2511 if (mClusTr[hit->
GetDigi(0)].count(itr) == 0 || mClusTr[hit->
GetDigi(1)].count(itr) == 0)
2515 cout <<
" !!! No track found: " << itr << endl;
2517 mClusTr[hit->
GetDigi(0)].erase(itr);
2518 mClusTr[hit->
GetDigi(1)].erase(itr);
2520 fVectorArray->Remove(tr);
2527 fVectorArray->Compress();
2531 ncand = fVectorArray->GetEntriesFast();
2559 ncand = fVectorArray->GetEntriesFast();
2562 for (Int_t j = 0; j < ncand; ++j) {
2571 for (
int ih = 0; ih < nhits; ++ih) {
2579 FairTrackParam param;
2581 int firstSta = *setStat.begin(), nmisSi = 0, nmisGem = 0, nmiss = 0;
2585 for (
int ista = firstSta - 2; ista >= 0; --ista) {
2595 for (
int imod = 0; imod < stat->
GetNModules(); ++imod) {
2612 for (
int imod = 0; imod < stat->
GetNModules(); ++imod) {
2630 for (
int ista = firstSta; ista <= fNsta; ++ista) {
2631 if (setStat.find(ista + 1) != setStat.end())
2642 for (
int imod = 0; imod < stat->
GetNModules(); ++imod) {
2659 for (
int imod = 0; imod < stat->
GetNModules(); ++imod) {
2675 fVectorArray->RemoveAt(j);
2679 tr->
SetFlag(nmisSi * 10 + nmisGem);
2683 fVectorArray->Compress();
2686 cout <<
" Exclude fakes: " << ncand <<
" " << fVectorArray->GetEntriesFast() << endl;
2691Double_t BmnStsVectorFinderV9::DxVsMom(Int_t ista, candvec& vec)
2695 Double_t pars[19][4] = {{0, 0, 0, 0},
2697 {8.28698e-06, 13.3515, 0, 0},
2698 {0.031189, 4.56933, 0.031189, 4.56933},
2699 {0.395468, 3.77954, 0.190848, 3.41027},
2700 {0.128467, 4.26652, 0.128467, 4.26652},
2701 {0.160979, 4.95095, 0.160979, 4.95095}};
2703 Double_t pxz = vec.momxz;
2704 Int_t endsta = vec.stahit.rbegin()->first;
2705 Double_t p0 = pars[ista][0];
2706 Double_t p1 = pars[ista][1];
2707 if (endsta > ista + 2) {
2712 Double_t dx = p0 / TMath::Power(TMath::Log10(10 * pxz), p1);
2718Double_t BmnStsVectorFinderV9::Proxim(Double_t phi0, Double_t phi)
2722 Double_t dPhi = phi0 - phi;
2723 if (TMath::Abs(dPhi) > TMath::Pi())
2724 phi += TMath::Pi() * 2 * TMath::Sign(1., dPhi);
2730Double_t BmnStsVectorFinderV9::LinearFit(candvec& cand,
2739 static Double_t y[3], l[3] = {0}, lens[3] = {0}, ys[3], lys[3], l2s[3];
2742 Int_t i0 = (newtr == 0) ? 0 : 2;
2744 for (Int_t
i = i0;
i < 3; ++
i) {
2755 l[
i] = lens[
i] = cand.lengxz;
2757 l[
i] = lens[
i] = cand2.lengxz + l[
i - 1];
2759 y[
i] = ys[
i] = hit->GetY();
2763 for (Int_t
i = i0;
i < 3; ++
i) {
2764 lys[
i] = l[
i] * y[
i];
2765 l2s[
i] = l[
i] * l[
i];
2767 lens[
i] += lens[
i - 1];
2769 lys[
i] += lys[
i - 1];
2770 l2s[
i] += l2s[
i - 1];
2773 Double_t b = 3 * lys[2] - lens[2] * ys[2];
2774 b /= (3 * l2s[2] - lens[2] * lens[2]);
2775 Double_t a = (ys[2] - b * lens[2]) / 3;
2777 Double_t chi2 = 0.0;
2779 for (
int i = 0;
i < 3; ++
i) {
2780 Double_t dy = a + b * l[
i] - y[
i];
2793Double_t BmnStsVectorFinderV9::Curv3(candvec& cand1, candvec& cand2, candvec& cand3,
int newtr)
2797 static TVector3 points3[3], midPoint;
2799 static Double_t by = 0.0;
2806 if (cand3.stahit.size() <= 2) {
2808 points3[0].SetXYZ(fXyzv[0], fXyzv[1], fXyzv[2]);
2811 map<int, int>::iterator mit = cand3.stahit.begin();
2814 points3[0] = fmapHits[mit->second].xyz;
2815 points3[0].SetY(0.0);
2819 if (cand3.stahit.size() > 2) {
2824 for (; mit != cand3.stahit.end(); ++mit) {
2826 points3[indx] = fmapHits[mit->second].xyz;
2828 midPoint = points3[indx];
2831 points3[indx] -= points3[0];
2832 points3[indx++].SetY(0.0);
2835 TVector3 vec21 = points3[2] - points3[1];
2838 Double_t cosAlpha = points3[1] * vec21 / points3[1].Mag() / cand2.lengxz;
2840 Double_t rad = points3[2].Mag() / 2. / TMath::Sin(TMath::ACos(cosAlpha));
2844 Double_t sign = TMath::Sign(3e-4, points3[1].Cross(points3[2]).Y());
2846 FairField* magField = FairRunAna::Instance()->GetField();
2847 by = magField->GetBy(midPoint[0], midPoint[1], midPoint[2]);
2848 if (TMath::Abs(by) < 0.1)
2852 Double_t pxz = -by * rad * sign;
2859set<int> BmnStsVectorFinderV9::KalmanWindow(candvec& cand,
int hitIndx)
2865 MakeStsTrack(cand, hitcode, track);
2866 fitter.
DoFit(&track);
2867 FairTrackParam param;
2869 Double_t z = hit->GetZ();
2871 Double_t sigx = 5 * TMath::Sqrt(param.GetCovariance(0, 0));
2872 Double_t sigy = 5 * TMath::Sqrt(param.GetCovariance(1, 1));
2874 cout <<
" Kalman: " << z <<
" " << hit->
GetStationNr() <<
" " << sigx <<
" " << sigy << endl;
2878 multimap<Double_t, Int_t>::iterator mityb = fmapY[istanext].lower_bound(param.GetY() - sigy);
2879 multimap<Double_t, Int_t>::iterator mitye = fmapY[istanext].upper_bound(param.GetY() + sigy);
2880 multimap<Double_t, Int_t>::iterator mitxb = fmapX[istanext].lower_bound(param.GetX() - sigx);
2881 multimap<Double_t, Int_t>::iterator mitxe = fmapX[istanext].upper_bound(param.GetX() + sigx);
2883 set<Int_t> setX, setY, intersect;
2884 for (multimap<Double_t, Int_t>::iterator mit = mitxb; mit != mitxe; ++mit)
2885 if (fmapHits[mit->second].used == 0)
2886 setX.insert(mit->second);
2887 for (multimap<Double_t, Int_t>::iterator mit = mityb; mit != mitye; ++mit)
2888 if (fmapHits[mit->second].used == 0)
2889 setY.insert(mit->second);
2890 set_intersection(setX.begin(), setX.end(), setY.begin(), setY.end(), std::inserter(intersect, intersect.begin()));
2896std::string BmnStsVectorFinderV9::MakeCode(candvec& cand)
2901 for (map<int, int>::iterator it = cand.stahit.begin(); it != cand.stahit.end(); ++it)
2908void BmnStsVectorFinderV9::PrintHits(candvec& cand)
2912 for (map<int, int>::iterator mit = cand.stahit.begin(); mit != cand.stahit.end(); ++mit) {
2913 int ista = mit->first, ih = mit->second;
2916 printf(
"%d(%5.2f,%5.2f,%5.2f):%d", ista, hit->GetZ(), fmapHits[ih].tx, fmapHits[ih].ty, ih);
2917 auto ret = fHit2id.equal_range(ih);
2918 for (unordered_multimap<Int_t, Int_t>::iterator mit1 = ret.first; mit1 != ret.second; ++mit1) {
2919 if (mit1 == ret.first)
2923 cout << mit1->second;
2932void BmnStsVectorFinderV9::InitTMVA3()
2940 std::map<std::string, int> Use;
2944 Float_t* var = fVarTMVA;
2946 fReadersTMVA3.insert(pair<int, TMVA::Reader*>(-13,
nullptr));
2947 fReadersTMVA3.insert(pair<int, TMVA::Reader*>(-11,
nullptr));
2948 fReadersTMVA3.insert(pair<int, TMVA::Reader*>(-10,
nullptr));
2949 fReadersTMVA3.insert(pair<int, TMVA::Reader*>(10,
nullptr));
2950 fReadersTMVA3.insert(pair<int, TMVA::Reader*>(11,
nullptr));
2951 fReadersTMVA3.insert(pair<int, TMVA::Reader*>(13,
nullptr));
2955 for (
auto mit = fReadersTMVA3.begin(); mit != fReadersTMVA3.end(); ++mit) {
2956 TMVA::Reader* reader =
new TMVA::Reader(
"!Color:!Silent");
2957 fReadersTMVA3[mit->first] = reader;
2965 reader->AddVariable(
"tanx", &var[iii++]);
2966 reader->AddVariable(
"tany", &var[iii++]);
2967 reader->AddVariable(
"zb", &var[iii++]);
2968 reader->AddVariable(
"dty", &var[iii++]);
2971 reader->AddVariable(
"log(abs(pxz2))", &var[iii++]);
2972 reader->AddVariable(
"dpxz", &var[iii++]);
2973 reader->AddVariable(
"corrq[0]", &var[iii++]);
2974 reader->AddVariable(
"corrq[1]", &var[iii++]);
2975 reader->AddVariable(
"corrq[2]", &var[iii++]);
2977 reader->AddVariable(
"log(mult)", &var[iii++]);
2981 TString dir =
"datasetTMVA3/weights";
2984 TString prefix =
"TMVAClassification";
2987 for (std::map<std::string, int>::iterator it = Use.begin(); it != Use.end(); it++) {
2989 TString methodName = TString(it->first) + TString(
" method");
2990 TString weightfile = dir + prefix + TString(
"_") + TString(it->first) + TString(
".weights.xml");
2991 reader->BookMVA(methodName, weightfile);
2999Float_t BmnStsVectorFinderV9::TMVAOutput3(candvec& aaa1, candvec& aaa2,
int mult)
3003 Float_t* var = fVarTMVA;
3004 map<Int_t, Int_t>& hitMap = aaa1.stahit;
3006 int iii = 0, indx = 0, inds[3];
3007 inds[0] = inds[1] = inds[2] = 0;
3010 for (map<Int_t, Int_t>::iterator mit = hitMap.begin(); mit != hitMap.end(); ++mit) {
3011 inds[indx] = mit->second;
3012 hit[indx++] = (
CbmStsHit*)fHitArray->UncheckedAt(mit->second);
3015 Double_t dx = hit[1]->GetX() - hit[0]->GetX();
3016 Double_t dz = hit[1]->GetZ() - hit[0]->GetZ();
3017 Double_t lenxz1 = TMath::Sqrt(dx * dx + dz * dz);
3018 Double_t dx1 = hit[2]->GetX() - hit[1]->GetX();
3019 Double_t dz1 = hit[2]->GetZ() - hit[1]->GetZ();
3020 Double_t lenxz2 = TMath::Sqrt(dx1 * dx1 + dz1 * dz1);
3021 Double_t dty = (hit[2]->GetY() - hit[1]->GetY()) / lenxz2 - (hit[1]->GetY() - hit[0]->GetY()) / lenxz1;
3022 Double_t pxz1 = aaa1.momxz;
3023 Double_t dpxz = (aaa2.momxz - pxz1) / (TMath::Abs(aaa2.momxz) + TMath::Abs(pxz1));
3025 var[iii++] = hit[0]->GetX() / hit[0]->GetZ();
3026 var[iii++] = hit[0]->GetY() / hit[0]->GetZ();
3027 var[iii++] = hit[0]->GetZ();
3030 var[iii++] = TMath::Log(TMath::Abs(1 / pxz1));
3035 var[iii++] = TMath::Log(mult);
3037 int iread = (fPass == 2) ? 1 : fPass;
3041 Float_t tmvaout = fReadersTMVA3[iread]->EvaluateMVA(
"BDTD method");
3054void BmnStsVectorFinderV9::InitTMVA2()
3062 std::map<std::string, int> Use;
3069 TMVA::Reader* reader =
new TMVA::Reader(
"!Color:!Silent");
3070 fReaderTMVA2 = reader;
3076 Float_t* var = fVarTMVA;
3078 reader->AddVariable(
"xb", &var[iii++]);
3079 reader->AddVariable(
"yb", &var[iii++]);
3080 reader->AddVariable(
"zb", &var[iii++]);
3081 reader->AddVariable(
"tx", &var[iii++]);
3082 reader->AddVariable(
"ty", &var[iii++]);
3084 reader->AddVariable(
"dtanysc", &var[iii++]);
3085 reader->AddVariable(
"lenxz", &var[iii++]);
3086 reader->AddVariable(
"1/pxz", &var[iii++]);
3087 reader->AddVariable(
"corrq[1]-corrq[0]", &var[iii++]);
3088 reader->AddVariable(
"corrn[1]-corrn[0]", &var[iii++]);
3089 reader->AddVariable(
"pass", &var[iii++]);
3093 TString dir =
"dataset4diff/weights2/";
3094 TString prefix =
"TMVAClassification";
3097 for (std::map<std::string, int>::iterator it = Use.begin(); it != Use.end(); it++) {
3099 TString methodName = TString(it->first) + TString(
" method");
3100 TString weightfile = dir + prefix + TString(
"_") + TString(it->first) + TString(
".weights.xml");
3101 reader->BookMVA(methodName, weightfile);
3108Float_t BmnStsVectorFinderV9::TMVAOutput2(candvec& aaa1)
3112 Float_t* var = fVarTMVA;
3113 map<Int_t, Int_t>& hitMap = aaa1.stahit;
3114 CbmStsHit *hit =
nullptr, *hit1 =
nullptr;
3115 int iii = 0, indx = 0;
3118 for (map<Int_t, Int_t>::iterator mit = hitMap.begin(); mit != hitMap.end(); ++mit) {
3119 hit = (
CbmStsHit*)fHitArray->UncheckedAt(mit->second);
3121 var[iii++] = hit->GetX();
3122 var[iii++] = hit->GetY();
3123 var[iii++] = hit->GetZ();
3125 }
else if (indx == 1) {
3126 Double_t dx = hit->GetX() - var[0];
3127 Double_t dy = hit->GetY() - var[1];
3128 Double_t dz = hit->GetZ() - var[2];
3129 var[iii++] = dx / dz;
3130 var[iii++] = dy / dz;
3131 var[iii++] = aaa1.ty;
3132 var[iii++] = aaa1.lengxz;
3133 var[iii++] = aaa1.momxz;
3135 var[iii++] = hit->GetTimeStamp() - hit1->GetTimeStamp();
3136 var[iii++] = (fPass == 2) ? 1 : fPass;
3140 return fReaderTMVA2->EvaluateMVA(
"MLPBNN method");
3145void BmnStsVectorFinderV9::InitTMVAtracks()
3153 std::map<std::string, int> Use;
3156 Float_t* var = fVarTMVA;
3157 fTmvaReaders.insert(pair<int, TMVA::Reader*>(-5,
nullptr));
3158 fTmvaReaders.insert(pair<int, TMVA::Reader*>(-4,
nullptr));
3159 fTmvaReaders.insert(pair<int, TMVA::Reader*>(4,
nullptr));
3160 fTmvaReaders.insert(pair<int, TMVA::Reader*>(5,
nullptr));
3164 for (
auto mit = fTmvaReaders.begin(); mit != fTmvaReaders.end(); ++mit) {
3165 TMVA::Reader* reader =
new TMVA::Reader(
"!Color:!Silent");
3166 int nhits = mit->first;
3167 fTmvaReaders[nhits] = reader;
3175 reader->AddVariable(
"atan2(yb,xb)", &var[iii++]);
3177 reader->AddVariable(
"tx", &var[iii++]);
3179 reader->AddVariable(
"log(abs(momr))", &var[iii++]);
3180 reader->AddVariable(
"chi2", &var[iii++]);
3183 reader->AddVariable(
"corrq[0]", &var[iii++]);
3184 reader->AddVariable(
"corrq[1]", &var[iii++]);
3185 reader->AddVariable(
"corrq[2]", &var[iii++]);
3186 reader->AddVariable(
"corrq[3]", &var[iii++]);
3187 if (TMath::Abs(nhits) == 5)
3188 reader->AddVariable(
"corrq[4]", &var[iii++]);
3189 reader->AddVariable(
"corrq3", &var[iii++]);
3191 reader->AddVariable(
"nseqmx", &var[iii++]);
3193 reader->AddVariable(
"corrn[0]", &var[iii++]);
3194 reader->AddVariable(
"corrn[1]", &var[iii++]);
3195 reader->AddVariable(
"corrn[2]", &var[iii++]);
3196 reader->AddVariable(
"corrn[3]", &var[iii++]);
3197 if (TMath::Abs(nhits) == 5)
3198 reader->AddVariable(
"corrn[4]", &var[iii++]);
3199 reader->AddVariable(
"nsigem", &var[iii++]);
3203 TString dir = gSystem->Getenv(
"VMCWORKDIR");
3205 dir +=
"/parameters/reco/datasetTMVAV8/weights";
3207 dir += (nhits < 10) ? TMath::Abs(nhits) : nhits / 10;
3213 TString prefix =
"TMVAClassification";
3216 for (std::map<std::string, int>::iterator it = Use.begin(); it != Use.end(); it++) {
3218 TString methodName = TString(it->first) + TString(
" method");
3219 TString weightfile = dir + prefix + TString(
"_") + TString(it->first) + TString(
".weights.xml");
3220 reader->BookMVA(methodName, weightfile);
3228void BmnStsVectorFinderV9::TMVAOutputTra()
3233 map<Int_t, set<Int_t>> mClusTr;
3234 int nTracks = fVectorArray->GetEntriesFast();
3236 for (
int itr = 0; itr < nTracks; ++itr) {
3242 for (
int ih = 0; ih < nhit; ++ih) {
3246 for (Int_t side = 0; side < 2; ++side) {
3247 Int_t iclus = hit->
GetDigi(side);
3248 if (mClusTr.count(iclus) == 0) {
3250 mClusTr[iclus] = aaa;
3252 mClusTr[iclus].insert(itr);
3257 Float_t* var = fVarTMVA;
3259 for (
int itr = 0; itr < nTracks; ++itr) {
3263 if (nhit < 4 || nhit > 5) {
3268 Float_t momr = 1. / param->GetQp();
3269 int iq = (momr >= 0) ? 1 : -1;
3270 TVector3 posb, pose, mom3;
3271 Float_t corrq[19], corrn[19] = {0}, corrn3 = 0, corrq3 = 0;
3272 int nmiss = 0, ista0 = -1, nsigem = 0, nseqmx = 1, nseq = 1;
3274 for (
int ih = 0; ih < nhit; ++ih) {
3278 hit->Position(posb);
3281 if (ista - ista0 > 1) {
3283 nseqmx = TMath::Max(nseqmx, nseq);
3288 hit->Position(pose);
3291 corrq3 += TMath::Abs(corrq[ih]);
3294 for (Int_t side = 0; side < 2; ++side) {
3295 Int_t iclus = hit->
GetDigi(side);
3296 int over = mClusTr[iclus].size();
3297 corrn[ih] += (over - 1);
3299 corrn3 += corrn[ih];
3306 nseqmx = TMath::Max(nseqmx, nseq);
3317 momr = TMath::Sqrt(mom3.X() * mom3.X() + mom3.Z() * mom3.Z());
3324 var[iii++] = posb.Phi();
3327 var[iii++] = param->GetTx();
3328 var[iii++] = TMath::Log(TMath::Abs(momr));
3334 var[iii++] = corrq[0];
3335 var[iii++] = corrq[1];
3336 var[iii++] = corrq[2];
3337 var[iii++] = corrq[3];
3339 var[iii++] = corrq[4];
3340 var[iii++] = corrq3;
3342 var[iii++] = nseqmx;
3345 var[iii++] = corrn[0];
3346 var[iii++] = corrn[1];
3347 var[iii++] = corrn[2];
3348 var[iii++] = corrn[3];
3350 var[iii++] = corrn[4];
3351 var[iii++] = nsigem;
3354 track->
SetB(fTmvaReaders[nhit * iq]->EvaluateMVA(
"BDTD method"));
3360void BmnStsVectorFinderV9::GoToTarget()
3364 int ntracks = fVectorArray->GetEntriesFast();
3365 Double_t xv = 0, yv = 0, wwwxtot = 0, wwwytot = 0;
3367 for (
int itr = 0; itr < ntracks; ++itr) {
3373 Double_t wwwx = 1 / param.GetCovariance(0, 0);
3374 Double_t wwwy = 1 / param.GetCovariance(1, 1);
3375 xv += (param.GetX() * wwwx);
3376 yv += (param.GetY() * wwwy);
3384 cout <<
" Vertex coords: " << fEvent <<
" " << fPass <<
" " << xv / wwwxtot <<
" " << yv / wwwytot << endl;
ClassImp(BmnH3LTripleFinder)
vector< Double_t > dist(vector< Double_t > qp, Double_t mu)
const Float_t d
Z-ccordinate of the first GEM-station.
Bool_t IsPointInsideModule(Double_t x, Double_t y)
BmnGemStripStation * GetStation(Int_t station_num)
BmnGemStripModule * GetModule(Int_t module_num)
Bool_t IsPointInsideModule(Double_t x, Double_t y, Bool_t isLocal)
BmnSiliconStation * GetStation(Int_t station_num)
BmnSiliconModule * GetModule(Int_t module_num)
void Extrapolate(CbmStsTrack *track, Double_t z, FairTrackParam *e_track)
void ReadMatBudget(TString &matBudgetFileName)
void SetKFHits(CbmKFTrack &T, CbmStsTrack *track)
Int_t DoFit(CbmStsTrack *track, Int_t pidHypo=211)
Int_t Fit(CbmStsTrack *track, Int_t pidHypo=211)
virtual InitStatus Init()
virtual void FinishEvent()
virtual void Exec(Option_t *opt)
virtual Int_t Filter(CbmKFTrackInterface &track, Bool_t downstream, Double_t &QP0)=0
Int_t Extrapolate(Double_t z, Double_t *QP0=0, Bool_t line=false)
Access to i-th hit.
void SetStsTrack(CbmStsTrack &track, bool first=1)
CbmKFHit * GetHit(Int_t i)
Number of hits.
void GetTrackParam(FairTrackParam &track)
Double_t & GetRefChi2()
array[15] of covariance matrix
static CbmKF * Instance()
int GetNStsStations() const
Int_t GetDigi(Int_t inum)
Int_t GetRefIndex(Int_t i=0) const
static CbmStsDigiScheme * Instance(int version=1)
CbmStsStation * GetStationByNr(Int_t stationNr)
virtual Int_t GetStationNr() const
Double_t GetSignalDiv() const
Int_t GetSystemId() const
Int_t GetDigi(Int_t iSide) const
CbmStsSector * GetSector(Int_t iSector)
FairTrackParam * GetParamLast()
void SetParamLast(FairTrackParam &par)
void SetParamFirst(FairTrackParam &par)
void SetChi2(Double_t chi2)
Int_t GetNStsHits() const
Int_t GetStsHitIndex(Int_t iHit) const
FairTrackParam * GetParamFirst()
NLOHMANN_BASIC_JSON_TPL_DECLARATION std::string to_string(const NLOHMANN_BASIC_JSON_TPL &j)
user-defined to_string function for JSON values