Skip to content

Commit

Permalink
fix SizeSecondMax calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
GernotMaier committed Jan 3, 2025
1 parent 8116015 commit 35ce505
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/CData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,8 @@ void CData::reconstruct_3tel_images( unsigned long int telescope_combination )
{
if( size[t] > SizeFirstMax )
{
SizeFirstMax = size[t];
SizeSecondMax = SizeFirstMax;
SizeFirstMax = size[t];
}
else
{
Expand Down
44 changes: 25 additions & 19 deletions src/VTableLookupDataHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,6 @@ int VTableLookupDataHandler::fillNextEvent( bool bShort )
bitset<8 * sizeof(unsigned long )> i_nimage; // for imagepattern
i_nimage.reset();

Double_t SizeFirstMax_temp = -1000.;
Double_t SizeSecondMax_temp = -100.;
for( unsigned int i = 0; i < fNTel; i++ )
{
bool fReadTPars = false;
Expand Down Expand Up @@ -526,18 +524,6 @@ int VTableLookupDataHandler::fillNextEvent( bool bShort )
}
}

if( fsize[i] > SizeSecondMax_temp )
{
if( fsize[i] > SizeFirstMax_temp )
{
SizeSecondMax_temp = SizeFirstMax_temp;
SizeFirstMax_temp = fsize[i];
}
else
{
SizeSecondMax_temp = fsize[i];
}
}
fCurrentNoiseLevel[i] = ftpars[i]->meanPedvar_Image;
fFitstat[i] = ftpars[i]->Fitstat;
if(!bShort )
Expand Down Expand Up @@ -571,11 +557,6 @@ int VTableLookupDataHandler::fillNextEvent( bool bShort )
}
}
fmeanPedvar_Image = calculateMeanNoiseLevel( true );

if( SizeSecondMax_temp > 0. )
{
fSizeSecondMax = SizeSecondMax_temp;
}
//////////////////////////////////////////////////////////
// redo the stereo (direction and core) reconstruction
if( fTLRunParameter->fRerunStereoReconstruction )
Expand All @@ -585,6 +566,31 @@ int VTableLookupDataHandler::fillNextEvent( bool bShort )
doStereoReconstruction( true );
}


// SizeSecondMax calculation
Double_t SizeFirstMax_temp = -1000.;
Double_t SizeSecondMax_temp = -100.;
for( int i = 0; i < fNImages; i++ )
{
unsigned int t = fImgSel_list_short[i];
if( fsize[t] > SizeSecondMax_temp )
{
if( fsize[t] > SizeFirstMax_temp )
{
SizeSecondMax_temp = SizeFirstMax_temp;
SizeFirstMax_temp = fsize[t];
}
else
{
SizeSecondMax_temp = fsize[t];
}
}
}
if( SizeSecondMax_temp > 0. )
{
fSizeSecondMax = SizeSecondMax_temp;
}

// dispEnergy - energy reconstruction using the disp MVA
if( fDispAnalyzerEnergy )
{
Expand Down

0 comments on commit 35ce505

Please sign in to comment.