-
Notifications
You must be signed in to change notification settings - Fork 1
/
quick.py
47 lines (31 loc) · 9.55 KB
/
quick.py
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
42
43
import os
os.chdir('/share/lazy/MomentumScaleCorrections')
step1 = open('D2KKPi_Step1_SingleGrid.C', 'r')
step1lines = step1.readlines()
step2 = open('D2KKPi_Step2.C', 'r')
step2lines = step2.readlines()
step3 = open('D2KKpi_Step3_29Jan2021.C', 'r')
step3lines = step3.readlines()
varbs = ['Dplus_ENDVERTEX_X', 'Dplus_ENDVERTEX_Y', 'Dplus_ENDVERTEX_Z', 'Dplus_ENDVERTEX_XERR', 'Dplus_ENDVERTEX_YERR', 'Dplus_ENDVERTEX_ZERR', 'Dplus_ENDVERTEX_CHI2', 'Dplus_ENDVERTEX_NDOF', 'Dplus_ENDVERTEX_COV_', 'Dplus_OWNPV_X', 'Dplus_OWNPV_Y', 'Dplus_OWNPV_Z', 'Dplus_OWNPV_XERR', 'Dplus_OWNPV_YERR', 'Dplus_OWNPV_ZERR', 'Dplus_OWNPV_CHI2', 'Dplus_OWNPV_NDOF', 'Dplus_OWNPV_COV_', 'Dplus_IP_OWNPV', 'Dplus_IPCHI2_OWNPV', 'Dplus_FD_OWNPV', 'Dplus_FDCHI2_OWNPV', 'Dplus_DIRA_OWNPV', 'Dplus_P', 'Dplus_PT', 'Dplus_PE', 'Dplus_PX', 'Dplus_PY', 'Dplus_PZ', 'Dplus_MM', 'Dplus_MMERR', 'Dplus_M', 'Dplus_ID', 'Dplus_X', 'Dplus_Y', 'Dplus_TAU', 'Dplus_TAUERR', 'Dplus_TAUCHI2', 'Kminus_MC12TuneV2_ProbNNe', 'Kminus_MC12TuneV2_ProbNNmu', 'Kminus_MC12TuneV2_ProbNNpi', 'Kminus_MC12TuneV2_ProbNNk', 'Kminus_MC12TuneV2_ProbNNp', 'Kminus_MC12TuneV2_ProbNNghost', 'Kminus_MC12TuneV3_ProbNNe', 'Kminus_MC12TuneV3_ProbNNmu', 'Kminus_MC12TuneV3_ProbNNpi', 'Kminus_MC12TuneV3_ProbNNk', 'Kminus_MC12TuneV3_ProbNNp', 'Kminus_MC12TuneV3_ProbNNghost', 'Kminus_MC12TuneV4_ProbNNe', 'Kminus_MC12TuneV4_ProbNNmu', 'Kminus_MC12TuneV4_ProbNNpi', 'Kminus_MC12TuneV4_ProbNNk', 'Kminus_MC12TuneV4_ProbNNp', 'Kminus_MC12TuneV4_ProbNNghost', 'Kminus_MC15TuneV1_ProbNNe', 'Kminus_MC15TuneV1_ProbNNmu', 'Kminus_MC15TuneV1_ProbNNpi', 'Kminus_MC15TuneV1_ProbNNk', 'Kminus_MC15TuneV1_ProbNNp', 'Kminus_MC15TuneV1_ProbNNghost', 'Kminus_OWNPV_X', 'Kminus_OWNPV_Y', 'Kminus_OWNPV_Z', 'Kminus_OWNPV_XERR', 'Kminus_OWNPV_YERR', 'Kminus_OWNPV_ZERR', 'Kminus_OWNPV_CHI2', 'Kminus_OWNPV_NDOF', 'Kminus_OWNPV_COV_', 'Kminus_IP_OWNPV', 'Kminus_IPCHI2_OWNPV', 'Kminus_ORIVX_X', 'Kminus_ORIVX_Y', 'Kminus_ORIVX_Z', 'Kminus_ORIVX_XERR', 'Kminus_ORIVX_YERR', 'Kminus_ORIVX_ZERR', 'Kminus_ORIVX_CHI2', 'Kminus_ORIVX_NDOF', 'Kminus_ORIVX_COV_', 'Kminus_P', 'Kminus_PT', 'Kminus_PE', 'Kminus_PX', 'Kminus_PY', 'Kminus_PZ', 'Kminus_M', 'Kminus_ID', 'Kminus_PIDe', 'Kminus_PIDmu', 'Kminus_PIDK', 'Kminus_PIDp', 'Kminus_PIDd', 'Kminus_ProbNNe', 'Kminus_ProbNNk', 'Kminus_ProbNNp', 'Kminus_ProbNNpi', 'Kminus_ProbNNmu', 'Kminus_ProbNNd', 'Kminus_ProbNNghost', 'Kminus_hasMuon', 'Kminus_isMuon', 'Kminus_hasRich', 'Kminus_UsedRichAerogel', 'Kminus_UsedRich1Gas', 'Kminus_UsedRich2Gas', 'Kminus_RichAboveElThres', 'Kminus_RichAboveMuThres', 'Kminus_RichAbovePiThres', 'Kminus_RichAboveKaThres', 'Kminus_RichAbovePrThres', 'Kminus_hasCalo', 'Kminus_TRACK_Type', 'Kminus_TRACK_Key', 'Kminus_TRACK_CHI2', 'Kminus_TRACK_NDOF', 'Kminus_TRACK_CHI2NDOF', 'Kminus_TRACK_PCHI2', 'Kminus_TRACK_VeloCHI2NDOF', 'Kminus_TRACK_TCHI2NDOF', 'Kminus_TRACK_VELO_UTID', 'Kminus_TRACK_TT_UTID', 'Kminus_TRACK_IT_UTID', 'Kminus_TRACK_OT_UTID', 'Kminus_TRACK_VP_UTID', 'Kminus_TRACK_UT_UTID', 'Kminus_TRACK_FT_UTID', 'Kminus_TRACK_nVeloHits', 'Kminus_TRACK_nVeloRHits', 'Kminus_TRACK_nVeloPhiHits', 'Kminus_TRACK_nVeloPileUpHits', 'Kminus_TRACK_nTTHits', 'Kminus_TRACK_nITHits', 'Kminus_TRACK_nOTHits', 'Kminus_TRACK_nVPHits', 'Kminus_TRACK_nUTHits', 'Kminus_TRACK_nFTHits', 'Kminus_TRACK_History', 'Kminus_TRACK_FirstMeasurementX', 'Kminus_TRACK_FirstMeasurementY', 'Kminus_TRACK_FirstMeasurementZ', 'Kminus_TRACK_FirstMeasurementQOverP', 'Kminus_TRACK_FirstMeasurementTx', 'Kminus_TRACK_FirstMeasurementTy', 'Kminus_TRACK_MatchCHI2', 'Kminus_TRACK_GhostProb', 'Kminus_TRACK_CloneDist', 'Kminus_TRACK_Likelihood', 'Kminus_X', 'Kminus_Y', 'Kplus_MC12TuneV2_ProbNNe', 'Kplus_MC12TuneV2_ProbNNmu', 'Kplus_MC12TuneV2_ProbNNpi', 'Kplus_MC12TuneV2_ProbNNk', 'Kplus_MC12TuneV2_ProbNNp', 'Kplus_MC12TuneV2_ProbNNghost', 'Kplus_MC12TuneV3_ProbNNe', 'Kplus_MC12TuneV3_ProbNNmu', 'Kplus_MC12TuneV3_ProbNNpi', 'Kplus_MC12TuneV3_ProbNNk', 'Kplus_MC12TuneV3_ProbNNp', 'Kplus_MC12TuneV3_ProbNNghost', 'Kplus_MC12TuneV4_ProbNNe', 'Kplus_MC12TuneV4_ProbNNmu', 'Kplus_MC12TuneV4_ProbNNpi', 'Kplus_MC12TuneV4_ProbNNk', 'Kplus_MC12TuneV4_ProbNNp', 'Kplus_MC12TuneV4_ProbNNghost', 'Kplus_MC15TuneV1_ProbNNe', 'Kplus_MC15TuneV1_ProbNNmu', 'Kplus_MC15TuneV1_ProbNNpi', 'Kplus_MC15TuneV1_ProbNNk', 'Kplus_MC15TuneV1_ProbNNp', 'Kplus_MC15TuneV1_ProbNNghost', 'Kplus_OWNPV_X', 'Kplus_OWNPV_Y', 'Kplus_OWNPV_Z', 'Kplus_OWNPV_XERR', 'Kplus_OWNPV_YERR', 'Kplus_OWNPV_ZERR', 'Kplus_OWNPV_CHI2', 'Kplus_OWNPV_NDOF', 'Kplus_OWNPV_COV_', 'Kplus_IP_OWNPV', 'Kplus_IPCHI2_OWNPV', 'Kplus_ORIVX_X', 'Kplus_ORIVX_Y', 'Kplus_ORIVX_Z', 'Kplus_ORIVX_XERR', 'Kplus_ORIVX_YERR', 'Kplus_ORIVX_ZERR', 'Kplus_ORIVX_CHI2', 'Kplus_ORIVX_NDOF', 'Kplus_ORIVX_COV_', 'Kplus_P', 'Kplus_PT', 'Kplus_PE', 'Kplus_PX', 'Kplus_PY', 'Kplus_PZ', 'Kplus_M', 'Kplus_ID', 'Kplus_PIDe', 'Kplus_PIDmu', 'Kplus_PIDK', 'Kplus_PIDp', 'Kplus_PIDd', 'Kplus_ProbNNe', 'Kplus_ProbNNk', 'Kplus_ProbNNp', 'Kplus_ProbNNpi', 'Kplus_ProbNNmu', 'Kplus_ProbNNd', 'Kplus_ProbNNghost', 'Kplus_hasMuon', 'Kplus_isMuon', 'Kplus_hasRich', 'Kplus_UsedRichAerogel', 'Kplus_UsedRich1Gas', 'Kplus_UsedRich2Gas', 'Kplus_RichAboveElThres', 'Kplus_RichAboveMuThres', 'Kplus_RichAbovePiThres', 'Kplus_RichAboveKaThres', 'Kplus_RichAbovePrThres', 'Kplus_hasCalo', 'Kplus_TRACK_Type', 'Kplus_TRACK_Key', 'Kplus_TRACK_CHI2', 'Kplus_TRACK_NDOF', 'Kplus_TRACK_CHI2NDOF', 'Kplus_TRACK_PCHI2', 'Kplus_TRACK_VeloCHI2NDOF', 'Kplus_TRACK_TCHI2NDOF', 'Kplus_TRACK_VELO_UTID', 'Kplus_TRACK_TT_UTID', 'Kplus_TRACK_IT_UTID', 'Kplus_TRACK_OT_UTID', 'Kplus_TRACK_VP_UTID', 'Kplus_TRACK_UT_UTID', 'Kplus_TRACK_FT_UTID', 'Kplus_TRACK_nVeloHits', 'Kplus_TRACK_nVeloRHits', 'Kplus_TRACK_nVeloPhiHits', 'Kplus_TRACK_nVeloPileUpHits', 'Kplus_TRACK_nTTHits', 'Kplus_TRACK_nITHits', 'Kplus_TRACK_nOTHits', 'Kplus_TRACK_nVPHits', 'Kplus_TRACK_nUTHits', 'Kplus_TRACK_nFTHits', 'Kplus_TRACK_History', 'Kplus_TRACK_FirstMeasurementX', 'Kplus_TRACK_FirstMeasurementY', 'Kplus_TRACK_FirstMeasurementZ', 'Kplus_TRACK_FirstMeasurementQOverP', 'Kplus_TRACK_FirstMeasurementTx', 'Kplus_TRACK_FirstMeasurementTy', 'Kplus_TRACK_MatchCHI2', 'Kplus_TRACK_GhostProb', 'Kplus_TRACK_CloneDist', 'Kplus_TRACK_Likelihood', 'Kplus_X', 'Kplus_Y', 'Piplus_MC12TuneV2_ProbNNe', 'Piplus_MC12TuneV2_ProbNNmu', 'Piplus_MC12TuneV2_ProbNNpi', 'Piplus_MC12TuneV2_ProbNNk', 'Piplus_MC12TuneV2_ProbNNp', 'Piplus_MC12TuneV2_ProbNNghost', 'Piplus_MC12TuneV3_ProbNNe', 'Piplus_MC12TuneV3_ProbNNmu', 'Piplus_MC12TuneV3_ProbNNpi', 'Piplus_MC12TuneV3_ProbNNk', 'Piplus_MC12TuneV3_ProbNNp', 'Piplus_MC12TuneV3_ProbNNghost', 'Piplus_MC12TuneV4_ProbNNe', 'Piplus_MC12TuneV4_ProbNNmu', 'Piplus_MC12TuneV4_ProbNNpi', 'Piplus_MC12TuneV4_ProbNNk', 'Piplus_MC12TuneV4_ProbNNp', 'Piplus_MC12TuneV4_ProbNNghost', 'Piplus_MC15TuneV1_ProbNNe', 'Piplus_MC15TuneV1_ProbNNmu', 'Piplus_MC15TuneV1_ProbNNpi', 'Piplus_MC15TuneV1_ProbNNk', 'Piplus_MC15TuneV1_ProbNNp', 'Piplus_MC15TuneV1_ProbNNghost', 'Piplus_OWNPV_X', 'Piplus_OWNPV_Y', 'Piplus_OWNPV_Z', 'Piplus_OWNPV_XERR', 'Piplus_OWNPV_YERR', 'Piplus_OWNPV_ZERR', 'Piplus_OWNPV_CHI2', 'Piplus_OWNPV_NDOF', 'Piplus_OWNPV_COV_', 'Piplus_IP_OWNPV', 'Piplus_IPCHI2_OWNPV', 'Piplus_ORIVX_X', 'Piplus_ORIVX_Y', 'Piplus_ORIVX_Z', 'Piplus_ORIVX_XERR', 'Piplus_ORIVX_YERR', 'Piplus_ORIVX_ZERR', 'Piplus_ORIVX_CHI2', 'Piplus_ORIVX_NDOF', 'Piplus_ORIVX_COV_', 'Piplus_P', 'Piplus_PT', 'Piplus_PE', 'Piplus_PX', 'Piplus_PY', 'Piplus_PZ', 'Piplus_M', 'Piplus_ID', 'Piplus_PIDe', 'Piplus_PIDmu', 'Piplus_PIDK', 'Piplus_PIDp', 'Piplus_PIDd', 'Piplus_ProbNNe', 'Piplus_ProbNNk', 'Piplus_ProbNNp', 'Piplus_ProbNNpi', 'Piplus_ProbNNmu', 'Piplus_ProbNNd', 'Piplus_ProbNNghost', 'Piplus_hasMuon', 'Piplus_isMuon', 'Piplus_hasRich', 'Piplus_UsedRichAerogel', 'Piplus_UsedRich1Gas', 'Piplus_UsedRich2Gas', 'Piplus_RichAboveElThres', 'Piplus_RichAboveMuThres', 'Piplus_RichAbovePiThres', 'Piplus_RichAboveKaThres', 'Piplus_RichAbovePrThres', 'Piplus_hasCalo', 'Piplus_TRACK_Type', 'Piplus_TRACK_Key', 'Piplus_TRACK_CHI2', 'Piplus_TRACK_NDOF', 'Piplus_TRACK_CHI2NDOF', 'Piplus_TRACK_PCHI2', 'Piplus_TRACK_VeloCHI2NDOF', 'Piplus_TRACK_TCHI2NDOF', 'Piplus_TRACK_VELO_UTID', 'Piplus_TRACK_TT_UTID', 'Piplus_TRACK_IT_UTID', 'Piplus_TRACK_OT_UTID', 'Piplus_TRACK_VP_UTID', 'Piplus_TRACK_UT_UTID', 'Piplus_TRACK_FT_UTID', 'Piplus_TRACK_nVeloHits', 'Piplus_TRACK_nVeloRHits', 'Piplus_TRACK_nVeloPhiHits', 'Piplus_TRACK_nVeloPileUpHits', 'Piplus_TRACK_nTTHits', 'Piplus_TRACK_nITHits', 'Piplus_TRACK_nOTHits', 'Piplus_TRACK_nVPHits', 'Piplus_TRACK_nUTHits', 'Piplus_TRACK_nFTHits', 'Piplus_TRACK_History', 'Piplus_TRACK_FirstMeasurementX', 'Piplus_TRACK_FirstMeasurementY', 'Piplus_TRACK_FirstMeasurementZ', 'Piplus_TRACK_FirstMeasurementQOverP', 'Piplus_TRACK_FirstMeasurementTx', 'Piplus_TRACK_FirstMeasurementTy', 'Piplus_TRACK_MatchCHI2', 'Piplus_TRACK_GhostProb', 'Piplus_TRACK_CloneDist', 'Piplus_TRACK_Likelihood', 'Piplus_X', 'Piplus_Y', 'nCandidate', 'totCandidates', 'EventInSequence', 'runNumber', 'eventNumber', 'BCID', 'BCType', 'OdinTCK', 'L0DUTCK', 'HLT1TCK', 'HLT2TCK', 'GpsTime', 'Polarity', 'nPV', 'PVX', 'PVY', 'PVZ', 'PVXERR', 'PVYERR', 'PVZERR', 'PVCHI2', 'PVNDOF', 'PVNTRACKS']
myLst1=[]
myLst2=[]
myLst3=[]
for line in step1lines:
for varb in varbs:
if varb in line:
myLst1.append(varb)
for line in step2lines:
for varb in varbs:
if varb in line:
myLst2.append(varb)
for line in step3lines:
for varb in varbs:
if varb in line:
myLst3.append(varb)
mySet1 = set(myLst1)
mySet2 = set(myLst2)
mySet3 = set(myLst3)
print('step 1 contains step 2 variables: ',mySet1 > mySet2)
print('step 1 contains step 3 variables: ',mySet1 > mySet3)
print('there are ',len(varbs),' variables in the main ntuples')
print('there are ',len(mySet1),' variables in the reduced ntuples')