]>
Commit | Line | Data |
---|---|---|
3ec50490 | 1 | void AliAnalysisTaskVertexingHFTest() { |
2 | ||
3 | gSystem->Load("libANALYSIS"); | |
7201805f | 4 | gSystem->Load("libANALYSISalice.so"); |
3ec50490 | 5 | gSystem->Load("libANALYSISRL"); |
6 | gSystem->Load("libAOD.so"); | |
7 | gSystem->Load("libPWG3base.so"); | |
8 | //This file can cause problems : | |
9 | if (!gSystem->AccessPathName("$ALICE_ROOT/ANALYSIS/AliAnalysisSelector_cxx.so",kFileExists)) { | |
10 | printf("File $ALICE_ROOT/ANALYSIS/AliAnalysisSelector_cxx.so exists and can cause problems, delete it if you can..."); | |
11 | return; | |
12 | } | |
13 | ||
14 | ||
15 | //Run over local files : | |
16 | TChain *chain= new TChain("esdTree"); | |
17 | chain->Add("AliESDs.root"); // put path to your files here | |
18 | ||
19 | // OR : | |
20 | ||
21 | /* | |
22 | //Fetch files with AliEn : | |
23 | const char *collectionfile = "essai6000CollectionTags1.xml"; | |
24 | TGrid::Connect("alien://") ; | |
25 | //Create an AliRunTagCuts and an AliEventTagCuts Object and impose some selection criteria | |
26 | AliRunTagCuts *runCuts = new AliRunTagCuts(); | |
27 | AliEventTagCuts *eventCuts = new AliEventTagCuts(); | |
28 | AliLHCTagCuts *lhcCuts = new AliLHCTagCuts(); | |
29 | AliDetectorTagCuts *detCuts = new AliDetectorTagCuts(); | |
30 | eventCuts->SetMultiplicityRange(0,20000); | |
31 | //Create an AliTagAnalysis Object and chain the tags | |
32 | AliTagAnalysis *tagAna = new AliTagAnalysis(); | |
33 | tagAna->SetType("ESD"); | |
34 | TAlienCollection *coll = TAlienCollection::Open(collectionfile); | |
35 | TGridResult *tagResult = coll->GetGridResult("",0,0); | |
36 | tagResult->Print(); | |
37 | tagAna->ChainGridTags(tagResult); | |
38 | //Create a new esd chain and assign the chain that is returned by querying the tags | |
39 | TChain* chain = tagAna->QueryTags(runCuts,lhcCuts,detCuts,eventCuts); | |
40 | */ | |
41 | ||
3ec50490 | 42 | //Create tasks |
43 | AliAnalysisManager *analManager = new AliAnalysisManager("myAnalysisManager"); | |
44 | //analManager->SetDebugLevel(10); | |
cc887581 | 45 | // ESD input handler |
46 | AliESDInputHandler *esdHandler = new AliESDInputHandler(); | |
47 | esdHandler->SetInactiveBranches("FMD CaloCluster"); | |
48 | analManager->SetInputEventHandler(esdHandler); | |
49 | ||
3ec50490 | 50 | AliAnalysisTaskVertexingHF *task1 = new AliAnalysisTaskVertexingHF("myTask"); |
51 | analManager->AddTask(task1); | |
52 | //Create containers for input/output | |
53 | AliAnalysisDataContainer *cinput1 = analManager->CreateContainer("cchain1",TChain::Class(),AliAnalysisManager::kInputContainer); | |
54 | AliAnalysisDataContainer *coutput1 = analManager->CreateContainer("tree1", TTree::Class(),AliAnalysisManager::kOutputContainer,"HFtrees.root"); | |
55 | AliAnalysisDataContainer *coutput2 = analManager->CreateContainer("tree2", TTree::Class(),AliAnalysisManager::kOutputContainer,"HFtrees.root"); | |
56 | AliAnalysisDataContainer *coutput3 = analManager->CreateContainer("tree3", TTree::Class(),AliAnalysisManager::kOutputContainer,"HFtrees.root"); | |
57 | AliAnalysisDataContainer *coutput4 = analManager->CreateContainer("tree4", TTree::Class(),AliAnalysisManager::kOutputContainer,"HFtrees.root"); | |
58 | analManager->ConnectInput(task1,0,cinput1); | |
59 | analManager->ConnectOutput(task1,0,coutput1); | |
60 | analManager->ConnectOutput(task1,1,coutput2); | |
61 | analManager->ConnectOutput(task1,2,coutput3); | |
62 | analManager->ConnectOutput(task1,3,coutput4); | |
3ec50490 | 63 | |
64 | printf("CHAIN HAS %d ENTRIES\n",(Int_t)chain->GetEntries()); | |
65 | if (analManager->InitAnalysis()) { | |
66 | analManager->PrintStatus(); | |
67 | //analManager->StartAnalysis("grid",chain); | |
68 | analManager->StartAnalysis("local",chain); | |
69 | } | |
70 | ||
71 | return; | |
72 | } | |
73 | ||
74 | ||
75 |