//________________________________________________________________________
AliAnalysisTaskScalarProduct::AliAnalysisTaskScalarProduct(const char *name) :
AliAnalysisTask(name, ""),
- fESD(0),
- fAOD(0),
- fSP(0),
- fEventMaker(0),
- fAnalysisType("ESD")
+ fESD(NULL),
+ fAOD(NULL),
+ fSP(NULL),
+ fEventMaker(NULL),
+ fAnalysisType("ESD"),
+ fListHistos(NULL)
{
// Constructor
cout<<"AliAnalysisTaskScalarProduct::AliAnalysisTaskScalarProduct(const char *name)"<<endl;
DefineInput(0, TChain::Class());
// Output slot #0 writes into a TList container
DefineOutput(0, TList::Class());
+
+ //event maker
+ fEventMaker = new AliFlowEventSimpleMaker();
+ //Analyser
+ fSP = new AliFlowAnalysisWithScalarProduct() ;
+ fSP-> Init();
}
//________________________________________________________________________
{
// Called once
cout<<"AliAnalysisTaskScalarProduct::CreateOutputObjects()"<<endl;
+
- if (!(fAnalysisType == "AOD" || fAnalysisType == "ESD" || fAnalysisType == "MC")) {
- cout<<"WRONG ANALYSIS TYPE! only ESD, AOD and MC are allowed."<<endl;
- exit(1);
+ if (fSP->GetHistList()) {
+ fSP->GetHistList()->Print();
+// *fListHistos = new TList();
+ fListHistos = fSP->GetHistList();
}
-
- //event maker
- fEventMaker = new AliFlowEventSimpleMaker();
- //Analyser
- fSP = new AliFlowAnalysisWithScalarProduct() ;
-
- //output file
- TString outputName = "outputFromScalarProductAnalysis" ;
- outputName += fAnalysisType.Data() ;
- outputName += ".root" ;
- fSP->SetHistFileName( outputName.Data() );
-
- fSP-> Init();
-
-
+ else {Printf("ERROR: Could not retrieve histogram list"); }
}
//________________________________________________________________________
delete fEvent;
}
+ PostData(0,fListHistos);
}
//________________________________________________________________________
{
// Called once at the end of the query
fSP->Finish();
- PostData(0,fSP->GetHistFile());
+ PostData(0,fListHistos);
delete fSP;
delete fEventMaker;
AliFlowAnalysisWithScalarProduct* fSP; // analysis object
AliFlowEventSimpleMaker* fEventMaker; // FlowEventSimple maker object
TString fAnalysisType; // can be MC, ESD or AOD
+ TList *fListHistos; //collection of output
ClassDef(AliAnalysisTaskScalarProduct, 1); // example of analysis
};
#include "Riostream.h" //needed as include
#include "TFile.h" //needed as include
+#include "TList.h"
#include "TMath.h"
#include "TProfile.h"
#include "TVector2.h"
fQ(NULL),
fU(NULL),
fEventNumber(0),
- fTrack(NULL),
fDebug(kFALSE),
- fHistFileName(0),
- fHistFile(NULL),
+ fHistList(NULL),
fHistProUQ(NULL),
fCommonHists(NULL)
{
-
// Constructor.
fU = new TVector2;
fQ = new AliFlowVector;
+ fHistList = new TList();
// fQ.Set(0.,0.); // flow vector
// fU.Set(0.,0.); // particle unit vector
-
}
//-----------------------------------------------------------------------
{
delete fU;
delete fQ;
+ delete fHistList;
//destructor
}
void AliFlowAnalysisWithScalarProduct::Init() {
//Define all histograms
- cout<<"---Analysis with the Scalar Product Method---"<<endl;
+ cout<<"---Analysis with the Scalar Product Method--- Init"<<endl;
Int_t fNbinsPt = AliFlowCommonConstants::GetNbinsPt();
Double_t fPtMin = AliFlowCommonConstants::GetPtMin();
Double_t fPtMax = AliFlowCommonConstants::GetPtMax();
// analysis file (output)
- fHistFile = new TFile(fHistFileName.Data(),"RECREATE") ;
fHistProUQ = new TProfile("Flow_UQ_SP","Flow_UQ_SP",fNbinsPt,fPtMin,fPtMax);
fHistProUQ->SetXTitle("p_t (GeV)");
fHistProUQ->SetYTitle("<uQ>");
+ fHistList->Add(fHistProUQ);
fCommonHists = new AliFlowCommonHist("SP");
//fCommonHistsRes = new AliFlowCommonHistResults("SP");
-
+ fHistList->Add(fCommonHists);
+
fEventNumber = 0; //set number of events to zero
}
//Double_t fMult = fQ.GetMult();
//loop over the tracks of the event
+ AliFlowTrackSimple* fTrack = NULL;
Int_t fNumberOfTracks = anEvent->NumberOfTracks();
for (Int_t i=0;i<fNumberOfTracks;i++)
{
}
}//track selected
}//loop over tracks
-
+
fEventNumber++;
cout<<"@@@@@ "<<fEventNumber<<" events processed"<<endl;
}
fHistProUQ->Draw();
// write to file
- fHistFile->Write();
+// fHistFile->Write();
cout<<".....finished"<<endl;
}
#define AliFlowAnalysisWithScalarProduct_H
#include "TVector2.h" //called explicitly
-#include "AliFlowVector.h"
#include "TString.h"
+#include "AliFlowVector.h"
+
class AliFlowTrackSimple;
class AliFlowEventSimple;
class AliFlowCommonHist;
//class AliFlowCommonHistResults;
class TProfile;
-class TFile;
+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
private:
AliFlowAnalysisWithScalarProduct(const AliFlowAnalysisWithScalarProduct& aAnalysis);
AliFlowAnalysisWithScalarProduct& operator=(const AliFlowAnalysisWithScalarProduct& aAnalysis);
- // AliFlowVector fQ; // flow vector
- // TVector2 fU; // particle unit vector
AliFlowVector *fQ; // flow vector
- TVector2 *fU; // particle unit vector
+ TVector2 *fU; // particle unit vector
- Int_t fEventNumber; // event counter
+ Int_t fEventNumber; // event counter
- AliFlowTrackSimple* fTrack ; //!
-
- Bool_t fDebug ; //! flag for lyz analysis: more print statements
+ Bool_t fDebug ; // flag for lyz analysis: more print statements
- TString fHistFileName; //!
- TFile* fHistFile; //!
-
- TProfile* fHistProUQ; //!
+ TList* fHistList;
+ TProfile* fHistProUQ;
- AliFlowCommonHist* fCommonHists; //!
- //AliFlowCommonHistResults* fCommonHistsRes; //!
+ AliFlowCommonHist* fCommonHists;
ClassDef(AliFlowAnalysisWithScalarProduct,0) // macro for rootcint
};
gProof->AddIncludePath("./PWG2AOD/AOD");
gProof->AddIncludePath("./PWG2flow/FLOW");
- gProof->Load("AliAnalysisTaskCumulants.cxx++g");
- TChain *chain = 0x0;
-
- gROOT->LoadMacro("CreateESDChain.C");
- chain = CreateESDChain("ESD82XX_30K.txt",200);
+ // TChain *chain = 0x0;
//____________________________________________//
// Make the analysis manager
mgr->SetInputEventHandler(esdH);
//____________________________________________//
// 1st Pt task
- AliAnalysisTaskFemto *task1 = new AliAnalysisTaskFemto("TaskCumulants");
+ AliAnalysisTaskScalarProduct *task1 = new AliAnalysisTaskScalarProduct("TaskScalarProduct");
mgr->AddTask(task1);
+
+
+ // Create chain of input files
+ gROOT->LoadMacro("CreateESDChain.C");
+ chain = CreateESDChain("ESD82XX_30K.txt",200);
+
+
// Create containers for input/output
AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("cchain1",TChain::Class(),AliAnalysisManager::kInputContainer);
- AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clist1", TList::Class(),AliAnalysisManager::kOutputContainer,"OutputFromCumulantAnlysisESD.root");
+ // AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clist1", TList::Class(),AliAnalysisManager::kOutputContainer,"OutputFromCumulantAnlysisESD.root");
+ AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clist1", TList::Class(),AliAnalysisManager::kOutputContainer,"outputFromScalarProductAnalysisESD.root");
//____________________________________________//
mgr->ConnectInput(task1,0,cinput1);
--- /dev/null
+void runProofScalarProduct() {
+ TStopwatch timer;
+ timer.Start();
+
+ printf("*** Connect to PROOF ***\n");
+ TProof::Open("snelling@lxb6046.cern.ch");
+
+ gProof->UploadPackage("STEERBase.par");
+ gProof->EnablePackage("STEERBase");
+ gProof->UploadPackage("ESD.par");
+ gProof->EnablePackage("ESD");
+ gProof->UploadPackage("AOD.par");
+ gProof->EnablePackage("AOD");
+ gProof->UploadPackage("ANALYSIS.par");
+ gProof->EnablePackage("ANALYSIS");
+ gProof->UploadPackage("ANALYSISalice.par");
+ gProof->EnablePackage("ANALYSISalice");
+ gProof->UploadPackage("PWG2AOD.par");
+ gProof->EnablePackage("PWG2AOD");
+ gProof->UploadPackage("PWG2flow.par");
+ gProof->EnablePackage("PWG2flow");
+ gSystem->SetIncludePath("-I$ROOTSYS/include -I./PWG2flow/FLOW -I./ESD -I./AOD -I./ANALYSIS -I./PWG2AOD/AOD");
+ gProof->AddIncludePath("./PWG2AOD/AOD");
+ gProof->AddIncludePath("./PWG2flow/FLOW");
+
+
+ // TChain *chain = 0x0;
+
+ //____________________________________________//
+ // Make the analysis manager
+ AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
+ AliESDInputHandler* esdH = new AliESDInputHandler;
+ esdH->SetInactiveBranches("FMD CaloCluster");
+ mgr->SetInputEventHandler(esdH);
+ //____________________________________________//
+ // 1st Pt task
+ AliAnalysisTaskScalarProduct *task1 = new AliAnalysisTaskScalarProduct("TaskScalarProduct");
+
+ mgr->AddTask(task1);
+
+
+
+ // Create chain of input files
+ gROOT->LoadMacro("CreateESDChain.C");
+ chain = CreateESDChain("ESD82XX_30K.txt",200);
+
+
+ // Create containers for input/output
+ AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("cchain1",TChain::Class(),AliAnalysisManager::kInputContainer);
+ // AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clist1", TList::Class(),AliAnalysisManager::kOutputContainer,"OutputFromCumulantAnlysisESD.root");
+ AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clist1", TList::Class(),AliAnalysisManager::kOutputContainer,"outputFromScalarProductAnalysisESD.root");
+
+ //____________________________________________//
+ mgr->ConnectInput(task1,0,cinput1);
+ mgr->ConnectOutput(task1,0,coutput1);
+
+ if (!mgr->InitAnalysis()) return;
+ mgr->PrintStatus();
+ mgr->StartAnalysis("proof",chain);
+
+ timer.Stop();
+ timer.Print();
+}
+