ATLAS Offline Software
Functions | Variables
python.LArCalib_PhysWavePredictionConfig Namespace Reference

Functions

def LArPhysWavePredictionCfg (flags)
 

Variables

 ConfigFlags = initConfigFlags()
 
 Files
 
 RunNumbers
 
 Database
 
 SubDet
 
 BadChannelDB
 
 BadChannelTag
 
 ROOTFile
 
 DatabaseInstance
 
 DBConnection
 
 GlobalTag
 
 AtlasVersion
 
 doAlign
 
 cfg = MainServicesCfg(ConfigFlags)
 

Function Documentation

◆ LArPhysWavePredictionCfg()

def python.LArCalib_PhysWavePredictionConfig.LArPhysWavePredictionCfg (   flags)

Definition at line 6 of file LArCalib_PhysWavePredictionConfig.py.

6 def LArPhysWavePredictionCfg(flags):
7 
8  #Get basic services and cond-algos
9  from LArCalibProcessing.LArCalibBaseConfig import LArCalibBaseCfg,chanSelStr
10  result=LArCalibBaseCfg(flags)
11 
12  from LArCalibProcessing.utils import FolderTagResolver
13  FolderTagResolver._globalTag=flags.IOVDb.GlobalTag
14  if flags.LArCalib.isSC:
15  FolderTagResolver._defaultSuffix="-RUN2-UPD3-00"
16  rs=FolderTagResolver()
17  CaliWaveTag=rs.getFolderTag(flags.LArCalib.CaliWave.Folder)
18  DetCellParamsTag=rs.getFolderTag(flags.LArCalib.DetCellParams.Folder)
19  CaliPulseParamsTag=rs.getFolderTag(flags.LArCalib.CaliPulseParams.Folder)
20  MphysOverMcalTag=rs.getFolderTag(flags.LArCalib.MphysOverMcal.Folder)
21  PhysWaveTag=rs.getFolderTag(flags.LArCalib.PhysWave.Folder)
22  del rs #Close database
23 
24  bcKey = "LArBadChannelSC" if flags.LArCalib.isSC else "LArBadChannel"
25 
26  #Lots of special settings for HEC
27  isHEC= (flags.LArCalib.Input.SubDet == "HEC")
28 
29  #"default" settings for CaliPulseParams (matter only for HEC)
30  #In reality, we use only the first TdriftVector (no double-triangle)
31  #copied from the old-cfg, mostly to maintain a record of the numbers.
32  HV = 2000
33  if ( HV == 2000 ):
34  TdriftVector = [ 420 , 469 , 469 , 469 ]
35  TdriftVector2 = [ 420 , 921 , 921 , 921 ]
36  TdriftWeight2 = [ 0. , 0.0672 , 0.0672 , 0.0672 ]
37  elif ( HV == 1600 ):
38  TdriftVector = [ 451.92 , 504.644 , 504.644 , 504.644 ]
39  TdriftVector2 = [ 451.92 , 990.996 , 990.996 , 990.996 ]
40  TdriftWeight2 = [ 0. , 0.0672 , 0.0672 , 0.0672 ]
41 
42 
43  #Retrieve inputs
44  from IOVDbSvc.IOVDbSvcConfig import addFolders
45  result.merge(addFolders(flags,flags.LArCalib.CaliWave.Folder,detDb=flags.LArCalib.Input.Database, tag=CaliWaveTag, modifiers=chanSelStr(flags)))
46  if flags.LArCalib.isSC:
47  result.merge(addFolders(flags,"/LAR/ElecCalibOflSC/Tdrift/Computed",detDb="LAR_OFL",tag="LARElecCalibOflSCTdriftComputed-000"))
48  result.merge(addFolders(flags,"/LAR/ElecCalibOflSC/PhysWaves/HECIdeal",detDb="LAR_OFL",tag="LARElecCalibOflSCPhysWavesHECIdeal-calib-02"))
49  result.merge(addFolders(flags,flags.LArCalib.FCALPhysWave.Folder,detDb="LAR_OFL",tag="LARElecCalibOflPhysWavesFCALFromTB-calib-01",modifiers="<key>FCALFromTB</key>"))
50  else:
51  result.merge(addFolders(flags,"/LAR/ElecCalibOfl/Tdrift/Computed",detDb="LAR_OFL",tag="LARElecCalibOflTdriftComputed-calib-03"))
52 
53 
54  if isHEC:
55  result.merge(addFolders(flags,"/LAR/ElecCalibOfl/PhysWaves/HECIdeal",detDb="LAR_OFL",tag="LARElecCalibOflPhysWavesHECIdeal-calib-02"))
56  if flags.LArCalib.isSC:
57  result.merge(addFolders(flags,flags.LArCalib.CaliPulseParams.Folder,detDb=flags.LArCalib.Input.Database, tag=CaliPulseParamsTag))
58  result.merge(addFolders(flags,flags.LArCalib.DetCellParams.Folder,detDb=flags.LArCalib.Input.Database, tag=DetCellParamsTag))
59  else:
60  result.merge(addFolders(flags,flags.LArCalib.CaliPulseParams.Folder,detDb="LAR_OFL", tag=CaliPulseParamsTag))
61  else:
62  result.merge(addFolders(flags,flags.LArCalib.CaliPulseParams.Folder,detDb=flags.LArCalib.Input.Database, tag=CaliPulseParamsTag))
63  result.merge(addFolders(flags,flags.LArCalib.DetCellParams.Folder,detDb=flags.LArCalib.Input.Database, tag=DetCellParamsTag))
64 
65  LArPhysWavePredictor = CompFactory.LArPhysWavePredictor( "LArPhysWavePredictor" )
66  LArPhysWavePredictor.ProblemsToMask= ["deadCalib","deadReadout","deadPhys","almostDead","short"]
67  LArPhysWavePredictor.TestMode = False
68  LArPhysWavePredictor.isSC = flags.LArCalib.isSC
69  LArPhysWavePredictor.KeyCaliList = [ "LArCaliWave" ]
70  LArPhysWavePredictor.UseCaliPulseParamsFromJO = isHEC
71  LArPhysWavePredictor.UseDetCellParamsFromJO = isHEC
72  LArPhysWavePredictor.UseTdriftFromJO = isHEC
73  LArPhysWavePredictor.Tdrift = TdriftVector
74  LArPhysWavePredictor.UseDoubleTriangle = False
75  LArPhysWavePredictor.Tdrift2 = TdriftVector2
76  LArPhysWavePredictor.WeightTriangle2 = TdriftWeight2
77  LArPhysWavePredictor.UseTimeShiftFromJO = True
78  LArPhysWavePredictor.GroupingType = flags.LArCalib.GroupingType
79  LArPhysWavePredictor.NormalizeCali = not isHEC
80  LArPhysWavePredictor.KeyMphysMcali = "LArMphysOverMcal"
81  LArPhysWavePredictor.DumpMphysMcali = False # set to True to dump on a ASCII file
82  LArPhysWavePredictor.KeyPhys = "LArPhysWave"
83  LArPhysWavePredictor.isHEC = isHEC
84  LArPhysWavePredictor.BadChanKey = bcKey
85 
86 
87  result.addEventAlgo(LArPhysWavePredictor)
88 
89  if (flags.LArCalib.isSC or flags.LArCalib.Input.SubDet == "HEC"):
90  LArPhysWaveHECTool=CompFactory.LArPhysWaveHECTool("LArPhysWaveHECTool")
91  LArPhysWaveHECTool.NormalizeCali = False
92  LArPhysWaveHECTool.TimeOriginShift = False
93  LArPhysWaveHECTool.SubtractBaseline = False
94  LArPhysWaveHECTool.isSC = flags.LArCalib.isSC
95  result.addPublicTool(LArPhysWaveHECTool)
96 
97 
98  if flags.LArCalib.isSC or flags.LArCalib.Input.SubDet != "HEC":
99  LArPhysWaveTool=CompFactory.LArPhysWaveTool("LArPhysWaveTool")
100  LArPhysWaveTool.NormalizeCali = False # this is taken care by LArPhysWavePredictor
101  LArPhysWaveTool.TimeOriginShift = False
102  LArPhysWaveTool.SubtractBaseline = False
103  LArPhysWaveTool.InjPointCorrLayer = [ 1, 1, 1, 1 ]
104  LArPhysWaveTool.InjPointUseTauR = [ 1, 1, 1, 1 ]
105  result.addPublicTool(LArPhysWaveTool)
106 
107 
108  rootfile=flags.LArCalib.Output.ROOTFile
109  if rootfile != "":
110  LArPhysWaves2Ntuple = CompFactory.LArPhysWaves2Ntuple("LArPhysWaves2Ntuple")
111  LArPhysWaves2Ntuple.NtupleName = "PHYSWAVE"
112  LArPhysWaves2Ntuple.AddFEBTempInfo = False
113  LArPhysWaves2Ntuple.KeyList = [ "LArPhysWave" ]
114  LArPhysWaves2Ntuple.isSC = flags.LArCalib.isSC
115  LArPhysWaves2Ntuple.AddCalib = True
116  LArPhysWaves2Ntuple.BadChanKey = bcKey
117  result.addEventAlgo(LArPhysWaves2Ntuple)
118 
119  LArMphysOverMcal2Ntuple = CompFactory.LArMphysOverMcal2Ntuple( "LArMphysOverMcal2Ntuple" )
120  LArMphysOverMcal2Ntuple.ContainerKey = "LArMphysOverMcal"
121  LArMphysOverMcal2Ntuple.AddFEBTempInfo = False
122  LArMphysOverMcal2Ntuple.isSC = flags.LArCalib.isSC
123  LArMphysOverMcal2Ntuple.BadChanKey = bcKey
124  result.addEventAlgo(LArMphysOverMcal2Ntuple)
125 
126  import os
127  if os.path.exists(rootfile):
128  os.remove(rootfile)
129  result.addService(CompFactory.NTupleSvc(Output = [ "FILE1 DATAFILE='"+rootfile+"' OPT='NEW'" ]))
130  result.setAppProperty("HistogramPersistency","ROOT")
131  pass # end if ROOT ntuple writing
132 
133 
134  from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
135  result.merge(OutputConditionsAlgCfg(flags,
136  outputFile=flags.LArCalib.Output.POOLFile,
137  ObjectList=["LArPhysWaveContainer#LArPhysWave#"+flags.LArCalib.PhysWave.Folder,
138  "LArMphysOverMcalComplete#LArMphysOverMcal#"+flags.LArCalib.MphysOverMcal.Folder,],
139  IOVTagList=[PhysWaveTag,MphysOverMcalTag],
140  Run1=flags.LArCalib.IOVStart,
141  Run2=flags.LArCalib.IOVEnd
142  ))
143 
144  #RegistrationSvc
145  result.addService(CompFactory.IOVRegistrationSvc(RecreateFolders = False))
146  result.getService("IOVDbSvc").DBInstance=""
147 
148  #MC Event selector since we have no input data file
149  from McEventSelector.McEventSelectorConfig import McEventSelectorCfg
150  result.merge(McEventSelectorCfg(flags,
151  RunNumber = flags.LArCalib.Input.RunNumbers[0],
152  EventsPerRun = 1,
153  FirstEvent = 1,
154  InitialTimeStamp = 0,
155  TimeStampInterval = 1))
156 
157  from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
158  result.merge(PerfMonMTSvcCfg(flags))
159 
160  return result
161 
162 
163 

