Ignore:
Timestamp:
12/15/19 18:04:36 (5 years ago)
Author:
tbretz
Message:
Fixed Error calculation for final spectrum, it is difficult to keep usage of the zenith angle consistent. To avoid strange features in the plots, the best is to use the telescope pointing for data and correlate it with the particle direction for simulations.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/spectrum/analysis.sql

    r19893 r19907  
    1111   returned. (Note that you must not add a comma behind it)
    1212
    13    100| %100:columns
    14    101| %101:files:: table containing the `FileId`s to analyze.
    15    102| %102:runinfo:: table with the run info data
    16    103| %103:events:: table with the image parameters
    17    104| %104:positions:: table with the source positions in the camera
    18    105| %105:estimator:: estimator for log10 energy
     13   100| %100:files:: table containing the `FileId`s to analyze.
     14   101| %101:runinfo:: table with the run info data
     15   102| %102:events:: table with the image parameters
     16   103| %103:positions:: table with the source positions in the camera
     17   104| %105:zenith:: zenith angle in degrees
     18   105| %104:columns
     19   106| %105:estimator:: estimator for log10 energy
     20
     21   WARNING:
     22     Right now, we correlate the mean zenith angle of the data
     23     file with the particle direction in the simulation!
    1924
    2025*************************************************************************** */
     
    2328(
    2429   SELECT
    25       %100:columns  -- this could be removed if we can join events via the same columns (without CorsikaNumResuse)
     30      %105:columns  -- this could be removed if we can join events via the same columns (without CorsikaNumResuse)
     31      %104:zenith AS Theta,
    2632      Weight,
    2733      Size,
     
    4046      cosa*Y + sina*X   AS PY
    4147   FROM
    42       %101:files
     48      %100:files
    4349   LEFT JOIN
    44       %102:runinfo USING (FileId)
     50      %101:runinfo USING (FileId)
    4551   LEFT JOIN
    46       %103:events USING (FileId)  -- This could be replaced by a user uploaded temporary table
     52      %102:events USING (FileId)  -- This could be replaced by a user uploaded temporary table
    4753   LEFT JOIN
    48       %104:positions USING (FileId, EvtNumber)
     54      %103:positions USING (FileId, EvtNumber)
    4955   CROSS JOIN
    5056      Wobble
     
    6066(
    6167   SELECT
    62       %100:columns
    63       Weight,
     68      %105:columns
     69      Theta, Weight,
    6470      Size, CosDelta, SinDelta, M3Long, SlopeLong, Leakage1, WdivL,
    6571      MeanX - PX/1.02e0 AS DX,
     
    7480(
    7581   SELECT
    76       %100:columns
    77       Weight,
     82      %105:columns
     83      Theta, Weight,
    7884      Size, CosDelta, SinDelta, DX, DY, M3Long, SlopeLong, Leakage1, WdivL,
    7985      SQRT(DX*DX + DY*DY) AS Norm
     
    8591(
    8692   SELECT
    87       %100:columns
    88       Weight,
     93      %105:columns
     94      Theta, Weight,
    8995      Size, M3Long, SlopeLong, Leakage1, WdivL, Norm,
    9096      LEAST(GREATEST((CosDelta*DY - SinDelta*DX)/Norm, -1), 1) AS LX,
     
    97103(
    98104   SELECT
    99       %100:columns
    100       Weight,
     105      %105:columns
     106      Theta, Weight,
    101107      Size, Leakage1, WdivL, LX,
    102108      Norm          *0.0117193246260285378e0 AS Dist,
     
    110116(
    111117   SELECT
    112       %100:columns
    113       Weight,
     118      %105:columns
     119      Theta, Weight,
    114120      Size, WdivL, Dist, LX, M3L, Slope,
    115121      1.39252e0 + 0.154247e0*Slope + 1.67972e0*(1-1/(1+4.86232e0*Leakage1)) AS Xi
     
    121127(
    122128   SELECT
    123       %100:columns
    124       Weight,
     129      %105:columns
     130      Theta, Weight,
    125131      Size, Dist, LX,
    126132      IF (M3L<-0.07 OR (Dist-0.5e0)*7.2e0-Slope<0, -Xi, Xi) * (1-WdivL) AS Disp
     
    130136
    131137SELECT
    132    %100:columns
    133    Weight,
     138   %105:columns
     139   Theta, Weight,
    134140   (Disp*Disp + Dist*Dist - 2*Disp*Dist*SQRT(1-LX*LX)) AS ThetaSq,
    135    %105:estimator AS LogEnergyEst
     141   %106:estimator AS LogEnergyEst
    136142FROM
    137143   Table7
Note: See TracChangeset for help on using the changeset viewer.