Skip to content

Python analysis: Add check on existence of selected detector

Title says it all.

When selecting a non-existing detector... Before:

~/software/allpix-squared/tools/root_analysis_macros $ python3 display_mc_hits.py -l ~/software/allpix-squared/lib/libAllpixObjects.so -f ../../examples/eudet_rd53a/output/eudet_rd53a_data.root -d dut
TFile**		../../examples/eudet_rd53a/output/eudet_rd53a_data.root	
 TFile*		../../examples/eudet_rd53a/output/eudet_rd53a_data.root	
  KEY: TProcessID	ProcessID0;1	12389cc6-92f4-11ec-80da-6c01a8c0beef
  KEY: TDirectoryFile	config;1	config
  KEY: TDirectoryFile	detectors;1	detectors
  KEY: TDirectoryFile	models;1	models
  KEY: TTree	MCTrack;1	Tree of MCTrack
  KEY: TTree	MCParticle;1	Tree of MCParticle
  KEY: TTree	DepositedCharge;1	Tree of DepositedCharge
  KEY: TTree	PropagatedCharge;1	Tree of PropagatedCharge
  KEY: TTree	PixelCharge;1	Tree of PixelCharge
  KEY: TTree	PixelHit;1	Tree of PixelHit
Loading in Data...

No error message or anything. Just no data to show.

After:

~/software/allpix-squared/tools/root_analysis_macros $ python3 display_mc_hits.py -l ~/software/allpix-squared/lib/libAllpixObjects.so -f ../../examples/eudet_rd53a/output/eudet_rd53a_data.root -d dut
TFile**		../../examples/eudet_rd53a/output/eudet_rd53a_data.root	
 TFile*		../../examples/eudet_rd53a/output/eudet_rd53a_data.root	
  KEY: TProcessID	ProcessID0;1	12389cc6-92f4-11ec-80da-6c01a8c0beef
  KEY: TDirectoryFile	config;1	config
  KEY: TDirectoryFile	detectors;1	detectors
  KEY: TDirectoryFile	models;1	models
  KEY: TTree	MCTrack;1	Tree of MCTrack
  KEY: TTree	MCParticle;1	Tree of MCParticle
  KEY: TTree	DepositedCharge;1	Tree of DepositedCharge
  KEY: TTree	PropagatedCharge;1	Tree of PropagatedCharge
  KEY: TTree	PixelCharge;1	Tree of PixelCharge
  KEY: TTree	PixelHit;1	Tree of PixelHit

Detector does not exist. Please choose one of the following detectors:
telescope0
telescope1
telescope2
dut_0
dut_1
telescope3
telescope4
telescope5
Reference
~/software/allpix-squared/tools/root_analysis_macros $ 

Merge request reports