ATLAS Offline Software
Functions | Variables
python.LArCalib_PileUpAutoCorrConfig Namespace Reference

Functions

def LArPileUpAutoCorrCfg (flags)
 

Variables

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

Function Documentation

◆ LArPileUpAutoCorrCfg()

def python.LArCalib_PileUpAutoCorrConfig.LArPileUpAutoCorrCfg (   flags)

Definition at line 7 of file LArCalib_PileUpAutoCorrConfig.py.

7 def LArPileUpAutoCorrCfg(flags):
8 
9  #Get basic services and cond-algos
10  from LArCalibProcessing.LArCalibBaseConfig import LArCalibBaseCfg,chanSelStr
11  result=LArCalibBaseCfg(flags)
12 
13  from IOVDbSvc.IOVDbSvcConfig import addFolders
14 
15  #load fsampl, MinBias Average and PulseShape 32 samples from OFLP200
16  if flags.LArCalib.isSC:
17  from LArConfiguration.LArElecCalibDBConfig import LArElecCalibDBMCSCCfg
18  # for the SC we need uA2MeV also from MC, because the one used for data are weighted with E->ET conversion
19  result.merge(LArElecCalibDBMCSCCfg(flags,["fSamplSC","ShapeSC","MinBiasSC","uA2MeVSC"]))
20  else:
21  result.merge(addFolders(flags,"/LAR/ElecCalibMC/Shape",detDb="LAR_OFL", db="OFLP200",tag="LARElecCalibMCShapeLArPileupShape-RUN2-2018",className="LArShape32MC",modifiers="<key>LArShapeMC</key>"))
22  result.merge(addFolders(flags,"/LAR/ElecCalibMC/fSampl",detDb="LAR_OFL", db="OFLP200",tag="LARElecCalibMCfSampl-G4101-20371-FTFP_BERT_BIRK_v2",className="LArfSamplMC"))
23  result.merge(addFolders(flags,"/LAR/ElecCalibMC/MinBias",detDb="LAR_OFL", db="OFLP200",tag="LARElecCalibMCMinBias-mc16-Epos-A3-s3687",className="LArMinBiasMC"))
24 
25  result.addCondAlgo(CompFactory.LArMCSymCondAlg())
26 
27  LArShapeSymAlg = CompFactory.getComp("LArSymConditionsAlg<LArShape32MC, LArShape32Sym>")
28  result.addCondAlgo(LArShapeSymAlg(ReadKey="LArShapeMC",WriteKey="LArShapeSym"))
29 
30  LArfSamplSymAlg = CompFactory.getComp("LArSymConditionsAlg<LArfSamplMC, LArfSamplSym>")
31  result.addCondAlgo(LArfSamplSymAlg(ReadKey="LArfSampl", WriteKey="LArfSamplSym"))
32 
33  LArMinBiasSymAlg = CompFactory.getComp("LArSymConditionsAlg<LArMinBiasMC, LArMinBiasSym>")
34  result.addCondAlgo(LArMinBiasSymAlg(ReadKey="LArMinBias",WriteKey="LArMinBiasSym"))
35 
36  from LArCalibProcessing.utils import FolderTagResolver
37  FolderTagResolver._globalTag=flags.IOVDb.GlobalTag
38  if flags.LArCalib.isSC:
39  FolderTagResolver._defaultSuffix="-UPD3-00"
40  rs=FolderTagResolver(dbname="sqlite://;schema=%s;dbname=CONDBR2"%flags.LArCalib.Input.Database)
41  AutoCorrTag=rs.getFolderTag(flags.LArCalib.AutoCorr.Folder)
42  # FIXME these tags has to be re-enabled in 2024 also for main readout:
43  #if flags.LArCalib.isSC:
44  PedestalTag=rs.getFolderTag(flags.LArCalib.Pedestal.Folder)
45  RampTag=rs.getFolderTag(flags.LArCalib.Ramp.Folder)
46  MpMcTag=rs.getFolderTag(flags.LArCalib.MphysOverMcal.Folder)
47  rsac=FolderTagResolver(dbname="COOLOFL_LAR/CONDBR2")
48  PhysAutoCorrTag= rsac.getFolderTag(flags.LArCalib.PhysAutoCorr.Folder)
49  nColl=flags.LArCalib.OFC.Ncoll
50  if (nColl>0 and "mu" not in PhysAutoCorrTag):
51  #Insert mu in tag-name:
52  elems=PhysAutoCorrTag.split("-")
53  PhysAutoCorrTag="-".join([elems[0]+"_mu_%i"%nColl,]+elems[1:])
54  del elems
55 
56  del rs
57 
58  result.merge(addFolders(flags,flags.LArCalib.AutoCorr.Folder,detDb=flags.LArCalib.Input.Database, tag=AutoCorrTag, modifiers=chanSelStr(flags)+"<key>LArAutoCorr</key>",
59  className="LArAutoCorrComplete"))
60  # FIXME these folders has to be re-enabled in 2024 also for Main readout:
61  #if flags.LArCalib.isSC:
62  result.merge(addFolders(flags,flags.LArCalib.Pedestal.Folder,detDb=flags.LArCalib.Input.Database, tag=PedestalTag, modifiers=chanSelStr(flags)+"<key>LArPedestal</key>",
63  className="LArPedestalComplete"))
64  result.merge(addFolders(flags,flags.LArCalib.Ramp.Folder,detDb=flags.LArCalib.Input.Database, tag=RampTag, modifiers=chanSelStr(flags),
65  className="LArRampComplete"))
66  result.merge(addFolders(flags,flags.LArCalib.MphysOverMcal.Folder,detDb=flags.LArCalib.Input.Database, tag=MpMcTag, modifiers=chanSelStr(flags),
67  className="LArMphysOverMcalComplete"))
68 
69  #Need ADC2MeV values for AutoCorrCondAlg ...
70  #use current production values as input conditions
71  if flags.LArCalib.isSC:
72  requiredConditions=["DAC2uA","HVScaleCorr"]
73  else:
74  #requiredConditions=["DAC2uA","uA2MeV","HVScaleCorr","Ramp","Pedestal","MphysOverMcal"]
75  # in 2024 put:
76  requiredConditions=["DAC2uA","uA2MeV","HVScaleCorr"]
77  if flags.LArCalib.isSC:
78  from LArConfiguration.LArElecCalibDBConfig import LArElecCalibDBSCCfg
79  result.merge(LArElecCalibDBSCCfg(flags,requiredConditions))
80  mapKey="LArOnOffIdMapSC"
81  bcKey = "LArBadChannelSC"
82  uAKey = "LAruA2MeVSC"
83  DACKey = "LArDAC2uASC"
84  HVKey = "LArHVScaleCorrSC"
85  else:
86  from LArConfiguration.LArElecCalibDBConfig import LArElecCalibDBCfg
87  result.merge(LArElecCalibDBCfg(flags,requiredConditions))
88  mapKey="LArOnOffIdMap"
89  bcKey = "LArBadChannel"
90  uAKey = "LAruA2MeV"
91  DACKey = "LArDAC2uA"
92  HVKey = "LArHVScaleCorr"
93 
94  result.addCondAlgo(CompFactory.LArADC2MeVCondAlg(UseFEBGainTresholds=False,LArOnOffIdMappingKey=mapKey,CompleteDetector=False,LAruA2MeVKey=uAKey,LArDAC2uAKey=DACKey,LArHVScaleCorrKey=HVKey,isSuperCell=flags.LArCalib.isSC))
95 
96  theLArAutoCorrTotalCondAlg=CompFactory.LArAutoCorrTotalCondAlg()
97  theLArAutoCorrTotalCondAlg.Nsamples=flags.LArCalib.OFC.Nsamples
98  from AthenaCommon.SystemOfUnits import ns
99  theLArAutoCorrTotalCondAlg.deltaBunch=int(flags.Beam.BunchSpacing/( 25.*ns)+0.5)
100  theLArAutoCorrTotalCondAlg.isSuperCell=flags.LArCalib.isSC
101  theLArAutoCorrTotalCondAlg.isMC=False
102  theLArAutoCorrTotalCondAlg.LArAutoCorrObjKey="LArAutoCorr"
103  theLArAutoCorrTotalCondAlg.LArAutoCorrTotalObjKey="LArPhysAutoCorr"
104  theLArAutoCorrTotalCondAlg.LArOnOffIdMappingObjKey=mapKey
105  theLArAutoCorrTotalCondAlg.LArPedestalObjKey="LArPedestal"
106  if flags.LArCalib.isSC:
107  theLArAutoCorrTotalCondAlg.LArShapeObjKey = "LArShapeSC"
108  theLArAutoCorrTotalCondAlg.LArfSamplObjKey = "LArfSamplSC"
109  theLArAutoCorrTotalCondAlg.LArMinBiasObjKey = "LArMinBiasSC"
110 
111  result.addCondAlgo(theLArAutoCorrTotalCondAlg)
112 
113  result.addEventAlgo(CompFactory.LArAutoCorrAlgToDB(GroupingType=flags.LArCalib.GroupingType,
114  NMinbias=nColl,isSC=flags.LArCalib.isSC))
115 
116 
117  #Ntuple writing
118  rootfile=flags.LArCalib.Output.ROOTFile
119  if rootfile != "":
120  result.addEventAlgo(CompFactory.LArAutoCorr2Ntuple(ContainerKey="LArPhysAutoCorr",OffId=True,isSC=flags.LArCalib.isSC,
121  BadChanKey=bcKey, AddCalib=True))
122  import os
123  if os.path.exists(rootfile):
124  os.remove(rootfile)
125  result.addService(CompFactory.NTupleSvc(Output = [ "FILE1 DATAFILE='"+rootfile+"' OPT='NEW'" ]))
126  result.setAppProperty("HistogramPersistency","ROOT")
127  pass # end if ROOT ntuple writing
128 
129 
130 
131  from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
132  result.merge(OutputConditionsAlgCfg(flags,
133  outputFile=flags.LArCalib.Output.POOLFile,
134  ObjectList=["LArAutoCorrComplete#LArPhysAutoCorr#"+flags.LArCalib.PhysAutoCorr.Folder,],
135  IOVTagList=[PhysAutoCorrTag,],
136  Run1=flags.LArCalib.IOVStart,
137  Run2=flags.LArCalib.IOVEnd
138  ))
139 
140 
141  #RegistrationSvc
142  result.addService(CompFactory.IOVRegistrationSvc(RecreateFolders = False))
143  result.getService("IOVDbSvc").DBInstance=""
144 
145 
146  #MC Event selector since we have no input data file
147  from McEventSelector.McEventSelectorConfig import McEventSelectorCfg
148  result.merge(McEventSelectorCfg(flags,
149  RunNumber = flags.LArCalib.Input.RunNumbers[0],
150  EventsPerRun = 1,
151  FirstEvent = 1,
152  InitialTimeStamp = 0,
153  TimeStampInterval = 1))
154 
155 
156  from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
157  result.merge(PerfMonMTSvcCfg(flags))
158 
159  return result
160 
161 
162 
163 

