Skip to content

o2-eve, o2-eve-export-workflow, o2-eve-convert: serialisation to root…#9497

Merged
shahor02 merged 6 commits into
AliceO2Group:devfrom
jmyrcha:dev2
Jul 27, 2022
Merged

o2-eve, o2-eve-export-workflow, o2-eve-convert: serialisation to root…#9497
shahor02 merged 6 commits into
AliceO2Group:devfrom
jmyrcha:dev2

Conversation

@jmyrcha
Copy link
Copy Markdown
Contributor

@jmyrcha jmyrcha commented Jul 21, 2022

… files, conversion tool

@jmyrcha
Copy link
Copy Markdown
Contributor Author

jmyrcha commented Jul 22, 2022

there is no trailing spaces in O2DPLDisplay.cxx

@jmyrcha
Copy link
Copy Markdown
Contributor Author

jmyrcha commented Jul 25, 2022

fullCI failed on irrelevant problems

Copy link
Copy Markdown
Collaborator

@shahor02 shahor02 left a comment

Choose a reason for hiding this comment

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

Hi,
Please see comments below. Also in plenty of places you are passing string by copy, please use const std::string& instead.
If you prefer, I can merge it as is now and you address questions later.


public:
FileWatcher(const std::string& path);
FileWatcher(const std::string& path, std::vector<std::string> ext);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why passing the vector by copy?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is executed once in a program lifetime (may be executed again on source switch, but seldom done) so I prefer code readibility over efficiency - passing by reference will require creating variable just over place where it is called. If you request I can refactor it in next PR (so please merge it as it is now with request to refactor)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not sure what you mean, now you are creating a copy to pass a vector, by passing the reference you create nothing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

And such variable will be visible in outer space - when it has no usage.
something like:
static std::vectorstd::string extensions = ...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

there is some misunderstanding: as it is now you are creating 2 clones of the vector: 1st one just to pass the vector, 2nd as a data member of the class.
To get rid of the 1st copy you just need to define your constructor as:

 FileWatcher(const std::string& path, const std::vector<std::string>& ext) : mExt(ext) ... {}

To get rid of the 2nd one: define your class as

class FileWatcher
{
....
 const std::vector<std::string>& mExt;
};

calo_energy = calorimeter.getEnergy();
calo_eta = calorimeter.getEta();
calo_phi = calorimeter.getPhi();
calo_GID = calorimeter.getGIDAsString();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what is the reason of using string for GID, which is a simple integer?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It was preserved from the previous version to keep interoperability with previous *.json files. I will address that in next (separate to that) PR when I will be able to test this change only. Please merge as it is and I will fix it soon.

Copy link
Copy Markdown
Collaborator

@shahor02 shahor02 left a comment

Choose a reason for hiding this comment

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

Merging but please get rid of excessive copies I mentioned.

Copy link
Copy Markdown
Collaborator

@shahor02 shahor02 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 actually conflicts, please rebase to dev and resubmit.

Copy link
Copy Markdown
Collaborator

@shahor02 shahor02 left a comment

Choose a reason for hiding this comment

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

Tests were passed, merging after rebase.

@shahor02 shahor02 merged commit aeb566d into AliceO2Group:dev Jul 27, 2022
@jmyrcha jmyrcha deleted the dev2 branch July 27, 2022 14:38
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