Skip to content

Commit 8751df4

Browse files
authored
Merge pull request #336 from VERITAS-Observatory/v492-13-mva-gh
v492 13 mva g/h separation
2 parents 2d34f15 + 8a668ad commit 8751df4

18 files changed

+266
-860
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2022-2025 Eventdisplay Developers
3+
Copyright (c) 2022-2026 Eventdisplay Developers
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

Makefile

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ all VTS: evndisp \
226226
VTS.getRunListFromDB \
227227
VTS.getLaserRunFromDB \
228228
VTS.getRun_TimeElevAzim \
229-
writeParticleRateFilesForTMVA \
230229
writelaserinDB \
231230
logFile \
232231
printCrabSensitivity \
@@ -1060,60 +1059,6 @@ writeVTSWPPhysSensitivityFiles: $(WRITEVTSPHYSOBJ)
10601059
$(LD) $(LDFLAGS) $^ $(GLIBS) $(OutPutOpt) ./bin/$@
10611060
@echo "$@ done"
10621061

1063-
########################################################
1064-
# writeParticleRateFilesForTMVA
1065-
########################################################
1066-
WRITEPARTPHYSOBJ= ./obj/writeParticleRateFilesForTMVA.o \
1067-
./obj/VGlobalRunParameter.o ./obj/VGlobalRunParameter_Dict.o \
1068-
./obj/CRunSummary.o ./obj/CRunSummary_Dict.o \
1069-
./obj/VAstronometry.o ./obj/VAstronometry_Dict.o \
1070-
./obj/VInstrumentResponseFunctionReader.o ./obj/VInstrumentResponseFunctionReader_Dict.o \
1071-
./obj/VSensitivityCalculator.o ./obj/VSensitivityCalculator_Dict.o \
1072-
./obj/CEffArea.o ./obj/CEffArea_Dict.o \
1073-
./obj/VAnalysisUtilities.o ./obj/VAnalysisUtilities_Dict.o \
1074-
./obj/VHistogramUtilities.o ./obj/VHistogramUtilities_Dict.o \
1075-
./obj/VInstrumentResponseFunctionData.o ./obj/VInstrumentResponseFunctionData_Dict.o \
1076-
./obj/VPlotUtilities.o ./obj/VPlotUtilities_Dict.o \
1077-
./obj/VGammaHadronCuts.o ./obj/VGammaHadronCuts_Dict.o \
1078-
./obj/VGammaHadronCutsStatistics.o ./obj/VGammaHadronCutsStatistics_Dict.o \
1079-
./obj/VTMVAEvaluator.o ./obj/VTMVAEvaluator_Dict.o \
1080-
./obj/VTMVARunDataEnergyCut.o ./obj/VTMVARunDataEnergyCut_Dict.o \
1081-
./obj/VTMVARunDataZenithCut.o ./obj/VTMVARunDataZenithCut_Dict.o \
1082-
./obj/VInstrumentResponseFunctionRunParameter.o ./obj/VInstrumentResponseFunctionRunParameter_Dict.o \
1083-
./obj/Ctelconfig.o ./obj/CData.o \
1084-
./obj/VTMVADispAnalyzer.o ./obj/VMeanScaledVariables.o \
1085-
./obj/VDispAnalyzer.o ./obj/VDispTableReader.o ./obj/VDispTableReader_Dict.o ./obj/VDispTableAnalyzer.o \
1086-
./obj/VEmissionHeightCalculator.o ./obj/VSimpleStereoReconstructor.o ./obj/VGrIsuAnalyzer.o \
1087-
./obj/VSpectralFitter.o ./obj/VSpectralFitter_Dict.o \
1088-
./obj/VEnergyThreshold.o ./obj/VEnergyThreshold_Dict.o \
1089-
./obj/VRunList.o ./obj/VRunList_Dict.o \
1090-
./obj/VEnergySpectrumfromLiterature.o ./obj/VEnergySpectrumfromLiterature_Dict.o \
1091-
./obj/VEnergySpectrum.o ./obj/VEnergySpectrum_Dict.o \
1092-
./obj/VMathsandFunctions.o ./obj/VMathsandFunctions_Dict.o \
1093-
./obj/VDifferentialFlux.o ./obj/VDifferentialFlux_Dict.o \
1094-
./obj/VMonteCarloRateCalculator.o ./obj/VMonteCarloRateCalculator_Dict.o \
1095-
./obj/VMonteCarloRunHeader.o ./obj/VMonteCarloRunHeader_Dict.o \
1096-
./obj/VStatistics_Dict.o \
1097-
./obj/VEvndispRunParameter.o ./obj/VEvndispRunParameter_Dict.o \
1098-
./obj/VSkyCoordinatesUtilities.o \
1099-
./obj/VTimeMask.o ./obj/VTimeMask_Dict.o \
1100-
./obj/VAnaSumRunParameter.o ./obj/VAnaSumRunParameter_Dict.o \
1101-
./obj/VImageCleaningRunParameter.o ./obj/VImageCleaningRunParameter_Dict.o \
1102-
./obj/VDispAnalyzer.o ./obj/VDispTableReader.o ./obj/VDispTableReader_Dict.o ./obj/VDispTableAnalyzer.o \
1103-
./obj/VTMVADispAnalyzer.o \
1104-
./obj/VUtilities.o
1105-
1106-
ifeq ($(ASTRONMETRY),-DASTROSLALIB)
1107-
WRITECTAPHYSOBJ += ./obj/VASlalib.o
1108-
endif
1109-
1110-
./obj/writeParticleRateFilesForTMVA.o: ./src/writeParticleRateFilesForTMVA.cpp
1111-
$(CXX) $(CXXFLAGS) -c -o $@ $<
1112-
1113-
writeParticleRateFilesForTMVA: $(WRITEPARTPHYSOBJ)
1114-
$(LD) $(LDFLAGS) $^ $(GLIBS) $(OutPutOpt) ./bin/$@
1115-
@echo "$@ done"
1116-
11171062
########################################################
11181063
# combineLookupTables
11191064
########################################################

