Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PWGCF] Please consider the following formatting changes to #9369 #19

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
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
109 changes: 51 additions & 58 deletions PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
TH1F* fhChi2A = nullptr;
TH1I* fhITSNclA = nullptr;


TH2F* fhNSigmaTPC[kIdBfNoOfSpecies] = {nullptr};
TH2F* fhNSigmaTOF[kIdBfNoOfSpecies] = {nullptr};
TH2F* fhNSigmaCombo[kIdBfNoOfSpecies] = {nullptr};
Expand Down Expand Up @@ -170,7 +169,6 @@
TH2F* fhTruePhiYA = nullptr;
TH2F* fhTruePtYA = nullptr;


TH1F* fhTrueEtaB = nullptr;
TH1F* fhTrueEtaA = nullptr;

Expand All @@ -185,7 +183,6 @@
TH2F* fhTrueDCAxyzB = nullptr;
TH2F* fhTrueDCAxyzA = nullptr;


//============================================================================================
// The IdentifiedBfFilter multiplicity counters
//============================================================================================
Expand Down Expand Up @@ -441,7 +438,7 @@
}

void IdentifiedBfFilter::processWithCentPID(aod::CollisionEvSelCent const& collision, IdBfFullTracksPID const& ftracks)
{
{
processReconstructed(collision, ftracks, getCentMultPercentile(collision));
}

Expand Down Expand Up @@ -768,9 +765,9 @@
fOutput.setObject(fOutputList);

/* incorporate configuration parameters to the output */
fOutputList->Add(new TParameter<Int_t>("TrackType", cfgTrackType, 'f'));

Check warning on line 768 in PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
fOutputList->Add(new TParameter<Int_t>("TrackOneCharge", 1, 'f'));

Check warning on line 769 in PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
fOutputList->Add(new TParameter<Int_t>("TrackTwoCharge", -1, 'f'));

Check warning on line 770 in PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.

if ((fDataType == kData) || (fDataType == kDataNoEvtSel) || (fDataType == kMC)) {
/* create the reconstructed data histograms */
Expand Down Expand Up @@ -820,25 +817,25 @@
fhCompatibleCollisionsZVtxRms = new TH2F("fHistCompatibleCollisionsZVtxRms", "Compatible collisions #it{z}_{vtx} RMS;#sigma_{#it{z}_{vtx}};Multiplicity (%);counts", 100, -10.0, 10.0, 101, -0.5, 100.5);
}

for(int sp = 0; sp < kIdBfNoOfSpecies; ++sp){
for (int sp = 0; sp < kIdBfNoOfSpecies; ++sp) {
fhNSigmaTPC[sp] = new TH2F(TString::Format("fhNSigmaTPC_%s", speciesName[sp]).Data(),
TString::Format("N Sigma from TPC vs P for %s;N #sigma;p (GeV/c)", speciesTitle[sp]).Data(),
48, -6, 6,
ptbins, ptlow, ptup);
TString::Format("N Sigma from TPC vs P for %s;N #sigma;p (GeV/c)", speciesTitle[sp]).Data(),
48, -6, 6,
ptbins, ptlow, ptup);
fhNSigmaTOF[sp] = new TH2F(TString::Format("fhNSigmaTOF_%s", speciesName[sp]).Data(),
TString::Format("N Sigma from TOF vs P for %s;N #sigma;p (GeV/c)", speciesTitle[sp]).Data(),
48, -6, 6,
ptbins, ptlow, ptup);
TString::Format("N Sigma from TOF vs P for %s;N #sigma;p (GeV/c)", speciesTitle[sp]).Data(),
48, -6, 6,
ptbins, ptlow, ptup);
fhNSigmaCombo[sp] = new TH2F(TString::Format("fhNSigmaCombo_%s", speciesName[sp]).Data(),
TString::Format("N Sigma from Combo vs P for %s;N #sigma;p (GeV/c)", speciesTitle[sp]).Data(),
48, -6, 6,
ptbins, ptlow, ptup);
TString::Format("N Sigma from Combo vs P for %s;N #sigma;p (GeV/c)", speciesTitle[sp]).Data(),
48, -6, 6,
ptbins, ptlow, ptup);
fhNSigmaTPC_IdTrks[sp] = new TH2F(TString::Format("fhNSigmaTPC_IdTrks_%s", speciesName[sp]).Data(),
TString::Format("N Sigma from TPC vs P for Identified %s;N #sigma;p (GeV/c)", speciesTitle[sp]).Data(),
48, -6, 6,
ptbins, ptlow, ptup);
}
LOGF(info,"Making histos");
LOGF(info, "Making histos");

