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

Last change on this file since 9485 was 9474, checked in by Daniela Dorner, 15 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 4.2 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" => "30",
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 "fParticleTypeName" => "Particle",
55 "fCorsikaSimTelarray" => "CorsikaSimtel",
56 "fChimp" => "Chimp",
57 "fCTAStar" => "Star",
58 "fStereoB" => "StereoB",
59 "fStereoC" => "StereoC",
60 "fStereoG" => "StereoG",
61 "fStartTime" => "Process",
62 "fFailedTime" => "Failed",
63 "fReturnCode" => "Ret<br>Code",
64 "fProgramId" => "Prgr<br>Id",
65 );
66
67
68$rightalign = array
69 (
70// $alias["fRunNumber"] => "1",
71 $alias["fNumEvents"] => "1",
72 "Time" => "1",
73 "Runs" => "1",
74 "Evts" => "1",
75);
76
77function GetCheck($fromtable, $val)
78{
79 $checks = array
80 (
81 "fParticleTypeName" => $fromtable . ".fParticleTypeKEY",
82 );
83
84 $check="";
85 if (!empty($checks[$val]))
86 $check=$checks[$val];
87 return $check;
88}
89
90
91function GetTable($fromtable, $val)
92{
93 $tables = array
94 (
95 "fNumEvents" => $fromtable . ".fNumEvents",
96 "fMCRunNumber" => "MCRunData.fMCRunNumber",
97 "fRawFileAvail" => "RunProcessStatus.fRawFileAvail",
98 "SUM(fRunTime)/3600" => "'Time [h]'",
99 "SUM(fNumEvents)" => "'Evts'",
100 "fStartTime" => "fStartTime",
101 "fFailedTime" => "fFailedTime",
102 "fReturnCode" => "fReturnCode",
103 "fProgramId" => "fProgramId",
104 "fParticleTypeName" => "ParticleType.fParticleTypeName",
105 );
106
107 $table="";
108 if (!empty($tables[$val]))
109 $table=$tables[$val];
110 if ($val=="Tel:Run/File")
111 $table="'Tel:Run/File'";
112 if ($val=="Tel:Sequ")
113 $table="CONCAT('M', Sequences.fTelescopeNumber, ':', LPAD(Sequences.fSequenceFirst, 8, '0'))";
114 if ($val=="NumRuns")
115 $table="'# Runs'";
116 if ($val=="NumSequ")
117 $table="'# Sequ'";
118 if ($val=="NumDS")
119 $table="'# Datasets'";
120 if ($val=="NumDays")
121 $table="'# days'";
122 if (empty($table))
123 $table=$val;
124 return $table;
125}
126
127
128function GetJoin($fromtable, $val)
129{
130 $joins = array
131 (
132 "fParticleTypeName" => " LEFT JOIN ParticleType USING(fParticleTypeKEY) ",
133 );
134
135
136 $join="";
137 if (!empty($joins[$val]))
138 $join=$joins[$val];
139 return $join;
140}
141
142
143?>
Note: See TracBrowser for help on using the repository browser.