Skip to content

Commit

Permalink
Merge pull request #137 from VERITAS-Observatory/v485-dev3
Browse files Browse the repository at this point in the history
Prepare release v485c (or possible v486)
  • Loading branch information
GernotMaier authored Nov 17, 2021
2 parents 5c1f395 + 387af8e commit 98ab943
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 53 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ endif
########################################################################################################################
# compiler and linker general values
CXX = g++
CXXFLAGS = -O3 -g -Wall -fPIC -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE_SOURCE -D_LARGEFILE64_SOURCE
CXXFLAGS = -O3 -g -Wall -fPIC -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE_SOURCE -D_LARGEFILE64_SOURCE -std=c++11
CXXFLAGS += -I. -I./inc/
CXXFLAGS += $(VBFFLAG) $(DBFLAG) $(ROOT6FLAG) $(GSLFLAG) $(GSL2FLAG) $(FROGSFLAG) $(DCACHEFLAG)
LD = g++
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

**Development version master - not to be used for science analysis**

For development, please use the branch v485-dev2

Main changes with respect to earlier version is the implementation of the correction factors to take the lower throughput / gains into account

Release page: ...
Expand Down
1 change: 0 additions & 1 deletion inc/CData.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#ifndef CData_h
#define CData_h

#include <TROOT.h>
#include <TChain.h>
#include <TFile.h>

Expand Down
1 change: 1 addition & 0 deletions inc/VStereoAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ class VStereoAnalysis
double fDL3EventTree_YGroundCore;
int fDL3EventTree_NImages;
ULong64_t fDL3EventTree_ImgSel;
double fDL3EventTree_MeanPedvar;
double fDL3EventTree_MSCW;
double fDL3EventTree_MSCL;
double fDL3EventTree_Az ;
Expand Down
42 changes: 9 additions & 33 deletions src/VEffectiveAreaCalculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1674,27 +1674,23 @@ bool VEffectiveAreaCalculator::initializeEffectiveAreasFromHistograms( TTree* iE
}
}
// energy bias histos may have different binning (i.e. to avoid artifacts and save up space) than the effective areas.
TGraph *iG_temp_esys = new TGraph( 1 );
for( int j = 0; j < nbins; j++ )
{
iG_temp_esys->SetPoint( j, e0[j], esys_rel[j] );
}
for( int e = 0; e < i_hEsysMCRelative->GetNbinsX(); e++ )
{
i_temp_Esys[e] = 0.;
for( int j = 0; j < nbins_MC; j++ )
{
if( TMath::Abs( e0_MC[j] - fEff_EsysMCRelative_EnergyAxis[e] ) < 1.e-5 )
{
i_temp_Esys[e] = esys_rel[j];
}
}

i_temp_Esys[e] = iG_temp_esys->Eval( fEff_EsysMCRelative_EnergyAxis[e] );
}
delete iG_temp_esys;
fEffArea_map[i_ID] = i_temp_Eff;
fEff_EsysMCRelative[i_ID] = i_temp_Esys;

if ( bLikelihoodAnalysis )
{

// Getting MC effective areas too
i_temp_Eff_MC.assign(fNBins, 0);


for( unsigned int e = 0; e < fNBins; e++ )
{
Expand All @@ -1712,22 +1708,7 @@ bool VEffectiveAreaCalculator::initializeEffectiveAreasFromHistograms( TTree* iE
fEsysMCRelative2D_map[i_ID] = (TH2F*)i_hEsysMCRelative2D->Clone();
i_hEsysMCRelative2D->SetDirectory(0);
i_hEsysMCRelative2D->AddDirectory(kFALSE);


}


if( i_hEsysMCRelative )
{
for( int ti = 1; ti <= i_hEsysMCRelative->GetNbinsX(); ti++ )
{
i_temp_Esys[ti - 1] = i_hEsysMCRelative->GetBinContent( ti );
i_temp_EsysE[ti - 1] = i_hEsysMCRelative->GetBinError( ti );
}
}
fEff_EsysMCRelative[i_ID] = i_temp_Esys;
fEff_EsysMCRelativeE[i_ID] = i_temp_EsysE;

// this is neeeded only if there are no azimuth dependent effective areas
iIndexAz++;

Expand Down Expand Up @@ -4220,7 +4201,6 @@ TGraphErrors* VEffectiveAreaCalculator::getMeanSystematicErrorHistogram()
fEff_EsysMCRelative[i_ID_0], fEff_EsysMCRelative[i_ID_1], false );
// don't interpolate errors, assume they are more or less constant
i_eff_tempE = fEff_EsysMCRelativeE[i_ID_0];

}
}
i_woff_eff_temp[w] = interpolate_effectiveArea( fEffectiveAreas_meanPedVar, fEff_Noise[i_ze_bins[i]][i_woff_bins[w]][i_noise_bins[0]], fEff_Noise[i_ze_bins[i]][i_woff_bins[w]][i_noise_bins[1]], i_noise_eff_temp[0], i_noise_eff_temp[1], false );
Expand All @@ -4235,12 +4215,8 @@ TGraphErrors* VEffectiveAreaCalculator::getMeanSystematicErrorHistogram()
unsigned int z = 0;
for( unsigned int i = 0; i < i_eff_temp.size(); i++ )
{
if( i_eff_tempE[i] > 0. )
{
gMeanSystematicErrorGraph->SetPoint( z, fEff_EsysMCRelative_EnergyAxis[i], i_eff_temp[i] );
gMeanSystematicErrorGraph->SetPointError( z, 0, i_eff_tempE[i] );
z++;
}
gMeanSystematicErrorGraph->SetPoint( z, fEff_EsysMCRelative_EnergyAxis[i], i_eff_temp[i] );
z++;
}
}

