// attached to charge slices and track length are dummy
Float_t dedx[3];
dedx[0] = dedx[1] = q*3.; dedx[2] = 0.;
- Float_t length = 3.7;
+ //Float_t length = 3.7;
//probEle *= pd->GetProbability(0, TMath::Abs(fPt), dedx, length, 0);
//probPio *= pd->GetProbability(2, TMath::Abs(fPt), dedx, length, 0);
}
// Calculate the input for the NN if fPIDmethod is kNN
- Float_t ldEdxNN[AliTRDCalPID::kNPlane * kNMLPslice], *dedx = 0x0;
+ Float_t ldEdxNN[AliTRDgeometry::kNlayer * kNMLPslice], *dedx = 0x0;
if(fPIDmethod == kNN) {
CookdEdxNN(&ldEdxNN[0]);
}
#include <TROOT.h>
#include "AliLog.h"
-#include "AliPID.h"
#include "AliESD.h"
#include "AliESDtrack.h"
Char_t* AliTRDCalPID::fPartName[AliPID::kSPECIES] = { "electron", "muon", "pion", "kaon", "proton"};
Char_t* AliTRDCalPID::fPartSymb[AliPID::kSPECIES] = { "EL", "MU", "PI", "KA", "PR"};
-Float_t AliTRDCalPID::fTrackMomentum[kNMom] = { 0.6, 0.8, 1.0, 1.5, 2.0
- , 3.0, 4.0, 5.0, 6.0, 8.0
- , 10.0};
+Color_t AliTRDCalPID::fPartColor[AliPID::kSPECIES] = { kRed, kGreen, kBlue, kYellow, kMagenta};
+Float_t AliTRDCalPID::fTrackMomentum[kNMom] = {
+ 0.6, 0.8, 1.0, 1.5, 2.0
+ ,3.0, 4.0, 5.0, 6.0, 8.0, 10.0};
//_________________________________________________________________________
AliTRDCalPID::AliTRDCalPID()
}
}
+
+//_________________________________________________________________________
+Int_t AliTRDCalPID::GetPartIndex(Int_t pdg)
+{
+ for(Int_t is=0; is<AliPID::kSPECIES; is++){
+ if(TMath::Abs(pdg) == AliPID::ParticleCode(is)) return is;
+ }
+ return -1;
+}
#include <TNamed.h>
#endif
+#ifndef ALIPID_H
+#include "AliPID.h"
+#endif
+
class AliTRDCalPID : public TNamed
{
public:
enum {
- kNMom = 11,
- kNPlane = 6
+ kNMom = 11
};
AliTRDCalPID();
virtual ~AliTRDCalPID();
virtual Bool_t LoadReferences(Char_t *refFile) = 0;
- static Double_t GetMomentum(Int_t ip)
- { return (ip<0 || ip>=kNMom)
- ? -1.0
- : fTrackMomentum[ip];
- }
+ static Double_t GetMomentum(Int_t ip) {
+ return (ip<0 || ip>=kNMom) ? -1.0 : fTrackMomentum[ip]; }
virtual TObject *GetModel(Int_t ip, Int_t iType, Int_t iPlane) const = 0;
virtual Double_t GetProbability(Int_t spec, Float_t mom, Float_t *dedx
, Float_t length, Int_t plane) const = 0;
+ static Color_t GetPartColor(Int_t i) { return fPartColor[i]; }
+ static Int_t GetPartIndex(Int_t pdg);
static Char_t *GetPartName(Int_t i) { return fPartName[i]; }
static Char_t *GetPartSymb(Int_t i) { return fPartSymb[i]; }
protected:
- static Char_t *fPartName[5]; //! Names of particle species
- static Char_t *fPartSymb[5]; //! Symbols of particle species
-
+ static Char_t *fPartName[AliPID::kSPECIES]; //! Names of particle species
+ static Char_t *fPartSymb[AliPID::kSPECIES]; //! Symbols of particle species
+ static Color_t fPartColor[AliPID::kSPECIES]; //! Colors of particle species
static Float_t fTrackMomentum[kNMom]; // Track momenta for which response functions are available
TObjArray *fModel; // Model for probability estimate
#include "AliESDtrack.h"
#include "AliTRDtrack.h"
+#include "AliTRDgeometry.h"
#include "AliTRDCalPIDNN.h"
#include "AliTRDcalibDB.h"
// Read Networks
for (Int_t imom = 0; imom < kNMom; imom++) {
- for (Int_t iplane = 0; iplane < kNPlane; iplane++) {
+ for (Int_t iplane = 0; iplane < AliTRDgeometry::kNlayer; iplane++) {
TMultiLayerPerceptron *nn = (TMultiLayerPerceptron *)
nnFile->Get(Form("NN_Mom%d_Plane%d",imom,iplane));
fModel->AddAt(nn,GetModelID(imom,0,iplane));
// Initialization
//
- fModel = new TObjArray(AliTRDCalPID::kNPlane * AliTRDCalPID::kNMom);
+ fModel = new TObjArray(AliTRDgeometry::kNlayer * AliTRDCalPID::kNMom);
fModel->SetOwner();
}
AliTrackReference *ref = 0x0;
AliExternalTrackParam *esd = 0x0;
- AliTRDseedV1 *TRDtracklet[AliTRDCalPID::kNPlane];
- for(Int_t iChamb = 0; iChamb < AliTRDCalPID::kNPlane; iChamb++)
+ AliTRDseedV1 *TRDtracklet[AliTRDgeometry::kNlayer];
+ for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++)
TRDtracklet[iChamb] = 0x0;
AliTRDcluster *TRDcluster = 0x0;
//&&(track->GetNumberOfClustersRefit()
// use only tracks that hit 6 chambers
- if(!(TRDtrack->GetNumberOfTracklets() == AliTRDCalPID::kNPlane)) continue;
+ if(!(TRDtrack->GetNumberOfTracklets() == AliTRDgeometry::kNlayer)) continue;
ref = track->GetTrackRef(0);
esd = track->GetOuterParam();
if(fDebugLevel>=4) Printf("PIDmethod[%d] Slices[%d] PDG[%d] LQLike[%f]", fReconstructor->GetPIDMethod(), fReconstructor->GetNdEdxSlices(), track->GetPDG(), TRDtrack -> GetPID(0));
- Float_t SumdEdx[AliTRDCalPID::kNPlane];
- for(Int_t iChamb = 0; iChamb < AliTRDCalPID::kNPlane; iChamb++){
+ Float_t SumdEdx[AliTRDgeometry::kNlayer];
+ for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){
TRDtracklet[iChamb] = TRDtrack -> GetTracklet(iChamb);
SumdEdx[iChamb] = 0.;
fdEdx = TRDtracklet[iChamb] -> GetdEdx();
case kElectron:
case kPositron:
hPIDLQ[AliPID::kElectron][iMomBin] -> Fill(TRDtrack -> GetPID(0));
- for(Int_t iChamb = 0; iChamb < AliTRDCalPID::kNPlane; iChamb++){
+ for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){
hdEdx[AliPID::kElectron][iMomBin] -> Fill(SumdEdx[iChamb]);
- for(Int_t iClus = 0; iClus < AliTRDtrackerV1::GetNTimeBins(); iClus++){
- if(!(TRDcluster = (AliTRDcluster*)TRDtracklet[iChamb] -> GetClusters(iClus)))
- continue;
- hPH[AliPID::kElectron][iMomBin] -> Fill(TRDcluster -> GetLocalTimeBin(), TRDtracklet[iChamb] -> GetdQdl(iClus));
- }
+ for(Int_t iClus = 0; iClus < AliTRDtrackerV1::GetNTimeBins(); iClus++){
+ if(!(TRDcluster = (AliTRDcluster*)TRDtracklet[iChamb] -> GetClusters(iClus)))
+ continue;
+ hPH[AliPID::kElectron][iMomBin] -> Fill(TRDcluster -> GetLocalTimeBin(), TRDtracklet[iChamb] -> GetdQdl(iClus));
+ }
}
break;
case kMuonPlus:
case kMuonMinus:
hPIDLQ[AliPID::kMuon][iMomBin] -> Fill(TRDtrack -> GetPID(0));
- for(Int_t iChamb = 0; iChamb < AliTRDCalPID::kNPlane; iChamb++){
+ for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){
hdEdx[AliPID::kMuon][iMomBin] -> Fill(SumdEdx[iChamb]);
- for(Int_t iClus = 0; iClus < AliTRDtrackerV1::GetNTimeBins(); iClus++){
- if(!(TRDcluster = (AliTRDcluster*)TRDtracklet[iChamb] -> GetClusters(iClus)))
- continue;
- hPH[AliPID::kMuon][iMomBin] -> Fill(TRDcluster -> GetLocalTimeBin(), TRDtracklet[iChamb] -> GetdQdl(iClus));
- }
+ for(Int_t iClus = 0; iClus < AliTRDtrackerV1::GetNTimeBins(); iClus++){
+ if(!(TRDcluster = (AliTRDcluster*)TRDtracklet[iChamb] -> GetClusters(iClus)))
+ continue;
+ hPH[AliPID::kMuon][iMomBin] -> Fill(TRDcluster -> GetLocalTimeBin(), TRDtracklet[iChamb] -> GetdQdl(iClus));
+ }
}
break;
case kPiPlus:
case kPiMinus:
hPIDLQ[AliPID::kPion][iMomBin] -> Fill(TRDtrack -> GetPID(0));
- for(Int_t iChamb = 0; iChamb < AliTRDCalPID::kNPlane; iChamb++){
+ for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){
hdEdx[AliPID::kPion][iMomBin] -> Fill(SumdEdx[iChamb]);
- for(Int_t iClus = 0; iClus < AliTRDtrackerV1::GetNTimeBins(); iClus++){
- if(!(TRDcluster = (AliTRDcluster*)TRDtracklet[iChamb] -> GetClusters(iClus)))
- continue;
- hPH[AliPID::kPion][iMomBin] -> Fill(TRDcluster -> GetLocalTimeBin(), TRDtracklet[iChamb] -> GetdQdl(iClus));
- }
+ for(Int_t iClus = 0; iClus < AliTRDtrackerV1::GetNTimeBins(); iClus++){
+ if(!(TRDcluster = (AliTRDcluster*)TRDtracklet[iChamb] -> GetClusters(iClus)))
+ continue;
+ hPH[AliPID::kPion][iMomBin] -> Fill(TRDcluster -> GetLocalTimeBin(), TRDtracklet[iChamb] -> GetdQdl(iClus));
+ }
}
break;
case kKPlus:
case kKMinus:
hPIDLQ[AliPID::kKaon][iMomBin] -> Fill(TRDtrack -> GetPID(0));
- for(Int_t iChamb = 0; iChamb < AliTRDCalPID::kNPlane; iChamb++){
+ for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){
hdEdx[AliPID::kKaon][iMomBin] -> Fill(SumdEdx[iChamb]);
- for(Int_t iClus = 0; iClus < AliTRDtrackerV1::GetNTimeBins(); iClus++){
- if(!(TRDcluster = (AliTRDcluster*)TRDtracklet[iChamb] -> GetClusters(iClus)))
- continue;
- hPH[AliPID::kKaon][iMomBin] -> Fill(TRDcluster -> GetLocalTimeBin(), TRDtracklet[iChamb] -> GetdQdl(iClus));
- }
+ for(Int_t iClus = 0; iClus < AliTRDtrackerV1::GetNTimeBins(); iClus++){
+ if(!(TRDcluster = (AliTRDcluster*)TRDtracklet[iChamb] -> GetClusters(iClus)))
+ continue;
+ hPH[AliPID::kKaon][iMomBin] -> Fill(TRDcluster -> GetLocalTimeBin(), TRDtracklet[iChamb] -> GetdQdl(iClus));
+ }
}
break;
case kProton:
case kProtonBar:
hPIDLQ[AliPID::kProton][iMomBin] -> Fill(TRDtrack -> GetPID(0));
- for(Int_t iChamb = 0; iChamb < AliTRDCalPID::kNPlane; iChamb++){
+ for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){
hdEdx[AliPID::kProton][iMomBin] -> Fill(SumdEdx[iChamb]);
- for(Int_t iClus = 0; iClus < AliTRDtrackerV1::GetNTimeBins(); iClus++){
- if(!(TRDcluster = (AliTRDcluster*)TRDtracklet[iChamb] -> GetClusters(iClus)))
- continue;
- hPH[AliPID::kProton][iMomBin] -> Fill(TRDcluster -> GetLocalTimeBin(), TRDtracklet[iChamb] -> GetdQdl(iClus));
- }
+ for(Int_t iClus = 0; iClus < AliTRDtrackerV1::GetNTimeBins(); iClus++){
+ if(!(TRDcluster = (AliTRDcluster*)TRDtracklet[iChamb] -> GetClusters(iClus)))
+ continue;
+ hPH[AliPID::kProton][iMomBin] -> Fill(TRDcluster -> GetLocalTimeBin(), TRDtracklet[iChamb] -> GetdQdl(iClus));
+ }
}
break;
}
#include "TEventList.h"
#include "TMultiLayerPerceptron.h"
-#include "AliPID.h"
#include "AliESDEvent.h"
#include "AliESDInputHandler.h"
#include "AliTrackReference.h"
memset(fv0pid, 0, AliPID::kSPECIES*sizeof(Float_t));
memset(fdEdx, 0, 10*sizeof(Float_t));
- const Int_t nnSize = AliTRDCalPID::kNMom * AliTRDCalPID::kNPlane;
+ const Int_t nnSize = AliTRDCalPID::kNMom * AliTRDgeometry::kNlayer;
memset(fTrain, 0, nnSize*sizeof(TEventList*));
memset(fTest, 0, nnSize*sizeof(TEventList*));
- memset(fNet, 0, AliTRDCalPID::kNPlane*sizeof(TMultiLayerPerceptron*));
+ memset(fNet, 0, AliTRDgeometry::kNlayer*sizeof(TMultiLayerPerceptron*));
DefineOutput(1, TTree::Class());
DefineOutput(2, TTree::Class());
fLQ = (TTree*)fInFileLQ -> Get("LQ");
for(Int_t iMom = 0; iMom < AliTRDCalPID::kNMom; iMom++){
- for(Int_t ily = 0; ily < AliTRDCalPID::kNPlane; ily++){
+ for(Int_t ily = 0; ily < AliTRDgeometry::kNlayer; ily++){
fTrain[iMom][ily] = new TEventList(Form("fTrainMom%d_%d", iMom, ily), Form("Training list for momentum intervall %d and plane %d", iMom, ily));
fTest[iMom][ily] = new TEventList(Form("fTestMom%d_%d", iMom, ily), Form("Test list for momentum intervall %d and plane %d", iMom, ily));
}
//&&(track->GetNumberOfClustersRefit()
// use only tracks that hit 6 chambers
- if(!(TRDtrack->GetNumberOfTracklets() == AliTRDCalPID::kNPlane)) continue;
+ if(!(TRDtrack->GetNumberOfTracklets() == AliTRDgeometry::kNlayer)) continue;
ref = track->GetTrackRef(0);
esd = track->GetOuterParam();
// fill the dE/dx information for NN
fReconstructor -> SetOption("nn");
- for(Int_t ily = 0; ily < AliTRDCalPID::kNPlane; ily++){
+ for(Int_t ily = 0; ily < AliTRDgeometry::kNlayer; ily++){
if(!(TRDtracklet = TRDtrack -> GetTracklet(ily))) continue;
TRDtracklet->CookdEdx(AliTRDReconstructor::kNNslices);
dedx = TRDtracklet->GetdEdx();
// fill the dE/dx information for LQ
fReconstructor -> SetOption("!nn");
- for(Int_t ily = 0; ily < AliTRDCalPID::kNPlane; ily++){
+ for(Int_t ily = 0; ily < AliTRDgeometry::kNlayer; ily++){
if(!(TRDtracklet = TRDtrack -> GetTracklet(ily))) continue;
TRDtracklet->CookdEdx(AliTRDReconstructor::kLQslices);
dedx = TRDtracklet->GetdEdx();
// set electrons
if(fv0pid[0] == 1){
if(nPart[0][iMomBin] < iTrain[iMomBin]){
- for(Int_t ily = 0; ily < AliTRDCalPID::kNPlane; ily++)
+ for(Int_t ily = 0; ily < AliTRDgeometry::kNlayer; ily++)
fTrain[iMomBin][ily] -> Enter(iEv + ily);
nPart[0][iMomBin]++;
}
else if(nPart[0][iMomBin] < iTest[iMomBin]+iTrain[iMomBin]){
- for(Int_t ily = 0; ily < AliTRDCalPID::kNPlane; ily++)
+ for(Int_t ily = 0; ily < AliTRDgeometry::kNlayer; ily++)
fTest[iMomBin][ily] -> Enter(iEv + ily);
nPart[0][iMomBin]++;
}
// set muons
else if(fv0pid[1] == 1){
if(nPart[1][iMomBin] < iTrain[iMomBin]){
- for(Int_t ily = 0; ily < AliTRDCalPID::kNPlane; ily++)
+ for(Int_t ily = 0; ily < AliTRDgeometry::kNlayer; ily++)
fTrain[iMomBin][ily] -> Enter(iEv + ily);
nPart[1][iMomBin]++;
}
else if(nPart[1][iMomBin] < iTest[iMomBin]+iTrain[iMomBin]){
- for(Int_t ily = 0; ily < AliTRDCalPID::kNPlane; ily++)
+ for(Int_t ily = 0; ily < AliTRDgeometry::kNlayer; ily++)
fTest[iMomBin][ily] -> Enter(iEv + ily);
nPart[1][iMomBin]++;
}
// set pions
else if(fv0pid[2] == 1){
if(nPart[2][iMomBin] < iTrain[iMomBin]){
- for(Int_t ily = 0; ily < AliTRDCalPID::kNPlane; ily++)
+ for(Int_t ily = 0; ily < AliTRDgeometry::kNlayer; ily++)
fTrain[iMomBin][ily] -> Enter(iEv + ily);
nPart[2][iMomBin]++;
}
else if(nPart[2][iMomBin] < iTest[iMomBin]+iTrain[iMomBin]){
- for(Int_t ily = 0; ily < AliTRDCalPID::kNPlane; ily++)
+ for(Int_t ily = 0; ily < AliTRDgeometry::kNlayer; ily++)
fTest[iMomBin][ily] -> Enter(iEv + ily);
nPart[2][iMomBin]++;
}
// set kaons
else if(fv0pid[3] == 1){
if(nPart[3][iMomBin] < iTrain[iMomBin]){
- for(Int_t ily = 0; ily < AliTRDCalPID::kNPlane; ily++)
+ for(Int_t ily = 0; ily < AliTRDgeometry::kNlayer; ily++)
fTrain[iMomBin][ily] -> Enter(iEv + ily);
nPart[3][iMomBin]++;
}
else if(nPart[3][iMomBin] < iTest[iMomBin]+iTrain[iMomBin]){
- for(Int_t ily = 0; ily < AliTRDCalPID::kNPlane; ily++)
+ for(Int_t ily = 0; ily < AliTRDgeometry::kNlayer; ily++)
fTest[iMomBin][ily] -> Enter(iEv + ily);
nPart[3][iMomBin]++;
}
// set protons
else if(fv0pid[4] == 1){
if(nPart[4][iMomBin] < iTrain[iMomBin]){
- for(Int_t ily = 0; ily < AliTRDCalPID::kNPlane; ily++)
+ for(Int_t ily = 0; ily < AliTRDgeometry::kNlayer; ily++)
fTrain[iMomBin][ily] -> Enter(iEv + ily);
nPart[4][iMomBin]++;
}
else if(nPart[4][iMomBin] < iTest[iMomBin]+iTrain[iMomBin]){
- for(Int_t ily = 0; ily < AliTRDCalPID::kNPlane; ily++)
+ for(Int_t ily = 0; ily < AliTRDgeometry::kNlayer; ily++)
fTest[iMomBin][ily] -> Enter(iEv + ily);
nPart[4][iMomBin]++;
}
gSystem->Exec(Form("mkdir ./Networks_%d/MomBin_%d",fDate, mombin));
// variable to check if network can load weights from previous training
- Bool_t bFirstLoop[AliTRDCalPID::kNPlane];
- memset(bFirstLoop, kTRUE, AliTRDCalPID::kNPlane*sizeof(Bool_t));
+ Bool_t bFirstLoop[AliTRDgeometry::kNlayer];
+ memset(bFirstLoop, kTRUE, AliTRDgeometry::kNlayer*sizeof(Bool_t));
// train networks over several loops and save them after each loop
for(Int_t iLoop = 0; iLoop < kMoniTrain; iLoop++){
// loop over chambers
- for(Int_t iChamb = 0; iChamb < AliTRDCalPID::kNPlane; iChamb++){
+ for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){
// set the event lists
fNN -> SetEventList(fTrain[mombin][iChamb]);
fNN -> SetEventList(fTest[mombin][iChamb]);
#include "AliTRDrecoTask.h"
#endif
+#ifndef ALIPID_H
+#include "AliPID.h"
+#endif
+
+#ifndef ALITRDGEOMETRY_H
+#include "AliTRDgeometry.h"
+#endif
+
class TTree;
class TEventList;
class TMultiLayerPerceptron;
AliTRDReconstructor *fReconstructor; //! reconstructor needed for recalculation the PID
TTree *fNN; // NN data
TTree *fLQ; // LQ data
- TEventList *fTrain[AliTRDCalPID::kNMom][AliTRDCalPID::kNPlane]; // Training list for each momentum
- TEventList *fTest[AliTRDCalPID::kNMom][AliTRDCalPID::kNPlane]; // Test list for each momentum
- TMultiLayerPerceptron *fNet[AliTRDCalPID::kNPlane]; // artificial neural network
+ TEventList *fTrain[AliTRDCalPID::kNMom][AliTRDgeometry::kNlayer]; // Training list for each momentum
+ TEventList *fTest[AliTRDCalPID::kNMom][AliTRDgeometry::kNlayer]; // Test list for each momentum
+ TMultiLayerPerceptron *fNet[AliTRDgeometry::kNlayer]; // artificial neural network
/* TMultiLayerPerceptron *fNet[AliTRDCalPID::kNMom][AliTRDCalPID::kNPlane]; // artificial neural network */
Int_t fLayer; // TRD layer index
op->Global2LocalPosition(xyz, op->GetAlpha());
if(fDebugLevel>=2) printf("op @ X[%7.3f]\n", xyz[0]);
}
-/* if(xyz[0] < 270.){
- printf("TPC track missing\n");
- } else { */
-// op->GetXYZAt(ref->LocalX(), AliTracker::GetBz(), xyz);
-// op->Global2LocalPosition(xyz, op->GetAlpha());
-// dy = ref->LocalY()- xyz[1];
-// dz = ref->Z() - xyz[2];
-// }
// read MC info
Int_t fPdg = -1;
label = esdTrack->GetLabel();
if(label < fMC->GetNumberOfTracks()) trackMap[TMath::Abs(label)] = kTRUE; // register the track
//if (TMath::Abs(label) > mStack->GetNtrack()) continue;
- AliMCParticle *mcParticle = fMC->GetTrack(TMath::Abs(label));
+ AliMCParticle *mcParticle = 0x0;
+ if(!(mcParticle = fMC->GetTrack(TMath::Abs(label)))){
+ printf("E - AliTRDtrackInfoGen::Exec() : MC particle missing for ESD label %d\n", label);
+ continue;
+ }
fPdg = mcParticle->Particle()->GetPdgCode();
Int_t nRefs = mcParticle->GetNumberOfTrackReferences();
Int_t iref = 0; AliTrackReference *ref = 0x0;
//printf("\ttrackRef[%2d] @ %7.3f\n", iref, ref->LocalX());
iref++;
}
- if(iref == nRefs){
-// if(!esdTrack->GetNcls(2)) continue;
-/* printf("No TRD Track References in the Track [%d] I\n", itrk);
- printf("Label = %d ITS[%d] TPC[%d] TRD[%d]\n", label, esdTrack->GetITSLabel(), esdTrack->GetTPCLabel(), esdTrack->GetTRDLabel());
- Int_t kref = 0;
- while(kref<nRefs){
- ref = mcParticle->GetTrackReference(kref);
- printf("\ttrackRef[%2d] @ %7.3f\n", kref, ref->LocalX());
- kref++;
- }*/
- }
new(fTrackInfo) AliTRDtrackInfo();
fTrackInfo->SetPDG(fPdg);
#include <TProfile.h>
#include "TTreeStream.h"
+#include "AliPID.h"
#include "AliESDtrack.h"
#include "AliTrackReference.h"
#include "AliExternalTrackParam.h"
#include "AliMagFMaps.h"
#include "AliAnalysisManager.h"
+#include "Cal/AliTRDCalPID.h"
#include "AliTRDtrackingEfficiency.h"
#include "AliTRDtrackInfo/AliTRDtrackInfo.h"
//
OpenFile(0, "RECREATE");
- const Int_t nbins = 11;
+ const Int_t nbins = AliTRDCalPID::kNMom;
Float_t xbins[nbins+1] = {.5, .7, .9, 1.3, 1.7, 2.4, 3.5, 4.5, 5.5, 7., 9., 11.};
+
+ TH1 *h = 0x0;
fContainer = new TObjArray();
- fContainer->Add(new TProfile("h", "", nbins, xbins));
+ for(Int_t is=0; is<AliPID::kSPECIES; is++){
+ fContainer->Add(h = new TProfile(Form("h%s", AliTRDCalPID::GetPartSymb(is)), "", nbins, xbins));
+ h->SetLineColor(AliTRDCalPID::GetPartColor(is));
+ h->SetMarkerColor(AliTRDCalPID::GetPartColor(is));
+ h->SetMarkerStyle(7);
+ }
+ fContainer->Add(h = new TProfile("h", "", nbins, xbins));
+ h->SetMarkerStyle(7);
}
//____________________________________________________________________
// Do it
//
- if(!AliTracker::GetFieldMap()){
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG);
- AliTracker::SetFieldMap(field, kTRUE);
- }
- TProfile *h = (TProfile*)fContainer->At(0);
- Int_t labelsacc[10000]; memset(labelsacc, 0, sizeof(Int_t) * 10000);
+ Int_t labelsacc[10000];
+ memset(labelsacc, 0, sizeof(Int_t) * 10000);
if(!fMissed){
fMissed = new TClonesArray("AliTRDtrackInfo", 10);
Float_t mom;
Int_t selection[10000], nselect = 0;
- ULong_t status;
+ ULong_t status; Int_t pidx;
Int_t nTRD = 0, nTPC = 0, nMiss = 0;
AliTRDtrackInfo *track = 0x0;
AliTrackReference *ref = 0x0;
AliExternalTrackParam *esd = 0x0;
for(Int_t itrk=0; itrk<fTracks->GetEntriesFast(); itrk++){
track = (AliTRDtrackInfo*)fTracks->UncheckedAt(itrk);
+
if(!track->HasESDtrack()) continue;
status = track->GetStatus();
- if(!(status&AliESDtrack::kTPCout)){
- // missing TPC propagation - interesting for SA
- continue;
- }
+ // missing TPC propagation - interesting for SA
+ if(!(status&AliESDtrack::kTPCout)) continue;
+
+ // missing MC info.
+ if(HasMCdata() && track->GetNTrackRefs() <= 1) continue;
+
nTPC++;
selection[nselect++]=itrk;
+ ref = track->GetTrackRef(0);
+ esd = track->GetOuterParam();
+ mom = ref ? ref->P(): esd->P();
+ pidx = AliTRDCalPID::GetPartIndex(track->GetPDG());
+ pidx = TMath::Max(pidx, 0);
//Int_t n = track->GetNumberOfClusters();
// where are this tracklets ???
//if(ncls0 > ncls1) printf("%3d ESD[%3d] TRD[%3d|%3d]\n", itrk, ncls0, ncls1, n);
if(track->GetNumberOfClustersRefit()){
- ref = track->GetTrackRef(0);
- esd = track->GetOuterParam();
- mom = ref ? ref->P(): esd->P();
- //printf("FOUND Id[%d] mom[%f]\n", itrk, mom);
- h->Fill(mom, 1.);
+ ((TProfile*)fContainer->At(pidx))->Fill(mom, 1.);
labelsacc[nTRD] = track->GetLabel();
nTRD++;
continue;
}
- Int_t nrefs = track->GetNTrackRefs();
- if(nrefs<=1){
- nTPC--;
- // we don't have MC info.
- // we should discard this track
- continue;
- }
Float_t xmed, xleng;
Int_t iref = 1; Bool_t found = kFALSE;
new ((*fMissed)[nMiss]) AliTRDtrackInfo(*track);
nMiss++;
}
- if(fDebugLevel>=1) printf("%3d Tracks: ESD[%3d] TPC[%3d] TRD[%3d | %5.2f%%] Off[%d]\n", (Int_t)AliAnalysisManager::GetAnalysisManager()->GetCurrentEntry(), fTracks->GetEntriesFast(), nTPC, nTRD, nTPC ? 1.E2*nTRD/float(nTPC) : 0., fMissed->GetEntriesFast());
+ if(fDebugLevel>=2) printf("%3d Tracks: ESD[%3d] TPC[%3d] TRD[%3d | %5.2f%%] Off[%d]\n", (Int_t)AliAnalysisManager::GetAnalysisManager()->GetCurrentEntry(), fTracks->GetEntriesFast(), nTPC, nTRD, nTPC ? 1.E2*nTRD/float(nTPC) : 0., fMissed->GetEntriesFast());
// Find double tracks
else{
ref = tt->GetTrackRef(0);
mom = ref ? ref->P(): op->P();
- h->Fill(mom, 0.);
- printf("\tNOT FOUND Id[%d] Mom[%f]\n", tt->GetTrackId(), mom);
+ pidx = AliTRDCalPID::GetPartIndex(tt->GetPDG());
+ pidx = TMath::Max(pidx, 0);
+ ((TProfile*)fContainer->At(pidx))->Fill(mom, 0.);
+ if(fDebugLevel>=2) printf("\tNOT FOUND Id[%d] Mom[%f]\n", tt->GetTrackId(), mom);
}
}
- //if(fDebugLevel>=1)
- printf("%3d Tracks: ESD[%3d] TPC[%3d] TRD[%3d | %5.2f%%] Off[%d]\n", (Int_t)AliAnalysisManager::GetAnalysisManager()->GetCurrentEntry(), fTracks->GetEntriesFast(), nTPC, nTRD, nTPC ? 1.E2*nTRD/float(nTPC) : 0., fMissed->GetEntriesFast());
+ if(fDebugLevel>=2) printf("%3d Tracks: ESD[%3d] TPC[%3d] TRD[%3d | %5.2f%%] Off[%d]\n", (Int_t)AliAnalysisManager::GetAnalysisManager()->GetCurrentEntry(), fTracks->GetEntriesFast(), nTPC, nTRD, nTPC ? 1.E2*nTRD/float(nTPC) : 0., fMissed->GetEntriesFast());
//fMissed->Delete();
// check for double countings
}
+
+
+//____________________________________________________________________
+void AliTRDtrackingEfficiency::GetRefFigure(Int_t ifig, Int_t &first, Int_t &last, Option_t *opt)
+{
+ switch(ifig){
+ case 0:
+ first = 5; last = 6; opt="e2";
+ break;
+ case 1:
+ first = 0; last = 5; opt="e2";
+ break;
+ }
+}
+
+
+//____________________________________________________________________
+Bool_t AliTRDtrackingEfficiency::PostProcess()
+{
+ TProfile *h = (TProfile*)fContainer->At(AliPID::kSPECIES);
+ for(Int_t is=0; is<AliPID::kSPECIES; is++){
+ h->Add((TProfile*)fContainer->At(is));
+ }
+ fNRefFigures = HasMCdata() ? 2 : 1;
+ return kTRUE;
+}
public:
AliTRDtrackingEfficiency();
virtual ~AliTRDtrackingEfficiency();
- void CreateOutputObjects();
- void Exec(Option_t *);
- void Terminate(Option_t *);
+ void CreateOutputObjects();
+ void Exec(Option_t *);
+ void GetRefFigure(Int_t ifig, Int_t &first, Int_t &last, Option_t *opt);
+ Bool_t PostProcess();
+ void Terminate(Option_t *);
private:
AliTRDtrackingEfficiency(const AliTRDtrackingEfficiency&);