GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » EMC » [FIXED] About negative track id -2
[FIXED] About negative track id -2 [message #15816] Mon, 27 January 2014 19:44 Go to previous message
Jifeng Hu is currently offline  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

 
Read Message
Read Message
Previous Topic: Recent updates about EMC packages (B)
Next Topic: EMC resolution
Goto Forum:
  


Current Time: Sun Nov 10 01:12:52 CET 2024

Total time taken to generate the page: 0.00853 seconds