ATLAS Offline Software
multiIoVMCRecoTag.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2 
3 from __future__ import print_function
4 
7 from PyCool import cool
8 
9 import sys
10 
11 #beamspotnt.py --rl 158045 --ru 167844 -b --grl /afs/cern.ch/user/a/atlasdqm/grlgen/Archive/CombinedPerf/Tracking/Tracking_v01/data10_7TeV.periodAllYear_DetStatus-v21-pro05_CoolRunQuery-00-04-00_Tracking.xml -p data10_7TeV.AllYear -f ~atlidbs/nt/repro/beamspotnt-IndetBeampos-Oct10-Collision_7T_2010_07-v0and1.root --tag IndetBeampos-data10_7TeV-PeriodDtoI-ave-001 ave
12 
13 #beamspotnt.py --time --rl 215414 --ru 216432 -b -p data12_8TeV.AllYear -f ~atlidbs/nt/cool/beamspotnt-COOL-Current.root summary
14 
15 # beamspotman.py --srctag IndetBeampos-RunDep-MC11-MC12prep-pPbprep-001 -t IndetBeampos-RunDep-MC11-MC12prep-pPbprep-001 --destdbname OFLP200 --srcdbname OFLP200 upload IndetBeampos-RunDep-MC11-MC12prep-pPbprep-001.db
16 
17 tagdict = {
18  (0,141748) : "IndetBeampos-unconstrained", # pre - 2009 900 GeV (unconstrained)
19  (141748, 142308) : "IndetBeampos-data09_900GeV-ave-001", # 2009 900 GeV (new)
20  (142308, 142309) : "IndetBeampos-unconstrained", # 2009 2 TeV (unconstrained)
21  (142309, 142402) : "IndetBeampos-data09_900GeV-ave-001", # 2009 900 GeV (new)
22  (142402, 142403) : "IndetBeampos-unconstrained", # 2009 2 TeV (unconstrained)
23  (142403, 152166) : "IndetBeampos-unconstrained", # pre - 2010 7 TeV (unconstrained)
24  (152166, 154465) : "IndetBeampos-data10_7TeV-PeriodDtoI-ave-001", # 2010 7 TeV (new)
25  (154465, 154813) : "IndetBeampos-data10_900GeV-ave-001", # 2010 900 GeV (new)
26  (154813, 168665) : "IndetBeampos-data10_7TeV-PeriodDtoI-ave-001", # 2010 7 TeV (new)
27  (168665, 177531) : "IndetBeampos-HI-PeriodJ-ave-001", # 2010 HI (new)
28  (177531, 178163) : "IndetBeampos-data11_7TeV-PeriodD1toL6-ave-001", # 2011 7 TeV (diff)
29  (178163, 178264) : "IndetBeampos-data11_2p76TeV-ave-001", # 2011 2.76 TeV (new)
30  (178264, 193211) : "IndetBeampos-data11_7TeV-PeriodD1toL6-ave-001", # 2011 7 TeV (diff)
31  (193211, 195847) : "IndetBeampos-data11_hi-PeriodN1toN5-ave-001", # 2011 HI (same)
32  (195847, 200805) : "IndetBeampos-data12_8TeV-AllYear-ave-001", # 2012 8 TeV (diff)
33  (200805, 200806) : "IndetBeampos-data12_8TeV-200805-LowMu-ave-001", # 2012 8 TeV mu=0 data (new)
34  (200806, 206881) : "IndetBeampos-data12_8TeV-AllYear-ave-001", # 2012 8 TeV (diff)
35  (206881, 206955) : "IndetBeampos-data12_8TeV-Beta90m-ave-001", # 2012 8 TeV beta*=90m, mu=0 data (new)
36  (206955, 210184) : "IndetBeampos-data12_8TeV-AllYear-ave-001", # 2012 8 TeV (diff)
37  (210184, 210185) : "IndetBeampos-data12_hip-210184-ave-001", # 2012 HIP z=0 (same)
38  (210185, 210186) : "IndetBeampos-unconstrained", # 2012 HIP Z=+50 (unconstrained)
39  (210186, 210187) : "IndetBeampos-unconstrained", # 2012 HIP Z=+50 (unconstrained)
40  (210187, 216399) : "IndetBeampos-data12_8TeV-AllYear-ave-001", # 2012 8 TeV (diff)
41  (216399, 216432) : "IndetBeampos-data12_8TeV-PeriodM25ns-ave-001", # 2012 8 TeV 25ns data (new)
42  (216432, 217946) : "IndetBeampos-data12_8TeV-AllYear-ave-001", # 2012 8 TeV (diff)
43  (217946, 219171) : "IndetBeampos-data13_hip-PeriodAtoB-ave-001", # 2013 HIP (same)
44  (219171, 219366) : "IndetBeampos-data13_2p76TeV-AllYear-ave-001", # 2013 2.76 TeV (same)
45  (219366, 222222) : "IndetBeampos-unconstrained", # unused, unconstrained
46  (222222, 222250) : "IndetBeampos-13TeV-0.45m-300urad", # DC14 (mu=30), 25ns
47  (222250, 222500) : "IndetBeampos-13TeV-0.45m-300urad", # DC14 (mu=30), 50ns
48  (222500, 222506) : "IndetBeampos-13TeV-LowMu-001", # mc15 50ns, low-mu
49  #(222500, 222509) : "IndetBeampos-data15_13TeV-LowMu-ave-sigmazp1mm-001",# mc15 low-mu averages from data, with sigmaz inflated by +1mm (requested by Anthony Morley)
50  (222506, 222508) : "IndetBeampos-data15_PbPb-ave-001", # Average PbPb pp beam in 2015 data
51  (222508, 222510) : "IndetBeampos-data15_5TeV-ave-001", # Average 5 TeV pp beamspot in 2015 data
52  (222510, 222525) : "IndetBeampos-13TeV-0.80m-290urad-1.24ns-2.7umr", # mc15 50ns
53  (222525, 226000) : "IndetBeampos-13TeV-0.80m-290urad-1.24ns-2.7umr", # mc15 25ns
54  (226000, 228000) : "IndetBeampos-data15_PbPb-ave-001", # Average PbPb pp beam in 2015 data
55  (228000, 230000) : "IndetBeampos-data15_5TeV-ave-001", # Average 5 TeV pp beamspot in 2015 data
56  (230000, 240000) : "IndetBeampos-13TeV-0.80m-290urad-1.24ns-2.7umr", # mc15 25ns
57  (240000, 250000) : "IndetBeampos-14TeV-SigmaXY12um-SigmaZ50mm-001", # tag for upgrade studies
58  (250000, 0 ) : "IndetBeampos-13TeV-0.80m-290urad-1.24ns-2.7umr" # mc15 25ns
59  }
60 
61 
62 tags = [tagdict[key] for key in sorted(tagdict.keys())]
63 runmin = [rl for (rl,ru) in sorted(tagdict.keys())]
64 runmax = [ru for (rl,ru) in sorted(tagdict.keys())]
65 
66 for (rl,ru) in sorted(tagdict.keys(),reverse=True):
67  print ("| !%s | [%s,0] - [%s,0) |" % (tagdict[(rl,ru)], rl, ru))
68 
69 assert(len(runmin) == len(runmax) == len(tags))
70 nTag = len(tags)
71 
72 tag='IndetBeampos-RunDep-MC15-BestKnowledge-002-03'
73 dbfile = tag + '.db'
74 folderHandle = openBeamSpotDbFile(dbfile, dbName = 'OFLP200', forceNew = True)
75 
76 for i in range(nTag):
77  BSDataColl = BeamSpotCOOL(tags[i], 'COOLOFL_INDET/OFLP200', '/Indet/Beampos')
78  BSDataColl.lbMax = cool.ValidityKeyMax
79 
80  if runmax[i] == 0:
81  runmax[i] = (1 << 31)-1
82 
83  totN = 0
84  for BSData in BSDataColl:
85  totN += 1
86  if totN == 1:
87  writeBeamSpotEntry(folderHandle, tag,
88  runMin=runmin[i], runMax=runmax[i],
89  status=BSData.status,
90  posX=BSData.posX,
91  posY=BSData.posY,
92  posZ=BSData.posZ,
93  sigmaX=BSData.sigmaX,
94  sigmaY=BSData.sigmaY,
95  sigmaZ=BSData.sigmaZ,
96  tiltX=BSData.tiltX,
97  tiltY=BSData.tiltY,
98  sigmaXY=BSData.sigmaXY,
99  posXErr=BSData.posXErr,
100  posYErr=BSData.posYErr,
101  posZErr=BSData.posZErr,
102  sigmaXErr=BSData.sigmaXErr,
103  sigmaYErr=BSData.sigmaYErr,
104  sigmaZErr=BSData.sigmaZErr,
105  tiltXErr=BSData.tiltXErr,
106  tiltYErr=BSData.tiltYErr,
107  sigmaXYErr=BSData.sigmaXYErr)
108 
109 
110  if totN > 1:
111  print ("WARNING: tag had more than one IOV")
BeamSpotData
python.COOLUtils.writeBeamSpotEntry
def writeBeamSpotEntry(folderHandle, tag='nominal', runMin=0, runMax=(1<< 31) -1, lbMin=0, lbMax=(1<< 32) -2, status=0, posX=0., posY=0., posZ=0., sigmaX=30., sigmaY=30., sigmaZ=500., tiltX=0., tiltY=0., sigmaXY=0., posXErr=0., posYErr=0., posZErr=0., sigmaXErr=0., sigmaYErr=0., sigmaZErr=0., tiltXErr=0., tiltYErr=0., sigmaXYErr=0.)
Definition: COOLUtils.py:63
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
COOLUtils
python.COOLUtils.openBeamSpotDbFile
def openBeamSpotDbFile(fileName, forceNew=False, folderName='/Indet/Beampos', dbName='BEAMSPOT')
Definition: COOLUtils.py:22