]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/CreateXML.C
Check we get everything from OCDB even before starting, and correctly deleting calibr...
[u/mrichter/AliRoot.git] / STEER / CreateXML.C
1 //_________________________________________________________________________
2 // Macro that creates esd xml collections by querying the tags.
3 // It addresses the following use cases:
4 // o) The tag files are stored locally.
5 //   - One queries the tags by using simple string statements.
6 //   - One queries the tags by using the corresponding aliroot classes.
7 // o) The tag files are stored in the file catalog. 
8 //    In this case the first thing we do is to query the f.c.
9 //    and extract a collection (xml) of tag files. 
10 //   - One queries the tags by using simple string statements.
11 //   - One queries the tags by using the corresponding aliroot classes.
12 //                                             
13 // In all cases you create the xml file by using the CreateXMLCollection
14 // of the AliTagAnalysisClass. The first argument of this method is the
15 // name of the output xml collection which is stored locally.
16 //_________________________________________________________________________
17 Bool_t CreateXML() {
18   TStopwatch timer;
19   timer.Start();
20   
21   //needed in the case of the string statements
22   gSystem->Load("libTreePlayer.so");
23
24   // Create A tag analysis object and impose some selection criteria
25   AliTagAnalysis *TagAna = new AliTagAnalysis(); 
26
27   //Case where the tag files are stored locally
28   //TagAna->ChainLocalTags(".");
29
30   //Case where the tag files are stored in the file catalog
31   //pp.xml is the xml collection of tag files that was produced 
32   //by querying the file catalog.
33   TGrid::Connect("alien://pcapiserv01.cern.ch:10000","pchrist");  
34   //TGrid::Connect("alien://"); 
35   TAlienCollection* coll = TAlienCollection::Open("pp.xml");
36   TGridResult* TagResult = coll->GetGridResult("");
37   TagAna->ChainGridTags(TagResult);
38
39   //__________________________//
40   //Usage of string statements//
41   //__________________________//
42   /*const char* fRunCuts = "fAliceRunId == 340";
43   const char* fEventCuts = "(fEventTag.fTopPtMin >= 1.0)&&(fEventTag.fNumberOfTracks >= 11)&&(fEventTag.fNumberOfTracks <= 12)";
44   TagAna->CreateXMLCollection("global",fRunCuts,fEventCuts);*/
45
46   //________________________________________________//
47   //Usage of AliRunTagCuts & AliEventTagCuts classes//
48   //________________________________________________//
49   // create a RunTagCut object
50   AliRunTagCuts *RunCuts = new AliRunTagCuts();
51   RunCuts->SetRunId(340);
52   // create an EventTagCut object
53   AliEventTagCuts *EvCuts = new AliEventTagCuts();
54   EvCuts->SetMultiplicityRange(11,12);
55   EvCuts->SetTopPtMin(1.0);
56   TagAna->CreateXMLCollection("global2",RunCuts,EvCuts);
57
58   timer.Stop();
59   timer.Print();
60
61   return kTRUE;
62 }