ClassImp(FlowEventSimpleMaker)
//-----------------------------------------------------------------------
-FlowEventSimpleMaker::FlowEventSimpleMaker()
+FlowEventSimpleMaker::FlowEventSimpleMaker():
+ fMCReactionPlaneAngle(0.),
+ fCount(0)
{
//constructor
}
}
//-----------------------------------------------------------------------
-AliFlowEventSimple* FlowEventSimpleMaker::FillTracks(TTree* anInput, AliFlowTrackSimpleCuts* RPCuts, AliFlowTrackSimpleCuts* POICuts)
+AliFlowEventSimple* FlowEventSimpleMaker::FillTracks(TTree* anInput, AliFlowTrackSimpleCuts* rpCuts, AliFlowTrackSimpleCuts* poiCuts)
{
//fills the event from a TTree of kinematic.root files
// number of times to use the same particle (trick to introduce nonflow)
Int_t iLoops = 1;
- //flags for particles passing RP and POI cuts
- Bool_t bPassedRPCuts = kFALSE;
- Bool_t bPassedPOICuts = kFALSE;
+ //flags for particles passing int. and diff. flow cuts
+ Bool_t bPassedRPFlowCuts = kFALSE;
+ Bool_t bPassedPOIFlowCuts = kFALSE;
//track cut values
- Double_t dPtMaxRP = RPCuts->GetPtMax();
- Double_t dPtMinRP = RPCuts->GetPtMin();
- Double_t dEtaMaxRP = RPCuts->GetEtaMax();
- Double_t dEtaMinRP = RPCuts->GetEtaMin();
- Double_t dPhiMaxRP = RPCuts->GetPhiMax();
- Double_t dPhiMinRP = RPCuts->GetPhiMin();
- Int_t iPIDRP = RPCuts->GetPID();
+ Double_t dPtMaxRP = rpCuts->GetPtMax();
+ Double_t dPtMinRP = rpCuts->GetPtMin();
+ Double_t dEtaMaxRP = rpCuts->GetEtaMax();
+ Double_t dEtaMinRP = rpCuts->GetEtaMin();
+ Double_t dPhiMaxRP = rpCuts->GetPhiMax();
+ Double_t dPhiMinRP = rpCuts->GetPhiMin();
+ Int_t iPIDRP = rpCuts->GetPID();
- Double_t dPtMaxPOI = POICuts->GetPtMax();
- Double_t dPtMinPOI = POICuts->GetPtMin();
- Double_t dEtaMaxPOI = POICuts->GetEtaMax();
- Double_t dEtaMinPOI = POICuts->GetEtaMin();
- Double_t dPhiMaxPOI = POICuts->GetPhiMax();
- Double_t dPhiMinPOI = POICuts->GetPhiMin();
- Int_t iPIDPOI = POICuts->GetPID();
+ Double_t dPtMaxPOI = poiCuts->GetPtMax();
+ Double_t dPtMinPOI = poiCuts->GetPtMin();
+ Double_t dEtaMaxPOI = poiCuts->GetEtaMax();
+ Double_t dEtaMinPOI = poiCuts->GetEtaMin();
+ Double_t dPhiMaxPOI = poiCuts->GetPhiMax();
+ Double_t dPhiMinPOI = poiCuts->GetPhiMin();
+ Int_t iPIDPOI = poiCuts->GetPID();
Int_t iNumberOfInputTracks = anInput->GetEntries() ;
- //cerr<<"iNumberOfInputTracks = "<<iNumberOfInputTracks<<endl;
+
TParticle* pParticle = new TParticle();
anInput->SetBranchAddress("Particles",&pParticle);
// AliFlowEventSimple* pEvent = new AliFlowEventSimple(iNumberOfInputTracks);
AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
- //cerr<<pEvent<<" pEvent "<<endl;
Int_t iN = iNumberOfInputTracks; // additional variable to artificially fix the number of tracks
// Int_t iN = 576; //multiplicity for chi=1.5
Int_t iGoodTracks = 0;
Int_t itrkN = 0;
+ Int_t iSelParticlesRP = 0;
Int_t iSelParticlesPOI = 0;
- Int_t iSelParticlesRP = 0;
+
while (itrkN < iNumberOfInputTracks) {
anInput->GetEntry(itrkN); //get input particle
- //checking the cuts for int. and diff. flow
- if (pParticle->Pt() > dPtMinRP && pParticle->Pt() < dPtMaxRP &&
- pParticle->Eta() > dEtaMinRP && pParticle->Eta() < dEtaMaxRP &&
- pParticle->Phi() > dPhiMinRP && pParticle->Phi() < dPhiMaxRP &&
- TMath::Abs(pParticle->GetPdgCode()) == iPIDRP) {
- bPassedRPCuts = kTRUE;
- }
+ if (pParticle->IsPrimary()) {
+ //checking the cuts for int. and diff. flow
+ if (pParticle->Pt() > dPtMinRP && pParticle->Pt() < dPtMaxRP &&
+ pParticle->Eta() > dEtaMinRP && pParticle->Eta() < dEtaMaxRP &&
+ pParticle->Phi() > dPhiMinRP && pParticle->Phi() < dPhiMaxRP &&
+ TMath::Abs(pParticle->GetPdgCode()) == iPIDRP) {
+ bPassedRPFlowCuts = kTRUE;
+ }
- if (pParticle->Pt() > dPtMinPOI && pParticle->Pt() < dPtMaxPOI &&
- pParticle->Eta() > dEtaMinPOI && pParticle->Eta() < dEtaMaxPOI &&
- pParticle->Phi() > dPhiMinPOI && pParticle->Phi() < dPhiMaxPOI &&
- TMath::Abs(pParticle->GetPdgCode()) == iPIDPOI){
- bPassedPOICuts = kTRUE;
+ if (pParticle->Pt() > dPtMinPOI && pParticle->Pt() < dPtMaxPOI &&
+ pParticle->Eta() > dEtaMinPOI && pParticle->Eta() < dEtaMaxPOI &&
+ pParticle->Phi() > dPhiMinPOI && pParticle->Phi() < dPhiMaxPOI &&
+ TMath::Abs(pParticle->GetPdgCode()) == iPIDPOI){
+ bPassedPOIFlowCuts = kTRUE;
+ }
}
-
- if (bPassedRPCuts || bPassedPOICuts) {
+ if (bPassedRPFlowCuts || bPassedPOIFlowCuts) {
for(Int_t d=0;d<iLoops;d++) {
AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
pTrack->SetPt(pParticle->Pt());
pTrack->SetPhi(pParticle->Phi());
//marking the particles used for int. flow:
- if(bPassedRPCuts && iSelParticlesRP < iN*iLoops) {
- //pTrack->SetForIntegratedFlow(kTRUE);
+ if(bPassedRPFlowCuts && iSelParticlesRP < iN*iLoops) {
pTrack->SetForRPSelection(kTRUE);
iSelParticlesRP++;
}
//marking the particles used for diff. flow:
- if(bPassedPOICuts) {
+ if(bPassedPOIFlowCuts) {
pTrack->SetForPOISelection(kTRUE);
iSelParticlesPOI++;
}
}//end of for(Int_t d=0;d<iLoops;d++)
}//end of if(bPassedIntFlowCuts || bPassedDiffFlowCuts)
itrkN++;
- bPassedRPCuts = kFALSE;
- bPassedPOICuts = kFALSE;
+ bPassedRPFlowCuts = kFALSE;
+ bPassedPOIFlowCuts = kFALSE;
}//end of while (itrkN < iNumberOfInputTracks)
pEvent->SetEventNSelTracksRP(iSelParticlesRP);
- pEvent->SetNumberOfTracks(iGoodTracks);//tracks used either for int. or for diff. flow
+ pEvent->SetNumberOfTracks(iGoodTracks);//tracks used either for RP or for POI selection
+ pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle);
+
+ if (!fMCReactionPlaneAngle == 0) cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl;
+ else cout<<" MC Reaction Plane Angle = unknown "<< endl;
- cout<<" iGoodTracks = "<<iGoodTracks<<endl;
- cout<<" # of selected tracks for RP = "<<iSelParticlesRP<<endl;
- cout<<" # of selected tracks for POI = "<<iSelParticlesPOI<<endl;
+ cout<<" iGoodTracks = "<< iGoodTracks << endl;
+ cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl;
+ cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl;
+ cout << "# " << ++fCount << " events processed" << endl;
delete pParticle;
return pEvent;
private:
FlowEventSimpleMaker(const FlowEventSimpleMaker& anAnalysis); //copy constructor
FlowEventSimpleMaker& operator=(const FlowEventSimpleMaker& anAnalysis); //assignment operator
-
+ Double_t fMCReactionPlaneAngle; // the angle of the reaction plane from the MC truth
+ Int_t fCount; // counter for the number of events processed
+
ClassDef(FlowEventSimpleMaker,0) // macro for rootcint
};
//type of analysis can be: ESD, AOD, MC, ESDMC0, ESDMC1
//const TString type = "ESD";
-void compareFlowResults(TString type="ESD")
+
+enum libModes {mLocal,mLocalSource};
+//mLocal: Analyze data on your computer using aliroot
+//mLocalSource: Analyze data on your computer using root + source files
+
+//void compareFlowResults(TString type="",Int_t mode=mLocalSource)
+void compareFlowResults(TString type="ESD",Int_t mode=mLocal)
{
+
+ // load needed libraries:
+ LoadLibraries(mode);
+
+
//==================================================================================
// set here which plots will be shown by default
//==================================================================================
Bool_t plotDiffFlowEtaPOI = kTRUE; //differential flow (Eta,POI)
//==================================================================================
-
+
//==================================================================================
// set here which methods will be plotted by default for differential flow (Pt,RP):
Bool_t plotMCPtRP = kFALSE;
// LYZEP
Int_t binLYZEPPOI = 13;
//==================================================================================
-
-
- //==================================================================================
- //load needed libraries:
- gSystem->AddIncludePath("-I$ROOTSYS/include");
- gSystem->Load("libTree.so");
-
- // for AliRoot
- gSystem->AddIncludePath("-I$ALICE_ROOT/include");
- gSystem->Load("libANALYSIS.so");
- gSystem->Load("libPWG2flowCommon.so");
- cerr<<"libPWG2flowCommon.so loaded ..."<<endl;
-
- // for root load histrogram classes
- // output histosgrams
- // gROOT->LoadMacro("code/AliFlowCommonHist.cxx+");
- // gROOT->LoadMacro("code/AliFlowCommonHistResults.cxx+");
- // gROOT->LoadMacro("code/AliFlowLYZHist1.cxx+");
- // gROOT->LoadMacro("code/AliFlowLYZHist2.cxx+");
- //==================================================================================
-
-
+
+
//==================================================================================
// accessing output files
//==================================================================================
//=====================================================================================
}
+
+void LoadLibraries(const libModes mode) {
+
+ //--------------------------------------
+ // Load the needed libraries most of them already loaded by aliroot
+ //--------------------------------------
+ gSystem->Load("libTree.so");
+ gSystem->Load("libGeom.so");
+ gSystem->Load("libVMC.so");
+ gSystem->Load("libXMLIO.so");
+ gSystem->Load("libPhysics.so");
+
+ //----------------------------------------------------------
+ // >>>>>>>>>>> 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.so");
+
+ // for AliRoot
+ gSystem->AddIncludePath("-I$ALICE_ROOT/include");
+ gSystem->Load("libANALYSIS.so");
+ gSystem->Load("libPWG2flowCommon.so");
+ cerr<<"libPWG2flowCommon.so loaded ..."<<endl;
+
+ }
+
+ else if (mode==mLocalSource) {
+
+ // In root inline compile
+
+
+ // Output histosgrams
+ gROOT->LoadMacro("AliFlowCommon/AliFlowCommonHist.cxx+");
+ gROOT->LoadMacro("AliFlowCommon/AliFlowCommonHistResults.cxx+");
+ gROOT->LoadMacro("AliFlowCommon/AliFlowLYZHist1.cxx+");
+ gROOT->LoadMacro("AliFlowCommon/AliFlowLYZHist2.cxx+");
+
+ cout << "finished loading macros!" << endl;
+
+ }
+
+}
+
+
// 3. cumulant order can be: 2nd, 4th, 6th or 8th.
//==========================================================================================
-void makeWeights(TString type="ESD", TString method="GFC", TString cumulantOrder="4th")
+
+enum libModes {mLocal,mLocalSource};
+//mLocal: Analyze data on your computer using aliroot
+//mLocalSource: Analyze data on your computer using root + source files
+
+
+//void makeWeights(TString type="", TString method="GFC", TString cumulantOrder="4th", Int_t mode=mLocalSource)
+void makeWeights(TString type="ESD", TString method="GFC", TString cumulantOrder="4th", Int_t mode=mLocal)
{
// load needed libraries:
- gSystem->AddIncludePath("-I$ROOTSYS/include");
- gSystem->Load("libTree.so");
+ LoadLibraries(mode);
- // for AliRoot
- gSystem->AddIncludePath("-I$ALICE_ROOT/include");
- gSystem->Load("libANALYSIS.so");
- gSystem->Load("libPWG2flowCommon.so");
- cerr<<"libPWG2flowCommon.so loaded ..."<<endl;
// open the output file from the first run of the specified method:
TString inputFileName = "output";
}
+void LoadLibraries(const libModes mode) {
+
+ //--------------------------------------
+ // Load the needed libraries most of them already loaded by aliroot
+ //--------------------------------------
+ gSystem->Load("libTree.so");
+ gSystem->Load("libGeom.so");
+ gSystem->Load("libVMC.so");
+ gSystem->Load("libXMLIO.so");
+ gSystem->Load("libPhysics.so");
+
+ //----------------------------------------------------------
+ // >>>>>>>>>>> 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.so");
+
+ // for AliRoot
+ gSystem->AddIncludePath("-I$ALICE_ROOT/include");
+ gSystem->Load("libANALYSIS.so");
+ gSystem->Load("libPWG2flowCommon.so");
+ cerr<<"libPWG2flowCommon.so loaded ..."<<endl;
+
+ }
+
+ else if (mode==mLocalSource) {
+
+ // In root inline compile
+
+ // Output histosgrams
+ gROOT->LoadMacro("AliFlowCommon/AliFlowCommonHist.cxx+");
+ gROOT->LoadMacro("AliFlowCommon/AliFlowCommonHistResults.cxx+");
+ gROOT->LoadMacro("AliFlowCommon/AliFlowLYZHist1.cxx+");
+ gROOT->LoadMacro("AliFlowCommon/AliFlowLYZHist2.cxx+");
+
+ cout << "finished loading macros!" << endl;
+
+ }
+
+}
+
+
//------------------------------------------------------------------------
- //standard code
+ //standard code to read files in directory
Int_t fCount = 0;
TString execDir(gSystem->pwd());
TString targetDir(dir);
//fill and save the flow event
AliFlowEventSimple *fEvent = fEventMaker->FillTracks(kTree, cutsInt, cutsDiff);
+ // do flow analysis for various methods
if(MCEP) mcep->Make(fEvent);
if(QC) qc->Make(fEvent);
if(GFC) gfc->Make(fEvent);