ATLAS Offline Software
Loading...
Searching...
No Matches
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
3import sys
4from ROOT import TFile
5
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:
14filenamein = sys.argv[1]
15rts={}
16
17# Here we read the text file for rts:
18file = TFile(filenamein)
19detectortuple = file.Get("Detector_Artuple")
20
21entries = detectortuple.GetEntries()
22info={}
23
24#loop over the Argon entries for Barrel A and C
25for 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
44detectortuple = file.Get("Detectortuple")
45entries = detectortuple.GetEntries()
46
47#loop over the Xenon entries for Endcap A and C
48for 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
67print("Extracted data\n")
68
void print(char *figname, TCanvas *c1)