104def addFolderList(flags, listOfFolderInfoTuple, extensible=False, db=None, modifiers=''):
105 """Add access to the given set of folders, in the identified subdetector schema.
106 FolerInfoTuple consists of (foldername,detDB,classname)
107
108 If EXTENSIBLE is set, then if we access an open-ended IOV at the end of the list,
109 the end time for this range will be set to just past the current event.
110 Subsequent accesses will update this end time for subsequent events.
111 This allows the possibility of later adding a new IOV using IOVSvc::setRange."""
113 folders = []
114 sqliteFolders=getSqliteContent(flags.IOVDb.SqliteInput,
115 flags.IOVDb.SqliteFolders,
116 flags.IOVDb.DatabaseInstance)
117
118 for (fs, detDb, className) in listOfFolderInfoTuple:
119 fse= _extractFolder(fs)
120
121 if className is not None:
122 loadFolders.add((className, fse))
123
124 if fse in sqliteFolders:
125 msg.warning(f'Reading folder {fs} from sqlite, bypassing production database')
126 fs+=sqliteFolders[fse]
127 elif detDb is not None and fs.find('<db>') == -1:
128
129 if db:
130 dbName=db
131 else:
132 dbName = flags.IOVDb.DatabaseInstance
133 if detDb in _dblist.keys():
134 fs = f'<db>{_dblist[detDb]}/{dbName}</db> {fs}'
135 elif os.access(detDb, os.R_OK):
136
137 fs = f'<db>sqlite://;schema={detDb};dbname={dbName}</db> {fs}'
138 else:
139 raise ConfigurationError(f'Error, db shorthand {detDb} not known, nor found as sqlite file')
140
141
142 if extensible:
143 fs = fs + '<extensible/>'
144
145
146 fs += modifiers
147
148
149 folders.append(fs)
150
151
152 result = IOVDbSvcCfg(flags)
153 result.getPrimary().Folders+=folders
154 if loadFolders:
155 result.getCondAlgo('CondInputLoader').Load |= loadFolders
156
157 if flags.IOVDb.CleanerRingSize > 0:
158
159 cleanerSvc = CompFactory.Athena.DelayedConditionsCleanerSvc(RingSize=flags.IOVDb.CleanerRingSize)
160 result.addService(cleanerSvc)
161 result.addService(CompFactory.Athena.ConditionsCleanerSvc(CleanerSvc=cleanerSvc))
162
163
164 return result
165
166