Variable Documentation

◆ AtlasVersion

python.LArCalib_PileUpAutoCorrConfig.AtlasVersion

Definition at line 183 of file LArCalib_PileUpAutoCorrConfig.py.

◆ BadChannelDB

python.LArCalib_PileUpAutoCorrConfig.BadChannelDB

Definition at line 177 of file LArCalib_PileUpAutoCorrConfig.py.

◆ BadChannelTag

python.LArCalib_PileUpAutoCorrConfig.BadChannelTag

Definition at line 178 of file LArCalib_PileUpAutoCorrConfig.py.

◆ cfg

python.LArCalib_PileUpAutoCorrConfig.cfg = MainServicesCfg(ConfigFlags)

Definition at line 191 of file LArCalib_PileUpAutoCorrConfig.py.

◆ ConfigFlags

python.LArCalib_PileUpAutoCorrConfig.ConfigFlags = initConfigFlags()

Definition at line 168 of file LArCalib_PileUpAutoCorrConfig.py.

◆ Database

python.LArCalib_PileUpAutoCorrConfig.Database

Definition at line 175 of file LArCalib_PileUpAutoCorrConfig.py.

◆ DatabaseInstance

python.LArCalib_PileUpAutoCorrConfig.DatabaseInstance

Definition at line 180 of file LArCalib_PileUpAutoCorrConfig.py.

