Skip to content

Commit 2be17e1

Browse files
authored
Merge pull request #339 from VERITAS-Observatory/direction-method
(Re-)introduce energy and direction method selector.
2 parents 75fc499 + 35e8a89 commit 2be17e1

26 files changed

+335
-311
lines changed

docs/changes/339.feature.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Allow to choose energy and direction reconstruction methods:
2+
3+
```
4+
Stereo reconstruction
5+
---------------------
6+
Method ids: 0 (DispBDT), 1 (LT Tables), 2 (XGB stereo)
7+
* ENERGYRECONSTRUCTIONMETHOD 0
8+
Method ids: 0 (DispBDT), 1 (Intersection Method), 2 (XGB stereo)
9+
* DIRECTIONRECONSTRUCTIONMETHOD 0
10+
```
11+
12+
Consistently use `CData` methods to get variables.

inc/CData.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,14 @@ class CData
273273
CData( TTree* tree, bool bMC, bool bShort, string file_name, string stereo_suffix, string gamma_hadron_suffix );
274274
virtual ~CData();
275275
virtual Int_t GetEntry( Long64_t entry );
276-
float get_Erec( unsigned int method = 0 );
277-
float get_Xoff( unsigned int method = 0 );
278-
float get_Yoff( unsigned int method = 0 );
279-
void initialize_xgb_tree(TTree* stereoTree, TTree* ghTree);
276+
float get_Erec( unsigned int method );
277+
float get_ErecChi2( unsigned int method );
278+
float get_ErecdE( unsigned int method );
279+
float get_Xoff( unsigned int method );
280+
float get_Yoff( unsigned int method );
281+
void initialize_xgb_tree( TTree* stereoTree, TTree* ghTree );
280282
TTree* getXGBTree( string file_name, string suffix, string tree_name );
281-
pair<float, float> get_XYoff_derot( unsigned int method = 0 );
283+
pair<float, float> get_XYoff_derot( unsigned int method );
282284
virtual Long64_t LoadTree( Long64_t entry );
283285
float get_GH_Gamma_Prediction();
284286
bool is_GH_Gamma();

inc/VAnaSumRunParameter.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ class VAnaSumRunParameter : public TNamed, public VGlobalRunParameter
190190
double fEnergyEffectiveAreaSmoothingThreshold;
191191
vector< double > fMCZe; // zenith angle interval for Monte Carlo
192192

193+
// direction reconstruction
194+
unsigned int fDirectionReconstructionMethod;
195+
193196
// dead time calculation method
194197
int fDeadTimeCalculationMethod;
195198

inc/VDataMCComparision.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ class VDataMCComparision
9090
bool fCalculateMVAValues;
9191
string fEpochATM;
9292

