fCutsEvent(NULL),
fCutsRP(NULL),
fCutsPOI(NULL),
- fQAInt(NULL),
- fQADiff(NULL),
+ fQAList(NULL),
fMinMult(0),
fMaxMult(10000000),
fMinA(-1.0),
fMaxA(-0.01),
fMinB(0.01),
fMaxB(1.0),
- fQA(kFALSE),
+ fQAon(kFALSE),
fLoadCandidates(kFALSE),
fNbinsMult(10000),
fNbinsPt(100),
fCutsEvent(NULL),
fCutsRP(NULL),
fCutsPOI(NULL),
- fQAInt(NULL),
- fQADiff(NULL),
+ fQAList(NULL),
fMinMult(0),
fMaxMult(10000000),
fMinA(-1.0),
fMaxA(-0.01),
fMinB(0.01),
fMaxB(1.0),
- fQA(on),
+ fQAon(on),
fLoadCandidates(bCandidates),
fNbinsMult(10000),
fNbinsPt(100),
// Define output slots here
// Define here the flow event output
DefineOutput(1, AliFlowEventSimple::Class());
- if(on)
- {
- DefineOutput(2, TList::Class());
- DefineOutput(3, TList::Class());
- }
+ DefineOutput(2, TList::Class());
// and for testing open an output file
// fOutputFile = new TFile("FlowEvents.root","RECREATE");
//
delete fMyTRandom3;
delete fFlowEvent;
+ delete fCutsEvent;
+ delete fCutsRP;
+ delete fCutsPOI;
+ delete fQAList;
// objects in the output list are deleted
// by the TSelector dtor (I hope)
fFlowEvent = new AliFlowEvent(3000);
+ if (fQAon)
+ {
+ fQAList=new TList();
+ fQAList->SetName(Form("%s QA",GetName()));
+ if (fCutsEvent->GetQA()) fQAList->Add(fCutsEvent->GetQA());
+ if (fCutsRP->GetQA()) fQAList->Add(fCutsRP->GetQA());
+ if (fCutsPOI->GetQA())fQAList->Add(fCutsPOI->GetQA());
+ PostData(2,fQAList);
+ }
}
//________________________________________________________________________
//fListHistos->Print();
//fOutputFile->WriteObject(fFlowEvent,"myFlowEventSimple");
PostData(1,fFlowEvent);
- if (fQA)
- {
- PostData(2,fQAInt);
- PostData(3,fQADiff);
- }
}
//________________________________________________________________________
AliCFManager* GetCFManager1() {return this->fCFManager1; }
void SetCFManager2(AliCFManager* cfmgr) {this->fCFManager2 = cfmgr; }
AliCFManager* GetCFManager2() {return this->fCFManager2; }
- void SetQAList1(TList* list) {this->fQAInt = list; }
- TList* GetQAList1() {return this->fQAInt; }
- void SetQAList2(TList* list) {this->fQADiff = list; }
- TList* GetQAList2() {return this->fQADiff; }
- void SetQAOn(Bool_t kt) {this->fQA = kt; }
- Bool_t GetQAOn() {return this->fQA; }
+ TList* GetQAList() {return fQAList; }
+ void SetQAOn(Bool_t kt) {fQAon = kt; }
+ Bool_t GetQAOn() {return fQAon; }
// setters for common constants
void SetNbinsMult( Int_t i ) { fNbinsMult = i; }
AliFlowEventCuts* fCutsEvent; //event cuts
AliFlowTrackCuts* fCutsRP; //cuts for RPs
AliFlowTrackCuts* fCutsPOI; //cuts for POIs
- TList* fQAInt; // QA histogram list
- TList* fQADiff; // QA histogram list
+ TList* fQAList; // QA histogram list
Int_t fMinMult; // Minimum multiplicity from tracks selected using CORRFW
Int_t fMaxMult; // Maximum multiplicity from tracks selected using CORRFW
Double_t fMinA; // Minimum of eta range for subevent A
Double_t fMinB; // Minimum of eta range for subevent B
Double_t fMaxB; // Maximum of eta range for subevent B
- Bool_t fQA; // flag to set the filling of the QA hostograms
+ Bool_t fQAon; // flag to set the filling of the QA hostograms
Bool_t fLoadCandidates; // true if reciving candidates collection
// setters for common constants
//fOutputList->Add(fESDpid);
- TH1* h=NULL;
- h = static_cast<TH1*>(fCutsTOFPions->GetQA()->At(0));
- h->SetName(Form("pion direct %s",h->GetName()));
- h = static_cast<TH1*>(fCutsTOFKaons->GetQA()->At(0));
- h->SetName(Form("kaon direct %s",h->GetName()));
- h = static_cast<TH1*>(fCutsTOFProtons->GetQA()->At(0));
- h->SetName(Form("proton direct %s",h->GetName()));
- fOutputList->Add(fCutsTOFPions->GetQA()->At(0));
- fOutputList->Add(fCutsTOFKaons->GetQA()->At(0));
- fOutputList->Add(fCutsTOFProtons->GetQA()->At(0));
-
- h = static_cast<TH1*>(fCutsTOFPions->GetQA()->At(1));
- h->SetName(Form("pion direct %s",h->GetName()));
- h = static_cast<TH1*>(fCutsTOFKaons->GetQA()->At(1));
- h->SetName(Form("kaon direct %s",h->GetName()));
- h = static_cast<TH1*>(fCutsTOFProtons->GetQA()->At(1));
- h->SetName(Form("proton direct %s",h->GetName()));
- fOutputList->Add(fCutsTOFPions->GetQA()->At(1));
- fOutputList->Add(fCutsTOFKaons->GetQA()->At(1));
- fOutputList->Add(fCutsTOFProtons->GetQA()->At(1));
-
- h = static_cast<TH1*>(fCutsTOFPions->GetQA()->At(2));
- h->SetName(Form("pion direct %s",h->GetName()));
- h = static_cast<TH1*>(fCutsTOFKaons->GetQA()->At(2));
- h->SetName(Form("kaon direct %s",h->GetName()));
- h = static_cast<TH1*>(fCutsTOFProtons->GetQA()->At(2));
- h->SetName(Form("proton direct %s",h->GetName()));
- fOutputList->Add(fCutsTOFPions->GetQA()->At(2));
- fOutputList->Add(fCutsTOFKaons->GetQA()->At(2));
- fOutputList->Add(fCutsTOFProtons->GetQA()->At(2));
-
- h = static_cast<TH1*>(fCutsTOFPions->GetQA()->At(3));
- h->SetName(Form("pion direct %s",h->GetName()));
- h = static_cast<TH1*>(fCutsTOFKaons->GetQA()->At(3));
- h->SetName(Form("kaon direct %s",h->GetName()));
- h = static_cast<TH1*>(fCutsTOFProtons->GetQA()->At(3));
- h->SetName(Form("proton direct %s",h->GetName()));
- fOutputList->Add(fCutsTOFPions->GetQA()->At(3));
- fOutputList->Add(fCutsTOFKaons->GetQA()->At(3));
- fOutputList->Add(fCutsTOFProtons->GetQA()->At(3));
+ fOutputList->Add(fCutsTPCElectrons);
+ fOutputList->Add(fCutsTPCPions);
+ fOutputList->Add(fCutsTPCKaons);
+ fOutputList->Add(fCutsTPCProtons);
+ fOutputList->Add(fCutsTOFElectrons);
+ fOutputList->Add(fCutsTOFPions);
+ fOutputList->Add(fCutsTOFKaons);
+ fOutputList->Add(fCutsTOFProtons);
if (fUseDebugFile) fFile = fopen("debug.txt","w");
AliESDtrack *trackESD=0;
+ fCuts->SetEvent(fESD);
+ fCutsTPCElectrons->SetEvent(fESD);
+ fCutsTPCPions->SetEvent(fESD);
+ fCutsTPCKaons->SetEvent(fESD);
+ fCutsTPCProtons->SetEvent(fESD);
+ fCutsTOFElectrons->SetEvent(fESD);
+ fCutsTOFPions->SetEvent(fESD);
+ fCutsTOFKaons->SetEvent(fESD);
+ fCutsTOFProtons->SetEvent(fESD);
+
for(int tr1=0; tr1<nTracks; tr1++)
{
trackESD=fESD->GetTrack(tr1);
const AliExternalTrackParam* innerParam = t->GetInnerParam();
if (!innerParam) return;
Double_t pinTPCglobal=innerParam->GetP();
- Double_t tpcSignal =t ->GetTPCsignal();
+ Double_t tpcSignal =t->GetTPCsignal();
Float_t p=innerParam->P();
Float_t pt=innerParam->Pt();
Float_t sigPion = fESDpid->GetTPCResponse().GetExpectedSignal(pinTPCglobal, AliPID::kPion);
invbetadiff[i] = invbeta-invbetaHypothesis[i];
}
- /////////////simple cuts
- Bool_t isPion = ( (betadiff[2]<0.015) && (betadiff[2]>-0.015) &&
- (betadiff[3]>0.025) &&
- (betadiff[4]>0.03) );
-
- Bool_t isKaon = ( (betadiff[3]<0.015) && (betadiff[3]>-0.015) &&
- (betadiff[2]<-0.03) &&
- (betadiff[4]>0.03) );
-
- Bool_t isProton = ( (betadiff[4]<0.015) && (betadiff[4]>-0.015) &&
- (betadiff[3]<-0.025) &&
- (betadiff[2]<-0.025) );
-
- if (isPion) fTOFbetaAfterPionCuts1->Fill(p,beta);
- if (isKaon) fTOFbetaAfterKaonCuts1->Fill(p,beta);
- if (isProton) fTOFbetaAfterProtonCuts1->Fill(p,beta);
-
//responses
fTOFbeta->Fill(p,beta);
fTOFbetaE->Fill(p,betadiff[0]);
fTOFinvbetaK->Fill(p,invbetadiff[3]);
fTOFinvbetaP->Fill(p,invbetadiff[4]);
- if (fCutsTOFElectrons->PassesTOFbetaCut(track))
+ if (fCutsTOFElectrons->IsSelected(track))
{
fTOFbetaAfterElectronsCuts->Fill(p,beta);
fTOFbetaEafter->Fill(p,beta-betaHypothesis[0]);
}
}
}
- if (fCutsTOFPions->PassesTOFbetaCut(track))
+ if (fCutsTOFPions->IsSelected(track))
{
fTPCdedxAfterTOFpidPions->Fill(pinTPCglobal,tpcSignal);
fTOFbetaAfterPionCuts->Fill(p,beta);
}
}
}
- if (fCutsTOFKaons->PassesTOFbetaCut(track))
+ if (fCutsTOFKaons->IsSelected(track))
{
fTPCdedxAfterTOFpidKaons->Fill(pinTPCglobal,tpcSignal);
fTOFbetaAfterKaonCuts->Fill(p,beta);
}
}
}
- if (fCutsTOFProtons->PassesTOFbetaCut(track))
+ if (fCutsTOFProtons->IsSelected(track))
{
fTPCdedxAfterTOFpidProtons->Fill(pinTPCglobal,tpcSignal);
fTOFbetaAfterProtonCuts->Fill(p,beta);
if (!poiCuts->FillFlowTrack(pTrack)) continue;
pTrack->TagPOI();
}
-
- //store the index of the ESD track for AODs and ESDs
- //TODO: should be moved to AliFlowTrackCuts
- Int_t trackID = -1;
- AliVTrack *toGetfID = dynamic_cast<AliVTrack*> (particle);
- if (toGetfID) trackID = toGetfID->GetID();
- pTrack->SetID(trackID);
fNumberOfTracks++;
}//end of while (i < numberOfTracks)
}
if (!pTrack) continue;
pTrack->TagPOI();
}
-
- //store the index of the ESD track for AODs and ESDs
- //TODO: should be moved to AliFlowTrackCuts
- Int_t trackID = -1;
- AliVTrack *toGetfID = dynamic_cast<AliVTrack*> (particle);
- if (toGetfID) trackID = toGetfID->GetID();
- pTrack->SetID(trackID);
-
AddTrack(pTrack);
}//end of while (i < numberOfTracks)
}
#include <limits.h>
#include <float.h>
+#include <TList.h>
+#include <TH1F.h>
+#include <TBrowser.h>
#include "TMath.h"
#include "TNamed.h"
#include "AliVVertex.h"
//-----------------------------------------------------------------------
AliFlowEventCuts::AliFlowEventCuts():
TNamed(),
+ fQA(NULL),
fCutNumberOfTracks(kFALSE),
fNumberOfTracksMax(INT_MAX),
fNumberOfTracksMin(INT_MIN),
//-----------------------------------------------------------------------
AliFlowEventCuts::AliFlowEventCuts(const char* name, const char* title):
TNamed(name, title),
+ fQA(NULL),
fCutNumberOfTracks(kFALSE),
fNumberOfTracksMax(INT_MAX),
fNumberOfTracksMin(INT_MIN),
////-----------------------------------------------------------------------
AliFlowEventCuts::AliFlowEventCuts(const AliFlowEventCuts& that):
TNamed(that),
+ fQA(NULL),
fCutNumberOfTracks(that.fCutNumberOfTracks),
fNumberOfTracksMax(that.fNumberOfTracksMax),
fNumberOfTracksMin(that.fNumberOfTracksMin),
fCutZDCtiming(that.fCutZDCtiming),
fTrigAna()
{
+ if (that.fQA) DefineHistograms();
//copy constructor
if (that.fRefMultCuts)
fRefMultCuts = new AliFlowTrackCuts(*(that.fRefMultCuts));
//dtor
delete fMeanPtCuts;
delete fRefMultCuts;
+ if (fQA) { fQA->SetOwner(); fQA->Delete(); delete fQA; }
}
////-----------------------------------------------------------------------
//assignment
if (this==&that) return *this;
+ if (that.fQA)
+ {
+ if (fQA)
+ {
+ fQA->Delete();
+ delete fQA;
+ }
+ fQA = static_cast<TList*>(that.fQA->Clone());
+ }
+ else
+ {
+ fQA->Delete();
+ delete fQA;
+ fQA=NULL;
+ }
+
fCutNumberOfTracks=that.fCutNumberOfTracks;
fNumberOfTracksMax=that.fNumberOfTracksMax;
fNumberOfTracksMin=that.fNumberOfTracksMin;
if (fCutPrimaryVertexZ)
{
if (pvtxz < fPrimaryVertexZmin || pvtxz >= fPrimaryVertexZmax)
+ {
return kFALSE;
+ }
}
if (fCutTPCmultiplicityOutliers)
{
}
return refmult;
}
+//_____________________________________________________________________________
+void AliFlowEventCuts::DefineHistograms()
+{
+ Bool_t adddirstatus = TH1::AddDirectoryStatus();
+ TH1::AddDirectory(kFALSE);
+ if (!fQA) fQA = new TList();
+ fQA->SetName(Form("%s QA",GetName()));
+ TList* before = new TList();
+ before->SetName("before");
+ TList* after = new TList();
+ after->SetName("after");
+ fQA->Add(before);
+ fQA->Add(after);
+ before->Add(new TH1F("zvertex",";z;event cout",500,-15.,15.));
+ after->Add(new TH1F("zvertex",";z;event cout",500,-15.,15.));
+ TH1::AddDirectory(adddirstatus);
+}
+
+//---------------------------------------------------------------//
+void AliFlowEventCuts::Browse(TBrowser* b)
+{
+ //some browsing capabilities
+ if (fQA) b->Add(fQA);
+}
+
+//---------------------------------------------------------------//
+Long64_t AliFlowEventCuts::Merge(TCollection* list)
+{
+ //merge
+ Int_t number=0;
+ AliFlowEventCuts* obj;
+ if (!list) return 0;
+ if (list->GetEntries()<1) return 0;
+ TIter next(list);
+ while ( (obj = dynamic_cast<AliFlowEventCuts*>(next())) )
+ {
+ if (obj==this) continue;
+ TList listwrapper;
+ listwrapper.Add(obj->GetQA());
+ fQA->Merge(&listwrapper);
+ number++;
+ }
+ return number;
+}
+
#include "TNamed.h"
class AliVEvent;
+class TBrowser;
+#include "TList.h"
+#include "TH1.h"
#include "AliTriggerAnalysis.h"
#include "AliFlowTrackCuts.h"
void SetRefMultCuts( AliFlowTrackCuts* cuts ) {fRefMultCuts=static_cast<AliFlowTrackCuts*>(cuts->Clone());}
void SetMeanPtCuts( AliFlowTrackCuts* cuts ) {fMeanPtCuts=static_cast<AliFlowTrackCuts*>(cuts->Clone());}
AliFlowTrackCuts* GetRefMultCuts() const {return fRefMultCuts;}
+ void DefineHistograms();
+ void SetQA() {DefineHistograms();}
+ TList* GetQA() const {return fQA;}
+ TH1* QAbefore(Int_t i) {return static_cast<TH1*>(static_cast<TList*>(fQA->At(0))->At(i));}
+ TH1* QAafter(Int_t i) {return static_cast<TH1*>(static_cast<TList*>(fQA->At(1))->At(i));}
Int_t RefMult(AliVEvent* event);
//Int_t GetRefMult() {return fRefMult;}
fCutCentralityPercentile=kTRUE; }
void SetCentralityPercentileMethod( refMultMethod m) {fCentralityPercentileMethod=m;}
void SetUseCentralityUnchecked(Bool_t b=kTRUE) {fUseCentralityUnchecked=b;}
+
+ void Browse(TBrowser* b);
+ Long64_t Merge(TCollection* list);
private:
+ TList* fQA; //QA
Bool_t fCutNumberOfTracks;//cut on # of tracks
Int_t fNumberOfTracksMax; //limits
Int_t fNumberOfTracksMin; //limits
Bool_t fCutZDCtiming; //cut on ZDC timing
AliTriggerAnalysis fTrigAna; //trigger analysis object
- ClassDef(AliFlowEventCuts,2)
+ ClassDef(AliFlowEventCuts,3)
};
#endif
#include <TMatrix.h>
#include "TParticle.h"
#include "TH2F.h"
-#include "TObjArray.h"
#include "AliStack.h"
+#include "TBrowser.h"
#include "AliMCEvent.h"
#include "AliESDEvent.h"
#include "AliVParticle.h"
fTPCpidCuts(NULL),
fTOFpidCuts(NULL),
fParticleID(AliPID::kPion),
- fParticleProbability(.9)
+ fParticleProbability(.9),
+ fAllowTOFmismatch(kFALSE)
{
//io constructor
for ( Int_t i=0; i<5; i++ ) { fProbBayes[i]=0.0; }
fTPCpidCuts(NULL),
fTOFpidCuts(NULL),
fParticleID(AliPID::kPion),
- fParticleProbability(.9)
+ fParticleProbability(.9),
+ fAllowTOFmismatch(kFALSE)
{
//constructor
SetName(name);
fTPCpidCuts(NULL),
fTOFpidCuts(NULL),
fParticleID(that.fParticleID),
- fParticleProbability(that.fParticleProbability)
+ fParticleProbability(that.fParticleProbability),
+ fAllowTOFmismatch(that.fAllowTOFmismatch)
{
//copy constructor
if (that.fTPCpidCuts) fTPCpidCuts = new TMatrixF(*(that.fTPCpidCuts));
fParticleID=that.fParticleID;
fParticleProbability=that.fParticleProbability;
+ fAllowTOFmismatch=that.fAllowTOFmismatch;
memcpy(fProbBayes,that.fProbBayes,sizeof(fProbBayes));
return *this;
delete fAliESDtrackCuts;
delete fTPCpidCuts;
delete fTOFpidCuts;
+ if (fQA) { fQA->SetOwner(); fQA->Delete(); delete fQA; }
}
//-----------------------------------------------------------------------
{
//check cuts on ESD tracks
Bool_t pass=kTRUE;
+ const AliExternalTrackParam* pout = track->GetOuterParam();
+ const AliExternalTrackParam* pin = track->GetInnerParam();
if (fIgnoreTPCzRange)
{
- const AliExternalTrackParam* pin = track->GetOuterParam();
- const AliExternalTrackParam* pout = track->GetInnerParam();
if (pin&&pout)
{
Double_t zin = pin->GetZ();
if (!fAliESDtrackCuts->IsSelected(track)) pass=kFALSE;
}
+ Double_t beta = GetBeta(track);
+ Double_t dedx = Getdedx(track);
+ if (fQA)
+ {
+ if (pass) QAbefore(0)->Fill(track->GetP(),beta);
+ if (pass) QAbefore(1)->Fill(pin->GetP(),dedx);
+ }
if (fCutPID)
{
switch (fPIDsource)
break;
}
}
+ if (fQA)
+ {
+ if (pass) QAafter(0)->Fill(track->GetP(),beta);
+ if (pass) QAafter(1)->Fill(pin->GetP(),dedx);
+ }
return pass;
}
flowtrack->Set(fTrack);
break;
}
- if (fParamType==kMC) flowtrack->SetSource(AliFlowTrack::kFromMC);
- else if (dynamic_cast<AliESDtrack*>(fTrack)) flowtrack->SetSource(AliFlowTrack::kFromESD);
- else if (dynamic_cast<AliAODTrack*>(fTrack)) flowtrack->SetSource(AliFlowTrack::kFromAOD);
- else if (dynamic_cast<AliMCParticle*>(fTrack)) flowtrack->SetSource(AliFlowTrack::kFromMC);
+ if (fParamType==kMC)
+ {
+ flowtrack->SetSource(AliFlowTrack::kFromMC);
+ flowtrack->SetID(fTrack->GetLabel());
+ }
+ else if (dynamic_cast<AliESDtrack*>(fTrack))
+ {
+ flowtrack->SetSource(AliFlowTrack::kFromESD);
+ flowtrack->SetID(static_cast<AliVTrack*>(fTrack)->GetID());
+ }
+ else if (dynamic_cast<AliAODTrack*>(fTrack))
+ {
+ flowtrack->SetSource(AliFlowTrack::kFromAOD);
+ flowtrack->SetID(static_cast<AliVTrack*>(fTrack)->GetID());
+ }
+ else if (dynamic_cast<AliMCParticle*>(fTrack))
+ {
+ flowtrack->SetSource(AliFlowTrack::kFromMC);
+ flowtrack->SetID(static_cast<AliVTrack*>(fTrack)->GetID());
+ }
return kTRUE;
}
flowtrack = new AliFlowTrack(fTrack);
break;
}
- if (fParamType==kMC) flowtrack->SetSource(AliFlowTrack::kFromMC);
- else if (dynamic_cast<AliESDtrack*>(fTrack)) flowtrack->SetSource(AliFlowTrack::kFromESD);
- else if (dynamic_cast<AliAODTrack*>(fTrack)) flowtrack->SetSource(AliFlowTrack::kFromAOD);
- else if (dynamic_cast<AliMCParticle*>(fTrack)) flowtrack->SetSource(AliFlowTrack::kFromMC);
+ if (fParamType==kMC)
+ {
+ flowtrack->SetSource(AliFlowTrack::kFromMC);
+ flowtrack->SetID(fTrack->GetLabel());
+ }
+ else if (dynamic_cast<AliESDtrack*>(fTrack))
+ {
+ flowtrack->SetSource(AliFlowTrack::kFromESD);
+ flowtrack->SetID(static_cast<AliVTrack*>(fTrack)->GetID());
+ }
+ else if (dynamic_cast<AliAODTrack*>(fTrack))
+ {
+ flowtrack->SetSource(AliFlowTrack::kFromAOD);
+ flowtrack->SetID(static_cast<AliVTrack*>(fTrack)->GetID());
+ }
+ else if (dynamic_cast<AliMCParticle*>(fTrack))
+ {
+ flowtrack->SetSource(AliFlowTrack::kFromMC);
+ flowtrack->SetID(static_cast<AliVTrack*>(fTrack)->GetID());
+ }
return flowtrack;
}
//define qa histograms
if (fQA) return;
- Int_t kPBins=60;
- Double_t binsPDummy[kPBins+1];
- binsPDummy[0]=0.0;
- for(int i=1; i<=kPBins+1; i++)
+ Int_t kNbinsP=60;
+ Double_t binsP[kNbinsP+1];
+ binsP[0]=0.0;
+ for(int i=1; i<=kNbinsP+1; i++)
{
- if(binsPDummy[i-1]+0.05<1.01)
- binsPDummy[i]=binsPDummy[i-1]+0.05;
+ if(binsP[i-1]+0.05<1.01)
+ binsP[i]=binsP[i-1]+0.05;
else
- binsPDummy[i]=binsPDummy[i-1]+0.1;
+ binsP[i]=binsP[i-1]+0.1;
}
- fQA=new TObjArray(4);
- fQA->Add(new TH2F("after TOFpidQA betadiffVSp",";p;#beta-#beta_{particle}",100,0,5,500,-0.25,0.25));
- fQA->Add(new TH2F("after TOFpidQA betaVSp",";p;#beta",kPBins,binsPDummy,1000,0.4,1.1));
- fQA->Add(new TH2F("before TOFpidQA betadiffVSp",";p;#beta-#beta_{particle}",100,0,5,500,-0.25,0.25));
- fQA->Add(new TH2F("before TOFpidQA betaVSp",";p;#beta",kPBins,binsPDummy,1000,0.4,1.1));
+ Bool_t adddirstatus = TH1::AddDirectoryStatus();
+ TH1::AddDirectory(kFALSE);
+ fQA=new TList();
+ fQA->SetOwner();
+ fQA->SetName(Form("%s QA",GetName()));
+ TList* before = new TList();
+ before->SetOwner();
+ before->SetName("before");
+ TList* after = new TList();
+ after->SetOwner();
+ after->SetName("after");
+ fQA->Add(before);
+ fQA->Add(after);
+ before->Add(new TH2F("TOFbeta",";p [GeV/c];#beta",kNbinsP,binsP,1000,0.4,1.1));
+ after->Add(new TH2F("TOFbeta",";p [GeV/c];#beta",kNbinsP,binsP,1000,0.4,1.1));
+ before->Add(new TH2F("TPCdedx",";p [GeV/c];dEdx",kNbinsP,binsP,500,0,500));
+ after->Add(new TH2F("TPCdedx",";p [GeV/c];dEdx",kNbinsP,binsP,500,0,500));
+ TH1::AddDirectory(adddirstatus);
}
//-----------------------------------------------------------------------
(track->GetStatus() & AliESDtrack::kTOFpid) &&
(track->GetTOFsignal() > 12000) &&
(track->GetTOFsignal() < 100000) &&
- (track->GetIntegratedLength() > 365) &&
- !(track->GetStatus() & AliESDtrack::kTOFmismatch);
+ (track->GetIntegratedLength() > 365);
+
+ if ((track->GetStatus() & AliESDtrack::kTOFmismatch) && !fAllowTOFmismatch) return kFALSE;
if (!goodtrack) return kFALSE;
(s[2]<-0.03) &&
(s[4]>0.03) );
case AliPID::kProton:
- return ( (s[4]<0.015) && (s[2]>-0.015) &&
+ return ( (s[4]<0.015) && (s[4]>-0.015) &&
(s[3]<-0.025) &&
(s[2]<-0.025) );
default:
return kFALSE;
}
+//-----------------------------------------------------------------------
+Float_t AliFlowTrackCuts::GetBeta(const AliESDtrack* track)
+{
+ //get beta
+ const Float_t c = 2.99792457999999984e-02;
+ Float_t p = track->GetP();
+ Float_t l = track->GetIntegratedLength();
+ Float_t trackT0 = fESDpid.GetTOFResponse().GetStartTime(p);
+ Float_t timeTOF = track->GetTOFsignal()- trackT0;
+ return l/timeTOF/c;
+}
+
//-----------------------------------------------------------------------
Bool_t AliFlowTrackCuts::PassesTOFbetaCut(const AliESDtrack* track )
{
(track->GetStatus() & AliESDtrack::kTOFpid) &&
(track->GetTOFsignal() > 12000) &&
(track->GetTOFsignal() < 100000) &&
- (track->GetIntegratedLength() > 365) &&
- !(track->GetStatus() & AliESDtrack::kTOFmismatch);
+ (track->GetIntegratedLength() > 365);
+
+ if ((track->GetStatus() & AliESDtrack::kTOFmismatch) && !fAllowTOFmismatch) return kFALSE;
if (!goodtrack) return kFALSE;
- const Float_t c = 2.99792457999999984e-02;
- Float_t p = track->GetP();
- Float_t l = track->GetIntegratedLength();
- Float_t trackT0 = fESDpid.GetTOFResponse().GetStartTime(p);
- Float_t timeTOF = track->GetTOFsignal()- trackT0;
- Float_t beta = l/timeTOF/c;
+ Float_t beta = GetBeta(track);
+
Double_t integratedTimes[5] = {-1.0,-1.0,-1.0,-1.0,-1.0};
track->GetIntegratedTimes(integratedTimes);
}
//signal to cut on
+ const Float_t c = 2.99792457999999984e-02;
+ Float_t l = track->GetIntegratedLength();
+ Float_t p = track->GetP();
Float_t betahypothesis = l/integratedTimes[pid]/c;
Float_t betadiff = beta-betahypothesis;
Bool_t pass = (betadiff>min && betadiff<max);
- if (fQA)
- {
- TH2F* qahistbetadiff = static_cast<TH2F*>(fQA->At(0));
- TH2F* qahistbeta = static_cast<TH2F*>(fQA->At(1));
- TH2F* qahistbetadiffbefore = static_cast<TH2F*>(fQA->At(2));
- TH2F* qahistbetabefore = static_cast<TH2F*>(fQA->At(3));
- if (pass&&qahistbetadiff) qahistbetadiff->Fill(p,betadiff);
- if (pass&&qahistbeta) qahistbeta->Fill(p,beta);
- if (qahistbetadiffbefore) qahistbetadiffbefore->Fill(p,betadiff);
- if (qahistbetabefore) qahistbetabefore->Fill(p,beta);
- }
-
return pass;
}
return kFALSE;
}
+//-----------------------------------------------------------------------
+Float_t AliFlowTrackCuts::Getdedx(const AliESDtrack* track)
+{
+ //get TPC dedx
+ return track->GetTPCsignal();
+}
+
//-----------------------------------------------------------------------
Bool_t AliFlowTrackCuts::PassesTPCdedxCut(const AliESDtrack* track)
{
phi = phi*3.14159/180.;
return phi;
}
+
+//---------------------------------------------------------------//
+void AliFlowTrackCuts::Browse(TBrowser* b)
+{
+ //some browsing capabilities
+ if (fQA) b->Add(fQA);
+}
+
//---------------------------------------------------------------//
+Long64_t AliFlowTrackCuts::Merge(TCollection* list)
+{
+ //merge
+ Int_t number=0;
+ AliFlowTrackCuts* obj;
+ if (!list) return 0;
+ if (list->GetEntries()<1) return 0;
+ TIter next(list);
+ while ( (obj = dynamic_cast<AliFlowTrackCuts*>(next())) )
+ {
+ if (obj==this) continue;
+ TList listwrapper;
+ listwrapper.Add(obj->GetQA());
+ fQA->Merge(&listwrapper);
+ number++;
+ }
+ return number;
+}
#define ALIFLOWTRACKCUTS_H
#include <TMatrix.h>
+#include <TList.h>
#include "AliFlowTrackSimpleCuts.h"
#include "AliESDtrackCuts.h"
#include "TMCProcess.h"
#include "AliPID.h"
#include "AliESDpid.h"
-class TObjArray;
+class TBrowser;
class AliVParticle;
class AliMCParticle;
class AliFlowTrack;
Double_t GetMinimalTPCdedx() const {return fMinimalTPCdedx;}
Int_t GetPmdDetPlane()const {return fPmdDet; }
Float_t GetPmdAdc()const {return fPmdAdc;}
- Float_t GetPmdNcell() const {return fPmdNcell; }
+ Float_t GetPmdNcell() const {return fPmdNcell; }
+ Float_t GetBeta(const AliESDtrack* t);
+ Float_t Getdedx(const AliESDtrack* t);
void SetQA() {DefineHistograms();}
- TObjArray* GetQA() const {return fQA;}
+ TList* GetQA() const {return fQA;}
+ TH1* QAbefore(Int_t i) {return static_cast<TH1*>(static_cast<TList*>(fQA->At(0))->At(i));}
+ TH1* QAafter(Int_t i) {return static_cast<TH1*>(static_cast<TList*>(fQA->At(1))->At(i));}
//MC stuff
void SetCutMC( Bool_t b=kTRUE );
void SetTOFpidCuts(TMatrixF* mat) {fTOFpidCuts=new TMatrixF(*mat);}
static const char* PIDsourceName(PIDsource s);
AliESDpid& GetESDpid() {return fESDpid;}
+ void SetAllowTOFmismatch(Bool_t b=kTRUE) {fAllowTOFmismatch=b;}
+ Bool_t GetAllowTOFmismatch() const {return fAllowTOFmismatch;}
//these should maybe be protected
Bool_t PassesCuts(AliVParticle* track);
Bool_t PassesTOFbetaSimpleCut(const AliESDtrack* track);
Bool_t PassesTOFpidCut(const AliESDtrack* track) const;
+ void Browse(TBrowser* b);
+ Long64_t Merge(TCollection* list);
+
protected:
AliFlowTrack* MakeFlowTrackSPDtracklet() const;
AliFlowTrack* MakeFlowTrackPMDtrack() const;
//the cuts
AliESDtrackCuts* fAliESDtrackCuts; //alianalysis cuts
- TObjArray* fQA; //qa histograms go here
+ TList* fQA; //qa histograms go here
Bool_t fCutMC; //do we cut on MC?
Bool_t fCutMCprocessType; //do we cut on mc process type?
TMCProcess fMCprocessType; //mc process type
TMatrixF* fTOFpidCuts; //tof pid cuts
AliPID::EParticleType fParticleID; //alipid
Double_t fParticleProbability; //desired prob for a particle type
+ Bool_t fAllowTOFmismatch; //allow TPC mismatch
// part added by F. Noferini
static const Int_t fgkPIDptBin = 20; // pT bins for priors
static const Int_t fgkNumberOfV0tracks=64; //number of V0 channels
- ClassDef(AliFlowTrackCuts,6)
+ ClassDef(AliFlowTrackCuts,7)
};
#endif
// use physics selection class
Bool_t UsePhysicsSelection = kTRUE;
-// QA
+// separate QA task
Bool_t runQAtask=kFALSE;
Bool_t FillQAntuple=kFALSE;
Bool_t DoQAcorrelations=kFALSE;
Float_t centrMax=100.,
TString fileNameBase="AnalysisResults" )
{
- TString centralityName("");
- centralityName+=Form("%.0f",centrMin);
- centralityName+="-";
- centralityName+=Form("%.0f",centrMax);
-
TString fileName(fileNameBase);
fileName.Append(".root");
//===========================================================================
//cutsEvent->SetUseCentralityUnchecked();
// RP TRACK CUTS:
- AliFlowTrackCuts* cutsRP = new AliFlowTrackCuts("rp cuts");
+ AliFlowTrackCuts* cutsRP = new AliFlowTrackCuts("GlobalRP");
cutsRP->SetParamType(rptype);
cutsRP->SetParamMix(rpmix);
cutsRP->SetPtRange(0.2,5.);
cutsRP->SetMinimalTPCdedx(10.);
// POI TRACK CUTS:
- AliFlowTrackCuts* cutsPOI = new AliFlowTrackCuts("poi cuts");
+ AliFlowTrackCuts* cutsPOI = new AliFlowTrackCuts("GlobalPOI");
cutsPOI->SetParamType(poitype);
cutsPOI->SetParamMix(poimix);
cutsPOI->SetPtRange(0.0,10.);
//cutsPOI->SetPID(AliPID::kPion, AliFlowTrackCuts::kTPCpid);
//cutsPOI->SetPID(AliPID::kProton, AliFlowTrackCuts::kTPCdedx);
//cutsPOI->SetPID(AliPID::kProton, AliFlowTrackCuts::kTOFbeta);
+ //cutsPOI->SetAllowTOFmismatch(kFALSE);
//iexample: francesco's tunig TPC Bethe Bloch for data:
//cutsPOI->GetESDpid().GetTPCResponse().SetBetheBlochParameters(4.36414e-02,1.75977e+01,1.14385e-08,2.27907e+00,3.36699e+00);
//cutsPOI->GetESDpid().GetTPCResponse().SetMip(49);
+ TString outputSlotName("");
+ outputSlotName+=Form("%.0f",centrMin);
+ outputSlotName+="-";
+ outputSlotName+=Form("%.0f",centrMax);
+ outputSlotName+=" ";
+ outputSlotName+=cutsRP->GetName()
+
Bool_t useWeights = WEIGHTS[0] || WEIGHTS[1] || WEIGHTS[2];
if (useWeights) cout<<"Weights are used"<<endl;
else cout<<"Weights are not used"<<endl;
break;
}
else {
- TList* fInputListLYZ2SUM = (TList*)fInputFileLYZ2SUM->Get("cobjLYZ1SUM");
+ TList* fInputListLYZ2SUM = (TList*)fInputFileLYZ2SUM->Get("LYZ1SUM");
if (!fInputListLYZ2SUM) {cout<<"list is NULL pointer!"<<endl;}
}
cout<<"LYZ2SUM input file/list read..."<<endl;
break;
}
else {
- TList* fInputListLYZ2PROD = (TList*)fInputFileLYZ2PROD->Get("cobjLYZ1PROD");
+ TList* fInputListLYZ2PROD = (TList*)fInputFileLYZ2PROD->Get("LYZ1PROD");
if (!fInputListLYZ2PROD) {cout<<"list is NULL pointer!"<<endl;}
}
cout<<"LYZ2PROD input file/list read..."<<endl;
break;
}
else {
- TList* fInputListLYZEP = (TList*)fInputFileLYZEP->Get("cobjLYZ2SUM");
+ TList* fInputListLYZEP = (TList*)fInputFileLYZEP->Get("LYZ2SUM");
if (!fInputListLYZEP) {cout<<"list is NULL pointer!"<<endl;}
}
cout<<"LYZEP input file/list read..."<<endl;
if (rptypestr == "FMD") {
AliAnalysisDataContainer *coutputFMD =
- mgr->CreateContainer(Form("BackgroundCorrected_%s",centralityName.Data()), TList::Class(), AliAnalysisManager::kExchangeContainer);
+ mgr->CreateContainer(Form("BackgroundCorrected_%s",outputSlotName.Data()), TList::Class(), AliAnalysisManager::kExchangeContainer);
//input and output taskFMD
mgr->ConnectInput(taskfmd, 0, cinput1);
mgr->ConnectOutput(taskfmd, 1, coutputFMD);
}
AliAnalysisDataContainer *coutputFE =
- mgr->CreateContainer(Form("cobjFlowEventSimple_%s",centralityName.Data()),AliFlowEventSimple::Class(),AliAnalysisManager::kExchangeContainer);
+ mgr->CreateContainer(Form("FlowEventSimple_%s",outputSlotName.Data()),AliFlowEventSimple::Class(),AliAnalysisManager::kExchangeContainer);
mgr->ConnectInput(taskFE,0,cinput1);
mgr->ConnectOutput(taskFE,1,coutputFE);
-
+
+ if (taskFE->GetQAon())
+ {
+ AliAnalysisDataContainer* coutputFEQA =
+ mgr->CreateContainer(Form("QA %s",outputSlotName.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s:QA %s",fileName,rptypestr));
+ mgr->ConnectOutput(taskFE,2,coutputFEQA);
+ }
// Create the output containers for the data produced by the analysis tasks
// Connect to the input and output containers
//===========================================================================
if (useWeights) {
- AliAnalysisDataContainer *cinputWeights = mgr->CreateContainer(Form("cobjWeights_%s",centralityName.Data()),
+ AliAnalysisDataContainer *cinputWeights = mgr->CreateContainer(Form("Weights_%s",outputSlotName.Data()),
TList::Class(),AliAnalysisManager::kInputContainer);
}
TString outputSP = fileName;
outputSP += ":outputSPanalysis";
outputSP+= rptypestr;
- AliAnalysisDataContainer *coutputSP = mgr->CreateContainer(Form("cobjSP_%s",centralityName.Data()),
+ AliAnalysisDataContainer *coutputSP = mgr->CreateContainer(Form("SP_%s",outputSlotName.Data()),
TList::Class(),AliAnalysisManager::kOutputContainer,outputSP);
mgr->ConnectInput(taskSP,0,coutputFE);
mgr->ConnectOutput(taskSP,1,coutputSP);
TString outputLYZ1SUM = fileName;
outputLYZ1SUM += ":outputLYZ1SUManalysis";
outputLYZ1SUM+= rptypestr;
- AliAnalysisDataContainer *coutputLYZ1SUM = mgr->CreateContainer(Form("cobjLYZ1SUM_%s",centralityName.Data()),
+ AliAnalysisDataContainer *coutputLYZ1SUM = mgr->CreateContainer(Form("LYZ1SUM_%s",outputSlotName.Data()),
TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ1SUM);
mgr->ConnectInput(taskLYZ1SUM,0,coutputFE);
mgr->ConnectOutput(taskLYZ1SUM,1,coutputLYZ1SUM);
TString outputLYZ1PROD = fileName;
outputLYZ1PROD += ":outputLYZ1PRODanalysis";
outputLYZ1PROD+= rptypestr;
- AliAnalysisDataContainer *coutputLYZ1PROD = mgr->CreateContainer(Form("cobjLYZ1PROD_%s",centralityName.Data()),
+ AliAnalysisDataContainer *coutputLYZ1PROD = mgr->CreateContainer(Form("LYZ1PROD_%s",outputSlotName.Data()),
TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ1PROD);
mgr->ConnectInput(taskLYZ1PROD,0,coutputFE);
mgr->ConnectOutput(taskLYZ1PROD,1,coutputLYZ1PROD);
}
if(LYZ2SUM) {
- AliAnalysisDataContainer *cinputLYZ2SUM = mgr->CreateContainer(Form("cobjLYZ2SUMin_%s",centralityName.Data()),
+ AliAnalysisDataContainer *cinputLYZ2SUM = mgr->CreateContainer(Form("LYZ2SUMin_%s",outputSlotName.Data()),
TList::Class(),AliAnalysisManager::kInputContainer);
TString outputLYZ2SUM = fileName;
outputLYZ2SUM += ":outputLYZ2SUManalysis";
outputLYZ2SUM+= rptypestr;
- AliAnalysisDataContainer *coutputLYZ2SUM = mgr->CreateContainer(Form("cobjLYZ2SUM_%s",centralityName.Data()),
+ AliAnalysisDataContainer *coutputLYZ2SUM = mgr->CreateContainer(Form("LYZ2SUM_%s",outputSlotName.Data()),
TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ2SUM);
mgr->ConnectInput(taskLYZ2SUM,0,coutputFE);
mgr->ConnectInput(taskLYZ2SUM,1,cinputLYZ2SUM);
cinputLYZ2SUM->SetData(fInputListLYZ2SUM);
}
if(LYZ2PROD) {
- AliAnalysisDataContainer *cinputLYZ2PROD = mgr->CreateContainer(Form("cobjLYZ2PRODin_%s",centralityName.Data()),
+ AliAnalysisDataContainer *cinputLYZ2PROD = mgr->CreateContainer(Form("LYZ2PRODin_%s",outputSlotName.Data()),
TList::Class(),AliAnalysisManager::kInputContainer);
TString outputLYZ2PROD = fileName;
outputLYZ2PROD += ":outputLYZ2PRODanalysis";
outputLYZ2PROD+= rptypestr;
- AliAnalysisDataContainer *coutputLYZ2PROD = mgr->CreateContainer(Form("cobjLYZ2PROD_%s",centralityName.Data()),
+ AliAnalysisDataContainer *coutputLYZ2PROD = mgr->CreateContainer(Form("LYZ2PROD_%s",outputSlotName.Data()),
TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ2PROD);
mgr->ConnectInput(taskLYZ2PROD,0,coutputFE);
mgr->ConnectInput(taskLYZ2PROD,1,cinputLYZ2PROD);
cinputLYZ2PROD->SetData(fInputListLYZ2PROD);
}
if(LYZEP) {
- AliAnalysisDataContainer *cinputLYZEP = mgr->CreateContainer(Form("cobjLYZEPin_%s",centralityName.Data()),
+ AliAnalysisDataContainer *cinputLYZEP = mgr->CreateContainer(Form("LYZEPin_%s",outputSlotName.Data()),
TList::Class(),AliAnalysisManager::kInputContainer);
TString outputLYZEP = fileName;
outputLYZEP += ":outputLYZEPanalysis";
outputLYZEP+= rptypestr;
- AliAnalysisDataContainer *coutputLYZEP = mgr->CreateContainer(Form("cobjLYZEP_%s",centralityName.Data()),
+ AliAnalysisDataContainer *coutputLYZEP = mgr->CreateContainer(Form("LYZEP_%s",outputSlotName.Data()),
TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZEP);
mgr->ConnectInput(taskLYZEP,0,coutputFE);
mgr->ConnectInput(taskLYZEP,1,cinputLYZEP);
outputGFC += ":outputGFCanalysis";
outputGFC+= rptypestr;
- AliAnalysisDataContainer *coutputGFC = mgr->CreateContainer(Form("cobjGFC_%s",centralityName.Data()),
+ AliAnalysisDataContainer *coutputGFC = mgr->CreateContainer(Form("GFC_%s",outputSlotName.Data()),
TList::Class(),AliAnalysisManager::kOutputContainer,outputGFC);
mgr->ConnectInput(taskGFC,0,coutputFE);
mgr->ConnectOutput(taskGFC,1,coutputGFC);
outputQC += ":outputQCanalysis";
outputQC+= rptypestr;
- AliAnalysisDataContainer *coutputQC = mgr->CreateContainer(Form("cobjQC_%s",centralityName.Data()),
+ AliAnalysisDataContainer *coutputQC = mgr->CreateContainer(Form("QC_%s",outputSlotName.Data()),
TList::Class(),AliAnalysisManager::kOutputContainer,outputQC);
mgr->ConnectInput(taskQC,0,coutputFE);
mgr->ConnectOutput(taskQC,1,coutputQC);
outputFQD += ":outputFQDanalysis";
outputFQD+= rptypestr;
- AliAnalysisDataContainer *coutputFQD = mgr->CreateContainer(Form("cobjFQD_%s",centralityName.Data()),
+ AliAnalysisDataContainer *coutputFQD = mgr->CreateContainer(Form("FQD_%s",outputSlotName.Data()),
TList::Class(),AliAnalysisManager::kOutputContainer,outputFQD);
mgr->ConnectInput(taskFQD,0,coutputFE);
mgr->ConnectOutput(taskFQD,1,coutputFQD);
outputMCEP += ":outputMCEPanalysis";
outputMCEP+= rptypestr;
- AliAnalysisDataContainer *coutputMCEP = mgr->CreateContainer(Form("cobjMCEP_%s",centralityName.Data()),
+ AliAnalysisDataContainer *coutputMCEP = mgr->CreateContainer(Form("MCEP_%s",outputSlotName.Data()),
TList::Class(),AliAnalysisManager::kOutputContainer,outputMCEP);
mgr->ConnectInput(taskMCEP,0,coutputFE);
mgr->ConnectOutput(taskMCEP,1,coutputMCEP);
outputMH += ":outputMHanalysis";
outputMH += rptypestr;
- AliAnalysisDataContainer *coutputMH = mgr->CreateContainer(Form("cobjMH_%s",centralityName.Data()),
+ AliAnalysisDataContainer *coutputMH = mgr->CreateContainer(Form("MH_%s",outputSlotName.Data()),
TList::Class(),AliAnalysisManager::kOutputContainer,outputMH);
mgr->ConnectInput(taskMH,0,coutputFE);
mgr->ConnectOutput(taskMH,1,coutputMH);
outputNL += ":outputNLanalysis";
outputNL += rptypestr;
- AliAnalysisDataContainer *coutputNL = mgr->CreateContainer(Form("cobjNL_%s",centralityName.Data()),
+ AliAnalysisDataContainer *coutputNL = mgr->CreateContainer(Form("NL_%s",outputSlotName.Data()),
TList::Class(),AliAnalysisManager::kOutputContainer,outputNL);
mgr->ConnectInput(taskNL,0,coutputFE);
mgr->ConnectOutput(taskNL,1,coutputNL);
taskQAflow->SetDoCorrelations(DoQAcorrelations);
mgr->AddTask(taskQAflow);
- Printf("centralityName %s",centralityName.Data());
+ Printf("outputSlotName %s",outputSlotName.Data());
TString taskQAoutputFileName(fileNameBase);
taskQAoutputFileName.Append("_QA.root");
- AliAnalysisDataContainer* coutputQAtask = mgr->CreateContainer(Form("flowQA_%s",centralityName.Data()),
+ AliAnalysisDataContainer* coutputQAtask = mgr->CreateContainer(Form("flowQA_%s",outputSlotName.Data()),
TObjArray::Class(),
AliAnalysisManager::kOutputContainer,
taskQAoutputFileName);
- AliAnalysisDataContainer* coutputQAtaskTree = mgr->CreateContainer(Form("flowQAntuple_%s",centralityName.Data()),
+ AliAnalysisDataContainer* coutputQAtaskTree = mgr->CreateContainer(Form("flowQAntuple_%s",outputSlotName.Data()),
TNtuple::Class(),
AliAnalysisManager::kOutputContainer,
taskQAoutputFileName);
// effects in QC code because by default this correction is switched off).
// Name of the merged, large statistics file obtained with the merging macros:
-TString mergedFileName = "outputCentralityTrain.root";
+TString mergedFileName = "output.root";
// Final output file name holding correct final results for large statistics sample:
TString outputFileName = "AnalysisResults.root";
-// Methods for which the flow analysis will be redone:
-const Int_t nMethods = 12;
-TString method[nMethods] = {"MCEP","SP","GFC","QC","FQD","LYZ1SUM","LYZ1PROD","LYZ2SUM","LYZ2PROD","LYZEP","MH","NL"};
-// Methods for which some settings can be modified before redoing Finish():
-// QC:
+
Bool_t bApplyCorrectionForNUA = kFALSE; // apply correction for non-uniform acceptance
Bool_t bApplyCorrectionForNUAVsM = kFALSE; // apply correction for non-uniform acceptance in each multiplicity bin independently
Bool_t bPropagateErrorAlsoFromNIT = kFALSE; // propagate error also from non-isotropic terms
Bool_t bMinimumBiasReferenceFlow = kTRUE; // store in CRH for reference flow the result obtained wihout rebinning in multiplicity (kTRUE)
-enum libModes {mLocal,mLocalSource};
-
-void redoFinish(TString type="ESD global", Int_t mode=mLocal)
+void redoFinish()
{
- // type: type of analysis can be ESD, AOD, MC, ....
- // (if type="" output files are from simulation 'on the fly')
- // mode: if mode = mLocal: analyze data on your computer using aliroot
- // if mode = mLocalSource: analyze data on your computer using root + source files
+ LoadLibraries();
- // Load needed libraries:
- LoadLibrariesRF(mode);
-
- // Accessing <mergedFileName>:
TString mergedFileFullPathName(gSystem->pwd());
mergedFileFullPathName+="/";
mergedFileFullPathName+=mergedFileName.Data();
}
// Access from <mergedFileName> the merged TDirectoryFile's for each method and from them the lists holding histograms:
- for(Int_t i=0; i<nMethods; i++)
+
+ TList* mergedFileKeys = mergedFile->GetListOfKeys();
+ for(Int_t i=0; i<mergedFileKeys->GetEntries(); i++)
{
- TString directoryName("");
- TDirectory* directory = NULL;
- cout<<endl;
- // Form a file name for each method:
- directoryName+="output";
- directoryName+=method[i].Data();
- directoryName+="analysis";
- directoryName+=type.Data();
- // Access this file:
- directory = (TDirectory*)mergedFile->FindObjectAny(directoryName.Data());
- // Form a list name for each method:
- if(!directory)
- {
- cout<<" WARNING: Couldn't find a TDirectory "<<directoryName.Data()<<" in file "<<mergedFileName.Data()<<endl;
- continue;
- }
+ TDirectory* directory = dynamic_cast<TDirectory*>(mergedFile->Get(mergedFileKeys->At(i)->GetName()));
+ if (!directory) continue;
TList* listTemp = directory->GetListOfKeys();
- if (!listTemp)
- {
- cout<<" WARNING: Accessing TList from TDirectoryFile failed for method "<<method[i].Data()<<" !!!!"<<endl;
- cout<<" Did you actually specify "<<method[i].Data()<<" in the analysis?"<<endl;
- cout<<endl;
- continue;
- }
-
for (Int_t icent=0; icent<listTemp->GetEntries(); icent++)
{
TList* list = dynamic_cast<TList*>(directory->Get(listTemp->At(icent)->GetName()));
if (!list) continue;
////////////////////
- if(TString(list->GetName()).Contains("cobjMCEP"))
+ if(TString(list->GetName()).Contains("MCEP"))
{
AliFlowAnalysisWithMCEventPlane* mcep = new AliFlowAnalysisWithMCEventPlane();
mcep->GetOutputHistograms(list);
directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete);
}
// SP:
- else if(TString(list->GetName()).Contains("cobjSP"))
+ else if(TString(list->GetName()).Contains("SP"))
{
AliFlowAnalysisWithScalarProduct* sp = new AliFlowAnalysisWithScalarProduct();
sp->GetOutputHistograms(list);
directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete);
}
// GFC:
- else if(TString(list->GetName()).Contains("cobjGFC"))
+ else if(TString(list->GetName()).Contains("GFC"))
{
AliFlowAnalysisWithCumulants* gfc = new AliFlowAnalysisWithCumulants();
gfc->GetOutputHistograms(list);
directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete);
}
// QC:
- else if(TString(list->GetName()).Contains("cobjQC"))
+ else if(TString(list->GetName()).Contains("QC"))
{
AliFlowAnalysisWithQCumulants* qc = new AliFlowAnalysisWithQCumulants();
qc->GetOutputHistograms(list);
directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete);
}
// FQD:
- else if(TString(list->GetName()).Contains("cobjFQD"))
+ else if(TString(list->GetName()).Contains("FQD"))
{
AliFlowAnalysisWithFittingQDistribution* fqd = new AliFlowAnalysisWithFittingQDistribution();
fqd->GetOutputHistograms(list);
directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete);
}
// LYZ1SUM:
- else if(TString(list->GetName()).Contains("cobjLYZ1SUM"))
+ else if(TString(list->GetName()).Contains("LYZ1SUM"))
{
AliFlowAnalysisWithLeeYangZeros* lyz1sum = new AliFlowAnalysisWithLeeYangZeros();
lyz1sum->SetFirstRun(kTRUE);
directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete);
}
// LYZ2SUM:
- else if(TString(list->GetName()).Contains("cobjLYZ2SUM"))
+ else if(TString(list->GetName()).Contains("LYZ2SUM"))
{
AliFlowAnalysisWithLeeYangZeros* lyz2sum = new AliFlowAnalysisWithLeeYangZeros();
lyz2sum->SetFirstRun(kFALSE);
directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete);
}
// LYZ1PROD:
- else if(TString(list->GetName()).Contains("cobjLYZ1PROD"))
+ else if(TString(list->GetName()).Contains("LYZ1PROD"))
{
AliFlowAnalysisWithLeeYangZeros* lyz1prod = new AliFlowAnalysisWithLeeYangZeros();
lyz1prod->SetFirstRun(kTRUE);
directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete);
}
// LYZ2PROD:
- else if(TString(list->GetName()).Contains("cobjLYZ2PROD"))
+ else if(TString(list->GetName()).Contains("LYZ2PROD"))
{
AliFlowAnalysisWithLeeYangZeros* lyz2prod = new AliFlowAnalysisWithLeeYangZeros();
lyz2prod->SetFirstRun(kFALSE);
directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete);
}
// LYZEP:
- else if(TString(list->GetName()).Contains("cobjLYZEP"))
+ else if(TString(list->GetName()).Contains("LYZEP"))
{
AliFlowAnalysisWithLYZEventPlane* lyzep = new AliFlowAnalysisWithLYZEventPlane();
lyzep->GetOutputHistograms(list);
directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete);
}
// MH:
- else if(TString(list->GetName()).Contains("cobjMH"))
+ else if(TString(list->GetName()).Contains("MH"))
{
AliFlowAnalysisWithMixedHarmonics* mh = new AliFlowAnalysisWithMixedHarmonics();
mh->GetOutputHistograms(list);
directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete);
}
// NL:
- else if(TString(list->GetName()).Contains("cobjNL"))
+ else if(TString(list->GetName()).Contains("NL"))
{
AliFlowAnalysisWithNestedLoops* nl = new AliFlowAnalysisWithNestedLoops();
nl->GetOutputHistograms(list);
directory->Write(directory->GetName(),TObject::kSingleKey+TObject::kWriteDelete);
}
}//for icent
- }// end of for(Int_t i=0;i<nMethods;i++)
+ }//
// Close the final output file:
delete mergedFile;
} // end of void redoFinish(Int_t mode=mLocal)
-void LoadLibrariesRF(const libModes mode)
+void LoadLibraries()
{
-
//--------------------------------------
// Load the needed libraries most of them already loaded by aliroot
//--------------------------------------
gSystem->Load("libXMLIO");
gSystem->Load("libPhysics");
- //----------------------------------------------------------
- // >>>>>>>>>>> Local mode <<<<<<<<<<<<<<
- //----------------------------------------------------------
- if (mode==mLocal)
- {
- //--------------------------------------------------------
- // If you want to use already compiled libraries
- // in the aliroot distribution
- //--------------------------------------------------------
-
- //==================================================================================
- //load needed libraries:
- gSystem->AddIncludePath("-I$ROOTSYS/include");
- //gSystem->Load("libTree");
-
- // for AliRoot
- gSystem->AddIncludePath("-I$ALICE_ROOT/include");
- gSystem->Load("libANALYSIS");
- gSystem->Load("libPWG2flowCommon");
- //cerr<<"libPWG2flowCommon loaded ..."<<endl;
-
- }
-
- else if (mode==mLocalSource)
- {
-
- // In root inline compile
-
- // Constants
- gROOT->LoadMacro("AliFlowCommon/AliFlowCommonConstants.cxx+");
- gROOT->LoadMacro("AliFlowCommon/AliFlowLYZConstants.cxx+");
-
- // Flow event
- gROOT->LoadMacro("AliFlowCommon/AliFlowVector.cxx+");
- gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimple.cxx+");
- gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimpleCuts.cxx+");
- gROOT->LoadMacro("AliFlowCommon/AliFlowEventSimple.cxx+");
-
- // Output histograms
- gROOT->LoadMacro("AliFlowCommon/AliFlowCommonHist.cxx+");
- gROOT->LoadMacro("AliFlowCommon/AliFlowCommonHistResults.cxx+");
- gROOT->LoadMacro("AliFlowCommon/AliFlowLYZHist1.cxx+");
- gROOT->LoadMacro("AliFlowCommon/AliFlowLYZHist2.cxx+");
-
- // Functions needed for various methods
- gROOT->LoadMacro("AliFlowCommon/AliCumulantsFunctions.cxx+");
- gROOT->LoadMacro("AliFlowCommon/AliFlowLYZEventPlane.cxx+");
-
- // Flow Analysis code for various methods
- gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithMCEventPlane.cxx+");
- gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithScalarProduct.cxx+");
- gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithLYZEventPlane.cxx+");
- gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithLeeYangZeros.cxx+");
- gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithCumulants.cxx+");
- gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithQCumulants.cxx+");
- gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithFittingQDistribution.cxx+");
- gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithMixedHarmonics.cxx+");
- gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithNestedLoops.cxx+");
-
- cout << "finished loading macros!" << endl;
-
- } // end of else if (mode==mLocalSource)
-
+ // for AliRoot
+ gSystem->Load("libANALYSIS");
+ gSystem->Load("libANALYSISalice");
+ gSystem->Load("libPWG2flowCommon");
+ gSystem->Load("libPWG2flowTasks");
} // end of void LoadLibrariesRF(const libModes mode)