fix_headers.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 BEGIN { %subdir_list = (
7  "CoreUtils" => "larcore/CoreUtils",
8  "Geometry" => "larcore/Geometry",
9  "SimpleTypesAndConstants" => "larcore/SimpleTypesAndConstants",
10  "SummaryData" => "larcore/SummaryData",
11  "AnalysisAlg" => "lardata/AnalysisAlg",
12  "AnalysisBase" => "lardata/AnalysisBase",
13  "DetectorInfo" => "lardata/DetectorInfo",
14  "DetectorInfoServices" => "lardata/DetectorInfoServices",
15  "MCBase" => "lardata/MCBase",
16  "OpticalDetectorData" => "lardata/OpticalDetectorData",
17  "RawData" => "lardata/RawData",
18  "RecoBase" => "lardata/RecoBase",
19  "RecoBaseArt" => "lardata/RecoBaseArt",
20  "RecoObjects" => "lardata/RecoObjects",
21  "CalData" => "larevt/CalData",
22  "CalibrationDBI" => "larevt/CalibrationDBI",
23  "Filters" => "larevt/Filters",
24  "SpaceCharge" => "larevt/SpaceCharge",
25  "DetSim" => "larsim/DetSim",
26  "EventGenerator" => "larsim/EventGenerator",
27  "LArG4" => "larsim/LArG4",
28  "MCCheater" => "larsim/MCCheater",
29  "MCSTReco" => "larsim/MCSTReco",
30  "MCDumpers" => "larsim/MCDumpers",
31  "PhotonPropagation" => "larsim/PhotonPropagation",
32  "SimFilters" => "larsim/SimFilters",
33  "Simulation" => "larsim/Simulation",
34  "TriggerAlgo" => "larsim/TriggerAlgo",
35  "EventDisplay" => "lareventdisplay/EventDisplay",
36  "AnalysisExample" => "larexamples/AnalysisExample",
37  "ClusterFinder" => "larreco/ClusterFinder",
38  "DirOfGamma" => "larreco/DirOfGamma",
39  "EventFinder" => "larreco/EventFinder",
40  "Genfit" => "larreco/Genfit",
41  "HitFinder" => "larreco/HitFinder",
42  "MCComp" => "larreco/MCComp",
43  "RecoAlg" => "larreco/RecoAlg",
44  "ShowerFinder" => "larreco/ShowerFinder",
45  "SpacePointFinder" => "larreco/SpacePointFinder",
46  "TrackFinder" => "larreco/TrackFinder",
47  "VertexFinder" => "larreco/VertexFinder",
48  "WireCell" => "larreco/WireCell",
49  "LArPandoraAnalysis" => "larpandora/LArPandoraAnalysis",
50  "LArPandoraInterface" => "larpandora/LArPandoraInterface",
51  "MicroBooNEPandora" => "larpandora/MicroBooNEPandora",
52  "Calorimetry" => "larana/Calorimetry",
53  "CosmicRemoval" => "larana/CosmicRemoval",
54  "OpticalDetector" => "larana/OpticalDetector",
55  "ParticleIdentification" => "larana/ParticleIdentification",
56  "T0Finder" => "larana/T0Finder"
57  ); }
58 
59 # explicit headers to avoid conflicts with experiment code
60 BEGIN { %header_list = (
61  "Utilities/AssociationUtil.h" => "lardata/Utilities/AssociationUtil.h",
62  "Utilities/BulkAllocator.h" => "lardata/Utilities/BulkAllocator.h",
63  "Utilities/ClockConstants.h" => "lardata/Utilities/ClockConstants.h",
64  "Utilities/CountersMap.h" => "lardata/Utilities/CountersMap.h",
65  "Utilities/DatabaseUtil.h" => "lardata/Utilities/DatabaseUtil.h",
66  "Utilities/Dereference.h" => "lardata/Utilities/Dereference.h",
67  "Utilities/DetectorProperties.h" => "lardata/Utilities/DetectorProperties.h",
68  "Utilities/ElecClock.h" => "lardata/Utilities/ElecClock.h",
69  "Utilities/DetectorPropertiesServiceArgoNeuT.h" => "lardata/Utilities/DetectorPropertiesServiceArgoNeuT.h",
70  "Utilities/FastMatrixMathHelper.h" => "lardata/Utilities/FastMatrixMathHelper.h",
71  "Utilities/FileCatalogMetadataExtras.h" => "lardata/Utilities/FileCatalogMetadataExtras.h",
72  "Utilities/GeometryUtilities.h" => "lardata/Utilities/GeometryUtilities.h",
73  "Utilities/LArFFT.h" => "lardata/Utilities/LArFFT.h",
74  "Utilities/LArProperties.h" => "lardata/DetectorInfo/LArProperties.h",
75  "lardata/Utilities/LArProperties.h" => "lardata/DetectorInfo/LArProperties.h",
76  "Utilities/LArPropertiesServiceArgoNeuT.h" => "lardata/Utilities/LArPropertiesServiceArgoNeuT.h",
77  "Utilities/MakeIndex.h" => "lardata/Utilities/MakeIndex.h",
78  "Utilities/NestedIterator.h" => "lardata/Utilities/NestedIterator.h",
79  "Utilities/PxHitConverter.h" => "lardata/Utilities/PxHitConverter.h",
80  "Utilities/PxUtils.h" => "lardata/Utilities/PxUtils.h",
81  "Utilities/Range.h" => "lardata/Utilities/Range.h",
82  "Utilities/SeedCreator.h" => "lardata/Utilities/SeedCreator.h",
83  "Utilities/SignalShaping.h" => "lardata/Utilities/SignalShaping.h",
84  "Utilities/SimpleFits.h" => "lardata/Utilities/SimpleFits.h",
85  "Utilities/SimpleTimeService.h" => "lardata/Utilities/SimpleTimeService.h",
86  "Utilities/sparse_vector.h" => "lardata/Utilities/sparse_vector.h",
87  "Utilities/StatCollector.h" => "lardata/Utilities/StatCollector.h",
88  "Utilities/SumSecondFunction.h" => "lardata/Utilities/SumSecondFunction.h",
89  "Utilities/TimeServiceException.h" => "lardata/Utilities/TimeServiceException.h",
90  "Utilities/TimeService.h" => "lardata/Utilities/TimeService.h",
91  "Utilities/UniqueRangeSet.h" => "lardata/Utilities/UniqueRangeSet.h",
92  "Utilities/UtilException.h" => "lardata/Utilities/UtilException.h",
93  "Utilities/VectorMap.h" => "lardata/Utilities/VectorMap.h",
94  "DetectorInfo/DetectorProperties.h" => "lardata/DetectorInfoServices/DetectorPropertiesService.h",
95  "lardata/DetectorInfo/DetectorProperties.h" => "lardata/DetectorInfoServices/DetectorPropertiesService.h",
96  "DetectorInfo/LArProperties.h" => "lardata/DetectorInfoServices/LArPropertiesService.h",
97  "lardata/DetectorInfo/LArProperties.h" => "lardata/DetectorInfoServices/LArPropertiesService.h"
98  ); }
99 
100 foreach my $inc (sort keys %subdir_list) {
101  s&^(\s*#include\s+["<])\Q$inc\E(/.*)&${1}$subdir_list{$inc}${2}& and last;
102 }
103 foreach my $inc (sort keys %header_list) {
104  s&^(\s*#include\s+["<])\Q$inc\E(.*)&${1}$header_list{$inc}${2}& and last;
105 }