ATLAS Offline Software
LArSC2NtupleConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentFactory import CompFactory
4 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5 
6 def LArSC2NtupleCfg(flags, isEmf=False, **kwargs):
7 
8  kwargs['isSC'] = True
9 
11 
12  from LArByteStream.LArRawSCDataReadingConfig import LArRawSCDataReadingCfg
13  cfg.merge(LArRawSCDataReadingCfg(flags,OutputLevel=kwargs['OutputLevel']))
14 
15  from LArCabling.LArCablingConfig import LArOnOffIdMappingSCCfg,LArCalibIdMappingSCCfg,LArLATOMEMappingCfg
16  cfg.merge(LArOnOffIdMappingSCCfg(flags))
17  cfg.merge(LArCalibIdMappingSCCfg(flags))
18  cfg.merge(LArLATOMEMappingCfg(flags))
19  if isEmf:
20  # hack for different mapping from EMF
21  cil=cfg.getCondAlgo('CondInputLoader')
22  iovdbsvc=cfg.getService('IOVDbSvc')
23  folder='/LAR/Identifier/LatomeMapping'
24  for i in range(0,len(iovdbsvc.Folders)):
25  if (iovdbsvc.Folders[i].find(folder)>=0):
26  del iovdbsvc.Folders[i]
27  break
28 
29  remove_folder = False
30  for cil_Loadval in cil.Load:
31  if folder in cil_Loadval:
32  print(f"Removing {cil_Loadval} from cil/Load")
33  remove_folder = True
34  break
35  if remove_folder: cil.Load.remove(cil_Loadval)
36  from IOVDbSvc.IOVDbSvcConfig import addFolders
37  cfg.merge(addFolders(flags,'/LAR/Identifier/LatomeMapping',tag='LARIdentifierLatomeMapping-EMF',className="CondAttrListCollection",detDb='/afs/cern.ch/user/p/pavol/w0/public/DB_update_24/SCcalib/LatomeMapping_EMF.db'))
38 
39  if flags.LArSCDump.doRawChan:
40  from LArByteStream.LArRawDataReadingConfig import LArRawDataReadingCfg
41  cfg.merge(LArRawDataReadingCfg(flags))
42  from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
43  cfg.merge(LArOnOffIdMappingCfg(flags))
44  from LArConfiguration.LArConfigFlags import RawChannelSource
45  if flags.LAr.RawChannelSource is RawChannelSource.Calculated:
46  from LArROD.LArRawChannelBuilderAlgConfig import LArRawChannelBuilderAlgCfg
47  cfg.merge(LArRawChannelBuilderAlgCfg(flags))
48 
49  cfg.getEventAlgo("LArRawChannelBuilder").LArRawChannelKey="LArRawChannels"
50 
51  if 'FillLB' in kwargs and kwargs['FillLB']: #we are filling per event tree
52  from LArCellRec.LArTimeVetoAlgConfig import LArTimeVetoAlgCfg
53  cfg.merge(LArTimeVetoAlgCfg(flags))
54  if flags.LArSCDump.fillNoisyRO: # should also config reco
55  from CaloRec.CaloRecoConfig import CaloRecoCfg
56  cfg.merge(CaloRecoCfg(flags))
57  from LArCellRec.LArNoisyROSummaryConfig import LArNoisyROSummaryCfg
58  cfg.merge(LArNoisyROSummaryCfg(flags))
59 
60  if 'FillTriggerTowers' in kwargs and kwargs['FillTriggerTowers']: #confiigure decoding
61  from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import L1TriggerByteStreamDecoderCfg
62  from TrigT1CaloByteStream.LVL1CaloRun2ByteStreamConfig import LVL1CaloRun2ReadBSCfg
63  cfg.merge(L1TriggerByteStreamDecoderCfg(flags) )
64  cfg.merge(LVL1CaloRun2ReadBSCfg(flags))
65  from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg, HLTConfigSvcCfg, L1PrescaleCondAlgCfg, HLTPrescaleCondAlgCfg
66  cfg.merge( L1ConfigSvcCfg(flags) )
67  cfg.merge( HLTConfigSvcCfg(flags) )
68  cfg.merge( L1PrescaleCondAlgCfg(flags) )
69  cfg.merge( HLTPrescaleCondAlgCfg(flags) )
70 
71  alg=CompFactory.LArSC2Ntuple('LArSC2Ntuple',**kwargs)
72 
73  print(alg)
74 
75  cfg.addEventAlgo(alg)
76 
77  return cfg
78 
79 
python.CaloRecoConfig.CaloRecoCfg
def CaloRecoCfg(flags, clustersname=None)
Definition: CaloRecoConfig.py:9
LArCablingConfig.LArOnOffIdMappingSCCfg
def LArOnOffIdMappingSCCfg(configFlags)
Definition: LArCablingConfig.py:65
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
python.LArRawChannelBuilderAlgConfig.LArRawChannelBuilderAlgCfg
def LArRawChannelBuilderAlgCfg(flags, **kwargs)
Definition: LArRawChannelBuilderAlgConfig.py:9
python.LArRawSCDataReadingConfig.LArRawSCDataReadingCfg
def LArRawSCDataReadingCfg(configFlags, **kwargs)
Definition: LArRawSCDataReadingConfig.py:8
LVL1CaloRun2ByteStreamConfig.LVL1CaloRun2ReadBSCfg
def LVL1CaloRun2ReadBSCfg(flags, forRoIBResultToxAOD=False)
Definition: LVL1CaloRun2ByteStreamConfig.py:121
python.TrigConfigSvcCfg.HLTPrescaleCondAlgCfg
def HLTPrescaleCondAlgCfg(flags)
Definition: TrigConfigSvcCfg.py:327
LArCablingConfig.LArLATOMEMappingCfg
def LArLATOMEMappingCfg(configFlags)
Definition: LArCablingConfig.py:95
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
LArTimeVetoAlgConfig.LArTimeVetoAlgCfg
def LArTimeVetoAlgCfg(flags)
Definition: LArTimeVetoAlgConfig.py:7
python.IOVDbSvcConfig.addFolders
def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers='')
Definition: IOVDbSvcConfig.py:72
LArCablingConfig.LArOnOffIdMappingCfg
def LArOnOffIdMappingCfg(configFlags)
Definition: LArCablingConfig.py:62
python.LArRawDataReadingConfig.LArRawDataReadingCfg
def LArRawDataReadingCfg(configFlags, **kwargs)
Definition: LArRawDataReadingConfig.py:10
python.TrigConfigSvcCfg.L1PrescaleCondAlgCfg
def L1PrescaleCondAlgCfg(flags)
Definition: TrigConfigSvcCfg.py:272
python.TrigConfigSvcCfg.L1ConfigSvcCfg
def L1ConfigSvcCfg(flags)
Definition: TrigConfigSvcCfg.py:198
LArCablingConfig.LArCalibIdMappingSCCfg
def LArCalibIdMappingSCCfg(configFlags)
Definition: LArCablingConfig.py:86
LArNoisyROSummaryConfig.LArNoisyROSummaryCfg
def LArNoisyROSummaryCfg(configFlags, **kwargs)
Definition: LArNoisyROSummaryConfig.py:8
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
python.TrigConfigSvcCfg.HLTConfigSvcCfg
def HLTConfigSvcCfg(flags)
Definition: TrigConfigSvcCfg.py:231
TrigT1ResultByteStreamConfig.L1TriggerByteStreamDecoderCfg
def L1TriggerByteStreamDecoderCfg(flags, returnEDM=False)
Definition: TrigT1ResultByteStreamConfig.py:133
LArSC2NtupleConfig.LArSC2NtupleCfg
def LArSC2NtupleCfg(flags, isEmf=False, **kwargs)
Definition: LArSC2NtupleConfig.py:6