HPS-MC
 
All Classes Namespaces Files Functions Variables Pages
Loading...
Searching...
No Matches
build2021filenames.py
Go to the documentation of this file.
1import ROOT as r
2import os
3import glob
4
5myT = r.TTree("myT","myT")
6myT.ReadFile("hps2021goldRuns.csv")
7nPartsTot = 0
8
9outF = open('run2021pass0.txt','w')
10
11for run in myT:
12 nfiles = run.evio_files_count
13 RN = run.number
14 fullpath = f'/mss/hallb/hps/physrun2021/data/hps_0{RN}/hps_0{RN}.evio.00000'
15 pin = ""
16 if not os.path.isfile(fullpath):
17 pin = "pin"
18 fullpath = f'/mss/hallb/hps/physrun2021/data/hpspin_0{RN}/hpspin_0{RN}.evio.00000'
19 print("")
20 print("Run number: ", RN)
21 print("N partitions: ", nfiles)
22 passList = glob.glob(f'/mss/hallb/hps/physrun2021/data/hps{pin}_0{RN}/hps{pin}_0{RN}.evio.0[1230]03[1234567890]')
23 print(passList)
24 print(len(passList))
25 nPartsTot += len(passList)
26 for fileLine in passList:
27 outF.write(fileLine+'\n')
28 pass
29 pass
30
31outF.close()
32print("Total parts in pass: ", nPartsTot)