Changeset 18280
- Timestamp:
- 08/18/15 10:16:43 (9 years ago)
- Location:
- trunk/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars
- Property svn:mergeinfo changed
/branches/MarsWobble (added) merged: 18160-18165,18278-18279
- Property svn:mergeinfo changed
-
trunk/Mars/mfileio/MWriteFitsFile.cc
r17868 r18280 519 519 520 520 // initialize all columns of the sub-table, defined by the current container 521 TString containerName = i_subTable->second.GetContainer()->GetName(); 521 522 TClass * cl = i_subTable->second.GetContainer()->IsA(); 522 if (!InitColumns(i_table->first, TString(cl->GetName()) + ".", fitsTable,523 i_subTable->second.GetContainer(), cl) ) 523 if (!InitColumns(i_table->first, containerName + ".", fitsTable, 524 i_subTable->second.GetContainer(), cl) ) 524 525 return kFALSE; 525 526 -
trunk/Mars/mjobs/MJSimulation.cc
r18158 r18280 247 247 write.AddContainer("IncidentAngle", "Events", kFALSE); 248 248 write.AddContainer("MPointingPos", "Events", kFALSE); 249 write.AddContainer("MSimSourcePos", "Events", kFALSE); 249 250 } 250 251 … … 658 659 write3af.AddContainer("MRawEvtData", "Events"); 659 660 write3af.AddContainer("MTruePhotonsPerPixelCont", "Events"); 660 write3af.AddContainer("MPhotonEvent","Events");661 661 662 662 write3ar.AddContainer("ElectronicNoise", "RunHeaders", kTRUE, 1); -
trunk/Mars/msim/MSimPointingPos.cc
r17846 r18280 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 … … 140 155 fPointing = (MPointingPos*)pList->FindCreateObj("MPointingPos"); 141 156 if (!fPointing) 157 return kFALSE; 158 159 fSimSourcePosition = (MPointingPos*)pList->FindCreateObj("MPointingPos","MSimSourcePos"); 160 if (!fSimSourcePosition) 142 161 return kFALSE; 143 162 … … 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; -
trunk/Mars/msim/MSimPointingPos.h
r9367 r18280 16 16 MCorsikaRunHeader *fRunHeader; //! Header storing event information 17 17 MCorsikaEvtHeader *fEvtHeader; //! Header storing event information 18 MPointingPos *fPointing; //! Output storing telescope poiting position in local (telescope) coordinate system 18 MPointingPos *fPointing; //! Output storing telescope pointing position in local (telescope) coordinate system 19 MPointingPos *fSimSourcePosition; //! Output storing simulated source pointing position in local (telescope) coordinate system 19 20 20 21 Double_t fOffTargetDistance; // [rad] Distance of the observed off-target position from the source
Note:
See TracChangeset
for help on using the changeset viewer.