ClassImp(AliAnalysisTaskSpectraBoth)
//________________________________________________________________________
-AliAnalysisTaskSpectraBoth::AliAnalysisTaskSpectraBoth(const char *name) : AliAnalysisTaskSE(name), fAOD(0), fHistMan(0), fTrackCuts(0), fEventCuts(0), fPID(0), fIsMC(0), fNRebin(0),fUseMinSigma(0),fCuts(0),fdotheMCLoopAfterEventCuts(0)
+AliAnalysisTaskSpectraBoth::AliAnalysisTaskSpectraBoth(const char *name) : AliAnalysisTaskSE(name), fAOD(0), fHistMan(0), fTrackCuts(0), fEventCuts(0), fPID(0), fIsMC(0), fNRebin(0),fUseMinSigma(0),fCuts(0),fdotheMCLoopAfterEventCuts(0),
+fmakePIDQAhisto(1),fMotherWDPDGcode(-1)
+
{
// Default constructor
void AliAnalysisTaskSpectraBoth::UserCreateOutputObjects()
{
// create output objects
- fHistMan = new AliSpectraBothHistoManager("SpectraHistos",fNRebin);
+ fHistMan = new AliSpectraBothHistoManager("SpectraHistos",fNRebin,fmakePIDQAhisto);
if (!fTrackCuts) AliFatal("Track Cuts should be set in the steering macro");
if (!fEventCuts) AliFatal("Event Cuts should be set in the steering macro");
if (!fTrackCuts->IsSelected(track,kTRUE))
continue;
ntracks++;
- fPID->FillQAHistos(fHistMan, track, fTrackCuts);
+ if(fmakePIDQAhisto)
+ fPID->FillQAHistos(fHistMan, track, fTrackCuts);
//calculate DCA for AOD track
if(dca==-999.)
Bool_t isSecondaryWeak = kFALSE;
Int_t idGen =kSpUndefined;
Int_t pdgcode=0;
+ Int_t motherpdg=-1;
if (ifAODEvent==AliSpectraBothTrackCuts::kAODobject)
{
AliAODMCParticle *partMC = (AliAODMCParticle*) arrayMC->At(TMath::Abs(track->GetLabel()));
isSecondaryMaterial = partMC->IsSecondaryFromMaterial();
//cout<<"AOD tagging "<<isPrimary<<" "<<isSecondaryWeak<<isSecondaryMaterial<<" "<<partMC->GetMCProcessCode()<<endl;
- if(!isPrimary&&!isSecondaryWeak&&!isSecondaryMaterial)
+ if(!isPrimary&&!isSecondaryWeak&&!isSecondaryMaterial)//old tagging for old AODs
{
AliError("old tagging");
Int_t mfl=-999,codemoth=-999;
isSecondaryMaterial = kTRUE;
}
//cout<<"AOD 2 tagging "<<isPrimary<<" "<<isSecondaryWeak<<isSecondaryMaterial<<" "<<partMC->GetMCProcessCode()<<endl;
-
+ if(isSecondaryWeak)
+ {
+ Int_t indexMoth=partMC->GetMother(); // FIXME ignore fakes? TO BE CHECKED, on ESD is GetFirstMother()
+ if(indexMoth>=0)
+ {
+ AliAODMCParticle* moth = (AliAODMCParticle*) arrayMC->At(indexMoth);
+ if(!moth)
+ motherpdg=TMath::Abs(moth->GetPdgCode());
+ }
+ }
idGen = fPID->GetParticleSpecie(partMC);
pdgcode=partMC->GetPdgCode();
isSecondaryMaterial = stack->IsSecondaryFromMaterial(TMath::Abs(track->GetLabel()));
//cout<<"ESD tagging "<<isPrimary<<" "<<isSecondaryWeak<<isSecondaryMaterial<<endl;
+ if(isSecondaryWeak)
+ {
+
+ TParticle* moth=stack->Particle(TMath::Abs(partMC->GetFirstMother()));
+ if(moth)
+ motherpdg = TMath::Abs(moth->GetPdgCode());
+
+ }
+
+
idGen = fPID->GetParticleSpecie(partMC);
pdgcode=partMC->GetPdgCode();
}
///..... END FIXME
// Fill secondaries
- if(isSecondaryWeak )
- fHistMan->GetHistogram2D(kHistPtRecSigmaSecondaryWeakDecay, idRec, charge)->Fill(track->Pt(),dca);
+ if(isSecondaryWeak)
+ {
+ if(fMotherWDPDGcode>0)
+ {
+ if(motherpdg==fMotherWDPDGcode)
+ fHistMan->GetHistogram2D(kHistPtRecSigmaSecondaryWeakDecay, idRec, charge)->Fill(track->Pt(),dca);
+ }
+ else
+ fHistMan->GetHistogram2D(kHistPtRecSigmaSecondaryWeakDecay, idRec, charge)->Fill(track->Pt(),dca);
+ }
if(isSecondaryMaterial)
fHistMan->GetHistogram2D(kHistPtRecSigmaSecondaryMaterial , idRec, charge)->Fill(track->Pt(),dca);
public:
// constructors
- AliAnalysisTaskSpectraBoth() : AliAnalysisTaskSE(), fAOD(0), fHistMan(0), fTrackCuts(0), fEventCuts(0), fPID(0), fIsMC(0), fNRebin(0),fUseMinSigma(0),fCuts(0),fdotheMCLoopAfterEventCuts(0)
+ AliAnalysisTaskSpectraBoth() : AliAnalysisTaskSE(), fAOD(0), fHistMan(0), fTrackCuts(0), fEventCuts(0), fPID(0), fIsMC(0), fNRebin(0),fUseMinSigma(0),fCuts(0),fdotheMCLoopAfterEventCuts(0),fmakePIDQAhisto(1),fMotherWDPDGcode(-1)
{}
AliAnalysisTaskSpectraBoth(const char *name);
virtual ~AliAnalysisTaskSpectraBoth() {}
void SetAliESDtrackCuts(AliESDtrackCuts* cuts ){fCuts=cuts;}
void SetdotheMCLoopAfterEventCuts (Bool_t flag) {fdotheMCLoopAfterEventCuts=flag;}
Bool_t GetdotheMCLoopAfterEventCuts () const {return fdotheMCLoopAfterEventCuts;}
+ void SetMakePIDQAHisto(Bool_t flag){fmakePIDQAhisto=flag;}
+ void SetMotherWDPDGCode(Int_t value){fMotherWDPDGcode=value;}
private:
AliVEvent * fAOD; //! AOD object
Bool_t fIsMC;// true if processing MC
Int_t fNRebin; //rebin of histos
Bool_t fUseMinSigma; // if true use min sigma
- AliESDtrackCuts *fCuts; // ESD track cuts
- Bool_t fdotheMCLoopAfterEventCuts; // if true first check the ESD event cuts than loop over MC info , if flase other approach
+ AliESDtrackCuts *fCuts; // ESD track cuts
+ Bool_t fdotheMCLoopAfterEventCuts; // if true first check the ESD event cuts than loop over MC info , if flase other approach
+ Bool_t fmakePIDQAhisto; // if true makes PIDQA histos
+ Int_t fMotherWDPDGcode; //the abs of pdg code of the mother for WD decays , used during systematic studies
AliAnalysisTaskSpectraBoth(const AliAnalysisTaskSpectraBoth&);
AliAnalysisTaskSpectraBoth& operator=(const AliAnalysisTaskSpectraBoth&);
- ClassDef(AliAnalysisTaskSpectraBoth, 2);
+ ClassDef(AliAnalysisTaskSpectraBoth, 3);
};
#endif
// };
-AliSpectraBothHistoManager::AliSpectraBothHistoManager(const char *name,Int_t nrebin): TNamed(name, "AOD Spectra Histo Manager"), fOutputList(0), fNRebin(0)
+AliSpectraBothHistoManager::AliSpectraBothHistoManager(const char *name,Int_t nrebin,Bool_t pidqa): TNamed(name, "AOD Spectra Histo Manager"), fOutputList(0), fNRebin(0)
{
// ctor
fNRebin=nrebin;
if (ihist > kNPtGenHist && ihist <= kNPtGenAllChHist) BookPtGenAllChHistogram(kHistNameBoth[ihist]); // PT histos
if (ihist > kNPtGenAllChHist && ihist <= kNPtRecHist) BookPtRecHistogram(kHistNameBoth[ihist]); // PT histos
if (ihist > kNPtRecHist && ihist <= kNPtRecAllChHist) BookPtRecAllChHistogram(kHistNameBoth[ihist]); // PT histos
- if (ihist > kNPtRecAllChHist && ihist <= kNHistPID) BookPIDHistogram(kHistNameBoth[ihist]); // PID histos
- if (ihist > kNHistPID && ihist <= kNHistNSig) BookNSigHistogram(kHistNameBoth[ihist]); // NSigmaSep histos
+ if (ihist > kNPtRecAllChHist && ihist <= kNHistPID && pidqa) BookPIDHistogram(kHistNameBoth[ihist]); // PID histos
+ if (ihist > kNHistPID && ihist <= kNHistNSig && pidqa) BookNSigHistogram(kHistNameBoth[ihist]); // NSigmaSep histos
if(ihist==kHistGenMulvsRawMul) BookGenMulvsRawMulHistogram(kHistNameBoth[ihist]);
}
{
public:
AliSpectraBothHistoManager() : TNamed(), fOutputList(0), fNRebin(0) {}
- AliSpectraBothHistoManager(const char *name,Int_t nrebin);
+ AliSpectraBothHistoManager(const char *name,Int_t nrebin,Bool_t pidqa=kTRUE);
virtual ~AliSpectraBothHistoManager() ;
return kSpUndefined;//if is the default value for the three
if( ( nsigmaKaon < nsigmaPion ) && ( nsigmaKaon < nsigmaProton ) && (nsigmaKaon < fNSigmaPID))
{
- hman->GetPIDHistogram(kHistPIDTPCKaonRec)->Fill(trk->GetTPCmomentum(), trk->GetTPCsignal()*trk->Charge()); // Reconstructed PIDKaon histo
+ if(hman->GetPIDHistogram(kHistPIDTPCKaonRec))
+ hman->GetPIDHistogram(kHistPIDTPCKaonRec)->Fill(trk->GetTPCmomentum(), trk->GetTPCsignal()*trk->Charge()); // Reconstructed PIDKaon histo
return kSpKaon;
}
if( ( nsigmaPion < nsigmaKaon ) && ( nsigmaPion < nsigmaProton ) && (nsigmaPion < fNSigmaPID))
{
- hman->GetPIDHistogram(kHistPIDTPCPionRec)->Fill(trk->GetTPCmomentum(), trk->GetTPCsignal()*trk->Charge()); // Reconstructed PIDPion histo
+ if(hman->GetPIDHistogram(kHistPIDTPCPionRec))
+ hman->GetPIDHistogram(kHistPIDTPCPionRec)->Fill(trk->GetTPCmomentum(), trk->GetTPCsignal()*trk->Charge()); // Reconstructed PIDPion histo
return kSpPion;
}
if( ( nsigmaProton < nsigmaKaon ) && ( nsigmaProton < nsigmaPion ) && (nsigmaProton < fNSigmaPID))
{
- hman->GetPIDHistogram(kHistPIDTPCProtonRec)->Fill(trk->GetTPCmomentum(), trk->GetTPCsignal()*trk->Charge()); // Reconstructed PIDProton histo
+ if(hman->GetPIDHistogram(kHistPIDTPCProtonRec))
+ hman->GetPIDHistogram(kHistPIDTPCProtonRec)->Fill(trk->GetTPCmomentum(), trk->GetTPCsignal()*trk->Charge()); // Reconstructed PIDProton histo
return kSpProton;
}
// else, return undefined
// nsig_data->RebinX(20);
// nsig_data->RebinY(4);
// nsig_data->Sumw2();
+ if(!nsig_data)
+ continue;
TH2F *nsig_mc = (TH2F*)((TH2F*)hman_mc->GetNSigHistogram(Form("hHistNSig%sPt%s",Particle[ipart].Data(),pidmethods[imethod].Data())))->Clone();
//nsig_mc->RebinX(20);
// nsig_mc->RebinY(4);
// nsig_mc->Sumw2();
+ if(!nsig_mc)
+ continue;
+
Int_t ibin=1;
Float_t binsize=nsig_mc->GetXaxis()->GetBinWidth(1);