for (int sp = 0; sp < kIdBfNoOfSpecies + 1; ++sp) {
fhPA[sp] = new TH1F(TString::Format("fHistPA_%s", speciesName[sp]).Data(),
Expand Down Expand Up @@ -867,11 +864,11 @@
ptbins, ptlow, ptup, 1000, 0.0, 1000.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(),
ptbins, ptlow, ptup, 1000, 0.0, 1000.0);
TString::Format("dE/dx vs P reconstructed Wrong Species; P (GeV/c); dE/dx (a.u.)").Data(),
ptbins, ptlow, ptup, 1000, 0.0, 1000.0);
fhdEdxIPTPCA[kIdBfNoOfSpecies + 1] = new TH2F(TString::Format("fhdEdxIPTPCA_WrongSpecies").Data(),
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);
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);
/* add the hstograms to the output list */
fOutputList->Add(fhXYB);
fOutputList->Add(fhYZB);
Expand Down Expand Up @@ -967,7 +964,7 @@
fhTrueDCAxyA = new TH1F("TrueDCAxyA", "DCA_{xy} distribution for generated;DCA_{xy};counts (cm)", 1000, -4., 4.0);
fhTrueDCAzB = new TH1F("TrueDCAzB", "DCA_{z} distribution for generated before;DCA_{z} (cm);counts", 1000, -4.0, 4.0);
fhTrueDCAzA = new TH1F("TrueDCAzA", "DCA_{z} distribution for generated;DCA_{z} (cm);counts", 1000, -4.0, 4.0);
fhTrueDCAxyzB = new TH2F("TrueDCAxyzB", "DCA_{xy} vs DCA_{z} distribution for generated before;DCA_{xy} (cm);DCA_{z} (cm);counts", 1000, -4.0, 4.0,1000, -4.0, 4.0);
fhTrueDCAxyzB = new TH2F("TrueDCAxyzB", "DCA_{xy} vs DCA_{z} distribution for generated before;DCA_{xy} (cm);DCA_{z} (cm);counts", 1000, -4.0, 4.0, 1000, -4.0, 4.0);
fhTrueDCAxyzA = new TH2F("TrueDCAxyzA", "DCA_{xy} vs DCA_{z} distribution for generated after;DCA_{xy} (cm);DCA_{z} (cm);counts", 1000, -4.0, 4.0, 1000, -4.0, 4.0);

