示例#1
0
  def createReconstructionProduction( self, meta, prodName, parameterDict ):
    """ create reconstruction production """
    gLogger.notice( "*"*80 + "\nCreating reconstruction production: %s " % prodName )
    from ILCDIRAC.Interfaces.API.NewInterface.ProductionJob import ProductionJob
    recProd = ProductionJob()
    recProd.dryrun = self._flags.dryRun
    recProd.setLogLevel( self.productionLogLevel )
    productionType = 'MCReconstruction_Overlay' if self._flags.over else 'MCReconstruction'
    recProd.setProdType( productionType )
    recProd.setClicConfig( self.clicConfig )

    res = recProd.setInputDataQuery( meta )
    if not res['OK']:
      raise RuntimeError( "Error setting inputDataQuery for Reconstruction production: %s " % res['Message'] )

    recProd.setOutputSE( self.outputSE )
    recType = 'rec_overlay' if self._flags.over else 'rec'
    recProd.setWorkflowName( self._productionName( meta, parameterDict, recType ) )
    recProd.setProdGroup( self.prodGroup )

    #Add overlay if needed
    if self._flags.over:
      res = recProd.append( self.createOverlayApplication( float( meta['Energy'] ) ) )
      if not res['OK']:
        raise RuntimeError( "Error appending overlay to reconstruction transformation: %s" % res['Message'] )

    #Add reconstruction
    res = recProd.append( self.createMarlinApplication( float( meta['Energy'] ) ) )
    if not res['OK']:
      raise RuntimeError( "Error appending Marlin to reconstruction production: %s" % res['Message'] )
    recProd.addFinalization(True,True,True,True)

    description = "CLICDet2017 %s" % meta['Energy']
    description += "Overlay" if self._flags.over else "No Overlay"
    if prodName:
      description += ", %s"%prodName
    recProd.setDescription( description )

    res = recProd.createProduction()
    if not res['OK']:
      raise RuntimeError( "Error creating reconstruction production: %s" % res['Message'] )

    recProd.addMetadataToFinalFiles( { 'BeamParticle1': parameterDict['pname1'],
                                       'BeamParticle2': parameterDict['pname2'],
                                       'EPA_B1': parameterDict['epa_b1'],
                                       'EPA_B2': parameterDict['epa_b2'],
                                     }
                                   )

    res = recProd.finalizeProd()
    if not res['OK']:
      raise RuntimeError( "Error finalising reconstruction production: %s " % res['Message'] )

    reconstructionMeta = recProd.getMetadata()
    return reconstructionMeta
示例#2
0
  def createSplitProduction( self, meta, prodName, parameterDict, eventsPerJob, eventsPerBaseFile, limited=False ):
    """ create splitting transformation for splitting files """
    gLogger.notice( "*"*80 + "\nCreating split production: %s " % prodName )
    from ILCDIRAC.Interfaces.API.NewInterface.ProductionJob import ProductionJob
    splitProd = ProductionJob()
    splitProd.setProdPlugin( 'Limited' if limited else 'Standard' )
    splitProd.setProdType( 'Split' )
    splitProd.setLogLevel( self.productionLogLevel )
    splitProd.dryrun = self._flags.dryRun

    res = splitProd.setInputDataQuery(meta)
    if not res['OK']:
      raise RuntimeError( 'Split production: failed to set inputDataQuery: %s' % res['Message'] )
    splitProd.setOutputSE( self.outputSE )
    splitProd.setWorkflowName( self._productionName( meta, parameterDict, 'stdhepSplit' ) )
    splitProd.setProdGroup( self.prodGroup )

    #Add the application
    res = splitProd.append( self.createSplitApplication( eventsPerJob, eventsPerBaseFile, 'stdhep' ) )
    if not res['OK']:
      raise RuntimeError( 'Split production: failed to append application: %s' % res['Message'] )
    splitProd.addFinalization(True,True,True,True)
    description = 'Splitting stdhep files'

    splitProd.setDescription( description )

    res = splitProd.createProduction()
    if not res['OK']:
      raise RuntimeError( "Failed to create split production: %s " % res['Message'] )

    splitProd.addMetadataToFinalFiles( { "BeamParticle1": parameterDict['pname1'],
                                         "BeamParticle2": parameterDict['pname2'],
                                         "EPA_B1": parameterDict['epa_b1'],
                                         "EPA_B2": parameterDict['epa_b2'],
                                       }
                                     )

    res = splitProd.finalizeProd()
    if not res['OK']:
      raise RuntimeError( 'Split production: failed to finalize: %s' % res['Message'] )

    return splitProd.getMetadata()
