[FIXED] About negative track id -2 [message #15816] |
Mon, 27 January 2014 19:44 |
Jifeng Hu
Messages: 31 Registered: October 2012
|
continuous participant |
From: *physik.uni-giessen.de
|
|
In simulation, we found negative values -2 of PndEmcPoint->GetTrackID(). Now I trace to PndStack class,
void PndStack::FillTrackArray() {
...
for (Int_t iPart=0; iPart<fNParticles; iPart++) {
fStoreIter = fStoreMap.find(iPart);
...
Bool_t store = (*fStoreIter).second;
if (store) {
...
}else{
fIndexMap[iPart] = -2; 【here】
}
}
// --> Map index for primary mothers
fIndexMap[-1] = -1;
Print(0);
}
Here, first check a particle if it's to be stored. If not,the index map of fIndexMap are assigned to iPart with -2. iPart is the ith TMcParticle.
later, inside the function,
void PndStack::UpdateTrackIndex(TRefArray* detList) {
...
FairDetector* det = NULL;
while ((det = (FairDetector*) detIter->Next())) {
// --> Get hit collections from detector
Int_t iColl = 0;
TClonesArray* hitArray;
while ((hitArray = det->GetCollection(iColl++))) {
nColl++;
Int_t nPoints = hitArray->GetEntriesFast();
// --> Update track index for all MCPoints in the collection
for (Int_t iPoint = 0; iPoint < nPoints; iPoint++) {
FairMCPoint* point = (FairMCPoint*) hitArray->At(iPoint);
Int_t iTrack = point->GetTrackID();
fIndexIter = fIndexMap.find(iTrack);
if (fIndexIter == fIndexMap.end()) {
gLogger->Error(MESSAGE_ORIGIN,
"PndStack: Particle index %i not found in index map! ",
iTrack);
Fatal("PndStack::UpdateTrackIndex",
"Particle index not found in map");
}
//std::cout << "point->SetTrackID() " << (*fIndexIter).second << std::endl;
point->SetTrackID((*fIndexIter).second); 【here】
// std::cout << "Header->GetEventID() " << header->GetEventID() << std::endl;
point->SetLink(FairLink(-1, (header->GetEventID()-1), "MCTrack", (*fIndexIter).second));
}
} // Collections of this detector
} // List of active detectors
....
}
The new track id was translated with the map of fIndexMap, and -2 was passed.
Anyone could tell me why we make this translation, and why save to fIndexMap for tracks we dont store?
[Updated on: Wed, 12 February 2014 16:11] by Moderator Report message to a moderator
|
|
|