for (int sp = 0; sp < kIdBfNoOfSpecies + 1; ++sp) {
Expand Down Expand Up @@ -1015,7 +1012,6 @@
fOutputList->Add(fhTrueDCAxyzB);
fOutputList->Add(fhTrueDCAxyzA);


for (int sp = 0; sp < kIdBfNoOfSpecies + 1; ++sp) {
fOutputList->Add(fhTruePA[sp]);
fOutputList->Add(fhTruePtA[sp]);
Expand Down Expand Up @@ -1128,12 +1124,12 @@

for (auto& particle : particles) {
int8_t pid = -1;
if(particle.isPhysicalPrimary()){
if (particle.isPhysicalPrimary()) {
TParticlePDG* pdgpart = fPDG->GetParticle(particle.pdgCode());
float charge = 0;
if (pdgpart != nullptr){
if (pdgpart != nullptr) {
charge = getCharge(pdgpart->Charge());
//print charge
// print charge
}
fhTrueCharge->Fill(charge);
if (charge != 0) {
Expand All @@ -1155,14 +1151,13 @@
}

} else {
if((particle.mcCollisionId() == 0) && traceCollId0){
if ((particle.mcCollisionId() == 0) && traceCollId0) {
LOGF(IDENTIFIEDBFFILTERLOGTRACKS, "Particle %d not Physical Primary", particle.globalIndex());
}
}
if (!fullDerivedData) {
gentracksinfo(pid);
}

}
LOGF(info,
"Processed %d accepted generated collisions out of a total of %d with %d accepted particles out of a "
Expand Down Expand Up @@ -1257,7 +1252,7 @@
{
using namespace identifiedbffilter;

int pdgcode = fabs(particle.pdgCode());

Check warning on line 1255 in PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.

switch (pdgcode) {
case pdgcodeEl:
Expand Down Expand Up @@ -1383,7 +1378,7 @@
float min_nsigma = 999.0f;
MatchRecoGenSpecies sp_min_nsigma = kWrongSpecies;
for (int sp = 0; sp < kIdBfNoOfSpecies; ++sp) {
if (fabs(nsigmas[sp]) < fabs(min_nsigma)) { // Check if species nsigma is less than current nsigma
if (fabs(nsigmas[sp]) < fabs(min_nsigma)) { // Check if species nsigma is less than current nsigma

Check warning on line 1381 in PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
min_nsigma = nsigmas[sp]; // If yes, set species nsigma to current nsigma
sp_min_nsigma = MatchRecoGenSpecies(sp); // set current species sp number to current sp
}
Expand Down Expand Up @@ -1496,12 +1491,11 @@
}
TParticlePDG* pdgpart = fPDG->GetParticle(particle.pdgCode());
float charge = 0;
if (pdgpart != nullptr){
if (pdgpart != nullptr) {
charge = getCharge(pdgpart->Charge());
}


if (particle.isPhysicalPrimary() && fabs(charge)>0.0) {
if (particle.isPhysicalPrimary() && fabs(charge) > 0.0) {

Check warning on line 1498 in PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
if ((particle.mcCollisionId() == 0) && traceCollId0) {
LOGF(info, "Particle %d passed isPhysicalPrimary", particle.globalIndex());
}
Expand Down Expand Up @@ -1600,14 +1594,14 @@
template <typename TrackObject, typename CollisionObject>
void IdentifiedBfFilterTracks::fillTrackHistosBeforeSelection(TrackObject const& track, CollisionObject const& collision)
{
fhXYB->Fill(track.x(),track.y());
fhYZB->Fill(track.y(),track.z());
fhXYB->Fill(track.x(), track.y());
fhYZB->Fill(track.y(), track.z());
fhNClustersB->Fill(track.tpcNClsFound());
fhPhiYB->Fill(track.phi(),track.eta());
fhPtYB->Fill(track.pt(),track.eta());
fhPhiYB->Fill(track.phi(), track.eta());
fhPtYB->Fill(track.pt(), track.eta());
fhChi2B->Fill(track.tpcChi2NCl());
fhITSNclB->Fill(track.itsNCls());

fhPB->Fill(track.p());
fhPtB->Fill(track.pt());
fhEtaB->Fill(track.eta());
Expand All @@ -1620,13 +1614,13 @@
fhPtNegB->Fill(track.pt());
}

//float dcaxy = CalculateDCA(track, collision,0);
//float dcaz = CalculateDCA(track, collision,1);
//fhDCAxyB->Fill(dcaxy);
//fhDCAzB->Fill(dcaz);
// float dcaxy = CalculateDCA(track, collision,0);
// float dcaz = CalculateDCA(track, collision,1);
// fhDCAxyB->Fill(dcaxy);
// fhDCAzB->Fill(dcaz);
fhDCAxyB->Fill(track.dcaXY());
fhDCAzB->Fill(track.dcaZ());
fhDCAxyzB->Fill(track.dcaXY(),track.dcaZ());
fhDCAxyzB->Fill(track.dcaXY(), track.dcaZ());
}

template <typename TrackObject, typename CollisionObject>
Expand All @@ -1636,20 +1630,20 @@
if (sp == kIdBfCharged) {
fhEtaA->Fill(track.eta());
fhPhiA->Fill(track.phi());
fhXYA->Fill(track.x(),track.y());
fhYZA->Fill(track.y(),track.z());
fhXYA->Fill(track.x(), track.y());
fhYZA->Fill(track.y(), track.z());
fhNClustersA->Fill(track.tpcNClsFound());
fhPhiYA->Fill(track.phi(),track.eta());
fhPtYA->Fill(track.pt(),track.eta());
fhPhiYA->Fill(track.phi(), track.eta());
fhPtYA->Fill(track.pt(), track.eta());
fhChi2A->Fill(track.tpcChi2NCl());
fhITSNclA->Fill(track.itsNCls());
//float dcaxy = CalculateDCA(track, collision, 0);
//float dcaz = CalculateDCA(track, collision, 1);
//fhDCAxyA->Fill(dcaxy);
//fhDCAzA->Fill(dcaz);
// float dcaxy = CalculateDCA(track, collision, 0);
// float dcaz = CalculateDCA(track, collision, 1);
// fhDCAxyA->Fill(dcaxy);
// fhDCAzA->Fill(dcaz);
fhDCAxyA->Fill(track.dcaXY());
fhDCAzA->Fill(track.dcaZ());
fhDCAxyzA->Fill(track.dcaXY(),track.dcaZ());
fhDCAxyzA->Fill(track.dcaXY(), track.dcaZ());

if (track.dcaXY() < 1.0) {
fhFineDCAxyA->Fill(track.dcaXY());
Expand All @@ -1672,8 +1666,8 @@
template <typename ParticleObject, typename MCCollisionObject>
void IdentifiedBfFilterTracks::fillParticleHistosBeforeSelection(ParticleObject const& particle, MCCollisionObject const& collision, float charge)
{
fhTruePhiYB->Fill(particle.phi(),particle.eta());
fhTruePtYB->Fill(particle.pt(),particle.eta());
fhTruePhiYB->Fill(particle.phi(), particle.eta());
fhTruePtYB->Fill(particle.pt(), particle.eta());
fhTruePB->Fill(particle.p());
fhTruePtB->Fill(particle.pt());
fhTrueEtaB->Fill(particle.eta());
Expand All @@ -1684,17 +1678,17 @@
fhTruePtNegB->Fill(particle.pt());
}

float dcaxy = TMath::Sqrt((particle.vx() - collision.posX()) * (particle.vx() - collision.posX()) +

Check warning on line 1681 in PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
(particle.vy() - collision.posY()) * (particle.vy() - collision.posY()));
if (traceDCAOutliers.mDoIt && (traceDCAOutliers.mLowValue < dcaxy) && (dcaxy < traceDCAOutliers.mUpValue)) {
fhTrueDCAxyBid->Fill(TString::Format("%d", particle.pdgCode()).Data(), 1.0);
}

fhTrueDCAxyB->Fill(TMath::Sqrt((particle.vx() - collision.posX()) * (particle.vx() - collision.posX()) +

Check warning on line 1687 in PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
(particle.vy() - collision.posY()) * (particle.vy() - collision.posY())));
fhTrueDCAxyzB->Fill(TMath::Sqrt((particle.vx() - collision.posX()) * (particle.vx() - collision.posX()) +

Check warning on line 1689 in PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
(particle.vy() - collision.posY()) * (particle.vy() - collision.posY())),
(particle.vz() - collision.posZ()));
(particle.vy() - collision.posY()) * (particle.vy() - collision.posY())),
(particle.vz() - collision.posZ()));
fhTrueDCAzB->Fill((particle.vz() - collision.posZ()));
}

Expand All @@ -1703,11 +1697,11 @@
{
/* the charged species should have been called first so avoid double counting */
if (sp == kIdBfCharged) {
fhTruePhiYA->Fill(particle.phi(),particle.eta());
fhTruePtYA->Fill(particle.pt(),particle.eta());
fhTruePhiYA->Fill(particle.phi(), particle.eta());
fhTruePtYA->Fill(particle.pt(), particle.eta());
fhTrueEtaA->Fill(particle.eta());
fhTruePhiA->Fill(particle.phi());
float dcaxy = TMath::Sqrt((particle.vx() - collision.posX()) * (particle.vx() - collision.posX()) +

Check warning on line 1704 in PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Consider replacing ROOT entities with equivalents from standard C++ or from O2.
(particle.vy() - collision.posY()) * (particle.vy() - collision.posY()));
if (traceDCAOutliers.mDoIt && (traceDCAOutliers.mLowValue < dcaxy) && (dcaxy < traceDCAOutliers.mUpValue)) {
LOGF(info, "DCAxy outlier: Particle with index %d and pdg code %d assigned to MC collision %d, pT: %f, phi: %f, eta: %f",
Expand All @@ -1719,8 +1713,8 @@
(particle.vy() - collision.posY()) * (particle.vy() - collision.posY())));
fhTrueDCAzA->Fill((particle.vz() - collision.posZ()));
fhTrueDCAxyzA->Fill(TMath::Sqrt((particle.vx() - collision.posX()) * (particle.vx() - collision.posX()) +
(particle.vy() - collision.posY()) * (particle.vy() - collision.posY())),
(particle.vz() - collision.posZ()));
(particle.vy() - collision.posY()) * (particle.vy() - collision.posY())),
(particle.vz() - collision.posZ()));
}
fhTruePA[sp]->Fill(particle.p());
fhTruePtA[sp]->Fill(particle.pt());
Expand All @@ -1729,7 +1723,6 @@
} else {
fhTruePtNegA[sp]->Fill(particle.pt());
}

}

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ enum SpeciesPairMatch {
kIdBfProtonProton ///< Proton-Proton
};

const char* speciesName[kIdBfNoOfSpecies+1] = {"e", "pi", "ka", "p","ha"};
const char* speciesName[kIdBfNoOfSpecies + 1] = {"e", "pi", "ka", "p", "ha"};

const char* speciesTitle[kIdBfNoOfSpecies+1] = {"e", "#pi", "K", "p","ha"};
const char* speciesTitle[kIdBfNoOfSpecies + 1] = {"e", "#pi", "K", "p", "ha"};

const int speciesChargeValue1[kIdBfNoOfSpecies] = {
0, //< electron
Expand Down Expand Up @@ -727,8 +727,6 @@ inline bool matchTrackType(TrackObject const& track, CollisionObject const& coll
}
}



/// \brief Accepts or not the passed track
/// \param track the track of interest
/// \return the internal track id, -1 if not accepted
Expand Down
Loading