|
20 | 20 | using namespace std; |
21 | 21 |
|
22 | 22 | double readMeanElevation( TFile* fIn ); |
| 23 | +double readWobbleOffset( TFile* fIn, bool printInteger ); |
23 | 24 |
|
24 | 25 | bool readRunParameter( TFile* fIn, string iPara ) |
25 | 26 | { |
@@ -110,34 +111,37 @@ bool readRunParameter( TFile* fIn, string iPara ) |
110 | 111 | cout << "\t" << fPar->fRunDuration; |
111 | 112 | cout << "\t" << fPar->fTargetName; |
112 | 113 | cout << "\t" << 90. - readMeanElevation( fIn ); |
| 114 | + cout << "\t" << readWobbleOffset( fIn, false ); |
| 115 | + cout << "\t" << readWobbleOffset( fIn, true ); |
113 | 116 | cout << endl; |
114 | 117 | } |
115 | 118 |
|
116 | 119 | return true; |
117 | 120 | } |
118 | 121 |
|
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 ) |
120 | 126 | { |
| 127 | + double fWobble = -999; |
| 128 | + double fWobble_int = -99; |
121 | 129 | if(!fIn ) |
122 | 130 | { |
123 | | - return false; |
| 131 | + if( printInteger ) return fWobble_int; |
| 132 | + else return fWobble; |
124 | 133 | } |
125 | 134 | VEvndispRunParameter* fPar = ( VEvndispRunParameter* )fIn->Get( "runparameterV2" ); |
126 | 135 | if( fPar ) |
127 | 136 | { |
128 | | - cout << "Wobble offset: "; |
129 | 137 | if( printInteger ) |
130 | 138 | { |
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. ); |
132 | 140 | } |
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 ); |
139 | 142 | } |
140 | | - return false; |
| 143 | + if( printInteger ) return fWobble_int; |
| 144 | + return fWobble; |
141 | 145 | } |
142 | 146 |
|
143 | 147 | /* |
@@ -342,7 +346,7 @@ int main( int argc, char* argv[] ) |
342 | 346 | } |
343 | 347 | else if( fOption.find( "-wobble" ) != string::npos ) |
344 | 348 | { |
345 | | - readWobbleOffset( fIn, ( fOption.find( "-wobbleInt" ) != string::npos ) ); |
| 349 | + cout << "Wobble offset: " << readWobbleOffset( fIn, ( fOption.find( "-wobbleInt" ) != string::npos ) ) << endl; |
346 | 350 | } |
347 | 351 | else if( fOption == "-mcaz" || fOption == "-runnumber" ) |
348 | 352 | { |
|
0 commit comments