Skip to content

Femtoworld#1186

Merged
victor-gonzalez merged 12 commits intoAliceO2Group:masterfrom
zchochul:femtoworld
Sep 13, 2022
Merged

Femtoworld#1186
victor-gonzalez merged 12 commits intoAliceO2Group:masterfrom
zchochul:femtoworld

Conversation

@zchochul
Copy link
Collaborator

@zchochul zchochul commented Sep 2, 2022

  • Changed printfs and couts for LOGFs and LOGs
  • Fixing filling phi candidates table filling

@alibuild
Copy link
Collaborator

alibuild commented Sep 2, 2022

Error while checking build/O2Physics/o2 for fc72792 at 2022-09-02 10:14:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/1186-slc7_x86-64/0/PWGCF/FemtoWorld/TableProducer/femtoWorldProducerTask.cxx:385:12: error: variable 'cutContainer' set but not used [-Werror=unused-but-set-variable]
/sw/SOURCES/O2Physics/1186-slc7_x86-64/0/PWGCF/FemtoWorld/TableProducer/femtoWorldProducerTask.cxx:583:15: error: unused variable 'indexChildID' [-Werror=unused-variable]
/sw/SOURCES/O2Physics/1186-slc7_x86-64/0/PWGCF/FemtoWorld/TableProducer/femtoWorldProducerTask.cxx:375:9: error: variable 'childIDs' set but not used [-Werror=unused-but-set-variable]
ninja: build stopped: subcommand failed.

Full log here.

@alibuild
Copy link
Collaborator

alibuild commented Sep 2, 2022

Error while checking build/O2Physics/o2 for 5e282bb at 2022-09-04 17:23:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/1186-slc7_x86-64/0/PWGCF/FemtoWorld/TableProducer/femtoWorldProducerTask.cxx:385:12: error: variable 'cutContainer' set but not used [-Werror=unused-but-set-variable]
/sw/SOURCES/O2Physics/1186-slc7_x86-64/0/PWGCF/FemtoWorld/TableProducer/femtoWorldProducerTask.cxx:584:15: error: unused variable 'indexChildID' [-Werror=unused-variable]
ninja: build stopped: subcommand failed.

Full log here.

