1 //Create by Christine Nattrass, Rebecca Scott, Irakli Martashvili
2 //University of Tennessee at Knoxville
4 //by default this runs locally
5 //With the argument true this submits jobs to the grid
6 //As written this requires an xml script tag.xml in the ~/et directory on the grid to submit jobs
7 void runCaloEt(bool submit = false, // true or false
8 const char *dataType="simPbPb/LHC10e18a", // "sim" or "real" etc.
9 const char *pluginRunMode="full", // "test" or "full" or "terminate"
10 const char *det = "EMCAL") // "PHOS" or "EMCAL"
14 gSystem->Load("libTree");
15 gSystem->Load("libGeom");
16 gSystem->Load("libVMC");
17 gSystem->Load("libPhysics");
19 gSystem->Load("libMinuit");
21 gSystem->AddIncludePath("-I$ALICE_ROOT/include");
23 gSystem->Load("libSTEERBase");
24 gSystem->Load("libESD");
25 gSystem->Load("libAOD");
27 gSystem->Load("libANALYSIS");
28 gSystem->Load("libANALYSISalice");
29 gSystem->Load("libCORRFW");
32 cout << "local - no submitting" << endl;
35 cout << "submitting to grid" << endl;
38 gROOT->ProcessLine(".L AliAnalysisEtCuts.cxx+g");
39 gROOT->ProcessLine(".L AliAnalysisEt.cxx+g");
40 gROOT->ProcessLine(".L AliAnalysisEtMonteCarlo.cxx+g");
41 gROOT->ProcessLine(".L AliAnalysisEtMonteCarloPhos.cxx+g");
42 gROOT->ProcessLine(".L AliAnalysisEtMonteCarloEmcal.cxx+g");
43 gROOT->ProcessLine(".L AliAnalysisEtReconstructed.cxx+g");
44 gROOT->ProcessLine(".L AliAnalysisEtReconstructedPhos.cxx+g");
45 gROOT->ProcessLine(".L AliAnalysisEtReconstructedEmcal.cxx+g");
46 gROOT->ProcessLine(".L AliAnalysisTaskTotEt.cxx+g");
48 char *kTreeName = "esdTree" ;
49 TChain * chain = new TChain(kTreeName,"myESDTree") ;
52 gSystem->Load("libNetx") ;
53 gSystem->Load("libgapiUI");
54 gSystem->Load("libRAliEn");
55 TGrid::Connect("alien://") ;
58 // Make the analysis manager
59 AliAnalysisManager *mgr = new AliAnalysisManager("TotEtManager");
62 TString taskName = "TaskTotEt" + detStr;
63 TString dataStr(dataType);
64 TString dataStrName(dataType);
65 dataStrName.ReplaceAll("/",".");
66 TString outputName = "Et.ESD." + dataStrName + "." + detStr + ".root";
67 TString outputDir = "totEt" + dataStr;
69 cout << " taskName " << taskName
70 << " outputName " << outputName
71 << " outputDir (alien) " << outputDir << endl;
74 gROOT->LoadMacro("CreateAlienHandlerCaloEtSim.C");
75 AliAnalysisGrid *alienHandler = CreateAlienHandlerCaloEtSim(outputDir, outputName, pluginRunMode);
76 if (!alienHandler) return;
77 mgr->SetGridHandler(alienHandler);
80 AliVEventHandler* esdH = new AliESDInputHandler;
81 mgr->SetInputEventHandler(esdH);
82 AliMCEventHandler* handler = new AliMCEventHandler;
83 if ( dataStr.Contains("sim") ) {
84 cout << " MC " << endl;
85 if ( dataStr.Contains("PbPb") ) { // a la: simPbPb/LHC10e18a
86 cout << " PbPb " << endl;
87 TString fileLocation = "/home/dsilverm/data/E_T/" + dataStr + "/198000/001/AliESDs.root";
88 cout << "fileLocation " << fileLocation.Data() << endl;
89 chain->Add(fileLocation.Data()); // link to local test file
92 chain->Add("/home/dsilverm/data/E_T/sim/LHC10d1/117222/100/AliESDs.root"); // link to local test file
94 handler->SetReadTR(kFALSE);
95 mgr->SetMCtruthEventHandler(handler);
98 chain->Add("/home/dsilverm/data/E_T/data/2010/LHC10b/000117222/ESDs/pass2/10000117222021.30/AliESDs.root"); // link to local test file
99 cout << " not MC " << endl;
103 AliAnalysisTaskTotEt *task1 = new AliAnalysisTaskTotEt(taskName);
106 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
107 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("out1", TList::Class(), AliAnalysisManager::kOutputContainer, outputName);
109 //____________________________________________//
110 mgr->ConnectInput(task1,0,cinput1);
111 mgr->ConnectOutput(task1,1,coutput1);
113 mgr->SetDebugLevel(0);
115 if (!mgr->InitAnalysis()) return;
118 mgr->StartAnalysis("grid");
121 mgr->StartAnalysis("local",chain);