◆ DBConnection

python.LArCalib_PileUpAutoCorrConfig.DBConnection

Definition at line 181 of file LArCalib_PileUpAutoCorrConfig.py.

◆ Files

python.LArCalib_PileUpAutoCorrConfig.Files

Definition at line 173 of file LArCalib_PileUpAutoCorrConfig.py.

◆ GlobalTag

python.LArCalib_PileUpAutoCorrConfig.GlobalTag

Definition at line 182 of file LArCalib_PileUpAutoCorrConfig.py.

◆ Ncoll

python.LArCalib_PileUpAutoCorrConfig.Ncoll

Definition at line 185 of file LArCalib_PileUpAutoCorrConfig.py.

◆ Nsamples

python.LArCalib_PileUpAutoCorrConfig.Nsamples

Definition at line 186 of file LArCalib_PileUpAutoCorrConfig.py.

◆ ROOTFile

python.LArCalib_PileUpAutoCorrConfig.ROOTFile

Definition at line 179 of file LArCalib_PileUpAutoCorrConfig.py.

◆ RunNumbers

python.LArCalib_PileUpAutoCorrConfig.RunNumbers

Definition at line 174 of file LArCalib_PileUpAutoCorrConfig.py.

◆ SubDet

python.LArCalib_PileUpAutoCorrConfig.SubDet