示例#3
0
  def createSimulationProduction( self, meta, prodName, parameterDict ):
    """ create simulation production """
    gLogger.notice( "*"*80 + "\nCreating simulation production: %s " % prodName )
    from ILCDIRAC.Interfaces.API.NewInterface.ProductionJob import ProductionJob
    simProd = ProductionJob()
    simProd.dryrun = self._flags.dryRun
    simProd.setLogLevel( self.productionLogLevel )
    simProd.setProdType( 'MCSimulation' )
    simProd.setClicConfig( self.clicConfig )
    res = simProd.setInputDataQuery( meta )
    if not res['OK']:
      raise RuntimeError( "Error creating Simulation Production: %s" % res['Message'] )
    simProd.setOutputSE( self.outputSE )
    simProd.setWorkflowName( self._productionName( meta, parameterDict, 'sim') )
    simProd.setProdGroup( self.prodGroup )
    #Add the application
    res = simProd.append( self.createDDSimApplication() )
    if not res['OK']:
      raise RuntimeError( "Error creating simulation Production: %s" % res[ 'Message' ] )
    simProd.addFinalization(True,True,True,True)
    description = "Model: %s" % self.detectorModel
    if prodName:
      description += ", %s"%prodName
    simProd.setDescription( description )
    res = simProd.createProduction()
    if not res['OK']:
      raise RuntimeError( "Error creating simulation production: %s" % res['Message'] )

    simProd.addMetadataToFinalFiles( { 'BeamParticle1': parameterDict['pname1'],
                                       'BeamParticle2': parameterDict['pname2'],
                                       'EPA_B1': parameterDict['epa_b1'],
                                       'EPA_B2': parameterDict['epa_b2'],
                                     }
                                   )

    res = simProd.finalizeProd()
    if not res['OK']:
      raise RuntimeError( "Error finalizing simulation production: %s" % res[ 'Message' ] )

    simulationMeta = simProd.getMetadata()
    return simulationMeta
slicpandora_ov.getInputFromApp(lcsim_prepandora_ov)
slicpandora_ov.setOutputFile('pandora.slcio')

lcsim_postpandora_ov = LCSIM()
lcsim_postpandora_ov.setVersion(lcsimVers)
lcsim_postpandora_ov.getInputFromApp(slicpandora_ov)
lcsim_postpandora_ov.setSteeringFile(lcsimSteering2)
lcsim_postpandora_ov.setTrackingStrategy(strategies)
lcsim_postpandora_ov.setDetectorModel(detectorName)

####################################################33
##Now define the productions

pslic = ProductionJob()
pslic.setInputDataQuery(meta)
res = pslic.append(slic)
if not res['OK']:
  print res['Message']
  exit(1)
pslic.addFinalization(True,True,True,True)

pslic.setProdType("MCSimulation")
pslic.setProdGroup(prodGroup)
pslic.setWorkflowName(workflowName+'_sim_sid_cdr')
pslic.setCPUTime(cpuLimit)
pslic.setOutputSE("CERN-SRM")
pslic.setDescription('Simulating '+workflowDescription)
res = pslic.createProduction()
if not res['OK']:
  print res['Message']
  exit(1)
示例#5
0
slicpandora_ov.getInputFromApp(lcsim_prepandora_ov)
slicpandora_ov.setOutputFile('pandora.slcio')

lcsim_postpandora_ov = LCSIM()
lcsim_postpandora_ov.setVersion(lcsimVers)
lcsim_postpandora_ov.getInputFromApp(slicpandora_ov)
lcsim_postpandora_ov.setSteeringFile(lcsimSteering2)
lcsim_postpandora_ov.setTrackingStrategy(strategies)
lcsim_postpandora_ov.setDetectorModel(detectorName)

####################################################33
##Now define the productions

pslic = ProductionJob()
pslic.setInputDataQuery(meta)
res = pslic.append(slic)
if not res['OK']:
    print res['Message']
    exit(1)
pslic.addFinalization(True, True, True, True)

pslic.setProdType("MCSimulation")
pslic.setProdGroup(prodGroup)
pslic.setWorkflowName(workflowName + '_sim_sid_cdr')
pslic.setCPUTime(cpuLimit)
pslic.setOutputSE("CERN-SRM")
pslic.setDescription('Simulating ' + workflowDescription)
res = pslic.createProduction()
if not res['OK']:
    print res['Message']
    exit(1)
 if gen:  
   ##########################################
   ##Define the generation production.
   pwh = ProductionJob()
   pwh.setLogLevel("verbose")
   pwh.setOutputSE("CERN-SRM")
   pwh.setProdType("MCGeneration")
   wname = process+"_"+str(energy)
   if additionnalreqs:
     wname += "_forced_decay"  
   if cut:
     wname += "_cut"
   wname += prod_name
   pwh.setWorkflowName(wname)  
   pwh.setProdGroup(analysis+"_"+str(energy))
   res = pwh.append(wh)
   if not res['OK']:
     print res['Message']
     exit(1)
   
   if cut:
     res = pwh.append(stdhepc)
     if not res['OK']:
       print res['Message']
       exit(1)
   
   pwh.addFinalization(True,True,True,True)
   descrp = "CLIC %s BeamSpread, ISR ON, whizard"%energy
   if additionnalreqs:
     descrp += ", %s"%additionnalreqs
   if cut:
overlay.setBkgEvtType("gghad")

##Reconstruction
ma = Marlin()
ma.setVersion('v0111Prod')
ma.setSteeringFile("clic_ild_cdr_steering.xml")
ma.setGearFile("clic_ild_cdr.gear")

##########################################
##Define the generation production.
pwh = ProductionJob()
pwh.setOutputSE("CERN-SRM")
pwh.setProdType("MCGeneration")
pwh.setWorkflowName(process+"_"+str(energy))
pwh.setProdGroup(process+"_"+str(energy))
res = pwh.append(wh)
if not res['OK']:
    print res['Message']
    exit(1)

pwh.addFinalization(True,True,True,True)
pwh.setDescription("CLIC 1.4Tev BeamSpread, ISR ON, whizard")

res = pwh.createProduction()
if not res['OK']:
    print res['Message']
res = pwh.finalizeProd()
if not res['OK']:
    print res['Message']
    exit(1)
pwh.setNbOfTasks(1)