]>
Commit | Line | Data |
---|---|---|
4998bf42 | 1 | //Create by Christine Nattrass, Rebecca Scott, Irakli Martashvili |
2 | //University of Tennessee at Knoxville | |
3 | ||
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 | |
54f97c57 | 7 | void runCaloEt(bool submit = false, // true or false |
53992099 | 8 | const char *dataType="simPbPb/LHC10e18a", // "sim" or "real" etc. |
9 | const char *pluginRunMode="full", // "test" or "full" or "terminate" | |
99a6613d | 10 | const char *det = "EMCAL") // "PHOS" or "EMCAL" |
11 | { | |
12 | TStopwatch timer; | |
13 | timer.Start(); | |
53992099 | 14 | gSystem->Load("libTree"); |
15 | gSystem->Load("libGeom"); | |
16 | gSystem->Load("libVMC"); | |
17 | gSystem->Load("libPhysics"); | |
18 | ||
19 | gSystem->Load("libMinuit"); | |
20 | ||
21 | gSystem->AddIncludePath("-I$ALICE_ROOT/include"); | |
6ad010c1 | 22 | gSystem->AddIncludePath("-I. -I$ALICE_ROOT/EMCAL -I$ALICE_ROOT/ANALYSIS"); |
23 | ||
53992099 | 24 | gSystem->Load("libSTEERBase"); |
25 | gSystem->Load("libESD"); | |
26 | gSystem->Load("libAOD"); | |
99a6613d | 27 | |
28 | gSystem->Load("libANALYSIS"); | |
29 | gSystem->Load("libANALYSISalice"); | |
53992099 | 30 | gSystem->Load("libCORRFW"); |
31 | ||
32 | if (!submit) { | |
99a6613d | 33 | cout << "local - no submitting" << endl; |
99a6613d | 34 | } |
35 | else { | |
36 | cout << "submitting to grid" << endl; | |
99a6613d | 37 | } |
53992099 | 38 | |
4998becf | 39 | gROOT->ProcessLine(".L AliAnalysisEtCuts.cxx+g"); |
53992099 | 40 | gROOT->ProcessLine(".L AliAnalysisEt.cxx+g"); |
41 | gROOT->ProcessLine(".L AliAnalysisEtMonteCarlo.cxx+g"); | |
42 | gROOT->ProcessLine(".L AliAnalysisEtMonteCarloPhos.cxx+g"); | |
43 | gROOT->ProcessLine(".L AliAnalysisEtMonteCarloEmcal.cxx+g"); | |
44 | gROOT->ProcessLine(".L AliAnalysisEtReconstructed.cxx+g"); | |
45 | gROOT->ProcessLine(".L AliAnalysisEtReconstructedPhos.cxx+g"); | |
46 | gROOT->ProcessLine(".L AliAnalysisEtReconstructedEmcal.cxx+g"); | |
47 | gROOT->ProcessLine(".L AliAnalysisTaskTotEt.cxx+g"); | |
48 | ||
4998bf42 | 49 | char *kTreeName = "esdTree" ; |
50 | TChain * chain = new TChain(kTreeName,"myESDTree") ; | |
4998bf42 | 51 | |
52 | if(submit){ | |
53992099 | 53 | gSystem->Load("libNetx") ; |
54 | gSystem->Load("libgapiUI"); | |
55 | gSystem->Load("libRAliEn"); | |
4998bf42 | 56 | TGrid::Connect("alien://") ; |
57 | } | |
4998bf42 | 58 | |
59 | // Make the analysis manager | |
60 | AliAnalysisManager *mgr = new AliAnalysisManager("TotEtManager"); | |
61 | ||
99a6613d | 62 | TString detStr(det); |
63 | TString taskName = "TaskTotEt" + detStr; | |
64 | TString dataStr(dataType); | |
54f97c57 | 65 | TString dataStrName(dataType); |
66 | dataStrName.ReplaceAll("/","."); | |
67 | TString outputName = "Et.ESD." + dataStrName + "." + detStr + ".root"; | |
99a6613d | 68 | TString outputDir = "totEt" + dataStr; |
69 | ||
70 | cout << " taskName " << taskName | |
54f97c57 | 71 | << " outputName " << outputName |
72 | << " outputDir (alien) " << outputDir << endl; | |
99a6613d | 73 | |
13b0d3c1 | 74 | if (submit) { |
99a6613d | 75 | gROOT->LoadMacro("CreateAlienHandlerCaloEtSim.C"); |
53992099 | 76 | AliAnalysisGrid *alienHandler = CreateAlienHandlerCaloEtSim(outputDir, outputName, pluginRunMode); |
4998bf42 | 77 | if (!alienHandler) return; |
78 | mgr->SetGridHandler(alienHandler); | |
79 | } | |
80 | ||
81 | AliVEventHandler* esdH = new AliESDInputHandler; | |
82 | mgr->SetInputEventHandler(esdH); | |
83 | AliMCEventHandler* handler = new AliMCEventHandler; | |
99a6613d | 84 | if ( dataStr.Contains("sim") ) { |
85 | cout << " MC " << endl; | |
54f97c57 | 86 | if ( dataStr.Contains("PbPb") ) { // a la: simPbPb/LHC10e18a |
99a6613d | 87 | cout << " PbPb " << endl; |
ce546038 | 88 | TString fileLocation = "/home/dsilverm/data/E_T/" + dataStr + "/dir/AliESDs.root"; |
54f97c57 | 89 | cout << "fileLocation " << fileLocation.Data() << endl; |
90 | chain->Add(fileLocation.Data()); // link to local test file | |
99a6613d | 91 | } |
13b0d3c1 | 92 | else { // pp |
93 | chain->Add("/home/dsilverm/data/E_T/sim/LHC10d1/117222/100/AliESDs.root"); // link to local test file | |
94 | } | |
99a6613d | 95 | handler->SetReadTR(kFALSE); |
96 | mgr->SetMCtruthEventHandler(handler); | |
97 | } | |
13b0d3c1 | 98 | else { // real data |
99 | chain->Add("/home/dsilverm/data/E_T/data/2010/LHC10b/000117222/ESDs/pass2/10000117222021.30/AliESDs.root"); // link to local test file | |
99a6613d | 100 | cout << " not MC " << endl; |
101 | } | |
4998bf42 | 102 | |
4998bf42 | 103 | |
99a6613d | 104 | AliAnalysisTaskTotEt *task1 = new AliAnalysisTaskTotEt(taskName); |
105 | mgr->AddTask(task1); | |
4998bf42 | 106 | |
99a6613d | 107 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); |
108 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("out1", TList::Class(), AliAnalysisManager::kOutputContainer, outputName); | |
109 | ||
110 | //____________________________________________// | |
111 | mgr->ConnectInput(task1,0,cinput1); | |
112 | mgr->ConnectOutput(task1,1,coutput1); | |
113 | ||
114 | mgr->SetDebugLevel(0); | |
115 | ||
116 | if (!mgr->InitAnalysis()) return; | |
117 | mgr->PrintStatus(); | |
118 | if(submit){ | |
119 | mgr->StartAnalysis("grid"); | |
120 | } | |
121 | else{ | |
122 | mgr->StartAnalysis("local",chain); | |
123 | } | |
124 | ||
125 | timer.Stop(); | |
126 | timer.Print(); | |
4998bf42 | 127 | } |