CMS 3D CMS Logo

Public Member Functions | Public Attributes

CrabTask::CrabTask Class Reference

List of all members.

Public Member Functions

def __init__
def create
def getoutput
def initializeTask
def run
def submit

Public Attributes

 crab_cfg
 crabCfg_name
 dir
 project
 pset
 pset_name

Detailed Description

Definition at line 7 of file CrabTask.py.


Constructor & Destructor Documentation

def CrabTask::CrabTask::__init__ (   self,
  dir,
  crab_cfg,
  pset = None,
  pset_name = 'mypset.py' 
)

Definition at line 8 of file CrabTask.py.

00009                                                                        :
00010         #Thread.__init__(self)
00011         self.dir = dir
00012   
00013         self.crabCfg_name = 'crab.cfg'
00014         self.crab_cfg = crab_cfg
00015   
00016         self.pset_name = pset_name
00017         self.pset = pset
00018         self.initializeTask(dir=self.dir)


Member Function Documentation

def CrabTask::CrabTask::create (   self,
  dir 
)

Definition at line 30 of file CrabTask.py.

00031                         :
00032         self.project = crabCreate(dir,self.crabCfg_name)
00033         return self.project

def CrabTask::CrabTask::getoutput (   self)

Definition at line 38 of file CrabTask.py.

00039                        :
00040         if not self.project: raise RuntimeError
00041         getOutput(self.project)

def CrabTask::CrabTask::initializeTask (   self,
  dir 
)

Definition at line 19 of file CrabTask.py.

00020                                  :
00021         if not os.path.exists(dir): os.makedirs(dir)
00022 
00023         # Write pset 
00024         if self.pset:
00025             self.crab_cfg.set('CMSSW','pset',self.pset_name)
00026             open(dir + '/' + self.pset_name,'w').write(self.pset) 
00027 
00028         # Write CRAB cfg
00029         self.crab_cfg.write(open(dir + '/' + self.crabCfg_name,'w'))
         
def CrabTask::CrabTask::run (   self)

Definition at line 46 of file CrabTask.py.

00047                  :
00048         #self.initializeTask(dir=self.dir)
00049         proj = self.create(self.dir) 
00050         self.submit()
00051         return proj

def CrabTask::CrabTask::submit (   self)

Definition at line 34 of file CrabTask.py.

00035                     :
00036         if not self.project: raise RuntimeError
00037         crabSubmit(self.project)


Member Data Documentation

Definition at line 8 of file CrabTask.py.

Definition at line 8 of file CrabTask.py.

Definition at line 8 of file CrabTask.py.

Definition at line 30 of file CrabTask.py.

Definition at line 8 of file CrabTask.py.

Definition at line 8 of file CrabTask.py.