Updating the functionality of AliAnalysisHadEtCorrections to accomodate centrality...
[u/mrichter/AliRoot.git] / prod / acrcaf / clean / clean.C
CommitLineData
a5c1ca0f 1void clean()
2{
3 // Login to CAF
4 TProof::Open("aliprod@alicecaf");
5
6 TMap* map = gProof->GetDataSets("/ALIREC/aliprod");
7
8 Int_t max = 0;
9
10 TIterator* iter = map->MakeIterator();
11 TObjString* str = 0;
12 while ((str = (TObjString*) iter->Next()))
13 {
14 //str->Print();
15
16 TObjArray* tokens = str->String().Tokenize("/");
17 if (tokens->GetEntries() < 3)
18 continue;
19
20 //tokens->Print();
21
22 TString str2(((TObjString*) tokens->At(2))->String());
23 str2.ReplaceAll("run", "");
24
25 Int_t run = str2.Atoi();
26
27 //Printf("%d", run);
28
29 max = TMath::Max(max, run);
30 }
31
32 Printf("Maximum run number found is %d", max);
33
34 Int_t removeUntil = max - 2000;
35
36 Printf("Removing all datasets for runs with smaller run numbers than %d", removeUntil);
37
38 iter->Reset();
39
40 while ((str = (TObjString*) iter->Next()))
41 {
42 TObjArray* tokens = str->String().Tokenize("/");
43 if (tokens->GetEntries() < 3)
44 continue;
45
46 //tokens->Print();
47
48 TString str2(((TObjString*) tokens->At(2))->String());
49 str2.ReplaceAll("run", "");
50
51 Int_t run = str2.Atoi();
52
53 if (run < removeUntil)
54 {
55 Printf("Removing run %d", run);
56
57 gProof->RemoveDataSet(str->String());
58 }
59 }
60}