source: trunk/Mars/datacenter/db/factdefs.php@ 14156

Last change on this file since 14156 was 14156, checked in by Daniela Dorner, 12 years ago
small fix for entries where only one of the new checksums is filled
  • Property svn:executable set to *
File size: 4.1 KB
Line 
1<?php
2
3$checkwhere = array
4 (
5 "fRunTypeName" => CheckWhere("fRunTypeKEY"),
6 );
7
8$checkgroup = array
9 (
10 "fRunTypeName" => CheckGroup("fRunTypeKEY"),
11 );
12
13
14 //don't put a '#' at the beginning of the alias, else SortBy won't work anymore
15$alias = array
16 (
17 "NumRuns" => "#Runs",
18 "Run" => "Run",
19 "fRunTypeName" => "RunType",
20 "if(isnull(fCheckSum)+isnull(fDataSum),Concat(fMd5sumRaw,\"/\",fMd5sumRawZip),Concat(fCheckSum,\"/\",fDataSum))" => "checksum",
21 "fROI" => "roi",
22 "fROITimeMarker" => "roi-tm",
23 "fLastUpdate" => "LastUpd",
24 //"SUM(fRunTime)/3600" => "Time [h]",
25 "SUM(fNumEvents)" => "Evts",
26 "Min(fZenithDistanceMin)" => "ZDMin",
27 "Max(fZenithDistanceMax)" => "ZDMax",
28 "Min(fZenithDistance)" => "ZdMin",
29 "Max(fZenithDistance)" => "ZdMax",
30 "fNumEvents" => "#Evts",
31 "fRunStart" => "start",
32 "fRunStop" => "stop",
33 "fFitsFileErrors" => "file err",
34 "fCompileTime" => "compiled",
35 "fRevisionNumber" => "rev#",
36 "if(fHasDrsFile=0,\"N\",fDrsStep)" => "drs",
37 "TimeDiff(fRunStop,fRunStart)" => "duration",
38 "Round(fNumPhysicsTrigger/Time_to_sec(TimeDiff(fRunStop,fRunStart)),1)" => "phys<br>rate<br>[Hz]",
39 "fNumPhysicsTrigger" => "#Phys",
40 "fNumExt1Trigger" => "#Ext1",
41 "fNumExt2Trigger" => "#Ext2",
42 "fNumELPTrigger" => "#ELP",
43 "fNumILPTrigger" => "#ILP",
44 "fNumPedestalTrigger" => "#Ped",
45 "fNumTimeTrigger" => "#Time",
46 "fNumOtherTrigger" => "#Other",
47 //"Round(Sum(TimeDiff(fRunStop,fRunStart))/60./60.,1)" => "Time [h]",
48 "fTriggerRateMedian" => "median rate",
49 "fBiasVoltageMedian" => "median bias",
50 "fThresholdMedian" => "median<br>threshold",
51 "fRightAscension" => "RA",
52 "fDeclination" => "Decl",
53 "fZenithDistanceMean" => "Zd",
54 "fAzimuthMean" => "Az",
55 //"Sec_to_time(Sum(Time_to_sec(TimeDiff(fRunStop,fRunStart))))" => "Time<br>[hh:mm:ss]",
56 //"Time [hh:mm:ss]" => "Time<br>[hh:mm:ss]",
57 );
58
59
60$rightalign = array
61 (
62 //$alias["fRunTypeName"] => "1",
63 $alias["fNumEvents"] => "1",
64 $alias["Round(fNumPhysicsTrigger/Time_to_sec(TimeDiff(fRunStop,fRunStart)),1)"] => "1",
65 $alias["fNumPhysicsTrigger"] => "1",
66 $alias["fNumExt1Trigger"] => "1",
67 $alias["fNumExt2Trigger"] => "1",
68 $alias["fNumELPTrigger"] => "1",
69 $alias["fNumILPTrigger"] => "1",
70 $alias["fNumPedestalTrigger"] => "1",
71 $alias["fNumTimeTrigger"] => "1",
72 $alias["fNumOtherTrigger"] => "1",
73 $alias["fFitsFileErrors"] => "1",
74 $alias["fRevisionNumber"] => "1",
75 $alias["fROI"] => "1",
76 $alias["fROITimeMarker"] => "1",
77 //"Time [h]" => "1",
78 "Time<br>[hh:mm:ss]" => "1",
79 "NumRuns" => "1",
80 "Evts" => "1",
81);
82
83function GetCheck($fromtable, $val)
84{
85 $checks = array
86 (
87 "fRunTypeName" => $fromtable . ".fRunTypeKEY",
88 );
89
90 $check="";
91 if (!empty($checks[$val]))
92 $check=$checks[$val];
93 return $check;
94}
95
96
97function GetJoin($fromtable, $val)
98{
99 $joins = array
100 (
101 "fRunTypeName" => " LEFT JOIN RunType USING(fRunTypeKEY) ",
102 );
103
104
105 $join="";
106 if (!empty($joins[$val]))
107 $join=$joins[$val];
108 return $join;
109}
110
111
112?>
Note: See TracBrowser for help on using the repository browser.