Skip to content

Commit ee9f264

Browse files
authored
Update nucleitpcpbpb.cxx
1 parent a60d351 commit ee9f264

File tree

1 file changed

+10
-27
lines changed

1 file changed

+10
-27
lines changed

PWGLF/Tasks/Nuspex/nucleitpcpbpb.cxx

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ static const std::vector<double> particleMasses{o2::constants::physics::MassPion
6060
static const std::vector<int> particleCharge{1, 1, 1, 1, 2, 2};
6161
const int nBetheParams = 6;
6262
std::vector<int> hfMothCodes = {511, 521, 531, 541, 5122}; // b-mesons + Lambda_b
63-
enum NucleiFlags {
64-
kIsPhysicalPrimary = BIT(0),
65-
kIsSecondaryFromMaterial = BIT(1),
66-
kIsSecondaryFromWeakDecay = BIT(2)
67-
};
6863
static const std::vector<std::string> betheBlochParNames{"p0", "p1", "p2", "p3", "p4", "resolution"};
6964
constexpr double kBetheBlochDefault[nParticles][nBetheParams]{
7065
{13.611469, 3.598765, -0.021138, 2.039562, 0.651040, 0.09}, // pion
@@ -160,6 +155,7 @@ struct NucleitpcPbPb {
160155
Configurable<bool> cfgFillmassnsigma{"cfgFillmassnsigma", true, "Fill mass vs nsigma histograms"};
161156
Configurable<float> centcut{"centcut", 80.0f, "centrality cut"};
162157
Configurable<float> cfgCutRapidity{"cfgCutRapidity", 0.5f, "Rapidity range"};
158+
Configurable<float> cfgtpcNClsFindable{"cfgtpcNClsFindable", 0.8f, "tpcNClsFindable over crossedRows"}; /////////////
163159
Configurable<float> cfgZvertex{"cfgZvertex", 10, "Min Z Vertex"};
164160
Configurable<bool> cfgZvertexRequire{"cfgZvertexRequire", true, "Pos Z cut require"};
165161
Configurable<bool> cfgZvertexRequireMC{"cfgZvertexRequireMC", true, "Pos Z cut require for generated particles"};
@@ -203,6 +199,7 @@ struct NucleitpcPbPb {
203199
TRandom3 rand;
204200
float he3 = 4;
205201
float he4 = 5;
202+
float processmaterial = 23;
206203
//----------------------------------------------------------------------------------------------------------------
207204
void init(InitContext const&)
208205
{
@@ -361,7 +358,7 @@ struct NucleitpcPbPb {
361358
continue;
362359
if (track.tpcNClsFound() < cfgTrackPIDsettings->get(i, "minTPCnCls") && cfgTPCNClsfoundRequire)
363360
continue;
364-
if (((track.tpcNClsCrossedRows() < cfgTrackPIDsettings->get(i, "minTPCnClsCrossedRows")) || track.tpcNClsCrossedRows() < 0.8 * track.tpcNClsFindable()) && cfgTPCNClsCrossedRowsRequire) // o2-linter: disable=magic-number (To be checked)
361+
if (((track.tpcNClsCrossedRows() < cfgTrackPIDsettings->get(i, "minTPCnClsCrossedRows")) || track.tpcNClsCrossedRows() < cfgtpcNClsFindable * track.tpcNClsFindable()) && cfgTPCNClsCrossedRowsRequire)
365362
continue;
366363
if (track.tpcChi2NCl() > cfgTrackPIDsettings->get(i, "maxTPCchi2") && cfgmaxTPCchi2Require)
367364
continue;
@@ -478,14 +475,15 @@ struct NucleitpcPbPb {
478475
isMaterialSecondary = true;
479476
} else {
480477
auto mother = mcParticle.mothers_as<aod::McParticles>().front();
481-
if (std::abs(mother.pdgCode()) < 1000000000) {
478+
float notmother = 1000000000;
479+
if (std::abs(mother.pdgCode()) < notmother) {
482480
isMaterialSecondary = true;
483481
}
484482
}
485483
}
486484
if (isHe3 || isHe4) {
487485
histomc.fill(HIST("histProcessCodeHe"), mcParticle.getProcess());
488-
if (mcParticle.getProcess() == 23) {
486+
if (mcParticle.getProcess() == processmaterial) {
489487
histomc.fill(HIST("histProcess23Details"), std::abs(pdgCode), mcParticle.pt());
490488
}
491489
}
@@ -513,32 +511,27 @@ struct NucleitpcPbPb {
513511
if (!isHe3 && !isHe4)
514512
continue;
515513

516-
uint16_t flags = 0;
517514
int decayType = 0;
518515
int particleAnti = (pdgCode > 0) ? 0 : 1;
519516

520517
if (mcParticle.isPhysicalPrimary()) {
521-
flags |= kIsPhysicalPrimary;
522518
decayType = 0;
523519
if (mcParticle.has_mothers()) {
524520
for (const auto& motherparticle : mcParticle.mothers_as<aod::McParticles>()) {
525521
if (std::find(hfMothCodes.begin(), hfMothCodes.end(),
526522
std::abs(motherparticle.pdgCode())) != hfMothCodes.end()) {
527-
flags |= kIsSecondaryFromWeakDecay;
528523
decayType = 1;
529524
break;
530525
}
531526
}
532527
}
533528
} else if (mcParticle.has_mothers()) {
534-
flags |= kIsSecondaryFromWeakDecay;
535529
decayType = 1;
536530
} else {
537-
flags |= kIsSecondaryFromMaterial;
538531
decayType = 2;
539532
continue;
540533
}
541-
bool isFromWeakDecay = (flags & kIsSecondaryFromWeakDecay) != 0;
534+
bool isFromWeakDecay = (decayType == 1);
542535

543536
if (!mcParticle.isPhysicalPrimary() && !isFromWeakDecay)
544537
continue;
@@ -609,32 +602,27 @@ struct NucleitpcPbPb {
609602
if (std::abs(mcParticle.y()) > cfgCutRapidity)
610603
continue;
611604

612-
uint16_t flags = 0;
613605
int decayType = 0;
614606
int particleAnti = (pdgCode > 0) ? 0 : 1;
615607

616608
if (mcParticle.isPhysicalPrimary()) {
617-
flags |= kIsPhysicalPrimary;
618609
decayType = 0;
619610
if (mcParticle.has_mothers()) {
620611
for (const auto& motherparticle : mcParticle.mothers_as<aod::McParticles>()) {
621612
if (std::find(hfMothCodes.begin(), hfMothCodes.end(),
622613
std::abs(motherparticle.pdgCode())) != hfMothCodes.end()) {
623-
flags |= kIsSecondaryFromWeakDecay;
624614
decayType = 1;
625615
break;
626616
}
627617
}
628618
}
629619
} else if (mcParticle.has_mothers()) {
630-
flags |= kIsSecondaryFromWeakDecay;
631620
decayType = 1;
632621
} else {
633-
flags |= kIsSecondaryFromMaterial;
634622
decayType = 2;
635623
continue;
636624
}
637-
bool isFromWeakDecay = (flags & kIsSecondaryFromWeakDecay) != 0;
625+
bool isFromWeakDecay = (decayType == 1);
638626

639627
if (!mcParticle.isPhysicalPrimary() && !isFromWeakDecay)
640628
continue;
@@ -699,7 +687,7 @@ struct NucleitpcPbPb {
699687
bool isMaterialSecondary = false;
700688
if ((isHe3 || isHe4) && !matchedMCParticle.isPhysicalPrimary()) {
701689

702-
if (matchedMCParticle.getProcess() == 23) { // kPMaterial
690+
if (matchedMCParticle.getProcess() == processmaterial) { // kPMaterial
703691
isMaterialSecondary = true;
704692
} else if (!matchedMCParticle.has_mothers()) {
705693
isMaterialSecondary = true;
@@ -728,30 +716,25 @@ struct NucleitpcPbPb {
728716
continue;
729717
}
730718
}
731-
uint16_t flags = 0;
732719
int decayType = 0;
733720
bool isFromWeakDecay = false;
734721

735722
if (matchedMCParticle.isPhysicalPrimary()) {
736-
flags |= kIsPhysicalPrimary;
737723
decayType = 0;
738724
if (matchedMCParticle.has_mothers()) {
739725
for (const auto& motherparticle : matchedMCParticle.mothers_as<aod::McParticles>()) {
740726
if (std::find(hfMothCodes.begin(), hfMothCodes.end(),
741727
std::abs(motherparticle.pdgCode())) != hfMothCodes.end()) {
742-
flags |= kIsSecondaryFromWeakDecay;
743728
isFromWeakDecay = true;
744729
decayType = 1;
745730
break;
746731
}
747732
}
748733
}
749734
} else if (matchedMCParticle.has_mothers()) {
750-
flags |= kIsSecondaryFromWeakDecay;
751735
isFromWeakDecay = true;
752736
decayType = 1;
753737
} else {
754-
flags |= kIsSecondaryFromMaterial;
755738
decayType = 2;
756739
}
757740

@@ -788,7 +771,7 @@ struct NucleitpcPbPb {
788771
continue;
789772
if (track.tpcNClsFound() < cfgTrackPIDsettings->get(i, "minTPCnCls") && cfgTPCNClsfoundRequire)
790773
continue;
791-
if (((track.tpcNClsCrossedRows() < cfgTrackPIDsettings->get(i, "minTPCnClsCrossedRows")) || track.tpcNClsCrossedRows() < 0.8 * track.tpcNClsFindable()) && cfgTPCNClsCrossedRowsRequire)
774+
if (((track.tpcNClsCrossedRows() < cfgTrackPIDsettings->get(i, "minTPCnClsCrossedRows")) || track.tpcNClsCrossedRows() < cfgtpcNClsFindable * track.tpcNClsFindable()) && cfgTPCNClsCrossedRowsRequire)
792775
continue;
793776
if (track.tpcChi2NCl() > cfgTrackPIDsettings->get(i, "maxTPCchi2") && cfgmaxTPCchi2Require)
794777
continue;

0 commit comments

Comments
 (0)