Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 34 additions & 36 deletions PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@
TH2S* fhTruePIDMismatch = nullptr;
TH1S* fhTruePIDCorrect = nullptr;

std::vector<std::vector<TH2F*>> fhTrueNSigmaTPC = {o2::analysis::identifiedbffilter::kIdBfNoOfSpecies,{o2::analysis::identifiedbffilter::kIdBfNoOfSpecies,nullptr}};
std::vector<std::vector<TH2F*>> fhTrueNSigmaTOF = {o2::analysis::identifiedbffilter::kIdBfNoOfSpecies,{o2::analysis::identifiedbffilter::kIdBfNoOfSpecies,nullptr}};
std::vector<std::vector<TH2F*>> fhTrueNSigmaTPC = {o2::analysis::identifiedbffilter::kIdBfNoOfSpecies, {o2::analysis::identifiedbffilter::kIdBfNoOfSpecies, nullptr}};
std::vector<std::vector<TH2F*>> fhTrueNSigmaTOF = {o2::analysis::identifiedbffilter::kIdBfNoOfSpecies, {o2::analysis::identifiedbffilter::kIdBfNoOfSpecies, nullptr}};

TH1F* fhTrueCentMultB = nullptr;
TH1F* fhTrueCentMultA = nullptr;
Expand Down Expand Up @@ -893,9 +893,8 @@
TString::Format("dE/dx vs P_{IP} reconstructed %s; P (GeV/c); dE/dx (a.u.)", speciesTitle[sp]).Data(),
ptbins, ptlow, ptup, 1000, 0.0, 1000.0);
fhTrackTime[sp] = new TH2F(TString::Format("fhTrackTime_%s", speciesName[sp]).Data(),
TString::Format("Track Time vs P_{IP} reconstructed %s; P (GeV/c); Track Time (ns)", speciesTitle[sp]).Data(),
ptbins, ptlow, ptup, 200, 0.0, 20.0);

TString::Format("Track Time vs P_{IP} reconstructed %s; P (GeV/c); Track Time (ns)", speciesTitle[sp]).Data(),
ptbins, ptlow, ptup, 200, 0.0, 20.0);
}
fhdEdxA[kIdBfNoOfSpecies + 1] = new TH2F(TString::Format("fhdEdxA_WrongSpecies").Data(),
TString::Format("dE/dx vs P reconstructed Wrong Species; P (GeV/c); dE/dx (a.u.)").Data(),
Expand All @@ -904,8 +903,8 @@
TString::Format("dE/dx vs P_{IP} reconstructed Wrong Species; P (GeV/c); dE/dx (a.u.)").Data(),
ptbins, ptlow, ptup, 1000, 0.0, 1000.0);
fhTrackTime[kIdBfNoOfSpecies + 1] = new TH2F(TString::Format("fhTrackTime_WrongSpecies").Data(),
TString::Format("Track Time vs P_{IP} reconstructed Wrong Species; P (GeV/c); Track Time (ns)").Data(),
ptbins, ptlow, ptup, 200, 0.0, 20.0);
TString::Format("Track Time vs P_{IP} reconstructed Wrong Species; P (GeV/c); Track Time (ns)").Data(),
ptbins, ptlow, ptup, 200, 0.0, 20.0);

/* add the hstograms to the output list */
fOutputList->Add(fhXYB);
Expand Down Expand Up @@ -1037,25 +1036,24 @@
TString::Format("N(%s^{#plus}) #minus N(%s^{#minus}) distribution (truth);N(%s^{#plus}) #minus N(%s^{#minus})", speciesTitle[sp], speciesTitle[sp], speciesTitle[sp], speciesTitle[sp]).Data(),
79, -39.5, 39.5);
fhTruedEdx[sp] = new TH2F(TString::Format("fhTruedEdxA_%s", speciesName[sp]).Data(),
TString::Format("dE/dx vs P_{IP} Generated %s; P (GeV/c); dE/dx (a.u.)", speciesTitle[sp]).Data(),
ptbins, ptlow, ptup, 1000, 0.0, 1000.0);
TString::Format("dE/dx vs P_{IP} Generated %s; P (GeV/c); dE/dx (a.u.)", speciesTitle[sp]).Data(),
ptbins, ptlow, ptup, 1000, 0.0, 1000.0);
fhTrueTrackTime[sp] = new TH2F(TString::Format("fhTrueTrackTimeA_%s", speciesName[sp]).Data(),
TString::Format("Track Time vs P_{IP} Generated %s; P (GeV/c); Track Time (ns)", speciesTitle[sp]).Data(),
ptbins, ptlow, ptup, 200, 0.0, 20.0);

