ATLAS Offline Software
TRTCalib_Extractor.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 #!/usr/bin/env python
3 import sys
4 from ROOT import TFile
5 
6 class storeinfo:
7  def __init__(self):
8  self.res=0.
9  self.tres=0.
10  self.resmean=0.
11  self.tresmean=0.
12 
13 # Script to read and plot rts from a text file:
14 filenamein = sys.argv[1]
15 rts={}
16 
17 # Here we read the text file for rts:
18 file = TFile(filenamein)
19 detectortuple = file.Get("Detector_Artuple")
20 
21 entries = detectortuple.GetEntries()
22 info={}
23 
24 #loop over the Argon entries for Barrel A and C
25 for i in range(entries):
26  detectortuple.GetEntry(i)
27  if abs(detectortuple.det) == 2:
28  continue
29  infoprev = storeinfo()
30 
31  infoprev.res = detectortuple.res
32  infoprev.tres = detectortuple.tres
33  infoprev.resmean = detectortuple.resMean
34  infoprev.tresmean = detectortuple.tresMean
35  infoprev.hits = detectortuple.nhits
36  det = detectortuple.det
37 
38  print ("For detector part %d res = %s\n" %(det,infoprev.res))
39  print ("For detector part %d tres = %s\n" %(det,infoprev.tres))
40  print ("For detector part %d resmean = %s\n" %(det,infoprev.resmean))
41  print ("For detector part %d tresmean = %s\n" %(det,infoprev.tresmean))
42  info[detectortuple.det, detectortuple.lay ] = infoprev
43 
44 detectortuple = file.Get("Detectortuple")
45 entries = detectortuple.GetEntries()
46 
47 #loop over the Xenon entries for Endcap A and C
48 for i in range(entries):
49  detectortuple.GetEntry(i)
50  if abs(detectortuple.det) == 1:
51  continue
52  infoprev = storeinfo()
53 
54  infoprev.res = detectortuple.res
55  infoprev.tres = detectortuple.tres
56  infoprev.resmean = detectortuple.resMean
57  infoprev.tresmean = detectortuple.tresMean
58  infoprev.hits = detectortuple.nhits
59  det = detectortuple.det
60 
61  print ("For detector part %d res = %s\n" %(det,infoprev.res))
62  print ("For detector part %d tres = %s\n" %(det,infoprev.tres))
63  print ("For detector part %d resmean = %s\n" %(det,infoprev.resmean))
64  print ("For detector part %d tresmean = %s\n" %(det,infoprev.tresmean))
65  info[detectortuple.det, detectortuple.lay ] = infoprev
66 
67 print("Extracted data\n")
68 
TRTCalib_Extractor.storeinfo.tresmean
tresmean
Definition: TRTCalib_Extractor.py:11
TRTCalib_Extractor.storeinfo.res
res
Definition: TRTCalib_Extractor.py:8
TRTCalib_Extractor.storeinfo.resmean
resmean
Definition: TRTCalib_Extractor.py:10
TRTCalib_Extractor.storeinfo.tres
tres
Definition: TRTCalib_Extractor.py:9
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
TRTCalib_Extractor.storeinfo
Definition: TRTCalib_Extractor.py:6
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70
TRTCalib_Extractor.storeinfo.__init__
def __init__(self)
Definition: TRTCalib_Extractor.py:7