CMS 3D CMS Logo

Public Member Functions | Public Attributes

DTResidualCalibration::DTResidualCalibration Class Reference

List of all members.

Public Member Functions

def __init__
def initCrab
def initProcess
def run
def writeCfg

Public Attributes

 config
 crab_cfg
 dir
 inputdb
 outputfile
 process
 project
 pset_name
 pset_template
 task

Detailed Description

Definition at line 6 of file DTResidualCalibration.py.


Constructor & Destructor Documentation

def DTResidualCalibration::DTResidualCalibration::__init__ (   self,
  run,
  dir,
  input_db,
  config 
)

Definition at line 7 of file DTResidualCalibration.py.

00008                                                   :
00009         self.pset_name = 'dtResidualCalibration_cfg.py'
00010         self.outputfile = 'residuals.root'
00011         self.config = config
00012         self.dir = dir
00013         self.inputdb = input_db
00014 
00015         self.pset_template = 'CalibMuon.DTCalibration.dtResidualCalibration_cfg'
00016         if hasattr(self.config,'runOnCosmics') and self.config.runOnCosmics:
00017             self.pset_template = 'CalibMuon.DTCalibration.dtResidualCalibration_cosmics_cfg'
00018 
00019         self.process = None  
00020         self.crab_cfg = None
00021         self.initProcess()
00022         self.initCrab()
00023         self.task = CrabTask(self.dir,self.crab_cfg)


Member Function Documentation

def DTResidualCalibration::DTResidualCalibration::initCrab (   self)

Definition at line 61 of file DTResidualCalibration.py.

00062                       :
00063         crab_cfg_parser = loadCrabCfg()
00064         loadCrabDefault(crab_cfg_parser,self.config)
00065         crab_cfg_parser.set('CMSSW','pset',self.pset_name)
00066         crab_cfg_parser.set('CMSSW','output_file',self.outputfile)
00067         crab_cfg_parser.remove_option('USER','additional_input_files')
00068         if self.inputdb:
00069             addCrabInputFile(crab_cfg_parser,self.inputdb)
00070 
00071         if hasattr(self.config,'inputVDriftDB') and self.config.inputVDriftDB:
00072             addCrabInputFile(crab_cfg_parser,self.config.inputVDriftDB)
00073 
00074         self.crab_cfg = crab_cfg_parser

def DTResidualCalibration::DTResidualCalibration::initProcess (   self)

Definition at line 24 of file DTResidualCalibration.py.

00025                          :
00026         self.process = loadCmsProcess(self.pset_template)
00027         self.process.GlobalTag.globaltag = self.config.globaltag
00028         self.process.dtResidualCalibration.rootFileName = self.outputfile 
00029 
00030         if hasattr(self.config,'inputVDriftDB') and self.config.inputVDriftDB:
00031             addPoolDBESSource(process = self.process,
00032                               moduleName = 'vDriftDB',record = 'DTMtimeRcd',tag = 'vDrift',
00033                               connect = 'sqlite_file:%s' % os.path.basename(self.config.inputVDriftDB))
00034 
00035         if hasattr(self.config,'inputDBTag') and self.config.inputDBTag:
00036             tag = self.config.inputDBTag
00037             record = self.config.inputDBRcd
00038             connect = self.config.connectStrDBTag
00039             moduleName = 'customDB%s' % record 
00040             addPoolDBESSource(process = self.process,
00041                               moduleName = moduleName,record = record,tag = tag,
00042                               connect = connect)
00043 
00044         if(self.inputdb):
00045             label = ''
00046             if hasattr(self.config,'runOnCosmics') and self.config.runOnCosmics: label = 'cosmics'
00047             addPoolDBESSource(process = self.process,
00048                               moduleName = 'calibDB',record = 'DTTtrigRcd',tag = 'ttrig',label = label,
00049                               connect = 'sqlite_file:%s' % os.path.basename(self.inputdb))
00050 
00051         if hasattr(self.config,'runOnRAW') and self.config.runOnRAW:
00052             if hasattr(self.config,'runOnMC') and self.config.runOnMC:
00053                 getattr(self.process,self.config.digilabel).inputLabel = 'rawDataCollector' 
00054             prependPaths(self.process,self.config.digilabel)
00055  
00056         if hasattr(self.config,'preselection') and self.config.preselection:
00057             pathsequence = self.config.preselection.split(':')[0]
00058             seqname = self.config.preselection.split(':')[1]
00059             self.process.load(pathsequence)
00060             prependPaths(self.process,seqname)

def DTResidualCalibration::DTResidualCalibration::run (   self)

Definition at line 79 of file DTResidualCalibration.py.

00080                  :
00081         self.project = self.task.run()
00082         return self.project
def DTResidualCalibration::DTResidualCalibration::writeCfg (   self)

Definition at line 75 of file DTResidualCalibration.py.

00076                       :
00077         writeCfg(self.process,self.dir,self.pset_name)
00078         #writeCfgPkl(self.process,self.dir,self.pset_name)


Member Data Documentation

Definition at line 7 of file DTResidualCalibration.py.

Definition at line 7 of file DTResidualCalibration.py.

Definition at line 7 of file DTResidualCalibration.py.

Definition at line 7 of file DTResidualCalibration.py.

Definition at line 7 of file DTResidualCalibration.py.

Definition at line 7 of file DTResidualCalibration.py.

Definition at line 79 of file DTResidualCalibration.py.

Definition at line 7 of file DTResidualCalibration.py.

Definition at line 7 of file DTResidualCalibration.py.

Definition at line 7 of file DTResidualCalibration.py.