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
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