SND@LHC Software
Loading...
Searching...
No Matches
run_digiSND Namespace Reference

Functions

 pyExit ()
 
 mem_monitor ()
 

Variables

int firstEvent = 0
 
 parser = ArgumentParser()
 
 dest
 
 help
 
 required
 
 type
 
 int
 
 default
 
 float
 
 action
 
 options = parser.parse_args()
 
 makeClusterScifi = not options.noClusterScifi
 
 timer = ROOT.TStopwatch()
 
 tmp = options.inputFile.split('/')
 
 outFile = tmp[len(tmp)-1].replace('.root','_dig.root')
 
 inputFile
 
 geoFile
 
 snd_geo = SndlhcGeo.GeoInterface(options.geoFile)
 
 lsOfGlobals = ROOT.gROOT.GetListOfGlobals()
 
 scifiDet = lsOfGlobals.FindObject('Scifi')
 
 mufiDet = lsOfGlobals.FindObject('MuFilter')
 
bool better_update = False
 The lines below aim to reproduce the original digitization case, but urge the user to regenerate the sample shall it be outdated from before the removal of the 1MeV production cut, which coincides with MuFi digi const update.
 
 run = ROOT.FairRunAna()
 
 ioman = ROOT.FairRootManager.Instance()
 
 fileSource = ROOT.FairFileSource(options.inputFile)
 
 outfile = ROOT.FairRootFileSink(outFile.replace('.root','CPP.root'))
 
 inRootFile = ROOT.TFile.Open(options.inputFile)
 
 inTree = inRootFile.Get('cbmsim')
 
 nEventsInFile = inTree.GetEntries()
 
 nEvents = min(nEventsInFile, options.nEvents)
 
 rtdb = run.GetRuntimeDb()
 
 DigiTask = ROOT.DigiTaskSND()
 
 Sndlhc = SndlhcDigi.SndlhcDigi(outFile,makeClusterScifi)
 
 iEvent
 
 rc = Sndlhc.sTree.GetEvent(iEvent)
 
 rtime = timer.RealTime()
 
 ctime = timer.CpuTime()
 

Function Documentation

◆ mem_monitor()

run_digiSND.mem_monitor ( )

Definition at line 12 of file run_digiSND.py.

12def mem_monitor():
13 # Getting virtual memory size
14 pid = os.getpid()
15 with open(os.path.join("/proc", str(pid), "status")) as f:
16 lines = f.readlines()
17 _vmsize = [l for l in lines if l.startswith("VmSize")][0]
18 vmsize = int(_vmsize.split()[1])
19 #Getting physical memory size
20 pmsize = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
21 print("memory: virtuell = %5.2F MB physical = %5.2F MB"%(vmsize/1.0E3,pmsize/1.0E3))
22

◆ pyExit()

run_digiSND.pyExit ( )

Definition at line 5 of file run_digiSND.py.

5def pyExit():
6 "nasty hack"
7 # This is needed to bypass seg violation with exiting cpp digitization
8 # Most likely related to file ownership.
9 os.system('kill '+str(os.getpid()))
10

Variable Documentation

◆ action

run_digiSND.action

Definition at line 38 of file run_digiSND.py.

◆ better_update

bool run_digiSND.better_update = False

The lines below aim to reproduce the original digitization case, but urge the user to regenerate the sample shall it be outdated from before the removal of the 1MeV production cut, which coincides with MuFi digi const update.

in MC productions generated before July 2022 Scifi signal speed is missing from the geofile

Definition at line 83 of file run_digiSND.py.

◆ ctime

run_digiSND.ctime = timer.CpuTime()

Definition at line 173 of file run_digiSND.py.

◆ default

run_digiSND.default

Definition at line 33 of file run_digiSND.py.

◆ dest

run_digiSND.dest

Definition at line 31 of file run_digiSND.py.

◆ DigiTask

run_digiSND.DigiTask = ROOT.DigiTaskSND()

Definition at line 140 of file run_digiSND.py.

