]>
Commit | Line | Data |
---|---|---|
f24a8bc3 | 1 | // Macro to make a tag file for a full run directly from ESDs and the GRP |
2 | // Takes as parameters a text file with the location of all ESD files | |
3 | // for a given run (can be modified to work on any chain of ESDs) | |
4 | // Second argument is the run number, for which the GRP will be retrieved | |
5 | // Suitable for a GRID job - runs with pure ROOT to minimize memory | |
6 | // consumption but needs ALIROOT package location to load only necessary | |
7 | // AliRoot libraries. | |
8 | // | |
9 | // Author: Adam.Kisiel@cern.ch | |
10 | ||
6dc1ea33 | 11 | class AliGRPObject; |
12 | ||
f24a8bc3 | 13 | AliGRPObject *GetGRPForRun(Int_t runno) { |
14 | AliCDBManager* man = AliCDBManager::Instance(); | |
15 | man->SetDefaultStorage("raw://"); | |
16 | man->SetRun(runno); | |
17 | AliCDBEntry* e = man->Get("GRP/GRP/Data"); | |
18 | AliGRPObject* o = (AliGRPObject*)e->GetObject(); | |
19 | ||
20 | return o; | |
21 | } | |
22 | ||
23 | void ReMakeTagsFullRun(const char *esdfile, Int_t runno) | |
24 | { | |
25 | gSystem->Load("libProofPlayer.so"); | |
26 | gSystem->Load("libVMC.so"); | |
27 | gSystem->Load("libSTEERBase.so"); | |
28 | gSystem->Load("libESD.so"); | |
29 | gSystem->Load("libAOD.so"); | |
30 | gSystem->Load("libANALYSIS.so"); | |
31 | gSystem->Load("libANALYSISalice.so"); | |
32 | gSystem->Load("libGui.so"); | |
33 | gSystem->Load("libCDB.so"); | |
34 | ||
35 | gSystem->Load("libMinuit.so"); | |
36 | gSystem->Load("libRAWDatabase.so"); | |
37 | ||
38 | gSystem->Load("libSTEER.so"); | |
39 | gSystem->Load("libXMLParser.so"); | |
40 | ||
41 | TGrid::Connect("alien://"); | |
42 | ||
43 | ||
44 | AliGRPObject *grpo = GetGRPForRun(runno); | |
45 | ||
46 | AliESDTagCreator *tagCre = new AliESDTagCreator(); | |
47 | tagCre->SetStorage(0); | |
48 | ||
49 | ||
50 | TChain *chain = new TChain("esdTree");; | |
51 | ifstream *istr = new ifstream(esdfile); | |
52 | ||
53 | char fname[2000]; | |
54 | char pname[2000]; | |
55 | while (!istr->eof()) { | |
56 | fname[0] = '\0'; | |
57 | (*istr) >> fname; | |
58 | if (strlen(fname) > 10) { | |
59 | sprintf(pname, "alien://%s", fname); | |
60 | chain->Add(pname); | |
61 | } | |
62 | } | |
63 | ||
64 | tagCre->CreateESDTagsFullRun(chain, grpo, 0, 0, 0, 0); | |
65 | } |