source: branches/Mars_MC/datacenter/db/mcdefs.php@ 17045

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