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

◆ postIncludeCosmicGenerator()

def CosmicGeneratorConfig.postIncludeCosmicGenerator (   flags,
  cfg 
)

Definition at line 211 of file CosmicGeneratorConfig.py.

211 def postIncludeCosmicGenerator(flags, cfg):
212  theCavern = CavernPropertyCalculator()
213  if flags.Sim.CosmicPtSlice != 'NONE':
214  print ("Configuring cosmic pT slice: %s" % flags.Sim.CosmicPtSlice)
215  theCavern.reconfigureCavernGeometry(flags,cfg)
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
CosmicGeneratorConfig.postIncludeCosmicGenerator
def postIncludeCosmicGenerator(flags, cfg)
Definition: CosmicGeneratorConfig.py:211
python.PartPropSvcConfig.PartPropSvcCfg
def PartPropSvcCfg(flags, **kwargs)
Definition: PartPropSvcConfig.py:6
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