ATLAS Offline Software
Loading...
Searching...
No Matches
LArSC2NtupleConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentFactory import CompFactory
4
5def LArSC2NtupleCfg(flags, isEmf=False, **kwargs):
6
7 kwargs['isSC'] = True
8
9 from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
10 cfg = ByteStreamReadCfg(flags)
11
12 if kwargs.get("ContainerKey","") != "" or "SC_ADC_BAS" in kwargs.get('SCContainerKeys') or "SC_ET" in kwargs.get('SCContainerKeys'):
13 from LArByteStream.LArRawSCDataReadingConfig import LArRawSCDataReadingCfg
14 cfg.merge(LArRawSCDataReadingCfg(flags,OutputLevel=kwargs['OutputLevel']))
15 else:
16 theLArLATOMEDecoder = CompFactory.LArLATOMEDecoder("LArLATOMEDecoder")
17 from LArCabling.LArCablingConfig import LArCalibIdMappingCfg,LArOnOffIdMappingCfg
18 cfg.merge(LArOnOffIdMappingCfg(flags))
19 cfg.merge(LArCalibIdMappingCfg(flags))
20 cfg.addEventAlgo(CompFactory.LArRawSCCalibDataReadingAlg(LArSCAccCalibDigitKey = flags.LArSCDump.acccalibdigitsKey,
21 LArSCAccDigitKey = flags.LArSCDump.accdigitsKey,
22 CalibCablingKeyLeg="LArCalibLineMap",
23 OnOffMapLeg="LArOnOffIdMap",
24 LATOMEDecoder = theLArLATOMEDecoder, ))
25
26 from LArCabling.LArCablingConfig import LArOnOffIdMappingSCCfg,LArCalibIdMappingSCCfg,LArLATOMEMappingCfg
27 cfg.merge(LArOnOffIdMappingSCCfg(flags))
28 cfg.merge(LArCalibIdMappingSCCfg(flags))
29 cfg.merge(LArLATOMEMappingCfg(flags))
30 if isEmf:
31 # hack for different mapping from EMF
32 cil=cfg.getCondAlgo('CondInputLoader')
33 iovdbsvc=cfg.getService('IOVDbSvc')
34 folder='/LAR/Identifier/LatomeMapping'
35 for i in range(0,len(iovdbsvc.Folders)):
36 if (iovdbsvc.Folders[i].find(folder)>=0):
37 del iovdbsvc.Folders[i]
38 break
39
40 remove_folder = False
41 for cil_Loadval in cil.Load:
42 if folder in cil_Loadval:
43 print(f"Removing {cil_Loadval} from cil/Load")
44 remove_folder = True
45 break
46 if remove_folder: cil.Load.remove(cil_Loadval)
47 from IOVDbSvc.IOVDbSvcConfig import addFolders
48 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'))
49
50 if flags.LArSCDump.doRawChan:
51 from LArByteStream.LArRawDataReadingConfig import LArRawDataReadingCfg
52 cfg.merge(LArRawDataReadingCfg(flags))
53 from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
54 cfg.merge(LArOnOffIdMappingCfg(flags))
55 from LArConfiguration.LArConfigFlags import RawChannelSource
56 if flags.LAr.RawChannelSource is RawChannelSource.Calculated:
57 from LArROD.LArRawChannelBuilderAlgConfig import LArRawChannelBuilderAlgCfg
58 cfg.merge(LArRawChannelBuilderAlgCfg(flags))
59
60 cfg.getEventAlgo("LArRawChannelBuilder").LArRawChannelKey="LArRawChannels"
61
62 if 'FillLB' in kwargs and kwargs['FillLB']: #we are filling per event tree
63 from LArCellRec.LArTimeVetoAlgConfig import LArTimeVetoAlgCfg
64 cfg.merge(LArTimeVetoAlgCfg(flags))
65 if flags.LArSCDump.fillNoisyRO: # should also config reco
66 from CaloRec.CaloRecoConfig import CaloRecoCfg
67 cfg.merge(CaloRecoCfg(flags))
68 from LArCellRec.LArNoisyROSummaryConfig import LArNoisyROSummaryCfg
69 cfg.merge(LArNoisyROSummaryCfg(flags))
70
71 if 'FillTriggerTowers' in kwargs and kwargs['FillTriggerTowers']: #confiigure decoding
72 from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import L1TriggerByteStreamDecoderCfg
73 from TrigT1CaloByteStream.LVL1CaloRun2ByteStreamConfig import LVL1CaloRun2ReadBSCfg
74 cfg.merge(L1TriggerByteStreamDecoderCfg(flags) )
75 cfg.merge(LVL1CaloRun2ReadBSCfg(flags))
76 from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg, HLTConfigSvcCfg, L1PrescaleCondAlgCfg, HLTPrescaleCondAlgCfg
77 cfg.merge( L1ConfigSvcCfg(flags) )
78 cfg.merge( HLTConfigSvcCfg(flags) )
79 cfg.merge( L1PrescaleCondAlgCfg(flags) )
80 cfg.merge( HLTPrescaleCondAlgCfg(flags) )
81
82 alg=CompFactory.LArSC2Ntuple('LArSC2Ntuple',**kwargs)
83
84 print(alg)
85
86 cfg.addEventAlgo(alg)
87
88 return cfg
89
90
void print(char *figname, TCanvas *c1)
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:138
LArSC2NtupleCfg(flags, isEmf=False, **kwargs)