Expand Down
34 changes: 18 additions & 16 deletions src/VStereoAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ double VStereoAnalysis::fillHistograms( int icounter, int irun, double iAzMin, d

// initialize time mask
fTimeMask->setMask( irun, iMJDStart, iMJDStopp, fRunPara->fTimeMaskFile );
fRunPara->setRunTimes( icounter, iMJDStart, iMJDStopp );
fRunPara->setRunTimes( icounter, iMJDStart, iMJDStopp );

// initialize cuts
setCuts( fRunPara->fRunList[fHisCounter], irun );
Expand Down Expand Up @@ -2155,6 +2155,7 @@ bool VStereoAnalysis::init_DL3Tree( int irun, int icounter )
fDL3EventTree->Branch( "Yderot", &fDL3EventTree_Yderot, "Yderot/D" );
fDL3EventTree->Branch( "NImages", &fDL3EventTree_NImages, "NImages/I" );
fDL3EventTree->Branch( "ImgSel", &fDL3EventTree_ImgSel, "ImgSel/l" );
fDL3EventTree->Branch( "MeanPedvar", &fDL3EventTree_MeanPedvar, "MeanPedvar/D" );
fDL3EventTree->Branch( "MSCW", &fDL3EventTree_MSCW, "MSCW/D" );
fDL3EventTree->Branch( "MSCL", &fDL3EventTree_MSCL, "MSCL/D" );
fDL3EventTree->Branch( "RA" , &fDL3EventTree_RA, "RA/D" );
Expand All @@ -2165,11 +2166,11 @@ bool VStereoAnalysis::init_DL3Tree( int irun, int icounter )
fDL3EventTree->Branch( "Xoff" , &fDL3EventTree_Xoff , "Xoff/D" );
fDL3EventTree->Branch( "Yoff" , &fDL3EventTree_Yoff , "Yoff/D" );
fDL3EventTree->Branch( "Acceptance" , &fDL3EventTree_Acceptance , "Acceptance/D" );
if ( fRunPara->fWriteAllEvents )
{
fDL3EventTree->Branch( "MVA" , &fDL3EventTree_MVA, "MVA/D" );
fDL3EventTree->Branch( "IsGamma" , &fDL3EventTree_IsGamma, "IsGamma/I" );
}
if ( fRunPara->fWriteAllEvents )
{
fDL3EventTree->Branch( "MVA" , &fDL3EventTree_MVA, "MVA/D" );
fDL3EventTree->Branch( "IsGamma" , &fDL3EventTree_IsGamma, "IsGamma/I" );
}
cout << endl;

// init radial acceptance class
Expand Down Expand Up @@ -2217,6 +2218,7 @@ void VStereoAnalysis::fill_DL3Tree( CData* c , double i_xderot, double i_yderot,
fDL3EventTree_YGroundCore = c->Ycore; // Gamma Ray Core-Ground intersection location (east)
fDL3EventTree_NImages = c->NImages; // Number of images used in reconstruction?
fDL3EventTree_ImgSel = c->ImgSel; // binary code describing which telescopes had images
fDL3EventTree_MeanPedvar = c->meanPedvar_Image; // average pedvar
fDL3EventTree_MSCW = c->MSCW; // mean scaled width
fDL3EventTree_MSCL = c->MSCL; // mean scaled length
fDL3EventTree_EmissionHeight = c->EmissionHeight ; // height of shower maximum (in km) above telescope z-plane
Expand Down Expand Up @@ -2263,18 +2265,18 @@ void VStereoAnalysis::fill_DL3Tree( CData* c , double i_xderot, double i_yderot,
fDL3EventTree_RA = 0.;
fDL3EventTree_DEC = 0.;
}
if ( fCuts && fRunPara->fWriteAllEvents )
{
fDL3EventTree_MVA = fCuts->getTMVA_EvaluationResult();
if ( bIsGamma )
{
fDL3EventTree_IsGamma = 1;
}
else
if ( fCuts && fRunPara->fWriteAllEvents )
{
fDL3EventTree_IsGamma = 0;
fDL3EventTree_MVA = fCuts->getTMVA_EvaluationResult();
if ( bIsGamma )
{
fDL3EventTree_IsGamma = 1;
}
else
{
fDL3EventTree_IsGamma = 0;
}
}
}


if( fDL3EventTree )
Expand Down

0 comments on commit 98ab943

Please sign in to comment.