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

Last change on this file since 9614 was 9610, checked in by Daniela Dorner, 15 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 6.6 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 "fZenithDistanceMin" => "Zd<br>Min",
54 "fZenithDistanceMax" => "Zd<br>Max",
55 "fAzimuthMin" => "Az<br>Min",
56 "fAzimuthMax" => "Az<br>Max",
57 "Min(fZenithDistanceMin)" => "ZDMin",
58 "Max(fZenithDistanceMax)" => "ZDMax",
59 "fEnergyMin" => "EMin<br>[GeV]",
60 "fEnergyMax" => "EMax<br>[GeV]",
61 "fImpactMax" => "Impact<br>[cm]",
62 "fViewConeMax" => "View<br>cone<br>[deg]",
63 "fEnergySlope" => "Slope",
64 "fStartingAltitude" => "Altitude<br>[g/sqcm]",
65 "fMirrorDiameter" => "Mirror<br>diam.<br>[cm]",
66 );
67
68
69$rightalign = array
70 (
71// $alias["fRunNumber"] => "1",
72 $alias["fNumEvents"] => "1",
73 $alias["fZenithDistanceMin"] => "1",
74 $alias["fZenithDistanceMax"] => "1",
75 $alias["fAzimuthMin"] => "1",
76 $alias["fAzimuthMax"] => "1",
77 $alias["fEnergyMin"] => "1",
78 $alias["fEnergyMax"] => "1",
79 $alias["fImpactMax"] => "1",
80 $alias["fViewConeMax"] => "1",
81 $alias["fEnergySlope"] => "1",
82 $alias["fStartingAltitude"] => "1",
83 $alias["fMirrorDiameter"] => "1",
84 "Time" => "1",
85 "Runs" => "1",
86 "Evts" => "1",
87);
88
89function GetCheck($fromtable, $val)
90{
91 $checks = array
92 (
93 "fParticleTypeName" => "ParticleType.fParticleTypeKEY",
94 "fRunTypeName" => "RunType.fRunTypeKEY",
95 "fAtmosphericModelName" => "AtmosphericModel.fAtmosphericModelKEY",
96 );
97
98 $check="";
99 if (!empty($checks[$val]))
100 $check=$checks[$val];
101 return $check;
102}
103
104
105function GetTable($fromtable, $val)
106{
107 $tables = array
108 (
109 "fNumEvents" => "CorsikaInfo.fNumEvents",
110 "fMCRunNumber" => "MCCorsikaRunData.fMCRunNumber",
111 "fRawFileAvail" => "RunProcessStatus.fRawFileAvail",
112 "SUM(fRunTime)/3600" => "'Time [h]'",
113 "SUM(fNumEvents)" => "'Evts'",
114 "fParticleTypeName" => "ParticleType.fParticleTypeName",
115 "fRunTypeName" => "RunType.fRunTypeName",
116 "fAtmosphericModelName" => "AtmosphericModel.fAtmosphericModelName",
117 "fAzimuthMin" => "CorsikaInfo.fAzimuthMin",
118 "fAzimuthMax" => "CorsikaInfo.fAzimuthMax",
119 "fZenithDistanceMin" => "CorsikaInfo.fZenithDistanceMin",
120 "fZenithDistanceMax" => "CorsikaInfo.fZenithDistanceMax",
121 "fEnergyMin" => "CorsikaInfo.fEnergyMin",
122 "fEnergyMax" => "CorsikaInfo.fEnergyMax",
123 "fImpactMax" => "CorsikaInfo.fImpactMax",
124 "fViewConeMax" => "CorsikaInfo.fViewConeMax",
125 "fEnergySlope" => "CorsikaInfo.fEnergySlope",
126 "fStartingAltitude" => "CorsikaInfo.fStartingAltitude",
127 "fMirrorDiameter" => "CorsikaInfo.fMirrorDiameter",
128 "Min(fZenithDistanceMin)" => "'ZDMin'",
129 "Max(fZenithDistanceMax)" => "'ZDMax'",
130 );
131
132 $table="";
133 if (!empty($tables[$val]))
134 $table=$tables[$val];
135 if ($val=="Run.File")
136 $table="'Run.File'";
137 if ($val=="Tel:Sequ")
138 $table="CONCAT('M', Sequences.fTelescopeNumber, ':', LPAD(Sequences.fSequenceFirst, 8, '0'))";
139 if ($val=="NumRuns")
140 $table="'# Runs'";
141 if ($val=="NumSequ")
142 $table="'# Sequ'";
143 if ($val=="NumDS")
144 $table="'# Datasets'";
145 if ($val=="# Files")
146 $table="'# Files'";
147 if ($val=="NumDays")
148 $table="'# days'";
149 if (empty($table))
150 $table=$val;
151 return $table;
152}
153
154
155function GetJoin($fromtable, $val)
156{
157 $joins = array
158 (
159 "fParticleTypeName" => " LEFT JOIN ParticleType USING(fParticleTypeKEY) ",
160 "fRunTypeName" => " LEFT JOIN RunType USING(fRunTypeKEY) ",
161 "fAtmosphericModelName" => " LEFT JOIN AtmosphericModel USING(fAtmosphericModelKEY) ",
162 "Corsika" => " LEFT JOIN CorsikaStatus USING(fRunNumber, fFileNumber) ",
163 "Ceres" => " LEFT JOIN CeresStatus USING(fRunNumber, fFileNumber, fCeresSetupKEY) ",
164 "SequenceFile" => " LEFT JOIN SequenceFileStatus USING(fSequenceNumber) ",
165 "Callisto" => " LEFT JOIN CallistoStatus USING(fSequenceNumber, fCeresSetupKEY) ",
166 "Star" => " LEFT JOIN StarStatus USING(fSequenceNumber, fCeresSetupKEY) ",
167 );
168
169
170 $join="";
171 if (!empty($joins[$val]))
172 $join=$joins[$val];
173 return $join;
174}
175
176
177?>
Note: See TracBrowser for help on using the repository browser.