Ignore:
Timestamp:
05/05/19 21:28:59 (6 years ago)
Author:
Daniela Dorner
Message:
added fluxes, added menu for analyses, cleaned-up y-pulldown
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/dch/db_explorer.php

    r19500 r19501  
    7676   $offset = 0;
    7777
     78switch($table)
     79{
     80case "LP":
     81    $zdfactor="(pow(cos(fZenithDistanceMean*PI()/180),3)+14.8/21.9*pow(sin(2*fZenithDistanceMean*PI()/180),5))";
     82    $thfactor="(1-0.00124/1.21*(fThresholdMinSet-500)*(fThresholdMinSet>=500))";
     83    // ETh: 715 GeV
     84    $crabflux="3.6";
     85    break;
     86case "ISDC":
     87    $zdfactor="pow(cos(fZenithDistanceMean*PI()/180)*exp(1-cos(fZenithDistanceMean*PI()/180)),4.2)";
     88    $thfactor="(1.18-IF(ISNULL(fThresholdMinSet),fThresholdMedian,fThresholdMinSet)*0.00062)";
     89    // ETh: 764 GeV
     90    $crabflux="3.3";
     91case "CutsLC":
     92    $zdfactor="pow(cos(fZenithDistanceMean*PI()/180)*exp(1-cos(fZenithDistanceMean*PI()/180)),4.5)";
     93    $thfactor="(1.37-IF(ISNULL(fThresholdMinSet),fThresholdMedian,fThresholdMinSet)*0.00118)";
     94    // ETh: 543 GeV
     95    $crabflux="5.7";
     96default:
     97    $zdfactor="0";
     98    $thfactor="0";
     99    $crabflux="0";
     100    break;
     101}
     102
     103
    78104/*
    79105$join   = isset($_GET["join"]) ? "LEFT JOIN ".$_GET["join"]." USING(fNight,fRunID)" : "";
     
    112138    $g = $_GET["good"];
    113139
    114     if ($g&0x1) $good .= " AND fNumThreshold750/(cos(fZenithDistanceMean*PI()/180)+0.179*pow(sin(1.89*fZenithDistanceMean*PI()/180),5))/TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart))/fEffectiveOn>3.7 ";
    115     if ($g&0x2) $good .= " AND ((fNumEvtsAfterCleaning*1.0-fNum27Sec*1.0)/((-2381.1+2766.3*LOG10(fThresholdMinSet)-1049.9*POW(LOG10(fThresholdMinSet),2)+131.05*POW(LOG10(fThresholdMinSet),3))/21.15)/(COS(fZenithDistanceMean*PI()/180)+0.179*POW(SIN(1.89*fZenithDistanceMean*PI()/180),5)))/(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart))*fEffectiveOn)>16.2 ";
    116     if ($g&0x4) $good .= " AND (fNumEvtsAfterQualCuts/(cos(fZenithDistanceMean*PI()/180)+0.179*pow(sin(1.89*fZenithDistanceMean*PI()/180),5))/((8598.9- 13181*log10(fThresholdMinSet)+7567.4*pow(log10(fThresholdMinSet),2)-1925.2*pow(log10(fThresholdMinSet),3)+183*pow(log10(fThresholdMinSet),4))/9.2 ))/(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart))*fEffectiveOn)>6.7 ";
    117     if ($g&0x8) $good .= " AND (fNumEvtsAfterBgCuts/(1.41*POW(fZenithDistanceMean*PI()/180,2)+0.975)/(-7.53e-12*POW(10, LOG10(fThresholdMinSet)*3.69)+1.035) )/(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart))*fEffectiveOn)>0.6 ";
     140    if ($g&0x1) $good .= " AND fR750Cor/fR750Ref BETWEEN 0.93 AND 1.3 ";
     141    if ($g&0x2) $good .= " AND fZenithDistance < 45 ";
     142    if ($g&0x4) $good .= " AND IF (ISNULL(fThresholdMinSet), fThresholdMedian, fThresholdMinSet) < 550 ";
     143    if ($g&0x8) $good .= " AND fTNGDust<10 ";
    118144}
    119145
     
    360386    $selecty="SUM(fNumSigEvts)/SUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart))*fEffectiveOn)";
    361387    $isnull="AND NOT ISNULL(fNumSigEvts)";
    362     $titley="Signal events";
     388    $titley="Signal rate";
    363389    break;
    364390case 5:
    365391    $selecty="SUM(fNumBgEvts)/SUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart))*fEffectiveOn)";
    366392    $isnull="AND NOT ISNULL(fNumBgEvts)";
    367     $titley="Background events";
     393    $titley="Background rate";
    368394    break;
    369395case 6:
     
    371397    $selecterr="EXCERR(SUM(fNumSigEvts), SUM(fNumBgEvts))/SUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart))*fEffectiveOn)*3600";
    372398    $isnull="AND NOT ISNULL(fNumExcEvts) AND NOT ISNULL(fEffectiveOn)";
    373     $titley="Excess events";
     399    $titley="Excess rate";
    374400    $unity="[1/h]";
     401    $errors = $noerr ? 0 : 1;
     402    break;
     403case 31:
     404    $selecty="SUM(fNumExcEvts/".$zdfactor."/".$thfactor.")*3600/SUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart))*fEffectiveOn)";
     405    $selecterr="EXCERR(SUM(fNumSigEvts), SUM(fNumBgEvts))/SUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart))*fEffectiveOn)*3600*SUM(fNumExcEvts/".$zdfactor."/".$thfactor.")/SUM(fNumExcEvts)";
     406    $isnull="AND NOT ISNULL(fNumExcEvts) AND NOT ISNULL(fEffectiveOn) AND NOT ISNULL(fZenithDistanceMean) AND NOT (ISNULL(fThresholdMinSet) AND ISNULL(fThresholdMedian)) ";
     407    $sqlhaving=" AND e < 1000 ";
     408    $titley="Corrected excess rate";
     409    $unity="[1/h]";
     410    $errors = $noerr ? 0 : 1;
     411    break;
     412case 32:
     413    $selecty="SUM(fNumExcEvts/".$zdfactor."/".$thfactor."/fCU)*3600/SUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart))*fEffectiveOn)";
     414    $selecterr="EXCERR(SUM(fNumSigEvts), SUM(fNumBgEvts))/SUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart))*fEffectiveOn)*3600*SUM(fNumExcEvts/".$zdfactor."/".$thfactor."/fCU)/SUM(fNumExcEvts)";
     415    $isnull="AND NOT ISNULL(fNumExcEvts) AND NOT ISNULL(fEffectiveOn) AND NOT ISNULL(fZenithDistanceMean) AND NOT (ISNULL(fThresholdMinSet) AND ISNULL(fThresholdMedian)) ";
     416    $sqlhaving=" AND e < 1000 ";
     417    $titley="Flux";
     418    $unity="[CU]";
     419    $errors = $noerr ? 0 : 1;
     420    break;
     421case 33:
     422    $selecty=$crabflux." * SUM(fNumExcEvts/".$zdfactor."/".$thfactor."/fCU)*3600/SUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart))*fEffectiveOn)";
     423    $selecterr=$crabflux." * EXCERR(SUM(fNumSigEvts), SUM(fNumBgEvts))/SUM(TIME_TO_SEC(TIMEDIFF(fRunStop,fRunStart))*fEffectiveOn)*3600*SUM(fNumExcEvts/".$zdfactor."/".$thfactor."/fCU)/SUM(fNumExcEvts)";
     424    $isnull="AND NOT ISNULL(fNumExcEvts) AND NOT ISNULL(fEffectiveOn) AND NOT ISNULL(fZenithDistanceMean) AND NOT (ISNULL(fThresholdMinSet) AND ISNULL(fThresholdMedian)) ";
     425    $sqlhaving=" AND e < 1000 ";
     426    $titley="Flux";
     427    $unity="[10^-11/cm2/s]";
    375428    $errors = $noerr ? 0 : 1;
    376429    break;
     
    898951
    899952    $( "#source" ).selectmenu();
     953    $( "#table" ).selectmenu();
    900954
    901955    $("#input_y").prop('disabled', $rate<42);
     
    905959    $('#select_y').val($rate).selectmenu("refresh");
    906960    $('#source').val($source).selectmenu("refresh");
     961    $('#table').val('$table').selectmenu("refresh");
    907962    $('#sql_cut').val("$cut");
    908963    $('#input_x').val("$sql_x");
     
    11771232         <option value="42">Average</option>
    11781233      </optgroup>
    1179       <optgroup label="Analysis event rates [Effective on time]">
     1234      <optgroup label="Light curves">
     1235         <option value="6">Excess rate</option>
     1236         <option value="31">Corrected excess rate (Zd/TH)</option>
     1237         <option value="32">Flux [CU]</option>
     1238         <option value="33">Flux [10^-11/cm2/s]</option>
     1239      </optgroup>
     1240      <optgroup label="Analysis event rates [Eff. ontime]">
    11801241         <option value="5">Background rate</option>
    11811242         <option value="17">Signal rate</option>
    11821243         <option value="6">Excess rate</option>
    11831244      </optgroup>
    1184       <optgroup label="Raw event rates [Effective on time]">
     1245      <optgroup label="Raw event rates [Eff. ontime]">
    11851246         <option value="21">Physics trigger</option>
    11861247         <option value="22">Physics trigger minus 27s events</option>
     
    11921253      </optgroup>
    11931254
    1194       <optgroup label="Corrected [Zd/TH] event rates [Eff. on time]">
     1255<!--
     1256      <optgroup label="Corrected [Zd/TH] event rates [Eff. ontime]">
    11951257         <option value="20">Events after cleaning minus 27s events</option>
    11961258         <option value="24">Events after background cuts</option>
     
    11981260         <option value="16">Artifical trigger TH750</option>
    11991261      </optgroup>
    1200 
    1201       <optgroup label="Artificial trigger rates [Effective on time]">
     1262-->
     1263      <optgroup label="Artificial trigger rates [Eff. ontime]">
    12021264         <option value="7">27s events</option>
    12031265         <option value="8">TH500</option>
     
    12111273
    12121274      <optgroup label="On time comparison">
    1213          <option value="15">Avg difference Eff. on time minus Stop-Start time</option>
    1214          <option value="26">Avg difference Eff. on time minus OnTimeAfterCuts</option>
     1275         <option value="15">Avg Eff. ontime minus Stop-Start time</option>
     1276         <option value="26">Avg Eff. ontime minus OnTimeAfterCuts</option>
    12151277         <option value="27">Avg Stop-Start time minus OnTimeAfterCuts</option>
    12161278         <option value="18">Avg FTM effective on time</option>
    1217          <option value="19">Sum FTM on time divided by Sum FTM elapsed time</option>
    1218       </optgroup>
    1219 
     1279         <option value="19">Sum(FTM ontime) / Sum(FTM elapsed time)</option>
     1280      </optgroup>
     1281
     1282<!--
    12201283      <optgroup label="Others">
    12211284         <option value="28">Excess rate correction factor (fNumEvtsAfterBgCuts / PRELIMINARY)</option>
     
    12231286         <option value="30">Excess rate correction factor (fNumExcEvts / PRELIMINARY)</option>
    12241287      </optgroup>
     1288-->
    12251289    </select>
    12261290
     
    12321296      <optgroup label="Sources">
    12331297$sourceoptions
     1298      </optgroup>
     1299    </select>
     1300
     1301    <label for="table">Analysis</label>
     1302    <select name="t" id="table">
     1303      <optgroup label="Online Analysis">
     1304        <option value="LP">QLA</option>
     1305      </optgroup>
     1306      <optgroup label="Offline Analyses">
     1307        <option value="ISDC">ISDC</option>
     1308        <option value="CutsLC">CutsLC</option>
    12341309      </optgroup>
    12351310    </select>
     
    13541429  <dt>&r = 24</dt><dd>Rate after background cuts runwise corrected for zenith angle and threshold</dd>
    13551430  <dt>&r = 25</dz><dd>Rate after quallity cuts runwise corrected for zenith angle and threshold</dd>
     1431  <dt>&r = 31</dt><dd>corrected excess rate</dd>
     1432  <dt>&r = 32</dt><dd>flux [CU]</dd>
     1433  <dt>&r = 33</dt><dd>flux [10^-11/cm2/s]</dd>
    13561434  <dt>&r = 42</dz><dd>Plot average of &y=... (profile histogram with &y as weights)</dd>
    13571435  <dt>&r = 43</dz><dd>Plot sum of &y=... (histogram with &y as weights)</dd>
     
    13731451  <dt>&print</dt><dd>Show the plot only [&print] </dd>
    13741452  <dt>&s=...</dt><dd>Restrict to given source id [eg. &s=5] </dd>
    1375   <dt>&t=...</dt><dd>Choose table with analysis results (ISDC, LP:default) [eg. &t=ISDC] </dd>
     1453  <dt>&t=...</dt><dd>Choose table with analysis results (CutsLC, ISDC, LP:default) [eg. &t=CutsLC] </dd>
    13761454  <dt>&cut=...</dt><dd>Additional where statement to be added with AND [eg. &cut=fZenithDistance&lt;35]</dd>
    13771455  <dt>&min=...</dt><dd>y-axis minimum [eg. &min=0]</dd>
     
    13851463  <dt>&sum=...</dt><dd>short for &y=... [forces &r=43, eg. &y=fOnTime]</dd>
    13861464  <dt>&hist=...</dt><dd>short for &x=...  [forces &r=45, eg. &y=fOnTime]</dd>
     1465  <dt>&good=...</dt><dd>some predefined data quality selection: 1 (standard datacheck with R750), 2 (zd<45), 3 (TH<550), 4 (Dust<10), values can be combined [eg. &good=14]</dd>
    13871466</dl>
    13881467</div>
Note: See TracChangeset for help on using the changeset viewer.