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

Last change on this file since 13408 was 13314, checked in by Daniela Dorner, 13 years ago
corrected names of columns
  • 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 "fMd5sumRaw" => "md5",
21 "fMd5sumRawZip" => "md5(zip)",
22 "fROI" => "roi",
23 "fROITimeMarker" => "roi-tm",
24 "fLastUpdate" => "LastUpd",
25 //"SUM(fRunTime)/3600" => "Time [h]",
26 "SUM(fNumEvents)" => "Evts",
27 "Min(fZenithDistanceMin)" => "ZDMin",
28 "Max(fZenithDistanceMax)" => "ZDMax",
29 "Min(fZenithDistance)" => "ZdMin",
30 "Max(fZenithDistance)" => "ZdMax",
31 "fNumEvents" => "#Evts",
32 "fRunStart" => "start",
33 "fRunStop" => "stop",
34 "fFitsFileErrors" => "file err",
35 "fCompileTime" => "compiled",
36 "fRevisionNumber" => "rev#",
37 "if(fHasDrsFile=0,\"N\",fDrsStep)" => "drs",
38 "TimeDiff(fRunStop,fRunStart)" => "duration",
39 "Round(fNumPhysicsTrigger/Time_to_sec(TimeDiff(fRunStop,fRunStart)),1)" => "phys<br>rate<br>[Hz]",
40 "fNumPhysicsTrigger" => "#Phys",
41 "fNumExt1Trigger" => "#Ext1",
42 "fNumExt2Trigger" => "#Ext2",
43 "fNumELPTrigger" => "#ELP",
44 "fNumILPTrigger" => "#ILP",
45 "fNumPedestalTrigger" => "#Ped",
46 "fNumTimeTrigger" => "#Time",
47 "fNumOtherTrigger" => "#Other",
48 //"Round(Sum(TimeDiff(fRunStop,fRunStart))/60./60.,1)" => "Time [h]",
49 "fTriggerRateMedian" => "median rate",
50 "fBiasVoltageMedian" => "median bias",
51 "fThresholdMedian" => "median<br>threshold",
52 "fRightAscension" => "RA",
53 "fDeclination" => "Decl",
54 "fZenithDistanceMean" => "Zd",
55 "fAzimuthMean" => "Az",
56 //"Sec_to_time(Sum(Time_to_sec(TimeDiff(fRunStop,fRunStart))))" => "Time<br>[hh:mm:ss]",
57 //"Time [hh:mm:ss]" => "Time<br>[hh:mm:ss]",
58 );
59
60
61$rightalign = array
62 (
63 //$alias["fRunTypeName"] => "1",
64 $alias["fNumEvents"] => "1",
65 $alias["Round(fNumPhysicsTrigger/Time_to_sec(TimeDiff(fRunStop,fRunStart)),1)"] => "1",
66 $alias["fNumPhysicsTrigger"] => "1",
67 $alias["fNumExt1Trigger"] => "1",
68 $alias["fNumExt2Trigger"] => "1",
69 $alias["fNumELPTrigger"] => "1",
70 $alias["fNumILPTrigger"] => "1",
71 $alias["fNumPedestalTrigger"] => "1",
72 $alias["fNumTimeTrigger"] => "1",
73 $alias["fNumOtherTrigger"] => "1",
74 $alias["fFitsFileErrors"] => "1",
75 $alias["fRevisionNumber"] => "1",
76 $alias["fROI"] => "1",
77 $alias["fROITimeMarker"] => "1",
78 //"Time [h]" => "1",
79 "Time<br>[hh:mm:ss]" => "1",
80 "NumRuns" => "1",
81 "Evts" => "1",
82);
83
84function GetCheck($fromtable, $val)
85{
86 $checks = array
87 (
88 "fRunTypeName" => $fromtable . ".fRunTypeKEY",
89 );
90
91 $check="";
92 if (!empty($checks[$val]))
93 $check=$checks[$val];
94 return $check;
95}
96
97
98function GetJoin($fromtable, $val)
99{
100 $joins = array
101 (
102 "fRunTypeName" => " LEFT JOIN RunType USING(fRunTypeKEY) ",
103 );
104
105
106 $join="";
107 if (!empty($joins[$val]))
108 $join=$joins[$val];
109 return $join;
110}
111
112
113?>
Note: See TracBrowser for help on using the repository browser.