Definition at line 176 of file LArCalib_PileUpAutoCorrConfig.py.

python.LArElecCalibDBConfig.LArElecCalibDBCfg
def LArElecCalibDBCfg(flags, condObjs)
Definition: LArElecCalibDBConfig.py:47
SystemOfUnits
python.LArElecCalibDBConfig.LArElecCalibDBMCSCCfg
def LArElecCalibDBMCSCCfg(flags, folders, detdb="LAR_OFL")
Definition: LArElecCalibDBConfig.py:241
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
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.LArElecCalibDBConfig.LArMinBiasSymAlg
LArMinBiasSymAlg
Definition: LArElecCalibDBConfig.py:13
python.LArCalibBaseConfig.chanSelStr
def chanSelStr(flags)
Definition: LArCalibBaseConfig.py:33
python.LArElecCalibDBConfig.LArShapeSymAlg
LArShapeSymAlg
Definition: LArElecCalibDBConfig.py:19
python.LArCalib_PileUpAutoCorrConfig.LArPileUpAutoCorrCfg
def LArPileUpAutoCorrCfg(flags)
Definition: LArCalib_PileUpAutoCorrConfig.py:7
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
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.LArCalibBaseConfig.LArCalibBaseCfg
def LArCalibBaseCfg(flags)
Definition: LArCalibBaseConfig.py:5
python.LArElecCalibDBConfig.LArElecCalibDBSCCfg
def LArElecCalibDBSCCfg(flags, condObjs, sqlite=None)
Definition: LArElecCalibDBConfig.py:126
python.LArElecCalibDBConfig.LArfSamplSymAlg
LArfSamplSymAlg
Definition: LArElecCalibDBConfig.py:16