CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/RecoLuminosity/LumiProducer/interface/RevisionDML.h

Go to the documentation of this file.
00001 #ifndef RecoLuminosity_LumiProducer_RevisionDML_H 
00002 #define RecoLuminosity_LumiProducer_RevisionDML_H
00003 #include <string>
00004 #include <vector>
00005 namespace coral{
00006   class ISchema;
00007 }
00008 namespace lumi{
00009   class RevisionDML{
00010   public:
00011     //class Revision{
00012     //public:
00013     //  Revision():revision_id(0),data_id(0){}
00014     //  unsigned long long revision_id;
00015     //  unsigned long long data_id;
00016     //};
00017     class DataID{
00018     public:
00019       DataID():lumi_id(0),trg_id(0),hlt_id(0){}
00020     public:
00021       unsigned long long lumi_id;       
00022       unsigned long long trg_id;
00023       unsigned long long hlt_id;
00024     };
00025     class Entry{
00026     public:
00027       Entry():revision_id(0),entry_id(0),data_id(0),entry_name(""){}
00028       unsigned long long revision_id;
00029       unsigned long long entry_id;
00030       unsigned long long data_id;
00031       std::string entry_name;
00032     };
00033     class LumiEntry : public Entry{
00034     public:
00035       LumiEntry():source(""),runnumber(0),bgev(0.0){}
00036       std::string source;
00037       unsigned int runnumber;
00038       float bgev;
00039       unsigned int ncollidingbunches;
00040     };
00041     class TrgEntry : public Entry{
00042       public:
00043       TrgEntry():source(""),runnumber(0),bitzeroname(""){}
00044       std::string source;
00045       unsigned int runnumber;
00046       std::string bitzeroname;
00047       std::string bitnames;
00048     };
00049     class HltEntry : public Entry{
00050     public:
00051       HltEntry():source(""),runnumber(0),npath(0){}
00052       std::string source;
00053       unsigned int runnumber;
00054       unsigned int npath;
00055       std::string pathnames;
00056     };
00057 
00061     unsigned long long branchIdByName(coral::ISchema& schema,const std::string& branchName);
00062     
00066     unsigned long long getEntryInBranchByName(coral::ISchema& schema,
00067                                               const std::string& datatableName,
00068                                               const std::string& entryname,
00069                                               const std::string& branchname);
00073     void bookNewEntry(coral::ISchema& schema,
00074                       const std::string& datatableName,
00075                       Entry& entry);
00079     void bookNewRevision(coral::ISchema& schema,
00080                       const std::string& datatableName,
00081                       Entry& revision);
00090     void addEntry(coral::ISchema& schema,const std::string& datatableName,const Entry& entry,unsigned long long branch_id,const std::string& branchname );
00097     void addRevision(coral::ISchema& schema,const std::string& datatableName,const Entry& revision,unsigned long long branch_id,std::string& branchname );
00098     void insertLumiRunData(coral::ISchema& schema,const LumiEntry& lumientry);
00099     void insertTrgRunData(coral::ISchema& schema,const TrgEntry& trgentry);
00100     void insertHltRunData(coral::ISchema& schema,const HltEntry& hltentry);
00101     
00102     unsigned long long currentHFDataTagId(coral::ISchema& schema);
00103     unsigned long long HFDataTagIdByName(coral::ISchema& schema,
00104                                          const std::string& datatagname);
00105     unsigned long long addRunToCurrentHFDataTag(coral::ISchema& schema,
00106                                   unsigned int runnum,
00107                                   unsigned long long lumiid,
00108                                   unsigned long long trgid,
00109                                   unsigned long long hltid,
00110                                   const std::string& patchcomment);
00111     DataID dataIDForRun(coral::ISchema& schema,
00112                         unsigned int runnum,
00113                         unsigned long long tagid);
00114     
00115   };
00116 }//ns lumi
00117 #endif