#include "AliMCEvent.h"
#include "AliMCEventHandler.h"
#include "AliMCParticle.h"
+#include "AliStack.h"
#include "AliPIDResponse.h"
#include "AliTrackReference.h"
#include "AliVEvent.h"
fSignalCuts->SetMCEvent(fMCEvent);
}
+ // MC get stack
+ AliStack* stack = 0x0;
+ if(mcthere){
+ stack = fMCEvent->Stack();
+ if(!stack) AliError("No Stack");
+ }
+
// Get Primary Vertex
const AliVVertex *vertex = fInputEvent->GetPrimaryVertex();
Double_t vtx[3];
<< "Centrality=" << centrality
<< "VertexZ=" << vtx[2]
<< "NumberOfContributors=" << ncontrib
+ << "run=" << run
<< "\n";
// Common variables
Double_t chi2PerClusterITS = 0.0;
if (nclustersITS != 0) chi2PerClusterITS = track->GetITSchi2() / Float_t(nclustersITS);
// TPC number of clusters (different definitions)
- UChar_t nclustersTPC = track->GetTPCncls();
+ UChar_t nclustersTPCfit = track->GetTPCNcls();
+ UChar_t nclustersTPCall = 0;
+ const TBits &clusterTPC = track->GetTPCClusterMap();
+ nclustersTPCall = clusterTPC.CountBits();
UChar_t nclustersTPCPID = track->GetTPCsignalN();
UChar_t nfindableTPC = track->GetTPCNclsF();
- Double_t clusterRatioTPC = 0.0;
- if((static_cast<Double_t>(nfindableTPC))>0.0) clusterRatioTPC = static_cast<Double_t>(nclustersTPC)/static_cast<Double_t>(nfindableTPC);
+ Double_t clusterRatioTPCfit = 0.0;
+ if((static_cast<Double_t>(nfindableTPC))>0.0) clusterRatioTPCfit = static_cast<Double_t>(nclustersTPCfit)/static_cast<Double_t>(nfindableTPC);
+ Double_t clusterRatioTPCall = 0.0;
+ if((static_cast<Double_t>(nfindableTPC))>0.0) clusterRatioTPCall = static_cast<Double_t>(nclustersTPCall)/static_cast<Double_t>(nfindableTPC);
UChar_t nclustersTPCshared = 0;
Float_t ncrossedRowsTPC = track->GetTPCCrossedRows();
const TBits &sharedTPC = track->GetTPCSharedMap();
UChar_t nclustersTRD = track->GetTRDncls();
UChar_t ntrackletsTRDPID = track->GetTRDntrackletsPID();
// ITS and TRD acceptance maps
- UChar_t hasClusterITS[6], statusITS[5], hasTrackletTRD[6];
+ UChar_t hasClusterITS[6], statusITS[6], hasTrackletTRD[6];
UChar_t itsPixel = track->GetITSClusterMap();
for(Int_t icl = 0; icl < 6; icl++){
hasClusterITS[icl] = TESTBIT(itsPixel, icl) ? 1 : 0;
tofdx=track->GetTOFsignalDx();
tofdz=track->GetTOFsignalDz();
+ // TOF track status
+ UInt_t status = 0;
+ status = track->GetStatus();
+ Bool_t hasTOFout = status&AliESDtrack::kTOFout;
+ Bool_t hasTOFtime = status&AliESDtrack::kTIME;
+ Bool_t hasTOFpid = status&AliESDtrack::kTOFpid;
+ Bool_t hasgoodTOF = kFALSE;
+ if (hasTOFout && hasTOFtime && hasTOFpid) hasgoodTOF = kTRUE;
+
+ // TRD track status
+ Bool_t hasTRDin = status&AliESDtrack::kTRDin;
+
+
+ // TOF mismatch (particle spectra group)
+ Int_t mismatchlevel=0; // default value; in data always 0
+ if(mcthere){
+ Int_t tofLabel[3];
+ track->GetTOFLabel(tofLabel);
+ if(TMath::Abs(track->GetLabel()) != TMath::Abs(tofLabel[0]) || tofLabel[1] > 0) mismatchlevel=1;
+ TParticle *matchedTrack = stack->Particle(TMath::Abs(tofLabel[0]));
+ if(TMath::Abs(matchedTrack->GetFirstMother()) == TMath::Abs(track->GetLabel()))
+ {
+ if(mismatchlevel==1) mismatchlevel=3;
+ else mismatchlevel=2;
+ }
+ }
+
+
// Fill Tree
(*fDebugTree) << "PIDdebug"
<< "centrality=" << centrality
<< "eta=" << eta
<< "phi=" << phi
<< "ntracklets=" << ntrackletsTRDPID
- << "nclustersTPC=" << nclustersTPC
+ << "nclustersTPC=" << nclustersTPCfit
+ << "nclustersTPCall=" << nclustersTPCall
<< "nclustersTPCPID=" << nclustersTPCPID
<< "nclustersTPCshared=" << nclustersTPCshared
<< "ncrossedRowsTPC=" << ncrossedRowsTPC
- << "clusterRatioTPC=" << clusterRatioTPC
+ << "clusterRatioTPC=" << clusterRatioTPCfit
+ << "clusterRatioTPCall=" << clusterRatioTPCall
<< "nclustersITS=" << nclustersITS
<< "nclusters=" << nclustersTRD
<< "chi2matching=" << chi2matching
<< "vy=" << vtx[1]
<< "vz=" << vtx[2]
<< "tofdx=" << tofdx
- << "tofdz=" << tofdz
+ << "tofdz=" << tofdz
+ << "statusTOFtracking=" << hasgoodTOF
+ << "TOFmismatchlevel=" << mismatchlevel
+ << "statusTRDtracking=" << hasTRDin
<< "ncontrib=" << ncontrib
<< "mesonID=" << mesonID
<< "eR=" << eR