93+
// reconstruction methods
94+
unsigned int fEnergyReconstructionMethod;
95+
unsigned int fDirectionReconstructionMethod;
96+
9397
// lists with all histograms
9498
TList* hisList;
9599
vector<TH1D* > hTel;
@@ -143,6 +147,11 @@ class VDataMCComparision
143147
{
144148
fShowerMaxZe_deg = iZe;
145149
}
150+
void setStereoReconstructionMethod( unsigned int iEnergyMethod = 0, unsigned int iDirectionMethod = 0 )
151+
{
152+
fEnergyReconstructionMethod = iEnergyMethod;
153+
fDirectionReconstructionMethod = iDirectionMethod;
154+
}
146155
bool setTelescopeCoordinates( double x, double y, double z = 0. );
147156
void setWobbleFromDataTree()
148157
{

inc/VEffectiveAreaCalculator.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ class VEffectiveAreaCalculator
113113
VInstrumentResponseFunctionRunParameter* fRunPara;
114114

115115
VGammaHadronCuts* fCuts;
116-
bool fIgnoreEnergyReconstruction;
117116
bool fIsotropicArrivalDirections;
118117

119118
// effective area calculation
@@ -316,7 +315,7 @@ class VEffectiveAreaCalculator
316315
~VEffectiveAreaCalculator();
317316

318317
void cleanup();
319-
bool fill( TH1D* hE0mc, CData* d, VEffectiveAreaCalculatorMCHistograms* iMC_histo, unsigned int iMethod );
318+
bool fill( TH1D* hE0mc, CData* d, VEffectiveAreaCalculatorMCHistograms* iMC_histo, unsigned int iEnergyReconstructionMethod, unsigned int iDirectionReconstructionMethod );
320319
TH1D* getHistogramhEmc();
321320
TGraphErrors* getMeanSystematicErrorHistogram();
322321
TTree* getTree()
@@ -363,10 +362,6 @@ class VEffectiveAreaCalculator
363362
{
364363
fEffectiveAreaVsEnergyMC = iMC;
365364
}
366-
void setIgnoreEnergyReconstructionCuts( bool iB = false )
367-
{
368-
fIgnoreEnergyReconstruction = iB;
369-
}
370365
void setIsotropicArrivalDirections( bool iB = false )
371366
{
372367
fIsotropicArrivalDirections = iB;

inc/VGammaHadronCuts.h

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ class VGammaHadronCuts : public VAnalysisUtilities
107107
double fTMVA_EvaluationResult;
108108
VTMVAEvaluatorResults* fTMVAEvaluatorResults;
109109

110+
// reconstruction methods
111+
unsigned int fEnergyReconstructionMethod;
112+
unsigned int fDirectionReconstructionMethod;
113+
110114
// orbital phase analysis
111115
TFile* fPhaseCut_File; //!
112116
TTree* fPhaseCut_Tree; //!
@@ -186,16 +190,16 @@ class VGammaHadronCuts : public VAnalysisUtilities
186190
VGammaHadronCuts();
187191
~VGammaHadronCuts();
188192

189-
bool applyDirectionCuts( unsigned int iEnergyReconstructionMethod = 0, bool bCount = false, double x0 = -99999., double y0 = -99999. );
190-
bool applyEnergyReconstructionQualityCuts( unsigned int iEnergyReconstructionMethod = 0, bool bCount = false );
193+
bool applyDirectionCuts( bool bCount = false, double x0 = -99999., double y0 = -99999. );
194+
bool applyEnergyReconstructionQualityCuts( bool bCount = false );
191195
bool applyInsideFiducialAreaCut( bool bCount = false );
192196
bool applyInsideFiducialAreaCut( float Xoff, float Yoff, bool bCount = false );
193197
bool applyMCXYoffCut( double x, double y, bool bCount = false );
194198
bool applyMeanReducedScaledStereoShapeCuts();
195199
bool applyMeanStereoShapeCuts();
196200
bool applyMeanScaledStereoShapeCuts();
197201
bool applyPhaseCut( int i );
198-
bool applyStereoQualityCuts( unsigned int iEnergyReconstructionMethod = 0, bool bCount = false, int iEntry = 0, bool fIsOn = false );
202+
bool applyStereoQualityCuts( bool bCount = false, int iEntry = 0, bool fIsOn = false );
199203
bool applyStereoShapeCuts();
200204
bool applyTMVACut( int i );
201205
bool applyXGBoostCut( int i );
@@ -208,13 +212,6 @@ class VGammaHadronCuts : public VAnalysisUtilities
208212
{
209213
return fArrayCentre_Y;
210214
}
211-
double getReconstructedEnergy( unsigned int iEnergyReconstructionMethod = 0 );
212-
double getReconstructedEnergyChi2( unsigned int iEnergyReconstructionMethod = 0 );
213-
double getReconstructedEnergydE( unsigned int iEnergyReconstructionMethod = 0. );
214-
double getReconstructedXoff();
215-
double getReconstructedYoff();
216-
double getReconstructedXcore();
217-
double getReconstructedYcore();
218215
int getGammaHadronCutSelector()
219216
{
220217
return fGammaHadronCutSelector;
@@ -254,7 +251,7 @@ class VGammaHadronCuts : public VAnalysisUtilities
254251
{
255252
return fTMVAEvaluatorResults;
256253
}
257-
void initialize();
254+
void initialize( unsigned int iEnergyMethod, unsigned int iDirectionMethod );
258255
bool isGamma( int i = 0, bool bCount = false, bool fIsOn = true );
259256
bool isMCCuts()
260257
{
@@ -305,6 +302,11 @@ class VGammaHadronCuts : public VAnalysisUtilities
305302
fArrayCentre_X = iX;
306303
fArrayCentre_Y = iY;
307304
}
305+
void setStereoReconstructionMethod( unsigned int iEnergyMethod = 0, unsigned int iDirectionMethod = 0 )
306+
{
307+
fEnergyReconstructionMethod = iEnergyMethod;
308+
fDirectionReconstructionMethod = iDirectionMethod;
309+
}
308310
void setTelToAnalyze( vector< unsigned int > iTelToAnalyze )
309311
{
310312
fTelToAnalyze = iTelToAnalyze;

inc/VInstrumentResponseFunction.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ class VInstrumentResponseFunction
4747
// histograms are not re-filled but duplicated
4848
unsigned int fDuplicationID;
4949

50-
unsigned int fEnergyReconstructionMethod;
51-
5250
// histograms and data
5351
vector< vector< VInstrumentResponseFunctionData* > > fIRFData;
5452

@@ -115,7 +113,7 @@ class VInstrumentResponseFunction
115113
bool initialize( string iName, string iType, unsigned int iNTel, double iMCMaxCoreRadius,
116114
double iZe, int iNoise, double iPedvars, double iXoff, double iYoff );
117115
void setDuplicationID( unsigned int iDuplicationID = 9999 );
118-
void setEnergyReconstructionMethod( unsigned int iMethod );
116+
void setStereoReconstructionMethod( unsigned int iEnergy, unsigned int iDirection );
119117
void setCuts( VGammaHadronCuts* iCuts );
120118
void setContainmentProbability( double iP = 0.68, double iPError = 0.95 )
121119
{

inc/VInstrumentResponseFunctionData.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class VInstrumentResponseFunctionData : public TObject, public VHistogramUtiliti
7474
unsigned int fNTel;
7575

7676
unsigned int fEnergyReconstructionMethod;
77+
unsigned int fDirectionReconstructionMethod;
7778

7879
// list of histograms
7980
enum E_HISTOID { E_DIFF, E_DIFF2, E_LOGDIFF, E_NIMAG, E_DIST, E_ERROR, E_RELA,
@@ -106,6 +107,10 @@ class VInstrumentResponseFunctionData : public TObject, public VHistogramUtiliti
106107
{
107108
fEnergyReconstructionMethod = iMethod;
108109
}
110+
void setDirectionReconstructionMethod( unsigned int iMethod = 0 )
111+
{
112+
fDirectionReconstructionMethod = iMethod;
113+
}
109114
void setPlottingStyle( int icolor, double iwidth = 1., int imarker = 20, double isize = 1., int iFillStyle = 0, int iLineStyle = 1 );
110115
void setHistogramEbinning( int iN = 60, double iMin = -2.0, double iMax = 4.0 )
111116
{

inc/VInstrumentResponseFunctionRunParameter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class VInstrumentResponseFunctionRunParameter : public TNamed
4343
int fGammaHadronCutSelector;
4444

4545
unsigned int fEnergyReconstructionMethod;
46+
unsigned int fDirectionReconstructionMethod;
4647
unsigned int fEnergyAxisBins_log10;
4748
bool fIgnoreEnergyReconstructionQuality;
4849
unsigned int fNSpectralIndex;

inc/VRadialAcceptance.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class VRadialAcceptance
4242
double fCut_CameraFiducialSize_max;
4343

4444
unsigned int fEnergyReconstructionMethod;
45+
unsigned int fDirectionReconstructionMethod;
4546

4647
// regions excluded from background
4748
vector<double> fXE;
@@ -154,10 +155,14 @@ class VRadialAcceptance
154155
fAzCut_min = iAzMin; //!< cut on Az (shower directory)
155156
fAzCut_max = iAzMax;
156157
}
157-
void setEnergyReconstructionMethod( unsigned int iEMethod = 1 )
158+
void setEnergyReconstructionMethod( unsigned int iEMethod = 0 )
158159
{
159160
fEnergyReconstructionMethod = iEMethod;
160161
}
162+
void setDirectionReconstructionMethod( unsigned int iEMethod = 0 )
163+
{
164+
fDirectionReconstructionMethod = iEMethod;
165+
}
161166
void setSource( double x, double y, double r, double idist, double imaxdist = 5. ); //!< set source position, radius, and minimal distance between source and background
162167
void setRegionToExcludeAcceptance( vector<double> x, vector<double> y, vector<double> r ); //set the region to be exclude in the analysis
163168
// for ellipsoidal region

0 commit comments

Comments
 (0)