Skip to content

Commit f4ae4da

Browse files
committed
Add wobble offset to runinfo
1 parent 6f71891 commit f4ae4da

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

src/printRunParameter.cpp

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
using namespace std;
2121

2222
double readMeanElevation( TFile* fIn );
23+
double readWobbleOffset( TFile* fIn, bool printInteger );
2324

2425
bool readRunParameter( TFile* fIn, string iPara )
2526
{
@@ -110,34 +111,37 @@ bool readRunParameter( TFile* fIn, string iPara )
110111
cout << "\t" << fPar->fRunDuration;
111112
cout << "\t" << fPar->fTargetName;
112113
cout << "\t" << 90. - readMeanElevation( fIn );
114+
cout << "\t" << readWobbleOffset( fIn, false );
115+
cout << "\t" << readWobbleOffset( fIn, true );
113116
cout << endl;
114117
}
115118

116119
return true;
117120
}
118121

119-
bool readWobbleOffset( TFile* fIn, bool printInteger )
122+
/*
123+
* Read wobble offset. Optionally return as int (x100).
124+
*/
125+
double readWobbleOffset( TFile* fIn, bool printInteger )
120126
{
127+
double fWobble = -999;
128+
double fWobble_int = -99;
121129
if(!fIn )
122130
{
123-
return false;
131+
if( printInteger ) return fWobble_int;
132+
else return fWobble;
124133
}
125134
VEvndispRunParameter* fPar = ( VEvndispRunParameter* )fIn->Get( "runparameterV2" );
126135
if( fPar )
127136
{
128-
cout << "Wobble offset: ";
129137
if( printInteger )
130138
{
131-
cout << TMath::Nint( sqrt( fPar->fWobbleNorth* fPar->fWobbleNorth + fPar->fWobbleEast* fPar->fWobbleEast ) * 100. );
139+
return TMath::Nint( sqrt( fPar->fWobbleNorth* fPar->fWobbleNorth + fPar->fWobbleEast* fPar->fWobbleEast ) * 100. );
132140
}
133-
else
134-
{
135-
cout << sqrt( fPar->fWobbleNorth* fPar->fWobbleNorth + fPar->fWobbleEast* fPar->fWobbleEast );
136-
}
137-
cout << endl;
138-
return true;
141+
return sqrt( fPar->fWobbleNorth* fPar->fWobbleNorth + fPar->fWobbleEast* fPar->fWobbleEast );
139142
}
140-
return false;
143+
if( printInteger ) return fWobble_int;
144+
return fWobble;
141145
}
142146

143147
/*
@@ -342,7 +346,7 @@ int main( int argc, char* argv[] )
342346
}
343347
else if( fOption.find( "-wobble" ) != string::npos )
344348
{
345-
readWobbleOffset( fIn, ( fOption.find( "-wobbleInt" ) != string::npos ) );
349+
cout << "Wobble offset: " << readWobbleOffset( fIn, ( fOption.find( "-wobbleInt" ) != string::npos ) ) << endl;
346350
}
347351
else if( fOption == "-mcaz" || fOption == "-runnumber" )
348352
{

0 commit comments

Comments
 (0)