180 likes | 209 Vues
AliRoot Classes for access to Calibration and Alignment objects. Magali Gruw é CERN PH/AIP ALICE Offline Meeting February 17 th 2005. To be presented to detector representatives during Alignment and Calibration Workshop (February 23 rd ). Layout. Wish list Functionalities Usage
E N D
AliRoot Classes for access to Calibration and Alignment objects Magali Gruwé CERN PH/AIP ALICE Offline Meeting February 17th 2005 To be presented to detector representatives during Alignment and Calibration Workshop (February 23rd)
Layout • Wish list • Functionalities • Usage • AliRoot classes • AliRunData • AliMetaData • AliRunDataStorage • AliRunDataFile • AliRunDataAlien • In practice (what does a user have to do?) • In the macros • In the reconstruction code Magali Gruwé CERN PH/AIP ALICE Offline Meeting, February 17th, 2005
Wish list/Functionalities • Simple user interface • Identification of data by strings • Automatically get the right object that is valid for the current run • Same interface for different types of data sources (Simple file, AliEn, something else?…) Magali Gruwé CERN PH/AIP ALICE Offline Meeting, February 17th, 2005
Example of usage • Detector person would like to retrieve some parameter of its sub-detector: • In a macro, specify where the data is stored (local file?, AliEn?) • In the macro, specify metadata: • Which data to get (specified by a string)? • Specific version of the data? • Other characteristics? • The required data is retrieved: • Valid for current run • Closest to specified version or most recent version • Possibility to store the retrieved data into a local file for later usage Magali Gruwé CERN PH/AIP ALICE Offline Meeting, February 17th, 2005
Layout • Wish list • Functionalities • Usage • AliRoot classes • AliRunData • AliMetaData • AliRunDataStorage • AliRunDataFile • AliRunDataAlien • In practice (what does a user have to do?) • In the macros • In the reconstruction code Magali Gruwé CERN PH/AIP ALICE Offline Meeting, February 17th, 2005
Schema AliRunDataAlien AliMetaData AliRunData AliRunDataStorage AliMetaData AliRunData AliRunDataFile TObject* AliMetaData AliRunData AliRunDataCombination Get(“string”,run number) AliRunLoader TObject* GetRunObject(“string”) AliDETReconstructor Magali Gruwé CERN PH/AIP ALICE Offline Meeting, February 17th, 2005
AliRoot Classes (I) • AliRunData: • Contains an object of the database and knows about its validity range • Constructor: • AliRunData::AliRunData(TObject* object, const AliMetaData& metaData) • Contains: • The run dependent data: • Calibration, alignment, geometry, field map,… data • Entirely defined by detector people: • Data such as gains, histograms, pedestals… • The metadata (AliMetaData): • Describes the “validity” of the data • See later… Magali Gruwé CERN PH/AIP ALICE Offline Meeting, February 17th, 2005
AliRoot Classes (II) • AliMetaData: • Metadata of the run dependent data: • Describes the “validity” of the data • Name (any regular expression) • Range of runs for which it is valid • Cycle (Reconstruction pass, etc…) • What else?… • Metadata is attached to AliRunData objects Magali Gruwé CERN PH/AIP ALICE Offline Meeting, February 17th, 2005
AliRoot Classes (III) • AliRunDataStorage: • Provides a simple interface to all run dependent data objects • Virtual interface to the database • Only one AliRunDataStorage instance at a time • Could be an • AliRunDataFile (for a local file) • AliRunDataAlien (for an AliEn file) • What else?… • Probably need for an AliRunDataCombination? • The user does not have to care about the details of where and how the data are stored: this is encapsulated in the implementation of the AliRunDataStorage subclasses: • The user can easily switch between different sources of data (local file for testing, or master database) Magali Gruwé CERN PH/AIP ALICE Offline Meeting, February 17th, 2005
AliRoot Classes (IV) • AliRunDataStorage: • Methods: • void Select(const AliMetaData& metaData) • Specify one or adds a metadata selection criterion • const TObject* Get(const char* name, Int_t runNumber) • Gets an object from the database according to specified selection criteria • Bool_t Put(const TObject* object, const AliMetaData& metaData) • Puts a given object into the database, together with associated metadata • Bool_t RecordToFile(const char* fileName) • Prepares for recording into a local file the entries (AliRunData objects) retrieved from the database Magali Gruwé CERN PH/AIP ALICE Offline Meeting, February 17th, 2005
AliRoot Classes (V) • AliRunDataFile: • Access class for a database in a (local) file • Methods: • GetEntry(AliMetaData& metaData, Int_t runNumber) • Gets an object from the database • PutEntry(AliRunData* entry) • Puts an object into the database • File is specified by a name (including path). Data objects with appropriate metadata are looked for in all cycles of the specified filename, till found. Magali Gruwé CERN PH/AIP ALICE Offline Meeting, February 17th, 2005
AliRoot Classes (VI) • AliRunDataAlien: • Access class for a database in an AliEn file • No implementation yet • Note that in this case, the AliEn file catalogue needs metadata knowledge: metadata is associated to files (as well as to objects). There is some redundancy. Magali Gruwé CERN PH/AIP ALICE Offline Meeting, February 17th, 2005
AliRoot Classes (VII) • Obviously still to be done: • Implementation of AliRunDataAlien • Continue implementation of AliRunDataStorage (Put method) • More thinking about AliMetaData • We probably also need: • An AliRunDataCombination • To deal with cases where some calibration data comes from a local file and the rest comes from AliEn, for example • Yet another AliRunDataStorage type • To deal with the case where we want to load all data stored in a given file, regardless of metadata (whether metadata are present or not) Magali Gruwé CERN PH/AIP ALICE Offline Meeting, February 17th, 2005
Layout • Wish list • Functionalities • Usage • AliRoot classes • AliRunData • AliMetaData • AliRunDataStorage • AliRunDataFile • AliRunDataAlien • In practice (what does a user have to do?) • In the macros • In the reconstruction code Magali Gruwé CERN PH/AIP ALICE Offline Meeting, February 17th, 2005
In a User Macro • Create an instance of the desired database access class: • AliRunDataFile, AliRunDataAlien, … is created • And configured (location, file name, …) • Perform the metadata selection by using the Select method of the AliRunDataStorage class. • May be called several times to specify several selection criteria • If no selection criterion is given, then the (matching) object with the highest version number is returned • The selection criteria are specified via meta data objects Magali Gruwé CERN PH/AIP ALICE Offline Meeting, February 17th, 2005
Selection of Data Objects • Example: • // Select version 2 for all TPC objects • AliMetaData metaData(^TPC/*”); • metaData.SetVersion(2); • AliRunDataStorage::Instance()->Select(metaData); • // But version 3 for TPC/Calibration/Param • metaData.SetName(“TPC/Calibration/Param”); • metaData.SetVersion(3); • AliRunDataStorage::Instance()->Select(metaData); Magali Gruwé CERN PH/AIP ALICE Offline Meeting, February 17th, 2005
In the reconstruction code • Access the data per run via the run loader • runLoader->GetRunObject(“TPC/Calibration/Param”) • The runLoader knows the run number • Other meta data selections were done in users macros • The getRunObject is used in the reconstruction (simulation/analysis) code without any metadata selection (except for the name) • The metadata selection is not done in the compiled code, but rather in the users macros Magali Gruwé CERN PH/AIP ALICE Offline Meeting, February 17th, 2005
Comments • The name of the metadata can be any regular expression • The data itself is identified via a string which can contain a path • The matching of the name to (alien files), directories, catalogues,… is subject to the implementation: the user should not have to care about it • There is redundancy: • Metadata associated to data objects • Metadata associated to files Magali Gruwé CERN PH/AIP ALICE Offline Meeting, February 17th, 2005