1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 //-----------------------------------------------------------------
19 // Implementation of the AliXMLCollection class
20 // This is the class that creates XML collections after querying the tags
21 // Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
22 //-----------------------------------------------------------------
25 #include <Riostream.h>
27 #include <TEventList.h>
29 #include "AliXMLCollection.h"
31 ClassImp(AliXMLCollection)
33 //___________________________________________________________________________
34 AliXMLCollection::AliXMLCollection() :
42 //___________________________________________________________________________
43 AliXMLCollection::~AliXMLCollection() {
47 //___________________________________________________________________________
48 Bool_t AliXMLCollection::WriteHeader() {
49 //Creates the xml output file
51 TString xmlName = fCollectionName;
54 TString collectionHeader = "<collection name=";
55 collectionHeader += "\"";
56 collectionHeader += fCollectionName;
57 collectionHeader += "\"";
58 collectionHeader += ">";
60 // Open the output stream
62 fout<<"<?xml version=\"1.0\"?>\n";
64 fout<<" "<<collectionHeader<<"\n";
69 //___________________________________________________________________________
70 Bool_t AliXMLCollection::WriteBody(Int_t counter, const char* guid, const char* turl, TEventList *list) {
71 //Writes the body of the xml collection
73 for(Int_t i = 0; i < list->GetN(); i++) {
74 listline += list->GetEntry(i);
77 listline = listline(0,listline.Length()-1);
79 TString line0 = "<event name=\"";
83 TString line1 = "<file name=\"AliESDs.root\" ";
95 fout<<" "<<line0<<"\n";
96 fout<<" "<<line1<<"\n";
102 //___________________________________________________________________________
103 Bool_t AliXMLCollection::Export() {
105 fout<<" "<<"</collection>\n";