8 if (hyp.Contains(
"H3L") || hyp.Contains(
"h3l")) {
11 }
else if (hyp.Contains(
"H4L") || hyp.Contains(
"h4l")) {
20 fParticlePair =
nullptr;
24 fUpperGemClusters =
nullptr;
25 fLowerGemClusters =
nullptr;
26 fUpperFsdClusters =
nullptr;
27 fLowerFsdClusters =
nullptr;
29 fGlobTracks =
nullptr;
30 fTof700Hits =
nullptr;
39void BmnHypNuclPairFinder::Analysis()
41 TLorentzVector lPos, lNeg;
42 Float_t VPX = fVertex->
GetX();
43 Float_t VPY = fVertex->
GetY();
44 Float_t VPZ = fVertex->
GetZ();
48 vector<FairTrackParam> parInVPPos;
49 vector<FairTrackParam> parInVPNeg;
50 vector<Float_t> m2Pos700;
51 vector<Float_t> chi2NDFPos;
52 vector<Float_t> chi2NDFNeg;
53 vector<Int_t> nHitsPos;
54 vector<Float_t> dedxPos;
55 vector<Int_t> nGemHitsNeg;
56 vector<Int_t> nGemHitsPos;
57 vector<Int_t> nFsdHitsNeg;
58 vector<Int_t> nFsdHitsPos;
60 TF1* hypCut =
new TF1(
"hypCut",
"20000*TMath::Exp(-2.0*TMath::Sqrt(x)) + 600.0", 0, 15);
63 TF1* m2CutLow =
nullptr;
65 TF1* m2CutUp =
nullptr;
68 m2CutLow =
new TF1(
"m2CutLow",
"-0.0236*x*x+0.0240*x+3.1896", 0, 30);
69 m2CutUp =
new TF1(
"m2CutUp",
"0.0169*x*x+0.1306*x+4.0525", 0, 30);
71 m2CutLow =
new TF1(
"m2CutLow",
"-0.0034*x*x-0.0360*x+1.7426", 0, 30);
72 m2CutUp =
new TF1(
"m2CutUp",
"0.0128*x*x-0.1060*x+2.6261", 0, 30);
75 for (Int_t
i = 0;
i < fGlobTracks->GetEntriesFast();
i++) {
87 const Float_t tZ = -0.01942;
93 GetNHits(sts, nGEM, nFSD);
95 Float_t mom = gl->
GetP();
101 if (dedx < hypCut->Eval(mom))
104 if (m2 > m2CutUp->Eval(mom) || m2 < m2CutLow->Eval(mom))
107 dedxPos.push_back(dedx);
108 m2Pos700.push_back(m2);
110 parInVPPos.push_back(par);
112 nGemHitsPos.push_back(nGEM);
113 nFsdHitsPos.push_back(nFSD);
115 parInVPNeg.push_back(par);
117 nGemHitsNeg.push_back(nGEM);
118 nFsdHitsNeg.push_back(nFSD);
122 for (
size_t i = 0;
i < parInVPPos.size(); ++
i) {
123 for (
size_t j = 0; j < parInVPNeg.size(); ++j) {
125 FairTrackParam VP1 = parInVPPos[
i];
126 FairTrackParam VP2 = parInVPNeg[j];
127 FairTrackParam V01 = parInVPPos[
i];
128 FairTrackParam V02 = parInVPNeg[j];
130 Float_t V0Z = FindV0ByVirtualPlanes(&V01, &V02, VPZ, 50.0);
131 if (V0Z > 30 || V0Z < 0)
140 Float_t V0X1 = V01.GetX();
141 Float_t V0X2 = V02.GetX();
142 Float_t V0Y1 = V01.GetY();
143 Float_t V0Y2 = V02.GetY();
144 Float_t VPX1 = VP1.GetX();
145 Float_t VPX2 = VP2.GetX();
146 Float_t VPY1 = VP1.GetY();
147 Float_t VPY2 = VP2.GetY();
149 Float_t dV0X1sq = V01.GetCovariance(0, 0);
150 Float_t dV0Y1sq = V01.GetCovariance(1, 1);
151 Float_t dV0X2sq = V02.GetCovariance(0, 0);
152 Float_t dV0Y2sq = V02.GetCovariance(1, 1);
153 Float_t dVPX1sq = VP1.GetCovariance(0, 0);
154 Float_t dVPY1sq = VP1.GetCovariance(1, 1);
155 Float_t dVPX2sq = VP2.GetCovariance(0, 0);
156 Float_t dVPY2sq = VP2.GetCovariance(1, 1);
158 Float_t DCA12 = Sqrt(Sq(V0X2 - V0X1) + Sq(V0Y2 - V0Y1));
160 1.0 / DCA12 * Sqrt(Sq(V0X2 - V0X1) * (dV0X1sq + dV0X2sq) + Sq(V0Y2 - V0Y1) * (dV0Y1sq + dV0Y2sq));
162 Float_t DCA1 = Sqrt(Sq(VPX1 - VPX) + Sq(VPY1 - VPY));
164 1.0 / DCA1 * Sqrt(Sq(VPX1 - VPX) * (dVPX1sq + dVPXsq) + Sq(VPY1 - VPY) * (dVPY1sq + dVPYsq));
165 Float_t DCA2 = Sqrt(Sq(VPX2 - VPX) + Sq(VPY2 - VPY));
167 1.0 / DCA2 * Sqrt(Sq(VPX2 - VPX) * (dVPX2sq + dVPXsq) + Sq(VPY2 - VPY) * (dVPY2sq + dVPYsq));
169 Float_t V0X = .5 * (V0X1 + V0X2);
170 Float_t V0Y = .5 * (V0Y1 + V0Y2);
171 Float_t path = Sqrt(Sq(V0X - VPX) + Sq(V0Y - VPY) + Sq(V0Z - VPZ));
175 partPair.
SetM2(m2Pos700[
i]);
186 vector<Int_t> nHits1 = {nFsdHitsPos[
i], nGemHitsPos[
i]};
187 vector<Int_t> nHits2 = {nFsdHitsNeg[j], nGemHitsNeg[j]};
190 Float_t p1 = Abs(1. / V01.GetQp());
192 Float_t p2 = Abs(1. / V02.GetQp());
193 Float_t Tx1 = V01.GetTx();
194 Float_t Ty1 = V01.GetTy();
195 Float_t Tx2 = V02.GetTx();
196 Float_t Ty2 = V02.GetTy();
197 Float_t A1 = 1. / Sqrt(Tx1 * Tx1 + Ty1 * Ty1 + 1);
198 Float_t A2 = 1. / Sqrt(Tx2 * Tx2 + Ty2 * Ty2 + 1);
199 Float_t pz1 = p1 * A1;
200 Float_t pz2 = p2 * A2;
201 Float_t px1 = Tx1 * pz1;
202 Float_t px2 = Tx2 * pz2;
203 Float_t py1 = Ty1 * pz1;
204 Float_t py2 = Ty2 * pz2;
209 Float_t PzPart0 = pz1 + pz2;
210 Float_t PxPart0 = px1 + px2;
211 Float_t PyPart0 = py1 + py2;
212 Float_t TxPart0 = PxPart0 / PzPart0;
213 Float_t TyPart0 = PyPart0 / PzPart0;
214 Float_t xPart0 = TxPart0 * (VPZ - V0Z) + V0X;
215 Float_t yPart0 = TyPart0 * (VPZ - V0Z) + V0Y;
216 Float_t dca0 = Sqrt(Sq(xPart0 - VPX) + Sq(yPart0 - VPY));
220 lPos.SetXYZM(px1, py1, pz1, massPos);
221 lNeg.SetXYZM(px2, py2, pz2, massNeg);
224 partPair.
SetInvMass(TLorentzVector((lPos + lNeg)).Mag());
228 new ((*fParticlePair)[fParticlePair->GetEntriesFast()])
BmnHypNuclPair(partPair);
497 cout <<
"\nBmnHypNuclPairFinder::Init()" << endl;
499 FairRootManager* ioman = FairRootManager::Instance();
501 fStsTracks = (TClonesArray*)ioman->GetObject(
"StsVector");
502 fGlobTracks = (TClonesArray*)ioman->GetObject(
"BmnGlobalTrack");
503 fStsHits = (TClonesArray*)ioman->GetObject(
"StsHit");
505 fVertex = (
CbmVertex*)ioman->GetObject(
"MpdVertex.");
507 fUpperGemClusters = (TClonesArray*)ioman->GetObject(
"BmnGemUpperCluster");
508 fLowerGemClusters = (TClonesArray*)ioman->GetObject(
"BmnGemLowerCluster");
509 fUpperFsdClusters = (TClonesArray*)ioman->GetObject(
"BmnSiliconUpperCluster");
510 fLowerFsdClusters = (TClonesArray*)ioman->GetObject(
"BmnSiliconLowerCluster");
511 fTof700Hits = (TClonesArray*)ioman->GetObject(
"BmnTof700Hit");
514 fParticlePair =
new TClonesArray(
"BmnHypNuclPair");
515 ioman->Register(
"pairs",
"HYP", fParticlePair, kTRUE);
526 fParticlePair->Delete();
531 cout <<
"Event# " << fEventCounter << endl;
538 if (fVertex->
GetZ() < -0.5 || fVertex->
GetZ() > +0.5)
541 Float_t centerOfTargetX = 0.40;
542 Float_t centerOfTargetY = 0.15;
543 Float_t radiusOfTarget = 1.2;
545 if (TMath::Sqrt(TMath::Sq(fVertex->
GetX() - centerOfTargetX) + TMath::Sq(fVertex->
GetY() - centerOfTargetY))
557 cout <<
"\n-I- [BmnHypNuclPairFinder::Finish] " << endl;
560Float_t BmnHypNuclPairFinder::FindV0ByVirtualPlanes(FairTrackParam* par1,
561 FairTrackParam* par2,
565 const Int_t nPlanes = 5;
567 while (range >= 0.1) {
568 Float_t zMax = z_0 + range;
569 Float_t zMin = z_0 - range;
570 Float_t zStep = (zMax - zMin) / nPlanes;
572 Float_t minDist = 1000.0;
573 Float_t minZ = -1000.0;
575 for (Int_t iPlane = 0; iPlane < nPlanes; ++iPlane) {
576 Float_t z = zMax - iPlane * zStep;
583 Float_t
d = Sqrt(Sq(par1->GetX() - par2->GetX()) + Sq(par1->GetY() - par2->GetY()));
596Float_t BmnHypNuclPairFinder::GetdEdx(
CbmStsTrack* tr)
600 set<Float_t> signalsLow;
603 for (Int_t hitIdx = 0; hitIdx < nHits; ++hitIdx) {
621 Int_t usedHits = (nGemHits == 3) ? 2
622 : (nGemHits == 4) ? 2
623 : (nGemHits == 5) ? 3
624 : (nGemHits == 6) ? 4
625 : (nGemHits == 7) ? 4
629 auto itLow = signalsLow.begin();
631 Float_t totSigLow = 0.0;
633 for (Int_t
i = 0;
i < usedHits; ++
i) {
635 totSigLow += (*itLow);
640 totSigLow /= usedHits;
649void BmnHypNuclPairFinder::GetNHits(
CbmStsTrack* tr, Int_t& nGEM, Int_t& nFSD)
653 for (Int_t hitIdx = 0; hitIdx < tr->
GetNStsHits(); ++hitIdx) {
663Float_t BmnHypNuclPairFinder::GetDyTof700(FairTrackParam* par)
666 Float_t mom = 1.0 / par->GetQp();
667 return (mom > 0) ? 0.17 * mom - 0.40 : 0.0;
672Float_t BmnHypNuclPairFinder::GetDxTof700(FairTrackParam* par)
680Float_t BmnHypNuclPairFinder::GetSigXTof700He3(FairTrackParam* par)
683 Float_t mom = 1.0 / par->GetQp();
684 return (mom > 0) ? 6.58 * TMath::Exp(-1.73 * mom) + 0.69 : 1.0;
689Float_t BmnHypNuclPairFinder::GetSigYTof700He3(FairTrackParam* par)
692 Float_t mom = 1.0 / par->GetQp();
693 return (mom > 0) ? 7.52 * TMath::Exp(-2.08 * mom) + 0.53 : 1.0;
698map<Float_t, pair<Int_t, Int_t>> BmnHypNuclPairFinder::FindPairs(TClonesArray* tracks, TClonesArray* hits)
701 map<Float_t, pair<Int_t, Int_t>> distancesPairs;
710 Float_t zTof701HitsMin = 616;
712 for (Int_t trIdx = 0; trIdx < tracks->GetEntriesFast(); ++trIdx) {
719 for (Int_t hitIdx = 0; hitIdx < hits->GetEntriesFast(); ++hitIdx) {
721 FairTrackParam param = parMinZ;
724 Float_t dX = Abs(param.GetX() - GetDxTof700(¶m) - hit->GetX());
725 Float_t dY = Abs(param.GetY() - GetDyTof700(¶m) - hit->GetY());
726 Float_t xCut = 3.0 * GetSigXTof700He3(¶m);
727 Float_t yCut = 3.0 * GetSigYTof700He3(¶m);
728 if (dX < xCut && dY < yCut) {
729 Float_t
dist = Sqrt(dX * dX + dY * dY);
731 distancesPairs.insert(pair<Float_t, pair<Int_t, Int_t>>(
dist, pair<Int_t, Int_t>(trIdx, hitIdx)));
736 return distancesPairs;
ClassImp(BmnHypNuclPairFinder)
vector< Double_t > dist(vector< Double_t > qp, Double_t mu)
const Float_t d
Z-ccordinate of the first GEM-station.
friend F32vec4 exp(const F32vec4 &a)
Double_t GetMass2(Int_t tofID)
Int_t GetGemTrackIndex() const
Double_t GetdQdNLower() const
void SetUsing(Bool_t use)
virtual InitStatus Init()
virtual void Exec(Option_t *option)
virtual ~BmnHypNuclPairFinder()
void SetdDCA12(Float_t val)
void SetDCA0(Float_t val)
void SetDCA1(Float_t val)
void SetInvMass(Float_t val)
void SetDCA2(Float_t val)
void SetChi2NDF(Float_t val1, Float_t val2)
void SetNHitsPair(vector< Int_t > part1, vector< Int_t > part2)
void SetDCA12(Float_t val)
void SetdDCA1(Float_t val)
void SetNTrInEvent(Int_t n)
void SetPath(Float_t val)
void SetDedx(Float_t val)
void SetdDCA2(Float_t val)
void SetMomXYZ2(Float_t px, Float_t py, Float_t pz)
void SetMomXYZ1(Float_t px, Float_t py, Float_t pz)
BmnStatus TGeoTrackPropagate(FairTrackParam *par, Double_t zOut, Int_t pdg, vector< Double_t > *F, Double_t *length, Bool_t isField)
Bool_t IsTriggerBitTrueAR(Short_t bit)
virtual Int_t GetStationNr() const
Int_t GetSystemId() const
FairTrackParam * GetParamLast()
Int_t GetNStsHits() const
Int_t GetStsHitIndex(Int_t iHit) const
FairTrackParam * GetParamFirst()
Double_t GetCovariance(Int_t i, Int_t j) const