void printCuts()
{
std::cout << "Debug information for FemtoWorldCollisionSelection \n Max. z-vertex: " << mZvtxMax << "\n Check trigger: " << mCheckTrigger << "\n Trigger: " << mTrigger << "\n Check offline: " << mCheckOffline << "\n";
// std::cout << "Debug information for FemtoWorldCollisionSelection \n Max. z-vertex: " << mZvtxMax << "\n Check trigger: " << mCheckTrigger << "\n Trigger: " << mTrigger << "\n Check offline: " << mCheckOffline << "\n";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No comments left, please

Comment on lines 72 to 81
/*for (int i = 0; i < 2; i++) {
std::string dirName = static_cast<std::string>(dirNames[1]);
histdetadpi[i][0] = mHistogramRegistry->add<TH2>((dirName + static_cast<std::string>(histNames[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}});
histdetadpi[i][1] = mHistogramRegistry->add<TH2>((dirName + static_cast<std::string>(histNames[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}});
if (plotForEveryRadii) {
for (int j = 0; j < 9; j++) {
histdetadpiRadii[i][j] = mHistogramRegistryQA->add<TH2>((dirName + static_cast<std::string>(histNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}});
}
}
}*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove comments
You can test your code locally until you are happy with it and then push it but don't leave pending code commented

Comment on lines 132 to 151
/*
if (part1.partType() != o2::aod::femtoworldparticle::ParticleType::kTrack || part2.partType() != o2::aod::femtoworldparticle::ParticleType::kV0) {
LOG(fatal) << "FemtoWorldDetaDphiStar: passed arguments don't agree with FemtoWorldDetaDphiStar instantiation! Please provide kTrack,kV0 candidates.";
return false;
}

bool pass = false;
for (int i = 0; i < 2; i++) {
auto indexOfDaughter = part2.index() - 2 + i;
auto daughter = particles.begin() + indexOfDaughter;
auto deta = part1.eta() - daughter.eta();
auto dphiAvg = AveragePhiStar(part1, *daughter, i);
histdetadpi[i][0]->Fill(deta, dphiAvg);
if (pow(dphiAvg, 2) / pow(deltaPhiMax, 2) + pow(deta, 2) / pow(deltaEtaMax, 2) < 1.) {
pass = true;
} else {
histdetadpi[i][1]->Fill(deta, dphiAvg);
}
}
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above

printf("-Something wrong in isSelectedMinimal--\n");
printf("ERROR - Wrong sign for Phi daughters\n");
LOGF(info, "-Something wrong in isSelectedMinimal--\n");
LOGF(info, "ERROR - Wrong sign for Phi daughters\n");
Copy link
Collaborator

@victor-gonzalez victor-gonzalez Sep 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using

LOGF(error, "....);

and consider using a single line with all error information
Be aware that you can use formatting the same way you do it with printf

Comment on lines 460 to 461
LOGF(info, "-Something wrong in isSelectedMinimal--\n");
LOGF(info, "ERROR - Wrong sign for Phi daughters\n");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Comment on lines 614 to 616
// float phiPx = posTrack.px() + negTrack.px();
// float phiPy = posTrack.py() + negTrack.py();
// float phiPz = posTrack.pz() + negTrack.pz();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, don't leave code commented

Comment on lines 324 to 325
LOGF(info, "-Something wrong in isSelectedMinimal--\n");
LOGF(info, "ERROR - Wrong sign for V0 daughters\n");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above

Comment on lines 396 to 397
LOGF(info, "-Something wrong in isSelectedMinimal--\n");
LOGF(info, "ERROR - Wrong sign for V0 daughters\n");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments as above

Comment on lines 37 to 40
#o2physics_add_dpl_workflow(femto-world-pair-track-v0
# SOURCES femtoWorldPairTaskTrackV0.cxx
# PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
# COMPONENT_NAME Analysis)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No comments left

Copy link
Collaborator

@victor-gonzalez victor-gonzalez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, fix the formatting errors and implement the suggested changes

@alibuild
Copy link
Collaborator

alibuild commented Sep 5, 2022

Error while checking build/O2Physics/o2 for 5ca42fc at 2022-09-05 17:51:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/1186-slc7_x86-64/0/PWGCF/FemtoWorld/Tasks/femtoWorldPairTaskTrackPhi.cxx:130:17: error: unused variable 'magFieldTesla' [-Werror=unused-variable]
ninja: build stopped: subcommand failed.

Full log here.

@alibuild
Copy link
Collaborator

alibuild commented Sep 6, 2022

Error while checking build/O2Physics/o2 for 90a7419 at 2022-09-06 11:27:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/1186-slc7_x86-64/0/PWGCF/FemtoWorld/Tasks/femtoWorldPairTaskTrackPhi.cxx:130:17: error: unused variable 'magFieldTesla' [-Werror=unused-variable]
ninja: build stopped: subcommand failed.

Full log here.

@alibuild
Copy link
Collaborator

alibuild commented Sep 9, 2022

Error while checking build/O2Physics/o2 for 07582c1 at 2022-09-09 15:04:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/1186-slc7_x86-64/0/PWGCF/FemtoWorld/Tasks/femtoWorldPairTaskTrackPhi.cxx:130:17: error: unused variable 'magFieldTesla' [-Werror=unused-variable]
ninja: build stopped: subcommand failed.

Full log here.

Copy link
Collaborator

@victor-gonzalez victor-gonzalez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, get rid of all commented code
If you are requiring to merge you code it will go into production
If you are just keeping your changes in a central repository change your PR to draft

Comment on lines 102 to 106
// DECLARE_SOA_DYNAMIC_COLUMN(P, p, //! Compute the overall momentum in GeV/c
// [](float pt, float eta) -> float {
// return pt * std::cosh(eta);
// });
// debug variables
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, no commented code

femtoworldparticle::Py<femtoworldparticle::Pt, femtoworldparticle::Phi>,
femtoworldparticle::Pz<femtoworldparticle::Pt, femtoworldparticle::Eta>,
femtoworldparticle::P<femtoworldparticle::Pt, femtoworldparticle::Eta>, // tu koniec poprzedniej wersji
// femtoworldparticle::P<femtoworldparticle::Pt, femtoworldparticle::Eta>, // tu koniec poprzedniej wersji
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, no commented code

aod::pidTPCKa, aod::pidTPCPr, aod::pidTPCDe,
aod::pidTOFEl, aod::pidTOFMu, aod::pidTOFPi,
aod::pidTOFKa, aod::pidTOFPr, aod::pidTOFDe, aod::pidTOFbeta>;
// using FilteredFullV0s = soa::Filtered<aod::V0Datas>; /// predefined Join table for o2::aod::V0s = soa::Join<o2::aod::TransientV0s, o2::aod::StoredV0s> to be used when we add v0Filter
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, no commented code

trackCuts.fillQA<aod::femtoworldparticle::ParticleType::kTrack, aod::femtoworldparticle::TrackType::kNoChild>(track);
// the bit-wise container of the systematic variations is obtained
auto cutContainer = trackCuts.getCutContainer<aod::femtoworldparticle::cutContainerType>(track);
// auto cutContainer = trackCuts.getCutContainer<aod::femtoworldparticle::cutContainerType>(track);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, no commented code

}
}
PROCESS_SWITCH(femtoWorldProducerTask, processPhi, "Produce Phi candidates tables", true);
*/}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Comment on lines 153 to 160
/*
if (p1.p() > cfgCutTable->get("PartOne", "MaxP") || p1.pt() > cfgCutTable->get("PartOne", "MaxPt")) {
continue;
}

if (!isFullPIDSelected(p1.pidcut(), p1.p(), cfgCutTable->get("PartOne", "PIDthr"), vPIDPartOne, cfgNspecies, kNsigma, cfgCutTable->get("PartOne", "nSigmaTPC"), cfgCutTable->get("PartOne", "nSigmaTPCTOF"))) {
continue;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was commented only temporarily. In next PR I will be adding cuts to the histograms

Copy link
Collaborator

@victor-gonzalez victor-gonzalez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still see files with code commented
This is not a good practice for going into production
Commenting code for making it readable is OK. Leaving code commented is not, it makes difficult its interpretation
For the time being I approve the PR to move it forward. But please, spend some time in removing all commented lines of code

@victor-gonzalez victor-gonzalez merged commit 8b99c96 into AliceO2Group:master Sep 13, 2022
@zchochul
Copy link
Collaborator Author

I'll try to avoid leaving commented code. Thank you for understanding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants