forked from cms-gem-daq-project/vfatqc-python-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildConfig.py
More file actions
executable file
·43 lines (34 loc) · 1.3 KB
/
buildConfig.py
File metadata and controls
executable file
·43 lines (34 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/env python
import os
import threading
from chamberInfo import chamber_config,GEBtype
from qcoptions import parser
from gempython.utils.wrappers import envCheck
(options, args) = parser.parse_args()
envCheck('DATA_PATH')
envCheck('CONFIG_PATH')
envCheck('BUILD_HOME')
def launchScurveScan(link,ztrim,cName,cType):
import ROOT as r
buildPath = os.getenv('BUILD_HOME')
dataPath = os.getenv('DATA_PATH')
configPath = os.getenv('CONFIG_PATH')
trimFile = r.TFile( '%s/%s/trim/z%f/config/SCurveData_Trimmed.root'%(dataPath,cName,ztrim) )
trimRange = {}
outTrimFile = open('%s/chConf%s.txt'%(configPath,cName),'w')
outTrimFile.write('vfatN\I:vfatCH\I:trimDAC\I\n')
for event in trimFile.scurveTree :
if event.vcal == 10 :
outTrimFile.write('%i\t%i\t%i\n'%(int(event.vfatN),int(event.vfatCH),int(event.trimDAC)))
if event.vfatCH == 10 : trimRange[int(event.vfatN)] = int(event.trimRange)
outTrimFile.close()
trimFile.Close()
os.system( 'cp %s/%s/threshold/config/ThresholdScanData/ThresholdByVFAT.txt %s/vthConf%s.txt'%(dataPath,cName,configPath,cName) )
ztrim = options.ztrim
threads = []
for link in range(10):
cType = GEBtype[link]
cName = chamber_config[link]
threads.append(threading.Thread(target=launchScurveScan, args=[link,ztrim,cName,cType]))
for t in threads:
t.start()