CMS 3D CMS Logo

AlCaTestEnable.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 """
3 _AlCaTestEnable_
4 
5 Scenario supporting proton collisions
6 
7 """
8 
10 
11 class AlCaTestEnable(AlCa):
12  def __init__(self):
13  AlCa.__init__(self)
14  self.skims=['TkAlLAS']
15  """
16  _AlCaTestEnable_
17 
18  Implement configuration building for data processing for proton
19  collision data taking
20 
21  """
22 
23  def expressProcessing(self, globalTag, **args):
24  """
25  _expressProcessing_
26 
27  Proton collision data taking express processing
28 
29  """
30  skims = []
31  if 'skims' in args:
32  skims = args['skims']
33  if 'EcalTestPulsesRaw' not in args['skims']:
34  skims.append('EcalTestPulsesRaw')
35  pclWkflws = [x for x in skims if "PromptCalibProd" in x]
36  for wfl in pclWkflws:
37  skims.remove(wfl)
38 
39  options = Options()
40  options.__dict__.update(defaultOptions.__dict__)
41  options.scenario = "pp"
42  options.step = stepALCAPRODUCER(skims)
43 
44  if 'outputs' in args:
45  # the RAW data-tier needs a special treatment since the event-content as defined in release is not good enough
46  outputs_Raw = [x for x in args['outputs'] if x['dataTier'] == 'RAW']
47  outputs_noRaw = [x for x in args['outputs'] if x['dataTier'] != 'RAW']
48  if len(outputs_Raw) == 1:
49  print 'RAW data-tier requested'
50  options.outputDefinition = outputs_noRaw.__str__()
51 
52  # dictIO(options,args)
53  options.conditions = gtNameAndConnect(globalTag, args)
54 
55  options.filein = 'tobeoverwritten.xyz'
56  if 'inputSource' in args:
57  options.filetype = args['inputSource']
58  process = cms.Process('RECO', self.eras)
59 
60  if 'customs' in args:
61  options.customisation_file=args['customs']
62 
63  cb = ConfigBuilder(options, process = process, with_output = True, with_input = True)
64 
65  cb.prepare()
66 
67  addMonitoring(process)
68 
69  for output in outputs_Raw:
70  print output
71  moduleLabel = output['moduleLabel']
72  selectEvents = output.get('selectEvents', None)
73  maxSize = output.get('maxSize', None)
74 
75  outputModule = cms.OutputModule(
76  "PoolOutputModule",
77  fileName = cms.untracked.string("%s.root" % moduleLabel)
78  )
79 
80  outputModule.dataset = cms.untracked.PSet(dataTier = cms.untracked.string("RAW"))
81 
82  if maxSize != None:
83  outputModule.maxSize = cms.untracked.int32(maxSize)
84 
85  if selectEvents != None:
86  outputModule.SelectEvents = cms.untracked.PSet(
87  SelectEvents = cms.vstring(selectEvents)
88  )
89  outputModule.outputCommands = cms.untracked.vstring('drop *',
90  'keep *_*_*_HLT')
91 
92  setattr(process, moduleLabel, outputModule)
93  # outputModule=getattr(self.process,theModuleLabel)
94  setattr(process, moduleLabel+'_step', cms.EndPath(outputModule))
95  path = getattr(process, moduleLabel+'_step')
96  process.schedule.append(path)
97 
98  return process
99 
100  def alcaHarvesting(self, globalTag, datasetName, **args):
101  """
102  _alcaHarvesting_
103 
104  Proton collisions data taking AlCa Harvesting
105 
106  """
107  skims = []
108  if 'skims' in args:
109  skims = args['skims']
110 
111 
112  if 'alcapromptdataset' in args:
113  skims.append('@'+args['alcapromptdataset'])
114 
115  if len(skims) == 0: return None
116  options = defaultOptions
117  options.scenario = self.cbSc if hasattr(self,'cbSc') else self.__class__.__name__
118  options.step = "ALCAHARVEST:"+('+'.join(skims))
119  options.name = "ALCAHARVEST"
120  options.conditions = gtNameAndConnect(globalTag, args)
121 
122  process = cms.Process("ALCAHARVEST", self.eras)
123  process.source = cms.Source("PoolSource")
124 
125  if 'customs' in args:
126  options.customisation_file=args['customs']
127 
128  configBuilder = ConfigBuilder(options, process = process)
129  configBuilder.prepare()
130 
131  #
132  # customise process for particular job
133  #
134  process.source.processingMode = cms.untracked.string('RunsAndLumis')
135  process.source.fileNames = cms.untracked(cms.vstring())
136  process.maxEvents.input = -1
137  process.dqmSaver.workflow = datasetName
138 
139  return process
def alcaHarvesting(self, globalTag, datasetName, args)
def gtNameAndConnect(globalTag, args)
Definition: Utils.py:137
def expressProcessing(self, globalTag, args)
def addMonitoring(process)
Definition: Utils.py:38
def stepALCAPRODUCER(skims)
Definition: Utils.py:9
static std::string join(char **cmd)
Definition: RemoteFile.cc:18