#ifndef TCOMETOutputMerged_hxx_seen #define TCOMETOutputMerged_hxx_seen #include #include #include #include class TChain; class TGeoManager; namespace COMET { class ICOMETEvent; class ICOMETInput; class ICOMETOutputMerged; class IFieldDescription; class IDataVector; /// Base class for output errors. OA_EXCEPTION(ECOMETOutputMerged, EoaCore); /// An error occurred during file merging. OA_EXCEPTION(ECOMETOutputMergedAddFileFailed, ECOMETOutputMerged); /// An error occurred during WriteEvent. OA_EXCEPTION(ECOMETOutputMergedDiffGeom, ECOMETOutputMergedAddFileFailed); /// An error occurred during AddList OA_EXCEPTION(ECOMETOutputAddListFailed, ECOMETOutputMergedAddFileFailed); } /// Extends the basic COMET output class to also write IEntryLists to the file. /// These are stored at the same level as the ICOMETEvent tree. class COMET::ICOMETOutputMerged : public ICOMETOutput { public: /// Open a new output file. ICOMETOutputMerged(const char* name, Option_t* opt="CREATE", Int_t compress = 1); virtual ~ICOMETOutputMerged(void); /// Ensure the list container is written when the file is closed virtual void Close(Option_t* opt = ""); /// Add a file to the output virtual void AddFile(ICOMETInput* inFile, bool addEntryList=true); /// Check the file to be added has the same geometry as previous added /// files, if any bool CheckGeometry(ICOMETInput* inFile); /// Check the file to be added has the same EM field as previous added /// files, if any bool CheckEMField(ICOMETInput* inFile); /// Add this tree to the event tree in the file void AddToTree(TTree* inTree); /// Create the container for all entry lists void CreateEntryListContainer(); /// Write the container for all entry lists void WriteEntryListContainer(); /// Add an entry list corresponding to a file with a given number of entries void AddEntryList(const char* fileName, int nEntries, int entryID=-1); /// Default name for the entry list container static const char* listContName; private: ICOMETOutputMerged(const ICOMETOutputMerged& aFile); IDataVector* fListContainer; /// Container for all lists int fNumFiles; /// Number of files merged ISHAHashValue fGeomHash; /// Geometry hash ClassDef(ICOMETOutputMerged,0); }; #endif