47 if (config == BmnGemStripConfiguration::GEM_CONFIG::RunSpring2018)
50 else if (config == BmnGemStripConfiguration::GEM_CONFIG::RunSpring2017)
54 cout <<
"BmnGemStripConfiguration not defined !!!" << endl;
61 gPathGemConfig +=
"/parameters/gem/XMLConfigs/";
66 cout <<
" Current Configuration : RunSpring2017"
72 cout <<
" Current Configuration : RunSpring2018"
78 cout <<
" Current Configuration : RunSpring2018"
90 FairTrackParam pion_V0,
91 FairTrackParam proton_Vp,
92 FairTrackParam pion_Vp)
111 TVector3 protonV0(proton_V0.GetX(), proton_V0.GetY(), proton_V0.GetZ());
113 TVector3 pionV0(pion_V0.GetX(), pion_V0.GetY(), pion_V0.GetZ());
116 TVector3 protonVp(proton_Vp.GetX(), proton_Vp.GetY(), proton_Vp.GetZ());
118 TVector3 pionVp(pion_Vp.GetX(), pion_Vp.GetY(), pion_Vp.GetZ());
133 vector<Double_t> cuts;
134 cuts.push_back(protonVpVp);
135 cuts.push_back(pionVpVp);
136 cuts.push_back(protonV0PionV0);
145 fKalman->TGeoTrackPropagate(&parPredict, Z, pdg,
nullptr,
nullptr,
kTRUE);
152 FairTrackParam param;
153 map<Double_t, FairMCPoint*> firstPoint;
155 for (
Int_t iPoint = 0; iPoint <
fSilPoints->GetEntriesFast(); iPoint++) {
157 Int_t TrackID = silPoint->GetTrackID();
159 if (TrackID != iTrack)
162 firstPoint[silPoint->
GetZIn()] = silPoint;
166 if (firstPoint.size() == 0)
167 for (
Int_t iPoint = 0; iPoint <
fGemPoints->GetEntriesFast(); iPoint++) {
169 Int_t TrackID = gemPoint->GetTrackID();
171 if (TrackID != iTrack)
174 firstPoint[gemPoint->
GetZIn()] = gemPoint;
177 point = firstPoint.begin()->second;
187 param.SetTx(Px / Pz);
188 param.SetTy(Py / Pz);
189 param.SetQp(sign /
Sqrt(Px * Px + Py * Py + Pz * Pz));
190 param.SetX(point->GetX());
191 param.SetY(point->GetY());
192 param.SetZ(point->GetZ());
212 eta = 0.5 *
Log((
Abs(p) + Pz) / (
Abs(p) - Pz));
253 if (iTrack == jTrack)
286 if (V0Z < Vpz - 10. || V0Z >
fDetector->GetGemStation(5)->GetZPosition())
298 FairTrackParam proton_V0, pion_V0;
302 Double_t V0X = .5 * (proton_V0.GetX() + pion_V0.GetX());
303 Double_t V0Y = .5 * (proton_V0.GetY() + pion_V0.GetY());
310 if (V0X < xCutMin || V0X > xCutMax || V0Y < yCutMin || V0Y > yCutMax)
313 vector<Double_t> geomTopology =
GeomTopology(proton_V0, pion_V0, proton_Vp, pion_Vp);
331 partPair.
SetDCA1(geomTopology.at(0));
332 partPair.
SetDCA2(geomTopology.at(1));
333 partPair.
SetDCA12(geomTopology.at(2));
374 vector<Int_t> particle1{nHitsSil1, nHitsGem1};
375 vector<Int_t> particle2{nHitsSil2, nHitsGem2};
384 Double_t Tx1, Ty1, Tx2, Ty2, p1, p2;
389 Tx1 = proton_V0.GetTx();
390 Ty1 = proton_V0.GetTy();
391 Tx2 = pion_V0.GetTx();
392 Ty2 = pion_V0.GetTy();
393 p1 = 1. / proton_V0.GetQp();
394 p2 = 1. / pion_V0.GetQp();
398 A1 = 1. /
Sqrt(Tx1 * Tx1 + Ty1 * Ty1 + 1);
403 A2 = 1. /
Sqrt(Tx2 * Tx2 + Ty2 * Ty2 + 1);
417 Double_t PzPart0 = PzPart1 + PzPart2;
418 Double_t PxPart0 = PzPart1 * Tx1 + PzPart2 * Tx2;
419 Double_t PyPart0 = PzPart1 * Ty1 + PzPart2 * Ty2;
421 Double_t TxPart0 = PxPart0 / PzPart0;
422 Double_t TyPart0 = PyPart0 / PzPart0;
424 Double_t xPart0 = TxPart0 * (Vp.
Z() - V0.
Z()) + V0.
X();
425 Double_t yPart0 = TyPart0 * (Vp.
Z() - V0.
Z()) + V0.
Y();
436 if (isMC &&
fAnalType[1].Contains(
"OFF")) {
460 cout <<
"\nBmnTwoParticleDecay::Init()" << endl;
462 FairRootManager* ioman = FairRootManager::Instance();
471 Fatal(
"BmnTwoParticleDecay::Init()",
"No geometry file passed!!!");
480 cout <<
"Geometry '" << setupTag <<
"' can't be loaded from the Geometry Database" << endl;
488 cout <<
"Something is wrong when getting run info from DB..." << endl;
524 const Char_t* className =
"BmnParticlePair";
532 ioman->Register(
"ParticlePair_MC",
"Lambda",
fParticlePair_MC, isWriteEveBranch);
538 ioman->Register(
"ParticlePair",
"Lambda",
fParticlePair, isWriteBranch);
542 ioman->Register(
"DstEventHeaderExtended.",
"Lambda",
fPhysInfo, isWriteBranch);
550 FairRunAna::Instance()->SetField(
fMagField);
551 fField = FairRunAna::Instance()->GetField();
585 if (iEvent % 10000 == 0)
586 cout <<
"digiFile#, processing event: " << iEvent << endl;
610 pair<Int_t, Int_t> trigPair =
fTrigCountMap.find(
id)->second;
622 for (
Int_t iTrack = 0; iTrack <
fMCTracks->GetEntriesFast(); iTrack++) {
644 for (
Int_t iProj = 0; iProj < 3; iProj++)
645 if (
Abs(
TVector3(roughVert - realVert)[iProj]) > vertexCut)
656 cout <<
"\n-I- [BmnTwoParticleDecay::Finish] " << endl;
679 Double_t momHyp2 = (Px1 + Px2) * (Px1 + Px2) + (Py1 + Py2) * (Py1 + Py2) + (Pz1 + Pz2) * (Pz1 + Pz2);
681 Double_t oneOver2MomHyp = 1 / (2 * momHyp);
682 Double_t L1 = (momHyp2 + mom1sq - mom2sq) * oneOver2MomHyp;
683 Double_t L2 = (momHyp2 + mom2sq - mom1sq) * oneOver2MomHyp;
684 Double_t alpha = (L1 - L2) / (L1 + L2);
685 Double_t Pt =
Sqrt((mom1sq + mom2sq + momHyp2) * (mom1sq + mom2sq + momHyp2)
686 - 2 * (mom1sq * mom1sq + mom2sq * mom2sq + momHyp2 * momHyp2))
697 const Int_t nPlanes = 10;
701 while (range >= 0.1) {
704 Double_t zStep = (zMax - zMin) / nPlanes;
712 for (
Int_t iPlane = 0; iPlane < nPlanes; ++iPlane) {
713 zPlane[iPlane] = zMax - iPlane * zStep;
724 Dist[iPlane] =
Sqrt(
Sq(par1.GetX() - par2.GetX()) +
Sq(par1.GetY() - par2.GetY()));
731 V0.
Fit(
"pol2",
"QF");
740 map<Double_t, Double_t> dist_zPlanes;
742 for (
Int_t iPlane = 0; iPlane < nPlanes; iPlane++)
743 dist_zPlanes[
Dist[iPlane]] = zPlane[iPlane];
745 z_0 = dist_zPlanes.begin()->second;
Bool_t IsParCorrect(const FairTrackParam *par, const Bool_t isField)
Float_t Dist(Float_t x1, Float_t y1, Float_t x2, Float_t y2)
void Fatal(const char *location, const char *msgfmt,...)
R__EXTERN TSystem * gSystem
BmnStatus
Define status code.
Int_t GetGemTrackIndex() const
Accessors.
Field Map does not have any symmetries w.r.t coordinate axises.
void SetMCTrackIdPart2(Int_t id)
Int_t GetNHitsPart1(TString det="")
void SetAlpha(Double_t val)
void SetDCA2(Double_t val)
void SetTxPair(Double_t val1, Double_t val2)
void SetPtPodol(Double_t val)
Int_t GetNHitsPart2(TString det="")
void SetRecoTrackIdPart2(Int_t id)
void SetNHitsPair(vector< Int_t > part1, vector< Int_t > part2)
void SetTyPair(Double_t val1, Double_t val2)
void SetInvMass(Double_t val)
void SetV0Y(Double_t val)
void SetV0Z(Double_t val)
void SetDCA1(Double_t val)
void SetDCA12(Double_t val)
void SetMomPair(Double_t val1, Double_t val2)
void SetMCTrackIdPart1(Int_t id)
void SetRecoTrackIdPart1(Int_t id)
void SetDCA0(Double_t val)
void SetEtaPair(Double_t val1, Double_t val2)
void SetPath(Double_t val)
void SetV0X(Double_t val)
FairTrackParam * GetParamFirst()
Int_t GetNHits() const
Accessors.
void SetParamFirst(FairTrackParam &par)
Modifiers.
BmnStatus FindFirstPointOnMCTrack(Int_t, BmnGlobalTrack *, Int_t)
Int_t CheckSign(Double_t val)
vector< TString > fAnalType
DstEventHeader * fDstHeader
TClonesArray * fGemTracks
virtual void Exec(Option_t *option)
Bool_t CheckTrack(BmnGlobalTrack *, Int_t, Double_t &, Double_t &)
TClonesArray * fParticlePair
vector< Double_t > GeomTopology(FairTrackParam, FairTrackParam, FairTrackParam, FairTrackParam)
BmnGemStripStationSet * fDetector
TDatabasePDG * fPDG
event counter
BmnGemStripConfiguration::GEM_CONFIG fGeometry
TClonesArray * fGemPoints
PDG database.
BmnKalmanFilter * fKalman
TString fBranchGlobalTracks
DstEventHeaderExtended * fPhysInfo
virtual InitStatus Init()
TString fBranchGlobalMatch
virtual ~BmnTwoParticleDecay()
Double_t FindV0ByVirtualPlanes(BmnGlobalTrack *, BmnGlobalTrack *, Double_t, Double_t range=50.)
TClonesArray * fSiliconTracks
TClonesArray * fParticlePair_MC
TClonesArray * fSilPoints
TClonesArray * fGlobalMatches
map< UInt_t, pair< Int_t, Int_t > > fTrigCountMap
TClonesArray * fParticlePair_RECO
TClonesArray * fGlobalTracks
FairTrackParam KalmanTrackPropagation(BmnGlobalTrack *track, Int_t, Double_t)
TVector2 ArmenterosPodol(FairTrackParam, FairTrackParam)
Int_t recoToMcIdx(Int_t iTrack)
Double_t GetStartZ() const
Double_t GetStartY() const
Int_t GetMotherId() const
Double_t GetStartX() const
int LoadSetupToGeoManager(string_view setup_tag)
Load selected geometry setup from the Local Geometry Database and create gGeoManager instance.
string GetLastApprovedSetupTag(string_view tag_prefix)
Get tag for the last approved setup corresponding to the pattern.
Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr=nullptr)
virtual Int_t Add(const char *name, Long64_t nentries=TTree::kMaxEntries)
Long64_t GetEntries() const override
Int_t GetEntry(Long64_t entry=0, Int_t getall=0) override
static TDatabasePDG * Instance()
virtual Double_t GetParameter(const TString &name) const
static TGeoManager * Import(const char *filename, const char *name="", Option_t *option="")
TF1 * GetFunction(const char *name) const
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Axis_t xmin=0, Axis_t xmax=0)
void SetXYZM(Double_t x, Double_t y, Double_t z, Double_t m)
Int_t GetEntriesFast() const
TObject * UncheckedAt(Int_t i) const
static TString Format(const char *fmt,...)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
UniRun.h Class for the table: run_.
static UniRun * GetRun(int period_number, int run_number)
get run from the database
double * GetFieldVoltage()
get field voltage of the current run
Double_t Sqrt(Double_t x)