def setup_Target_GaussJob(physList, targetThick, targetMat, projEng, projID, nEvts=10000): from Configurables import LHCbApp from Configurables import DDDBConf from Configurables import CondDB from Configurables import Gauss target = 'Target_' + str(targetThick) + 'mm' + targetMat Gauss() DDDBConf().DbRoot = "conddb:/TargetsDet.xml" if 'v45' not in os.environ["GAUSSROOT"]: CondDB().LoadCALIBDB = "HLT1" CondDB().Upgrade = True LHCbApp().DDDBtag = "dddb-20140120" LHCbApp().CondDBtag = "sim-20131108-vc-md100" LHCbApp().Simulation = True # For testing only #DDDBConf(DbRoot = "/afs/cern.ch/user/s/seaso/public/Simulation/ #upgrade/Gauss_Target/DB/myDDDB-Upgrade-TargetGeom-January2014/TargetsDet.xml") Gauss.DetectorGeo = {"Detectors": []} Gauss.DetectorSim = {"Detectors": []} Gauss.DetectorMoni = {"Detectors": []} Gauss.DataType = "Upgrade" Gauss.PhysicsList = { "Em": 'NoCuts', "Hadron": physList, "GeneralPhys": True, "LHCbPhys": True } # --- activate special targets geometry appendPostConfigAction(targetGeo) # --- Switch off delta rays Gauss.DeltaRays = False # --- activate GaussTargetMultiplicity tool appendPostConfigAction(addMyTool) # --- Configure the tool from Configurables import GiGa, GiGaTrackActionSequence, GaussTargetMultiplicity giga = GiGa() giga.addTool(GiGaTrackActionSequence("TrackSeq"), name="TrackSeq") giga.TrackSeq.addTool(GaussTargetMultiplicity) giga.TrackSeq.GaussTargetMultiplicity.InteractionVolumeName = [ "/dd/Structure/TargetDet/" + target + "#pv" + target.replace('Target', 'Targ') ] giga.TrackSeq.GaussTargetMultiplicity.InteractionVolumeString = [target] giga.TrackSeq.GaussTargetMultiplicity.TargetMaterial = [targetMat] giga.TrackSeq.GaussTargetMultiplicity.TargetThickness = [targetThick] giga.TrackSeq.GaussTargetMultiplicity.PhysicsList = [physList] giga.TrackSeq.GaussTargetMultiplicity.ProjectileEnergy = [projEng] giga.TrackSeq.GaussTargetMultiplicity.ProjectilePdgID = [particles[projID]] #giga.TrackSeq.GaussTargetMultiplicity.OutputLevel = DEBUG from Configurables import CondDB, LHCbApp, DDDBConf, CondDBAccessSvc from Configurables import Gauss Gauss().Production = 'PGUN' #--Generator phase, set random numbers GaussGen = GenInit("GaussGen") GaussGen.FirstEventNumber = 1 GaussGen.RunNumber = 1082 #--Number of events LHCbApp().EvtMax = nEvts Gauss().Production = 'PGUN' Gauss().OutputType = 'NONE' Gauss().Histograms = 'NONE' #--- Save ntuple with hadronic cross section information ApplicationMgr().ExtSvc += ["NTupleSvc"] NTupleSvc().Output = [ "FILE1 DATAFILE='Multi_{particle}_in{material}.root' TYP='ROOT' OPT='NEW'" .format(particle=projID, material=targetMat) ]
def addMyTool(): from Configurables import GiGa, GiGaTrackActionSequence giga = GiGa() giga.addTool(GiGaTrackActionSequence("TrackSeq"), name="TrackSeq") giga.TrackSeq.Members.append("GaussTargetMultiplicity")
# --- Configure the tool from Configurables import GiGa, GiGaStepActionSequence, MonitorTiming giga = GiGa() giga.addTool(GiGaStepActionSequence("StepSeq"), name="StepSeq") giga.StepSeq.addTool(MonitorTiming) giga.StepSeq.MonitorTiming.OutputLevel = 0 #giga.StepSeq.MonitorTiming.OutputFileName='monitorOut.log' #obsolete: remove! giga.StepSeq.MonitorTiming.TimerFileName = 'Timing.log' giga.StepSeq.MonitorTiming.Volumes = [ 'Velo', 'TT', 'IT', 'OT', 'Spd', 'Prs', 'Ecal', 'Hcal', 'Rich1', 'Rich2', 'Muon', 'Universe', 'Pipe', 'Magnet', 'Converter' ] #giga.StepSeq.MonitorTiming.Volumes=['Velo','TT', 'IT', 'OT', 'Spd', 'Prs', 'Ecal', 'Hcal', 'Rich1', 'Rich2', 'Muon', 'Universe'] #Need to run as post-config option: Add other memebers to StepSeq giga.StepSeq.Members += ['MonitorTiming'] giga.StepSeq.Members += ['RichG4StepAnalysis6/RichStepHpdRefl'] giga.StepSeq.Members += ['RichG4StepAnalysis4/RichStepAgelExit'] giga.StepSeq.Members += ['RichG4StepAnalysis5/RichStepMirrorRefl'] giga.StepSeq.Members += ['GaussStepAction/GaussStep'] giga.StepSeq.Members += ['RichG4StepAnalysis4/RichStepAgelExit'] giga.StepSeq.Members += ['RichG4StepAnalysis5/RichStepMirrorRefl'] giga.StepSeq.Members += ['RichG4StepAnalysis3/RichStep']
## File with options to set up specific run action to write ## geometry in GDML ( Geant4 geometry description language) ## ## @author G.Corti ## @date 2012-07-12 from Configurables import GiGa giga = GiGa() giga.addTool( GiGaRunActionSequence("RunSeq") , name="RunSeq" ) giga.RunSeq.Members.append( "GDMLRunAction" ) # The following lines have the default settings #giga.RunSeq.addTool( GDMLRunAction("GDMLRunAction") , name = "GDMLRunAction" ) #giga.RunSeq.GDMLRunAction.Schema = "$G4GDMLROOT/schema/gdml.xsd"; #giga.RunSeq.GDMLRunAction.Output = "LHCb.gdml";
# Define the production tool Generation().Special.addTool(ReadLHEfileProduction, name="ReadLHEfileProduction") Generation().Special.ProductionTool = "ReadLHEfileProduction" ## Define the input file in LHE xml format. Generation().Special.ReadLHEfileProduction.InputFile = "LHE_FILE_BASENAME" ############################################################################## # Monopole physics ############################################################################## # Set add monopole physics constructor from GaussMonopoles to the GiGa # physics list. giga = GiGa() giga.addTool(GiGaPhysListModular("ModularPL"), name="ModularPL") giga.ModularPL.addTool(GiGaPhysConstructorMonopole, name="GiGaPhysConstructorMonopole") ############################################################################ ## Add the Ntuple writer to the Simulation Monitor ## Kind of a hack, but works monopoleTupleAlg = MonopoleTupleAlg() GaudiSequencer("SimMonitor").Members += [monopoleTupleAlg] genTupleAlg = GenTupleAlg() GaudiSequencer("GenMonitor").Members += [genTupleAlg] ############################################################################ ## Switch off RICH physics (leave geometry) giga.ModularPL.addTool(GiGaPhysConstructorOp, name="GiGaPhysConstructorOp")
def trackNeutrinos(): from Configurables import GiGa, GiGaRunActionSequence, TrCutsRunAction giga = GiGa() giga.addTool( GiGaRunActionSequence("RunSeq") , name="RunSeq" ) giga.RunSeq.addTool( TrCutsRunAction("TrCuts") , name = "TrCuts" ) giga.RunSeq.TrCuts.DoNotTrackParticles = []