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  # in case main readout shape should be used:
50  #result.merge(addFolders(flags,flags.LArCalib.FCALPhysWave.Folder,detDb="LAR_OFL",tag="LARElecCalibOflPhysWavesFCALFromTB-calib-01",modifiers="<key>FCALFromTB</key>"))
51  # otherwise:
52  result.merge(addFolders(flags,"/LAR/ElecCalibOflSC/PhysWaves/FCALmeasured",detDb="LAR_OFL",tag="LARElecCalibOflSCPhysWavesFCALmeasured-data-00",modifiers="<key>FCALFromData</key>"))
53  else:
54  result.merge(addFolders(flags,"/LAR/ElecCalibOfl/Tdrift/Computed",detDb="LAR_OFL",tag="LARElecCalibOflTdriftComputed-calib-03"))
55 
56 
57  if isHEC:
58  result.merge(addFolders(flags,"/LAR/ElecCalibOfl/PhysWaves/HECIdeal",detDb="LAR_OFL",tag="LARElecCalibOflPhysWavesHECIdeal-calib-02"))
59  if flags.LArCalib.isSC:
60  result.merge(addFolders(flags,flags.LArCalib.CaliPulseParams.Folder,detDb=flags.LArCalib.Input.Database, tag=CaliPulseParamsTag))
61  result.merge(addFolders(flags,flags.LArCalib.DetCellParams.Folder,detDb=flags.LArCalib.Input.Database, tag=DetCellParamsTag))
62  else:
63  result.merge(addFolders(flags,flags.LArCalib.CaliPulseParams.Folder,detDb="LAR_OFL", tag=CaliPulseParamsTag))
64  else:
65  result.merge(addFolders(flags,flags.LArCalib.CaliPulseParams.Folder,detDb=flags.LArCalib.Input.Database, tag=CaliPulseParamsTag))
66  result.merge(addFolders(flags,flags.LArCalib.DetCellParams.Folder,detDb=flags.LArCalib.Input.Database, tag=DetCellParamsTag))
67 
68  LArPhysWavePredictor = CompFactory.LArPhysWavePredictor( "LArPhysWavePredictor" )
69  LArPhysWavePredictor.ProblemsToMask= ["deadCalib","deadReadout","deadPhys","almostDead","short"]
70  LArPhysWavePredictor.TestMode = False
71  LArPhysWavePredictor.isSC = flags.LArCalib.isSC
72  LArPhysWavePredictor.KeyCaliList = [ "LArCaliWave" ]
73  LArPhysWavePredictor.UseCaliPulseParamsFromJO = isHEC
74  LArPhysWavePredictor.UseDetCellParamsFromJO = isHEC
75  LArPhysWavePredictor.UseTdriftFromJO = isHEC
76  LArPhysWavePredictor.Tdrift = TdriftVector
77  LArPhysWavePredictor.UseDoubleTriangle = False
78  LArPhysWavePredictor.Tdrift2 = TdriftVector2
79  LArPhysWavePredictor.WeightTriangle2 = TdriftWeight2
80  LArPhysWavePredictor.UseTimeShiftFromJO = True
81  LArPhysWavePredictor.GroupingType = flags.LArCalib.GroupingType
82  LArPhysWavePredictor.NormalizeCali = not isHEC
83  LArPhysWavePredictor.KeyMphysMcali = "LArMphysOverMcal"
84  LArPhysWavePredictor.DumpMphysMcali = False # set to True to dump on a ASCII file
85  LArPhysWavePredictor.KeyPhys = "LArPhysWave"
86  LArPhysWavePredictor.isHEC = isHEC
87  LArPhysWavePredictor.BadChanKey = bcKey
88 
89  if flags.LArCalib.isSC:
90  LArPhysWavePredictor.KeyFcal = "FCALFromData"
91 
92  result.addEventAlgo(LArPhysWavePredictor)
93 
94  if (flags.LArCalib.isSC or flags.LArCalib.Input.SubDet == "HEC"):
95  LArPhysWaveHECTool=CompFactory.LArPhysWaveHECTool("LArPhysWaveHECTool")
96  LArPhysWaveHECTool.NormalizeCali = False
97  LArPhysWaveHECTool.TimeOriginShift = False
98  LArPhysWaveHECTool.SubtractBaseline = False
99  LArPhysWaveHECTool.isSC = flags.LArCalib.isSC
100  result.addPublicTool(LArPhysWaveHECTool)
101 
102 
103  if flags.LArCalib.isSC or flags.LArCalib.Input.SubDet != "HEC":
104  LArPhysWaveTool=CompFactory.LArPhysWaveTool("LArPhysWaveTool")
105  LArPhysWaveTool.NormalizeCali = False # this is taken care by LArPhysWavePredictor
106  LArPhysWaveTool.TimeOriginShift = False
107  LArPhysWaveTool.SubtractBaseline = False
108  LArPhysWaveTool.InjPointCorrLayer = [ 1, 1, 1, 1 ]
109  LArPhysWaveTool.InjPointUseTauR = [ 1, 1, 1, 1 ]
110  result.addPublicTool(LArPhysWaveTool)
111 
112 
113  rootfile=flags.LArCalib.Output.ROOTFile
114  if rootfile != "":
115  LArPhysWaves2Ntuple = CompFactory.LArPhysWaves2Ntuple("LArPhysWaves2Ntuple")
116  LArPhysWaves2Ntuple.NtupleName = "PHYSWAVE"
117  LArPhysWaves2Ntuple.AddFEBTempInfo = False
118  LArPhysWaves2Ntuple.KeyList = [ "LArPhysWave" ]
119  LArPhysWaves2Ntuple.isSC = flags.LArCalib.isSC
120  LArPhysWaves2Ntuple.AddCalib = True
121  LArPhysWaves2Ntuple.BadChanKey = bcKey
122  result.addEventAlgo(LArPhysWaves2Ntuple)
123 
124  LArMphysOverMcal2Ntuple = CompFactory.LArMphysOverMcal2Ntuple( "LArMphysOverMcal2Ntuple" )
125  LArMphysOverMcal2Ntuple.ContainerKey = "LArMphysOverMcal"
126  LArMphysOverMcal2Ntuple.AddFEBTempInfo = False
127  LArMphysOverMcal2Ntuple.isSC = flags.LArCalib.isSC
128  LArMphysOverMcal2Ntuple.BadChanKey = bcKey
129  result.addEventAlgo(LArMphysOverMcal2Ntuple)
130 
131  import os
132  if os.path.exists(rootfile):
133  os.remove(rootfile)
134  result.addService(CompFactory.NTupleSvc(Output = [ "FILE1 DATAFILE='"+rootfile+"' OPT='NEW'" ]))
135  result.setAppProperty("HistogramPersistency","ROOT")
136  pass # end if ROOT ntuple writing
137 
138 
139  from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
140  result.merge(OutputConditionsAlgCfg(flags,
141  outputFile=flags.LArCalib.Output.POOLFile,
142  ObjectList=["LArPhysWaveContainer#LArPhysWave#"+flags.LArCalib.PhysWave.Folder,
143  "LArMphysOverMcalComplete#LArMphysOverMcal#"+flags.LArCalib.MphysOverMcal.Folder,],
144  IOVTagList=[PhysWaveTag,MphysOverMcalTag],
145  Run1=flags.LArCalib.IOVStart,
146  Run2=flags.LArCalib.IOVEnd
147  ))
148 
149  #RegistrationSvc
150  result.addService(CompFactory.IOVRegistrationSvc(RecreateFolders = False))
151  result.getService("IOVDbSvc").DBInstance=""
152 
153  #MC Event selector since we have no input data file
154  from McEventSelector.McEventSelectorConfig import McEventSelectorCfg
155  result.merge(McEventSelectorCfg(flags,
156  RunNumber = flags.LArCalib.Input.RunNumbers[0],
157  EventsPerRun = 1,
158  FirstEvent = 1,
159  InitialTimeStamp = 0,
160  TimeStampInterval = 1))
161 
162  from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
163  result.merge(PerfMonMTSvcCfg(flags))
164 
165  return result
166 
167 
168 