◆ fileSource

run_digiSND.fileSource = ROOT.FairFileSource(options.inputFile)

Definition at line 127 of file run_digiSND.py.

◆ firstEvent

int run_digiSND.firstEvent = 0

Definition at line 3 of file run_digiSND.py.

◆ float

run_digiSND.float

Definition at line 34 of file run_digiSND.py.

◆ geoFile

run_digiSND.geoFile

Definition at line 66 of file run_digiSND.py.

◆ help

run_digiSND.help

Definition at line 31 of file run_digiSND.py.

◆ iEvent

run_digiSND.iEvent

Definition at line 160 of file run_digiSND.py.

◆ inputFile

run_digiSND.inputFile

Definition at line 55 of file run_digiSND.py.

◆ inRootFile

run_digiSND.inRootFile = ROOT.TFile.Open(options.inputFile)

Definition at line 134 of file run_digiSND.py.

◆ int

run_digiSND.int

Definition at line 33 of file run_digiSND.py.

◆ inTree

run_digiSND.inTree = inRootFile.Get('cbmsim')

Definition at line 135 of file run_digiSND.py.

◆ ioman

run_digiSND.ioman = ROOT.FairRootManager.Instance()

Definition at line 120 of file run_digiSND.py.

◆ lsOfGlobals

run_digiSND.lsOfGlobals = ROOT.gROOT.GetListOfGlobals()

Definition at line 71 of file run_digiSND.py.

◆ makeClusterScifi

run_digiSND.makeClusterScifi = not options.noClusterScifi

Definition at line 45 of file run_digiSND.py.

◆ mufiDet

run_digiSND.mufiDet = lsOfGlobals.FindObject('MuFilter')

Definition at line 73 of file run_digiSND.py.

◆ nEvents

run_digiSND.nEvents = min(nEventsInFile, options.nEvents)

Definition at line 137 of file run_digiSND.py.

◆ nEventsInFile

run_digiSND.nEventsInFile = inTree.GetEntries()

Definition at line 136 of file run_digiSND.py.

◆ options

run_digiSND.options = parser.parse_args()

Definition at line 43 of file run_digiSND.py.

◆ outFile

run_digiSND.outFile = tmp[len(tmp)-1].replace('.root','_dig.root')

Definition at line 52 of file run_digiSND.py.

◆ outfile

run_digiSND.outfile = ROOT.FairRootFileSink(outFile.replace('.root','CPP.root'))

Definition at line 130 of file run_digiSND.py.

◆ parser

run_digiSND.parser = ArgumentParser()

Definition at line 30 of file run_digiSND.py.

◆ rc

run_digiSND.rc = Sndlhc.sTree.GetEvent(iEvent)

Definition at line 161 of file run_digiSND.py.

◆ required

run_digiSND.required

Definition at line 31 of file run_digiSND.py.

◆ rtdb

run_digiSND.rtdb = run.GetRuntimeDb()

Definition at line 139 of file run_digiSND.py.

◆ rtime

run_digiSND.rtime = timer.RealTime()

Definition at line 172 of file run_digiSND.py.

◆ run

run_digiSND.run = ROOT.FairRunAna()

Definition at line 119 of file run_digiSND.py.

◆ scifiDet

run_digiSND.scifiDet = lsOfGlobals.FindObject('Scifi')

Definition at line 72 of file run_digiSND.py.

◆ snd_geo

run_digiSND.snd_geo = SndlhcGeo.GeoInterface(options.geoFile)

Definition at line 68 of file run_digiSND.py.

◆ Sndlhc

Definition at line 154 of file run_digiSND.py.

◆ timer

run_digiSND.timer = ROOT.TStopwatch()

Definition at line 47 of file run_digiSND.py.

◆ tmp

run_digiSND.tmp = options.inputFile.split('/')

Definition at line 51 of file run_digiSND.py.

◆ type

run_digiSND.type

Definition at line 33 of file run_digiSND.py.