#include "TChain.h"
#include "TTree.h"
#include "TFile.h"
+#include "TList.h"
class AliAnalysisTask;
#include "AliMCEventHandler.h"
#include "AliMCEvent.h"
+#include "../../CORRFW/AliCFManager.h"
+
#include "AliAnalysisTaskLeeYangZeros.h"
#include "AliFlowEventSimpleMaker.h"
#include "AliFlowAnalysisWithLeeYangZeros.h"
fESD(0),
fAOD(0),
fAnalysisType("ESD"),
+ fCFManager1(NULL),
+ fCFManager2(NULL),
fLyz(0),
fEventMaker(0),
fFirstRunFile(0),
+ fListHistos(NULL),
fFirstRunLYZ(firstrun), //set boolean for firstrun to initial value
fUseSumLYZ(kTRUE) //set boolean for use sum to initial value
{
DefineOutput(0, TList::Class());
}
+
+/*
+//________________________________________________________________________
+AliAnalysisTaskLeeYangZeros::AliAnalysisTaskLeeYangZeros() :
+ fESD(0),
+ fAOD(0),
+ fAnalysisType("ESD"),
+ fCFManager1(NULL),
+ fCFManager2(NULL),
+ fLyz(0),
+ fEventMaker(0),
+ fFirstRunFile(0),
+ fListHistos(NULL),
+ fFirstRunLYZ(kTRUE), //set boolean for firstrun to initial value
+ fUseSumLYZ(kTRUE) //set boolean for use sum to initial value
+{
+ // Constructor
+ cout<<"AliAnalysisTaskLeeYangZeros::AliAnalysisTaskLeeYangZeros(const char *name)"<<endl;
+
+}
+
+*/
+
+//________________________________________________________________________
+AliAnalysisTaskLeeYangZeros::~AliAnalysisTaskLeeYangZeros()
+{
+
+ //destructor
+
+}
+
+
+
//________________________________________________________________________
void AliAnalysisTaskLeeYangZeros::ConnectInputData(Option_t *)
{
fLyz -> SetFirstRun(GetFirstRunLYZ()); //set first run true or false
fLyz -> SetUseSum(GetUseSumLYZ()); //set use sum true or false
- //output file
- TString outputName = "outputFromLeeYangZerosAnalysis" ;
- outputName += fAnalysisType.Data() ;
- if (fFirstRunLYZ) {
- outputName += "_firstrun.root" ;
- } else {
- outputName += "_secondrun.root" ;
- }
- fLyz->SetHistFileName( outputName.Data() );
-
// Get data from input slot 1
if (GetNinputs() == 2) { //if there are two input slots
fFirstRunFile = (TFile*)GetInputData(1);
cerr<<"fFirstRunFile ("<<fFirstRunFile<<")"<<endl;
- if (fFirstRunFile) cerr<<"fFirstRunFile -> IsOpen() = "<<fFirstRunFile -> IsOpen()<<endl;
-
+ if (fFirstRunFile) { cerr<<"fFirstRunFile -> IsOpen() = "<<fFirstRunFile -> IsOpen()<<endl;}
+ else { cerr<<"fFirstRunFile has a NULL pointer!!"<<endl; exit(0);}
fLyz -> SetFirstRunFile(fFirstRunFile);
}
fLyz-> Init();
+ if (fLyz->GetHistList()) {
+ fLyz->GetHistList()->Print();
+ fListHistos = fLyz->GetHistList();
+ fListHistos->Print();
+ }
+ else {Printf("ERROR: Could not retrieve histogram list"); }
+
}
//________________________________________________________________________
return;
}
+ fCFManager1->SetEventInfo(mcEvent);
+ fCFManager2->SetEventInfo(mcEvent);
+
Printf("MC particles: %d", mcEvent->GetNumberOfTracks());
//lee yang zeros analysis
- AliFlowEventSimple* fEvent = fEventMaker->FillTracks(mcEvent);
+ //AliFlowEventSimple* fEvent = fEventMaker->FillTracks(mcEvent);
+ AliFlowEventSimple* fEvent = fEventMaker->FillTracks(mcEvent,fCFManager1,fCFManager2);
fLyz->Make(fEvent);
delete fEvent;
}
Printf("There are %d tracks in this event", fESD->GetNumberOfTracks());
//lee yang zeros analysis
- AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD);
+ //AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD);
+ AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,fCFManager1,fCFManager2);
fLyz->Make(fEvent);
delete fEvent;
}
- else if (fAnalysisType == "ESDMC0") {
+ else if (fAnalysisType == "ESDMC0" || fAnalysisType == "ESDMC1") {
if (!fESD) {
Printf("ERROR: fESD not available");
return;
return;
}
- //lee yang zeros analysis
- AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,mcEvent,0); //0 = kine from ESD, 1 = kine from MC
- fLyz->Make(fEvent);
- delete fEvent;
- //delete mcEvent;
- }
- else if (fAnalysisType == "ESDMC1") {
- if (!fESD) {
- Printf("ERROR: fESD not available");
- return;
- }
- Printf("There are %d tracks in this event", fESD->GetNumberOfTracks());
-
- AliMCEventHandler* eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
- if (!eventHandler) {
- Printf("ERROR: Could not retrieve MC event handler");
- return;
- }
-
- AliMCEvent* mcEvent = eventHandler->MCEvent();
- if (!mcEvent) {
- Printf("ERROR: Could not retrieve MC event");
- return;
- }
+ fCFManager1->SetEventInfo(mcEvent);
+ fCFManager2->SetEventInfo(mcEvent);
//lee yang zeros analysis
- AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,mcEvent,1); //0 = kine from ESD, 1 = kine from MC
+ //AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,mcEvent,0); //0 = kine from ESD, 1 = kine from MC
+ AliFlowEventSimple* fEvent=NULL;
+ if (fAnalysisType == "ESDMC0") {
+ fEvent = fEventMaker->FillTracks(fESD, mcEvent, fCFManager1, fCFManager2, 0); //0 = kine from ESD, 1 = kine from MC
+ } else if (fAnalysisType == "ESDMC1") {
+ fEvent = fEventMaker->FillTracks(fESD, mcEvent, fCFManager1, fCFManager2, 1); //0 = kine from ESD, 1 = kine from MC
+ }
fLyz->Make(fEvent);
delete fEvent;
//delete mcEvent;
}
+
else if (fAnalysisType == "AOD") {
if (!fAOD) {
Printf("ERROR: fAOD not available");
Printf("There are %d tracks in this event", fAOD->GetNumberOfTracks());
//lee yang zeros analysis
- AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fAOD);
+ AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fAOD); //no CF yet!
fLyz->Make(fEvent);
delete fEvent;
}
+ //PostData(0,fListHistos); //here for CAF
+
}
//________________________________________________________________________
if (GetNinputs() == 2) {
cerr<<"fFirstRunFile -> IsOpen() = "<<fFirstRunFile -> IsOpen()<<endl;
}
- cerr<<"fLyz->GetHistFile() -> IsOpen() = "<<fLyz->GetHistFile() -> IsOpen()<<endl;
-
- fLyz->Finish();
+
+ fLyz->Finish(); //remove for CAF
+ PostData(0,fListHistos); //remove for CAF
+
- PostData(0,fLyz->GetHistFile());
+ //print histogram list:
+ TList* fOutListHistos = (TList*)GetOutputData(0);
+ cout << "histogram list in Terminate" << endl;
+ if (fOutListHistos) {
+ //fOutListHistos->Print(); //gives error for secondrun??
+ }
+ else {
+ cout << "histgram list pointer is empty" << endl;}
- delete fLyz;
- delete fEventMaker;
+ //delete fLyz;
+ //delete fEventMaker;
cout<<".....finished"<<endl;
}
class AliESDEvent;
class AliAODEvent;
+class AliCFManager;
class AliFlowAnalysisWithLeeYangZeros;
class AliFlowEventSimpleMaker;
class TFile;
+class TList;
+#include "TString.h"
#include "AliAnalysisTask.h"
class AliAnalysisTaskLeeYangZeros : public AliAnalysisTask {
public:
+ //AliAnalysisTaskLeeYangZeros();
AliAnalysisTaskLeeYangZeros(const char *name = "AliAnalysisTaskLeeYangZeros", Bool_t firstrun = kTRUE);
- virtual ~AliAnalysisTaskLeeYangZeros() {}
+ virtual ~AliAnalysisTaskLeeYangZeros();
virtual void ConnectInputData(Option_t *);
virtual void CreateOutputObjects();
void SetUseSumLYZ(Bool_t kt) { this->fUseSumLYZ = kt ; }
Bool_t GetUseSumLYZ() const { return this->fUseSumLYZ ; }
void SetAnalysisType(TString type) {this->fAnalysisType = type ; }
-
+ TString GetAnalysisType() {return this->fAnalysisType; }
+ void SetCFManager1(AliCFManager* cfmgr) {this->fCFManager1 = cfmgr; }
+ AliCFManager* GetCFManager1() {return this->fCFManager1; }
+ void SetCFManager2(AliCFManager* cfmgr) {this->fCFManager2 = cfmgr; }
+ AliCFManager* GetCFManager2() {return this->fCFManager2; }
+
+
private:
AliAnalysisTaskLeeYangZeros(const AliAnalysisTaskLeeYangZeros& aAnalysis);
AliAnalysisTaskLeeYangZeros& operator=(const AliAnalysisTaskLeeYangZeros& aAnalysis);
- AliESDEvent *fESD; //ESD object
- AliAODEvent* fAOD; //AOD object
- TString fAnalysisType; //string to select which kind of input to analyse: ESD, AOD or MC
+ AliESDEvent* fESD; //ESD object
+ AliAODEvent* fAOD; //AOD object
+ TString fAnalysisType; //string to select which kind of input to analyse: ESD, AOD or MC
+ AliCFManager* fCFManager1; // correction framework manager
+ AliCFManager* fCFManager2; // correction framework manager
AliFlowAnalysisWithLeeYangZeros* fLyz; //LYZ analysis object
AliFlowEventSimpleMaker* fEventMaker; //FlowEventSimple maker object
- TFile* fFirstRunFile; //! file from the first loop over events
+ TFile* fFirstRunFile; // file from the first loop over events
+ TList* fListHistos; // collection of output
//flags
Bool_t fFirstRunLYZ ; //! flag for lyz analysis
#include "Riostream.h" //needed as include
#include "TChain.h"
#include "TTree.h"
-#include "TFile.h" //needed as include
+//#include "TFile.h" //needed as include
#include "TList.h"
#include "AliMCEventHandler.h"
#include "AliMCEvent.h"
+#include "../../CORRFW/AliCFManager.h"
+
#include "AliAnalysisTaskScalarProduct.h"
#include "AliFlowEventSimpleMaker.h"
#include "AliFlowAnalysisWithScalarProduct.h"
fSP(NULL),
fEventMaker(NULL),
fAnalysisType("ESD"),
+ fCFManager1(NULL),
+ fCFManager2(NULL),
fListHistos(NULL)
{
// Constructor
fSP(NULL),
fEventMaker(NULL),
fAnalysisType("ESD"),
+ fCFManager1(NULL),
+ fCFManager2(NULL),
fListHistos(NULL)
{
// Constructor
fESD = esdH->GetEvent();
}
}
- else if (fAnalysisType == "ESD") {
+ else if (fAnalysisType == "ESD" || fAnalysisType == "ESDMC0" || fAnalysisType == "ESDMC1") {
cout<<"!!!!!reading the ESD only"<<endl;
tree->SetBranchStatus("*", kFALSE);
tree->SetBranchStatus("Tracks.*", kTRUE);
}
}
else {
- Printf("!!!!!Wrong analysis type: Only ESD, AOD and MC types are allowed!");
+ Printf("!!!!!Wrong analysis type: Only ESD, ESDMC0, ESDMC1, AOD and MC types are allowed!");
exit(1);
}
{
// Called at every worker node to initialize
cout<<"AliAnalysisTaskScalarProduct::CreateOutputObjects()"<<endl;
+
+ if (!(fAnalysisType == "AOD" || fAnalysisType == "ESD" || fAnalysisType == "ESDMC0" || fAnalysisType == "ESDMC1" || fAnalysisType == "MC")) {
+ cout<<"WRONG ANALYSIS TYPE! only ESD, ESDMC0, ESDMC1, AOD and MC are allowed."<<endl;
+ exit(1);
+ }
+
//event maker
fEventMaker = new AliFlowEventSimpleMaker();
//Analyser
if (fSP->GetHistList()) {
- // fSP->GetHistList()->Print();
- fListHistos = fSP->GetHistList();
- // fListHistos->Print();
+ fSP->GetHistList()->Print();
+ fListHistos = fSP->GetHistList();
+ fListHistos->Print();
}
else {Printf("ERROR: Could not retrieve histogram list"); }
}
// Main loop
// Called for each event
-
-
-
+
if (fAnalysisType == "MC") {
// Process MC truth, therefore we receive the AliAnalysisManager and ask it for the AliMCEventHandler
return;
}
+ fCFManager1->SetEventInfo(mcEvent);
+ fCFManager2->SetEventInfo(mcEvent);
+
// analysis
Printf("MC particles: %d", mcEvent->GetNumberOfTracks());
- AliFlowEventSimple* fEvent = fEventMaker->FillTracks(mcEvent);
+ AliFlowEventSimple* fEvent = fEventMaker->FillTracks(mcEvent,fCFManager1,fCFManager2);
fSP->Make(fEvent);
delete fEvent;
Printf("There are %d tracks in this event", fESD->GetNumberOfTracks());
// analysis
- AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD);
+ AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fESD,fCFManager1,fCFManager2);
fSP->Make(fEvent);
delete fEvent;
}
+else if (fAnalysisType == "ESDMC0" || fAnalysisType == "ESDMC1" ) {
+ if (!fESD) {
+ Printf("ERROR: fESD not available");
+ return;
+ }
+ Printf("There are %d tracks in this event", fESD->GetNumberOfTracks());
+
+ AliMCEventHandler* eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
+ if (!eventHandler) {
+ Printf("ERROR: Could not retrieve MC event handler");
+ return;
+ }
+
+ AliMCEvent* mcEvent = eventHandler->MCEvent();
+ if (!mcEvent) {
+ Printf("ERROR: Could not retrieve MC event");
+ return;
+ }
+
+ fCFManager1->SetEventInfo(mcEvent);
+ fCFManager2->SetEventInfo(mcEvent);
+
+ //lee yang zeros analysis
+ AliFlowEventSimple* fEvent=NULL;
+ if (fAnalysisType == "ESDMC0") {
+ fEvent = fEventMaker->FillTracks(fESD, mcEvent, fCFManager1, fCFManager2, 0); //0 = kine from ESD, 1 = kine from MC
+ } else if (fAnalysisType == "ESDMC1") {
+ fEvent = fEventMaker->FillTracks(fESD, mcEvent, fCFManager1, fCFManager2, 1); //0 = kine from ESD, 1 = kine from MC
+ }
+ fSP->Make(fEvent);
+ delete fEvent;
+ //delete mcEvent;
+ }
+
else if (fAnalysisType == "AOD") {
if (!fAOD) {
Printf("ERROR: fAOD not available");
Printf("There are %d tracks in this event", fAOD->GetNumberOfTracks());
// analysis
+ //For the moment don't use CF //AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fAOD,fCFManager1,fCFManager2);
AliFlowEventSimple* fEvent = fEventMaker->FillTracks(fAOD);
fSP->Make(fEvent);
delete fEvent;
}
- // fListHistos->Print();
+ //fListHistos->Print();
PostData(0,fListHistos);
}
// Called once at the end of the query
// fSP->Finish();
// PostData(0,fListHistos);
+
fListHistos = (TList*)GetOutputData(0);
cout << "histgram list in Terminate" << endl;
if (fListHistos)
{
cout << "histgram list pointer is empty" << endl;
}
- // delete fSP;
- // delete fEventMaker;
+// delete fSP;
+// delete fEventMaker;
}
class AliESDEvent;
class AliAODEvent;
+class AliCFManager;
class AliFlowAnalysisWithScalarProduct;
class AliFlowEventSimpleMaker;
+class TList;
#include "TString.h"
#include "AliAnalysisTask.h"
void SetAnalysisType(TString type) { this->fAnalysisType = type; }
TString GetAnalysisType() const { return this->fAnalysisType; }
-
+
+ void SetCFManager1(AliCFManager* cfmgr) {this->fCFManager1 = cfmgr; }
+ AliCFManager* GetCFManager1() {return this->fCFManager1; }
+ void SetCFManager2(AliCFManager* cfmgr) {this->fCFManager2 = cfmgr; }
+ AliCFManager* GetCFManager2() {return this->fCFManager2; }
+
private:
AliAnalysisTaskScalarProduct(const AliAnalysisTaskScalarProduct& aAnalysisTask);
AliFlowAnalysisWithScalarProduct* fSP; // analysis object
AliFlowEventSimpleMaker* fEventMaker; // FlowEventSimple maker object
TString fAnalysisType; // can be MC, ESD or AOD
- TList *fListHistos; //collection of output
+ AliCFManager* fCFManager1; // correction framework manager
+ AliCFManager* fCFManager2; // correction framework manager
+ TList *fListHistos; // collection of output
ClassDef(AliAnalysisTaskScalarProduct, 1); // example of analysis
};
fSecondVPt->SetLineColor(3);
fSecondVPt->SetLineWidth(2);
fSecondVPt->Draw();
- fHistFlow = fCommonHistsRes->GetfHistDiffFlow();
+ fHistFlow = fCommonHistsRes->GetHistDiffFlow();
fHistFlow->Draw("SAME");
// draw the legend
TLegend *legend2 = new TLegend(0.6,0.65,0.88,0.85);
#include "TMath.h" //needed as include
#include "TFile.h" //needed as include
+#include "TList.h"
class TComplex;
class TProfile;
fUseSum(kTRUE),
fDoubleLoop(kFALSE),
fDebug(kFALSE),
- fHistFileName(0),
- fHistFile(0),
- fSummaryFile(0),
+ fHistList(NULL),
firstRunFileName(0),
firstRunFile(NULL),
fHistProVtheta(NULL),
//default constructor
if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::AliFlowAnalysisWithLeeYangZeros default constructor****"<<endl;
- // output file (histograms)
- fHistFileName = "outputFromLYZAnalysis.root" ;
+ fHistList = new TList();
for(Int_t i = 0;i<5;i++)
{
//default destructor
if (fDebug) cout<<"****~AliFlowAnalysisWithLeeYangZeros****"<<endl;
delete fQsum;
- delete fHistFile;
+ delete fHistList;
}
//-----------------------------------------------------------------------
//init method
if (fDebug) cout<<"****AliFlowAnalysisWithLeeYangZeros::Init()****"<<endl;
- // Open output files (->plots)
- fHistFile = new TFile(fHistFileName.Data(), "RECREATE");
-
-
// Book histograms
Int_t iNtheta = AliFlowLYZConstants::kTheta;
Int_t iNbinsPt = AliFlowCommonConstants::GetNbinsPt();
//for control histograms
fCommonHists = new AliFlowCommonHist("LYZ");
+ //fHistList->Add(fCommonHists->GetHistList());
+ fHistList->Add(fCommonHists->GetHistMultOrig());
+ fHistList->Add(fCommonHists->GetHistMultInt());
+ fHistList->Add(fCommonHists->GetHistMultDiff());
+ fHistList->Add(fCommonHists->GetHistPtInt());
+ fHistList->Add(fCommonHists->GetHistPtDiff());
+ fHistList->Add(fCommonHists->GetHistPhiInt());
+ fHistList->Add(fCommonHists->GetHistPhiDiff());
+ fHistList->Add(fCommonHists->GetHistEtaInt());
+ fHistList->Add(fCommonHists->GetHistEtaDiff());
+ fHistList->Add(fCommonHists->GetHistProMeanPtperBin());
+ fHistList->Add(fCommonHists->GetHistQ());
fCommonHistsRes = new AliFlowCommonHistResults("LYZ");
+ //fHistList->Add(fCommonHistsRes->GetHistList());
+ fHistList->Add(fCommonHistsRes->GetHistDiffFlow());
+ fHistList->Add(fCommonHistsRes->GetHistChi());
+ fHistList->Add(fCommonHistsRes->GetHistIntFlow());
//for first loop over events
if (fFirstRun){
fHistProR0theta = new TProfile("First_FlowPro_r0theta_LYZ","First_FlowPro_r0theta_LYZ",iNtheta,-0.5,iNtheta-0.5);
fHistProR0theta->SetXTitle("#theta");
fHistProR0theta->SetYTitle("r_{0}^{#theta}");
+ fHistList->Add(fHistProR0theta);
fHistProVtheta = new TProfile("First_FlowPro_Vtheta_LYZ","First_FlowPro_Vtheta_LYZ",iNtheta,-0.5,iNtheta-0.5);
fHistProVtheta->SetXTitle("#theta");
fHistProVtheta->SetYTitle("V_{n}^{#theta}");
+ fHistList->Add(fHistProVtheta);
//class AliFlowLYZHist1 defines the histograms: fHistProGtheta, fHistProReGtheta, fHistProImGtheta, fHistProR0theta
for (Int_t theta=0;theta<iNtheta;theta++) {
fHist1[theta]=new AliFlowLYZHist1(theta);
+ //fHistList->Add(fHist1[theta]->GetHistList() );
+ fHistList->Add(fHist1[theta]->GetHistGtheta() );
+ fHistList->Add(fHist1[theta]->GetHistProReGtheta() );
+ fHistList->Add(fHist1[theta]->GetHistProImGtheta() );
}
}
fHistProReDenom = new TProfile("Second_FlowPro_ReDenom_LYZ","Second_FlowPro_ReDenom_LYZ" , iNtheta, -0.5, iNtheta-0.5);
fHistProReDenom->SetXTitle("#theta");
fHistProReDenom->SetYTitle("Re(Q^{#theta}e^{ir_{0}^{#theta}Q^{#theta}})");
+ fHistList->Add(fHistProReDenom);
fHistProImDenom = new TProfile("Second_FlowPro_ImDenom_LYZ","Second_FlowPro_ImDenom_LYZ" , iNtheta, -0.5, iNtheta-0.5);
fHistProImDenom->SetXTitle("#theta");
fHistProImDenom->SetYTitle("Im(Q^{#theta}e^{ir_{0}^{#theta}Q^{#theta}})");
+ fHistList->Add(fHistProImDenom);
fHistProVeta = new TProfile("Second_FlowPro_Veta_LYZ","Second_FlowPro_Veta_LYZ",iNbinsEta,dEtaMin,dEtaMax);
fHistProVeta->SetXTitle("rapidity");
fHistProVeta->SetYTitle("v (%)");
+ fHistList->Add(fHistProVeta);
fHistProVPt = new TProfile("Second_FlowPro_VPt_LYZ","Second_FlowPro_VPt_LYZ",iNbinsPt,dPtMin,dPtMax);
fHistProVPt->SetXTitle("Pt");
fHistProVPt->SetYTitle("v (%)");
+ fHistList->Add(fHistProVPt);
fHistProReDtheta = new TProfile("Second_FlowPro_ReDtheta_LYZ","Second_FlowPro_ReDtheta_LYZ",iNtheta, -0.5, iNtheta-0.5);
fHistProReDtheta->SetXTitle("#theta");
fHistProReDtheta->SetYTitle("Re(D^{#theta})");
+ fHistList->Add(fHistProReDtheta);
fHistProImDtheta = new TProfile("Second_FlowPro_ImDtheta_LYZ","Second_FlowPro_ImDtheta_LYZ",iNtheta, -0.5, iNtheta-0.5);
fHistProImDtheta->SetXTitle("#theta");
fHistProImDtheta->SetYTitle("Im(D^{#theta})");
+ fHistList->Add(fHistProImDtheta);
//class AliFlowLYZHist2 defines the histograms:
for (Int_t theta=0;theta<iNtheta;theta++) {
fHist2[theta]=new AliFlowLYZHist2(theta);
+ //fHistList->Add(fHist2[theta]->GetHistList() );
+ fHistList->Add(fHist2[theta]->GetHistProReNumer() );
+ fHistList->Add(fHist2[theta]->GetHistProImNumer() );
+ fHistList->Add(fHist2[theta]->GetHistProReNumerPt() );
+ fHistList->Add(fHist2[theta]->GetHistProImNumerPt() );
+ //fHistList->Add(fHist2[theta]->GetHistProReNumer2D() ); //gives error in compilation
+ //fHistList->Add(fHist2[theta]->GetHistProImNumer2D() ); //gives error in compilation
}
//read hists from first run file
exit(-1);
} else if (firstRunFile->IsOpen()){
cout<<"----firstRunFile is open----"<<endl<<endl;
- fHistProR0theta = (TProfile*)firstRunFile->Get("First_FlowPro_r0theta_LYZ");
+ TList* list = (TList*)firstRunFile->Get("cobj1");
+ if (!list) {cout<<"list is NULL pointer!"<<endl;}
+ fHistProR0theta = (TProfile*)list->FindObject("First_FlowPro_r0theta_LYZ");
+ if (!fHistProR0theta) {cout<<"fHistProR0theta has a NULL pointer!"<<endl;}
+ fHistList->Add(fHistProR0theta);
}
}
if (fDebug) cout<<"****histograms filled****"<<endl;
- //save histograms in file //temp for testing selector
- fHistFile->cd();
- fHistFile->Write();
-
return kTRUE;
fEventNumber =0; //set to zero for second round over events
} //firstrun
fCommonHistsRes->FillDifferentialFlow(b, dv2pro, dErrdifcomb);
} //loop over bins b
-
- //save histograms in file
- fHistFile->cd();
- fHistFile->Write();
- fHistFile->Close();
- //Note that when the file is closed, all histograms and Trees in memory associated with this file are deleted
- if (fDebug) cout<<"****Histograms saved and fHistFile closed, all histograms deleted****"<<endl;
-
+
//close the first run file
- firstRunFile->Close();
+ //firstRunFile->Close(); //gives error when writing to TList
} //secondrun
dR0 = fHistProR0theta->GetBinContent(theta+1);
}
else {
- cout <<"pointer fHistProR0Theta does not exist" << endl;
+ cout <<"pointer fHistProR0theta does not exist" << endl;
}
//cerr<<"dR0 = "<<dR0 <<endl;
class TFile;
class TComplex;
class TString;
+class TList;
class Riostream;
// Output
- void SetHistFileName(TString name) { this->fHistFileName = name ; } // Sets output file name
- TString GetHistFileName() const { return this->fHistFileName ; } // Gets output file name
- TFile* GetHistFile() const { return this->fHistFile ; } // Gets output file
-
+ TList* GetHistList() const { return this->fHistList ; } // Gets output histogram list
+
// input for second run
void SetFirstRunFileName(TString name) { this->firstRunFileName = name ; } // Sets input file name
TString GetFirstRunFileName() const { return this->firstRunFileName ; } // Gets output file name
Bool_t fDoubleLoop ; // flag for studying non flow effects
Bool_t fDebug ; // flag for lyz analysis: more print statements
- TString fHistFileName; //
- TFile* fHistFile; //
- TFile* fSummaryFile; //
+ TList* fHistList; //list to hold all output histograms
TString firstRunFileName; //
TFile* firstRunFile; //
Int_t iNbinsPt = AliFlowCommonConstants::GetNbinsPt();
- TH1F* fHistPtDiff = fCommonHists->GetfHistPtDiff();
+ TH1F* fHistPtDiff = fCommonHists->GetHistPtDiff();
Double_t dV = 0.;
Double_t dErrV = 0.;
Double_t dSum = 0.;
#define AliFlowAnalysisWithScalarProduct_cxx
#include "Riostream.h" //needed as include
-#include "TFile.h" //needed as include
+//#include "TFile.h" //needed as include
#include "TList.h"
#include "TMath.h"
#include "TProfile.h"
fHistList->Add(fHistProUQ);
fCommonHists = new AliFlowCommonHist("SP");
- fHistList->Add(fCommonHists->GetHistList());
+ //fHistList->Add(fCommonHists->GetHistList());
+ fHistList->Add(fCommonHists->GetHistMultOrig());
+ fHistList->Add(fCommonHists->GetHistMultInt());
+ fHistList->Add(fCommonHists->GetHistMultDiff());
+ fHistList->Add(fCommonHists->GetHistPtInt());
+ fHistList->Add(fCommonHists->GetHistPtDiff());
+ fHistList->Add(fCommonHists->GetHistPhiInt());
+ fHistList->Add(fCommonHists->GetHistPhiDiff());
+ fHistList->Add(fCommonHists->GetHistEtaInt());
+ fHistList->Add(fCommonHists->GetHistEtaDiff());
+ fHistList->Add(fCommonHists->GetHistProMeanPtperBin());
+ fHistList->Add(fCommonHists->GetHistQ());
//fCommonHistsRes = new AliFlowCommonHistResults("SP");
fEventNumber = 0; //set number of events to zero
Double_t GetEntriesInPtBin(Int_t iBin); //gets entries from fHistPtDiff
Double_t GetMeanPt(Int_t iBin); //gets the mean pt for this bin from fHistProMeanPtperBin
- TH1F* GetfHistMultOrig() {return fHistMultOrig; } ;
- TH1F* GetfHistMultInt() {return fHistMultInt; } ;
- TH1F* GetfHistMultDiff() {return fHistMultDiff; } ;
- TH1F* GetfHistPtInt() {return fHistPtInt; } ;
- TH1F* GetfHistPtDiff() {return fHistPtDiff; } ;
- TH1F* GetfHistPhiInt() {return fHistPhiInt; } ;
- TH1F* GetfHistPhiDiff() {return fHistPhiDiff; } ;
- TH1F* GetfHistEtaInt() {return fHistEtaInt; } ;
- TH1F* GetfHistEtaDiff() {return fHistEtaDiff; } ;
- TProfile* GetfHistProMeanPtperBin() {return fHistProMeanPtperBin; } ;
- TH1F* GetfHistQ() {return fHistQ; } ;
- TList* GetHistList() {return fHistList;} ;
+ TH1F* GetHistMultOrig() {return fHistMultOrig; } ;
+ TH1F* GetHistMultInt() {return fHistMultInt; } ;
+ TH1F* GetHistMultDiff() {return fHistMultDiff; } ;
+ TH1F* GetHistPtInt() {return fHistPtInt; } ;
+ TH1F* GetHistPtDiff() {return fHistPtDiff; } ;
+ TH1F* GetHistPhiInt() {return fHistPhiInt; } ;
+ TH1F* GetHistPhiDiff() {return fHistPhiDiff; } ;
+ TH1F* GetHistEtaInt() {return fHistEtaInt; } ;
+ TH1F* GetHistEtaDiff() {return fHistEtaDiff; } ;
+ TProfile* GetHistProMeanPtperBin() {return fHistProMeanPtperBin; } ;
+ TH1F* GetHistQ() {return fHistQ; } ;
+ TList* GetHistList() {return fHistList;} ;
virtual Double_t Merge(TCollection *aList); //merge function
Bool_t FillChi(Double_t aChi); //fill fHistChi
//make get methods here
- TH1D* GetfHistDiffFlow() {return fHistDiffFlow; } ;
- TH1D* GetfHistChi() {return fHistChi; } ;
- TH1D* GetfHistIntFlow() {return fHistIntFlow; } ;
- TList* GetHistList() {return fHistList;} ;
+ TH1D* GetHistDiffFlow() {return fHistDiffFlow; } ;
+ TH1D* GetHistChi() {return fHistChi; } ;
+ TH1D* GetHistIntFlow() {return fHistIntFlow; } ;
+ TList* GetHistList() {return fHistList;} ;
virtual Double_t Merge(TCollection *aList); //merge function
#include "AliESDtrack.h"
#include "AliAODEvent.h"
#include "AliAODTrack.h"
+#include "../../CORRFW/AliCFManager.h"
// AliFlowEventSimpleMaker:
// Class to fill the AliFlowEventSimple
// Has fill methods for TTree, AliMCEvent, AliESDEvent and AliAODEvent
// author: N. van der Kolk (kolk@nikhef.nl)
-
-
ClassImp(AliFlowEventSimpleMaker)
//-----------------------------------------------------------------------
AliFlowEventSimpleMaker::AliFlowEventSimpleMaker()
Int_t iSelParticlesDiff = 0;
Int_t iSelParticlesInt = 0;
-
//normal loop
while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
AliMCParticle* pParticle = anInput->GetTrack(itrkN); //get input particle
//cut on tracks
- if (TMath::Abs(pParticle->Eta()) < 0.2)
+ if (TMath::Abs(pParticle->Eta()) < 0.9)
{
if(
TMath::Abs(pParticle->Particle()->GetPdgCode()) == 211
iGoodTracks++;
pEvent->TrackCollection()->Add(pTrack) ;
}
- /* else if(
+ /* else if(
TMath::Abs(pParticle->Particle()->GetPdgCode()) == 211
)
{
}
+
+//-----------------------------------------------------------------------
+AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliMCEvent* anInput, AliCFManager* intCFManager, AliCFManager* diffCFManager)
+{
+ //Fills the event from the MC kinematic information
+
+ Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
+ cerr<<"anInput->GetNumberOfTracks() = "<<iNumberOfInputTracks<<endl;
+
+ AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
+
+ //Int_t iN = 256; //multiplicity for chi=1
+ Int_t iN = iNumberOfInputTracks;
+ Int_t iGoodTracks = 0;
+ Int_t itrkN = 0;
+ Int_t iSelParticlesDiff = 0;
+ Int_t iSelParticlesInt = 0;
+
+
+ //normal loop
+ while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
+ //get input particle
+ AliMCParticle* pParticle = anInput->GetTrack(itrkN);
+ //make new AliFlowTrackSimple
+ AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
+ pTrack->SetPt(pParticle->Pt() );
+ pTrack->SetEta(pParticle->Eta() );
+ pTrack->SetPhi(pParticle->Phi() );
+
+ //check if pParticle passes the cuts
+ if (intCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pParticle)) {
+ pTrack->SetForIntegratedFlow(kTRUE);
+ //cout<<"integrated selection. PID = "<<pParticle->Particle()->GetPdgCode()<<endl;
+ }
+ if (diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pParticle)) {
+ pTrack->SetForDifferentialFlow(kTRUE);
+ //cout<<"differential selection. PID = "<<pParticle->Particle()->GetPdgCode()<<endl;
+ }
+
+ //check if any bits are set
+ TBits bFlowBits = pTrack->GetFlowBits();
+ if (bFlowBits.CountBits() != 0) {
+ //cout<<"The number of bits set = "<<bFlowBits.CountBits()<<endl;
+ pEvent->TrackCollection()->Add(pTrack) ;
+ iGoodTracks++;
+
+ if (pTrack->UseForIntegratedFlow())
+ { iSelParticlesInt++; }
+ if (pTrack->UseForDifferentialFlow())
+ { iSelParticlesDiff++; }
+ }
+
+ itrkN++;
+ }
+
+ pEvent-> SetEventNSelTracksIntFlow(iSelParticlesInt);
+ pEvent-> SetNumberOfTracks(iGoodTracks);
+ cout<<" iGoodTracks = "<<iGoodTracks<<endl;
+ cout << " iSelectedTracksInt = " << iSelParticlesInt << endl;
+ return pEvent;
+
+}
+
+
//-----------------------------------------------------------------------
AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput)
{
while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
AliESDtrack* pParticle = anInput->GetTrack(itrkN); //get input particle
//cut on tracks
- if (TMath::Abs(pParticle->Eta()) < 0.2)
+ if (TMath::Abs(pParticle->Eta()) < 0.9)
{
AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
pTrack->SetPt(pParticle->Pt() );
}
+//-----------------------------------------------------------------------
+AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, AliCFManager* intCFManager, AliCFManager* diffCFManager)
+{
+ //Fills the event from the ESD
+
+ Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
+ cerr<<"anInput->GetNumberOfTracks() = "<<iNumberOfInputTracks<<endl;
+
+ AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
+
+ //Int_t iN = 256; //multiplicity for chi=1
+ Int_t iN = iNumberOfInputTracks;
+ Int_t iGoodTracks = 0;
+ Int_t itrkN = 0;
+ Int_t iSelParticlesDiff = 0;
+ Int_t iSelParticlesInt = 0;
+
+
+ //normal loop
+ while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
+ AliESDtrack* pParticle = anInput->GetTrack(itrkN); //get input particle
+ //make new AliFLowTrackSimple
+ AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
+ pTrack->SetPt(pParticle->Pt() );
+ pTrack->SetEta(pParticle->Eta() );
+ pTrack->SetPhi(pParticle->Phi() );
+ //check if pParticle passes the cuts
+
+ if (intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle)) {
+ pTrack->SetForIntegratedFlow(kTRUE);
+ }
+ if (diffCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle)) {
+ pTrack->SetForDifferentialFlow(kTRUE);}
+
+ //check if any bits are set
+ TBits bFlowBits = pTrack->GetFlowBits();
+ if (bFlowBits.CountBits() !=0) {
+ pEvent->TrackCollection()->Add(pTrack) ;
+ iGoodTracks++;
+
+ if (pTrack->UseForIntegratedFlow())
+ { iSelParticlesInt++; }
+ if (pTrack->UseForDifferentialFlow())
+ { iSelParticlesDiff++; }
+
+ }
+ itrkN++;
+ }
+
+ pEvent-> SetEventNSelTracksIntFlow(iSelParticlesInt);
+ pEvent->SetNumberOfTracks(iGoodTracks);
+ cout<<" iGoodTracks = "<<iGoodTracks<<endl;
+ cout << " iSelectedTracksInt = " << iSelParticlesInt << endl;
+ return pEvent;
+
+
+}
//-----------------------------------------------------------------------
AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliAODEvent* anInput)
Int_t itrkN = 0;
Int_t iSelParticlesDiff = 0;
Int_t iSelParticlesInt = 0;
-
//normal loop
while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
AliAODTrack* pParticle = anInput->GetTrack(itrkN); //get input particle
//cut on tracks
- if (TMath::Abs(pParticle->Eta()) < 0.2)
+ if (TMath::Abs(pParticle->Eta()) < 0.9)
{
AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
pTrack->SetPt(pParticle->Pt() );
return pEvent;
}
+
+
+//-----------------------------------------------------------------------
+AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliAODEvent* anInput, AliCFManager* intCFManager, AliCFManager* diffCFManager)
+{
+ //Fills the event from the AOD
+
+ Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
+ cerr<<"anInput->GetNumberOfTracks() = "<<iNumberOfInputTracks<<endl;
+
+ AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
+
+ //Int_t iN = 256; //multiplicity for chi=1
+ Int_t iN = iNumberOfInputTracks;
+ Int_t iGoodTracks = 0;
+ Int_t itrkN = 0;
+ Int_t iSelParticlesDiff = 0;
+ Int_t iSelParticlesInt = 0;
+
+
+ //normal loop
+ while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
+ AliAODTrack* pParticle = anInput->GetTrack(itrkN); //get input particle
+ //make new AliFlowTrackSimple
+ AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
+ pTrack->SetPt(pParticle->Pt() );
+ pTrack->SetEta(pParticle->Eta() );
+ pTrack->SetPhi(pParticle->Phi() );
+
+ //check if pParticle passes the cuts
+ if (intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle)) { //check these cuts!!
+ pTrack->SetForIntegratedFlow(kTRUE); }
+ if (diffCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle)) {
+ pTrack->SetForDifferentialFlow(kTRUE);}
+
+ //check if any bits are set
+ TBits bFlowBits = pTrack->GetFlowBits();
+ if (bFlowBits.CountBits() !=0) {
+ pEvent->TrackCollection()->Add(pTrack) ;
+ iGoodTracks++;
+
+ if (pTrack->UseForIntegratedFlow())
+ { iSelParticlesInt++; }
+ if (pTrack->UseForDifferentialFlow())
+ { iSelParticlesDiff++; }
+
+ }
+
+ itrkN++;
+ }
+
+ pEvent-> SetEventNSelTracksIntFlow(iSelParticlesInt);
+ pEvent->SetNumberOfTracks(iGoodTracks);
+ cout<<" iGoodTracks = "<<iGoodTracks<<endl;
+ cout << " iSelectedTracksInt = " << iSelParticlesInt << endl;
+ return pEvent;
+
+}
+
//-----------------------------------------------------------------------
AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, Int_t anOption)
{
}
+//-----------------------------------------------------------------------
+AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, AliCFManager* intCFManager, AliCFManager* diffCFManager, Int_t anOption)
+{
+ //fills the event with tracks from the ESD and kinematics from the MC info via the track label
+ ///////////////////////////////////////////////////
+ //
+ // WARNING: this method is not correct yet!
+ // The PID cut has to be implemented correctly
+ // 24/06/08
+ //
+ //////////////////////////////////////////////////
-/*
-$Log$
-*/
+ if (!(anOption ==0 || anOption ==1)) {
+ cout<<"WRONG OPTION IN AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, Int_t anOption)"<<endl;
+ exit(1);
+ }
+ Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
+ cerr<<"anInput->GetNumberOfTracks() = "<<iNumberOfInputTracks<<endl;
+
+ AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
+
+ //Int_t iN = 256; //multiplicity for chi=1
+ Int_t iN = iNumberOfInputTracks;
+ Int_t iGoodTracks = 0;
+ Int_t itrkN = 0;
+ Int_t iSelParticlesDiff = 0;
+ Int_t iSelParticlesInt = 0;
+
+ //normal loop
+ while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
+ AliESDtrack* pParticle = anInput->GetTrack(itrkN); //get input particle
+ //get Label
+ Int_t iLabel = pParticle->GetLabel();
+ //match to mc particle
+ AliMCParticle* pMcParticle = anInputMc->GetTrack(TMath::Abs(iLabel));
+
+ //check
+ if (TMath::Abs(pParticle->GetLabel())!=pMcParticle->Label()) cout<<"pParticle->GetLabel()!=pMcParticle->Label() "<<pParticle->GetLabel()<<" "<<pMcParticle->Label()<<endl;
+
+ //make new AliFlowTrackSimple
+ AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
+ if(anOption == 0) { //take the PID from the MC & the kinematics from the ESD
+ pTrack->SetPt(pParticle->Pt() );
+ pTrack->SetEta(pParticle->Eta() );
+ pTrack->SetPhi(pParticle->Phi() );
+ }
+ else if (anOption == 1) { //take the PID and kinematics from the MC
+ pTrack->SetPt(pMcParticle->Pt() );
+ pTrack->SetEta(pMcParticle->Eta() );
+ pTrack->SetPhi(pMcParticle->Phi() );
+ }
+ else { cout<<"Not a valid option"<<endl; }
+
+ //check if pParticle passes the cuts
+ if(anOption == 0) {
+ //cout<<"take the PID from the MC & the kinematics from the ESD"<<endl;
+ if (intCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle,"mcGenCuts1") &&
+ intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle)) { //????which cuts to use on which particle
+ pTrack->SetForIntegratedFlow(kTRUE); }
+ if (diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle,"mcGenCuts2") &&
+ diffCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle)) { //????which cuts to use on which particle
+ pTrack->SetForDifferentialFlow(kTRUE);}
+ }
+ else if (anOption == 1) {
+ //cout<<"take the PID and kinematics from the MC"<<endl;
+ if (intCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle)) {
+ pTrack->SetForIntegratedFlow(kTRUE); }
+ if (diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle)) {
+ pTrack->SetForDifferentialFlow(kTRUE);}
+ }
+ else { cout<<"Not a valid option"<<endl; }
+
+ //check if any bits are set
+ TBits bFlowBits = pTrack->GetFlowBits();
+ if (bFlowBits.CountBits() !=0) {
+ pEvent->TrackCollection()->Add(pTrack) ;
+ iGoodTracks++;
+
+ if (pTrack->UseForIntegratedFlow())
+ { iSelParticlesInt++; }
+ if (pTrack->UseForDifferentialFlow())
+ { iSelParticlesDiff++; }
+
+ }
+ itrkN++;
+ }
+
+ pEvent-> SetEventNSelTracksIntFlow(iSelParticlesInt);
+ pEvent->SetNumberOfTracks(iGoodTracks);
+ cout<<" iGoodTracks = "<<iGoodTracks<<endl;
+ cout << " iSelectedTracksInt = " << iSelParticlesInt << endl;
+ return pEvent;
+
+}
+
+
+
+
+
+
#include "AliFlowEventSimple.h" //needed as include
//class AliFlowEventSimple; //does not compile
+#include "../../CORRFW/AliCFManager.h"
+//class AliCFManager;
+
class TTree;
class AliMCEvent;
class AliESDEvent;
AliFlowEventSimpleMaker(); //constructor
virtual ~AliFlowEventSimpleMaker(); //destructor
- AliFlowEventSimple* FillTracks(TTree* anInput);
- AliFlowEventSimple* FillTracks(AliMCEvent* anInput);
- AliFlowEventSimple* FillTracks(AliESDEvent* anInput);
- AliFlowEventSimple* FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, Int_t anOption);
+ //TTree
+ AliFlowEventSimple* FillTracks(TTree* anInput); //use own cuts
+ //AliMCEvent
+ AliFlowEventSimple* FillTracks(AliMCEvent* anInput); //use own cuts
+ AliFlowEventSimple* FillTracks(AliMCEvent* anInput, AliCFManager* intCFManager, AliCFManager* diffCFManager ); //use CF(2x)
+ //AliESDEvent
+ AliFlowEventSimple* FillTracks(AliESDEvent* anInput); //use own cuts
+ AliFlowEventSimple* FillTracks(AliESDEvent* anInput, AliCFManager* intCFManager, AliCFManager* diffCFManager); //use CF(2x)
+ //AliESDEvent & AliMCEvent
+ AliFlowEventSimple* FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, Int_t anOption); //use own cuts
+ AliFlowEventSimple* FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, AliCFManager* intCFManager, AliCFManager* diffCFManager, Int_t anOption); //use CF(2x)
// anOption = 0 : kine from ESD
// anOption = 1 : kine from MC
- AliFlowEventSimple* FillTracks(AliAODEvent* anInput);
+ //AliAODEvent
+ AliFlowEventSimple* FillTracks(AliAODEvent* anInput); //use own cuts
+ AliFlowEventSimple* FillTracks(AliAODEvent* anInput, AliCFManager* intCFManager, AliCFManager* diffCFManager); //use CF(2x)
private:
AliFlowEventSimpleMaker(const AliFlowEventSimpleMaker& anAnalysis); //copy constructor
Double_t GetR0(); //get R0
Double_t GetBinCenter(Int_t i); //Get a bincentre of fHistGtheta
Int_t GetNBins(); //Gets Nbins
- TList* GetHistList() {return fHistList;} ;
+
+ TH1D* GetHistGtheta() {return this->fHistGtheta;} ;
+ TProfile* GetHistProReGtheta() {return this->fHistProReGtheta;} ;
+ TProfile* GetHistProImGtheta() {return this->fHistProImGtheta;} ;
+ TList* GetHistList() {return this->fHistList;} ;
virtual Double_t Merge(TCollection *aList); //merge function
{Double_t dPt = fHistProReNumerPt->GetXaxis()->GetBinCenter(i); return dPt;}
TComplex GetNumerEta(Int_t i); //get numerator for diff. flow (eta)
TComplex GetNumerPt(Int_t i); //get numerator for diff. flow (pt)
- TList* GetHistList()
- {return fHistList;}
+
+ TProfile* GetHistProReNumer() {return this->fHistProReNumer;}
+ TProfile* GetHistProImNumer() {return this->fHistProImNumer;}
+ TProfile* GetHistProReNumerPt() {return this->fHistProReNumerPt;}
+ TProfile* GetHistProImNumerPt() {return this->fHistProImNumerPt;}
+ TProfile2D* GetHistProReNumer2D() {return this->fHistProReNumer2D;}
+ TProfile2D* GetHistProImNumer2D() {return this->fHistProImNumer2D;}
+ TList* GetHistList() {return this->fHistList;}
virtual Double_t Merge(TCollection *aList); //merge function
Double_t Eta() const;
Double_t Pt() const;
Double_t Phi() const;
- Bool_t UseForIntegratedFlow() const;
- Bool_t UseForDifferentialFlow() const;
+ TBits GetFlowBits() const;
+ Bool_t UseForIntegratedFlow() const;
+ Bool_t UseForDifferentialFlow() const;
void SetEta(Double_t eta);
void SetPt(Double_t pt);
};
inline Double_t AliFlowTrackSimple::Eta() const {
- return fEta; }
+ return this->fEta; }
inline Double_t AliFlowTrackSimple::Pt() const {
// cout << "Returned pt:" << fPt << endl;
- return fPt;}
+ return this->fPt;}
inline Double_t AliFlowTrackSimple::Phi() const {
- return fPhi; }
+ return this->fPhi; }
+inline TBits AliFlowTrackSimple::GetFlowBits() const {
+ return this->fFlowBits; }
inline Bool_t AliFlowTrackSimple::UseForIntegratedFlow() const {
- return fFlowBits.TestBitNumber(0); }
+ return this->fFlowBits.TestBitNumber(0); }
inline Bool_t AliFlowTrackSimple::UseForDifferentialFlow() const {
- return fFlowBits.TestBitNumber(1); }
+ return this->fFlowBits.TestBitNumber(1); }
inline void AliFlowTrackSimple::SetEta(Double_t val) {
fEta = val; }
TChain* CreateESDChain(const char* aDataDir = "ESDfiles.txt", Int_t aRuns = 20, Int_t offset = 0) ;
void LookupWrite(TChain* chain, const char* target) ;
+//SETTING THE ANALYSIS
+//Flow analysis method can be:
+// SP = Scalar Product
+// LYZ1 = Lee Yang Zeroes first run
+// LYZ2 = Lee Yang Zeroes second run
+// LYZEP = Lee Yang Zeroes Event Plane
+// CUM = Cumulants
+const TString method = "SP";
+
+//Type of analysis can be:
+// ESD, AOD, MC, ESDMC0, ESDMC1
+const TString type = "ESDMC1";
+
+
+//SETTING THE CUTS
+
+//for integrated flow
+const Double_t ptmin1 = 0.0;
+const Double_t ptmax1 = 1000.0;
+const Double_t ymin1 = -2.;
+const Double_t ymax1 = 2.;
+const Int_t mintrackrefsTPC1 = 2;
+const Int_t mintrackrefsITS1 = 3;
+const Int_t charge1 = 1;
+const Int_t PDG1 = 211;
+const Int_t minclustersTPC1 = 50;
+const Int_t maxnsigmatovertex1 = 3;
+
+//for differential flow
+const Double_t ptmin2 = 0.0;
+const Double_t ptmax2 = 1000.0;
+const Double_t ymin2 = -2.;
+const Double_t ymax2 = 2.;
+const Int_t mintrackrefsTPC2 = 2;
+const Int_t mintrackrefsITS2 = 3;
+const Int_t charge2 = 1;
+const Int_t PDG2 = 321;
+const Int_t minclustersTPC2 = 50;
+const Int_t maxnsigmatovertex2 = 3;
+
+
+
+void runAliAnalysisTaskFlow(Int_t nRuns = 10, const Char_t* dataDir="/data/alice1/kolk/TherminatorFIX", Int_t offset = 0)
-void runAliAnalysisTaskFlow(Int_t nRuns = 2, TString type = "ESD", Bool_t firstrun = kTRUE, Bool_t usesum = kTRUE, const Char_t* dataDir="/Users/snelling/alice_data/TherminatorFIX", Int_t offset = 0)
{
TStopwatch timer;
timer.Start();
+ // include path (to find the .h files when compiling)
+ gSystem->AddIncludePath("-I$ALICE_ROOT/include") ;
+ gSystem->AddIncludePath("-I$ROOTSYS/include") ;
+
// load needed libraries
gSystem->Load("libTree.so");
gSystem->Load("libESD.so");
cerr<<"libESD loaded..."<<endl;
gSystem->Load("libANALYSIS.so");
cerr<<"libANALYSIS.so loaded..."<<endl;
+ gSystem->Load("libANALYSISRL.so");
+ cerr<<"libANALYSISRL.so loaded..."<<endl;
+ gSystem->Load("libCORRFW.so");
+ cerr<<"libCORRFW.so loaded..."<<endl;
gSystem->Load("libPWG2flow.so");
-
+ cerr<<"libPWG2flow.so loaded..."<<endl;
+
// create the TChain. CreateESDChain() is defined in CreateESDChain.C
TChain* chain = CreateESDChain(dataDir, nRuns, offset);
cout<<"chain ("<<chain<<")"<<endl;
+
+ //____________________________________________//
+ //Create cuts using correction framework
+
+ //############# cuts on MC
+ AliCFTrackKineCuts* mcKineCuts1 = new AliCFTrackKineCuts("mcKineCuts1","MC-level kinematic cuts");
+ mcKineCuts1->SetPtRange(ptmin1,ptmax1);
+ mcKineCuts1->SetRapidityRange(ymin1,ymax1);
+ mcKineCuts1->SetChargeMC(charge1);
+
+ AliCFTrackKineCuts* mcKineCuts2 = new AliCFTrackKineCuts("mcKineCuts2","MC-level kinematic cuts");
+ mcKineCuts2->SetPtRange(ptmin2,ptmax2);
+ mcKineCuts2->SetRapidityRange(ymin2,ymax2);
+ mcKineCuts2->SetChargeMC(charge2);
+
+ AliCFParticleGenCuts* mcGenCuts1 = new AliCFParticleGenCuts("mcGenCuts1","MC particle generation cuts");
+ mcGenCuts1->SetRequireIsPrimary();
+ mcGenCuts1->SetRequirePdgCode(PDG1);
+
+ AliCFParticleGenCuts* mcGenCuts2 = new AliCFParticleGenCuts("mcGenCuts2","MC particle generation cuts");
+ mcGenCuts2->SetRequireIsPrimary();
+ mcGenCuts2->SetRequirePdgCode(PDG2);
+
+ //############# Acceptance Cuts ????????
+ AliCFAcceptanceCuts *mcAccCuts = new AliCFAcceptanceCuts("mcAccCuts","MC acceptance cuts");
+ mcAccCuts->SetMinNHitITS(mintrackrefsITS1);
+ mcAccCuts->SetMinNHitTPC(mintrackrefsTPC1);
+
+ //############# Rec-Level kinematic cuts
+ AliCFTrackKineCuts *recKineCuts1 = new AliCFTrackKineCuts("recKineCuts1","rec-level kine cuts");
+ recKineCuts1->SetPtRange(ptmin1,ptmax1);
+ recKineCuts1->SetRapidityRange(ymin1,ymax1);
+ recKineCuts1->SetChargeRec(charge1);
+
+ AliCFTrackKineCuts *recKineCuts2 = new AliCFTrackKineCuts("recKineCuts2","rec-level kine cuts");
+ recKineCuts2->SetPtRange(ptmin2,ptmax2);
+ recKineCuts2->SetRapidityRange(ymin2,ymax2);
+ recKineCuts2->SetChargeRec(charge2);
+
+ AliCFTrackQualityCuts *recQualityCuts = new AliCFTrackQualityCuts("recQualityCuts","rec-level quality cuts");
+ recQualityCuts->SetMinNClusterTPC(minclustersTPC1);
+ recQualityCuts->SetRequireITSRefit(kTRUE);
+
+ AliCFTrackIsPrimaryCuts *recIsPrimaryCuts = new AliCFTrackIsPrimaryCuts("recIsPrimaryCuts","rec-level isPrimary cuts");
+ recIsPrimaryCuts->SetMaxNSigmaToVertex(maxnsigmatovertex1);
+
+ AliCFTrackCutPid* cutPID1 = new AliCFTrackCutPid("cutPID1","ESD_PID") ;
+ AliCFTrackCutPid* cutPID2 = new AliCFTrackCutPid("cutPID2","ESD_PID") ;
+ int n_species = AliPID::kSPECIES ;
+ Double_t* prior = new Double_t[n_species];
+
+ prior[0] = 0.0244519 ;
+ prior[1] = 0.0143988 ;
+ prior[2] = 0.805747 ;
+ prior[3] = 0.0928785 ;
+ prior[4] = 0.0625243 ;
+
+ cutPID1->SetPriors(prior);
+ cutPID1->SetProbabilityCut(0.0);
+ cutPID1->SetDetectors("TPC TOF");
+ switch(TMath::Abs(PDG1)) {
+ case 11 : cutPID1->SetParticleType(AliPID::kElectron, kTRUE); break;
+ case 13 : cutPID1->SetParticleType(AliPID::kMuon , kTRUE); break;
+ case 211 : cutPID1->SetParticleType(AliPID::kPion , kTRUE); break;
+ case 321 : cutPID1->SetParticleType(AliPID::kKaon , kTRUE); break;
+ case 2212 : cutPID1->SetParticleType(AliPID::kProton , kTRUE); break;
+ default : printf("UNDEFINED PID\n"); break;
+ }
+
+ cutPID2->SetPriors(prior);
+ cutPID2->SetProbabilityCut(0.0);
+ cutPID2->SetDetectors("TPC TOF");
+ switch(TMath::Abs(PDG2)) {
+ case 11 : cutPID2->SetParticleType(AliPID::kElectron, kTRUE); break;
+ case 13 : cutPID2->SetParticleType(AliPID::kMuon , kTRUE); break;
+ case 211 : cutPID2->SetParticleType(AliPID::kPion , kTRUE); break;
+ case 321 : cutPID2->SetParticleType(AliPID::kKaon , kTRUE); break;
+ case 2212 : cutPID2->SetParticleType(AliPID::kProton , kTRUE); break;
+ default : printf("UNDEFINED PID\n"); break;
+ }
+
+
+ printf("CREATE MC KINE CUTS\n");
+ TObjArray* mcList1 = new TObjArray(0);
+ mcList1->AddLast(mcKineCuts1);
+ mcList1->AddLast(mcGenCuts1);
+
+ TObjArray* mcList2 = new TObjArray(0);
+ mcList2->AddLast(mcKineCuts2);
+ mcList2->AddLast(mcGenCuts2);
+
+ printf("CREATE ACCEPTANCE CUTS\n");
+ TObjArray* accList = new TObjArray(0) ;
+ accList->AddLast(mcAccCuts);
+
+ printf("CREATE RECONSTRUCTION CUTS\n");
+ TObjArray* recList1 = new TObjArray(0) ;
+ recList1->AddLast(recKineCuts1);
+ recList1->AddLast(recQualityCuts);
+ recList1->AddLast(recIsPrimaryCuts);
+
+ TObjArray* recList2 = new TObjArray(0) ;
+ recList2->AddLast(recKineCuts2);
+ recList2->AddLast(recQualityCuts);
+ recList2->AddLast(recIsPrimaryCuts);
+
+ printf("CREATE PID CUTS\n");
+ TObjArray* fPIDCutList1 = new TObjArray(0) ;
+ fPIDCutList1->AddLast(cutPID1);
+
+ TObjArray* fPIDCutList2 = new TObjArray(0) ;
+ fPIDCutList2->AddLast(cutPID2);
- //----------------------------------------------------
- //-----------------standard Lee Yang Zeros------------
- if (!firstrun){
- // read the input files
- TString firstRunFileName = "outputFromLeeYangZerosAnalysis" ;
+ printf("CREATE INTERFACE AND CUTS\n");
+ AliCFManager* cfmgr1 = new AliCFManager();
+ cfmgr1->SetParticleCutsList(AliCFManager::kPartGenCuts,mcList1);
+ //cfmgr1->SetParticleCutsList(AliCFManager::kPartAccCuts,accList);
+ cfmgr1->SetParticleCutsList(AliCFManager::kPartRecCuts,recList1);
+ cfmgr1->SetParticleCutsList(AliCFManager::kPartSelCuts,fPIDCutList1);
+
+ AliCFManager* cfmgr2 = new AliCFManager();
+ cfmgr2->SetParticleCutsList(AliCFManager::kPartGenCuts,mcList2);
+ //cfmgr2->SetParticleCutsList(AliCFManager::kPartAccCuts,accList);
+ cfmgr2->SetParticleCutsList(AliCFManager::kPartRecCuts,recList2);
+ cfmgr2->SetParticleCutsList(AliCFManager::kPartSelCuts,fPIDCutList2);
+
+
+ if (method == "LYZ2"){
+ // read the input files from the first run
+ TString firstRunFileName = "outputLYZ1analysis" ;
firstRunFileName += type;
firstRunFileName += "_firstrun.root";
+ cout<<"The input file is "<<firstRunFileName.Data()<<endl;
TFile* fFirstRunFile = new TFile(firstRunFileName.Data(),"READ");
if(!fFirstRunFile || fFirstRunFile->IsZombie()) { cerr << " ERROR: NO First Run file... " << endl ; }
cout<<"input files read..."<<endl;
}
- //----------------------------------------------------
- //-----------------Lee Yang Zeros Event Plane---------
- /*
- // read the input files
- TString firstRunFileName = "outputFromLeeYangZerosAnalysis" ;
- firstRunFileName += type;
- firstRunFileName += "_firstrun.root";
- TFile* fFirstRunFile = new TFile(firstRunFileName.Data(),"READ");
- if(!fFirstRunFile || fFirstRunFile->IsZombie()) { cerr << " ERROR: NO First Run file... " << endl ; }
- TString secondRunFileName = "outputFromLeeYangZerosAnalysis" ;
- secondRunFileName += type;
- secondRunFileName += "_secondrun.root";
- TFile* fSecondRunFile = new TFile(secondRunFileName.Data(),"READ");
- if(!fSecondRunFile || fSecondRunFile->IsZombie()) { cerr << " ERROR: NO Second Run file... " << endl ; }
- cout<<"input files read..."<<endl;
- */
-
- //----------------------------------------------------
- //-----------------Monte Carlo Event Plane------------
- //no extra input files
-
//____________________________________________//
// Make the analysis manager
- AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
- AliVEventHandler* esdH = new AliESDInputHandler;
- mgr->SetInputEventHandler(esdH);
- AliVEventHandler* aodH = new AliAODInputHandler;
- mgr->SetInputEventHandler(aodH);
- AliMCEventHandler *mc = new AliMCEventHandler();
- mgr->SetMCtruthEventHandler(mc);
- //____________________________________________//
- //----------------------------------------------------
- //-----------------standard Lee Yang Zeros------------
- // 1st LYZ task
- AliAnalysisTaskLeeYangZeros *task1 = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZeros", firstrun);
- task1->SetAnalysisType(type);
- task1->SetFirstRunLYZ(firstrun); //set to first or second run
- task1->SetUseSumLYZ(usesum); //set to sum gen.function or product gen.function
- mgr->AddTask(task1);
+ AliAnalysisManager *mgr = new AliAnalysisManager("FlowAnalysisManager");
+
+ if (type == "ESD"){
+ AliVEventHandler* esdH = new AliESDInputHandler;
+ mgr->SetInputEventHandler(esdH); }
+
+ if (type == "AOD"){
+ AliVEventHandler* aodH = new AliAODInputHandler;
+ mgr->SetInputEventHandler(aodH); }
+
+ if (type == "MC" || type == "ESDMC0" || type == "ESDMC1"){
+ AliVEventHandler* esdH = new AliESDInputHandler;
+ mgr->SetInputEventHandler(esdH);
- // Create containers for input/output
- AliAnalysisDataContainer *cinput1 =
- mgr->CreateContainer("cchain1",TChain::Class(),AliAnalysisManager::kInputContainer);
- if (!firstrun){ AliAnalysisDataContainer *cinput2 =
- mgr->CreateContainer("cobj2",TList::Class(),AliAnalysisManager::kInputContainer); }
- AliAnalysisDataContainer *coutput1 =
- mgr->CreateContainer("cobj1", TList::Class(),AliAnalysisManager::kOutputContainer);
+ AliMCEventHandler *mc = new AliMCEventHandler();
+ mgr->SetMCtruthEventHandler(mc); }
+
+ //____________________________________________//
+ // 1st MC EP task
+ if (method == "SP"){
+ AliAnalysisTaskScalarProduct *task1 = new AliAnalysisTaskScalarProduct("TaskScalarProduct");
+ task1->SetAnalysisType(type);
+ task1->SetCFManager1(cfmgr1);
+ task1->SetCFManager2(cfmgr2);
+ mgr->AddTask(task1);
+ }
+ else if (method == "LYZ1"){
+ AliAnalysisTaskLeeYangZeros *task1 = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZeros",kTRUE);
+ task1->SetAnalysisType(type);
+ task1->SetFirstRunLYZ(kTRUE);
+ task1->SetUseSumLYZ(kTRUE);
+ task1->SetCFManager1(cfmgr1);
+ task1->SetCFManager2(cfmgr2);
+ mgr->AddTask(task1);
+ }
+ else if (method == "LYZ2"){
+ AliAnalysisTaskLeeYangZeros *task1 = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZeros",kFALSE);
+ task1->SetAnalysisType(type);
+ task1->SetFirstRunLYZ(kFALSE);
+ task1->SetUseSumLYZ(kTRUE);
+ task1->SetCFManager1(cfmgr1);
+ task1->SetCFManager2(cfmgr2);
+ mgr->AddTask(task1);
+ }
+ else if (method == "LYZEP"){
+ AliAnalysisTaskLYZEventPlane *task1 = new AliAnalysisTaskLYZEventPlane("TaskLYZEventPlane");
+ task1->SetAnalysisType(type);
+ //task1->SetCFManager1(cfmgr1);
+ //task1->SetCFManager2(cfmgr2);
+ mgr->AddTask(task1);
+ }
+ else if (method == "CUM"){
+ AliAnalysisTaskCumulants *task1 = new AliAnalysisTaskCumulants("TaskCumulants");
+ task1->SetAnalysisType(type);
+ //task1->SetCFManager1(cfmgr1);
+ //task1->SetCFManager2(cfmgr2);
+ mgr->AddTask(task1);
+ }
- //----------------------------------------------------
- //-----------------Lee Yang Zeros Event Plane---------
- /*
- // 1st LYZ EP task
- AliAnalysisTaskLYZEventPlane *task1 = new AliAnalysisTaskLYZEventPlane("TaskLYZEventPlane");
- task1->SetAnalysisType(type);
- mgr->AddTask(task1);
// Create containers for input/output
AliAnalysisDataContainer *cinput1 =
mgr->CreateContainer("cchain1",TChain::Class(),AliAnalysisManager::kInputContainer);
- AliAnalysisDataContainer *cinput2 =
- mgr->CreateContainer("cobj2",TList::Class(),AliAnalysisManager::kInputContainer);
- AliAnalysisDataContainer *cinput3 =
- mgr->CreateContainer("cobj3",TList::Class(),AliAnalysisManager::kInputContainer);
- AliAnalysisDataContainer *coutput1 =
- mgr->CreateContainer("cobj1", TList::Class(),AliAnalysisManager::kOutputContainer);
- */
- //----------------------------------------------------
- //-----------------Monte Carlo Event Plane------------
- /*
- // 1st MC EP task
- AliAnalysisTaskMCEventPlane *task1 = new AliAnalysisTaskMCEventPlane("TaskMCEventPlane");
- task1->SetAnalysisType(type);
- mgr->AddTask(task1);
+ if (method == "LYZ2"){ AliAnalysisDataContainer *cinput2 =
+ mgr->CreateContainer("cobj2",TList::Class(),AliAnalysisManager::kInputContainer); }
- // Create containers for input/output
- AliAnalysisDataContainer *cinput1 =
- mgr->CreateContainer("cchain1",TChain::Class(),AliAnalysisManager::kInputContainer);
+
+ TString outputName = "output";
+ outputName+= method;
+ outputName+= "analysis";
+ outputName+= type;
+ if (method == "LYZ1") outputName+= "_firstrun";
+ if (method == "LYZ2") outputName+= "_secondrun";
+ outputName+= ".root";
AliAnalysisDataContainer *coutput1 =
- mgr->CreateContainer("cobj1", TList::Class(),AliAnalysisManager::kOutputContainer);
- */
+ mgr->CreateContainer("cobj1", TList::Class(),AliAnalysisManager::kOutputContainer,outputName);
//____________________________________________//
- //----------------------------------------------------
- //-----------------standard Lee Yang Zeros------------
mgr->ConnectInput(task1,0,cinput1);
- if (!firstrun) { mgr->ConnectInput(task1,1,cinput2); }
+ if (method == "LYZ2") { mgr->ConnectInput(task1,1,cinput2); }
mgr->ConnectOutput(task1,0,coutput1);
- if (!firstrun){ cinput2->SetData(fFirstRunFile);}
-
- //----------------------------------------------------
- //-----------------Lee Yang Zeros Event Plane---------
- /*
- mgr->ConnectInput(task1,0,cinput1);
- mgr->ConnectInput(task1,1,cinput2);
- mgr->ConnectInput(task1,2,cinput3);
- mgr->ConnectOutput(task1,0,coutput1);
-
- cinput2->SetData(fFirstRunFile);
- cinput3->SetData(fSecondRunFile);
- */
-
- //----------------------------------------------------
- //-----------------Monte Carlo Event Plane------------
- /*
- mgr->ConnectInput(task1,0,cinput1);
- mgr->ConnectOutput(task1,0,coutput1);
- */
+ if (method == "LYZ2"){ cinput2->SetData(fFirstRunFile);}
if (!mgr->InitAnalysis()) return;
mgr->PrintStatus();
delete iter;
}
-