CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/DQMServices/Diagnostic/scripts/Database/Python/HDQMDatabaseProducerConfiguration.py

Go to the documentation of this file.
00001 import sys
00002 import ConfigParser
00003 
00004 class HDQMDatabaseProducerConfiguration:
00005 
00006     def __init__(self, configFileName):
00007         config = ConfigParser.ConfigParser()
00008         # config.read("HDQMDatabaseProducerConfiguration.cfg")
00009         config.read(configFileName)
00010 
00011         # [RunSelection]
00012         # ##############
00013 
00014         self.FirstRun = config.get('Config', 'FirstRun')
00015         self.LastRun = config.get('Config', 'LastRun')
00016         self.RunType = config.get('Config', 'RunType')
00017 
00018         if config.get('Config', 'DiscoverRecoTypes') == "True":
00019             self.RecoTypes = ""
00020         else:
00021             self.RecoTypes = config.get('Config', 'RecoTypes').split(",")
00022 
00023         self.RunsToSkip = config.get('Config', 'RunsToSkip')
00024 
00025         # Good run selection
00026         self.Group = config.get('Config', 'Group')
00027 
00028         # Tag
00029         # ###
00030 
00031         # Prefix to tag name. Will be composed with subdet and tag version to build the actual tag name
00032         self.TagName = config.get('Config', 'TagName')
00033 
00034         # Helper class to store information for each tag
00035         class SubDetInfo:
00036             def __init__(self, subDet, tag, qualityFlag):
00037                 self.SubDet = subDet
00038                 self.Tag = tag
00039                 self.QualityFlag = qualityFlag
00040 
00041         self.SubDetsAndTags = list()
00042         fullList = config.get('Config', 'SubDetsAndTags')
00043         for item in fullList.split(";"):
00044             itemList = item.split(",")
00045             if len(itemList) != 3:
00046                 print "Error: incorrect configuration of subDetsAndTags"
00047                 sys.exit()
00048             self.SubDetsAndTags.append(SubDetInfo(itemList[0].strip(), itemList[1].strip(), itemList[2].strip()))
00049             # print itemList[0], itemList[1], itemList[2]
00050 
00051         # [Database]
00052         # ##########
00053         
00054         self.AuthenticationPath = config.get('Config', 'AuthenticationPath')
00055         self.Database = config.get('Config', 'Database')
00056         
00057         # [Directories]
00058         # #############
00059         
00060         # Directory where the scripts are
00061         self.BaseDir = config.get('Config', 'BaseDir')
00062         
00063         # CMS environment
00064         self.CMS_PATH = config.get('Config', 'CMS_PATH')
00065         self.CMSSW_Version = config.get('Config', 'CMSSW_Version')
00066         
00067         # Directory containing the cfg templates
00068         self.TemplatesDir = config.get('Config', 'TemplatesDir')
00069         
00070         # DQM root files location
00071         self.SourceDir = config.get('Config', 'SourceDir')
00072         
00073         # Directory where to copy the plots
00074         self.StorageDir = config.get('Config', 'StorageDir')