ATLAS Offline Software
RootCollectionSchemaEditor.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ROOTCOLLECTION_COLLECTIONSCHEMAEDITOR_H
6 #define ROOTCOLLECTION_COLLECTIONSCHEMAEDITOR_H
7 
8 #include <string>
9 #include <vector>
10 #include <typeinfo>
11 
14 
15 #include "CoralBase/MessageStream.h"
16 
17 #include "TTree.h"
18 
19 
20 namespace pool {
21  class ICollectionColumn;
22 
23  namespace RootCollection {
24 
25  class RootCollection;
26 
33  {
34 
35  friend class RootCollection;
36 
37  public:
38 
41  TTree *tree );
42 
43 
49  virtual void setEventReferenceColumnName( const std::string& columnName );
50 
61  const std::string& columnName,
62  const std::string& columnType,
63  const std::string& annotation = "",
64  int maxSize = 0,
65  bool sizeIsFixed = true );
66 
76  const std::string& columnName,
77  const std::type_info& columnType,
78  const std::string& annotation = "",
79  int maxSize = 0,
80  bool sizeIsFixed = true );
81 
88  const std::string& columnName,
89  const std::string& annotation = "" );
90 
91 
94  const std::string& columnName,
95  const std::string& annotation );
96 
102  virtual void dropColumn( const std::string& columnName );
103 
110  virtual void renameColumn( const std::string& oldName, const std::string& newName );
111 
114 
115  protected:
116  void addTreeBranch( const std::string& name, const std::string& type_name );
117  void readSchema();
119  void writeSchema();
120 
122 
124 
125  TTree *m_tree;
126 
128 
129  coral::MessageStream m_poolOut;
130  };
131  }
132 }
133 #endif
134 
pool::RootCollection::RootCollectionSchemaEditor::m_collection
RootCollection & m_collection
Definition: RootCollectionSchemaEditor.h:121
pool::RootCollection::RootCollectionSchemaEditor::renameColumn
virtual void renameColumn(const std::string &oldName, const std::string &newName)
Renames a column of the collection.
pool::RootCollection::RootCollectionSchemaEditor::dropColumn
virtual void dropColumn(const std::string &columnName)
Removes a column from the collection.
pool::ICollectionSchemaEditor
Definition: ICollectionSchemaEditor.h:22
pool::RootCollection::RootCollectionSchemaEditor::m_poolOut
coral::MessageStream m_poolOut
Definition: RootCollectionSchemaEditor.h:129
CollectionDescription.h
tree
TChain * tree
Definition: tile_monitor.h:30
pool::RootCollection::RootCollectionSchemaEditor::m_tree
TTree * m_tree
Definition: RootCollectionSchemaEditor.h:125
pool
pool namespace
Definition: libname.h:15
pool::RootCollection::RootCollectionSchemaEditor::~RootCollectionSchemaEditor
virtual ~RootCollectionSchemaEditor()
destructor.
pool::RootCollection::RootCollectionSchemaEditor::annotateColumn
virtual const ICollectionColumn & annotateColumn(const std::string &columnName, const std::string &annotation)
add annotation to column
pool::RootCollection::RootCollectionSchemaEditor::readSchema
void readSchema()
pool::RootCollection::RootCollectionSchemaEditor::m_description
CollectionDescription & m_description
Definition: RootCollectionSchemaEditor.h:123
pool::RootCollection::RootCollectionSchemaEditor::insertColumn
virtual const ICollectionColumn & insertColumn(const std::string &columnName, const std::type_info &columnType, const std::string &annotation="", int maxSize=0, bool sizeIsFixed=true)
Adds a new column to the collection.
pool::RootCollection::RootCollection
Collection (and CollectionProxy) implementation based on ROOT trees.
Definition: RootCollection.h:70
ICollectionSchemaEditor.h
pool::RootCollection::RootCollectionSchemaEditor::createTreeBranches
void createTreeBranches()
pool::RootCollection::RootCollectionSchemaEditor::RootCollectionSchemaEditor
RootCollectionSchemaEditor(RootCollection &collection, CollectionDescription &description, TTree *tree)
pool::CollectionDescription
Definition: CollectionDescription.h:29
pool::RootCollection::RootCollectionSchemaEditor::m_schemaWritten
bool m_schemaWritten
Definition: RootCollectionSchemaEditor.h:127
pool::ICollectionColumn
Definition: ICollectionColumn.h:19
pool::RootCollection::RootCollectionSchemaEditor::setEventReferenceColumnName
virtual void setEventReferenceColumnName(const std::string &columnName)
Sets the name of the event reference Token column.
pool::RootCollection::RootCollectionSchemaEditor
Definition: RootCollectionSchemaEditor.h:33
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
MakeNewFileFromOldAndSubstitution.newName
dictionary newName
Definition: ICHEP2016/MakeNewFileFromOldAndSubstitution.py:95
pool::RootCollection::RootCollectionSchemaEditor::writeSchema
void writeSchema()
pool::RootCollection::RootCollectionSchemaEditor::addTreeBranch
void addTreeBranch(const std::string &name, const std::string &type_name)
pool::RootCollection::RootCollectionSchemaEditor::insertColumn
virtual const ICollectionColumn & insertColumn(const std::string &columnName, const std::string &columnType, const std::string &annotation="", int maxSize=0, bool sizeIsFixed=true)
Adds a new column to the collection.
pool::RootCollection::RootCollectionSchemaEditor::insertTokenColumn
virtual const ICollectionColumn & insertTokenColumn(const std::string &columnName, const std::string &annotation="")
Adds a new column of type pool::Token to the collection.
description
std::string description
glabal timer - how long have I taken so far?
Definition: hcg.cxx:88