ATLAS Offline Software
Classes | Functions
CosmicGeneratorConfig Namespace Reference

Classes

class  CavernPropertyCalculator
 

Functions

def CosmicGeneratorCfg (flags, name="CosmicGenerator", **kwargs)
 Note that in this coordinate frame the y-axis points upward such that the cosmics arrive from upward to downward in y. More...
 
def postIncludeCosmicGenerator (flags, cfg)
 

Function Documentation

◆ CosmicGeneratorCfg()

def CosmicGeneratorConfig.CosmicGeneratorCfg (   flags,
  name = "CosmicGenerator",
**  kwargs 
)

Note that in this coordinate frame the y-axis points upward such that the cosmics arrive from upward to downward in y.

The production vertex of cosmics is randomly distributed (flat) in the x-z plane with boundaries given below. The energy range is given as well.

The following settings are tuned to scintillators of dimensions 140 x 0.5 x 100 cm^3 placed at +-115.0 cm

Definition at line 147 of file CosmicGeneratorConfig.py.

147 def CosmicGeneratorCfg(flags, name="CosmicGenerator", **kwargs):
148 
149  result = ComponentAccumulator()
150  result.addService(CompFactory.PartPropSvc(InputFile="PDGTABLE.MeV"))
151 
152 
153  from RngComps.RngCompsConfig import AthRNGSvcCfg
154  kwargs.setdefault('RndmSvc', result.getPrimaryAndMerge(AthRNGSvcCfg(flags)).name)
155 
156  from CosmicGenerator.CosmicGeneratorConfig import CavernPropertyCalculator
157  theCavern = CavernPropertyCalculator()
158 
159 
171 
172  kwargs.setdefault('emin', theCavern.CosmicEmin(flags))
173  kwargs.setdefault('emax', theCavern.CosmicEmax(flags))
174  #kwargs.setdefault('emin', 10000) # default =10000 #10 GeV
175  #kwargs.setdefault('emax', 5000*1000) # 2 TeV - FIXME?!
176 
177  kwargs.setdefault('xvert_low', theCavern.CosmicLowVertex_X(flags) )
178  kwargs.setdefault('xvert_hig', theCavern.CosmicHighVertex_X(flags))
179  kwargs.setdefault('zvert_low', theCavern.CosmicLowVertex_Z(flags) )
180  kwargs.setdefault('zvert_hig', theCavern.CosmicHighVertex_Z(flags))
181  kwargs.setdefault('Radius', theCavern.CosmicRadius(flags))
182  kwargs.setdefault('yvert_val', 57300.+41000.)
183  kwargs.setdefault('ctcut', 0.)
184  kwargs.setdefault('OptimizeForCavern', True)
185  kwargs.setdefault('IPx', 0.)
186  kwargs.setdefault('IPy', 0.)
187  kwargs.setdefault('IPz', 0.)
188 
189  if len(flags.Sim.CosmicFilterVolumeNames)>0:
190  print ('Using %s Volume setup of Cosmic Generator...' % flags.Sim.CosmicFilterVolumeNames[0])
191  #special settings from Juerg Beringer
192  if 'Pixel' in flags.Sim.CosmicFilterVolumeNames:
193  kwargs.setdefault('doPathLengthCut', True) # Optimization based on box cut in pixel detector plane
194  kwargs.setdefault('energyCutThreshold', 100.) # - margin of error for energy loss calculation (in MeV)
195  kwargs.setdefault('doAimedAtPixelsCut', True) # Optimization based on box cut in pixel detector plane
196  kwargs.setdefault('pixelplane_maxx', 1150.) # - require |x| < value in mm
197  kwargs.setdefault('pixelplane_maxz', 1650.) # - require |y| < value in mm
198  kwargs.setdefault('doReweighting', True) # Whether to use reweighting for cosmic ray generation
199  kwargs.setdefault('rvert_max', 300000.) # - radius in mm for generating primary vertex
200 
201  # Random seeding
202  kwargs.setdefault("Dsid", flags.Input.RunNumbers[0]) # Could (should?) set this as Input.MCChannelNumber currently trying to match legacy config
203  #kwargs.setdefault("RandomSeed", flags.Sim.RandomSeedOffset) # No such flag in ConfigFlags. TODO Add?
204 
205  result.addEventAlgo(CompFactory.CosmicGenerator('CosmicGenerator', **kwargs))
206  return result
207 
208 

◆ postIncludeCosmicGenerator()

def CosmicGeneratorConfig.postIncludeCosmicGenerator (   flags,
  cfg 
)

Definition at line 209 of file CosmicGeneratorConfig.py.

209 def postIncludeCosmicGenerator(flags, cfg):
210  theCavern = CavernPropertyCalculator()
211  if flags.Sim.CosmicPtSlice != 'NONE':
212  print ("Configuring cosmic pT slice: %s" % flags.Sim.CosmicPtSlice)
213  theCavern.reconfigureCavernGeometry(flags,cfg)
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
CosmicGeneratorConfig.postIncludeCosmicGenerator
def postIncludeCosmicGenerator(flags, cfg)
Definition: CosmicGeneratorConfig.py:209
CosmicGeneratorConfig.CosmicGeneratorCfg
def CosmicGeneratorCfg(flags, name="CosmicGenerator", **kwargs)
Note that in this coordinate frame the y-axis points upward such that the cosmics arrive from upward ...
Definition: CosmicGeneratorConfig.py:147
RngCompsConfig.AthRNGSvcCfg
def AthRNGSvcCfg(flags, name="AthRNGSvc")
Definition: RngCompsConfig.py:51