Variable Documentation

◆ AtlasVersion

python.LArCalib_PhysWavePredictionConfig.AtlasVersion

Definition at line 188 of file LArCalib_PhysWavePredictionConfig.py.

◆ BadChannelDB

python.LArCalib_PhysWavePredictionConfig.BadChannelDB

Definition at line 181 of file LArCalib_PhysWavePredictionConfig.py.

◆ BadChannelTag

python.LArCalib_PhysWavePredictionConfig.BadChannelTag

Definition at line 182 of file LArCalib_PhysWavePredictionConfig.py.

◆ cfg

python.LArCalib_PhysWavePredictionConfig.cfg = MainServicesCfg(ConfigFlags)

Definition at line 196 of file LArCalib_PhysWavePredictionConfig.py.

◆ ConfigFlags

python.LArCalib_PhysWavePredictionConfig.ConfigFlags = initConfigFlags()

Definition at line 173 of file LArCalib_PhysWavePredictionConfig.py.

◆ Database

python.LArCalib_PhysWavePredictionConfig.Database

Definition at line 179 of file LArCalib_PhysWavePredictionConfig.py.

◆ DatabaseInstance

python.LArCalib_PhysWavePredictionConfig.DatabaseInstance

Definition at line 184 of file LArCalib_PhysWavePredictionConfig.py.

◆ DBConnection

python.LArCalib_PhysWavePredictionConfig.DBConnection

Definition at line 185 of file LArCalib_PhysWavePredictionConfig.py.

◆ doAlign

python.LArCalib_PhysWavePredictionConfig.doAlign

Definition at line 190 of file LArCalib_PhysWavePredictionConfig.py.

◆ Files

python.LArCalib_PhysWavePredictionConfig.Files

Definition at line 177 of file LArCalib_PhysWavePredictionConfig.py.

◆ GlobalTag

python.LArCalib_PhysWavePredictionConfig.GlobalTag

Definition at line 186 of file LArCalib_PhysWavePredictionConfig.py.

◆ ROOTFile

python.LArCalib_PhysWavePredictionConfig.ROOTFile

Definition at line 183 of file LArCalib_PhysWavePredictionConfig.py.

◆ RunNumbers

python.LArCalib_PhysWavePredictionConfig.RunNumbers

Definition at line 178 of file LArCalib_PhysWavePredictionConfig.py.

◆ SubDet

python.LArCalib_PhysWavePredictionConfig.SubDet

Definition at line 180 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