cmpFDEvent.cc
Go to the documentation of this file.
1 #include "cmpFDEvent.h"
2 
3 #include <iostream>
4 #include <iomanip>
5 #include <sstream>
6 #include <string>
7 #include <map>
8 
9 #include <TFile.h>
10 #include <TDirectory.h>
11 
12 #include <adst/RecEventFile.h>
13 #include <adst/DetectorGeometry.h>
14 #include <adst/FileInfo.h>
15 #include <adst/RecEvent.h>
16 #include <adst/FDEvent.h>
17 #include <adst/FdRecPixel.h>
18 #include <adst/FdGenGeometry.h>
19 #include <adst/FdGenApertureLight.h>
20 #include <adst/FdRecStation.h>
21 
22 #include "testlib.h"
23 #include "adstReading.h"
24 
25 #define IS(x,prefix) is(test.x, ref.x, prefix"."#x)
26 #define ISDIAG(x,prefix) isDiag(test.x, ref.x, prefix"."#x)
27 #define ISEPSDIAG(x,eps,prefix) isEpsDiag(test.x, ref.x, eps, prefix"."#x)
28 
29 using namespace std;
30 
32 void
33 cmpFDEvent(const FDEvent& ref, const FDEvent& test)
34 {
35  isDiag(test.GetEventClass(), ref.GetEventClass(), "FDEvent.GetEventClass");
36  isDiag(test.GetEventId(), ref.GetEventId(), "FDEvent.GetEventId");
37  isDiag(test.GetEventType(), ref.GetEventType(), "FDEvent.GetEventType");
38  isDiag(test.GetEyeId(), ref.GetEyeId(), "FDEvent.GetEyeId");
39 
40  cmpFDRecAPLight(ref.GetFdRecApertureLight(), test.GetFdRecApertureLight());
41  // GetFdRecApertureLightTel is below
42  cmpFDRecGeometry(ref.GetFdRecGeometry(), test.GetFdRecGeometry());
43  cmpFDRecPixel(ref.GetFdRecPixel(), test.GetFdRecPixel());
44  cmpFDRecShower(ref.GetFdRecShower(), test.GetFdRecShower());
45  cmpFDGenAPLight(ref.GetGenApertureLight(), test.GetGenApertureLight());
46  // GetGenApertureLightTel is below
47  cmpFDGenGeometry(ref.GetGenGeometry(), test.GetGenGeometry());
48  cmpFDGenShower(ref.GetGenShower(), test.GetGenShower());
49 
50  ISDIAG(GetGPSNanoSecond(),"FDEvent");
51  ISDIAG(GetGPSSecond(),"FDEvent");
52  ISDIAG(GetHHMMSS(),"FDEvent");
53  ISDIAG(GetHottestMirrorId(),"FDEvent");
54  ISDIAG(GetMirrorsInEvent(),"FDEvent");
55  ISDIAG(GetMirrorsInEye(),"FDEvent");
56  // GetMirrorTimeOffset is below
57  // GetMirrorTimeOffsets can be skipped
58  ISDIAG(GetMoonCycle(),"FDEvent");
59  ISDIAG(GetRecLevel(),"FDEvent");
60  ISDIAG(GetRunId(),"FDEvent");
61  // GetSdRecGeometry can be skipped
62  // GetStation can be skipped
63  ISDIAG(GetStationVector().size(),"FDEvent");
64  for (unsigned int iStation=0;
65  iStation < min(ref.GetStationVector().size(),test.GetStationVector().size());
66  ++iStation)
67  cmpFDRecStation(test.GetStationVector()[iStation], ref.GetStationVector()[iStation]);
68  ISDIAG(GetT3Azimuth(),"FDEvent");
69  ISDIAG(GetT3NPixels(),"FDEvent");
70  ISDIAG(GetT3SDPTheta(),"FDEvent");
71  ISDIAG(GetT3TimeAtGround(),"FDEvent");
72  // GetTLTLabel is below
73  ISDIAG(GetXmaxInFOVTelId(),"FDEvent");
74  ISDIAG(GetXmaxPixel(),"FDEvent");
75  ISDIAG(GetYYMMDD(),"FDEvent");
76  // HasFdGenApertureLightTel is below
77  // HasFdRecApertureLightTel is below
78  IS(HasT3Reconstruction(),"FDEvent");
79  IS(IsHybridEvent(),"FDEvent");
80  // IsXmaxInTelFOV is below
81  // MirrorIsInEvent is below
82 
83  // loop over telescopes
84  for (unsigned int iTel = 0; iTel < 10; ++iTel) {
85  ostringstream msg;
86  msg << "(" << iTel << ")";
87 
88  if (ref.HasTelescopeData(iTel))
89  {
90  const FdTelescopeData& refT = ref.GetTelescopeData(iTel);
91  if (ok(test.HasTelescopeData(iTel), string("FDEvent.HasTelescopeData")+msg.str()))
92  {
93  const FdTelescopeData& testT = test.GetTelescopeData(iTel);
94  diag(string("Testing FdRecApertureLightTel")+msg.str());
95  cmpFDRecAPLight(refT.GetRecApertureLight(), testT.GetRecApertureLight());
96  is(test.IsXmaxInTelFOV(iTel),ref.IsXmaxInTelFOV(iTel),"FDEvent.IsXmaxInTelFOV"+msg.str());
97  diag(string("Testing GenApertureLightTel")+msg.str());
98  cmpFDGenAPLight(refT.GetGenApertureLight(), testT.GetGenApertureLight());
99  }
100  }
101 
102  if (ref.HasTLT(iTel))
103  {
104  if (ok(test.HasTLT(iTel), "FDEvent.HasTLT"+msg.str()))
105  {
106  isDiag(test.GetTLTLabel(iTel),ref.GetTLTLabel(iTel),"FDEvent.GetTLTLabel"+msg.str());
107  }
108  }
109 
110  if (ref.MirrorIsInEvent(iTel))
111  {
112  if (ok(test.MirrorIsInEvent(iTel), "FDEvent.MirrorIsInEvent"+msg.str()))
113  {
114  isDiag(test.GetMirrorTimeOffset(iTel),ref.GetMirrorTimeOffset(iTel),"FDEvent.GetMirrorTimeOffset"+msg.str());
115  }
116  }
117  }
118 }
119 
120 
122 void
123 cmpFDRecShower(const FdRecShower& ref, const FdRecShower& test)
124 {
125  isDiag(test.GetAngTrackObs(), ref.GetAngTrackObs(), "FdRecShower.GetAngTrackObs");
126  isDiag(test.GetAngularVelocity(), ref.GetAngularVelocity(), "FdRecShower.GetAngularVelocity");
127  isEpsDiag(test.GetCherenkovFraction(), ref.GetCherenkovFraction(), 1.e-8, "FdRecShower.GetCherenkovFraction");
128 
129 //test.GetCombineddEdXProfile()
130 
131  isEpsDiag(test.GetCoreXmaxDist(), ref.GetCoreXmaxDist(), 1.e-6, "FdRecShower.GetCoreXmaxDist");
132  isEpsDiag(test.GetCoreEastingError(), ref.GetCoreEastingError(), 1.e-6, "FdRecShower.GetCoreEastingError");
133  isEpsDiag(test.GetCoreNorthingEastingCorrelation(), ref.GetCoreNorthingEastingCorrelation(), 1.e-6, "FdRecShower.GetCoreNorthingEastingCorrelation");
134  isEpsDiag(test.GetCoreNorthingError(), ref.GetCoreNorthingError(), 1.e-5, "FdRecShower.GetCoreNorthingError");
135  isEpsDiag(test.GetCosZenithError(), ref.GetCosZenithError(), 1.e-8, "FdRecShower.GetCosZenithError");
136  isEpsDiag(test.GetCoreSiteCS(), ref.GetCoreSiteCS(), 1e-7, "FdRecShower.GetCoreSiteCS");
137  isDiag(test.GetCoreTimeNanoSecond(), ref.GetCoreTimeNanoSecond(), "FdRecShower.GetCoreTimeNanoSecond");
138  isDiag(test.GetCoreTimeSecond(), ref.GetCoreTimeSecond(), "FdRecShower.GetCoreTimeSecond");
139  isEpsDiag(test.GetCoreUTMCS(), ref.GetCoreUTMCS(), 1e-7, "FdRecShower.GetCoreUTMCS");
140  isEpsDiag(test.GetCosZenith(), ref.GetCosZenith(), 1.e-9, "FdRecShower.GetCosZenith");
141 
142  isRelEpsDiag(test.GetDepth(), ref.GetDepth(), 1.e-7, "FdRecShower.GetDepth");
143  isRelEpsDiag(test.GetDepthError(), ref.GetDepthError(), 1.e-7, "FdRecShower.GetDepthError");
144  isRelEpsDiag(test.GetElectrons(), ref.GetElectrons(), 1.e-6, "FdRecShower.GetElectrons");
145  isRelEpsDiag(test.GetElectronsError(), ref.GetElectronsError(), 1.e-8, "FdRecShower.GetElectronsError");
146  isRelEpsDiag(test.GetEnergyDeposit(), ref.GetEnergyDeposit(), 1.e-7, "FdRecShower.GetEnergyDeposit");
147  isRelEpsDiag(test.GetEnergyDepositError(), ref.GetEnergyDepositError(), 1.e-7, "FdRecShower.GetEnergyDepositError");
148 
149  isDiag(test.GetDepthVelocity(), ref.GetDepthVelocity(), "FdRecShower.GetDepthVelocity");
150  isEpsDiag(test.GetDistXmax(), ref.GetDistXmax(), 1.e-6, "FdRecShower.GetDistXmax");
151 
152  // GH fit
153  isRelEpsDiag(test.GetGHChi2(), ref.GetGHChi2(), 1.e-7, "FdRecShower.GetGHChi2");
154  isDiag(test.GetGHNdf(), ref.GetGHNdf(), "FdRecShower.GetGHNdf");
155  isRelEpsDiag(test.GetX0(), ref.GetX0(), 1.e-7, "FdRecShower.GetX0");
156  isRelEpsDiag(test.GetX0Error(), ref.GetX0Error(), 1.e-7, "FdRecShower.GetX0Error");
157  isRelEpsDiag(test.GetXmax(), ref.GetXmax(), 1.e-7, "FdRecShower.GetXmax");
158  isRelEpsDiag(test.GetXmaxError(), ref.GetXmaxError(), 1.e-7, "FdRecShower.GetXmaxError");
159  isRelEpsDiag(test.GetXmaxChi(), ref.GetXmaxChi(), 1.e-7, "FdRecShower.GetXmaxChi");
160  isRelEpsDiag(test.GetXmaxChiError(), ref.GetXmaxChiError(), 1.e-7, "FdRecShower.GetXmaxChiError");
161  isRelEpsDiag(test.GetLambda(), ref.GetLambda(), 1.e-7, "FdRecShower.GetLambda");
162  isRelEpsDiag(test.GetLambdaError(), ref.GetLambdaError(), 1.e-7, "FdRecShower.GetLambdaError");
163  isRelEpsDiag(test.GetdEdXmax(), ref.GetdEdXmax(), 1.e-7, "FdRecShower.GetdEdXmax");
164  isRelEpsDiag(test.GetdEdXmaxError(), ref.GetdEdXmaxError(), 1.e-7, "FdRecShower.GetdEdXmaxError");
165 
166  isRelEpsDiag(test.GetHeight(), ref.GetHeight(), 1.e-7, "FdRecShower.GetHeight");
167  isRelEpsDiag(test.GetHeightXmax(), ref.GetHeightXmax(), 1.e-7, "FdRecShower.GetHeightXmax");
168 
169  isDiag(test.GetMaxAngle(), ref.GetMaxAngle(), "FdRecShower.GetMaxAngle");
170  isDiag(test.GetMeanAngle(), ref.GetMeanAngle(), "FdRecShower.GetMeanAngle");
171  isDiag(test.GetMinAngle(), ref.GetMinAngle(), "FdRecShower.GetMinAngle");
172  isEpsDiag(test.GetMinViewingAngles(), ref.GetMinViewingAngles(), 1.e-12, "FdRecShower.GetMinViewingAngles");
173 
174  isEpsDiag(test.GetMieAttXmax(), ref.GetMieAttXmax(), 1.e-9, "FdRecShower.GetMieAttXmax");
175  isEpsDiag(test.GetAttXmax(), ref.GetAttXmax(), 1.e-9, "FdRecShower.GetAttXmax");
176  isEpsDiag(test.GetMieCorrection(), ref.GetMieCorrection(), 1.e-9, "FdRecShower.GetMieCorrection");
177  isEpsDiag(test.GetRayleighAttXmax(), ref.GetRayleighAttXmax(), 1.e-9, "FdRecShower.GetRayleighAttXmax");
178  isEpsDiag(test.GetRayleighCorrection(), ref.GetRayleighCorrection(), 1.e-9, "FdRecShower.GetRayleighCorrection");
179  isDiag(test.GetShowerAge(), ref.GetShowerAge(), "FdRecShower.GetShowerAge");
180  isDiag(test.GetTimTrackObs(), ref.GetTimTrackObs(), "FdRecShower.GetTimTrackObs");
181  isRelEpsDiag(test.GetTrackLength(), ref.GetTrackLength(), 1e-7, "FdRecShower.GetTrackLength");
182  isRelEpsDiag(test.GetTrackLengthFOV(), ref.GetTrackLengthFOV(), 1.e-9, "FdRecShower.GetTrackLengthFOV");
183  isRelEpsDiag(test.GetX1(), ref.GetX1(), 1e-7, "FdRecShower.GetX1");
184  isRelEpsDiag(test.GetX1Chi(), ref.GetX1Chi(), 1e-7, "FdRecShower.GetX1Chi");
185  isRelEpsDiag(test.GetX1ChiError(), ref.GetX1ChiError(), 1e-7, "FdRecShower.GetX1ChiError");
186  isRelEpsDiag(test.GetX1Error(), ref.GetX1Error(), 1e-7, "FdRecShower.GetX1Error");
187 
188  isRelEpsDiag(test.GetXFOVMax(), ref.GetXFOVMax(), 1.e-7, "FdRecShower.GetXFOVMax");
189  isRelEpsDiag(test.GetXFOVMin(), ref.GetXFOVMin(), 1.e-7, "FdRecShower.GetXFOVMin");
190  isRelEpsDiag(test.GetXTrackMax(), ref.GetXTrackMax(), 1.e-7, "FdRecShower.GetXTrackMax");
191  isRelEpsDiag(test.GetXTrackMin(), ref.GetXTrackMin(), 1.e-7, "FdRecShower.GetXTrackMin");
192  isRelEpsDiag(test.GetXTrackMinChi(), ref.GetXTrackMinChi(), 1.e-7, "FdRecShower.GetXTrackMinChi");
193  isRelEpsDiag(test.GetZVector(), ref.GetZVector(), 1.e-7, "FdRecShower.GetZVector");
194  isRelEpsDiag(test.GetZXmax(), ref.GetZXmax(), 1.e-7, "FdRecShower.GetZXmax");
195 
196  isEpsDiag(test.GetAxisCoreCS(), ref.GetAxisCoreCS(), 1.e-7, "FdRecShower.GetAxisCoreCS");
197  isEpsDiag(test.GetAxisSiteCS(), ref.GetAxisSiteCS(), 1.e-7, "FdRecShower.GetAxisSiteCS");
198  isRelEpsDiag(test.GetAzimuth(), ref.GetAzimuth(), 1.e-9, "FdRecShower.GetAzimuth");
199  isRelEpsDiag(test.GetAzimuthError(), ref.GetAzimuthError(), 1.e-9, "FdRecShower.GetAzimuthError");
200  isRelEpsDiag(test.GetZenith(), ref.GetZenith(), 1.e-9, "FdRecShower.GetZenith");
201  isRelEpsDiag(test.GetZenithError(), ref.GetZenithError(), 1.e-9, "FdRecShower.GetZenithError");
202  isRelEpsDiag(test.GetZenithAzimuthCorrelation(), ref.GetZenithAzimuthCorrelation(), 1.e-9, "FdRecShower.GetZenithAzimuthCorrelation");
203 
204  isRelEpsDiag(test.GetGalacticLatitudeError(), ref.GetGalacticLatitudeError(), 1.e-7, "FdRecShower.GetGalacticLatitudeError");
205  isRelEpsDiag(test.GetGalacticLatitude(), ref.GetGalacticLatitude(), 1.e-7, "FdRecShower.GetGalacticLatitude");
206  isRelEpsDiag(test.GetGalacticLongitude(), ref.GetGalacticLongitude(), 1.e-7, "FdRecShower.GetGalacticLongitude");
207  isRelEpsDiag(test.GetGalacticLongitudeError(), ref.GetGalacticLongitudeError(), 1.e-7, "FdRecShower.GetGalacticLongitudeError");
208  isRelEpsDiag(test.GetLongLatCorrelation(), ref.GetLongLatCorrelation(), 1.e-7, "FdRecShower.GetLongLatCorrelation");
209  isRelEpsDiag(test.GetDeclinationError(), ref.GetDeclinationError(), 1.e-7, "FdRecShower.GetDeclinationError");
210  isRelEpsDiag(test.GetDeclination(), ref.GetDeclination(), 1.e-7, "FdRecShower.GetDeclination");
211  isRelEpsDiag(test.GetRDCorrelation(), ref.GetRDCorrelation(), 1.e-7, "FdRecShower.GetRDCorrelation");
212  isRelEpsDiag(test.GetRightAscension(), ref.GetRightAscension(), 1.e-7, "FdRecShower.GetRightAscension");
213  isRelEpsDiag(test.GetRightAscensionError(), ref.GetRightAscensionError(), 1.e-7, "FdRecShower.GetRightAscensionError");
214 
215  isRelEpsDiag(test.GetLinearProfileFitChi2(), ref.GetLinearProfileFitChi2(), 1.e-7, "FdRecShower.GetLinearProfileFitChi2");
216 
217  isRelEpsDiag(test.GetCalorimetricEnergy(), ref.GetCalorimetricEnergy(), 1.e-7, "FdRecShower.GetCalorimetricEnergy");
218  isRelEpsDiag(test.GetCalorimetricEnergyError(), ref.GetCalorimetricEnergyError(), 1.e-7, "FdRecShower.GetCalorimetricEnergyError");
219  isRelEpsDiag(test.GetEnergyAtmError(), ref.GetEnergyAtmError(), 1.e-7, "FdRecShower.GetEnergyAtmError");
220  isRelEpsDiag(test.GetEnergyError(), ref.GetEnergyError(), 1.e-7, "FdRecShower.GetEnergyError");
221  isRelEpsDiag(test.GetEnergy(), ref.GetEnergy(), 1.e-7, "FdRecShower.GetEnergy");
222 }
223 
225 void
226 cmpFDRecGeometry(const FdRecGeometry& ref, const FdRecGeometry& test)
227 {
228  // SDP
229  isDiag(test.GetSDPChi2(), ref.GetSDPChi2(), "FdRecGeo.GetSDPChi2");
230  isDiag(test.GetSDPNdF(), ref.GetSDPNdF(), "FdRecGeo.GetSDPNdF");
231  isDiag(test.GetSDPPhiError(), ref.GetSDPPhiError(), "FdRecGeo.GetSDPPhiError");
232  isDiag(test.GetSDPPhi(), ref.GetSDPPhi(), "FdRecGeo.GetSDPPhi");
233  isDiag(test.GetSDPTheta(), ref.GetSDPTheta(), "FdRecGeo.GetSDPTheta");
234  isDiag(test.GetSDPThetaError(), ref.GetSDPThetaError(), "FdRecGeo.GetSDPThetaError");
235  isDiag(test.GetSDPThetaPhiCorrelation(), ref.GetSDPThetaPhiCorrelation(), "FdRecGeo.GetSDPThetaPhiCorrelation");
236  is(test.GetSDP(), ref.GetSDP(), "FdRecGeo.GetSDP");
237 
238  isDiag(test.GetChi0(), ref.GetChi0(), "FdRecGeo.GetChi0");
239  isDiag(test.GetChi0Error(), ref.GetChi0Error(), "FdRecGeo.GetChi0Error");
240  isDiag(test.GetRp(), ref.GetRp(), "FdRecGeo.GetRp");
241  isDiag(test.GetRpError(), ref.GetRpError(), "FdRecGeo.GetRpError");
242  isDiag(test.GetT0Error(), ref.GetT0Error(), "FdRecGeo.GetT0Error");
243  isDiag(test.GetT0(), ref.GetT0(), "FdRecGeo.GetT0");
244  isDiag(test.GetRpT0Correlation(), ref.GetRpT0Correlation(), "FdRecGeo.GetRpT0Correlation");
245  isDiag(test.GetChi0RpCorrelation(), ref.GetChi0RpCorrelation(), "FdRecGeo.GetChi0RpCorrelation");
246  isDiag(test.GetChi0T0Correlation(), ref.GetChi0T0Correlation(), "FdRecGeo.GetChi0T0Correlation");
247  isRelEpsDiag(test.GetTimeFitChi2(), ref.GetTimeFitChi2(), 1.e-7, "FdRecGeo.GetTimeFitChi2");
248  isEpsDiag(test.GetTimeFitFDChi2(), ref.GetTimeFitFDChi2(), 1.e-6, "FdRecGeo.GetTimeFitFDChi2");
249  isDiag(test.GetTimeFitNdof(), ref.GetTimeFitNdof(), "FdRecGeo.GetTimeFitNdof");
250 
251  isRelEpsDiag(test.GetCoreEyeDistanceError(), ref.GetCoreEyeDistanceError(), 1.e-7, "FdRecGeo.GetCoreEyeDistanceError");
252  isRelEpsDiag(test.GetCoreEyeDistance(), ref.GetCoreEyeDistance(), 1.e-7, "FdRecGeo.GetCoreEyeDistance");
253 
254  isDiag(test.GetHottestStation(), ref.GetHottestStation(), "FdRecGeo.GetHottestStation");
255  isDiag(test.GetNHybridStations(), ref.GetNHybridStations(), "FdRecGeo.GetNHybridStations");
256  isRelEpsDiag(test.GetSDFDTimeOffset(), ref.GetSDFDTimeOffset(), 1.e-7, "FdRecGeo.GetSDFDTimeOffset");
257  isRelEpsDiag(test.GetStationAxisDistance(), ref.GetStationAxisDistance(), 1.e-7, "FdRecGeo.GetStationAxisDistance");
258  isRelEpsDiag(test.GetStationSDPDistance(), ref.GetStationSDPDistance(), 1.e-7, "FdRecGeo.GetStationSDPDistance");
259 
260  isRelEpsDiag(test.GetLinearTimeFitChi2(), ref.GetLinearTimeFitChi2(), 1.e-7, "FdRecGeo.GetLinearTimeFitChi2");
261 }
262 
264 void
265 cmpFDRecAPLight(const FdRecApertureLight& ref, const FdRecApertureLight& test)
266 {
267  isDiag(test.GetCherLightCollEfficiency(), ref.GetCherLightCollEfficiency(), "FdRecApertureLight.GetCherLightCollEfficiency");
268  isDiag(test.GetCherLightCollEfficiencyErrors(), ref.GetCherLightCollEfficiencyErrors(), "FdRecApertureLight.GetCherLightCollEfficiencyErrors");
269  isDiag(test.GetFluorLightCollEfficiency(), ref.GetFluorLightCollEfficiency(), "FdRecApertureLight.GetFluorLightCollEfficiency");
270  isDiag(test.GetFluorLightCollEfficiencyErrors(), ref.GetFluorLightCollEfficiencyErrors(), "FdRecApertureLight.GetFluorLightCollEfficiencyErrors");
271  isDiag(test.GetMieCherLightCollEfficiency(), ref.GetMieCherLightCollEfficiency(), "FdRecApertureLight.GetMieCherLightCollEfficiency");
272  isDiag(test.GetMieCherLightCollEfficiencyErrors(), ref.GetMieCherLightCollEfficiencyErrors(), "FdRecApertureLight.GetMieCherLightCollEfficiencyErrors");
273  isDiag(test.GetRayCherLightCollEfficiency(), ref.GetRayCherLightCollEfficiency(), "FdRecApertureLight.GetRayCherLightCollEfficiency");
274  isDiag(test.GetRayCherLightCollEfficiencyErrors(), ref.GetRayCherLightCollEfficiencyErrors(), "FdRecApertureLight.GetRayCherLightCollEfficiencyErrors");
275  isDiag(test.GetTimeError(), ref.GetTimeError(), "FdRecApertureLight.GetTimeError");
276  isDiag(test.GetTotalLightAtApertureError(), ref.GetTotalLightAtApertureError(), "FdRecApertureLight.GetTotalLightAtApertureError");
277  isDiag(test.GetTotalLightIntegral(), ref.GetTotalLightIntegral(), "FdRecApertureLight.GetTotalLightIntegral");
278  isDiag(test.GetTotalLightIntegralError(), ref.GetTotalLightIntegralError(), "FdRecApertureLight.GetTotalLightIntegralError");
279  isDiag(test.GetZeta(), ref.GetZeta(), "FdRecApertureLight.GetZeta");
280  isEpsDiag(test.GetCherLightAtAperture(), ref.GetCherLightAtAperture(), 1.e-5, "FdRecApertureLight.GetCherLightAtAperture");
281  isEpsDiag(test.GetFluorLightAtAperture(), ref.GetFluorLightAtAperture(), 1.e-5, "FdRecApertureLight.GetFluorLightAtAperture");
282  isEpsDiag(test.GetMieCherLightAtAperture(), ref.GetMieCherLightAtAperture(), 1.e-5, "FdRecApertureLight.GetMieCherLightAtAperture");
283  isEpsDiag(test.GetMultScatCherLightAtAperture(), ref.GetMultScatCherLightAtAperture(), 1.e-5, "FdRecApertureLight.GetMultScatCherLightAtAperture");
284  isEpsDiag(test.GetMultScatFluorLightAtAperture(), ref.GetMultScatFluorLightAtAperture(), 1.e-5, "FdRecApertureLight.GetMultScatFluorLightAtAperture");
285  isDiag(test.GetNumberTimePoints(), ref.GetNumberTimePoints(), "FdRecApertureLight.GetNumberTimePoints");
286  isEpsDiag(test.GetRayCherLightAtAperture(), ref.GetRayCherLightAtAperture(), 1.e-6, "FdRecApertureLight.GetRayCherLightAtAperture");
287  isDiag(test.GetTotalLightAtAperture(), ref.GetTotalLightAtAperture(), "FdRecApertureLight.GetTotalLightAtAperture");
288  isDiag(test.GetTime(), ref.GetTime(), "FdRecApertureLight.GetTime");
289 }
290 
292 void
293 cmpFDGenAPLight(const FdGenApertureLight& ref, const FdGenApertureLight& test)
294 {
295  ISDIAG(GetCherLightAtAperture(), "FdGenAperture");
296  ISDIAG(GetFluorLightAtAperture(), "FdGenAperture");
297  // GetLightFluxSum can be skipped
298  // GetLightFluxSumVector can be skipped
299  ISEPSDIAG(GetLightFraction(FdApertureLight::eUnknown), 1.e-8, "FdGenAperture");
300  ISEPSDIAG(GetLightFraction(FdApertureLight::eTotalCherenkov), 1.e-8, "FdGenAperture");
301  ISEPSDIAG(GetLightFraction(FdApertureLight::eDirect), 1.e-8, "FdGenAperture");
302  ISEPSDIAG(GetLightFraction(FdApertureLight::eMie), 1.e-8, "FdGenAperture");
303  ISEPSDIAG(GetLightFraction(FdApertureLight::eRayleigh), 1.e-8, "FdGenAperture");
304  ISEPSDIAG(GetLightFraction(FdApertureLight::eScattered), 1.e-8, "FdGenAperture");
305  ISEPSDIAG(GetLightFraction(FdApertureLight::eFluorescence), 1.e-8, "FdGenAperture");
306  ISDIAG(GetMieCherLightAtAperture(), "FdGenAperture");
307  ISDIAG(GetMultScatCherLightAtAperture(), "FdGenAperture");
308  ISDIAG(GetMultScatFluorLightAtAperture(), "FdGenAperture");
309  ISDIAG(GetNumberTimePoints(),"FdGenAperture");
310  ISDIAG(GetRayCherLightAtAperture(),"FdGenAperture");
311  ISDIAG(GetTime(),"FdGenAperture");
312  ISDIAG(GetTotalLightAtAperture(),"FdGenAperture");
313  IS(HasMultipleScatteredLight(),"FdGenAperture");
314 }
315 
317 void
318 cmpFDRecPixel(const FdRecPixel& ref, const FdRecPixel& test)
319 {
320  // GetCalibrationConstant is below
321  // GetCharge(i) can be skipped
322  ISDIAG(GetCharge(),"FdRecPixel");
323  // GetChi(i) can be skipped
324  ISDIAG(GetChi(),"FdRecPixel");
325  // GetID(i) can be skipped
326  ISDIAG(GetID(),"FdRecPixel");
327  ISDIAG(GetMeanADCRMS(),"FdRecPixel");
328  ISDIAG(GetMeanPixelRMS(),"FdRecPixel");
329  ISDIAG(GetMeanThreshold(),"FdRecPixel");
330  // GetNumberOfPixels is below
331  ISDIAG(GetNumberOfPulsedPixels(),"FdRecPixel");
332  ISDIAG(GetNumberOfSDPFitPixels(),"FdRecPixel");
333  ISDIAG(GetNumberOfSpotTracePixels(),"FdRecPixel");
334  ISDIAG(GetNumberOfTimeFitPixels(),"FdRecPixel");
335  ISDIAG(GetNumberOfTracePixels(),"FdRecPixel");
336  ISDIAG(GetNumberOfTriggeredPixels(),"FdRecPixel");
337  // GetPixelId is below
338  // GetPulseStart is below
339  // GetPulseStop is below
340  // GetRMS is below
341  // GetSimTrace is below
342  // GetSimTraceOffset is below
343  // GetSpotRecTrace is below
344  // GetSpotRecTraceMax can be skipped
345  // GetSpotRecTraceSum can be skipped
346  // GetStatus(i) can be skipped
347  ISDIAG(GetStatus(),"FdRecPixel");
348  // GetTelescopeId is below
349  // GetThreshold is below
350  // GetTime(i) can be skipped
351  ISDIAG(GetTime(),"FdRecPixel");
352  // GetTimeErr(i) can be skipped
353  ISDIAG(GetTimeErr(),"FdRecPixel");
354  // GetTrace is below
355  // GetTraceMax can be skipped
356  // GetTraces can be skipped
357  // GetTraceSum can be skipped
358  // HasADCTrace is below
359  ISDIAG(HasHighGainSaturatedPixels(),"FdRecPixel");
360  ISDIAG(HasLowGainSaturatedPixels(),"FdRecPixel");
361  ISDIAG(HasSaturationRecoveredPixels(),"FdRecPixel");
362  // HasSimTrace is below
363  // HasSpotRecADCTrace is below
364 
365  ISDIAG(GetNumberOfPixels(),"FdRecPixel");
366  unsigned int size = min(ref.GetNumberOfPixels(),test.GetNumberOfPixels());
367  for (unsigned int i=0;i<size;++i)
368  {
369  ISDIAG(GetCalibrationConstant(i),"FdRecPixel");
370  ISDIAG(GetPixelId(i),"FdRecPixel");
371  ISDIAG(GetTelescopeId(i),"FdRecPixel");
372  ISDIAG(GetThreshold(i),"FdRecPixel");
373  ISDIAG(GetPulseStart(i),"FdRecPixel");
374  ISDIAG(GetPulseStop(i),"FdRecPixel");
375  ISDIAG(GetRMS(i),"FdRecPixel");
376 
377  if (ref.HasSimTrace(i,FdApertureLight::eUnknown))
378  if (ok(test.HasSimTrace(i,FdApertureLight::eUnknown)),"FdRecPixel.HasSimTrace(eUnknown)")
379  ISDIAG(GetSimTrace(i,FdApertureLight::eUnknown),"FdRecPixel");
380  if (ref.HasSimTrace(i,FdApertureLight::eTotalCherenkov))
381  if (ok(test.HasSimTrace(i,FdApertureLight::eTotalCherenkov)),"FdRecPixel.HasSimTrace(eTotalCherenkov)")
382  ISDIAG(GetSimTrace(i,FdApertureLight::eTotalCherenkov),"FdRecPixel");
383  if (ref.HasSimTrace(i,FdApertureLight::eDirect))
384  if (ok(test.HasSimTrace(i,FdApertureLight::eDirect)),"FdRecPixel.HasSimTrace(eDirect)")
385  ISDIAG(GetSimTrace(i,FdApertureLight::eDirect),"FdRecPixel");
386  if (ref.HasSimTrace(i,FdApertureLight::eMie))
387  if (ok(test.HasSimTrace(i,FdApertureLight::eMie)),"FdRecPixel.HasSimTrace(eMie)")
388  ISDIAG(GetSimTrace(i,FdApertureLight::eMie),"FdRecPixel");
389  if (ref.HasSimTrace(i,FdApertureLight::eRayleigh))
390  if (ok(test.HasSimTrace(i,FdApertureLight::eRayleigh)),"FdRecPixel.HasSimTrace(eRayleigh)")
391  ISDIAG(GetSimTrace(i,FdApertureLight::eRayleigh),"FdRecPixel");
392  if (ref.HasSimTrace(i,FdApertureLight::eScattered))
393  if (ok(test.HasSimTrace(i,FdApertureLight::eScattered)),"FdRecPixel.HasSimTrace(eScattered)")
394  ISDIAG(GetSimTrace(i,FdApertureLight::eScattered),"FdRecPixel");
395  if (ref.HasSimTrace(i,FdApertureLight::eFluorescence))
396  if (ok(test.HasSimTrace(i,FdApertureLight::eFluorescence)),"FdRecPixel.HasSimTrace(eFluorescence)")
397  ISDIAG(GetSimTrace(i,FdApertureLight::eFluorescence),"FdRecPixel");
398 
399  if (ref.HasADCTrace(i) && ok(test.HasADCTrace(i),"FdRecPixel.HasADCTrace"))
400  {
401  ISDIAG(GetTrace(i),"FdRecPixel");
402  ISDIAG(IsHighGainSaturated(i),"FdRecPixel");
403  ISDIAG(IsLowGainSaturated(i),"FdRecPixel");
404  ISDIAG(IsSaturationRecovered(i),"FdRecPixel");
405  }
406  else {
407  ok(!test.HasADCTrace(i), "!FdRecPixel.HasADCTrace (reference doesn't have one)");
408  }
409 
410  if (ref.HasSpotRecADCTrace(i) && ok(test.HasSpotRecADCTrace(i),"FdRecPixel.HasSpotRecADCTrace"))
411  {
412  ISDIAG(GetSpotRecTrace(i),"FdRecPixel");
413  }
414  else {
415  ok(!test.HasSpotRecADCTrace(i), "!FdRecPixel.HasSpotRecADCTrace (reference doesn't have one)");
416  }
417 
418  ISDIAG(GetSimTraceOffset(i),"FdRecPixel");
419  ISDIAG(GetStatus(i),"FdRecPixel");
420  }
421 }
422 
424 void
425 cmpFDGenGeometry(const FdGenGeometry& ref, const FdGenGeometry& test)
426 {
427 }
428 
430 void
431 cmpFDGenShower(const FdGenShower& ref, const FdGenShower& test)
432 {
433 }
434 
436 void
437 cmpFDRecStation(const FdRecStation& ref, const FdRecStation& test)
438 {
439 }
double GetCalibrationConstant(const fevt::Pixel &evtpixel)
Fetches the calibration constant for the given pixel.
Definition: FD2ADSTUtil.cc:302
bool is(const double a, const double b)
Definition: testlib.cc:113
void diag(const std::string &msg)
Definition: testlib.cc:59
bool ok(bool okay)
Definition: testlib.cc:89
bool isRelEpsDiag(const double a, const double b, const double thisEps, const std::string &name)
Definition: testlib.cc:240
void cmpFDRecAPLight(const FdRecApertureLight &ref, const FdRecApertureLight &test)
Definition: cmpFDEvent.cc:265
void cmpFDGenShower(const FdGenShower &ref, const FdGenShower &test)
Definition: cmpFDEvent.cc:431
void cmpFDEvent(const FDEvent &ref, const FDEvent &test)
Definition: cmpFDEvent.cc:33
bool isEpsDiag(const double a, const double b, const double thisEps, const std::string &name)
Definition: testlib.cc:210
void cmpFDRecPixel(const FdRecPixel &ref, const FdRecPixel &test)
Definition: cmpFDEvent.cc:318
void cmpFDRecGeometry(const FdRecGeometry &ref, const FdRecGeometry &test)
Definition: cmpFDEvent.cc:226
#define ISEPSDIAG(x, eps, prefix)
Definition: cmpFDEvent.cc:27
void cmpFDGenGeometry(const FdGenGeometry &ref, const FdGenGeometry &test)
Definition: cmpFDEvent.cc:425
bool isDiag(const double a, const double b, const std::string &name)
Definition: testlib.cc:232
#define ISDIAG(x, prefix)
Definition: cmpFDEvent.cc:26
void cmpFDRecStation(const FdRecStation &ref, const FdRecStation &test)
Definition: cmpFDEvent.cc:437
void cmpFDRecShower(const FdRecShower &ref, const FdRecShower &test)
Definition: cmpFDEvent.cc:123
void cmpFDGenAPLight(const FdGenApertureLight &ref, const FdGenApertureLight &test)
Definition: cmpFDEvent.cc:293
#define IS(x, prefix)
Definition: cmpFDEvent.cc:25

, generated on Tue Sep 26 2023.