HighLAND
Versioning.hxx
1 #ifndef VERSIONING_HXX_SEEN
2 #define VERSIONING_HXX_SEEN
3 #include "AnalysisTools/libReadoaAnalysis/libReadoaAnalysisProjectHeaders.h"
4 
5 /// This file contains pre-processor directives related to the
6 /// oaAnalysis file format that was used to compile nd280AnalysisTools.
7 /// Depending on the file format, different bits of highland need to
8 /// be conditionally compiled.
9 ///
10 /// nd280AnalysisTools advertises a few low-level directives. This file
11 /// defines higher-level directives (related to specific features that
12 /// are enabled/disabled in each version), to make using the directives
13 /// easier and more transparent.
14 ///
15 /// If you are editing this file, you should make sure that all definitions
16 /// check for the existence of ANATOOLS_FILE_VERSION as the first check.
17 /// This ensures that backwards-compatibility is kept for people with older
18 /// versions of nd280AnalysisTools.
19 ///
20 /// The file version information was only introduced in nd280AnalysisTools
21 /// v1r1. For backwards-compatibility we assume that anyone using an older
22 /// version of nd280AnalysisTools is using a Production 5 file. We also mock
23 /// up some of the definitions we rely on.
24 
25 #if !defined ANATOOLS_FILE_VERSION
26 /// This is just a mockup so that things compile. The real BEFORE_ANATOOLS_FILE
27 /// is found in libReadoaAnalysisProjectHeaders.h in nd280AnalysisTools.
28 /// Having this mockup defined as 1 means that old versions of nd280AnalysisTools
29 /// are assumed to be processing Production 5 files.
30 #define BEFORE_ANATOOLS_FILE(v,r,p) 1
31 
32 /// This is just a mockup so that things compile. The real ANATOOLS_FILE_PROD5
33 /// is found in libReadoaAnalysisProjectHeaders.h in nd280AnalysisTools.
34 /// Having this mockup defined as 1 means that old versions of nd280AnalysisTools
35 /// are assumed to be processing Production 5 files.
36 #define ANATOOLS_FILE_PROD5 1
37 #endif
38 
39 /// For production 6 pre-production files, we need to disable all corrections.
40 #define VERSION_DISABLE_CORRECTIONS VERSION_PROD6PRE
41 
42 /// nd280 version for production 5E is v10r11p17 to v10r11p18
43 #define VERSION_PROD5E (!defined ANATOOLS_FILE_VERSION || ANATOOLS_FILE_PROD5 || (defined ANATOOLS_FILE_VERSION && !BEFORE_ANATOOLS_FILE(10,11,17) && BEFORE_ANATOOLS_FILE(10,11,18)))
44 
45 /// nd280 version for production 5F goes from v10r11p19 to v10r11p23
46 #define VERSION_PROD5F (defined ANATOOLS_FILE_VERSION && !BEFORE_ANATOOLS_FILE(10,11,19) && BEFORE_ANATOOLS_FILE(10,11,27))
47 
48 /// nd280 version for production 5G is v10r11p27
49 #define VERSION_PROD5G (defined ANATOOLS_FILE_VERSION && !BEFORE_ANATOOLS_FILE(10,11,27) && BEFORE_ANATOOLS_FILE(10,11,29))
50 
51 /// nd280 version for pre production 6 goes from v11r17 to v11r27
52 #define VERSION_PROD6PRE (defined ANATOOLS_FILE_VERSION && !BEFORE_ANATOOLS_FILE(11,17,0) && BEFORE_ANATOOLS_FILE(11,29,0))
53 
54 /// nd280 version for Production 6A is v11r29
55 #define VERSION_PROD6A (defined ANATOOLS_FILE_VERSION && !BEFORE_ANATOOLS_FILE(11,29,0) && BEFORE_ANATOOLS_FILE(11,31,0))
56 
57 /// nd280 version for Production 6B is v11r31
58 #define VERSION_PROD6B (defined ANATOOLS_FILE_VERSION && !BEFORE_ANATOOLS_FILE(11,31,0) && BEFORE_ANATOOLS_FILE(11,33,0))
59 
60 /// For production 6 pre-production or production 6A files, we need to disable all production dependent corrections
61 #define VERSION_DISABLE_PROD_CORRECTIONS (VERSION_PROD6PRE || VERSION_PROD6A)
62 
63 /// The B-field distortion refit info changed interface between P5 and P6.
64 /// In P5F, we had Charge, Momentum, Position and Direction saved
65 #define VERSION_HAS_BFIELD_REFIT_FULL VERSION_PROD5F
66 
67 /// In P6, we have only the B-field refit Momentum (and it changed name).
68 #define VERSION_HAS_BFIELD_REFIT_BASIC (defined ANATOOLS_FILE_VERSION && !BEFORE_ANATOOLS_FILE(11,17,0))
69 
70 /// Whether there is any B-field information. Although the momentum name is
71 /// different in P5/P6 oaAnalysis files, we kept the same name in highland.
72 /// Note that there is a gap between P5 and P6 pre-production files where
73 /// no B-field info was saved...
74 #define VERSION_HAS_BFIELD_REFIT (VERSION_HAS_BFIELD_REFIT_FULL || VERSION_HAS_BFIELD_REFIT_BASIC )
75 
76 /// TPC E-field refit information was added in v11r17.
77 #define VERSION_HAS_EFIELD_REFIT (defined ANATOOLS_FILE_VERSION && !BEFORE_ANATOOLS_FILE(11,17,0))
78 
79 /// P5 files didn't store the ECal LLR (PID) variables directly, and they had
80 /// to be calculated using a tool in nd280AnalysisTools. In P6, they are
81 /// stored directly in the oaAnalysis file.
82 #define VERSION_HAS_ECAL_LLR (defined ANATOOLS_FILE_VERSION && !BEFORE_ANATOOLS_FILE(11,0,0))
83 
84 /// P5 files had CT5POT (and needed a correction to use CT4POT for some beam runs). P6 files
85 /// have an OfficalPOT variable.
86 #define VERSION_HAS_OFFICIAL_POT (defined ANATOOLS_FILE_VERSION && !BEFORE_ANATOOLS_FILE(11,17,0))
87 
88 /// P6 files have refits of each global track for electron/muon/proton hypotheses
89 /// in both the forwards and backwards directions.
90 #define VERSION_HAS_REVERSED_REFITS (defined ANATOOLS_FILE_VERSION && !BEFORE_ANATOOLS_FILE(11,17,0))
91 
92 /// P6 files have momentum from range estiamtates for a global track, assuming electron/muon/proton hypotheses
93 /// in both the forwards and backwards directions.
94 #define VERSION_HAS_PRANGE_ESTIMATES (defined ANATOOLS_FILE_VERSION && !BEFORE_ANATOOLS_FILE(11,17,0))
95 
96 /// P6 files have node times updated with t_vs_dist fit results
97 /// independently for each sub-detector
98 #define VERSION_HAS_TIME_FITS (defined ANATOOLS_FILE_VERSION && !BEFORE_ANATOOLS_FILE(11,17,0))
99 
100 /// P6 files have have both vertex (start or entrance) and end (stop or exit) activities
101 /// calculated for FGD tracks
102 #define VERSION_HAS_FGD_VERTEX_AND_END_ACTIVITY (defined ANATOOLS_FILE_VERSION && !BEFORE_ANATOOLS_FILE(11,17,0))
103 
104 /// P6 files use the same method for main track fitting and alternates fitting
105 #define VERSION_HAS_EQUIVALENT_MAIN_AND_ALT_FITS (defined ANATOOLS_FILE_VERSION && !BEFORE_ANATOOLS_FILE(11,17,0))
106 
107 /// For preproduction 6 the number of nodes for TPC objects was 2
108 #define VERSION_HAS_TWO_TPC_NODES VERSION_PROD6PRE
109 
110 /// For production 6 P0D objects got hits/nodes averaged time stamps
111 #define VERSION_HAS_P0D_AVERAGED_TIME (VERSION_PROD6A || VERSION_PROD6B)
112 
113 /// For production 6 FGDTimeBins objects have hit information
114 #define VERSION_HAS_FGDTIMEBIN_ALL_HITS (VERSION_PROD6A || VERSION_PROD6B)
115 
116 /// Production 7 development version
117 #define VERSION_PROD7_DEVEL (defined ANATOOLS_FILE_VERSION && !BEFORE_ANATOOLS_FILE(12,0,0))
118 
119 
120 #endif