TString::Format("Track Time vs P_{IP} Generated %s; P (GeV/c); Track Time (ns)", speciesTitle[sp]).Data(),
ptbins, ptlow, ptup, 200, 0.0, 20.0);
}

for (int sp1 = 0; sp1 < kIdBfNoOfSpecies; ++sp1) {
for (int sp2 = 0; sp2 < kIdBfNoOfSpecies; ++sp2) {
fhTrueNSigmaTPC[sp1][sp2] = new TH2F(TString::Format("fhTrueNSigmaTPC%s_%s", speciesName[sp1], speciesName[sp2]).Data(),
TString::Format("N #sigma %s from TPC vs P for generated %s;N #sigma;p (GeV/c)", speciesTitle[sp1], speciesTitle[sp2]).Data(),
48, -6, 6,
ptbins, ptlow, ptup);
TString::Format("N #sigma %s from TPC vs P for generated %s;N #sigma;p (GeV/c)", speciesTitle[sp1], speciesTitle[sp2]).Data(),
48, -6, 6,
ptbins, ptlow, ptup);

fhTrueNSigmaTOF[sp1][sp2] = new TH2F(TString::Format("fhTrueNSigmaTOF%s_%s", speciesName[sp1], speciesName[sp2]).Data(),
TString::Format("N #sigma %s from TOF vs P for generated %s;N #sigma;p (GeV/c)", speciesTitle[sp1], speciesTitle[sp2]).Data(),
48, -6, 6,
ptbins, ptlow, ptup);
TString::Format("N #sigma %s from TOF vs P for generated %s;N #sigma;p (GeV/c)", speciesTitle[sp1], speciesTitle[sp2]).Data(),
48, -6, 6,
ptbins, ptlow, ptup);
}
}

Expand Down Expand Up @@ -1494,14 +1492,14 @@

fillNSigmaHistos(track);

std::vector<float> actualTPCNSigma(kIdBfNoOfSpecies,0.);
std::vector<float> actualTPCNSigma(kIdBfNoOfSpecies, 0.);

actualTPCNSigma[kIdBfElectron] = track.tpcNSigmaEl();
actualTPCNSigma[kIdBfPion] = track.tpcNSigmaPi();
actualTPCNSigma[kIdBfKaon] = track.tpcNSigmaKa();
actualTPCNSigma[kIdBfProton] = track.tpcNSigmaPr();

std::vector<float> actualTOFNSigma(kIdBfNoOfSpecies,0.);
std::vector<float> actualTOFNSigma(kIdBfNoOfSpecies, 0.);

actualTOFNSigma[kIdBfElectron] = track.tofNSigmaEl();
actualTOFNSigma[kIdBfPion] = track.tofNSigmaPi();
Expand All @@ -1511,7 +1509,7 @@
float nsigmas[kIdBfNoOfSpecies];

if constexpr (framework::has_type_v<aod::mctracklabel::McParticleId, typename TrackObject::all_columns>) {
identifyRealNSigma(track.template mcParticle_as<aod::McParticles>(),actualTPCNSigma, actualTOFNSigma, track.tpcInnerParam());
identifyRealNSigma(track.template mcParticle_as<aod::McParticles>(), actualTPCNSigma, actualTOFNSigma, track.tpcInnerParam());
}

if (loadfromccdb) {
Expand All @@ -1532,7 +1530,7 @@
nsigmas[iSp] = sqrtf(actualTPCNSigma[iSp] * actualTPCNSigma[iSp] + actualTOFNSigma[iSp] * actualTOFNSigma[iSp]);
}
} else if (!reqTOF || !onlyTOF) {
//If I don't require TOF after the tofCut, use TPC only for tracks w/o TOF
// If I don't require TOF after the tofCut, use TPC only for tracks w/o TOF
for (int iSp = 0; iSp < kIdBfNoOfSpecies; iSp++) {
nsigmas[iSp] = actualTPCNSigma[iSp];
}
Expand All @@ -1545,8 +1543,8 @@
}
}