docs/changes/336.feature.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve TMVA interpolation from average zenith to average airmass.

docs/changes/336.maintenance.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Removed deprecated smoothing and interpolation functionality for MVA cut values.
2+
Cleaned up unused parameters and obsolete code related to box smoothing and TMVA optimization.

inc/VAnaSumRunParameter.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,6 @@ class VAnaSumRunParameterDataClass : public TNamed
110110

111111
string fEffectiveAreaFile; // file with effective areas, use NOFILE if not available
112112

113-
// all models
114-
unsigned int fNBoxSmooth;
115-
116113
// ON/OFF MODEL
117114
double fOO_alpha;
118115

@@ -139,7 +136,7 @@ class VAnaSumRunParameterDataClass : public TNamed
139136
{
140137
return fRunOn < x.fRunOn;
141138
}
142-
ClassDef( VAnaSumRunParameterDataClass, 3 );
139+
ClassDef( VAnaSumRunParameterDataClass, 4 );
143140
};
144141

145142
class VAnaSumRunParameter : public TNamed, public VGlobalRunParameter

inc/VGammaHadronCuts.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,6 @@ class VGammaHadronCuts : public VAnalysisUtilities
104104
unsigned int fTMVAWeightFileIndex_Zmax;
105105
map< unsigned int, double > fTMVASignalEfficiency;
106106
map< unsigned int, double > fTMVA_MVACut;
107-
string fTMVAOptimizeSignalEfficiencyParticleNumberFile;
108-
double fTMVAParticleNumberFile_Conversion_Rate_to_seconds;
109-
double fTMVAOptimizeSignalEfficiencySignificance_Min;
110-
double fTMVAOptimizeSignalEfficiencySignalEvents_Min;
111-
double fTMVAOptimizeSignalEfficiencyObservationTime_h;
112-
double fTMVAFixedSignalEfficiencyMax;
113-
double fTMVAMinSourceStrength;
114-
double fTMVAFixedThetaCutMin;
115107
double fTMVA_EvaluationResult;
116108
VTMVAEvaluatorResults* fTMVAEvaluatorResults;
117109

inc/VInstrumentResponseFunctionRunParameter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class VInstrumentResponseFunctionRunParameter : public TNamed
114114
bool readRunParameterFromTextFile( string iFile );
115115
bool testRunparameters();
116116

117-
ClassDef( VInstrumentResponseFunctionRunParameter, 19 );
117+
ClassDef( VInstrumentResponseFunctionRunParameter, 20 );
118118
};
119119

120120
#endif

inc/VTMVAEvaluator.h

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ class VTMVAEvaluator : public TNamed, public VPlotUtilities
117117
double fOptimizationBackgroundAlpha;
118118
double fOptimizationObservingTime_h;
119119

