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

small changes necessary for https://github.com/rest-for-physics/geant4lib/pull/41 #10

Merged
merged 4 commits into from
Apr 5, 2022

Conversation

lobis
Copy link
Member

@lobis lobis commented Apr 1, 2022

lobis 15

using new interfaces.

For more info: rest-for-physics/geant4lib#41

src/TRestGeant4ToDetectorHitsProcess.cxx Outdated Show resolved Hide resolved
src/TRestGeant4ToDetectorHitsProcess.cxx Outdated Show resolved Hide resolved
@lobis
Copy link
Member Author

lobis commented Apr 1, 2022

Not that terrible that this-> is there so that it is clear that is a method from the class, and not from a namespace.

True, but I guess this could be said for any class method.

src/TRestGeant4ToDetectorHitsProcess.cxx Outdated Show resolved Hide resolved
z = fG4Event->GetTrack(i)->GetHits()->fZ[j];
E = fG4Event->GetTrack(i)->GetHits()->fEnergy[j];

Bool_t addHit = true;
Copy link
Member

@juanangp juanangp Apr 1, 2022

Choose a reason for hiding this comment

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

Indeed, we change the behaviour, by default addHit = true unless the number of volume hits is higher than zero

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, we change the behaviour, by default addHit = true unless the number of volume hits is higher than zero

I am not sure if this refers to the current code (77c74c1), I think the behaviour right now is the same, right?

Copy link
Member

@juanangp juanangp Apr 4, 2022

Choose a reason for hiding this comment

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

No, it is not the same, before we had addHit = true if fVolumeId.size() == 0 now we just check hits.GetVolumeId(j) == volumeID). So, in case fVolumeId.size() == 0 (which I would suggest fVolumeId.empty()) we assume addHit = false. Therefore, the logic has been changed.

Bug was indroduced in 4a29a1b

Copy link
Member

@jgalan jgalan Apr 4, 2022

Choose a reason for hiding this comment

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

Right, however if fVolumeId.size() == 0, then we would have no hits inside the event. In normal conditions, the loop will always go inside, setting addHit=false. Because, if there are hits it means that there was at least one activeVolume and fVolumeId should contain at least 1 volume id.

Except that fVolumeId behaviour would have been changed in restG4.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think 53d73ec restores previous logic, perhaps now pipeline passes 🤞🏻

@lobis lobis merged commit e8de6f5 into master Apr 5, 2022
@lobis lobis deleted the lobis-add-const-to-getters branch April 5, 2022 11:26
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

Successfully merging this pull request may close these issues.

3 participants