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] Net charge #9525

Merged
merged 18 commits into from
Jan 30, 2025
Merged

[PWGCF] Net charge #9525

merged 18 commits into from
Jan 30, 2025

Conversation

nidamalikk
Copy link
Contributor

This code generates the QA plots for net charge fluctuation study by using an observable nu_dyn.

@victor-gonzalez
Copy link
Collaborator

Any reason for not incorporating (merging) the suggested formatting changes?
If clang-format CI test is not completed other CI tests, as linter for instance, cannot start and you will probably get suggestions also from linter

@victor-gonzalez
Copy link
Collaborator

Please, rebase your changes to the latest version of O2Physics
That is the reason for the This branch has conflicts that must be resolved message

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, check my suggestions
Remember that your PR is conflicting with the latest version of O2Physics
You have to rebase your changes to that latest version

using namespace o2::framework::expressions;
using namespace std;

namespace o2::aod
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 use this name space. Use your own if so you want

{
histos.fill(HIST("hVertexZ_bef"), coll.posZ());

if (fabs(coll.posZ()) > 10.f) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Precede it with std::, i.e. std::fabs

histos.fill(HIST("hCentrality"), coll.centRun2V0M());
histos.fill(HIST("hMultiplicity"), coll.multFV0M());

for (auto track : inputTracks) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use a const reference qualifier, if not your full track is copied here which is not efficient

histos.fill(HIST("hMultiplicity"), coll.multFV0M());

for (auto track : inputTracks) {
if (fabs(track.eta()) > 0.8)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Incorporate std::

@@ -43,3 +43,8 @@ o2physics_add_dpl_workflow(factorial-moments
SOURCES FactorialMomentsTask.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(netchargefluct
Copy link
Collaborator

Choose a reason for hiding this comment

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

You will need to use netcharge-fluctuations according to the name of your source file and you will need to change the name of this one to netchargeFluctuations.cxx

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, consider my suggestions, remove the old file and rebase your changes to the latest version
As it is now you PR will not merge because it has conflicts with the current (latest) version of O2Physics

using MyTrack = MyTracks::iterator;
} // namespace o2::aod

struct netchargeFluctuations {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You have to keep the first letter as capital, NetchargeFluctuations

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay. My file name is netchargeFluctuations.cxx. Would you like me to change its first letter also?

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, just the struct name. If you don't do it now you will be requested to do it latter by the linter
You already changed the file name to netchargeFluctuations.cxx which is correct according to the name you selected for your workflow in the CMakeLists.txt file

histos.fill(HIST("hCentrality"), coll.centRun2V0M());
histos.fill(HIST("hMultiplicity"), coll.multFV0M());

for (const auto track : inputTracks) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You still need to fully qualify it as constant reference, if not the full track is copied here which is quite inefficient

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the first time I created a pull request. Please tell me what change I should make to fully qualify it as constant reference.

Copy link
Collaborator

Choose a reason for hiding this comment

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

You have to use for (auto const& track : inputTracks)
The type is indicated by the auto, which will be resolved by the compiler. The reference to that type is indicated by the &. And the fact that what the reference refers cannot be changed, a compiler error will happen if it is, is indicated by the const preceding the reference indication

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for helping me out.

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.

There are still two things you need to do

  • remove the old NetchargeFluctuations.cxx file
  • rebase your changes to the latest version of O2Physics. The latest version of O2Physics has not been used for implementing these changes and that's why the message This branch has conflicts that must be resolved is shown

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.

The linter recommendations that you can see in the CMakeLists.txt file are not yours, they are from other analyzers and they will take care of them in a timely manner

But, please, follow the linter recommendations on your source file, netchargeFluctuations.cxx, in the next iteration

@victor-gonzalez victor-gonzalez merged commit e5084c7 into AliceO2Group:master Jan 30, 2025
12 of 14 checks passed
@SwatiSaha-1997
Copy link
Contributor

SwatiSaha-1997 commented Jan 31, 2025

Dear @nidamalikk and @victor-gonzalez, this commit removed my workflow from the CMakeLists and now I am not able to run my code. Please be careful while you modify the CmakeLists.txt @nidamalikk .

@victor-gonzalez
Copy link
Collaborator

Dear @nidamalikk and @victor-gonzalez, this commit removed my workflow from the CMakeLists and now I am not able to run my code. Please be careful while you modify the CmakeLists.txt @nidamalikk .

@SwatiSaha-1997 this is usually taken care by the own gitHub machinery
gitHub was complaining about conflict with a previous commit
I did not approve it until the conflict was resolved by @nidamalikk according to gitHub
At that moment, when gitHub validated it, I approved it and merged it

So I guess something happened with gitHub which considered resolved a conflict which was not and that ended up in a CMakeLists.txt which excluded your workflow

We always enforce to rebase the changes to the latest version of O2Physics but when commits come closer to each other, even gitHub gets confused

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

Successfully merging this pull request may close these issues.

3 participants