]>
Commit | Line | Data |
---|---|---|
60da4435 | 1 | void AnaPi0Select(const char* dataset="minbias_LHC09a4_81040_81050.xml") |
2 | { | |
3 | ||
4 | gSystem->Load("libTree.so"); | |
5 | gSystem->Load("libGeom.so"); | |
6 | gSystem->Load("libVMC.so"); | |
7 | gSystem->Load("libPhysics.so"); | |
8 | ||
9 | //load analysis framework | |
10 | gSystem->Load("libANALYSIS"); | |
11 | gSystem->Load("libANALYSISalice"); //AliAnalysisTaskSE | |
12 | ||
13 | //Set local DB for PHOS | |
14 | gROOT->ProcessLine(".! tar xzvf PHOS.tgz") ; | |
7134a9fa | 15 | AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); |
60da4435 | 16 | AliCDBManager::Instance()->SetSpecificStorage("PHOS/*","local://./"); |
17 | ||
18 | // A task can be compiled dynamically with AClic | |
19 | gROOT->LoadMacro("AliAnalysisTaskPi0CalibSelection.cxx+g"); | |
20 | ||
21 | // Connect to alien | |
22 | TString token = gSystem->Getenv("GRID_TOKEN") ; | |
23 | if ( token == "OK" ) | |
24 | TGrid::Connect("alien://"); | |
25 | else | |
26 | AliInfo("You are not connected to the GRID") ; | |
27 | ||
28 | // Create the chain | |
29 | TChain* chain = new TChain("esdTree"); | |
30 | TGridCollection * collection = dynamic_cast<TGridCollection*>(TAlienCollection::Open(dataset)); | |
31 | ||
32 | TAlienResult* result = collection->GetGridResult("",0 ,0); | |
33 | TList* rawFileList = result->GetFileInfoList(); | |
34 | ||
35 | for (Int_t counter=0 ; counter < rawFileList->GetEntries() ; counter++) { | |
36 | TFileInfo * fi = static_cast<TFileInfo*>(rawFileList->At(counter)) ; | |
37 | const char * rawFile = fi->GetCurrentUrl()->GetUrl() ; | |
38 | printf("Processing %s\n", rawFile) ; | |
39 | chain->Add(rawFile); | |
40 | printf("Chain: %d entries.\n",chain->GetEntries()); | |
41 | } | |
42 | ||
43 | // Make the analysis manager | |
44 | AliAnalysisManager *mgr = new AliAnalysisManager("Pi0CalibSelect","Pi0CalibSelection"); | |
45 | ||
46 | // ESD input handler | |
47 | AliESDInputHandler* esdH = new AliESDInputHandler(); | |
48 | mgr->SetInputEventHandler(esdH); | |
49 | ||
50 | // Debug level | |
51 | mgr->SetDebugLevel(10); | |
52 | ||
53 | // Add task | |
54 | AliAnalysisTaskPi0CalibSelection *task = new AliAnalysisTaskPi0CalibSelection("Pi0CalibSelection"); | |
55 | task->SetClusterMinEnergy(0.4); | |
56 | mgr->AddTask(task); | |
57 | ||
58 | // Create containers for input/output | |
7134a9fa | 59 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); |
60da4435 | 60 | AliAnalysisDataContainer *coutput = mgr->CreateContainer("histos",TList::Class(),AliAnalysisManager::kOutputContainer,"histos.root"); |
61 | ||
62 | // Connect input/output | |
63 | mgr->ConnectInput(task, 0, cinput); | |
64 | mgr->ConnectOutput(task, 1, coutput); | |
65 | ||
66 | if (mgr->InitAnalysis()) { | |
67 | mgr->PrintStatus(); | |
68 | mgr->StartAnalysis("local", chain); | |
69 | } | |
70 | ||
71 | } | |
72 | ||
73 |