fix_headers_larg4.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 "larsim/LArG4/AuxDetReadout.h" => "larsim/LegacyLArG4/AuxDetReadout.h",
9 "larsim/LArG4/AuxDetReadoutGeometry.h" => "larsim/LegacyLArG4/AuxDetReadoutGeometry.h",
10 "larsim/LArG4/ConfigurablePhysicsList.hh" => "larsim/LegacyLArG4/ConfigurablePhysicsList.hh",
11 "larsim/LArG4/ConfigurablePhysicsList.icc" => "larsim/LegacyLArG4/ConfigurablePhysicsList.icc",
12 "larsim/LArG4/CustomPhysicsBuiltIns.hh" => "larsim/LegacyLArG4/CustomPhysicsBuiltIns.hh",
13 "larsim/LArG4/CustomPhysicsFactory.hh" => "larsim/LegacyLArG4/CustomPhysicsFactory.hh",
14 "larsim/LArG4/CustomPhysicsTable.hh" => "larsim/LegacyLArG4/CustomPhysicsTable.hh",
15 "larsim/LArG4/FastOpticalPhysics.h" => "larsim/LegacyLArG4/FastOpticalPhysics.h",
16 "larsim/LArG4/G4BadIdeaAction.h" => "larsim/LegacyLArG4/G4BadIdeaAction.h",
17 "larsim/LArG4/G4ThermalElectron.hh" => "larsim/LegacyLArG4/G4ThermalElectron.hh",
18 "larsim/LArG4/ISCalculation.h" => "larsim/LegacyLArG4/ISCalculation.h",
19 "larsim/LArG4/ISCalculationNEST.h" => "larsim/LegacyLArG4/ISCalculationNEST.h",
20 "larsim/LArG4/ISCalculationSeparate.h" => "larsim/LegacyLArG4/ISCalculationSeparate.h",
21 "larsim/LArG4/IonizationAndScintillation.h" => "larsim/LegacyLArG4/IonizationAndScintillation.h",
22 "larsim/LArG4/IonizationAndScintillationAction.h" => "larsim/LegacyLArG4/IonizationAndScintillationAction.h",
23 "larsim/LArG4/LArStackingAction.h" => "larsim/LegacyLArG4/LArStackingAction.h",
24 "larsim/LArG4/LArVoxelReadout.h" => "larsim/LegacyLArG4/LArVoxelReadout.h",
25 "larsim/LArG4/LArVoxelReadoutGeometry.h" => "larsim/LegacyLArG4/LArVoxelReadoutGeometry.h",
26 "larsim/LArG4/MaterialPropertyLoader.h" => "larsim/LegacyLArG4/MaterialPropertyLoader.h",
27 "larsim/LArG4/MuNuclearSplittingProcess.h" => "larsim/LegacyLArG4/MuNuclearSplittingProcess.h",
28 "larsim/LArG4/MuNuclearSplittingProcessXSecBias.h" => "larsim/LegacyLArG4/MuNuclearSplittingProcessXSecBias.h",
29 "larsim/LArG4/NestAlg.h" => "larsim/LegacyLArG4/NestAlg.h",
30 "larsim/LArG4/NeutronHPphysics.hh" => "larsim/LegacyLArG4/NeutronHPphysics.hh",
31 "larsim/LArG4/OpBoundaryProcessSimple.hh" => "larsim/LegacyLArG4/OpBoundaryProcessSimple.hh",
32 "larsim/LArG4/OpDetLookup.h" => "larsim/LegacyLArG4/OpDetLookup.h",
33 "larsim/LArG4/OpDetPhotonTable.h" => "larsim/LegacyLArG4/OpDetPhotonTable.h",
34 "larsim/LArG4/OpDetReadoutGeometry.h" => "larsim/LegacyLArG4/OpDetReadoutGeometry.h",
35 "larsim/LArG4/OpDetSensitiveDetector.h" => "larsim/LegacyLArG4/OpDetSensitiveDetector.h",
36 "larsim/LArG4/OpFastScintillation.hh" => "larsim/LegacyLArG4/OpFastScintillation.hh",
37 "larsim/LArG4/OpParamAction.h" => "larsim/LegacyLArG4/OpParamAction.h",
38 "larsim/LArG4/OpParamSD.h" => "larsim/LegacyLArG4/OpParamSD.h",
39 "larsim/LArG4/OpticalPhysics.hh" => "larsim/LegacyLArG4/OpticalPhysics.hh",
40 "larsim/LArG4/ParticleListAction.h" => "larsim/LegacyLArG4/ParticleListAction.h",
41 "larsim/LArG4/PhysicsList.h" => "larsim/LegacyLArG4/PhysicsList.h",
42 "larsim/LArG4/VisualizationAction.h" => "larsim/LegacyLArG4/VisualizationAction.h"
43  ); }
44 
45 foreach my $inc (sort keys %header_list) {
46  s&^(\s*#include\s+["<])\Q$inc\E(.*)&${1}$header_list{$inc}${2}& and last;
47  s&^(\s*#include\s+["<]GENIE/)\Q$inc\E(.*)&${1}$header_list{$inc}${2}& and last;
48 }