//Change this to just skip undesired particle checks instead of setting the nsigma to 999.0f
//This method will allow for exclusion of the electron band
// Change this to just skip undesired particle checks instead of setting the nsigma to 999.0f
// This method will allow for exclusion of the electron band
if (!pidEl) {
nsigmas[kIdBfElectron] = 999.0f;
}
Expand Down Expand Up @@ -1583,7 +1581,7 @@
fhWrongTrackID->Fill(track.p());
fhdEdxA[kIdBfNoOfSpecies]->Fill(track.p(), track.tpcSignal());
fhdEdxIPTPCA[kIdBfNoOfSpecies]->Fill(track.tpcInnerParam(), track.tpcSignal());
if(track.hasTOF()){
if (track.hasTOF()) {
fhTrackTime[kIdBfNoOfSpecies]->Fill(track.tpcInnerParam(), track.trackTime());
}
fhDoublePID->Fill(spMinNSigma, spDouble);
Expand Down Expand Up @@ -1620,7 +1618,7 @@
if (matchTrackType(track)) {
if (ptlow < track.pt() && track.pt() < ptup && etalow < track.eta() && track.eta() < etaup) {
fillTrackHistosAfterSelection(track, kIdBfCharged);
if constexpr (framework::has_type_v<aod::mctracklabel::McParticleId, typename TrackObject::all_columns>){
if constexpr (framework::has_type_v<aod::mctracklabel::McParticleId, typename TrackObject::all_columns>) {
fillTrueTrackHistosAfterSelection(track);
}
MatchRecoGenSpecies sp = kWrongSpecies;
Expand Down Expand Up @@ -1803,7 +1801,8 @@
}

template <typename ParticleObject>
inline MatchRecoGenSpecies IdentifiedBfFilterTracks::findTruePID(ParticleObject const& particle){
inline MatchRecoGenSpecies IdentifiedBfFilterTracks::findTruePID(ParticleObject const& particle)
{
MatchRecoGenSpecies realPID = kWrongSpecies;
int pdgcode = std::fabs(particle.pdgCode());
switch (pdgcode) {
Expand All @@ -1827,22 +1826,22 @@
break;
}
return realPID;

}

template <typename TrackObject>
void IdentifiedBfFilterTracks::fillTrueTrackHistosAfterSelection(TrackObject const& track){
void IdentifiedBfFilterTracks::fillTrueTrackHistosAfterSelection(TrackObject const& track)
{

fhTruedEdx[kIdBfCharged]->Fill(track.tpcInnerParam(), track.tpcSignal());

if(track.hasTOF()){
if (track.hasTOF()) {
fhTrueTrackTime[kIdBfCharged]->Fill(track.tpcInnerParam(), track.trackTime());
}
MatchRecoGenSpecies realPID = findTruePID(track.template mcParticle_as<aod::McParticles>());
if(!(realPID < 0)){
if (!(realPID < 0)) {
fhTruedEdx[realPID]->Fill(track.tpcInnerParam(), track.tpcSignal());

if(track.hasTOF()){
if (track.hasTOF()) {
fhTrueTrackTime[realPID]->Fill(track.tpcInnerParam(), track.trackTime());
}
}
Expand Down Expand Up @@ -1872,13 +1871,12 @@
if (track.dcaZ() < 1.0) {
fhFineDCAzA->Fill(track.dcaZ());
}

}
fhPA[sp]->Fill(track.p());
fhPtA[sp]->Fill(track.pt());
fhdEdxA[sp]->Fill(track.p(), track.tpcSignal());
fhdEdxIPTPCA[sp]->Fill(track.tpcInnerParam(), track.tpcSignal());
if(track.hasTOF()){
if (track.hasTOF()) {
fhTrackTime[sp]->Fill(track.tpcInnerParam(), track.trackTime());
}
if (track.sign() > 0) {
Expand All @@ -1890,7 +1888,6 @@
}
}


template <typename ParticleObject, typename MCCollisionObject>
void IdentifiedBfFilterTracks::fillParticleHistosBeforeSelection(ParticleObject const& particle, MCCollisionObject const& collision, float charge)
{
Expand Down Expand Up @@ -1963,4 +1960,5 @@
{"processWithoutCentGeneratorLevel", true}}}),
adaptAnalysisTask<IdentifiedBfFilterTracks>(cfgc)};
return workflow;
}
}

Check failure on line 1964 in PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
Loading