Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/changes/339.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Allow to choose energy and direction reconstruction methods:

```
Stereo reconstruction
---------------------
Method ids: 0 (DispBDT), 1 (LT Tables), 2 (XGB stereo)
* ENERGYRECONSTRUCTIONMETHOD 0
Method ids: 0 (DispBDT), 1 (Intersection Method), 2 (XGB stereo)
* DIRECTIONRECONSTRUCTIONMETHOD 0
```

Consistently use `CData` methods to get variables.
12 changes: 7 additions & 5 deletions inc/CData.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,14 @@ class CData
CData( TTree* tree, bool bMC, bool bShort, string file_name, string stereo_suffix, string gamma_hadron_suffix );
virtual ~CData();
virtual Int_t GetEntry( Long64_t entry );
float get_Erec( unsigned int method = 0 );
float get_Xoff( unsigned int method = 0 );
float get_Yoff( unsigned int method = 0 );
void initialize_xgb_tree(TTree* stereoTree, TTree* ghTree);
float get_Erec( unsigned int method );
float get_ErecChi2( unsigned int method );
float get_ErecdE( unsigned int method );
float get_Xoff( unsigned int method );
float get_Yoff( unsigned int method );
void initialize_xgb_tree( TTree* stereoTree, TTree* ghTree );
TTree* getXGBTree( string file_name, string suffix, string tree_name );
pair<float, float> get_XYoff_derot( unsigned int method = 0 );
pair<float, float> get_XYoff_derot( unsigned int method );
virtual Long64_t LoadTree( Long64_t entry );
float get_GH_Gamma_Prediction();
bool is_GH_Gamma();
Expand Down
3 changes: 3 additions & 0 deletions inc/VAnaSumRunParameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ class VAnaSumRunParameter : public TNamed, public VGlobalRunParameter
double fEnergyEffectiveAreaSmoothingThreshold;
vector< double > fMCZe; // zenith angle interval for Monte Carlo

// direction reconstruction
unsigned int fDirectionReconstructionMethod;

// dead time calculation method
int fDeadTimeCalculationMethod;

Expand Down
9 changes: 9 additions & 0 deletions inc/VDataMCComparision.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ class VDataMCComparision
bool fCalculateMVAValues;
string fEpochATM;

// reconstruction methods
unsigned int fEnergyReconstructionMethod;
unsigned int fDirectionReconstructionMethod;

