Commit 2b32df7e authored by Dominik Smith's avatar Dominik Smith Committed by Florian Uhlig
Browse files

CbmTrdHitProducerQa: Particle ID now properly obtained from MC tracks.

parent 9c1fd888
......@@ -176,7 +176,13 @@ void CbmTrdHitProducerQa::Exec(Option_t*)
cout << GetName() << ": Warning, TRD plane out of bounds, skipping hit." << endl;
const int partID = (dynamic_cast<CbmMCTrack*>(fMCTrackArray->Get(trdDigiMatch->GetMatchedLink())))->GetPdgCode();
//get particle ID of track corresponding to point
const int fileId = trdDigiMatch->GetMatchedLink().GetFile();
const int event = trdDigiMatch->GetMatchedLink().GetEntry();
const int index = trdPoint->GetTrackID();
const CbmMCTrack* track = dynamic_cast<CbmMCTrack*>(fMCTrackArray->Get(fileId, event, index));
const int partID = track->GetPdgCode();
const float momentum = TMath::Sqrt((trdPoint->GetPx() * trdPoint->GetPx()) + (trdPoint->GetPy() * trdPoint->GetPy())
+ (trdPoint->GetPz() * trdPoint->GetPz()));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment