ATLAS Offline Software
TrigConfCoolFolderSpec.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // ============================================================
6 // filename: TrigConfCoolFolderSpec.cpp
7 // package: Trigger/TrigConfStorage
8 // project: AtlasTrigger
9 //
10 // author: Joerg Stelzer <stelzer@cern.ch>
11 //
12 // purpose: this class defines the COOL folder structure of the
13 // trigger configuration (LVL1 and HLT)
14 //
15 // ============================================================
16 
17 #ifndef TrigConfCoolFolderSpec_h
18 #define TrigConfCoolFolderSpec_h
19 
20 #include <iostream>
21 #include <vector>
22 #include <map>
23 
24 #include "CoolKernel/pointers.h"
25 #include "CoolKernel/FolderVersioning.h"
26 #include "CoolKernel/FolderSpecification.h"
27 
28 #include <sys/types.h>
29 
30 #include <stdint.h>
31 
32 namespace cool {
33  class RecordSpecification;
34  class IRecordSpecification;
35 }
36 
37 namespace TrigConf {
38 
39 
41  public:
42  FolderDefinition(const std::string& folder, cool::FolderVersioning::Mode mode, const cool::RecordSpecification& rspec) :
44  std::string folder;
45  cool::FolderSpecification fspec;
46  cool::RecordSpecification m_rspec;
47  cool::RecordSpecification& rspec() { return m_rspec; }
48  // const cool::RecordSpecification& rspec() { return fspec->payloadSpecification(); }
49  };
50 
51 
54  public:
55 
57  static int readSchemaVersion(cool::IDatabasePtr db);
58 
61 
67  static cool::IFolderSetPtr createFolderStructure(cool::IDatabasePtr db, int schemaVersion = 0);
68 
74  static cool::IFolderSetPtr createMonFolderStructure(cool::IDatabasePtr db, int schemaVersion = 0);
75 
81  static void printFolderStructure(cool::IDatabasePtr db, std::ostream & o);
82 
83 
84 
85 
86  // /TRIGGER/LVL1/Menu
87  static cool::IFolderPtr getLvl1MenuFolder(cool::IDatabasePtr db);
88 
89 
90  // /TRIGGER/LVL1/ItemDef
91  static cool::IFolderPtr getLvl1ItemDefFolder(cool::IDatabasePtr db);
92 
93 
94  // /TRIGGER/LVL1/Threshold
95  static cool::IFolderPtr getLvl1ThresholdFolder(cool::IDatabasePtr db);
96 
97 
98  // /TRIGGER/LVL1/Lvl1ConfigKey
99  static cool::IFolderPtr getLvl1ConfKeyFolder(cool::IDatabasePtr db);
100 
101 
102  // /TRIGGER/LVL1/Prescales
103  static cool::IFolderPtr getLvl1PrescalesFolder(cool::IDatabasePtr db);
104 
105 
106  // /TRIGGER/LVL1/BunchGroupKey
107  static cool::IFolderPtr getLvl1BGKeyFolder(cool::IDatabasePtr db);
108 
109 
110  // /TRIGGER/LVL1/BunchGroupContent
111  static cool::IFolderPtr getLvl1BGContentFolder(cool::IDatabasePtr db);
112 
113 
114  // /TRIGGER/LVL1/BunchGroupDescription
115  static cool::IFolderPtr getLvl1BGDescFolder(cool::IDatabasePtr db);
116 
117 
118  // /TRIGGER/LVL1/CTPCoreInputMapping
119  static cool::IFolderPtr getLvl1InputMapFolder(cool::IDatabasePtr db);
120 
121 
122  // /TRIGGER/LVL1/CTPInMonitoringMapping
123  static cool::IFolderPtr getLvl1MonMapFolder(cool::IDatabasePtr db);
124 
125 
126  // /TRIGGER/HLT/Menu
127  static cool::IFolderPtr getHltMenuFolder(cool::IDatabasePtr db);
128 
129 
130  // /TRIGGER/HLT/Menu
131  static cool::IFolderPtr getHltChainGroupFolder(cool::IDatabasePtr db);
132 
133 
134  // /TRIGGER/HLT/HltConfigKeys
135  static cool::IFolderPtr getHltConfKeyFolder(cool::IDatabasePtr db);
136 
137 
138  // /TRIGGER/HLT/MenuAwareMonConfigKey
139  static cool::IFolderPtr getMonConfKeyFolder(cool::IDatabasePtr db);
140 
141 
142  // /TRIGGER/HLT/Prescales
143  static cool::IFolderPtr getHltPrescalesFolder(cool::IDatabasePtr db);
144 
145 
146  // /TRIGGER/HLT/PrescaleKey
147  static cool::IFolderPtr getHltPrescaleKeyFolder(cool::IDatabasePtr db);
148 
149 
150  // returns version number
151  static int determineSchemaVersion(const std::vector<cool::IFolderPtr> & folders);
152 
153 
154  static bool CreateFolderIfNotExist(cool::IDatabasePtr db, const std::string& folder, const cool::IRecordSpecification& spec,
155  cool::FolderVersioning::Mode mode, bool isMultiChannel);
156 
157  static bool CreateFolderIfNotExist(cool::IDatabasePtr db, FolderDefinition fd, bool isMultiChannel);
158 
159 
164  static FolderDefinition Lvl1PrescalesFolderDefinition(int schemaVersion);
175 
176 
177  static cool::RecordSpecification createLvl1MenuFolderSpecification();
178  static cool::RecordSpecification createLvl1ItemDefFolderSpecification();
179  static cool::RecordSpecification createLvl1ThresholdFolderSpecification();
180  static cool::RecordSpecification createLvl1ConfigKeysFolderSpecification();
181  static cool::RecordSpecification createLvl1PrescalesFolderSpecification(int schemaVersion);
182  static cool::RecordSpecification createLvl1InputMapFolderSpecification();
183  static cool::RecordSpecification createLvl1MonMapFolderSpecification();
184  static cool::RecordSpecification createLvl1BGKeyFolderSpecification();
185  static cool::RecordSpecification createLvl1BGContentFolderSpecification();
186  static cool::RecordSpecification createLvl1BGDescFolderSpecification();
187  static cool::RecordSpecification createHltMenuFolderSpecification();
188  static cool::RecordSpecification createHltChainGroupFolderSpecification();
189  static cool::RecordSpecification createHltConfigKeysFolderSpecification();
190  static cool::RecordSpecification createHltPrescalesFolderSpecification();
191  static cool::RecordSpecification createHltPrescaleKeyFolderSpecification();
192 
193  const static int mDefaultSchemaVersion;
194  const static long mBGDescBlobSize;
195  const static long mBGContentBlobSize;
196 
197  private:
200 
203 
204  };
205 
206 } // end namespace TrigConf
207 
208 #endif
TrigConf::TrigConfCoolFolderSpec::Lvl1BGContentFolderDefinition
static FolderDefinition Lvl1BGContentFolderDefinition()
Definition: TrigConfCoolFolderSpec.cxx:213
TrigConf::TrigConfCoolFolderSpec::TrigConfCoolFolderSpec
TrigConfCoolFolderSpec(const TrigConfCoolFolderSpec &)
copy constructor
Definition: TrigConfCoolFolderSpec.h:202
TrigConf::TrigConfCoolFolderSpec::HltPrescaleKeyFolderDefinition
static FolderDefinition HltPrescaleKeyFolderDefinition()
Definition: TrigConfCoolFolderSpec.cxx:338
TrigConf::TrigConfCoolFolderSpec::getLvl1PrescalesFolder
static cool::IFolderPtr getLvl1PrescalesFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:511
TrigConf::TrigConfCoolFolderSpec::createLvl1MenuFolderSpecification
static cool::RecordSpecification createLvl1MenuFolderSpecification()
defines the folder structure for the LVL1 menu
Definition: TrigConfCoolFolderSpec.cxx:81
TrigConf::TrigConfCoolFolderSpec::createLvl1ItemDefFolderSpecification
static cool::RecordSpecification createLvl1ItemDefFolderSpecification()
defines the folder structure for the LVL1 item def
Definition: TrigConfCoolFolderSpec.cxx:98
TrigConf::TrigConfCoolFolderSpec::createLvl1ConfigKeysFolderSpecification
static cool::RecordSpecification createLvl1ConfigKeysFolderSpecification()
defines the folder structure for the LVL1 config key
Definition: TrigConfCoolFolderSpec.cxx:134
TrigConf::TrigConfCoolFolderSpec::Lvl1BGKeyFolderDefinition
static FolderDefinition Lvl1BGKeyFolderDefinition()
Definition: TrigConfCoolFolderSpec.cxx:197
TrigConf::TrigConfCoolFolderSpec::getHltChainGroupFolder
static cool::IFolderPtr getHltChainGroupFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:539
TrigConf::FolderDefinition::folder
std::string folder
Definition: TrigConfCoolFolderSpec.h:44
CaloCondBlobAlgs_fillNoiseFromASCII.spec
spec
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:47
TrigConf::TrigConfCoolFolderSpec::getLvl1ConfKeyFolder
static cool::IFolderPtr getLvl1ConfKeyFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:507
CaloCondBlobAlgs_fillNoiseFromASCII.db
db
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:43
TrigConf::TrigConfCoolFolderSpec::HltConfigKeysFolderDefinition
static FolderDefinition HltConfigKeysFolderDefinition()
Definition: TrigConfCoolFolderSpec.cxx:302
TrigConf::TrigConfCoolFolderSpec::getLvl1MenuFolder
static cool::IFolderPtr getLvl1MenuFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:495
TrigConf::TrigConfCoolFolderSpec::getDefaultSchemaVersion
static int getDefaultSchemaVersion()
access to the version
Definition: TrigConfCoolFolderSpec.h:60
TrigConf::TrigConfCoolFolderSpec::getLvl1BGKeyFolder
static cool::IFolderPtr getLvl1BGKeyFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:515
TrigConf::TrigConfCoolFolderSpec::createFolderStructure
static cool::IFolderSetPtr createFolderStructure(cool::IDatabasePtr db, int schemaVersion=0)
creates the folder structure in the COOL database
Definition: TrigConfCoolFolderSpec.cxx:415
TrigConf::TrigConfCoolFolderSpec::mBGDescBlobSize
static const long mBGDescBlobSize
Definition: TrigConfCoolFolderSpec.h:194
TrigConf::TrigConfCoolFolderSpec::getHltConfKeyFolder
static cool::IFolderPtr getHltConfKeyFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:543
TrigConf::FolderDefinition::rspec
cool::RecordSpecification & rspec()
Definition: TrigConfCoolFolderSpec.h:47
TrigConf::TrigConfCoolFolderSpec::createMonFolderStructure
static cool::IFolderSetPtr createMonFolderStructure(cool::IDatabasePtr db, int schemaVersion=0)
creates the folder structure in the monitoring COOL database
Definition: TrigConfCoolFolderSpec.cxx:476
TrigConf::TrigConfCoolFolderSpec::Lvl1BGDescFolderDefinition
static FolderDefinition Lvl1BGDescFolderDefinition()
Definition: TrigConfCoolFolderSpec.cxx:229
TrigConf::TrigConfCoolFolderSpec::createHltChainGroupFolderSpecification
static cool::RecordSpecification createHltChainGroupFolderSpecification()
defines the folder structure for the HLT chain groups
Definition: TrigConfCoolFolderSpec.cxx:280
TrigConf::FolderDefinition::m_rspec
cool::RecordSpecification m_rspec
Definition: TrigConfCoolFolderSpec.h:46
TrigConf::TrigConfCoolFolderSpec::determineSchemaVersion
static int determineSchemaVersion(const std::vector< cool::IFolderPtr > &folders)
TrigConf::TrigConfCoolFolderSpec::getHltPrescalesFolder
static cool::IFolderPtr getHltPrescalesFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:551
cool
Definition: CoolTagInfo.h:12
TrigConf::TrigConfCoolFolderSpec::getMonConfKeyFolder
static cool::IFolderPtr getMonConfKeyFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:547
TrigConf::TrigConfCoolFolderSpec::createLvl1MonMapFolderSpecification
static cool::RecordSpecification createLvl1MonMapFolderSpecification()
defines the folder structure for the LVL1 monitoring counter map
Definition: TrigConfCoolFolderSpec.cxx:353
TrigConf::FolderDefinition::FolderDefinition
FolderDefinition(const std::string &folder, cool::FolderVersioning::Mode mode, const cool::RecordSpecification &rspec)
Definition: TrigConfCoolFolderSpec.h:42
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
TrigConf::TrigConfCoolFolderSpec::HltChainGroupFolderDefinition
static FolderDefinition HltChainGroupFolderDefinition()
Definition: TrigConfCoolFolderSpec.cxx:285
TrigConf::TrigConfCoolFolderSpec::getHltMenuFolder
static cool::IFolderPtr getHltMenuFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:535
TrigConf::TrigConfCoolFolderSpec::Lvl1ItemDefFolderDefinition
static FolderDefinition Lvl1ItemDefFolderDefinition()
Definition: TrigConfCoolFolderSpec.cxx:103
TrigConf::TrigConfCoolFolderSpec::createLvl1BGContentFolderSpecification
static cool::RecordSpecification createLvl1BGContentFolderSpecification()
defines the folder structure for the LVL1 bunch groups
Definition: TrigConfCoolFolderSpec.cxx:208
TrigConf::TrigConfCoolFolderSpec::HltPrescalesFolderDefinition
static FolderDefinition HltPrescalesFolderDefinition()
Definition: TrigConfCoolFolderSpec.cxx:320
TrigConf::TrigConfCoolFolderSpec::Lvl1ThresholdFolderDefinition
static FolderDefinition Lvl1ThresholdFolderDefinition()
Definition: TrigConfCoolFolderSpec.cxx:121
TrigConf::FolderDefinition::fspec
cool::FolderSpecification fspec
Definition: TrigConfCoolFolderSpec.h:45
TrigConf::TrigConfCoolFolderSpec::createHltPrescaleKeyFolderSpecification
static cool::RecordSpecification createHltPrescaleKeyFolderSpecification()
defines the folder structure for the HLT prescales
Definition: TrigConfCoolFolderSpec.cxx:333
TrigConf::TrigConfCoolFolderSpec::getLvl1BGDescFolder
static cool::IFolderPtr getLvl1BGDescFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:523
TrigConf::TrigConfCoolFolderSpec::mBGContentBlobSize
static const long mBGContentBlobSize
Definition: TrigConfCoolFolderSpec.h:195
Preparation.mode
mode
Definition: Preparation.py:94
TrigConf::TrigConfCoolFolderSpec::createLvl1BGKeyFolderSpecification
static cool::RecordSpecification createLvl1BGKeyFolderSpecification()
defines the folder structure for the LVL1 bunch group key
Definition: TrigConfCoolFolderSpec.cxx:192
TrigConf::TrigConfCoolFolderSpec::createHltMenuFolderSpecification
static cool::RecordSpecification createHltMenuFolderSpecification()
defines the folder structure for the HLT menu
Definition: TrigConfCoolFolderSpec.cxx:256
TrigConf::TrigConfCoolFolderSpec::Lvl1MonMapFolderSpecification
static FolderDefinition Lvl1MonMapFolderSpecification()
Definition: TrigConfCoolFolderSpec.cxx:358
TrigConf::TrigConfCoolFolderSpec
Definition of the COOL folder structure for the trigger configuration data.
Definition: TrigConfCoolFolderSpec.h:53
TrigConf::TrigConfCoolFolderSpec::TrigConfCoolFolderSpec
TrigConfCoolFolderSpec()
default constructor
Definition: TrigConfCoolFolderSpec.h:199
TrigConf::TrigConfCoolFolderSpec::Lvl1InputMapFolderDefinition
static FolderDefinition Lvl1InputMapFolderDefinition()
Definition: TrigConfCoolFolderSpec.cxx:175
ReadFromCoolCompare.fd
fd
Definition: ReadFromCoolCompare.py:196
TrigConf::TrigConfCoolFolderSpec::createLvl1BGDescFolderSpecification
static cool::RecordSpecification createLvl1BGDescFolderSpecification()
defines the folder structure for the LVL1 bunch group descriptions
Definition: TrigConfCoolFolderSpec.cxx:224
EventContainers::Mode
Mode
Definition: IdentifiableContainerBase.h:13
TrigConf::TrigConfCoolFolderSpec::readSchemaVersion
static int readSchemaVersion(cool::IDatabasePtr db)
get the version of the COOL database
Definition: TrigConfCoolFolderSpec.cxx:32
TrigConf::TrigConfCoolFolderSpec::getLvl1ItemDefFolder
static cool::IFolderPtr getLvl1ItemDefFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:499
TrigConf::TrigConfCoolFolderSpec::createHltPrescalesFolderSpecification
static cool::RecordSpecification createHltPrescalesFolderSpecification()
defines the folder structure for the HLT prescales
Definition: TrigConfCoolFolderSpec.cxx:315
TrigConf::TrigConfCoolFolderSpec::createHltConfigKeysFolderSpecification
static cool::RecordSpecification createHltConfigKeysFolderSpecification()
defines the folder structure for the HLT config key
Definition: TrigConfCoolFolderSpec.cxx:297
TrigConf::TrigConfCoolFolderSpec::CreateFolderIfNotExist
static bool CreateFolderIfNotExist(cool::IDatabasePtr db, FolderDefinition fd, bool isMultiChannel)
TrigConf::TrigConfCoolFolderSpec::HltMenuFolderDefinition
static FolderDefinition HltMenuFolderDefinition()
Definition: TrigConfCoolFolderSpec.cxx:261
makeDTCalibBlob_pickPhase.folders
folders
Definition: makeDTCalibBlob_pickPhase.py:346
TrigConf::TrigConfCoolFolderSpec::CreateFolderIfNotExist
static bool CreateFolderIfNotExist(cool::IDatabasePtr db, const std::string &folder, const cool::IRecordSpecification &spec, cool::FolderVersioning::Mode mode, bool isMultiChannel)
TrigConf::TrigConfCoolFolderSpec::getLvl1BGContentFolder
static cool::IFolderPtr getLvl1BGContentFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:519
TrigConf::TrigConfCoolFolderSpec::Lvl1PrescalesFolderDefinition
static FolderDefinition Lvl1PrescalesFolderDefinition(int schemaVersion)
Definition: TrigConfCoolFolderSpec.cxx:155
CaloCondBlobAlgs_fillNoiseFromASCII.folder
folder
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:56
TrigConf::FolderDefinition
Definition: TrigConfCoolFolderSpec.h:40
TrigConf::TrigConfCoolFolderSpec::printFolderStructure
static void printFolderStructure(cool::IDatabasePtr db, std::ostream &o)
prints the folder structure that is in the COOL database
Definition: TrigConfCoolFolderSpec.cxx:564
TrigConf::TrigConfCoolFolderSpec::mDefaultSchemaVersion
static const int mDefaultSchemaVersion
Definition: TrigConfCoolFolderSpec.h:193
TrigConf::TrigConfCoolFolderSpec::getLvl1MonMapFolder
static cool::IFolderPtr getLvl1MonMapFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:531
TrigConf::TrigConfCoolFolderSpec::getLvl1ThresholdFolder
static cool::IFolderPtr getLvl1ThresholdFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:503
TrigConf::TrigConfCoolFolderSpec::getHltPrescaleKeyFolder
static cool::IFolderPtr getHltPrescaleKeyFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:555
TrigConf::TrigConfCoolFolderSpec::getLvl1InputMapFolder
static cool::IFolderPtr getLvl1InputMapFolder(cool::IDatabasePtr db)
Definition: TrigConfCoolFolderSpec.cxx:527
TrigConf::TrigConfCoolFolderSpec::Lvl1MenuFolderDefinition
static FolderDefinition Lvl1MenuFolderDefinition()
Definition: TrigConfCoolFolderSpec.cxx:86
TrigConf::TrigConfCoolFolderSpec::createLvl1PrescalesFolderSpecification
static cool::RecordSpecification createLvl1PrescalesFolderSpecification(int schemaVersion)
defines the folder structure for the LVL1 prescales
Definition: TrigConfCoolFolderSpec.cxx:150
TrigConf::TrigConfCoolFolderSpec::Lvl1ConfigKeysFolderDefinition
static FolderDefinition Lvl1ConfigKeysFolderDefinition()
Definition: TrigConfCoolFolderSpec.cxx:139
TrigConf::TrigConfCoolFolderSpec::createLvl1ThresholdFolderSpecification
static cool::RecordSpecification createLvl1ThresholdFolderSpecification()
defines the folder structure for the LVL1 thresholds
Definition: TrigConfCoolFolderSpec.cxx:116
TrigConf::TrigConfCoolFolderSpec::createLvl1InputMapFolderSpecification
static cool::RecordSpecification createLvl1InputMapFolderSpecification()
defines the folder structure for the LVL1 CTP input map
Definition: TrigConfCoolFolderSpec.cxx:170