ROOT logo
#ifndef ALIXMLCOLLECTION_H
#define ALIXMLCOLLECTION_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */


/* $Id$ */

//-------------------------------------------------------------------------
//                          Class AliXMLCollection
//   This is the class that creates XML collections after querying the tags
//
//    Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
//-------------------------------------------------------------------------

#include <TObject.h>
#include "TGridCollection.h"
#include <Riostream.h>
#include <TString.h>

class TMap;
class TIter;
class TEntryList;

using std::ofstream;
//___________________________________________________________________________
class AliXMLCollection : public TGridCollection {
 
 public:
  AliXMLCollection();
  AliXMLCollection(const char *localCollectionFile);
  AliXMLCollection(const AliXMLCollection& collection);
  
  virtual ~AliXMLCollection();
  
  //____________________________________________________//
  Bool_t WriteHeader();
  Bool_t WriteSummary(Int_t aTotal, Int_t aAccepted, Int_t aRejRun, Int_t aRejLHC, Int_t aRejDet, Int_t aRejEvt);
  Bool_t WriteBody(Int_t counter, const char* guid, const char *lfn, const char *turl, TEntryList *fEntryList);
  Bool_t WriteBody(Int_t counter, const char* guid, const char *lfn, const char *turl, TEntryList *fEntryListm, Int_t accSum, Int_t rejSum);
  Bool_t Export();

  void SetCollectionName(const char* name) {fCollectionName = name;}
  
  //____________________________________________________//
  const char* GetCollectionName() const {return fCollectionName.Data();}

  //____________________________________________________//
  void        Reset();
  TMap       *Next();
  Bool_t      Remove(TMap *map);
  const char *GetTURL(const char *name);
  const char *GetLFN(const char *name);
  const char *GetGUID(const char *name);
  const char *GetCutSumm();
  TEntryList *GetEventList(const char *filename) const;
  TEntryList *GetEntryList(const char *filename) { return GetEventList(filename); }
  Bool_t      OverlapCollection(TGridCollection * comparator);
  Bool_t      GetCollectionSummary(Int_t  *aTot, Int_t  *aAcc, Int_t  *aRejRun, Int_t  *aRejLHC, Int_t  *aRejDet, Int_t  *aRejEvt) const;

  static AliXMLCollection *Open(const char *localcollectionfile);

  //____________________________________________________//
 protected:
  virtual void ParseXML();

  TString  fXmlFile;        // collection XML file
  TList   *fEventList;      // list with event file maps
  TIter   *fEventListIter;  // event file list iterator
  TMap    *fCurrent;        // current event file map
  TString  fCollectionName;   //the name of the xml file
  ofstream fout; // The output stream

  // List summary information
  Int_t    fTotalEvents;    // Total no. of events in collection
  Int_t    fAcceptedEvents; // No. of accepted events in collection
  Int_t    fRejectedRun;    // No. of events rejected by Run cuts
  Int_t    fRejectedLHC;    // No. of events rejected by LHC cuts
  Int_t    fRejectedDet;    // No. of events rejected by Detector cuts
  Int_t    fRejectedEvt;    // No. of events rejected by Event cuts
  
  AliXMLCollection & operator=(const AliXMLCollection & ) {return *this;}

  ClassDef(AliXMLCollection,0)  //(ClassName, ClassVersion)
};
//___________________________________________________________________________

#endif
 AliXMLCollection.h:1
 AliXMLCollection.h:2
 AliXMLCollection.h:3
 AliXMLCollection.h:4
 AliXMLCollection.h:5
 AliXMLCollection.h:6
 AliXMLCollection.h:7
 AliXMLCollection.h:8
 AliXMLCollection.h:9
 AliXMLCollection.h:10
 AliXMLCollection.h:11
 AliXMLCollection.h:12
 AliXMLCollection.h:13
 AliXMLCollection.h:14
 AliXMLCollection.h:15
 AliXMLCollection.h:16
 AliXMLCollection.h:17
 AliXMLCollection.h:18
 AliXMLCollection.h:19
 AliXMLCollection.h:20
 AliXMLCollection.h:21
 AliXMLCollection.h:22
 AliXMLCollection.h:23
 AliXMLCollection.h:24
 AliXMLCollection.h:25
 AliXMLCollection.h:26
 AliXMLCollection.h:27
 AliXMLCollection.h:28
 AliXMLCollection.h:29
 AliXMLCollection.h:30
 AliXMLCollection.h:31
 AliXMLCollection.h:32
 AliXMLCollection.h:33
 AliXMLCollection.h:34
 AliXMLCollection.h:35
 AliXMLCollection.h:36
 AliXMLCollection.h:37
 AliXMLCollection.h:38
 AliXMLCollection.h:39
 AliXMLCollection.h:40
 AliXMLCollection.h:41
 AliXMLCollection.h:42
 AliXMLCollection.h:43
 AliXMLCollection.h:44
 AliXMLCollection.h:45
 AliXMLCollection.h:46
 AliXMLCollection.h:47
 AliXMLCollection.h:48
 AliXMLCollection.h:49
 AliXMLCollection.h:50
 AliXMLCollection.h:51
 AliXMLCollection.h:52
 AliXMLCollection.h:53
 AliXMLCollection.h:54
 AliXMLCollection.h:55
 AliXMLCollection.h:56
 AliXMLCollection.h:57
 AliXMLCollection.h:58
 AliXMLCollection.h:59
 AliXMLCollection.h:60
 AliXMLCollection.h:61
 AliXMLCollection.h:62
 AliXMLCollection.h:63
 AliXMLCollection.h:64
 AliXMLCollection.h:65
 AliXMLCollection.h:66
 AliXMLCollection.h:67
 AliXMLCollection.h:68
 AliXMLCollection.h:69
 AliXMLCollection.h:70
 AliXMLCollection.h:71
 AliXMLCollection.h:72
 AliXMLCollection.h:73
 AliXMLCollection.h:74
 AliXMLCollection.h:75
 AliXMLCollection.h:76
 AliXMLCollection.h:77
 AliXMLCollection.h:78
 AliXMLCollection.h:79
 AliXMLCollection.h:80
 AliXMLCollection.h:81
 AliXMLCollection.h:82
 AliXMLCollection.h:83
 AliXMLCollection.h:84
 AliXMLCollection.h:85
 AliXMLCollection.h:86
 AliXMLCollection.h:87
 AliXMLCollection.h:88