forked from alisw/AliPhysics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJetAnalysisManager.C
70 lines (60 loc) · 2.06 KB
/
JetAnalysisManager.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
void JetAnalysisManager()
{
//
// Load relevant libraries
//
gSystem->Load("libTree");
gSystem->Load("libNetx");
gSystem->Load("libProof");
gSystem->Load("libProofPlayer");
gSystem->Load("libGeom");
gSystem->Load("libEG");
gSystem->Load("libANALYSIS");
gSystem->Load("libESD");
gSystem->Load("libJETAN");
//
// Connect to alien
//
TGrid::Connect("alien://");
AliTagAnalysis *TagAna = new AliTagAnalysis();
AliEventTagCuts *EvCuts = new AliEventTagCuts();
AliRunTagCuts *RuCuts = new AliRunTagCuts();
//EvCuts->SetNChargedAbove1GeVRange(1, 1000);
//EvCuts->SetMultiplicityRange(11,120);
//EvCuts->SetNPionRange(2,10000);
TGridCollection* coll = gGrid->OpenCollection("tag100.xml");
TGridResult* TagResult = coll->GetGridResult("", 0, 0);
TagResult->Print();
TagAna->ChainGridTags(TagResult);
//////////////////////////////////////////////////////////////////
//Get the chain
printf("*******************************\n");
printf("*** Getting the Chain ***\n");
printf("*******************************\n");
TChain* chain1 = 0x0;
chain1 = TagAna->QueryTags(RuCuts, EvCuts);
chain1->ls();
//
// Make the analysis manager
//
AliAnalysisManager *mgr = new AliAnalysisManager("Manager", "Manager");
mgr-> SetDebugLevel(10);
AliAnalysisTaskJets *jetana = new AliAnalysisTaskJets("JetAnalysis");
jetana->SetDebugLevel(10);
mgr->AddTask(jetana);
// Create containers for input/output
AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("cchain1",TChain::Class(),
AliAnalysisManager::kInputContainer);
AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("chist1", TH1::Class(),
AliAnalysisManager::kOutputContainer);
mgr->ConnectInput (jetana,0,cinput1);
mgr->ConnectOutput(jetana,0,coutput1);
cinput1->SetData(chain1);
//
// Run the analysis
//
if (mgr->InitAnalysis()) {
mgr->PrintStatus();
mgr->StartAnalysis("local", chain1);
}
}