-
Notifications
You must be signed in to change notification settings - Fork 536
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
[PWGCF] Net charge #9525
Conversation
Any reason for not incorporating (merging) the suggested formatting changes? |
Please, rebase your changes to the latest version of |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this 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
There was a problem hiding this 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
Dear @nidamalikk and @victor-gonzalez, this commit removed my workflow from the |
@SwatiSaha-1997 this is usually taken care by the own gitHub machinery So I guess something happened with gitHub which considered resolved a conflict which was not and that ended up in a 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 |
This code generates the QA plots for net charge fluctuation study by using an observable nu_dyn.