Reading database objects in CMSSW

Specific information about the CSC database objects (what they contain and acessing methods) can be found in CondFormats/CSCObjects. Several configuration files in /test will tell you how to read back an object by a specific tag and IOV. For example, looking at readChamberIndex.cfg, you read back information using the PoolDBESSource inside which you specify the name of the record you want to read (in this case CSCChamberIndexRcd) and a specific tag (CSCChamberIndex):

es_source = PoolDBESSource { VPSet toGet = {
                                     {string record = "CSCChamberIndexRcd"
                                      string tag    = "CSCChamberIndex"}
                                    }

If you misspell the tag name or you try to read some other one that doesn't exist in the database your job will crash with an error like: PoolDBESSource::fillrecordToIOVInfo: tag CSCCrateMap_xxx has empty iov token - which means that it doesn't exist in the database. If you want to read a specific IOV range using an EmptySource (which doesn't require any root or raw file input), you have to add this information to your configuration file as well:

     source = EmptySource {
                    untracked uint32 firstRun = xxx
                    untracked uint32 numberEventsInRun = 1
      }

You read the information by runnumber and from a specific database (like FroNTier):

      string timetype = "runnumber"
      string connect = "frontier://FrontierDev/CMS_COND_CSC"

To be able to connect you need a password - each of our subdetectors has a specific one - which is given to you automatically when you specify the authentication path:

PSet DBParameters = {
                                    untracked string authenticationPath="/afs/cern.ch/cms/DB/conddb"
                                    untracked uint32 authenticationMethod = 1
                                    }

The C++ code which reads the information is located in CondFormats/CSCObjects/test/stubs - if you need something else you have to update these files there - and you need to specify this as a module inside the cfg file:

        module prod1 = CSCReadChamberIndexValuesAnalyzer{}

This particular cfg file will print the information from the module into an ASCII file:

        module print = AsciiOutputModule { }
        endpath ep = { print }

-- OanaBoeriu - 11 Aug 2009

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2009-08-13 - OanaBoeriu
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback