예제 #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
예제 #4
0
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)
res = pslic.finalizeProd()
if not res['OK']:
  print res['Message']
  exit(1)

meta = pslic.getMetadata() ##This is needed to link Sim and Rec


###Reconstruction w/o overlay 
plcsim = ProductionJob()
plcsim.setInputDataQuery(meta)
res = plcsim.append(lcsim_prepandora)
if not res['OK']:
  print res['Message']
  exit(1)
res = plcsim.append(slicpandora)
예제 #5
0
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)
res = pslic.finalizeProd()
if not res['OK']:
    print res['Message']
    exit(1)

meta = pslic.getMetadata()  ##This is needed to link Sim and Rec

###Reconstruction w/o overlay
plcsim = ProductionJob()
plcsim.setInputDataQuery(meta)
res = plcsim.append(lcsim_prepandora)
if not res['OK']:
    print res['Message']
    exit(1)
res = plcsim.append(slicpandora)
if not res['OK']:
예제 #6
0
     descrp += ", %s"%additionnalreqs
   if cut:
     descrp += ", cut at stdhep level"
   if prod_name:
     descrp += ", %s"%prod_name
 
   pwh.setDescription(descrp)
   
   res = pwh.createProduction()
   if not res['OK']:
     print res['Message']
       
   pwh.addMetadataToFinalFiles({"BeamParticle1":proddict['pname1'], "BeamParticle2":proddict['pname2'],
                                "EPA_B1":proddict['epa_b1'], "EPA_B2":proddict['epa_b2']})
   
   res = pwh.finalizeProd()
   if not res['OK']:
     print res['Message']
     exit(1)
   pwh.setNbOfTasks(1)
   ##The production is created, one can now take care of the second step:
   #For that we will use the metadata of the previous production as input
   meta = pwh.getMetadata()
   
 if activesplitstdhep and meta:
   pstdhepsplit =  ProductionJob()
   pstdhepsplit.setLogLevel("verbose")
   pstdhepsplit.setProdType('Split')
   res = pstdhepsplit.setInputDataQuery(meta)
   if not res['OK']:
     print res['Message']
예제 #7
0
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)
##The production is created, one can now take care of the second step:
#For that we will use the metadata of the previous production as input
meta = pwh.getMetadata()

####################
##Define the second production (simulation). Notice the setInputDataQuery call
pmo = ProductionJob()
pmo.setProdType('MCSimulation')
res = pmo.setInputDataQuery(meta)
if not res['OK']:
  print res['Message']