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

DDG4Dict.h question #807

Closed
saraheno opened this issue Apr 14, 2021 · 1 comment
Closed

DDG4Dict.h question #807

saraheno opened this issue Apr 14, 2021 · 1 comment

Comments

@saraheno
Copy link

Hi,
I notice that in DDG4/include/DDG4/DDG4Dict.h
Geant4:Tracker::Hit has several methods
1 default constructor
2 initializing constructor
3 default destructor
4 assignment operator
5 clear hit content
6 store geant4 point and step

while Geant4Calorimeter only has default constructor, initializing constructor, and destructor.

I guess if I need any of these other methods, I can just put them into my own sensitive hit structure, But souldn't at least the assignment operator be useful for a generic Geant$Calorimeter::Hit? Or this is probably okay without it?

@MarkusFrankATcernch
Copy link
Contributor

In general the assignment operator should be present at the moment a copy constructor exists -- or both should be disabled.

Though, in DDG4 the hits are associated by reference (aka pointer) and neither the copy constructor
not the assignment is ever used (except the tracker copy, which is not a true copy either; see below).
On the contrary, copies and assignments in most cases would be harmful for MC truth tracking etc.
It just is not possible to copy these objects and properly track MC truth at the same time.
I think I will rather disable all copies ans moves in these classes.

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

No branches or pull requests

2 participants