source: trunk/Mars/datacenter/db/mcdefs.php@ 10009

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