source: trunk/MagicSoft/Mars/datacenter/db/ctadefs.php@ 9486

Last change on this file since 9486 was 9486, checked in by Daniela Dorner, 15 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 4.4 KB
Line 
1<?php
2
3$needs = array
4 (
5 "fCorsikaSimTelarray" => "MCRunProcessStatus.fMCRunNumber",
6 "fChimp" => "MCRunProcessStatus.fCorsikaSimTelarray",
7 "fCTAStar" => "MCRunProcessStatus.fChimp",
8 "fStereoB" => "MCRunProcessStatus.fCTAStar",
9 "fStereoC" => "MCRunProcessStatus.fCTAStar",
10 "fStereoG" => "MCRunProcessStatus.fCTAStar",
11 );
12
13
14$timelimits = array
15 (
16 "fCorsikaSimTelarray" => "48",
17 "fChimp" => "4",
18 "fCTAStar" => "2",
19 "fStereoB" => "1",
20 "fStereoC" => "1",
21 "fStereoG" => "1",
22 );
23
24
25$checkwhere = array
26 (
27 "fParticleTypeName" => CheckWhere("fParticleTypeKEY", $_GET),
28 );
29
30$checkgroup = array
31 (
32 "fParticleTypeName" => CheckGroup("fParticleTypeKEY", $_GET),
33 );
34
35
36$checkstatusgroup = array
37 (
38 "fCorsikaSimTelarray" => CheckStatusGroup("fCorsikaSimTelarrayStatus", $_GET),
39 "fChimp" => CheckStatusGroup("fChimpStatus", $_GET),
40 "fCTAStar" => CheckStatusGroup("fCTAStarStatus", $_GET),
41 "fStereoB" => CheckStatusGroup("fStereoBStatus", $_GET),
42 "fStereoC" => CheckStatusGroup("fStereoCStatus", $_GET),
43 "fStereoG" => CheckStatusGroup("fStereoGStatus", $_GET),
44 );
45
46
47
48$alias = array
49 (
50// "fRunNumber" => "Run#",
51 "Run#" => "Run#",
52 "fNumEvents" => "#Evts",
53 "SUM(fNumEvents)" => "Evts",
54 "SUM(fNumEvents) DIV 1000" => "kEvts",
55 "fParticleTypeName" => "Particle",
56 "fCorsikaSimTelarray" => "CorsikaSimtel",
57 "fChimp" => "Chimp",
58 "fCTAStar" => "Star",
59 "fStereoB" => "StereoB",
60 "fStereoC" => "StereoC",
61 "fStereoG" => "StereoG",
62 "fStartTime" => "Process",
63 "fFailedTime" => "Failed",
64 "fReturnCode" => "Ret<br>Code",
65 "fProgramId" => "Prgr<br>Id",
66 );
67
68
69$rightalign = array
70 (
71// $alias["fRunNumber"] => "1",
72 $alias["fNumEvents"] => "1",
73 $alias["SUM(fNumEvents) DIV 1000"] => "1",
74 "Time" => "1",
75 "Runs" => "1",
76 "Evts" => "1",
77);
78
79function GetCheck($fromtable, $val)
80{
81 $checks = array
82 (
83 "fParticleTypeName" => $fromtable . ".fParticleTypeKEY",
84 );
85
86 $check="";
87 if (!empty($checks[$val]))
88 $check=$checks[$val];
89 return $check;
90}
91
92
93function GetTable($fromtable, $val)
94{
95 $tables = array
96 (
97 "fNumEvents" => $fromtable . ".fNumEvents",
98 "fMCRunNumber" => "MCRunData.fMCRunNumber",
99 "fRawFileAvail" => "RunProcessStatus.fRawFileAvail",
100 "SUM(fRunTime)/3600" => "'Time [h]'",
101 "SUM(fNumEvents)" => "'Evts'",
102 "fStartTime" => "fStartTime",
103 "fFailedTime" => "fFailedTime",
104 "fReturnCode" => "fReturnCode",
105 "fProgramId" => "fProgramId",
106 "fParticleTypeName" => "ParticleType.fParticleTypeName",
107 );
108
109 $table="";
110 if (!empty($tables[$val]))
111 $table=$tables[$val];
112 if ($val=="Tel:Run/File")
113 $table="'Tel:Run/File'";
114 if ($val=="Tel:Sequ")
115 $table="CONCAT('M', Sequences.fTelescopeNumber, ':', LPAD(Sequences.fSequenceFirst, 8, '0'))";
116 if ($val=="NumRuns")
117 $table="'# Runs'";
118 if ($val=="NumSequ")
119 $table="'# Sequ'";
120 if ($val=="NumDS")
121 $table="'# Datasets'";
122 if ($val=="NumDays")
123 $table="'# days'";
124 if (empty($table))
125 $table=$val;
126 return $table;
127}
128
129
130function GetJoin($fromtable, $val)
131{
132 $joins = array
133 (
134 "fParticleTypeName" => " LEFT JOIN ParticleType USING(fParticleTypeKEY) ",
135 );
136
137
138 $join="";
139 if (!empty($joins[$val]))
140 $join=$joins[$val];
141 return $join;
142}
143
144
145?>
Note: See TracBrowser for help on using the repository browser.