Repository navigation
Conversation
|
REQUEST FOR PRODUCTION RELEASES: This will add The following labels are available |
sawenzel
left a comment
There was a problem hiding this comment.
please consider general comments and in-line comments
| for (Long64_t oldParticleId = 0; oldParticleId < numberOfParticles; ++oldParticleId) { | ||
| inputTree->GetEntry(oldParticleId); | ||
| particleMcCollisionId[oldParticleId] = mcCollisionId; | ||
| const int safeMothersSize = std::min(mothersSize, kMaxMothers); |
There was a problem hiding this comment.
This check comes after GetEntry, which has already written mothersSize entries into the fixed mothers[kMaxMothers] buffer. The PDG macro checks GetMaximum("fIndexArray_Mothers_size") before the loop; could you do the same here?
| Long64_t newlyInvalidatedReferences = 0; | ||
| for (Long64_t row = 0; row < numberOfRows; ++row) { | ||
| inputTree->GetEntry(row); | ||
| if (idsSize > kMaxCaloLabels) { |
There was a problem hiding this comment.
Same as above for the calo labels: the overflow has already happened when this triggers. The PDG macro's GetMaximum pre-check would fix it.
| // A daughter slice represents a contiguous interval | ||
| // [firstDaughter, lastDaughter]. Preserve the surviving daughters if their | ||
| // remapped indices remain contiguous. | ||
| bool survivingDaughterSliceIsContiguous = true; |
There was a problem hiding this comment.
Since oldToNew preserves order, the survivors of a contiguous old range are always contiguous, so this check never fails. Only slices with no survivors get cleared. That is fine, but the counter "incomplete daughter slices cleared" really counts empty slices, while incomplete ones are kept (see the general comment on truncation).
| }; | ||
| int getSubGeneratorIdFromGeneratorsID(Short_t generatorsID) { | ||
| const auto encoded = static_cast<UShort_t>(generatorsID); | ||
| const int encodedSubGeneratorId = static_cast<int>((encoded >> 11) & 0x1Fu); |
There was a problem hiding this comment.
Could this use o2::mcgenid::getSubGeneratorId() from SimulationDataFormat/MCGenProperties.h instead of repeating the bit layout?
| delete object; | ||
| continue; | ||
| } | ||
| if (!object->InheritsFrom(TDirectory::Class())) { |
There was a problem hiding this comment.
parentFiles in merged AO2Ds is a TMap as well, and it needs kSingleKey like metaData; otherwise each entry ends up as its own key.
| if (!object->InheritsFrom(TDirectory::Class())) { | |
| if (key->GetName() == std::string("parentFiles")) { | |
| outputFile->cd(); | |
| object->Write("parentFiles", TObject::kSingleKey | TObject::kOverwrite); | |
| delete object; | |
| continue; | |
| } | |
| if (!object->InheritsFrom(TDirectory::Class())) { |
| TIter next(inDir->GetListOfKeys()); | ||
| TKey* key = nullptr; | ||
|
|
||
| while ((key = static_cast<TKey*>(next()))) { |
There was a problem hiding this comment.
Here and in the top-level loop at L1164: the gap macro skips older key cycles (key->GetCycle() != dir->GetKey(name)->GetCycle()); this one doesn't, and with kOverwrite the older cycle, being read last, wins.
|
|
||
| const std::string name = obj->GetName(); | ||
|
|
||
| if (!obj->InheritsFrom(TDirectory::Class())) { |
There was a problem hiding this comment.
Same parentFiles / kSingleKey point as in the gap macro.
|
|
||
| const Long64_t inputBytes = inFile->GetSize(); | ||
|
|
||
| auto* outFile = TFile::Open(output, "RECREATE"); |
There was a problem hiding this comment.
Same compression point as in the gap macro:
| auto* outFile = TFile::Open(output, "RECREATE"); | |
| auto* outFile = TFile::Open(output, "RECREATE", "", 505); |
| void filterAO2DMCParticlesPdg( | ||
| const char* input = "AO2D.root", | ||
| const char* output = "AO2D_filter.root", | ||
| const std::vector<int>& pdgs = {211, 2212}, |
There was a problem hiding this comment.
Is {211, 2212} intended as a default? It keeps almost everything; maybe no default, or the Λ example from the usage line.
| int firstNewDaughter = -1; | ||
| int lastNewDaughter = -1; | ||
| int previousNewDaughter = -1; | ||
| bool validSlice = true; |
There was a problem hiding this comment.
Same as in the gap macro: with an order-preserving map this can't become false.
No description provided.