source: tags/Mars-V2.4/datacenter/db/mcdefs.php

Last change on this file was 9498, checked in by Daniela Dorner, 15 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 6.0 KB
Line 
1<?php
2
3$needs = array
4 (
5 "fCorsikaInputCreated" => "MCRunProcessStatus.fMCRunNumber",
6 "fCorsikaFileAvail" => "MCRunProcessStatus.fCorsikaInputCreated",
7 );
8
9
10$timelimits = array
11 (
12 "fCorsikaInputCreated" => "1",
13 "fCorsikaFileAvail" => "60",
14 );
15
16
17$checkwhere = array
18 (
19 "fParticleTypeName" => CheckWhere("fParticleTypeKEY"),
20 "fAtmosphericModelName" => CheckWhere("fAtmosphericModelKEY"),
21 );
22
23$checkgroup = array
24 (
25 "fParticleTypeName" => CheckGroup("fParticleTypeKEY"),
26 "fAtmosphericModelName" => CheckGroup("fAtmosphericModelKEY"),
27 );
28
29
30$checkstatusgroup = array
31 (
32 "fCorsikaInputCreated" => CheckStatusGroup("fCorsikaInputCreatedStatus"),
33 "fCorsikaFileAvail" => CheckStatusGroup("fCorsikaFileAvailStatus"),
34 );
35
36
37
38$alias = array
39 (
40// "fRunNumber" => "Run#",
41 "Run#" => "Run#",
42 "fNumEvents" => "#Evts",
43 "SUM(fNumEvents)" => "Evts",
44 "fParticleTypeName" => "Particle",
45 "fAtmosphericModelName" => "Atm.Model",
46 "fCorsikaInputCreated" => "Input",
47 "fCorsikaFileAvail" => "Corsika",
48 "fStartTime" => "Process",
49 "fFailedTime" => "Failed",
50 "fReturnCode" => "Ret<br>Code",
51 "fProgramId" => "Prgr<br>Id",
52 "fZenithDistanceMin" => "Zd<br>Min",
53 "fZenithDistanceMax" => "Zd<br>Max",
54 "fAzimuthMin" => "Az<br>Min",
55 "fAzimuthMax" => "Az<br>Max",
56 "Min(fZenithDistanceMin)" => "ZDMin",
57 "Max(fZenithDistanceMax)" => "ZDMax",
58 "fEnergyMin" => "EMin<br>[GeV]",
59 "fEnergyMax" => "EMax<br>[GeV]",
60 "fImpactMax" => "Impact<br>[cm]",
61 "fViewConeMax" => "View<br>cone<br>[deg]",
62 "fEnergySlope" => "Slope",
63 "fNumReUseShower" => "#ShowerReUse",
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["fNumReUseShower"] => "1",
83 $alias["fStartingAltitude"] => "1",
84 $alias["fMirrorDiameter"] => "1",
85 "Time" => "1",
86 "Runs" => "1",
87 "Evts" => "1",
88);
89
90function GetCheck($fromtable, $val)
91{
92 $checks = array
93 (
94 "fParticleTypeName" => $fromtable . ".fParticleTypeKEY",
95 "fAtmosphericModelName" => $fromtable . ".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" => $fromtable . ".fNumEvents",
110 "fMCRunNumber" => "MCCorsikaRunData.fMCRunNumber",
111 "fRawFileAvail" => "RunProcessStatus.fRawFileAvail",
112 "SUM(fRunTime)/3600" => "'Time [h]'",
113 "SUM(fNumEvents)" => "'Evts'",
114 "fStartTime" => "fStartTime",
115 "fFailedTime" => "fFailedTime",
116 "fReturnCode" => "fReturnCode",
117 "fProgramId" => "fProgramId",
118 "fParticleTypeName" => "ParticleType.fParticleTypeName",
119 "fAtmosphericModelName" => "AtmosphericModel.fAtmosphericModelName",
120 "fAzimuthMin" => $fromtable . ".fAzimuthMin",
121 "fAzimuthMax" => $fromtable . ".fAzimuthMax",
122 "fZenithDistanceMin" => $fromtable . ".fZenithDistanceMin",
123 "fZenithDistanceMax" => $fromtable . ".fZenithDistanceMax",
124 "fEnergyMin" => $fromtable . ".fEnergyMin",
125 "fEnergyMax" => $fromtable . ".fEnergyMax",
126 "fImpactMax" => $fromtable . ".fImpactMax",
127 "fViewConeMax" => $fromtable . ".fViewConeMax",
128 "fEnergySlope" => $fromtable . ".fEnergySlope",
129 "fNumReUseShower" => $fromtable . ".fNumReUseShower",
130 "fStartingAltitude" => $fromtable . ".fStartingAltitude",
131 "fMirrorDiameter" => $fromtable . ".fMirrorDiameter",
132 "Min(fZenithDistanceMin)" => "'ZDMin'",
133 "Max(fZenithDistanceMax)" => "'ZDMax'",
134 );
135
136 $table="";
137 if (!empty($tables[$val]))
138 $table=$tables[$val];
139 if ($val=="Tel:Run/File")
140 $table="'Tel:Run/File'";
141 if ($val=="Tel:Sequ")
142 $table="CONCAT('M', Sequences.fTelescopeNumber, ':', LPAD(Sequences.fSequenceFirst, 8, '0'))";
143 if ($val=="NumRuns")
144 $table="'# Runs'";
145 if ($val=="NumSequ")
146 $table="'# Sequ'";
147 if ($val=="NumDS")
148 $table="'# Datasets'";
149 if ($val=="NumDays")
150 $table="'# days'";
151 if (empty($table))
152 $table=$val;
153 return $table;
154}
155
156
157function GetJoin($fromtable, $val)
158{
159 $joins = array
160 (
161 "fParticleTypeName" => " LEFT JOIN ParticleType USING(fParticleTypeKEY) ",
162 "fAtmosphericModelName" => " LEFT JOIN AtmosphericModel USING(fAtmosphericModelKEY) ",
163 );
164
165
166 $join="";
167 if (!empty($joins[$val]))
168 $join=$joins[$val];
169 return $join;
170}
171
172
173?>
Note: See TracBrowser for help on using the repository browser.