fix_headers_genie3.pl
Go to the documentation of this file.
1 use strict;
2 
3 use vars qw(%subdir_list);
4 use vars qw(%header_list);
5 
6 # explicit headers to avoid conflicts with experiment code
7 BEGIN { %header_list = (
8 "Messenger/Messenger.h" => "Framework/Messenger/Messenger.h",
9 "ReWeight/GReWeight.h" => "RwFramework/GReWeight.h",
10 "ReWeight/GReWeightI.h" => "RwFramework/GReWeightI.h",
11 "ReWeight/GSyst.h" => "RwFramework/GSyst.h",
12 "ReWeight/GSystSet.h" => "RwFramework/GSystSet.h",
13 "ReWeight/GSystUncertainty.h" => "RwFramework/GSystUncertainty.h",
14 "ReWeight/GReWeightAGKY.h" => "RwCalculators/GReWeightAGKY.h",
15 "ReWeight/GReWeightDISNuclMod.h" => "RwCalculators/GReWeightDISNuclMod.h",
16 "ReWeight/GReWeightFGM.h" => "RwCalculators/GReWeightFGM.h",
17 "ReWeight/GReWeightFZone.h" => "RwCalculators/GReWeightFZone.h",
18 "ReWeight/GReWeightINuke.h" => "RwCalculators/GReWeightINuke.h",
19 "ReWeight/GReWeightINukeParams.h" => "RwCalculators/GReWeightINukeParams.h",
20 "ReWeight/GReWeightNonResonanceBkg.h" => "RwCalculators/GReWeightNonResonanceBkg.h",
21 "ReWeight/GReWeightNuXSecCCQEaxial.h" => "RwCalculators/GReWeightNuXSecCCQEaxial.h",
22 "ReWeight/GReWeightNuXSecCCQE.h" => "RwCalculators/GReWeightNuXSecCCQE.h",
23 "ReWeight/GReWeightNuXSecCCQEvec.h" => "RwCalculators/GReWeightNuXSecCCQEvec.h",
24 "ReWeight/GReWeightNuXSecCCRES.h" => "RwCalculators/GReWeightNuXSecCCRES.h",
25 "ReWeight/GReWeightNuXSecCOH.h" => "RwCalculators/GReWeightNuXSecCOH.h",
26 "ReWeight/GReWeightNuXSecDIS.h" => "RwCalculators/GReWeightNuXSecDIS.h",
27 "ReWeight/GReWeightNuXSecHelper.h" => "RwCalculators/GReWeightNuXSecHelper.h",
28 "ReWeight/GReWeightNuXSecNCEL.h" => "RwCalculators/GReWeightNuXSecNCEL.h",
29 "ReWeight/GReWeightNuXSecNC.h" => "RwCalculators/GReWeightNuXSecNC.h",
30 "ReWeight/GReWeightNuXSecNCRES.h" => "RwCalculators/GReWeightNuXSecNCRES.h",
31 "ReWeight/GReWeightResonanceDecay.h" => "RwCalculators/GReWeightResonanceDecay.h",
32 "ReWeight/GReWeightUtils.h" => "RwCalculators/GReWeightUtils.h",
33 "ReWeight/GReWeightIOBranchDesc.h" => "RwIO/GReWeightIOBranchDesc.h",
34 "ReWeight/GReWeightIORecord.h" => "RwIO/GReWeightIORecord.h",
35 "GHEP/GHepFlags.h" => "Framework/GHEP/GHepFlags.h",
36 "GHEP/GHepParticle.h" => "Framework/GHEP/GHepParticle.h",
37 "GHEP/GHepRecord.h" => "Framework/GHEP/GHepRecord.h",
38 "GHEP/GHepRecordHistory.h" => "Framework/GHEP/GHepRecordHistory.h",
39 "GHEP/GHepStatus.h" => "Framework/GHEP/GHepStatus.h",
40 "GHEP/GHepUtils.h" => "Framework/GHEP/GHepUtils.h",
41 "GHEP/GHepVirtualListFolder.h" => "Framework/GHEP/GHepVirtualListFolder.h",
42 "GHEP/GHepVirtualList.h" => "Framework/GHEP/GHepVirtualList.h",
43 "Interaction/InitialState.h" => "Framework/Interaction/InitialState.h",
44 "Interaction/InteractionException.h" => "Framework/Interaction/InteractionException.h",
45 "Interaction/Interaction.h" => "Framework/Interaction/Interaction.h",
46 "Interaction/InteractionType.h" => "Framework/Interaction/InteractionType.h",
47 "Interaction/Kinematics.h" => "Framework/Interaction/Kinematics.h",
48 "Interaction/KPhaseSpace.h" => "Framework/Interaction/KPhaseSpace.h",
49 "Interaction/ProcessInfo.h" => "Framework/Interaction/ProcessInfo.h",
50 "Interaction/ScatteringType.h" => "Framework/Interaction/ScatteringType.h",
51 "Interaction/SppChannel.h" => "Framework/Interaction/SppChannel.h",
52 "Interaction/Target.h" => "Framework/Interaction/Target.h",
53 "Interaction/XclsTag.h" => "Framework/Interaction/XclsTag.h",
54 "Algorithm/AlgCmp.h" => "Framework/Algorithm/AlgCmp.h",
55 "Algorithm/AlgConfigPool.h" => "Framework/Algorithm/AlgConfigPool.h",
56 "Algorithm/AlgFactory.h" => "Framework/Algorithm/AlgFactory.h",
57 "Algorithm/AlgId.h" => "Framework/Algorithm/AlgId.h",
58 "Algorithm/Algorithm.h" => "Framework/Algorithm/Algorithm.h",
59 "Algorithm/AlgStatus.h" => "Framework/Algorithm/AlgStatus.h",
60 "EVGCore/EventGenerator.h" => "Framework/EventGen/EventGenerator.h",
61 "EVGCore/EventGeneratorI.h" => "Framework/EventGen/EventGeneratorI.h",
62 "EVGCore/EventGeneratorListAssembler.h" => "Framework/EventGen/EventGeneratorListAssembler.h",
63 "EVGCore/EventGeneratorList.h" => "Framework/EventGen/EventGeneratorList.h",
64 "EVGCore/EventRecord.h" => "Framework/EventGen/EventRecord.h",
65 "EVGCore/EventRecordVisitorI.h" => "Framework/EventGen/EventRecordVisitorI.h",
66 "EVGCore/EVGThreadException.h" => "Framework/EventGen/EVGThreadException.h",
67 "EVGCore/GVldContext.h" => "Framework/EventGen/GVldContext.h",
68 "EVGCore/InteractionGeneratorMap.h" => "Framework/EventGen/InteractionGeneratorMap.h",
69 "EVGCore/InteractionListAssembler.h" => "Framework/EventGen/InteractionListAssembler.h",
70 "EVGCore/InteractionListGeneratorI.h" => "Framework/EventGen/InteractionListGeneratorI.h",
71 "EVGCore/InteractionList.h" => "Framework/EventGen/InteractionList.h",
72 "EVGCore/InteractionSelectorI.h" => "Framework/EventGen/InteractionSelectorI.h",
73 "EVGCore/PhysInteractionSelector.h" => "Framework/EventGen/PhysInteractionSelector.h",
74 "EVGCore/RunningThreadInfo.h" => "Framework/EventGen/RunningThreadInfo.h",
75 "EVGCore/ToyInteractionSelector.h" => "Framework/EventGen/ToyInteractionSelector.h",
76 "EVGCore/XSecAlgorithmMap.h" => "Framework/EventGen/XSecAlgorithmMap.h",
77 "NucleonDecay/DummyInteractionListGenerator.h" => "Physics/NucleonDecay/DummyInteractionListGenerator.h",
78 "NucleonDecay/DummyPXSec.h" => "Physics/NucleonDecay/DummyPXSec.h",
79 "NucleonDecay/NucleonDecayMode.h" => "Physics/NucleonDecay/NucleonDecayMode.h",
80 "NucleonDecay/NucleonDecayPrimaryVtxGenerator.h" => "Physics/NucleonDecay/NucleonDecayPrimaryVtxGenerator.h",
81 "NucleonDecay/NucleonDecayUtils.h" => "Physics/NucleonDecay/NucleonDecayUtils.h",
82 "PDG/PDGCodeList.h" => "Framework/ParticleData/PDGCodeList.h",
83 "PDG/PDGCodes.h" => "Framework/ParticleData/PDGCodes.h",
84 "PDG/PDGLibrary.h" => "Framework/ParticleData/PDGLibrary.h",
85 "PDG/PDGUtils.h" => "Framework/ParticleData/PDGUtils.h",
86 "Utils/AppInit.h" => "Framework/Utils/AppInit.h",
87 "Utils/RunOpt.h" => "Framework/Utils/RunOpt.h",
88 "Utils/BWFunc.h" => "Framework/Utils/BWFunc.h",
89 "Utils/CacheBranchFx.h" => "Framework/Utils/CacheBranchFx.h",
90 "Utils/CacheBranchI.h" => "Framework/Utils/CacheBranchI.h",
91 "Utils/CacheBranchNtp.h" => "Framework/Utils/CacheBranchNtp.h",
92 "Utils/Cache.h" => "Framework/Utils/Cache.h",
93 "Utils/CmdLnArgParser.h" => "Framework/Utils/CmdLnArgParser.h",
94 "Utils/ConfigIsotopeMapUtils.h" => "Framework/Utils/ConfigIsotopeMapUtils.h",
95 "Utils/GSimFiles.h" => "Framework/Utils/GSimFiles.h",
96 "Utils/GUIUtils.h" => "Framework/Utils/GUIUtils.h",
97 "Utils/HadXSUtils.h" => "Framework/Utils/HadXSUtils.h",
98 "Utils/KineUtils.h" => "Framework/Utils/KineUtils.h",
99 "Utils/PhysUtils.h" => "Framework/Utils/PhysUtils.h",
100 "Utils/PREM.h" => "Framework/Utils/PREM.h",
101 "Utils/PrintUtils.h" => "Framework/Utils/PrintUtils.h",
102 "Utils/Range1.h" => "Framework/Utils/Range1.h",
103 "Utils/StringUtils.h" => "Framework/Utils/StringUtils.h",
104 "Utils/Style.h" => "Framework/Utils/Style.h",
105 "Utils/SystemUtils.h" => "Framework/Utils/SystemUtils.h",
106 "Utils/T2KEvGenMetaData.h" => "Framework/Utils/T2KEvGenMetaData.h",
107 "Utils/UnitUtils.h" => "Framework/Utils/UnitUtils.h",
108 "Utils/XSecSplineList.h" => "Framework/Utils/XSecSplineList.h",
109 "Utils/XmlParserUtils.h" => "Framework/Utils/XmlParserUtils.h",
110 "Geo/FidShape.h" => "Tools/Geometry/FidShape.h",
111 "Geo/GeomVolSelectorBasic.h" => "Tools/Geometry/GeomVolSelectorBasic.h",
112 "Geo/GeomVolSelectorFiducial.h" => "Tools/Geometry/GeomVolSelectorFiducial.h",
113 "Geo/GeomVolSelectorI.h" => "Tools/Geometry/GeomVolSelectorI.h",
114 "Geo/GeomVolSelectorRockBox.h" => "Tools/Geometry/GeomVolSelectorRockBox.h",
115 "Geo/GeoUtils.h" => "Tools/Geometry/GeoUtils.h",
116 "Geo/PathSegmentList.h" => "Tools/Geometry/PathSegmentList.h",
117 "Geo/PointGeomAnalyzer.h" => "Tools/Geometry/PointGeomAnalyzer.h",
118 "Geo/ROOTGeomAnalyzer.h" => "Tools/Geometry/ROOTGeomAnalyzer.h",
119 "Conventions/Constants.h" => "Framework/Conventions/Constants.h",
120 "Conventions/Controls.h" => "Framework/Conventions/Controls.h",
121 "Conventions/EnvSnapshot.h" => "Framework/Conventions/EnvSnapshot.h",
122 "Conventions/GBuild.h" => "Framework/Conventions/GBuild.h",
123 "Conventions/GMode.h" => "Framework/Conventions/GMode.h",
124 "Conventions/GVersion.h" => "Framework/Conventions/GVersion.h",
125 "Conventions/KinePhaseSpace.h" => "Framework/Conventions/KinePhaseSpace.h",
126 "Conventions/KineVar.h" => "Framework/Conventions/KineVar.h",
127 "Conventions/RefFrame.h" => "Framework/Conventions/RefFrame.h",
128 "Conventions/Units.h" => "Framework/Conventions/Units.h",
129 "FluxDrivers/GAstroFlux.h" => "Tools/Flux/GAstroFlux.h",
130 "FluxDrivers/GAtmoFlux.h" => "Tools/Flux/GAtmoFlux.h",
131 "FluxDrivers/GBGLRSAtmoFlux.h" => "Tools/Flux/GBGLRSAtmoFlux.h",
132 "FluxDrivers/GCylindTH1Flux.h" => "Tools/Flux/GCylindTH1Flux.h",
133 "FluxDrivers/GFlavorMap.h" => "Tools/Flux/GFlavorMap.h",
134 "FluxDrivers/GFlavorMixerFactory.h" => "Tools/Flux/GFlavorMixerFactory.h",
135 "FluxDrivers/GFlavorMixerI.h" => "Tools/Flux/GFlavorMixerI.h",
136 "FluxDrivers/GFLUKAAtmoFlux.h" => "Tools/Flux/GFLUKAAtmoFlux.h",
137 "FluxDrivers/GFluxBlender.h" => "Tools/Flux/GFluxBlender.h",
138 "FluxDrivers/GFluxDriverFactory.h" => "Tools/Flux/GFluxDriverFactory.h",
139 "FluxDrivers/GFluxExposureI.h" => "Tools/Flux/GFluxExposureI.h",
140 "FluxDrivers/GFluxFileConfigI.h" => "Tools/Flux/GFluxFileConfigI.h",
141 "FluxDrivers/GHAKKMAtmoFlux.h" => "Tools/Flux/GHAKKMAtmoFlux.h",
142 "FluxDrivers/GJPARCNuFlux.h" => "Tools/Flux/GJPARCNuFlux.h",
143 "FluxDrivers/GMonoEnergeticFlux.h" => "Tools/Flux/GMonoEnergeticFlux.h",
144 "FluxDrivers/GNuMIFlux.h" => "Tools/Flux/GNuMIFlux.h",
145 "FluxDrivers/GSimpleNtpFlux.h" => "Tools/Flux/GSimpleNtpFlux.h",
146 "Conventions/XmlParserStatus.h" => "Framework/Conventions/.h",
147 "NeutronOsc/NeutronOscMode.h" => "Physics/NNBarOscillation/NNBarOscMode.h"
148  ); }
149 
150 foreach my $inc (sort keys %header_list) {
151  s&^(\s*#include\s+["<])\Q$inc\E(.*)&${1}$header_list{$inc}${2}& and last;
152  s&^(\s*#include\s+["<]GENIE/)\Q$inc\E(.*)&${1}$header_list{$inc}${2}& and last;
153 }