Implement setter function to check MC signal from mother to daughter#945
Conversation
8ed7b5d to
7f828ff
Compare
|
Error while checking build/O2Physics/o2 for 7f828ff at 2022-07-04 11:44: Full log here. |
|
Error while checking build/O2Physics/o2 for a31fd4f at 2022-07-04 14:14: Full log here. |
| void SetSources(int generation, uint64_t bits, uint64_t exclude = 0, bool useANDonSourceBits = true); | ||
| void SetSourceBit(int generation, int sourceBit, bool exclude = false); | ||
| void SetUseANDonSourceBits(int generation, bool option = true); | ||
| void SetSignalInTime(int generation, bool intime = false); // set variable to check generations in time or back in time (default) |
There was a problem hiding this comment.
This function does not need the first parameter (generation), since the rule to go back in time or in time, holds for the entire prong. So please remove it, only the "intime" parameter is used
| } | ||
|
|
||
| //________________________________________________________________________________________________________________ | ||
| void MCProng::SetSignalInTime(int generation, bool intime /*=false*/) |
There was a problem hiding this comment.
The "generation" parameter is not needed since the "intime" holds for the whole prong history
| if (generation < 0 || generation >= fNGenerations) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
these lines can be removed
| // currentMCParticle = currentMCParticle.template mother0_as<U>(); | ||
| } | ||
| } else { | ||
| // make sure that a daughter exists in the stack before moving one generation younger |
There was a problem hiding this comment.
Please add a comment here, mentioning that the prong history will move on the branch of the first daughter that matches the PDG requirement
| if (abs(d.pdgCode()) == fProngs[i].fPDGcodes[j + 1]) { | ||
| currentMCParticle = d; | ||
| break; |
There was a problem hiding this comment.
Here you check the absolute of the PDG code, however, the user has the option to choose between checking both charges (using the abs of the PDG code), or not. So the latter situation is overwritten here. Could you fix it? Ideally one should use here the MCProng::TestPDG() since that will take into account automatically these options.
| if (abs(d.pdgCode()) == fProngs[i].fPDGcodes[j + 1]) { | ||
| currentMCParticle = d; | ||
| break; |
|
@iarsene
In case there is something else that I should change please let me know. |
| if (currentMCParticle.has_daughters() && j < fProngs[i].fNGenerations - 1) { | ||
| // currentMCParticle = currentMCParticle.template mothers_first_as<U>(); | ||
| // currentMCParticle = mcStack.iteratorAt(currentMCParticle.mothersIds()[0]); | ||
| } |
There was a problem hiding this comment.
This if statement doesn't do anything, should be removed
|
Hi @feisenhu, |
You are right. Thank you for pointing out. :) |
Implemented a setter function in the MCprong files to give the option, when defining a MCsignal in the MCSignalLibrary.h to check the MC signal from the mother to the daughter (In time).
Therefore the MC signal needs the mother pdg code as first entry and its daughter as second:
e.g.
The CheckProng function in MCSignal.h then checks the boolean
fCheckGenerationsInTimewhether we have to check in the next generation for a mother or daughters.If we look for daughters, we check if there is one, and if so if it has a pdg code of the next generation.
If it is true it uses the first daughter that fulfils that requirement and sets it as current particle to check for further generations.
(Note: There is no option currently to check multiple daughters in the same generation that would fulfil the MC signal.)