
Public Member Functions | |
| McCworker () | |
| void | evaluate () |
Private Attributes | |
| Item | McXDir |
| Item | McYDir |
| Item | McZDir |
| float | m_mcRa |
| float | m_mcDec |
| float | m_mcL |
| float | m_mcB |
| float | m_mcZen |
| float | m_mcAzim |
|
|
Definition at line 141 of file McCoordsAlg.cxx. References addItem(), m_mcAzim, m_mcB, m_mcDec, m_mcL, m_mcRa, and m_mcZen.
00143 : McXDir("McXDir") 00144 , McYDir("McYDir") 00145 , McZDir("McZDir") 00146 { 00147 //now create new items 00148 00149 addItem( "McRa", m_mcRa); 00150 addItem( "McDec", m_mcDec); 00151 addItem( "McL", m_mcL); 00152 addItem( "McB", m_mcB); 00153 addItem( "McZenithTheta", m_mcZen); 00154 addItem( "McEarthAzimuth", m_mcAzim); 00155 } |
|
|
Definition at line 157 of file McCoordsAlg.cxx. References m_mcAzim, m_mcB, m_mcDec, m_mcL, m_mcRa, m_mcZen, McXDir, McYDir, and McZDir. Referenced by McCoordsAlg::execute().
00158 {
00159 // convert to (ra, dec)
00160
00161 Vector Mc_t0(McXDir, McYDir, McZDir);
00162 // Mc particle direction points down...
00163 // toSky converts a *particle* direction
00164 // into a direction on the sky, so the minus-sign is taken care of!
00165
00166 astro::SkyDir mcdir = gps->toSky( Mc_t0 );
00167 m_mcRa = mcdir.ra();
00168 m_mcDec = mcdir.dec();
00169 m_mcL = mcdir.l();
00170 m_mcB = mcdir.b();
00171
00172 // Local zenith coordinates
00173 astro::SkyDir zenith(gps->zenithDir()); // pointing direction
00174 double zenith_theta = mcdir.difference(zenith);
00175 if( fabs(zenith_theta)<1e-8) zenith_theta=0;
00176 // all this to do the azimuth angle :-(
00177 Hep3Vector north_pole(0,0,1);
00178 Hep3Vector east_dir( north_pole.cross(zenith()).unit() ); // east is perp to north_pole and zenith
00179 Hep3Vector north_dir( zenith().cross(east_dir));
00180 double earth_azimuth=atan2( mcdir().dot(east_dir), mcdir().dot(north_dir) );
00181 if( earth_azimuth <0) earth_azimuth += 2*M_PI; // to 0-360 deg.
00182 if( fabs(earth_azimuth)<1e-8) earth_azimuth=0;
00183 m_mcZen = zenith_theta*180/M_PI;;
00184 m_mcAzim = earth_azimuth*180/M_PI;
00185
00186 return;
00187 }
|
|
|
Definition at line 71 of file McCoordsAlg.cxx. Referenced by evaluate(), and McCworker(). |
|
|
Definition at line 70 of file McCoordsAlg.cxx. Referenced by evaluate(), and McCworker(). |
|
|
Definition at line 70 of file McCoordsAlg.cxx. Referenced by evaluate(), and McCworker(). |
|
|
Definition at line 70 of file McCoordsAlg.cxx. Referenced by evaluate(), and McCworker(). |
|
|
Definition at line 70 of file McCoordsAlg.cxx. Referenced by evaluate(), and McCworker(). |
|
|
Definition at line 71 of file McCoordsAlg.cxx. Referenced by evaluate(), and McCworker(). |
|
|
Definition at line 65 of file McCoordsAlg.cxx. Referenced by evaluate(). |
|
|
Definition at line 66 of file McCoordsAlg.cxx. Referenced by evaluate(). |
|
|
Definition at line 67 of file McCoordsAlg.cxx. Referenced by evaluate(). |
1.3.3