Variable Documentation

◆ AtlasVersion

python.LArCalib_PhysWavePredictionConfig.AtlasVersion

Definition at line 183 of file LArCalib_PhysWavePredictionConfig.py.

◆ BadChannelDB

python.LArCalib_PhysWavePredictionConfig.BadChannelDB

Definition at line 176 of file LArCalib_PhysWavePredictionConfig.py.

◆ BadChannelTag

python.LArCalib_PhysWavePredictionConfig.BadChannelTag

Definition at line 177 of file LArCalib_PhysWavePredictionConfig.py.

◆ cfg

python.LArCalib_PhysWavePredictionConfig.cfg = MainServicesCfg(ConfigFlags)

Definition at line 191 of file LArCalib_PhysWavePredictionConfig.py.

◆ ConfigFlags

python.LArCalib_PhysWavePredictionConfig.ConfigFlags = initConfigFlags()

Definition at line 168 of file LArCalib_PhysWavePredictionConfig.py.

◆ Database

python.LArCalib_PhysWavePredictionConfig.Database

Definition at line 174 of file LArCalib_PhysWavePredictionConfig.py.

◆ DatabaseInstance

python.LArCalib_PhysWavePredictionConfig.DatabaseInstance

Definition at line 179 of file LArCalib_PhysWavePredictionConfig.py.