// lists with all histograms
TList* hisList;
vector<TH1D* > hTel;
Expand Down Expand Up @@ -143,6 +147,11 @@ class VDataMCComparision
{
fShowerMaxZe_deg = iZe;
}
void setStereoReconstructionMethod( unsigned int iEnergyMethod = 0, unsigned int iDirectionMethod = 0 )
{
fEnergyReconstructionMethod = iEnergyMethod;
fDirectionReconstructionMethod = iDirectionMethod;
}
bool setTelescopeCoordinates( double x, double y, double z = 0. );
void setWobbleFromDataTree()
{
Expand Down
7 changes: 1 addition & 6 deletions inc/VEffectiveAreaCalculator.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ class VEffectiveAreaCalculator
VInstrumentResponseFunctionRunParameter* fRunPara;

VGammaHadronCuts* fCuts;
bool fIgnoreEnergyReconstruction;
bool fIsotropicArrivalDirections;

// effective area calculation
Expand Down Expand Up @@ -316,7 +315,7 @@ class VEffectiveAreaCalculator
~VEffectiveAreaCalculator();

void cleanup();
bool fill( TH1D* hE0mc, CData* d, VEffectiveAreaCalculatorMCHistograms* iMC_histo, unsigned int iMethod );
bool fill( TH1D* hE0mc, CData* d, VEffectiveAreaCalculatorMCHistograms* iMC_histo, unsigned int iEnergyReconstructionMethod, unsigned int iDirectionReconstructionMethod );
TH1D* getHistogramhEmc();
TGraphErrors* getMeanSystematicErrorHistogram();
TTree* getTree()
Expand Down Expand Up @@ -363,10 +362,6 @@ class VEffectiveAreaCalculator
{
fEffectiveAreaVsEnergyMC = iMC;
}
void setIgnoreEnergyReconstructionCuts( bool iB = false )
{
fIgnoreEnergyReconstruction = iB;
}
void setIsotropicArrivalDirections( bool iB = false )
{
fIsotropicArrivalDirections = iB;
Expand Down
24 changes: 13 additions & 11 deletions inc/VGammaHadronCuts.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ class VGammaHadronCuts : public VAnalysisUtilities
double fTMVA_EvaluationResult;
VTMVAEvaluatorResults* fTMVAEvaluatorResults;

// reconstruction methods
unsigned int fEnergyReconstructionMethod;
unsigned int fDirectionReconstructionMethod;

// orbital phase analysis
TFile* fPhaseCut_File; //!
TTree* fPhaseCut_Tree; //!
Expand Down Expand Up @@ -186,16 +190,16 @@ class VGammaHadronCuts : public VAnalysisUtilities
VGammaHadronCuts();
~VGammaHadronCuts();

bool applyDirectionCuts( unsigned int iEnergyReconstructionMethod = 0, bool bCount = false, double x0 = -99999., double y0 = -99999. );
bool applyEnergyReconstructionQualityCuts( unsigned int iEnergyReconstructionMethod = 0, bool bCount = false );
bool applyDirectionCuts( bool bCount = false, double x0 = -99999., double y0 = -99999. );
bool applyEnergyReconstructionQualityCuts( bool bCount = false );
bool applyInsideFiducialAreaCut( bool bCount = false );
bool applyInsideFiducialAreaCut( float Xoff, float Yoff, bool bCount = false );
bool applyMCXYoffCut( double x, double y, bool bCount = false );
bool applyMeanReducedScaledStereoShapeCuts();
bool applyMeanStereoShapeCuts();
bool applyMeanScaledStereoShapeCuts();
bool applyPhaseCut( int i );
bool applyStereoQualityCuts( unsigned int iEnergyReconstructionMethod = 0, bool bCount = false, int iEntry = 0, bool fIsOn = false );
bool applyStereoQualityCuts( bool bCount = false, int iEntry = 0, bool fIsOn = false );
bool applyStereoShapeCuts();
bool applyTMVACut( int i );
bool applyXGBoostCut( int i );
Expand All @@ -208,13 +212,6 @@ class VGammaHadronCuts : public VAnalysisUtilities
{
return fArrayCentre_Y;
}
double getReconstructedEnergy( unsigned int iEnergyReconstructionMethod = 0 );
double getReconstructedEnergyChi2( unsigned int iEnergyReconstructionMethod = 0 );
double getReconstructedEnergydE( unsigned int iEnergyReconstructionMethod = 0. );
double getReconstructedXoff();
double getReconstructedYoff();
double getReconstructedXcore();
double getReconstructedYcore();
int getGammaHadronCutSelector()
{
return fGammaHadronCutSelector;
Expand Down Expand Up @@ -254,7 +251,7 @@ class VGammaHadronCuts : public VAnalysisUtilities
{
return fTMVAEvaluatorResults;
}
void initialize();
void initialize( unsigned int iEnergyMethod, unsigned int iDirectionMethod );
bool isGamma( int i = 0, bool bCount = false, bool fIsOn = true );
bool isMCCuts()
{
Expand Down Expand Up @@ -305,6 +302,11 @@ class VGammaHadronCuts : public VAnalysisUtilities
fArrayCentre_X = iX;
fArrayCentre_Y = iY;
}
void setStereoReconstructionMethod( unsigned int iEnergyMethod = 0, unsigned int iDirectionMethod = 0 )
{
fEnergyReconstructionMethod = iEnergyMethod;
fDirectionReconstructionMethod = iDirectionMethod;
}
void setTelToAnalyze( vector< unsigned int > iTelToAnalyze )
{
fTelToAnalyze = iTelToAnalyze;
Expand Down
4 changes: 1 addition & 3 deletions inc/VInstrumentResponseFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ class VInstrumentResponseFunction
// histograms are not re-filled but duplicated
unsigned int fDuplicationID;

unsigned int fEnergyReconstructionMethod;

// histograms and data
vector< vector< VInstrumentResponseFunctionData* > > fIRFData;

Expand Down Expand Up @@ -115,7 +113,7 @@ class VInstrumentResponseFunction
bool initialize( string iName, string iType, unsigned int iNTel, double iMCMaxCoreRadius,
double iZe, int iNoise, double iPedvars, double iXoff, double iYoff );
void setDuplicationID( unsigned int iDuplicationID = 9999 );
void setEnergyReconstructionMethod( unsigned int iMethod );
void setStereoReconstructionMethod( unsigned int iEnergy, unsigned int iDirection );
void setCuts( VGammaHadronCuts* iCuts );
void setContainmentProbability( double iP = 0.68, double iPError = 0.95 )
{
Expand Down
5 changes: 5 additions & 0 deletions inc/VInstrumentResponseFunctionData.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class VInstrumentResponseFunctionData : public TObject, public VHistogramUtiliti
unsigned int fNTel;

unsigned int fEnergyReconstructionMethod;
unsigned int fDirectionReconstructionMethod;

// list of histograms
enum E_HISTOID { E_DIFF, E_DIFF2, E_LOGDIFF, E_NIMAG, E_DIST, E_ERROR, E_RELA,
Expand Down Expand Up @@ -106,6 +107,10 @@ class VInstrumentResponseFunctionData : public TObject, public VHistogramUtiliti
{
fEnergyReconstructionMethod = iMethod;
}
void setDirectionReconstructionMethod( unsigned int iMethod = 0 )
{
fDirectionReconstructionMethod = iMethod;
}
void setPlottingStyle( int icolor, double iwidth = 1., int imarker = 20, double isize = 1., int iFillStyle = 0, int iLineStyle = 1 );
void setHistogramEbinning( int iN = 60, double iMin = -2.0, double iMax = 4.0 )
{
Expand Down
1 change: 1 addition & 0 deletions inc/VInstrumentResponseFunctionRunParameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class VInstrumentResponseFunctionRunParameter : public TNamed
int fGammaHadronCutSelector;

unsigned int fEnergyReconstructionMethod;
unsigned int fDirectionReconstructionMethod;
unsigned int fEnergyAxisBins_log10;
bool fIgnoreEnergyReconstructionQuality;
unsigned int fNSpectralIndex;
Expand Down
7 changes: 6 additions & 1 deletion inc/VRadialAcceptance.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class VRadialAcceptance
double fCut_CameraFiducialSize_max;

unsigned int fEnergyReconstructionMethod;
unsigned int fDirectionReconstructionMethod;

// regions excluded from background
vector<double> fXE;
Expand Down Expand Up @@ -154,10 +155,14 @@ class VRadialAcceptance
fAzCut_min = iAzMin; //!< cut on Az (shower directory)
fAzCut_max = iAzMax;
}
void setEnergyReconstructionMethod( unsigned int iEMethod = 1 )
void setEnergyReconstructionMethod( unsigned int iEMethod = 0 )
{
fEnergyReconstructionMethod = iEMethod;
}
void setDirectionReconstructionMethod( unsigned int iEMethod = 0 )
{
fDirectionReconstructionMethod = iEMethod;
}
void setSource( double x, double y, double r, double idist, double imaxdist = 5. ); //!< set source position, radius, and minimal distance between source and background
void setRegionToExcludeAcceptance( vector<double> x, vector<double> y, vector<double> r ); //set the region to be exclude in the analysis
// for ellipsoidal region
Expand Down
5 changes: 3 additions & 2 deletions inc/VTMVAEvaluator.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class VTMVAEvaluator : public TNamed, public VPlotUtilities
vector< VTMVAEvaluatorData* > fTMVAData;

CData* fData;
unsigned int fEnergyReconstructionMethod;

map< unsigned int, double > fSignalEfficiencyMap; // from user: energy dependent signal efficiency
double fSignalEfficiencyNoVec;
Expand Down Expand Up @@ -171,7 +172,7 @@ class VTMVAEvaluator : public TNamed, public VPlotUtilities

public:

VTMVAEvaluator();
VTMVAEvaluator( unsigned int iEnergyReconstructionMethod = 0 );
~VTMVAEvaluator() {};

bool evaluate( bool interpolate_mva = false, bool use_average_zenith_angle = true );
Expand Down Expand Up @@ -241,7 +242,7 @@ class VTMVAEvaluator : public TNamed, public VPlotUtilities
}
void setTMVAMethod( string iMethodName = "BDT" );

ClassDef( VTMVAEvaluator, 37 );
ClassDef( VTMVAEvaluator, 38 );
};

#endif
3 changes: 2 additions & 1 deletion inc/VTMVARunDataEnergyCut.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ class VTMVARunDataEnergyCut : public TNamed
double fEnergyCut_Log10TeV_max;
TCut fEnergyCut;
unsigned int fEnergyReconstructionMethod;
unsigned int fDirectionReconstructionMethod;

VTMVARunDataEnergyCut();
~VTMVARunDataEnergyCut() {}

void print();

ClassDef( VTMVARunDataEnergyCut, 2 );
ClassDef( VTMVARunDataEnergyCut, 3 );
};

#endif
Loading