120-
double fTMVA_EvaluationResult; // result from TVMA evaluator
121-
bool fSmoothAndInterpolateMVAValues;
120+
double fTMVA_EvaluationResult; // result from TMVA evaluator
122121
double fAverageZenithPerRun; // (rough) average zenith angle of run
123122

124123
string fTMVAMethodName;
@@ -169,20 +168,13 @@ class VTMVAEvaluator : public TNamed, public VPlotUtilities
169168
double interpolate_mva_evaluation();
170169
TGraph* readNonNoffGraphsFromFile( TFile* iF, double i_ze_min, double i_ze_max, bool bIsOn = true );
171170
void reset();
172-
void smoothAndInterPolateMVAValue( TH1F*, TH1F*,
173-
unsigned int iE_min, unsigned int iE_max, unsigned int iZ_min, unsigned int iZ_max );
174-
void smoothAndInterPolateMVAValue_EnergyOnly( TH1F*, TH1F* );
175-
void smoothAndInterPolateMVAValue_Energy_and_Zenith( TH1F*, TH1F*,
176-
unsigned int iE_min, unsigned int iE_max, unsigned int iZ_min, unsigned int iZ_max );
177171

178172
public:
179173

180174
VTMVAEvaluator();
181175
~VTMVAEvaluator() {};
182176

183177
bool evaluate( bool interpolate_mva = false, bool use_average_zenith_angle = true );
184-
vector< double > getBackgroundEfficiency();
185-
vector< bool > getOptimumCutValueFound();
186178
vector< double > getSignalEfficiency();
187179
double getOptimalTheta2Cut( double iEnergy_log10TeV, double iZe = -9999 );
188180
vector< double > getTMVACutValue();
@@ -201,7 +193,7 @@ class VTMVAEvaluator : public TNamed, public VPlotUtilities
201193
{
202194
return fIsZombie;
203195
}
204-
TGraphAsymmErrors* plotSignalAndBackgroundEfficiencies( bool iLogY = true, double iYmin = 1.e-4, double iMVA_min = -1., double iMVA_max = 1. );
196+
void plotSignalAndBackgroundEfficiencies( bool iLogY = true, double iYmin = 1.e-4, double iMVA_min = -1., double iMVA_max = 1. );
205197
void printOptimizedMVACutValues( string iEpoch = "V6" );
206198
void printSensitivityOptimizationParameters();
207199
void printSignalEfficiency();
@@ -237,10 +229,6 @@ class VTMVAEvaluator : public TNamed, public VPlotUtilities
237229
}
238230
void setSignalEfficiency( double iSignalEfficiency = -99. );
239231
void setSignalEfficiency( map< unsigned int, double > iMSignalEfficiency );
240-
void setSmoothAndInterPolateMVAValues( bool iS = true )
241-
{
242-
fSmoothAndInterpolateMVAValues = iS;
243-
}
244232
void setSpectralIndexForEnergyWeighting( double iS = -2. )
245233
{
246234
fSpectralIndexForEnergyWeighting = iS;
@@ -253,7 +241,7 @@ class VTMVAEvaluator : public TNamed, public VPlotUtilities
253241
}
254242
void setTMVAMethod( string iMethodName = "BDT" );
255243

256-
ClassDef( VTMVAEvaluator, 36 );
244+
ClassDef( VTMVAEvaluator, 37 );
257245
};
258246

259247
#endif

inc/VTMVARunData.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class VTMVARunData : public TNamed
9999
VTMVARunData();
100100
~VTMVARunData() {}
101101
void print();
102-
VTableLookupRunParameter* getTLRunParameter();
102+
VTableLookupRunParameter* getTableLookupRunParameters();
103103
bool readConfigurationFile( char* );
104104
bool openDataFiles();
105105
void setDebug( bool iB = true )
@@ -112,7 +112,7 @@ class VTMVARunData : public TNamed
112112
}
113113
void updateTrainingEvents( string iVarName, unsigned int iNEvents );
114114

115-
ClassDef( VTMVARunData, 12 );
115+
ClassDef( VTMVARunData, 13 );
116116
};
117117

118118
#endif

macros/optimizeBDTcuts.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void optimizeBDTcuts(
5757
weightFileIndex_Zmin, weightFileIndex_Zmax );
5858

5959
// plotting
60-
a.plotSignalAndBackgroundEfficiencies();
60+
a.plotSignalAndBackgroundEfficiencies(true, 7.e-3, -0.2, 0.7);
6161

6262
// print results to screen
6363
a.printSignalEfficiency();

0 commit comments

Comments
 (0)