◆ DBConnection

python.LArCalib_PhysWavePredictionConfig.DBConnection

Definition at line 180 of file LArCalib_PhysWavePredictionConfig.py.

◆ doAlign

python.LArCalib_PhysWavePredictionConfig.doAlign

Definition at line 185 of file LArCalib_PhysWavePredictionConfig.py.

◆ Files

python.LArCalib_PhysWavePredictionConfig.Files

Definition at line 172 of file LArCalib_PhysWavePredictionConfig.py.

◆ GlobalTag

python.LArCalib_PhysWavePredictionConfig.GlobalTag

Definition at line 181 of file LArCalib_PhysWavePredictionConfig.py.

◆ ROOTFile

python.LArCalib_PhysWavePredictionConfig.ROOTFile

Definition at line 178 of file LArCalib_PhysWavePredictionConfig.py.

◆ RunNumbers

python.LArCalib_PhysWavePredictionConfig.RunNumbers

Definition at line 173 of file LArCalib_PhysWavePredictionConfig.py.

◆ SubDet

python.LArCalib_PhysWavePredictionConfig.SubDet

Definition at line 175 of file LArCalib_PhysWavePredictionConfig.py.

OutputConditionsAlgConfig.OutputConditionsAlgCfg
def OutputConditionsAlgCfg(flags, name="OutputConditionsAlg", outputFile='condobjs.root', **kwargs)
Definition: OutputConditionsAlgConfig.py:5
python.PerfMonCompsConfig.PerfMonMTSvcCfg
def PerfMonMTSvcCfg(flags, **kwargs)
A minimal new-style configuration for PerfMonMTSvc.
Definition: PerfMonCompsConfig.py:10
python.LArCalibBaseConfig.chanSelStr
def chanSelStr(flags)
Definition: LArCalibBaseConfig.py:33
python.McEventSelectorConfig.McEventSelectorCfg
def McEventSelectorCfg(flags, **kwargs)
Definition: McEventSelectorConfig.py:5
python.IOVDbSvcConfig.addFolders
def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers='')
Definition: IOVDbSvcConfig.py:72
python.LArCalib_PhysWavePredictionConfig.LArPhysWavePredictionCfg
def LArPhysWavePredictionCfg(flags)
Definition: LArCalib_PhysWavePredictionConfig.py:6
python.LArCalibBaseConfig.LArCalibBaseCfg
def LArCalibBaseCfg(flags)
Definition: LArCalibBaseConfig.py:5