Skip to content

Commit

Permalink
resolve plotting runs > 100000 for lightcurves
Browse files Browse the repository at this point in the history
  • Loading branch information
GernotMaier committed Feb 18, 2022
1 parent 20f55ea commit 2693d2a
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 9 deletions.
9 changes: 7 additions & 2 deletions inc/VAnaSumRunParameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ class VAnaSumRunParameterDataClass : public TNamed

VAnaSumRunParameterDataClass();
~VAnaSumRunParameterDataClass() {}
ClassDef( VAnaSumRunParameterDataClass, 3 );
bool operator<(const VAnaSumRunParameterDataClass& x) const
{
return fRunOn < x.fRunOn;
}
ClassDef( VAnaSumRunParameterDataClass, 2 );
};

class VAnaSumRunParameter : public TNamed, public VGlobalRunParameter
Expand Down Expand Up @@ -258,9 +262,10 @@ class VAnaSumRunParameter : public TNamed, public VGlobalRunParameter
bool setTargetRADecJ2000( unsigned int i, double ra, double dec, string iTargetName );
bool setTargetRADec_currentEpoch( unsigned int i, double ra, double dec );
bool setTargetShifts( unsigned int i, double west, double north, double ra, double dec );
void sortRunList();
bool writeListOfExcludedSkyRegions();
bool getListOfExcludedSkyRegions( TFile* f );

ClassDef( VAnaSumRunParameter, 14 ) ;
ClassDef( VAnaSumRunParameter, 15 ) ;
};
#endif
1 change: 1 addition & 0 deletions src/VAnaSum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ void VAnaSum::initialize( string i_LongListFilename, string i_ShortListFilename,
///////////////////////////////////////////////////////////////////////////////////////////
if( fAnalysisRunMode == 1 )
{
fRunPara->sortRunList();
// loop over all files in run list and copy histograms
for( unsigned int j = 0; j < fRunPara->fRunList.size(); j++ )
{
Expand Down
5 changes: 4 additions & 1 deletion src/VAnaSumRunParameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,10 @@ double VAnaSumRunParameter::getDeclinationFromStrings( string iDec1, string iDec
return d_tt;
}


void VAnaSumRunParameter::sortRunList()
{
sort( fRunList.begin(), fRunList.end() );
}


//==================================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/VFluxCalculation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2867,7 +2867,7 @@ unsigned int VFluxCalculation::getIndexOfRun( int iRun )
}
}

return 99999;
return 999999;
}

//######################################################################################
Expand Down
19 changes: 16 additions & 3 deletions src/VLightCurve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ bool VLightCurve::initializeTeVLightCurve( string iAnaSumFile, double iDayInterv
fAnaSumFile = iAnaSumFile;

// read full file to get an overview of all available runs
fFluxCombined = new VFluxCalculation( fAnaSumFile, 1, 0, 100000, -99., -99., false );
fFluxCombined = new VFluxCalculation( fAnaSumFile, 1, 0, 1000000, -99., -99., false );
if( fFluxCombined->IsZombie() )
{
cout << "VLightCurve::initializeLightCurve error reading anasum file" << endl;
Expand All @@ -133,11 +133,24 @@ bool VLightCurve::initializeTeVLightCurve( string iAnaSumFile, double iDayInterv
// get MJD for the case that no time limits are given
if( iMJDMin < 0 )
{
iMJDMin = TMath::Floor( fMJD[0] );
iMJDMin = 1000000;
for( unsigned int i = 0; i < fMJD.size(); i++ )
{
if( fMJD[i] > 0 && fMJD[i] < iMJDMin )
{
iMJDMin = TMath::Floor( fMJD[i] );
}
}
}
if( iMJDMax < 0 )
{
iMJDMax = TMath::Floor( fMJD[fMJD.size() - 2] ) + 1;
for( unsigned int i = 0; i < fMJD.size(); i++ )
{
if( fMJD[i] > 0 && fMJD[i] > iMJDMax )
{
iMJDMax = TMath::Floor( fMJD[i] ) + 1;
}
}
}

// plotting parameters
Expand Down
2 changes: 1 addition & 1 deletion src/VLightCurveData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ bool VLightCurveData::fillTeVEvndispData( string iAnaSumFile, double iThresholdS
{
fDataFileName = iAnaSumFile;

VFluxCalculation fFluxCalculation( fDataFileName, 1, 0, 100000, fMJD_min, fMJD_max, false );
VFluxCalculation fFluxCalculation( fDataFileName, 1, 0, 1000000, fMJD_min, fMJD_max, false );
if( fFluxCalculation.IsZombie() )
{
cout << "VLightCurveData::fill error reading anasum file: " << fDataFileName << endl;
Expand Down
2 changes: 1 addition & 1 deletion src/VTS.getRun_TimeElevAzim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ int main( int argc, char* argv[] )
}
else
{
cout << "Error, '" << file_line << "' needs to be a valid runnumber (9999-99999)" << endl;
cout << "Error, '" << file_line << "' needs to be a valid runnumber (9999-999999)" << endl;
return 1 ;
}
}
Expand Down

0 comments on commit 2693d2a

Please sign in to comment.