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.
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.
17 // coll_in: xml collection of tag files
18 // or path to the tag files
20 // coll_out: name of the output xml collection
21 //_________________________________________________________________________
22 Bool_t CreateXML(char * coll_in="pp.xml", char * coll_out="global2")
28 gSystem->Load("libTreePlayer"); //needed in the case of the string statements
29 gSystem->Load("libANALYSIS"); //needed by libANALYSISalice
30 gSystem->Load("libANALYSISalice"); //needed AliTagAnalysis
32 // Create A tag analysis object and impose some selection criteria
33 AliTagAnalysis *TagAna = new AliTagAnalysis();
35 //Case where the tag files are stored locally
36 //TagAna->ChainLocalTags(coll_in);
38 //Case where the tag files are stored in the file catalog
39 //coll_in (pp.xml) is the xml collection of tag files that was produced
40 //by querying the file catalog:
41 // find -x pp /alice/sim/PDC_08/LHC08r/270001/* *tag.root > pp.xml
43 TGrid::Connect("alien://pcapiserv01.cern.ch:10000","elopez");
44 //TGrid::Connect("alien://");
45 TAlienCollection* coll = TAlienCollection::Open(coll_in);
46 TGridResult* TagResult = coll->GetGridResult("",0,0);
47 cout << endl << "Chain Grid Tags..." << endl;
48 TagAna->ChainGridTags(TagResult);
50 //__________________________//
51 //Usage of string statements//
52 //__________________________//
54 const char* runTagCuts = "fAliceRunId==270001";
55 const char* lhcTagCuts = "fLHCTag.fLHCState==LHC08r";
56 const char* detTagCuts = "fDetectorTag.fTPC==1";
57 const char* evTagCuts = "(fEventTag.fTopPtMin >= 1.0)&&(fEventTag.fNumberOfTracks >= 11)&&(fEventTag.fNumberOfTracks <= 12)";
60 //________________________________________________//
61 //Usage of AliRunTagCuts & AliEventTagCuts classes//
62 //________________________________________________//
63 // create a RunTagCut object
64 AliRunTagCuts *runTagCuts = new AliRunTagCuts();
65 // runTagCuts->SetRunId(270001);
67 // create an LHCTagCuts object
68 AliLHCTagCuts *lhcTagCuts = new AliLHCTagCuts();
70 // create an DetectorTagCuts object
71 AliDetectorTagCuts *detTagCuts = new AliDetectorTagCuts();
73 // create an EventTagCut object
74 AliEventTagCuts *evTagCuts = new AliEventTagCuts();
75 //evTagCuts->SetMultiplicityRange(11,12);
76 //evTagCuts->SetTopPtMin(1.0);
78 // Query the Tags and create the xml collection
79 cout << endl << "Create XML Collection..." << endl;
80 TagAna->CreateXMLCollection(coll_out, runTagCuts, lhcTagCuts, detTagCuts, evTagCuts);