- Timestamp:
- 03/16/15 16:18:36 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/MarsWobble/msim/MSimPointingPos.cc
r17846 r18163 39 39 // 40 40 // If no view cone option was given and off-target observations are switched 41 // on by setting fOffTargetDistance!=0 the poi tnting position is calculated:41 // on by setting fOffTargetDistance!=0 the pointing position is calculated: 42 42 // 43 43 // 1) fOffTargetDistance < 0: … … 51 51 // fOffTargetDistance. (phi==0 is the direction of positive theta) 52 52 // 53 // The original zenith and azimuth coordinates of the shower axis are stored in 54 // the MSimSourcePos container. 55 // 56 // If the view cone option was given and off-target observations are switched on 57 // the orientation is fixed to the main direction around the view cone was 58 // produced. 59 // In addition a 'quasi'-simulated source position is calculated, 60 // depending on fOffTargetDistance and fOffTargetPhi (see 1) and 2) above). 61 // The corresponding zenith and azimuth coordinates are stored in the 62 // MSimSourcePos container. This is of course not a physical source position, 63 // but it can be used to determine the performance of wobble analysis on 64 // background events (which are homogenous distributed). 65 // 66 // 53 67 // 54 68 // Input Containers: … … 58 72 // Output Containers: 59 73 // MPointingPos 74 // MSimSourcePos 60 75 // 61 76 ////////////////////////////////////////////////////////////////////////////// … … 84 99 // 85 100 MSimPointingPos::MSimPointingPos(const char* name, const char *title) 86 : fRunHeader(0), fEvtHeader(0), fPointing(0), 101 : fRunHeader(0), fEvtHeader(0), fPointing(0), fSimSourcePosition(0), 87 102 fOffTargetDistance(0), fOffTargetPhi(-1) 88 103 … … 139 154 { 140 155 fPointing = (MPointingPos*)pList->FindCreateObj("MPointingPos"); 156 if (!fPointing) 157 return kFALSE; 158 159 fSimSourcePosition = (MPointingPos*)pList->FindCreateObj("MPointingPos","MSimSourcePos"); 141 160 if (!fPointing) 142 161 return kFALSE; … … 180 199 { 181 200 *fLog << warn; 182 *fLog << "WARNING - Combining the view cone option with off-target observations doesn't make sense." << endl;183 *fLog << " Option for off-target observations will be ignored." << endl;201 *fLog << "WARNING - Combining the view cone option with off-target pointing can lead to not homogenous events." << endl; 202 *fLog << " A simulated source position according to the off-target parameters will be created instead." << endl; 184 203 } 185 204 // FIXME: Check also the enlightened region on the ground! … … 209 228 210 229 // Local sky coordinates (direction of telescope axis) 211 Double_t zd = viewcone ? fRunHeader->GetZdMin() : fEvtHeader->GetZd()*TMath::RadToDeg(); // x==north 212 Double_t az = viewcone ? fRunHeader->GetAzMin() : fEvtHeader->GetAz()*TMath::RadToDeg(); // y==west 213 214 if (!viewcone) 215 { 216 Double_t dtheta, dphi; 217 GetDelta(dtheta, dphi); 218 219 const Double_t theta = zd*TMath::DegToRad(); 220 const Double_t phi = az*TMath::DegToRad(); 221 222 TVector3 src, pnt; 223 src.SetMagThetaPhi(1, theta, phi); 224 pnt.SetMagThetaPhi(1, theta+dtheta, phi); 225 226 pnt.Rotate(dphi, src); 227 228 zd = pnt.Theta()*TMath::RadToDeg(); 229 az = pnt.Phi() *TMath::RadToDeg(); 230 } 230 Double_t zdCorsika = viewcone ? fRunHeader->GetZdMin() : fEvtHeader->GetZd()*TMath::RadToDeg(); // x==north 231 Double_t azCorsika = viewcone ? fRunHeader->GetAzMin() : fEvtHeader->GetAz()*TMath::RadToDeg(); // y==west 232 233 // Calculate off target position in local sky coordinates 234 Double_t dtheta, dphi; 235 GetDelta(dtheta, dphi); 236 237 const Double_t theta = zdCorsika*TMath::DegToRad(); 238 const Double_t phi = azCorsika*TMath::DegToRad(); 239 240 TVector3 originalVector, wobbleVector; 241 originalVector.SetMagThetaPhi(1, theta, phi); 242 wobbleVector.SetMagThetaPhi(1, theta+dtheta, phi); 243 244 wobbleVector.Rotate(dphi, originalVector); 245 246 Double_t zdWobble, azWobble; 247 zdWobble = wobbleVector.Theta()*TMath::RadToDeg(); 248 azWobble = wobbleVector.Phi() *TMath::RadToDeg(); 231 249 232 250 // Transform the corsika coordinate system (north is magnetic north) 233 251 // into the telescopes local coordinate system. Note, that all vectors 234 252 // are already correctly oriented. 235 az += fRunHeader->GetMagneticFieldAz()*TMath::RadToDeg(); 236 237 // Setup the pointing position 238 fPointing->SetLocalPosition(zd, az); 239 240 // Calculate incident angle between magnetic field direction 241 // and pointing direction ( phi and theta? ) 253 azCorsika += fRunHeader->GetMagneticFieldAz()*TMath::RadToDeg(); 254 azWobble += fRunHeader->GetMagneticFieldAz()*TMath::RadToDeg(); 255 256 // Setup the pointing and the simulated source position 257 if (!viewcone) 258 { 259 fPointing->SetLocalPosition(zdWobble, azWobble); 260 fSimSourcePosition->SetLocalPosition(zdCorsika, azCorsika); 261 } 262 else 263 { 264 fPointing->SetLocalPosition(zdCorsika, azCorsika); 265 fSimSourcePosition->SetLocalPosition(zdWobble, azWobble); 266 } 242 267 243 268 return kTRUE;
Note:
See TracChangeset
for help on using the changeset viewer.