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 | "fHasDrsFile" => "num drs",
|
---|
36 | "TimeDiff(fRunStop,fRunStart)" => "duration",
|
---|
37 | "Round(fNumPhysicsTrigger/Time_to_sec(TimeDiff(fRunStop,fRunStart)),1)" => "phys<br>rate<br>[Hz]",
|
---|
38 | "fNumPhysicsTrigger" => "#Phys",
|
---|
39 | "fNumExt1Trigger" => "#Ext1",
|
---|
40 | "fNumExt2Trigger" => "#Ext2",
|
---|
41 | "fNumELPTrigger" => "#ELP",
|
---|
42 | "fNumILPTrigger" => "#ILP",
|
---|
43 | "fNumPedestalTrigger" => "#Ped",
|
---|
44 | "fNumTimeTrigger" => "#Time",
|
---|
45 | "fNumOtherTrigger" => "#Other",
|
---|
46 | "Round(Sum(TimeDiff(fRunStop,fRunStart))/60./60.,1)" => "Time [h]",
|
---|
47 | "fTriggerRateMedian" => "mean rate",
|
---|
48 | "fBiasVoltageMedian" => "mean bias",
|
---|
49 | "fThresholdMedian" => "mean threshold",
|
---|
50 | "fRightAscension" => "RA",
|
---|
51 | "fDeclination" => "Decl",
|
---|
52 | );
|
---|
53 |
|
---|
54 |
|
---|
55 | $rightalign = array
|
---|
56 | (
|
---|
57 | //$alias["fRunTypeName"] => "1",
|
---|
58 | $alias["fNumEvents"] => "1",
|
---|
59 | $alias["Round(fNumPhysicsTrigger/Time_to_sec(TimeDiff(fRunStop,fRunStart)),1)"] => "1",
|
---|
60 | $alias["fNumPhysicsTrigger"] => "1",
|
---|
61 | $alias["fNumExt1Trigger"] => "1",
|
---|
62 | $alias["fNumExt2Trigger"] => "1",
|
---|
63 | $alias["fNumELPTrigger"] => "1",
|
---|
64 | $alias["fNumILPTrigger"] => "1",
|
---|
65 | $alias["fNumPedestalTrigger"] => "1",
|
---|
66 | $alias["fNumTimeTrigger"] => "1",
|
---|
67 | $alias["fNumOtherTrigger"] => "1",
|
---|
68 | $alias["fFitsFileErrors"] => "1",
|
---|
69 | $alias["fROI"] => "1",
|
---|
70 | $alias["fROITimeMarker"] => "1",
|
---|
71 | "Time [h]" => "1",
|
---|
72 | "NumRuns" => "1",
|
---|
73 | "Evts" => "1",
|
---|
74 | );
|
---|
75 |
|
---|
76 | function GetCheck($fromtable, $val)
|
---|
77 | {
|
---|
78 | $checks = array
|
---|
79 | (
|
---|
80 | "fRunTypeName" => $fromtable . ".fRunTypeKEY",
|
---|
81 | );
|
---|
82 |
|
---|
83 | $check="";
|
---|
84 | if (!empty($checks[$val]))
|
---|
85 | $check=$checks[$val];
|
---|
86 | return $check;
|
---|
87 | }
|
---|
88 |
|
---|
89 |
|
---|
90 | function GetJoin($fromtable, $val)
|
---|
91 | {
|
---|
92 | $joins = array
|
---|
93 | (
|
---|
94 | "fRunTypeName" => " LEFT JOIN RunType USING(fRunTypeKEY) ",
|
---|
95 | );
|
---|
96 |
|
---|
97 |
|
---|
98 | $join="";
|
---|
99 | if (!empty($joins[$val]))
|
---|
100 | $join=$joins[$val];
|
---|
101 | return $join;
|
---|
102 | }
|
---|
103 |
|
---|
104 |
|
---|
105 | ?>
|
---|