source: trunk/MagicSoft/Mars/datacenter/db/mcdefs.php@ 9599

Last change on this file since 9599 was 9599, checked in by Daniela Dorner, 16 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 7.0 KB
Line 
1<?php
2
3$timelimits = array
4 (
5 "Corsika" => "60",
6 "Ceres" => "1",
7 "SequenceFile" => "1",
8 "Callisto" => "1",
9 "Star" => "1",
10 );
11
12
13$checkwhere = array
14 (
15 "fParticleTypeName" => CheckWhere("fParticleTypeKEY"),
16 "fRunTypeName" => CheckWhere("fRunTypeKEY"),
17 "fAtmosphericModelName" => CheckWhere("fAtmosphericModelKEY"),
18 );
19
20$checkgroup = array
21 (
22 "fParticleTypeName" => CheckGroup("fParticleTypeKEY"),
23 "fRunTypeName" => CheckGroup("fRunTypeKEY"),
24 "fAtmosphericModelName" => CheckGroup("fAtmosphericModelKEY"),
25 );
26
27
28$checkstatusgroup = array
29 (
30 "Corsika" => CheckStatusGroup("Corsika"),
31 "Ceres" => CheckStatusGroup("Ceres"),
32 "SequenceFile" => CheckStatusGroup("SequenceFile"),
33 "Callisto" => CheckStatusGroup("Callisto"),
34 "Star" => CheckStatusGroup("Star"),
35 );
36
37
38
39$alias = array
40 (
41 "Run.File" => "Run.File",
42 "fNumEvents" => "#Evts",
43 "SUM(fNumEvents)" => "Evts",
44 "fParticleTypeName" => "Particle",
45 "fRunTypeName" => "RunType",
46 "fAtmosphericModelName" => "Atm.Model",
47 "fCorsikaInputCreated" => "Input",
48 "Corsika" => "Corsika",
49 "Ceres" => "Ceres",
50 "SequenceFile" => "SequenceFile",
51 "Callisto" => "Callisto",
52 "Star" => "Star",
53 "fStartTime" => "Process",
54 "fFailedTime" => "Failed",
55 "fReturnCode" => "Ret<br>Code",
56 "fProgramId" => "Prgr<br>Id",
57 "fZenithDistanceMin" => "Zd<br>Min",
58 "fZenithDistanceMax" => "Zd<br>Max",
59 "fAzimuthMin" => "Az<br>Min",
60 "fAzimuthMax" => "Az<br>Max",
61 "Min(fZenithDistanceMin)" => "ZDMin",
62 "Max(fZenithDistanceMax)" => "ZDMax",
63 "fEnergyMin" => "EMin<br>[GeV]",
64 "fEnergyMax" => "EMax<br>[GeV]",
65 "fImpactMax" => "Impact<br>[cm]",
66 "fViewConeMax" => "View<br>cone<br>[deg]",
67 "fEnergySlope" => "Slope",
68 "fStartingAltitude" => "Altitude<br>[g/sqcm]",
69 "fMirrorDiameter" => "Mirror<br>diam.<br>[cm]",
70 );
71
72
73$rightalign = array
74 (
75// $alias["fRunNumber"] => "1",
76 $alias["fNumEvents"] => "1",
77 $alias["fZenithDistanceMin"] => "1",
78 $alias["fZenithDistanceMax"] => "1",
79 $alias["fAzimuthMin"] => "1",
80 $alias["fAzimuthMax"] => "1",
81 $alias["fEnergyMin"] => "1",
82 $alias["fEnergyMax"] => "1",
83 $alias["fImpactMax"] => "1",
84 $alias["fViewConeMax"] => "1",
85 $alias["fEnergySlope"] => "1",
86 $alias["fStartingAltitude"] => "1",
87 $alias["fMirrorDiameter"] => "1",
88 "Time" => "1",
89 "Runs" => "1",
90 "Evts" => "1",
91);
92
93function GetCheck($fromtable, $val)
94{
95 $checks = array
96 (
97 "fParticleTypeName" => "ParticleType.fParticleTypeKEY",
98 "fRunTypeName" => "RunType.fRunTypeKEY",
99 "fAtmosphericModelName" => "AtmosphericModel.fAtmosphericModelKEY",
100 );
101
102 $check="";
103 if (!empty($checks[$val]))
104 $check=$checks[$val];
105 return $check;
106}
107
108
109function GetTable($fromtable, $val)
110{
111 $tables = array
112 (
113 "fNumEvents" => $fromtable . ".fNumEvents",
114 "fMCRunNumber" => "MCCorsikaRunData.fMCRunNumber",
115 "fRawFileAvail" => "RunProcessStatus.fRawFileAvail",
116 "SUM(fRunTime)/3600" => "'Time [h]'",
117 "SUM(fNumEvents)" => "'Evts'",
118 "fStartTime" => "fStartTime",
119 "fFailedTime" => "fFailedTime",
120 "fReturnCode" => "fReturnCode",
121 "fProgramId" => "fProgramId",
122 "fParticleTypeName" => "ParticleType.fParticleTypeName",
123 "fRunTypeName" => "RunType.fRunTypeName",
124 "fAtmosphericModelName" => "AtmosphericModel.fAtmosphericModelName",
125 "fAzimuthMin" => "CorsikaInfo.fAzimuthMin",
126 "fAzimuthMax" => "CorsikaInfo.fAzimuthMax",
127 "fZenithDistanceMin" => "CorsikaInfo.fZenithDistanceMin",
128 "fZenithDistanceMax" => "CorsikaInfo.fZenithDistanceMax",
129 "fEnergyMin" => "CorsikaInfo.fEnergyMin",
130 "fEnergyMax" => "CorsikaInfo.fEnergyMax",
131 "fImpactMax" => "CorsikaInfo.fImpactMax",
132 "fViewConeMax" => "CorsikaInfo.fViewConeMax",
133 "fEnergySlope" => "CorsikaInfo.fEnergySlope",
134 "fStartingAltitude" => "CorsikaInfo.fStartingAltitude",
135 "fMirrorDiameter" => "CorsikaInfo.fMirrorDiameter",
136 "Min(fZenithDistanceMin)" => "'ZDMin'",
137 "Max(fZenithDistanceMax)" => "'ZDMax'",
138 );
139
140 $table="";
141 if (!empty($tables[$val]))
142 $table=$tables[$val];
143 if ($val=="Run.File")
144 $table="'Run.File'";
145 if ($val=="Tel:Sequ")
146 $table="CONCAT('M', Sequences.fTelescopeNumber, ':', LPAD(Sequences.fSequenceFirst, 8, '0'))";
147 if ($val=="NumRuns")
148 $table="'# Runs'";
149 if ($val=="NumSequ")
150 $table="'# Sequ'";
151 if ($val=="NumDS")
152 $table="'# Datasets'";
153 if ($val=="# Files")
154 $table="'# Files'";
155 if ($val=="NumDays")
156 $table="'# days'";
157 if (empty($table))
158 $table=$val;
159 return $table;
160}
161
162
163function GetJoin($fromtable, $val)
164{
165 $joins = array
166 (
167 "fParticleTypeName" => " LEFT JOIN ParticleType USING(fParticleTypeKEY) ",
168 "fRunTypeName" => " LEFT JOIN RunType USING(fRunTypeKEY) ",
169 "fAtmosphericModelName" => " LEFT JOIN AtmosphericModel USING(fAtmosphericModelKEY) ",
170 "Corsika" => " LEFT JOIN CorsikaStatus USING(fRunNumber, fFileNumber) ",
171 "Ceres" => " LEFT JOIN CeresStatus USING(fRunNumber, fFileNumber, fCeresSetupKEY) ",
172 "SequenceFile" => " LEFT JOIN SequenceFileStatus USING(fSequenceNumber) ",
173 "Callisto" => " LEFT JOIN CallistoStatus USING(fSequenceNumber, fCeresSetupKEY) ",
174 "Star" => " LEFT JOIN StarStatus USING(fSequenceNumber, fCeresSetupKEY) ",
175 );
176
177
178 $join="";
179 if (!empty($joins[$val]))
180 $join=$joins[$val];
181 return $join;
182}
183
184
185?>
Note: See TracBrowser for help on using the repository browser.