80 likes | 237 Views
OCDB ACCESS. Offline Weekly Meeting 12 February 2009. The Idea. The Idea is to make it as easy as possible to access the OCDB (i.e. setting the default storage), without setting by hand the AliEn path:
E N D
OCDB ACCESS Offline Weekly Meeting 12 February 2009
The Idea... • The Idea is to make it as easy as possible to access the OCDB (i.e. setting the default storage), without setting by hand the AliEn path: • MC: Since no dependence on the AliRoot version is there anymore, in case of simulation/reconstruction of MC data, the only necessary information concerns the type of simulation (Ideal, Residual, Full) • Raw data: a map to get the AliEn folder from the run number is needed Chiara Zampolli – Offl. Weekly Meeting
Possible Solution – I (not yet final!) • In order to avoid any confusion with what was there in the past, the same methods will be kept: • void SetDefaultStorage(const char* dbString); • void SetDefaultStorage(const AliCDBParam* param); • void SetDefaultStorage(AliCDBStorage *storage); • void SetSpecificStorage(const char* calibType, const char* dbString); • void SetSpecificStorage(const char* calibType, AliCDBParam* param); • For MC data, an additional method is added – overloading of the existing SetDefaultStorage • void SetDefaultStorage(const char* runType, const char* simType); • According to the specified sim-type, the proper MC OCDB folder is returned (hardcoded in AliRoot) Chiara Zampolli – Offl. Weekly Meeting
Possible Solution – II (not yet final!) In the case of Raw data, the run number is needed the Default Storage will be set in two steps: • The existing method is used: • void SetDefaultStorage(const char* dbString); • dbString = “raw://” • If dbString == “raw://”: • A flag (fRaw) is activated in the AliCDBManager instance • A grid storage is automatically set, without pointing to any specific folder • In AliReconstruction, InitCDB() returns without doing anything • In AliReconstruction, SetNumberFromData() sets the run number for the AliCDBManager: as soon as the method AliCDBManager::SetRun(Int_t run) is called, if fRaw is active, the proper Default Storage is set • The setting for the Specific Storages remains as valid as before Chiara Zampolli – Offl. Weekly Meeting
Run Number AliEn OCDB Folder • The correspondance between the Run Number and the AliEn OCDB Folder to be set as Default Storage is done via the parsing of an XMLfile on the grid (path hardcoded in AliRoot) <?xml version="1.0"?> <!DOCTYPE LHCPeriodvsRunRange [ <!ELEMENT LHCPeriodvsRunRange (Folder*)> <!ELEMENT Folder EMPTY> <!ATTLIST Folder StartRunRange CDATA #REQUIRED> <!ATTLIST Folder EndRunRange CDATA #REQUIRED> <!ATTLIST Folder LHCPeriodFolder CDATA #REQUIRED> ]> <LHCPeriodvsRunRange> <Folder StartRunRange="0" EndRunRange="10" LHCPeriodFolder="alien://folder=/alice/data/2008/LHC08a/OCDB"> </Folder> <Folder StartRunRange="11" EndRunRange="20" LHCPeriodFolder="alien://folder=/alice/data/2008/LHC08b/OCDB"> </Folder> </LHCPeriodvsRunRange> Chiara Zampolli – Offl. Weekly Meeting
Parsing the XML file • A SAX Parser will be used: • AliCDBSaxHandler class • Given the run number r_num, the Parsing function returns the start run, the end run for the run range r_num belongs to, and the AliEn folder to be set as Default Storage • At a subsequent AliCDBManager::SetRun() call, the Parsing function is called again only if the new r_num’ is outside the run range already considered. Chiara Zampolli – Offl. Weekly Meeting
Overwriting a File for MC Simulation • An issue concerning the possibility to overwrite a file for MC Simulation arose • So far, the version of a file in the Grid was determined by what was already there in the OCDB no possibility to set anything manually (this prevented to loose files) • From MC simulation, it is now needed to overwrite files keeping the same version ...First idea... • When creating the AliCDBEntry, the version has to be explicitely set • The AliCDBEntry::HasVersion() method is now used when creating the Id for an AliCDBEntry • When putting a new entry in AliEn, the “RECREATE” option is used instead of “CREATE”, otherwise an error may occur Chiara Zampolli – Offl. Weekly Meeting
Some Remarks • OCDB Access • The proposed solution has been tested, and everything works fine within the OCDB framework • The necessary changes in AliReconstruction are still missing • Some minor details still to be fixed – e.g. the parsing of the file should check possible overlaps between run ranges • Overwriting of an OCDB grid file • Some additional protections may be added... Chiara Zampolli – Offl. Weekly Meeting