source: branches/Corsika7405Compatibility/datacenter/db/ctadefs.php@ 20115

Last change on this file since 20115 was 17386, checked in by tbretz, 11 years ago
Removed svn:executable property, these are no executables.
File size: 4.3 KB
Line 
1<?php
2
3$needs = array
4 (
5 "fCorsikaSimTelarray" => "MCRunProcessStatus.fMCRunNumber",
6 "fChimp" => "MCRunProcessStatus.fCorsikaSimTelarray",
7 "fCTAStar" => "MCRunProcessStatus.fChimp",
8 "fStereoB" => "MCRunProcessStatus.fCTAStar",
9 "fStereoC" => "MCRunProcessStatus.fCTAStar",
10 "fStereoG" => "MCRunProcessStatus.fCTAStar",
11 );
12
13
14$timelimits = array
15 (
16 "fCorsikaSimTelarray" => "48",
17 "fChimp" => "4",
18 "fCTAStar" => "2",
19 "fStereoB" => "1",
20 "fStereoC" => "1",
21 "fStereoG" => "1",
22 );
23
24
25$checkwhere = array
26 (
27 "fParticleTypeName" => CheckWhere("fParticleTypeKEY"),
28 );
29
30$checkgroup = array
31 (
32 "fParticleTypeName" => CheckGroup("fParticleTypeKEY"),
33 );
34
35
36$checkstatusgroup = array
37 (
38 "fCorsikaSimTelarray" => CheckStatusGroup("fCorsikaSimTelarrayStatus"),
39 "fChimp" => CheckStatusGroup("fChimpStatus"),
40 "fCTAStar" => CheckStatusGroup("fCTAStarStatus"),
41 "fStereoB" => CheckStatusGroup("fStereoBStatus"),
42 "fStereoC" => CheckStatusGroup("fStereoCStatus"),
43 "fStereoG" => CheckStatusGroup("fStereoGStatus"),
44 );
45
46
47
48$alias = array
49 (
50// "fRunNumber" => "Run#",
51 "Run#" => "Run#",
52 "fNumEvents" => "#Evts",
53 "fObsLevel" => "ObsLev<br>[m]",
54 "SUM(fNumEvents)" => "Evts",
55 "SUM(fNumEvents) DIV 1000" => "kEvts",
56 "fParticleTypeName" => "Particle",
57 "fCorsikaSimTelarray" => "CorsikaSimtel",
58 "fChimp" => "Chimp",
59 "fCTAStar" => "Star",
60 "fStereoB" => "StereoB",
61 "fStereoC" => "StereoC",
62 "fStereoG" => "StereoG",
63 "fStartTime" => "Process",
64 "fFailedTime" => "Failed",
65 "fReturnCode" => "Ret<br>Code",
66 "fProgramId" => "Prgr<br>Id",
67 );
68
69
70$rightalign = array
71 (
72// $alias["fRunNumber"] => "1",
73 $alias["fNumEvents"] => "1",
74 $alias["fObsLevel"] => "1",
75 $alias["SUM(fNumEvents) DIV 1000"] => "1",
76 "Time" => "1",
77 "Runs" => "1",
78 "Evts" => "1",
79);
80
81function GetCheck($fromtable, $val)
82{
83 $checks = array
84 (
85 "fParticleTypeName" => $fromtable . ".fParticleTypeKEY",
86 );
87
88 $check="";
89 if (!empty($checks[$val]))
90 $check=$checks[$val];
91 return $check;
92}
93
94
95function GetTable($fromtable, $val)
96{
97 $tables = array
98 (
99 "fNumEvents" => $fromtable . ".fNumEvents",
100 "fMCRunNumber" => "MCRunData.fMCRunNumber",
101 "fRawFileAvail" => "RunProcessStatus.fRawFileAvail",
102 "SUM(fRunTime)/3600" => "'Time [h]'",
103 "SUM(fNumEvents)" => "'Evts'",
104 "fStartTime" => "fStartTime",
105 "fFailedTime" => "fFailedTime",
106 "fReturnCode" => "fReturnCode",
107 "fProgramId" => "fProgramId",
108 "fParticleTypeName" => "ParticleType.fParticleTypeName",
109 );
110
111 $table="";
112 if (!empty($tables[$val]))
113 $table=$tables[$val];
114 if ($val=="Tel:Run/File")
115 $table="'Tel:Run/File'";
116 if ($val=="Tel:Sequ")
117 $table="CONCAT('M', Sequences.fTelescopeNumber, ':', LPAD(Sequences.fSequenceFirst, 8, '0'))";
118 if ($val=="NumRuns")
119 $table="'# Runs'";
120 if ($val=="NumSequ")
121 $table="'# Sequ'";
122 if ($val=="NumDS")
123 $table="'# Datasets'";
124 if ($val=="NumDays")
125 $table="'# days'";
126 if (empty($table))
127 $table=$val;
128 return $table;
129}
130
131
132function GetJoin($fromtable, $val)
133{
134 $joins = array
135 (
136 "fParticleTypeName" => " LEFT JOIN ParticleType USING(fParticleTypeKEY) ",
137 );
138
139
140 $join="";
141 if (!empty($joins[$val]))
142 $join=$joins[$val];
143 return $join;
144}
145
146
147?>
Note: See TracBrowser for help on using the repository browser.