From f7c78647f471ff3333e72a0ac27b3475d8415982 Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Thu, 18 Apr 2024 10:59:07 +0200 Subject: [PATCH 01/18] remove size --- inc/CData.h | 15 ----- inc/VImageParameter.h | 2 - inc/VImageParameterCalculation.h | 2 +- inc/VTableLookupDataHandler.h | 23 +------ src/VCamera.cpp | 3 +- src/VImageAnalyzer.cpp | 12 +--- src/VImageBaseAnalyzer.cpp | 2 +- src/VImageParameter.cpp | 4 -- src/VImageParameterCalculation.cpp | 59 +++-------------- src/VTableLookup.cpp | 30 ++++----- src/VTableLookupDataHandler.cpp | 103 +++-------------------------- 11 files changed, 44 insertions(+), 211 deletions(-) diff --git a/inc/CData.h b/inc/CData.h index 34cbbf75..e6d4f19c 100644 --- a/inc/CData.h +++ b/inc/CData.h @@ -87,7 +87,6 @@ class CData Float_t meanPedvar_ImageT[VDST_MAXTELESCOPES]; Double_t dist[VDST_MAXTELESCOPES]; Double_t size[VDST_MAXTELESCOPES]; - Double_t size2[VDST_MAXTELESCOPES]; Double_t fraclow[VDST_MAXTELESCOPES]; Double_t loss[VDST_MAXTELESCOPES]; Double_t max1[VDST_MAXTELESCOPES]; @@ -192,7 +191,6 @@ class CData TBranch* b_meanPedvar_ImageT; //! TBranch* b_dist; //! TBranch* b_size; //! - TBranch* b_size2; //! TBranch* b_fraclow; //! TBranch* b_loss; //! TBranch* b_max1; //! @@ -590,17 +588,6 @@ void CData::Init( TTree* tree ) { fChain->SetBranchAddress( "dist", dist ); fChain->SetBranchAddress( "size", size ); - if( fChain->GetBranchStatus( "size2" ) ) - { - fChain->SetBranchAddress( "size2", size2 ); - } - else - { - for( int i = 0; i < VDST_MAXTELESCOPES; i++ ) - { - size2[i] = 0.; - } - } if( fChain->GetBranchStatus( "fracLow" ) ) { fChain->SetBranchAddress( "fracLow", fraclow ); @@ -687,7 +674,6 @@ void CData::Init( TTree* tree ) { dist[i] = 0.; size[i] = 0.; - size2[i] = 0.; fraclow[i] = 0.; loss[i] = 0.; max1[i] = 0.; @@ -916,7 +902,6 @@ Bool_t CData::Notify() b_dist = fChain->GetBranch( "dist" ); b_size = fChain->GetBranch( "size" ); - b_size2 = fChain->GetBranch( "size2" ); b_fraclow = fChain->GetBranch( "fraclow" ); b_max1 = fChain->GetBranch( "max1" ); b_max2 = fChain->GetBranch( "max2" ); diff --git a/inc/VImageParameter.h b/inc/VImageParameter.h index d7fd3463..2f4c5e4b 100644 --- a/inc/VImageParameter.h +++ b/inc/VImageParameter.h @@ -65,9 +65,7 @@ class VImageParameter float length; //!< Length of ellipse float width; //!< width of ellipse float size; //!< total signal - float size2; //!< total signal (second summation window) float sizeLL; //!< total signal; LL method - float size2LL; //!< total signal (second summation window); LL method float dist; //!< distance to centroid float azwidth; //!< used by certain analysis techniques float alpha; //!< Alpha angle (-Pi/2..Pi/2) diff --git a/inc/VImageParameterCalculation.h b/inc/VImageParameterCalculation.h index 1d9df3da..dba48d91 100644 --- a/inc/VImageParameterCalculation.h +++ b/inc/VImageParameterCalculation.h @@ -66,7 +66,7 @@ class VImageParameterCalculation : public TObject VImageParameterCalculation( unsigned int iShortTree = 0, VEvndispData* iData = 0 ); ~VImageParameterCalculation(); - vector calcLL( bool iUseSums2 = false ); //!< calculate image parameters (log like) + vector calcLL(); //!< calculate image parameters (log like) void muonRingFinder(); //!< fit a single ring to the image to look for muons void sizeInMuonRing(); //! calculate the brightness of the muon ring void muonPixelDistribution(); //!< determine the distribution of pixels in the image diff --git a/inc/VTableLookupDataHandler.h b/inc/VTableLookupDataHandler.h index cc8d7287..db02a0d7 100644 --- a/inc/VTableLookupDataHandler.h +++ b/inc/VTableLookupDataHandler.h @@ -238,7 +238,6 @@ class VTableLookupDataHandler double ffui [VDST_MAXTELESCOPES]; double fdist_telType[VDST_MAXTELESCOPES]; double fsize [VDST_MAXTELESCOPES]; - double fsize2 [VDST_MAXTELESCOPES]; double fsizeCorr [VDST_MAXTELESCOPES]; double fsize_telType[VDST_MAXTELESCOPES]; double floss [VDST_MAXTELESCOPES]; @@ -502,26 +501,8 @@ class VTableLookupDataHandler { return fOutFile; } - double* getSize( double iSizeCorrection = 1., bool iSelectedImagesOnly = false, bool iSize2 = false ); // deprecated - double* getSize( double iSizeCorrection, ULong64_t iTelType, bool iSelectedImagesOnly, bool iSize2 = false ); // deprecated - double* getSize( vector iSizeCorrection, bool iSelectedImagesOnly = false, bool iSize2 = false ); - double* getSize( vector iSizeCorrection, ULong64_t iTelType, bool iSelectedImagesOnly = false, bool iSize2 = false ); - double* getSize2( double iSizeCorrection = 1., bool iSelectedImagesOnly = false ) // deprecated - { - return getSize( iSizeCorrection, iSelectedImagesOnly, true ); - } - double* getSize2( double iSizeCorrection, ULong64_t iTelType, bool iSelectedImagesOnly ) // deprecated - { - return getSize( iSizeCorrection, iTelType, iSelectedImagesOnly, true ); - } - double* getSize2( vector iSizeCorrection, bool iSelectedImagesOnly ) - { - return getSize( iSizeCorrection, iSelectedImagesOnly, true ); - } - double* getSize2( vector iSizeCorrection, ULong64_t iTelType, bool iSelectedImagesOnly ) - { - return getSize( iSizeCorrection, iTelType, iSelectedImagesOnly, true ); - } + double* getSize( double iSizeCorrection = 1., bool iSelectedImagesOnly = false ); + double* getSize( double iSizeCorrection, ULong64_t iTelType, bool iSelectedImagesOnly); double* getWeight() { return fweight; diff --git a/src/VCamera.cpp b/src/VCamera.cpp index 2405685d..736ebcda 100644 --- a/src/VCamera.cpp +++ b/src/VCamera.cpp @@ -903,14 +903,13 @@ void VCamera::drawEventText() fData->getImageParametersLogL()->size, fData->getImageParametersLogL()->Fitstat ); fTextEvent[fTextEvent.size() - 1]->SetTitle( iText ); - sprintf( iText, "GEO: c_x=%.2f,c_y=%.2f,dist=%.2f,length=%.3f,width=%.3f,size=%.0f/%.0f,loss=%.2f,lossDead=%.2f,fui=%.2f", + sprintf( iText, "GEO: c_x=%.2f,c_y=%.2f,dist=%.2f,length=%.3f,width=%.3f,size=%.0f,loss=%.2f,lossDead=%.2f,fui=%.2f", fData->getImageParameters()->cen_x, fData->getImageParameters()->cen_y, fData->getImageParameters()->dist, fData->getImageParameters()->length, fData->getImageParameters()->width, fData->getImageParameters()->size, - fData->getImageParameters()->size2, fData->getImageParameters()->loss, fData->getImageParameters()->lossAndDead, fData->getImageParameters()->fui ); diff --git a/src/VImageAnalyzer.cpp b/src/VImageAnalyzer.cpp index bf517c76..f5a6ef55 100644 --- a/src/VImageAnalyzer.cpp +++ b/src/VImageAnalyzer.cpp @@ -200,9 +200,7 @@ void VImageAnalyzer::doAnalysis() && getImageParameters()->loss > fRunPar->fLogLikelihoodLoss_min[getTelID()] ) { fVImageParameterCalculation->setParametersLogL( getImageParameters() ); - setLLEst( fVImageParameterCalculation->calcLL( true ) ); - fVImageParameterCalculation->setParametersLogL( getImageParameters() ); - setLLEst( fVImageParameterCalculation->calcLL( false ) ); + setLLEst( fVImageParameterCalculation->calcLL() ); } } @@ -283,9 +281,7 @@ void VImageAnalyzer::doAnalysis() && ( fRunPar->fForceLLImageFit || ( getImageParameters()->loss > fRunPar->fLogLikelihoodLoss_min[getTelID()] ) ) ) // FORCELL { fVImageParameterCalculation->setParametersLogL( getImageParameters() ); - setLLEst( fVImageParameterCalculation->calcLL( true ) ); - fVImageParameterCalculation->setParametersLogL( getImageParameters() ); - setLLEst( fVImageParameterCalculation->calcLL( false ) ); + setLLEst( fVImageParameterCalculation->calcLL() ); } } @@ -299,9 +295,7 @@ void VImageAnalyzer::doAnalysis() if( getImageParameters()->ntubes > 0 ) { fVImageParameterCalculation->setParametersLogL( getImageParametersLogL() ); - setLLEst( fVImageParameterCalculation->calcLL( true ) ); - fVImageParameterCalculation->setParametersLogL( getImageParametersLogL() ); - setLLEst( fVImageParameterCalculation->calcLL( false ) ); + setLLEst( fVImageParameterCalculation->calcLL() ); } else { diff --git a/src/VImageBaseAnalyzer.cpp b/src/VImageBaseAnalyzer.cpp index 050d6ddc..c63aab2a 100644 --- a/src/VImageBaseAnalyzer.cpp +++ b/src/VImageBaseAnalyzer.cpp @@ -1495,7 +1495,7 @@ void VImageBaseAnalyzer::calcSecondTZerosSums() */ unsigned int VImageBaseAnalyzer::getDynamicSummationWindow( unsigned int i_channelHitID ) { - // low gain: return larger integration window (from size2) + // low gain: return larger integration window if( getHiLo()[i_channelHitID] ) { return getSumWindow_2(); diff --git a/src/VImageParameter.cpp b/src/VImageParameter.cpp index 6e42b5bf..9ae641b9 100644 --- a/src/VImageParameter.cpp +++ b/src/VImageParameter.cpp @@ -97,12 +97,10 @@ void VImageParameter::initTree( string iName, string iTitle, bool iMC, bool iLL, tpars->Branch( "length", &length, "length/F" ); tpars->Branch( "width", &width, "width/F" ); tpars->Branch( "size", &size, "size/F" ); - tpars->Branch( "size2", &size2, "size2/F" ); tpars->Branch( "loss", &loss, "loss/F" ); if( fShortTree < 1 ) { tpars->Branch( "sizeLL", &sizeLL, "sizeLL/F" ); - tpars->Branch( "size2LL", &size2LL, "size2LL/F" ); tpars->Branch( "lossAndDead", &lossAndDead, "lossAndDead/F" ); } tpars->Branch( "fui", &fui, "fui/F" ); @@ -277,9 +275,7 @@ void VImageParameter::reset( unsigned int resetLevel ) length = 0.; width = 0.; size = 0.; - size2 = 0.; sizeLL = 0.; - size2LL = 0.; loss = 0.; lossAndDead = 0.; fui = 0.; diff --git a/src/VImageParameterCalculation.cpp b/src/VImageParameterCalculation.cpp index f65e1a0c..b8082772 100644 --- a/src/VImageParameterCalculation.cpp +++ b/src/VImageParameterCalculation.cpp @@ -1149,9 +1149,7 @@ void VImageParameterCalculation::calcParameters() const double dist = sqrt( xmean2 + ymean2 ); fParGeo->size = sumsig; - fParGeo->size2 = sumsig_2; fParGeo->sizeLL = -1.; - fParGeo->size2LL = -1.; fParGeo->cen_x = xmean; fParGeo->cen_y = ymean; fParGeo->dist = dist; @@ -1372,7 +1370,7 @@ void VImageParameterCalculation::calcParameters() In this case there is a large probablitity that the parameters are wrong. */ -vector VImageParameterCalculation::calcLL( bool iUseSums2 ) +vector VImageParameterCalculation::calcLL() { if( !fData ) { @@ -1441,14 +1439,7 @@ vector VImageParameterCalculation::calcLL( bool iUseSums2 ) if( fData->getImage()[j] || fData->getBorder()[j] ) { - if( iUseSums2 ) - { - fll_Sums.push_back( fData->getSums2()[j] ); - } - else - { - fll_Sums.push_back( fData->getSums()[j] ); - } + fll_Sums.push_back( fData->getSums()[j] ); } else { @@ -1646,10 +1637,6 @@ vector VImageParameterCalculation::calcLL( bool iUseSums2 ) // integrate over all bins to get fitted size bool iWidthResetted = false; float iSize = fParGeo->size; - if( iUseSums2 ) - { - iSize = fParGeo->size2; - } if( fParLL->Fitstat > 0 ) { // assume that all pixel are of the same size @@ -1733,14 +1720,7 @@ vector VImageParameterCalculation::calcLL( bool iUseSums2 ) cen_x = fParGeo->cen_x; cen_y = fParGeo->cen_y; phi = fParGeo->phi; - if( iUseSums2 ) - { - iSize = fParGeo->size2; - } - else - { - iSize = fParGeo->size; - } + iSize = fParGeo->size; } double cosphi = cos( phi ); double sinphi = sin( phi ); @@ -1858,32 +1838,15 @@ vector VImageParameterCalculation::calcLL( bool iUseSums2 ) fParLL->cen_y = cen_y; fParLL->length = length; fParLL->width = width; - fParLL->size2LL = fParGeo->size2; fParLL->sizeLL = fParGeo->size; - if( iUseSums2 ) - { - if( iWidthResetted ) - { - fParLL->size2 = fParGeo->size2; - } - else - { - fParLL->size2 = iSize; - } - fParLL->size = fParGeo->size; - } - else - { - if( iWidthResetted ) - { - fParLL->size = fParGeo->size; - } - else - { - fParLL->size = iSize; - } - fParLL->size2 = fParGeo->size2; - } + if( iWidthResetted ) + { + fParLL->size = fParGeo->size; + } + else + { + fParLL->size = iSize; + } fParLL->dist = dist; fParLL->azwidth = -1.; // !!!!!!!!!!!!!! to tired for calculation fParLL->alpha = alpha * TMath::RadToDeg(); diff --git a/src/VTableLookup.cpp b/src/VTableLookup.cpp index 84482886..12aad7a9 100644 --- a/src/VTableLookup.cpp +++ b/src/VTableLookup.cpp @@ -632,7 +632,7 @@ void VTableLookup::fillLookupTable() ULong64_t t = iter_i_list_of_Tel_type->first; // This should be already the corrected/scaled size value for MC. - double* i_s2 = fData->getSize2( 1., t, fTLRunParameter->fUseEvndispSelectedImagesOnly ); + double* i_s = fData->getSize( 1., t, fTLRunParameter->fUseEvndispSelectedImagesOnly ); double* i_r = fData->getDistanceToCore( t ); unsigned int i_type = fData->getNTel_type( t ); //////////////////////////////////////////////// @@ -643,11 +643,11 @@ void VTableLookup::fillLookupTable() for( unsigned int a = 0; a < fTableAzBins; a++ ) { // fill tables (get arrays filled for corresponding telescope type; one table per type) - fmscw[0][0][w][a][i_Tel_type_counter]->calc( i_type, i_r, i_s2, + fmscw[0][0][w][a][i_Tel_type_counter]->calc( i_type, i_r, i_s, fData->getWidth( t ), idummy1, iEventWeight, idummy3, idummy1 ); - fmscl[0][0][w][a][i_Tel_type_counter]->calc( i_type, i_r, i_s2, + fmscl[0][0][w][a][i_Tel_type_counter]->calc( i_type, i_r, i_s, fData->getLength( t ), idummy1, iEventWeight, idummy3, idummy1 ); - fenergySizevsRadius[0][0][w][a][i_Tel_type_counter]->calc( i_type, i_r, i_s2, + fenergySizevsRadius[0][0][w][a][i_Tel_type_counter]->calc( i_type, i_r, i_s, fData->getMCEnergyArray(), idummy1, iEventWeight, idummy3, idummy1 ); } } @@ -657,11 +657,11 @@ void VTableLookup::fillLookupTable() { unsigned int a = getAzBin( fData->getMCAz() ); // fill tables (get arrays filled for corresponding telescope type; one table per type) - fmscw[0][0][w][a][i_Tel_type_counter]->calc( i_type, i_r, i_s2, + fmscw[0][0][w][a][i_Tel_type_counter]->calc( i_type, i_r, i_s, fData->getWidth( t ), idummy1, iEventWeight, idummy3, idummy1 ); - fmscl[0][0][w][a][i_Tel_type_counter]->calc( i_type, i_r, i_s2, + fmscl[0][0][w][a][i_Tel_type_counter]->calc( i_type, i_r, i_s, fData->getLength( t ), idummy1, iEventWeight, idummy3, idummy1 ); - fenergySizevsRadius[0][0][w][a][i_Tel_type_counter]->calc( i_type, i_r, i_s2, + fenergySizevsRadius[0][0][w][a][i_Tel_type_counter]->calc( i_type, i_r, i_s, fData->getMCEnergyArray(), idummy1, iEventWeight, idummy3, idummy1 ); } i_Tel_type_counter++; @@ -957,11 +957,11 @@ void VTableLookup::readLookupTable() // calculate mean width ratio (mean scaled variables) imr = 0.; inr = 0.; - // require size2 > 0 (to use only selected images for the MWR/MWL calculation) - double* i_s2 = fData->getSize2( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly ); + // require size > 0 (to use only selected images for the MWR/MWL calculation) + double* i_s = fData->getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly ); for( unsigned int j = 0; j < s_N->fNTel; j++ ) { - if( s_N->mscw_T[j] > 0. && fData->getWidth() && i_s2 && i_s2[j] > 0. ) + if( s_N->mscw_T[j] > 0. && fData->getWidth() && i_s && i_s[j] > 0. ) { imr += fData->getWidth()[j] / s_N->mscw_T[j]; inr++; @@ -980,7 +980,7 @@ void VTableLookup::readLookupTable() inr = 0.; for( unsigned int j = 0; j < s_N->fNTel; j++ ) { - if( s_N->mscl_T[j] > 0. && fData->getLength() && i_s2 && i_s2[j] > 0. ) + if( s_N->mscl_T[j] > 0. && fData->getLength() && i_s && i_s[j] > 0. ) { imr += fData->getLength()[j] / s_N->mscl_T[j]; inr++; @@ -1413,27 +1413,27 @@ void VTableLookup::calculateMSFromTables( VTablesToRead* s, double esys ) } double i_dummy = 0.; - double* i_s2 = fData->getSize2( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly ); + double* i_s = fData->getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly ); f_calc_msc->setCalculateEnergies( false ); /////////////////// // calculate mscw f_calc_msc->setVHistograms( s->hmscwMedian ); s->mscw = f_calc_msc->calc( ( int )fData->getNTel(), fData->getDistanceToCore(), - i_s2, fData->getWidth(), + i_s, fData->getWidth(), s->mscw_T, i_dummy, i_dummy, s->mscw_Tsigma ); /////////////////// // calculate mscl f_calc_msc->setVHistograms( s->hmsclMedian ); s->mscl = f_calc_msc->calc( ( int )fData->getNTel(), fData->getDistanceToCore(), - i_s2, fData->getLength(), + i_s, fData->getLength(), s->mscl_T, i_dummy, i_dummy, s->mscl_Tsigma ); /////////////////// // calculate energy (method 1) f_calc_energySR->setCalculateEnergies( true ); f_calc_energySR->setVHistograms( s->henergySRMedian ); s->energySR = f_calc_energySR->calc( ( int )fData->getNTel(), fData->getDistanceToCore(), - i_s2, 0, + i_s, 0, s->energySR_T, s->energySR_Chi2, s->energySR_dE, s->energySR_Tsigma ); } diff --git a/src/VTableLookupDataHandler.cpp b/src/VTableLookupDataHandler.cpp index a3e2e4ba..ca4e06ea 100644 --- a/src/VTableLookupDataHandler.cpp +++ b/src/VTableLookupDataHandler.cpp @@ -517,7 +517,6 @@ int VTableLookupDataHandler::fillNextEvent( bool bShort ) fdist[i] = ftpars[i]->dist; ffui[i] = ftpars[i]->fui; fsize[i] = ftpars[i]->size; - fsize2[i] = ftpars[i]->size2; floss[i] = ftpars[i]->loss; ffracLow[i] = ftpars[i]->fracLow; fwidth[i] = ftpars[i]->width; @@ -623,7 +622,7 @@ int VTableLookupDataHandler::fillNextEvent( bool bShort ) getNTel(), fArrayPointing_Elevation, fArrayPointing_Azimuth, fTel_type, - getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly, false ), + getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly), fcen_x, fcen_y, fcosphi, fsinphi, fwidth, flength, @@ -673,7 +672,7 @@ void VTableLookupDataHandler::doStereoReconstruction() i_SR.reconstruct_direction( getNTel(), fArrayPointing_Elevation, fArrayPointing_Azimuth, fTelX, fTelY, fTelZ, - getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly, false ), + getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly), fcen_x, fcen_y, fcosphi, fsinphi, fwidth, flength, @@ -708,7 +707,7 @@ void VTableLookupDataHandler::doStereoReconstruction() getNTel(), fArrayPointing_Elevation, fArrayPointing_Azimuth, fTel_type, - getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly, false ), + getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly), fcen_x, fcen_y, fcosphi, fsinphi, fwidth, flength, @@ -728,7 +727,7 @@ void VTableLookupDataHandler::doStereoReconstruction() getNTel(), fArrayPointing_Elevation, fArrayPointing_Azimuth, fTel_type, - getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly, false ), + getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly), fcen_x, fcen_y, fcosphi, fsinphi, fwidth, flength, @@ -754,7 +753,7 @@ void VTableLookupDataHandler::doStereoReconstruction() getNTel(), fArrayPointing_Elevation, fArrayPointing_Azimuth, fTel_type, - getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly, false ), + getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly), fcen_x, fcen_y, fcosphi, fsinphi, fwidth, flength, @@ -833,7 +832,7 @@ void VTableLookupDataHandler::doStereoReconstruction() fArrayPointing_Elevation, fArrayPointing_Azimuth, fXoff, fYoff, fTelX, fTelY, fTelZ, - getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly, false ), + getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly), fcen_x, fcen_y, fcosphi, fsinphi, fwidth, flength, @@ -1410,8 +1409,6 @@ bool VTableLookupDataHandler::setOutputFile( string iOutput, string iOption, str fOTree->Branch( "dist", fdist, iTT ); sprintf( iTT, "size[%d]/D", fNTel ); fOTree->Branch( "size", fsize, iTT ); - sprintf( iTT, "size2[%d]/D", fNTel ); - fOTree->Branch( "size2", fsize2, iTT ); sprintf( iTT, "loss[%d]/D", fNTel ); fOTree->Branch( "loss", floss, iTT ); sprintf( iTT, "fracLow[%d]/D", fNTel ); @@ -2098,7 +2095,6 @@ void VTableLookupDataHandler::resetImageParameters( unsigned int i ) fdist[i] = 0.; ffui[i] = 0.; fsize[i] = 0.; - fsize2[i] = 0.; floss[i] = 0.; ffracLow[i] = 0.; fwidth[i] = 0.; @@ -2308,7 +2304,6 @@ void VTableLookupDataHandler::resetAll() fdist[i] = 0.; ffui[i] = 0.; fsize[i] = 0.; - fsize2[i] = 0.; fsizeCorr[i] = 0.; fsize_telType[i] = 0.; floss[i] = 0.; @@ -2591,7 +2586,7 @@ double* VTableLookupDataHandler::getDistanceToCore( ULong64_t iTelType ) * used for table filling only * */ -double* VTableLookupDataHandler::getSize( double iSizeCorrection, bool iSelectedImagesOnly, bool iSize2 ) +double* VTableLookupDataHandler::getSize( double iSizeCorrection, bool iSelectedImagesOnly) { for( unsigned int i = 0; i < getNTel(); i++ ) { @@ -2600,83 +2595,12 @@ double* VTableLookupDataHandler::getSize( double iSizeCorrection, bool iSelected fsizeCorr[i] = -99.; continue; } - if( !iSize2 ) - { - fsizeCorr[i] = fsize[i] * iSizeCorrection; - } - else - { - fsizeCorr[i] = fsize2[i] * iSizeCorrection; - } - } - return fsizeCorr; -} - -double* VTableLookupDataHandler::getSize( double iSizeCorrection, ULong64_t iTelType, bool iSelectedImagesOnly, bool iSize2 ) -{ - unsigned int z = 0; - for( unsigned int i = 0; i < getNTel(); i++ ) - { - if( fTel_type[i] == iTelType ) - { - if( iSelectedImagesOnly && !fImgSel_list[i] ) - { - fsize_telType[z] = -99.; - z++; - continue; - } - if( !iSize2 ) - { - fsize_telType[z] = fsize[i] * iSizeCorrection; - } - else - { - fsize_telType[z] = fsize2[i] * iSizeCorrection; - } - z++; - } - } - return fsize_telType; -} - -/* - * get an array with image size - * - * called while reading lookup tables - * - * iSelectedImagesOnly = true: use eventdisplay selection - * - */ -double* VTableLookupDataHandler::getSize( vector iSizeCorrection, bool iSelectedImagesOnly, bool iSize2 ) -{ - for( unsigned int i = 0; i < getNTel(); i++ ) - { - if( iSelectedImagesOnly && !fImgSel_list[i] ) - { - fsizeCorr[i] = -99.; - continue; - } - if( !iSize2 ) - { - fsizeCorr[i] = fsize[i] * iSizeCorrection[i]; - } - else - { - fsizeCorr[i] = fsize2[i] * iSizeCorrection[i]; - } + fsizeCorr[i] = fsize[i] * iSizeCorrection; } return fsizeCorr; } -/* - * get an array with image size - * - * called while filling lookup tables - * - * iSelectedImagesOnly = true: use eventdisplay selection - * - */ -double* VTableLookupDataHandler::getSize( vector iSizeCorrection, ULong64_t iTelType, bool iSelectedImagesOnly, bool iSize2 ) +double* VTableLookupDataHandler::getSize( double iSizeCorrection, ULong64_t iTelType, bool iSelectedImagesOnly) { unsigned int z = 0; for( unsigned int i = 0; i < getNTel(); i++ ) @@ -2689,14 +2613,7 @@ double* VTableLookupDataHandler::getSize( vector iSizeCorrection, ULong z++; continue; } - if( !iSize2 ) - { - fsize_telType[z] = fsize[i] * iSizeCorrection[i]; - } - else - { - fsize_telType[z] = fsize2[i] * iSizeCorrection[i]; - } + fsize_telType[z] = fsize[i] * iSizeCorrection; z++; } } From a74e5898ac545b59045a6da7a7748ec15990623c Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Thu, 18 Apr 2024 12:49:09 +0200 Subject: [PATCH 02/18] typo --- src/VImageParameterCalculation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/VImageParameterCalculation.cpp b/src/VImageParameterCalculation.cpp index b8082772..84dd8db6 100644 --- a/src/VImageParameterCalculation.cpp +++ b/src/VImageParameterCalculation.cpp @@ -1848,7 +1848,7 @@ vector VImageParameterCalculation::calcLL() fParLL->size = iSize; } fParLL->dist = dist; - fParLL->azwidth = -1.; // !!!!!!!!!!!!!! to tired for calculation + fParLL->azwidth = -1.; // !!!!!!!!!!!!!! too tired for calculation fParLL->alpha = alpha * TMath::RadToDeg(); fParLL->los = los; fParLL->miss = miss; From 1230d63fc0b83afcef5b2e35de4f467dac9919ff Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Sun, 21 Apr 2024 18:30:35 +0200 Subject: [PATCH 03/18] astyle --- src/VTableLookupDataHandler.cpp | 20 ++++++++++---------- src/VTableLookupRunParameter.cpp | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/VTableLookupDataHandler.cpp b/src/VTableLookupDataHandler.cpp index ca4e06ea..c547311d 100644 --- a/src/VTableLookupDataHandler.cpp +++ b/src/VTableLookupDataHandler.cpp @@ -622,7 +622,7 @@ int VTableLookupDataHandler::fillNextEvent( bool bShort ) getNTel(), fArrayPointing_Elevation, fArrayPointing_Azimuth, fTel_type, - getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly), + getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly ), fcen_x, fcen_y, fcosphi, fsinphi, fwidth, flength, @@ -672,7 +672,7 @@ void VTableLookupDataHandler::doStereoReconstruction() i_SR.reconstruct_direction( getNTel(), fArrayPointing_Elevation, fArrayPointing_Azimuth, fTelX, fTelY, fTelZ, - getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly), + getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly ), fcen_x, fcen_y, fcosphi, fsinphi, fwidth, flength, @@ -707,7 +707,7 @@ void VTableLookupDataHandler::doStereoReconstruction() getNTel(), fArrayPointing_Elevation, fArrayPointing_Azimuth, fTel_type, - getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly), + getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly ), fcen_x, fcen_y, fcosphi, fsinphi, fwidth, flength, @@ -727,7 +727,7 @@ void VTableLookupDataHandler::doStereoReconstruction() getNTel(), fArrayPointing_Elevation, fArrayPointing_Azimuth, fTel_type, - getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly), + getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly ), fcen_x, fcen_y, fcosphi, fsinphi, fwidth, flength, @@ -753,7 +753,7 @@ void VTableLookupDataHandler::doStereoReconstruction() getNTel(), fArrayPointing_Elevation, fArrayPointing_Azimuth, fTel_type, - getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly), + getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly ), fcen_x, fcen_y, fcosphi, fsinphi, fwidth, flength, @@ -832,7 +832,7 @@ void VTableLookupDataHandler::doStereoReconstruction() fArrayPointing_Elevation, fArrayPointing_Azimuth, fXoff, fYoff, fTelX, fTelY, fTelZ, - getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly), + getSize( 1., fTLRunParameter->fUseEvndispSelectedImagesOnly ), fcen_x, fcen_y, fcosphi, fsinphi, fwidth, flength, @@ -2586,7 +2586,7 @@ double* VTableLookupDataHandler::getDistanceToCore( ULong64_t iTelType ) * used for table filling only * */ -double* VTableLookupDataHandler::getSize( double iSizeCorrection, bool iSelectedImagesOnly) +double* VTableLookupDataHandler::getSize( double iSizeCorrection, bool iSelectedImagesOnly ) { for( unsigned int i = 0; i < getNTel(); i++ ) { @@ -2595,12 +2595,12 @@ double* VTableLookupDataHandler::getSize( double iSizeCorrection, bool iSelected fsizeCorr[i] = -99.; continue; } - fsizeCorr[i] = fsize[i] * iSizeCorrection; + fsizeCorr[i] = fsize[i] * iSizeCorrection; } return fsizeCorr; } -double* VTableLookupDataHandler::getSize( double iSizeCorrection, ULong64_t iTelType, bool iSelectedImagesOnly) +double* VTableLookupDataHandler::getSize( double iSizeCorrection, ULong64_t iTelType, bool iSelectedImagesOnly ) { unsigned int z = 0; for( unsigned int i = 0; i < getNTel(); i++ ) @@ -2613,7 +2613,7 @@ double* VTableLookupDataHandler::getSize( double iSizeCorrection, ULong64_t iTe z++; continue; } - fsize_telType[z] = fsize[i] * iSizeCorrection; + fsize_telType[z] = fsize[i] * iSizeCorrection; z++; } } diff --git a/src/VTableLookupRunParameter.cpp b/src/VTableLookupRunParameter.cpp index 954a2e7e..4bc2caec 100644 --- a/src/VTableLookupRunParameter.cpp +++ b/src/VTableLookupRunParameter.cpp @@ -299,7 +299,7 @@ bool VTableLookupRunParameter::fillParameters( int argc, char* argv[] ) else if( iTemp.find( "-minntubes" ) < iTemp.size() ) { fminntubes = atoi( iTemp.substr( iTemp.rfind( "=" ) + 1, iTemp.size() ).c_str() ); - } + } else if( iTemp.find( "-minwidth" ) < iTemp.size() ) { fminwidth = atof( iTemp.substr( iTemp.rfind( "=" ) + 1, iTemp.size() ).c_str() ); From 037e4416bb3c1be5165ccf558120b156e58c358b Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Sun, 21 Apr 2024 18:30:54 +0200 Subject: [PATCH 04/18] run two LL estimators --- inc/VImageParameterCalculation.h | 2 +- src/VImageAnalyzer.cpp | 12 +++++++++--- src/VImageParameterCalculation.cpp | 29 ++++++++++++++++++----------- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/inc/VImageParameterCalculation.h b/inc/VImageParameterCalculation.h index dba48d91..aa86d2bf 100644 --- a/inc/VImageParameterCalculation.h +++ b/inc/VImageParameterCalculation.h @@ -66,7 +66,7 @@ class VImageParameterCalculation : public TObject VImageParameterCalculation( unsigned int iShortTree = 0, VEvndispData* iData = 0 ); ~VImageParameterCalculation(); - vector calcLL(); //!< calculate image parameters (log like) + vector calcLL(bool); //!< calculate image parameters (log like) void muonRingFinder(); //!< fit a single ring to the image to look for muons void sizeInMuonRing(); //! calculate the brightness of the muon ring void muonPixelDistribution(); //!< determine the distribution of pixels in the image diff --git a/src/VImageAnalyzer.cpp b/src/VImageAnalyzer.cpp index f5a6ef55..bf517c76 100644 --- a/src/VImageAnalyzer.cpp +++ b/src/VImageAnalyzer.cpp @@ -200,7 +200,9 @@ void VImageAnalyzer::doAnalysis() && getImageParameters()->loss > fRunPar->fLogLikelihoodLoss_min[getTelID()] ) { fVImageParameterCalculation->setParametersLogL( getImageParameters() ); - setLLEst( fVImageParameterCalculation->calcLL() ); + setLLEst( fVImageParameterCalculation->calcLL( true ) ); + fVImageParameterCalculation->setParametersLogL( getImageParameters() ); + setLLEst( fVImageParameterCalculation->calcLL( false ) ); } } @@ -281,7 +283,9 @@ void VImageAnalyzer::doAnalysis() && ( fRunPar->fForceLLImageFit || ( getImageParameters()->loss > fRunPar->fLogLikelihoodLoss_min[getTelID()] ) ) ) // FORCELL { fVImageParameterCalculation->setParametersLogL( getImageParameters() ); - setLLEst( fVImageParameterCalculation->calcLL() ); + setLLEst( fVImageParameterCalculation->calcLL( true ) ); + fVImageParameterCalculation->setParametersLogL( getImageParameters() ); + setLLEst( fVImageParameterCalculation->calcLL( false ) ); } } @@ -295,7 +299,9 @@ void VImageAnalyzer::doAnalysis() if( getImageParameters()->ntubes > 0 ) { fVImageParameterCalculation->setParametersLogL( getImageParametersLogL() ); - setLLEst( fVImageParameterCalculation->calcLL() ); + setLLEst( fVImageParameterCalculation->calcLL( true ) ); + fVImageParameterCalculation->setParametersLogL( getImageParametersLogL() ); + setLLEst( fVImageParameterCalculation->calcLL( false ) ); } else { diff --git a/src/VImageParameterCalculation.cpp b/src/VImageParameterCalculation.cpp index 84dd8db6..5969b9b9 100644 --- a/src/VImageParameterCalculation.cpp +++ b/src/VImageParameterCalculation.cpp @@ -1370,7 +1370,7 @@ void VImageParameterCalculation::calcParameters() In this case there is a large probablitity that the parameters are wrong. */ -vector VImageParameterCalculation::calcLL() +vector VImageParameterCalculation::calcLL( bool iUseSums2 ) { if( !fData ) { @@ -1439,7 +1439,14 @@ vector VImageParameterCalculation::calcLL() if( fData->getImage()[j] || fData->getBorder()[j] ) { - fll_Sums.push_back( fData->getSums()[j] ); + if( iUseSums2 ) + { + fll_Sums.push_back( fData->getSums2()[j] ); + } + else + { + fll_Sums.push_back( fData->getSums()[j] ); + } } else { @@ -1720,7 +1727,7 @@ vector VImageParameterCalculation::calcLL() cen_x = fParGeo->cen_x; cen_y = fParGeo->cen_y; phi = fParGeo->phi; - iSize = fParGeo->size; + iSize = fParGeo->size; } double cosphi = cos( phi ); double sinphi = sin( phi ); @@ -1839,14 +1846,14 @@ vector VImageParameterCalculation::calcLL() fParLL->length = length; fParLL->width = width; fParLL->sizeLL = fParGeo->size; - if( iWidthResetted ) - { - fParLL->size = fParGeo->size; - } - else - { - fParLL->size = iSize; - } + if( iWidthResetted ) + { + fParLL->size = fParGeo->size; + } + else + { + fParLL->size = iSize; + } fParLL->dist = dist; fParLL->azwidth = -1.; // !!!!!!!!!!!!!! too tired for calculation fParLL->alpha = alpha * TMath::RadToDeg(); From 92e371c6b64bda88ce1af98982ddf7a47a0cfa1f Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Sun, 21 Apr 2024 18:31:21 +0200 Subject: [PATCH 05/18] avoid VDST init if not needed --- src/VEventLoop.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/VEventLoop.cpp b/src/VEventLoop.cpp index fd51da62..942e859b 100644 --- a/src/VEventLoop.cpp +++ b/src/VEventLoop.cpp @@ -103,7 +103,11 @@ VEventLoop::VEventLoop( VEvndispRunParameter* irunparameter ) fCalibrator = new VCalibrator(); // create data summarizer - fDST = new VDST( ( fRunMode == R_DST ), ( fRunPar->fsourcetype == 1 || fRunPar->fsourcetype == 2 || fRunPar->fsourcetype == 6 ) ); + fDST = 0; + if( fRunMode == R_DST ) + { + fDST = new VDST( ( fRunMode == R_DST ), ( fRunPar->fsourcetype == 1 || fRunPar->fsourcetype == 2 || fRunPar->fsourcetype == 6 ) ); + } // create analyzer (one for all telescopes) fAnalyzer = new VImageAnalyzer(); From dbd5c6eadb77788a265cf73336120ae963c7b72a Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Sun, 21 Apr 2024 18:35:13 +0200 Subject: [PATCH 06/18] memory optimization --- inc/VGlobalRunParameter.h | 4 ++++ src/VGlobalRunParameter.cpp | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/inc/VGlobalRunParameter.h b/inc/VGlobalRunParameter.h index 1832ee75..409ca0a9 100644 --- a/inc/VGlobalRunParameter.h +++ b/inc/VGlobalRunParameter.h @@ -8,6 +8,10 @@ #include #include +#include +#include +#include + #include #include #include diff --git a/src/VGlobalRunParameter.cpp b/src/VGlobalRunParameter.cpp index a23db7bc..7ce890bb 100644 --- a/src/VGlobalRunParameter.cpp +++ b/src/VGlobalRunParameter.cpp @@ -178,8 +178,9 @@ bool VGlobalRunParameter::setDirectories() fEVNDISPAnaDataDirectory = data_dir; fEVNDISPAnaDataDirectory += "/"; } - // test if directory exists - if( gSystem->AccessPathName( fEVNDISPAnaDataDirectory.c_str() ) ) + struct stat s; + int err = stat( fEVNDISPAnaDataDirectory.c_str(), &s ); + if( err == -1 || !S_ISDIR( s.st_mode ) ) { cout << "VGlobalRunParameter::setDirectories() error: cannot find directory with EVNDISP aux data" << endl; cout << "\t looking for " << fEVNDISPAnaDataDirectory << endl; From 94f468f3edb4b5ac172cdef33de8e0f122248c6a Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Fri, 17 May 2024 17:55:56 +0200 Subject: [PATCH 07/18] remove obsolete ls --- src/VImageAnalyzer.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/VImageAnalyzer.cpp b/src/VImageAnalyzer.cpp index bf517c76..4ec944c0 100644 --- a/src/VImageAnalyzer.cpp +++ b/src/VImageAnalyzer.cpp @@ -875,10 +875,6 @@ void VImageAnalyzer::shutdown() { fOutputfile->Flush(); cout << "closing evndisp output file, final contents: "; - if( fReader->isMC() ) - { - fOutputfile->ls(); - } cout << "\t file size: " << fOutputfile->GetSize() << endl; fOutputfile->Close(); } From ef8cacba9835b4dd9eaebc57fe8bcd166ea9c6d7 Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Fri, 17 May 2024 18:07:45 +0200 Subject: [PATCH 08/18] typo --- Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 91c0155f..842d2195 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ # # Optional libraries: # -# for using GSL libraries (as part of ROO mathmore) +# for using GSL libraries (as part of ROOT mathmore) # # for using FITS (optional) # FITSSYS (pointing to FITS installation) @@ -540,7 +540,7 @@ printCrabSensitivity = ./obj/printCrabSensitivity.o \ ./obj/VAnaSumRunParameter.o ./obj/VAnaSumRunParameter_Dict.o \ ./obj/VTimeMask.o ./obj/VTimeMask_Dict.o \ ./obj/CRunSummary.o ./obj/CRunSummary_Dict.o \ - + ./obj/printCrabSensitivity.o: ./src/printCrabSensitivity.cpp $(CXX) $(CXXFLAGS) -c -o $@ $< @@ -555,7 +555,7 @@ printCrabSensitivity: $(printCrabSensitivity) # logFile ######################################################## LOGFILE = ./obj/logFile.o \ - + ./obj/logFile.o: ./src/logFile.cpp $(CXX) $(CXXFLAGS) -c -o $@ $< @@ -725,7 +725,7 @@ ifneq ($(TSPECTRUMFLAG),-DNOSPECTRUM) endif ifeq ($(ASTRONMETRY),-DASTROSLALIB) - SHAREDOBJS += ./obj/VASlalib.o ./obj/VASlalib_Dict.o + SHAREDOBJS += ./obj/VASlalib.o ./obj/VASlalib_Dict.o endif ifneq ($(GSLFLAG),-DNOGSL) @@ -925,7 +925,7 @@ compareDatawithMC: $(COMPAREDATAMCOBJ) @echo "$@ done" ######################################################## -# printMJD +# printMJD ######################################################## PRINTMJDOBJ= ./obj/VSkyCoordinatesUtilities.o \ ./obj/VAstronometry.o \ @@ -940,7 +940,7 @@ printMJD: $(PRINTMJDOBJ) @echo "$@ done" ######################################################## -# printSQLDate +# printSQLDate ######################################################## printSQLDateOBJ= ./obj/VSkyCoordinatesUtilities.o \ ./obj/VAstronometry.o \ @@ -1532,7 +1532,7 @@ ifeq ($(GSLFLAG),-DNOGSL) @echo "evndisp without GSL libraries (no Hough muon calibration, no likelihood fitter)" else @echo "evndisp with GSL libraries (used in Hough muon calibration, likelihood fitter)" - @echo " GSL $(GSLFLAG)" + @echo " GSL $(GSLFLAG)" @echo " $(GSLCFLAGS) $(GSLLIBS)" endif @echo "" @@ -1602,7 +1602,7 @@ else endif ############################################################################################################################### -# source code formating +# source code formatting ############################################################################################################################### formatSourceCode: @echo "" From 4f58b8f66884e1191a95adb206318f2c077120a3 Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Fri, 17 May 2024 18:45:01 +0200 Subject: [PATCH 09/18] add missing library --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b7fead2..5244c018 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,10 +26,11 @@ jobs: container: ${{ matrix.root }} steps: - # Checks-out your repository under $GITHUB_WORKSPACE - uses: actions/checkout@v4 - # Runs a set of commands using the runners shell + - name: install libblas + run: sudo apt-get install -y libblas-dev + - name: build run: | root-config --version From 68c5fd4d6e3ab59831a7013d5852b53147209cbb Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Fri, 17 May 2024 18:47:10 +0200 Subject: [PATCH 10/18] add missing library --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5244c018..2e5ce720 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: - uses: actions/checkout@v4 - name: install libblas - run: sudo apt-get install -y libblas-dev + run: apt-get install -y libblas-dev - name: build run: | From cb540f081a64e3f63d94f9950eb8cddde5e58bd2 Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Fri, 17 May 2024 18:54:48 +0200 Subject: [PATCH 11/18] missing lib --- .github/workflows/ci-buildmatrix-cpp17.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-buildmatrix-cpp17.yml b/.github/workflows/ci-buildmatrix-cpp17.yml index 0af613f8..17994242 100644 --- a/.github/workflows/ci-buildmatrix-cpp17.yml +++ b/.github/workflows/ci-buildmatrix-cpp17.yml @@ -4,8 +4,7 @@ name: cpp17-buildmatrix # Controls when the workflow will run on: pull_request: - branches: [main, master, v490-dev-v0.7] - # run this workflow manually from the Actions tab + branches: [main, master] workflow_dispatch: jobs: @@ -16,14 +15,17 @@ jobs: root: - "rootproject/root:latest" - "rootproject/root:6.26.06-ubuntu22.04" - - "rootproject/root:6.26.06-fedora35" + - "rootproject/root:6.30.02-alma9 runs-on: ${{ matrix.os }} container: ${{ matrix.root }} steps: - # Checks-out your repository under $GITHUB_WORKSPACE - uses: actions/checkout@v4 + - name: install libblas + if: ${{ matrix.root == 'rootproject/root:latest' || matrix.root == 'rootproject/root:6.26.06-ubuntu22.04' }} + run: apt-get install -y libblas-dev + - name: vbf run: | curl https://syncandshare.desy.de/index.php/s/${{ secrets.VBFcpp17 }}/download > VBF.tar.gz From 1c29de0a5eeee94add6dc7f85e1b477f3e40cbe9 Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Fri, 17 May 2024 18:56:39 +0200 Subject: [PATCH 12/18] missing lib --- .github/workflows/ci-buildmatrix-cpp17.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-buildmatrix-cpp17.yml b/.github/workflows/ci-buildmatrix-cpp17.yml index 17994242..90127be3 100644 --- a/.github/workflows/ci-buildmatrix-cpp17.yml +++ b/.github/workflows/ci-buildmatrix-cpp17.yml @@ -15,7 +15,7 @@ jobs: root: - "rootproject/root:latest" - "rootproject/root:6.26.06-ubuntu22.04" - - "rootproject/root:6.30.02-alma9 + - "rootproject/root:6.30.02-alma9" runs-on: ${{ matrix.os }} container: ${{ matrix.root }} From ae1fb6735c31e8a75a3bbeceb58179acfd8dca2c Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Fri, 17 May 2024 18:59:57 +0200 Subject: [PATCH 13/18] try with 4 cpus --- .github/workflows/ci-buildmatrix-cpp17.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-buildmatrix-cpp17.yml b/.github/workflows/ci-buildmatrix-cpp17.yml index 90127be3..d5d78146 100644 --- a/.github/workflows/ci-buildmatrix-cpp17.yml +++ b/.github/workflows/ci-buildmatrix-cpp17.yml @@ -47,4 +47,4 @@ jobs: export LD_LIBRARY_PATH="${EVNDISPSYS}/obj:${EVNDISPSYS}/lib:${LD_LIBRARY_PATH}" export LD_LIBRARY_PATH="${VBFSYS}/lib:${LD_LIBRARY_PATH}" export SOFASYS=/sofa - make VTS + make -j 4 VTS From 1d99b785af5fe5ea3fd6ddb27117c09f4de8c55d Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Fri, 17 May 2024 19:05:51 +0200 Subject: [PATCH 14/18] make --- .github/workflows/ci-buildmatrix-cpp11.yml | 2 +- .github/workflows/ci.yml | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-buildmatrix-cpp11.yml b/.github/workflows/ci-buildmatrix-cpp11.yml index 25082019..e71fb2b9 100644 --- a/.github/workflows/ci-buildmatrix-cpp11.yml +++ b/.github/workflows/ci-buildmatrix-cpp11.yml @@ -44,4 +44,4 @@ jobs: export LD_LIBRARY_PATH="${EVNDISPSYS}/obj:${EVNDISPSYS}/lib:${LD_LIBRARY_PATH}" export LD_LIBRARY_PATH="${VBFSYS}/lib:${LD_LIBRARY_PATH}" export SOFASYS=/sofa - make VTS + make -j 4 VTS diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e5ce720..eb04f79d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,12 +3,8 @@ name: CI # Controls when the workflow will run on: - # Triggers the workflow on push or pull request - # events but only for the main branch pull_request: branches: [main, master] - - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: jobs: @@ -38,4 +34,4 @@ jobs: export SOFASYS=${EVNDISPSYS}/sofa ./install_sofa.sh CI make config - make VTS + make -j 4 VTS From 430ce9fa3246f349fe4896d3be29e866103b5e2d Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Fri, 17 May 2024 21:25:08 +0200 Subject: [PATCH 15/18] re-enable cpp11 --- .github/workflows/ci-buildmatrix-cpp11.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-buildmatrix-cpp11.yml b/.github/workflows/ci-buildmatrix-cpp11.yml index e71fb2b9..54a2a8d4 100644 --- a/.github/workflows/ci-buildmatrix-cpp11.yml +++ b/.github/workflows/ci-buildmatrix-cpp11.yml @@ -3,9 +3,8 @@ name: cpp11-buildmatrix # Controls when the workflow will run on: - # pull_request: - # branches: [main, master, v490-dev-v0.7] - # run this workflow manually from the Actions tab + pull_request: + branches: [main, master] workflow_dispatch: jobs: @@ -20,8 +19,7 @@ jobs: container: ${{ matrix.root }} steps: - # Checks-out your repository under $GITHUB_WORKSPACE - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: vbf run: | From 7612c404b7fd5dab6b15ac48049e34901a0ae3ec Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Sat, 18 May 2024 16:04:53 +0200 Subject: [PATCH 16/18] centos7 only --- .github/workflows/ci-buildmatrix-cpp11.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci-buildmatrix-cpp11.yml b/.github/workflows/ci-buildmatrix-cpp11.yml index 54a2a8d4..e43c2138 100644 --- a/.github/workflows/ci-buildmatrix-cpp11.yml +++ b/.github/workflows/ci-buildmatrix-cpp11.yml @@ -14,7 +14,6 @@ jobs: os: [ubuntu-latest] root: - "rootproject/root:6.24.06-centos7" - - "rootproject/root:6.22.08-ubuntu20.04" runs-on: ${{ matrix.os }} container: ${{ matrix.root }} From 40ee84c39d28ff5824c5b3263792a883220ec3da Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Sat, 18 May 2024 16:06:33 +0200 Subject: [PATCH 17/18] disable cpp11 --- .github/workflows/ci-buildmatrix-cpp11.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-buildmatrix-cpp11.yml b/.github/workflows/ci-buildmatrix-cpp11.yml index e43c2138..76d569ca 100644 --- a/.github/workflows/ci-buildmatrix-cpp11.yml +++ b/.github/workflows/ci-buildmatrix-cpp11.yml @@ -3,8 +3,8 @@ name: cpp11-buildmatrix # Controls when the workflow will run on: - pull_request: - branches: [main, master] + # pull_request: + # branches: [main, master] workflow_dispatch: jobs: From 3330bf7e1863990b7e8a0cb1a6f8d15e386db3fb Mon Sep 17 00:00:00 2001 From: GernotMaier Date: Sat, 18 May 2024 16:08:11 +0200 Subject: [PATCH 18/18] format --- INSTALL.md | 16 ++++++++-------- inc/VDeadPixelOrganizer.h | 5 ++++- inc/VDispAnalyzer.h | 2 +- inc/VImageParameterCalculation.h | 2 +- inc/VTableLookupDataHandler.h | 2 +- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 98e2c7ed..5f89c9d5 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -8,7 +8,7 @@ Eventdisplay is a C++ based library and designed to run in typical Linux environ CERN's [ROOT](https://root.cern.ch/) library for I/O, histogramming, and statistical applications: -- ROOT versions >= 6.20 +- ROOT versions >= 6.28 - the first-stage tool `evndisp` requires ROOT compiled with mysql for access to the VERITAS database. Pre-compiled version of ROOT (downloaded from [here](https://root.cern/install/)) have mysql installed. If building from source, ensure the mysql dependencies are installed and compiler flags are added (see [root installation page](https://root.cern/install/build_from_source/)). All other stages of Eventdisplay do not required mysql - meaning e.g., the conda-based installation of Eventdisplay is fine. - paths for ROOT should be set through e.g., @@ -28,7 +28,7 @@ root-config --has-mysql ### SOFA [SOFA](http://www.iausofa.org/current_C.html) for all astronometry transformations. - + Download and install using this script in the $EVNDISPSYS directory: ``` @@ -63,7 +63,7 @@ Eventdisplay can be used efficiently with the correct environmental variables se ### Compiling and Linking -ROOTSYS : (required) ROOT installation; add $ROOTSYS/lib to $LD_LIBRARY_PATH and $ROOTSYS/bin to $PATH +ROOTSYS : (required) ROOT installation; add $ROOTSYS/lib to $LD_LIBRARY_PATH and $ROOTSYS/bin to $PATH SOFASYS: (required) Astronomy library from Sofa @@ -83,11 +83,11 @@ EVNDISPSCRIPTS: Eventdisplay scripts directory Assume a computing environment, where several users are analysis the same raw data (would be in $VERITAS_DATA_DIR), but having their analysis results written to their own -directories ($VERITAS_USER_DATA_DIR). +directories ($VERITAS_USER_DATA_DIR). Note that $VERITAS_DATA_DIR and $VERITAS_USER_DATA_DIR can point to the same directory. - VERITAS_EVNDISP_AUX_DIR: directory with all auxiliary data like calibration files, lookup tables, effective areas, etc -- VERITAS_DATA_DIR : directory containing the raw telescope data or input simulation files +- VERITAS_DATA_DIR : directory containing the raw telescope data or input simulation files - VERITAS_USER_DATA_DIR : user data directory: containing output files from this analysis package - VERITAS_USER_LOG_DIR : user log file directory: log files and temporary scripts are written to this directory @@ -107,14 +107,14 @@ make config Compare the output with the requirements on software and environmental variable settings described above. -In the main Eventdisplay directory ($EVNDISPSYS is pointing to this directory), compile all Eventdisplay binaries with +In the main Eventdisplay directory ($EVNDISPSYS is pointing to this directory), compile all Eventdisplay binaries with ``` -source ./setObservatory.sh VTS +source ./setObservatory.sh VTS make VTS ``` -If you are working on a computing with several cores, this can be accelerated by e.g. compiling with four cores in parallel: +If you are working on a computing with several cores, this can be accelerated by e.g. compiling with four cores in parallel: ``` source ./setObservatory.sh VTS diff --git a/inc/VDeadPixelOrganizer.h b/inc/VDeadPixelOrganizer.h index 3e31cef9..53aac26b 100644 --- a/inc/VDeadPixelOrganizer.h +++ b/inc/VDeadPixelOrganizer.h @@ -104,7 +104,10 @@ class VNGain vector stateHistory ; // functions - VNGain() { fIsLow = false; } ; + VNGain() + { + fIsLow = false; + } ; void initialize( string gainType, VNPixel* parentVNP ) ; void updateState( int mjd, double time, PixelStateInt state ) ; void setParentVNPixelPointer( VNPixel* ptr ) ; diff --git a/inc/VDispAnalyzer.h b/inc/VDispAnalyzer.h index ef07df34..54b2b16e 100644 --- a/inc/VDispAnalyzer.h +++ b/inc/VDispAnalyzer.h @@ -247,7 +247,7 @@ class VDispAnalyzer void setQualityCuts( unsigned int iNImages_min = 0, float iAxesAngles_min = 0., float imaxdist = 1.e5, float imaxloss = 1., float iminfui = 0., float iminwidth = -1., float iminfitstat = -10., - int iminntubes = 0 ) + int iminntubes = 0 ) { fAxesAngles_min = iAxesAngles_min; fNImages_min = iNImages_min; diff --git a/inc/VImageParameterCalculation.h b/inc/VImageParameterCalculation.h index aa86d2bf..75e8d2ea 100644 --- a/inc/VImageParameterCalculation.h +++ b/inc/VImageParameterCalculation.h @@ -66,7 +66,7 @@ class VImageParameterCalculation : public TObject VImageParameterCalculation( unsigned int iShortTree = 0, VEvndispData* iData = 0 ); ~VImageParameterCalculation(); - vector calcLL(bool); //!< calculate image parameters (log like) + vector calcLL( bool ); //!< calculate image parameters (log like) void muonRingFinder(); //!< fit a single ring to the image to look for muons void sizeInMuonRing(); //! calculate the brightness of the muon ring void muonPixelDistribution(); //!< determine the distribution of pixels in the image diff --git a/inc/VTableLookupDataHandler.h b/inc/VTableLookupDataHandler.h index db02a0d7..3ebe6223 100644 --- a/inc/VTableLookupDataHandler.h +++ b/inc/VTableLookupDataHandler.h @@ -502,7 +502,7 @@ class VTableLookupDataHandler return fOutFile; } double* getSize( double iSizeCorrection = 1., bool iSelectedImagesOnly = false ); - double* getSize( double iSizeCorrection, ULong64_t iTelType, bool iSelectedImagesOnly); + double* getSize( double iSizeCorrection, ULong64_t iTelType, bool iSelectedImagesOnly ); double* getWeight() { return fweight;