source: trunk/MagicSoft/Mars/datacenter/db/magicdefs.php@ 8198

Last change on this file since 8198 was 8198, checked in by Daniela Dorner, 18 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 37.5 KB
Line 
1<?php
2
3$needs = array
4 (
5 "fCCFilled" => "SequenceBuildStatus.fDate",
6 "fExclusionsDone" => "fCCFilled",
7 "fSequenceEntriesBuilt" => "fExclusionsDone",
8 "fCCFileAvail" => "RunProcessStatus.fRunNumber",
9 "fCaCoFileAvail" => "RunProcessStatus.fRunNumber",
10 "fCaCoFileFound" => "RunProcessStatus.fRunNumber",
11 "fRawFileAvail" => "RunProcessStatus.fRunNumber",
12 "fDataCheckDone" => "fRawFileAvail",
13 "fTimingCorrection" => "fRawFileAvail",
14 "fSequenceFileWritten" => "SequenceProcessStatus.fSequenceFirst",
15 "fAllFilesAvail" => "fSequenceFileWritten",
16 "fCallisto" => "fAllFilesAvail",
17 "fStar" => "fCallisto",
18 "fFillCallisto" => "fCallisto",
19 "fFillStar" => "fStar",
20 "fDataSetInserted" => "DataSetProcessStatus.fDataSetNumber",
21 "fStarFilesAvail" => "fDataSetInserted",
22 "fGanymed" => "fStarFilesAvail",
23 "fFillGanymed" => "fGanymed",
24 );
25
26
27$limitsmean = array
28 (
29 "fPedRmsInLimit" => "fMeanPedRmsInner",
30// "fArrTRmsLimit" => "fArrTimeRmsInner",
31 "fMuonRateLimit" => "fMuonRate",
32 "fMuonCalLimit" => "fRatio",
33 "fPSFLimit" => "fPSF",
34 "fInhomLimit" => "fInhomogeneity",
35 "fNumIslLimit" => "fMeanNumberIslands",
36 "fImgRateLimit" => "fDataRate",
37 "fSkyBrightLimit" => "fBrightnessMed",
38 );
39
40$limitsmin = array
41 (
42 "fZdMinLimit" => "fZenithDistanceMin",
43 "fNumStarsLimit" => "fNumStarsMed",
44 "fNumStarsCorLimit" => "fNumStarsCorMed",
45 "fMuonNumLimit" => "fMuonNumber",
46 "fArrTimeLimit" => "fArrTimeInner",
47 "fPulsePosLimit" => "fMeanPulsePosInner",
48 "fRunTimeLimit" => "fRunTime/60",
49 );
50
51$limitsmax = array
52 (
53 "fZdMaxLimit" => "fZenithDistanceMax",
54 "fUnsInLimit" => "fUnsuitableInner",
55 "fIsoInLimit" => "fIsolatedInner",
56 "fIMCLimit" => "fIsolatedMaxCluster",
57 "fMaxHumLimit" => "fMaxHumidity",
58 "fRelTimeLimit" => "fEffOnTime/fRunTime",
59 );
60
61$checkwhere = array
62 (
63 "fRunTypeName" => CheckWhere("fRunTypeKEY", $_GET),
64 "fProjectName" => CheckWhere("fProjectKEY", $_GET),
65 "fSourceName" => CheckWhere("fSourceKEY", $_GET),
66 "fMagicNumberName" => CheckWhere("fMagicNumberKEY", $_GET),
67 "fL1TriggerTableName" => CheckWhere("fL1TriggerTableKEY", $_GET),
68 "fL2TriggerTableName" => CheckWhere("fL2TriggerTableKEY", $_GET),
69 "fHvSettingsName" => CheckWhere("fHvSettingsKEY", $_GET),
70 "fCalibrationScriptName" => CheckWhere("fCalibrationScriptKEY", $_GET),
71 "fExcludedFDAName" => CheckWhere("fExcludedFDAKEY", $_GET),
72 "fManuallyChangedName" => CheckWhere("fManuallyChangedKEY", $_GET),
73 "fObservationModeName" => CheckWhere("fObservationModeKEY", $_GET),
74 "fDiscriminatorThresholdTableName" => CheckWhere("fDiscriminatorThresholdTableKEY", $_GET),
75 "fTriggerDelayTableName" => CheckWhere("fTriggerDelayTableKEY", $_GET),
76 "fTestFlagName" => CheckWhere("fTestFlagKEY", $_GET),
77 "fLightConditionsName" => CheckWhere("fLightConditionsKEY", $_GET),
78 "fParticleTypeName" => CheckWhere("fParticleTypeKEY", $_GET),
79 "fFitsFileName" => CheckWhere("fFitsFileKEY", $_GET),
80 "fObjectName" => CheckWhere("fObjectKEY", $_GET),
81 "fStatusName" => CheckWhere("fStatusKEY", $_GET),
82 );
83
84$checkgroup = array
85 (
86 "fRunTypeName" => CheckGroup("fRunTypeKEY", $_GET),
87 "fProjectName" => CheckGroup("fProjectKEY", $_GET),
88 "fSourceName" => CheckGroup("fSourceKEY", $_GET),
89 "fMagicNumberName" => CheckGroup("fMagicNumberKEY", $_GET),
90 "fL1TriggerTableName" => CheckGroup("fL1TriggerTableKEY", $_GET),
91 "fL2TriggerTableName" => CheckGroup("fL2TriggerTableKEY", $_GET),
92 "fHvSettingsName" => CheckGroup("fHvSettingsKEY", $_GET),
93 "fCalibrationScriptName" => CheckGroup("fCalibrationScriptKEY", $_GET),
94 "fExcludedFDAName" => CheckGroup("fExcludedFDAKEY", $_GET),
95 "fManuallyChangedName" => CheckGroup("fManuallyChangedKEY", $_GET),
96 "fObservationModeName" => CheckGroup("fObservationModeKEY", $_GET),
97 "fDiscriminatorThresholdTableName" => CheckGroup("fDiscriminatorThresholdTableKEY", $_GET),
98 "fTriggerDelayTableName" => CheckGroup("fTriggerDelayTableKEY", $_GET),
99 "fTestFlagName" => CheckGroup("fTestFlagKEY", $_GET),
100 "fLightConditionsName" => CheckGroup("fLightConditionsKEY", $_GET),
101 "fParticleTypeName" => CheckGroup("fParticleTypeKEY", $_GET),
102 "fFitsFileName" => CheckGroup("fFitsFileKEY", $_GET),
103 "fObjectName" => CheckGroup("fObjectKEY", $_GET),
104 "fStatusName" => CheckGroup("fStatusKEY", $_GET),
105 );
106
107
108$checkstatusgroup = array
109 (
110 "fCCFilled" => CheckStatusGroup("fCCFilledStatus", $_GET),
111 "fExclusionsDone" => CheckStatusGroup("fExclusionsDoneStatus", $_GET),
112 "fSequenceEntriesBuilt" => CheckStatusGroup("fSequenceEntriesBuiltStatus",$_GET),
113 "fCCFileAvail" => CheckStatusGroup("fCCFileAvailStatus", $_GET),
114 "fCaCoFileAvail" => CheckStatusGroup("fCaCoFileAvailStatus", $_GET),
115 "fCaCoFileFound" => CheckStatusGroup("fCaCoFileFoundStatus", $_GET),
116 "fRawFileAvail" => CheckStatusGroup("fRawFileAvailStatus", $_GET),
117 "fTimingCorrection" => CheckStatusGroup("fTimingCorrectionStatus", $_GET),
118 "fDataCheckDone" => CheckStatusGroup("fDataCheckDoneStatus", $_GET),
119// "fFillDotRaw" => CheckStatusGroup("fFillDotRawStatus", $_GET),
120 "fSequenceFileWritten" => CheckStatusGroup("fSequenceFileWrittenStatus", $_GET),
121 "fAllFilesAvail" => CheckStatusGroup("fAllFilesAvailStatus", $_GET),
122 "fCallisto" => CheckStatusGroup("fCallistoStatus", $_GET),
123 "fFillCallisto" => CheckStatusGroup("fFillCallistoStatus", $_GET),
124 "fStar" => CheckStatusGroup("fStarStatus", $_GET),
125 "fFillStar" => CheckStatusGroup("fFillStarStatus", $_GET),
126 "fDataSetInserted" => CheckStatusGroup("fDataSetInsertedStatus", $_GET),
127 "fStarFilesAvail" => CheckStatusGroup("fStarFilesAvailStatus", $_GET),
128 "fGanymed" => CheckStatusGroup("fGanymedStatus", $_GET),
129 "fFillGanymed" => CheckStatusGroup("fFillGanymedStatus", $_GET),
130 );
131
132
133$checkenumgroup = array
134 (
135 "fHasSignal" => CheckEnumGroup("fHasSignalEnum", $_GET),
136 "fHasPedestal" => CheckEnumGroup("fHasPedestalEnum", $_GET),
137 "fHasSignalInterlaced" => CheckEnumGroup("fHasSignalInterlacedEnum", $_GET),
138 "fHasPedestalInterlaced" => CheckEnumGroup("fHasPedestalInterlacedEnum", $_GET),
139 );
140
141
142
143$alias = array
144 (
145 "fRawFileKEY" => "Idx",
146 "fMagicNumberName" => "Magic#",
147 "fFormatVersion" => "F-Ver",
148 "fLastUpdate" => "LastUpd",
149 "fRunNumber" => "Run#",
150 "fRunTypeName" => "RunType",
151 "fMeanTriggerRate" => "Rate<br>[Hz]",
152 "fDaqTriggerRate" => "Daq<br>TRate<br>[Hz]",
153 "fDaqStoreRate" => "Daq<br>SRate<br>[Hz]",
154 "fL2RatePresc" => "L2<br>pRate<br>[Hz]",
155 "fL2RateUnpresc" => "L2<br>upRate<br>[Hz]",
156 "fManuallyChangedName" => "Manually<br>Changed",
157 "fObservationModeName" => "Obs.<br>Mode",
158 "fLastUpdate" => "LastUpd",
159 "fSequenceFirst" => "Sequ",
160 "fProjectName" => "Project",
161 "fSourceName" => "Source",
162 "fNumEvents" => "#Evts",
163 "fRunTime/60" => "Up<br>Time<br>[min]",
164 "fRunStart" => "Start",
165 "fRunStop" => "Stop",
166// "fRunStart" => "StartTime",
167 "fSequenceLast" => "Last<br>Run",
168 "fL1TriggerTableName" => "L1Trig<br>Table",
169 "fL2TriggerTableName" => "L2Trig<br>Table",
170 "fHvSettingsName" => "HV Settings",
171 "fCalibrationScriptName" => "Cal Script",
172 "fTestFlagName" => "Testflag",
173 "fLightConditionsName" => "Lightcond",
174 "fTriggerDelayTableName" => "TrigDelay",
175 "fDiscriminatorThresholdTableName" => "DT",
176 "fExcludedFDAName" => "Exclusion",
177 "fZenithDistance" => "Zd",
178 "fAzimuth" => "Az",
179 "fZenithDistanceMin" => "Zd<br>Min",
180 "fZenithDistanceMax" => "Zd<br>Max",
181 "fAzimuthMin" => "Az<br>Min",
182 "fAzimuthMax" => "Az<br>Max",
183 "fTest" => "Test",
184 "fSourceKEY" => "KEY",
185 "fDate" => "Date",
186 "fCCFilled" => "CCFilled",
187 "fExclusionsDone" => "Exclusions",
188 "fSequenceEntriesBuilt" => "Sequences",
189 "fCCFileAvail" => "CCFile",
190 "fCaCoFileAvail" => "CaCoFile",
191 "fCaCoFileFound" => "CaCoRun",
192 "fRawFileAvail" => "RawFile",
193 "fTimingCorrection" => "TimingCorr",
194 "fDataCheckDone" => "Datacheck",
195// "fFillDotRaw" => "Filldotraw",
196 "fSequenceFileWritten" => "SequFile",
197 "fAllFilesAvail" => "FilesAvail",
198 "fCallisto" => "Callisto",
199 "fStar" => "Star",
200 "fFillCallisto" => "FillCal",
201 "fFillStar" => "FillStar",
202 "fDataSetInserted" => "DataSet",
203 "fStarFilesAvail" => "FilesAvail",
204 "fGanymed" => "Ganymed",
205 "fFillGanymed" => "FillGanymed",
206 "fUnsuitableOuter" => "Un<br>suit.<br>Out",
207 "fUnreliableOuter" => "Un<br>rel.<br>Out",
208 "fUnreliableInner" => "Un<br>rel.<br>In",
209 "fUnsuitableInner" => "Un<br>suit.<br>In",
210 "fIsolatedOuter" => "Isol.<br>Out",
211 "fIsolatedInner" => "Isol.<br>In",
212 "fMeanPedRmsOuter" => "Ped<br>Rms<br>Out",
213 "fMeanPedRmsInner" => "Ped<br>Rms<br>In",
214 "fArrTimeMeanInner" => "Arr<br>Time<br>In",
215 "fArrTimeMeanOuter" => "Arr<br>Time<br>Out",
216 "fArrTimeRmsInner" => "Rms<br>ArrT<br>In",
217 "fArrTimeRmsOuter" => "Rms<br>ArrT<br>Out",
218 "fMeanSignalInner" => "Sign<br>In",
219 "fMeanSignalOuter" => "Sign<br>Out",
220 "fPulsePosMean" => "Puls<br>Pos",
221 "fConvFactorInner" => "Conv<br>In",
222 "fConvFactorOuter" => "Conv<br>Out",
223 // "fConvFactorInner" => "Conv Inner<BR>[ph/FADC]",
224 // "fConvFactorOuter" => "Conv Outer<BR>[ph/FADC]",
225 "fIsolatedMaxCluster" => "Isol.<br>Max<br>Cl",
226 "fMeanNumberIslands" => "Mean<br>Num<br>Isl",
227 "fPSF" => "PSF<br>[mm]",
228 "fRatio" => "Ratio<br>[%]",
229 "fMuonNumber" => "#<br>Muons",
230 "fEffOnTime" => "EffOn<br>Time<br>[s]",
231 "fEffOnTime/fRunTime" => "RelOn<br>Time",
232 "fEffOnTime/3600" => "EffOn<br>Time<br>[h]",
233 "fMuonRate" => "Muon<br>Rate<br>[Hz]",
234 "fInhomogeneity" => "Inhom",
235 "fDataRate" => "Img.<br>Rate<br>[Hz]",
236 "fMaxHumidity" => "Max<br>Hum<br>[%]",
237 "fBrightnessMed" => "Sky<br>Brightn.<br>Med",
238 "fBrightnessRMS" => "Sky<br>Brightn.<br>RMS",
239 "fNumStarsMed" => "#<br>id.<br>stars",
240 "fNumStarsRMS" => "RMS<br>id.<br>stars",
241 "fNumStarsCorMed" => "#<br>cor.<br>stars",
242 "fNumStarsCorRMS" => "RMS<br>cor.<br>stars",
243 "fEvents" => "DataEvents",
244 "fPositionSignal" => "ArrTime",
245 "fPositionFWHM" => "ArrTimeFWHM",
246 "fHeightSignal" => "Signal",
247 "fHeightFWHM" => "SignalFWHM",
248 "fHasSignal" => "HasSignal",
249 "fHasPedestal" => "HasPedestal",
250 "fPositionAsym" => "ArrTimeAsym",
251 "fHeightAsym" => "SignalAsym",
252 "fEventsInterlaced" => "CalEvents",
253 "fPositionSignalInterlaced" => "ArrTimeCal",
254 "fPositionFWHMInterlaced" => "ArrTimeFWHMCal",
255 "fHeightSignalInterlaced" => "SignalCal",
256 "fHeightFWHMInterlaced" => "SignalFWHMCal",
257 "fHasSignalInterlaced" => "HasSignalCal",
258 "fHasPedestalInterlaced" => "HasPedestalCal",
259 "fPositionAsymInterlaced" => "ArrTimeAsymCal",
260 "fHeightAsymInterlaced" => "SignalAsymCal",
261 "fExcessEvents" => "Exc<br>Evts",
262 "fBackgroundEvents" => "Bg<br>Evts",
263 "fSignalEvents" => "Sign<br>Evts",
264 "fSignificance" => "Sign",
265 "fScaleFactor" => "Scale",
266 "fDataSetNumber" => "Data<br>Set#",
267 "fComment" => "Comment",
268 "fExcessEvents*60/fEffOnTime" => "Exc<br>Rate",
269 "fBackgroundEvents*60/fEffOnTime" => "Bg<br>Rate",
270 "fSignalEvents*60/fEffOnTime" => "Sign<br>Rate",
271 "Round(fSignificance/Sqrt(fEffOnTime/3600),2)" => "Signf<br>Rate",
272 "SUM(fRunTime)/3600" => "Time [h]",
273 "SUM(fNumEvents)" => "Evts",
274 "Min(fZenithDistanceMin)" => "ZDMin",
275 "Max(fZenithDistanceMax)" => "ZDMax",
276 "Min(fZenithDistance)" => "ZdMin",
277 "Max(fZenithDistance)" => "ZdMax",
278// "fArrTimeLimit" => "ArrTRms",
279 "fArrTimeLimit" => "ArrTime",
280 "fPulsePosLimit" => "PulsePos",
281 "fRunTimeLimit" => "UpTime",
282 "fPedRmsInLimit" => "PedRms",
283 "fMuonRateLimit" => "MuonRate",
284 "fMuonNumLimit" => "# Muons",
285 "fMuonCalLimit" => "MuonCal",
286 "fPSFLimit" => "PSF",
287 "fInhomLimit" => "Inhom.",
288 "fNumIslLimit" => "# Islands",
289 "fImgRateLimit" => "ImgRate",
290 "fSkyBrightLimit" => "SkyBrightness",
291 "fNumStarsLimit" => "# id. Stars",
292 "fNumStarsCorLimit" => "# cor. Stars",
293 "fUnsInLimit" => "Unsuit.In",
294 "fIsoInLimit" => "Isol.In",
295 "fIMCLimit" => "IMC",
296 "fMaxHumLimit" => "Humidity",
297 "fZdMinLimit" => "ZdMin",
298 "fZdMaxLimit" => "ZdMax",
299 "fRelTimeLimit" => "Rel.Ontime",
300 "fEMin" => "Emin",
301 "fEMax" => "Emax",
302 "fParticleTypeName" => "Particle",
303 "fStartTime" => "Process",
304 "fFailedTime" => "Failed",
305 "fReturnCode" => "Ret<br>Code",
306 "fFailedCode" => "Err<br>Code",
307 "fFailedCodeAdd" => "Code<br>Add",
308 "fTimestamp" => "Time",
309 "fExposure" => "Exposure",
310 "fFitsFileName" => "FitsFile",
311 "fObjectName" => "Object",
312 "fSkyLevel" => "SkyLevel",
313 "fFWHM" => "FWHM",
314 "fApertureRadius" => "Ap.Rad.",
315 "fInstrumentalMag" => "Instr.Mag.",
316 "fInstrumentalMagErr" => "Instr.Mag.Err.",
317 "fStatusName" => "StatusCode",
318// "COUNT(*)" => "# Runs",
319// "COUNT(*)" => "Sequence",
320 );
321
322
323$rightalign = array
324 (
325 $alias["fRawFileKEY"] => "1",
326 $alias["fFormatVersion"] => "1",
327 $alias["fRunNumber"] => "1",
328 $alias["fZenithDistance"] => "1",
329 $alias["fAzimuth"] => "1",
330 $alias["fMeanTriggerRate"] => "1",
331 $alias["fDaqTriggerRate"] => "1",
332 $alias["fDaqStoreRate"] => "1",
333 $alias["fL2RatePresc"] => "1",
334 $alias["fL2RateUnpresc"] => "1",
335 $alias["fSequenceFirst"] => "1",
336 $alias["fNumEvents"] => "1",
337 $alias["fRunTime/60"] => "1",
338 $alias["fSequenceLast"] => "1",
339 $alias["fZenithDistanceMin"] => "1",
340 $alias["fZenithDistanceMax"] => "1",
341 $alias["fAzimuthMin"] => "1",
342 $alias["fAzimuthMax"] => "1",
343 $alias["fUnsuitableOuter"] => "1",
344 $alias["fUnreliableOuter"] => "1",
345 $alias["fUnsuitableInner"] => "1",
346 $alias["fUnreliableInner"] => "1",
347 $alias["fIsolatedOuter"] => "1",
348 $alias["fIsolatedInner"] => "1",
349 $alias["fMeanPedRmsOuter"] => "1",
350 $alias["fMeanPedRmsInner"] => "1",
351 $alias["fArrTimeMeanInner"] => "1",
352 $alias["fArrTimeMeanOuter"] => "1",
353 $alias["fArrTimeRmsInner"] => "1",
354 $alias["fArrTimeRmsOuter"] => "1",
355 $alias["fMeanSignalInner"] => "1",
356 $alias["fMeanSignalOuter"] => "1",
357 $alias["fPulsePosMean"] => "1",
358 $alias["fConvFactorInner"] => "1",
359 $alias["fConvFactorOuter"] => "1",
360 $alias["fIsolatedMaxCluster"] => "1",
361 $alias["fMeanNumberIslands"] => "1",
362 $alias["fPSF"] => "1",
363 $alias["fRatio"] => "1",
364 $alias["fMuonNumber"] => "1",
365 $alias["fEffOnTime"] => "1",
366 $alias["fEffOnTime/fRunTime"] => "1",
367 $alias["fEffOnTime/3600"] => "1",
368 $alias["fMuonRate"] => "1",
369 $alias["fInhomogeneity"] => "1",
370 $alias["fDataRate"] => "1",
371 $alias["fMaxHumidity"] => "1",
372 $alias["fBrightnessMed"] => "1",
373 $alias["fBrightnessRMS"] => "1",
374 $alias["fNumStarsMed"] => "1",
375 $alias["fNumStarsRMS"] => "1",
376 $alias["fNumStarsCorMed"] => "1",
377 $alias["fNumStarsCorRMS"] => "1",
378 $alias["fDate"] => "1",
379 $alias["fCaCoFileFound"] => "1",
380 $alias["fTest"] => "1",
381 $alias["fSourceKEY"] => "1",
382 $alias["fEvents"] => "1",
383 $alias["fPositionSignal"] => "1",
384 $alias["fPositionFWHM"] => "1",
385 $alias["fHeightSignal"] => "1",
386 $alias["fHeightFWHM"] => "1",
387 $alias["fHasSignal"] => "1",
388 $alias["fHasPedestal"] => "1",
389 $alias["fPositionAsym"] => "1",
390 $alias["fHeightAsym"] => "1",
391 $alias["fEventsInterlaced"] => "1",
392 $alias["fPositionSignalInterlaced"] => "1",
393 $alias["fPositionFWHMInterlaced"] => "1",
394 $alias["fHeightSignalInterlaced"] => "1",
395 $alias["fHeightFWHMInterlaced"] => "1",
396 $alias["fHasSignalInterlaced"] => "1",
397 $alias["fHasPedestalInterlaced"] => "1",
398 $alias["fPositionAsymInterlaced"] => "1",
399 $alias["fHeightAsymInterlaced"] => "1",
400 $alias["fReturnCode"] => "1",
401 $alias["fFailedCode"] => "1",
402 $alias["fFailedCodeAdd"] => "1",
403 "Time" => "1",
404// "Time [h]" => "1",
405 "ZDMin" => "1",
406 "ZDMax" => "1",
407// "Evts#" => "1",
408// "Runs#" => "1"
409 "Runs" => "1",
410 "Evts" => "1",
411);
412
413function GetCheck($fromtable, $val)
414{
415 $checks = array
416 (
417 "fRunTypeName" => $fromtable . ".fRunTypeKEY",
418 "fProjectName" => $fromtable . ".fProjectKEY",
419 "fSourceName" => $fromtable . ".fSourceKEY",
420 "fMagicNumberName" => $fromtable . ".fMagicNumberKEY",
421 "fL1TriggerTableName" => $fromtable . ".fL1TriggerTableKEY",
422 "fL2TriggerTableName" => $fromtable . ".fL2TriggerTableKEY",
423 "fHvSettingsName" => $fromtable . ".fHvSettingsKEY",
424 "fCalibrationScriptName" => $fromtable . ".fCalibrationScriptKEY",
425 "fExcludedFDAName" => $fromtable . ".fExcludedFDAKEY",
426 "fManuallyChangedName" => $fromtable . ".fManuallyChangedKEY",
427 "fObservationModeName" => $fromtable . ".fObservationModeKEY",
428 "fDiscriminatorThresholdTableName" => $fromtable . ".fDiscriminatorThresholdTableKEY",
429 "fTriggerDelayTableName" => $fromtable . ".fTriggerDelayTableKEY",
430 "fTestFlagName" => $fromtable . ".fTestFlagKEY",
431 "fLightConditionsName" => $fromtable . ".fLightConditionsKEY",
432 "fParticleTypeName" => $fromtable . ".fParticleTypeKEY",
433 "fFitsFileName" => $fromtable . ".fFitsFileKEY",
434 "fObjectName" => $fromtable . ".fObjectKEY",
435 "fStatusName" => $fromtable . ".fStatusKEY",
436 );
437
438 $check="";
439 if (!empty($checks[$val]))
440 $check=$checks[$val];
441 return $check;
442}
443
444
445function GetTable($fromtable, $val)
446{
447 $tables = array
448 (
449 "fSequenceFirst" => $fromtable . ".fSequenceFirst",
450 "fSequenceLast" => $fromtable . ".fSequenceLast",
451 "fNumEvents" => $fromtable . ".fNumEvents",
452 "fRunStart" => $fromtable . ".fRunStart",
453 "fLastUpdate" => $fromtable . ".fLastUpdate",
454 "fRunTime" => $fromtable . ".fRunTime",
455 "fRunTime/60" => $fromtable . ".fRunTime/60",
456 "fAzimuthMin" => $fromtable . ".fAzimuthMin",
457 "fAzimuthMax" => $fromtable . ".fAzimuthMax",
458 "fZenithDistanceMin" => $fromtable . ".fZenithDistanceMin",
459 "fZenithDistanceMax" => $fromtable . ".fZenithDistanceMax",
460 "fRunNumber" => "RunData.fRunNumber",
461 "fRunStop" => "RunData.fRunStop",
462 "fAzimuth" => "RunData.fAzimuth",
463 "fZenithDistance" => "RunData.fZenithDistance",
464 "fFormatVersion" => "RunData.fFormatVersion",
465 "fRunTypeName" => "RunType.fRunTypeName",
466 "fDaqStoreRate" => "RunData.fDaqStoreRate",
467 "fDaqTriggerRate" => "RunData.fDaqTriggerRate",
468 "fMeanTriggerRate" => "RunData.fMeanTriggerRate",
469 "fL2RatePresc" => "RunData.fL2RatePresc",
470 "fL2RateUnpresc" => "RunData.fL2RateUnpresc",
471 "fMagicNumberName" => "MagicNumber.fMagicNumberName",
472 "fExcludedFDAName" => "ExcludedFDA.fExcludedFDAName",
473 "fProjectName" => "Project.fProjectName",
474 "fSourceName" => "Source.fSourceName",
475 "fL1TriggerTableName" => "L1TriggerTable.fL1TriggerTableName",
476 "fL2TriggerTableName" => "L2TriggerTable.fL2TriggerTableName",
477 "fHvSettingsName" => "HvSettings.fHvSettingsName",
478 "fManuallyChangedName" => "ManuallyChanged.fManuallyChangedName",
479 "fObservationModeName" => "ObservationMode.fObservationModeName",
480 "fTriggerDelayTableName" => "TriggerDelayTable.fTriggerDelayTableName",
481 "fDiscriminatorThresholdTableName" => "DiscriminatorThresholdTable.fDiscriminatorThesholdTableName",
482 "fCalibrationScriptName" => "CalibrationScript.fCalibrationScriptName",
483 "fTestFlagName" => "TestFlag.fTestFlagName",
484 "fLightConditionsName" => "LightConditions.fLightConditionsName",
485 "fRawFileAvail" => "RunProcessStatus.fRawFileAvail",
486 "fCCFileAvail" => "RunProcessStatus.fCCFileAvail",
487 "fCaCoFileAvail" => "RunProcessStatus.fCaCoFileAvail",
488 "fCaCoFileFound" => "RunProcessStatus.fCaCoFileFound",
489 "fTimingCorrection" => "RunProcessStatus.fTimingCorrection",
490// "fFillDotRaw" => "RunProcessStatus.fFillDotRaw",
491 "fSequenceFileWritten" => "SequenceProcessStatus.fSequenceFileWritten",
492 "fAllFilesAvail" => "SequenceProcessStatus.fAllFilesAvail",
493 "fCallisto" => "SequenceProcessStatus.fCallisto",
494 "fFillCallisto" => "SequenceProcessStatus.fFillCallisto",
495 "fStar" => "SequenceProcessStatus.fStar",
496 "fFillStar" => "SequenceProcessStatus.fFillStar",
497 "fUnsuitableInner" => "Calibration.fUnsuitableInner",
498 "fUnsuitableOuter" => "Calibration.fUnsuitableOuter",
499 "fUnreliableInner" => "Calibration.fUnreliableInner",
500 "fUnreliableOuter" => "Calibration.fUnreliableOuter",
501 "fIsolatedInner" => "Calibration.fIsolatedInner",
502 "fIsolatedOuter" => "Calibration.fIsolatedOuter",
503 "fIsolatedMaxCluster" => "Calibration.fIsolatedMaxCluster",
504 "fLastUpdate" => "Calibration.fLastUpdate",
505 "fMeanPedRmsInner" => "Calibration.fMeanPedRmsInner",
506 "fMeanPedRmsOuter" => "Calibration.fMeanPedRmsOuter",
507 "fArrTimeMeanInner" => "Calibration.fArrTimeMeanInner",
508 "fArrTimeMeanOuter" => "Calibration.fArrTimeMeanOuter",
509 "fArrTimeRmsInner" => "Calibration.fArrTimeRmsInner",
510 "fArrTimeRmsOuter" => "Calibration.fArrTimeRmsOuter",
511 "fMeanSignalInner" => "Calibration.fMeanSignalInner",
512 "fMeanSignalOuter" => "Calibration.fMeanSignalOuter",
513 "fPulsePosMean" => "Calibration.fPulsePosMean",
514 "fConvFactorInner" => "Calibration.fConvFactorInner",
515 "fConvFactorOuter" => "Calibration.fConvFactorOuter",
516 "fMeanNumberIslands" => "Star.fMeanNumberIslands",
517 "fPSF" => "Star.fPSF",
518 "fRatio" => "Star.fRatio",
519 "fMuonNumber" => "Star.fMuonNumber",
520 "fEffOnTime" => "fEffOnTime",
521 "fEffOnTime/fRunTime" => "Sequences.fRunTime/Star.fEffOnTime",
522 "fEffOnTime/3600" => "fEffOnTime/3600",
523// "fEffOnTime" => $fromtable . ".fEffOnTime",
524 "fMuonRate" => "Star.fMuonRate",
525 "fInhomogeneity" => "Star.fInhomogeneity",
526 "fDataRate" => "Star.fDataRate",
527 "fMaxHumidity" => "Star.fMaxHumidity",
528 "fBrightnessMed" => "Star.fBrightnessMed",
529 "fBrightnessRMS" => "Star.fBrightnessRMS",
530 "fNumStarsMed" => "Star.fNumStarsMed",
531 "fNumStarsRMS" => "Star.fNumStarsRMS",
532 "fNumStarsCorMed" => "Star.fNumStarsCorMed",
533 "fNumStarsCorRMS" => "Star.fNumStarsCorRMS",
534 "fDataSetNumber" => $fromtable . ".fDataSetNumber",
535 "fDataSetInserted" => "DataSetProcessStatus.fDataSetInserted",
536 "fStarFilesAvail" => "DataSetProcessStatus.fStarFilesAvail",
537 "fGanymed" => "DataSetProcessStatus.fGanymed",
538 "fFillGanymed" => "DataSetProcessStatus.fFillGanymed",
539 "fComment" => "DataSets.fComment",
540 "fEvents" => "DataCheck.fEvents",
541 "fPositionSignal" => "DataCheck.fPositionSignal",
542 "fPositionFWHM" => "DataCheck.fPositionFWHM",
543 "fHeightSignal" => "DataCheck.fHeightSignal",
544 "fHeightFWHM" => "DataCheck.fHeightFWHM",
545 "fHasSignal" => "DataCheck.fHasSignal",
546 "fHasPedestal" => "DataCheck.fHasPedestal",
547 "fPositionAsym" => "DataCheck.fPositionAsym",
548 "fHeightAsym" => "DataCheck.fHeightAsym",
549 "fEventsInterlaced" => "DataCheck.fEventsInterlaced",
550 "fPositionSignalInterlaced" => "DataCheck.fPositionSignalInterlaced",
551 "fPositionFWHMInterlaced" => "DataCheck.fPositionFWHMInterlaced",
552 "fHeightSignalInterlaced" => "DataCheck.fHeightSignalInterlaced",
553 "fHeightFWHMInterlaced" => "DataCheck.fHeightFWHMInterlaced",
554 "fHasSignalInterlaced" => "DataCheck.fHasSignalInterlaced",
555 "fHasPedestalInterlaced" => "DataCheck.fHasPedestalInterlaced",
556 "fPositionAsymInterlaced" => "DataCheck.fPositionAsymInterlaced",
557 "fHeightAsymInterlaced" => "DataCheck.fHeightAsymInterlaced",
558 "fExcessEvents" => "Ganymed.fExcessEvents",
559 "fBackgroundEvents" => "Ganymed.fBackgroundEvents",
560 "fSignalEvents" => "Ganymed.fSignalEvents",
561 "fSignificance" => "Ganymed.fSignificance",
562 "fScaleFactor" => "Ganymed.fScaleFactor",
563 "fExcessEvents*60/fEffOnTime" => "fExcessEvents*60/fEffOnTime",
564 "fBackgroundEvents*60/fEffOnTime" => "fBackgroundEvents*60/fEffOnTime",
565 "fSignalEvents*60/fEffOnTime" => "fSignalEvents*60/fEffOnTime",
566 "Round(fSignificance/Sqrt(fEffOnTime/3600),2)" => "Round(fSignificance/Sqrt(fEffOnTime/3600),2)",
567 "SUM(fRunTime)/3600" => "'Time [h]'",
568 "SUM(fNumEvents)" => "'Evts'",
569 "Min(fZenithDistanceMin)" => "'ZDMin'",
570 "Max(fZenithDistanceMax)" => "'ZDMax'",
571 "Min(fZenithDistance)" => "'ZdMin'",
572 "Max(fZenithDistance)" => "'ZdMax'",
573// "COUNT(*)" => "'Sequence'",
574 "fStartTime" => "fStartTime",
575 "fFailedTime" => "fFailedTime",
576 "fReturnCode" => "fReturnCode",
577 "fFailedCode" => "fFailedCode",
578 "fFailedCodeAdd" => "fFailedCodeAdd",
579 "fParticleTypeName" => "ParticleType.fParticleTypeName",
580 "fFitsFileName" => "FitsFile.fFitsFileName",
581 "fObjectName" => "Object.fObjectName",
582 "fStatusName" => "Status.fStatusName",
583 );
584
585 $table="";
586 if (!empty($tables[$val]))
587 $table=$tables[$val];
588 if ($val=="NumRuns")
589 $table="'# Runs'";
590 if ($val=="NumSequ")
591 $table="'# Sequ'";
592 if ($val=="NumDS")
593 $table="'# Datasets'";
594 if ($val=="NumDays")
595 $table="'# days'";
596 if (empty($table))
597 $table=$val;
598 return $table;
599}
600
601
602function GetJoin($fromtable, $val)
603{
604 $joins = array
605 (
606 "fRunTypeName" => " LEFT JOIN RunType ON " . $fromtable . ".fRunTypeKEY=RunType.fRunTypeKEY ",
607 "fProjectName" => " LEFT JOIN Project ON " . $fromtable . ".fProjectKEY=Project.fProjectKEY ",
608 "fSourceName" => " LEFT JOIN Source ON " . $fromtable . ".fSourceKEY=Source.fSourceKEY ",
609 "fMagicNumberName" => " LEFT JOIN MagicNumber ON " . $fromtable . ".fMagicNumberKEY=MagicNumber.fMagicNumberKEY ",
610 "fL1TriggerTableName" => " LEFT JOIN L1TriggerTable ON " . $fromtable . ".fL1TriggerTableKEY=L1TriggerTable.fL1TriggerTableKEY",
611 "fL2TriggerTableName" => " LEFT JOIN L2TriggerTable ON " . $fromtable . ".fL2TriggerTableKEY=L2TriggerTable.fL2TriggerTableKEY",
612 "fHvSettingsName" => " LEFT JOIN HvSettings ON " . $fromtable . ".fHvSettingsKEY=HvSettings.fHvSettingsKEY",
613 "fCalibrationScriptName" => " LEFT JOIN CalibrationScript ON " . $fromtable . ".fCalibrationScriptKEY=CalibrationScript.fCalibrationScriptKEY",
614 "fExcludedFDAName" => " LEFT JOIN ExcludedFDA ON " . $fromtable . ".fExcludedFDAKEY=ExcludedFDA.fExcludedFDAKEY",
615 "fManuallyChangedName" => " LEFT JOIN ManuallyChanged ON " . $fromtable . ".fManuallyChangedKEY=ManuallyChanged.fManuallyChangedKEY ",
616 "fObservationModeName" => " LEFT JOIN ObservationMode ON " . $fromtable . ".fObservationModeKEY=ObservationMode.fObservationModeKEY ",
617 "fDiscriminatorThresholdTableName" => " LEFT JOIN DiscriminatorThresholdTable ON " . $fromtable . ".fDiscriminatorThresholdTableKEY=DiscriminatorThresholdTable.fDiscriminatorThresholdTableKEY ",
618 "fTriggerDelayTableName" => " LEFT JOIN TriggerDelayTable ON " . $fromtable . ".fTriggerDelayTableKEY=TriggerDelayTable.fTriggerDelayTableKEY ",
619 "fTestFlagName" => " LEFT JOIN TestFlag ON " . $fromtable . ".fTestFlagKEY=TestFlag.fTestFlagKEY",
620 "fLightConditionsName" => " LEFT JOIN LightConditions ON " . $fromtable . ".fLightConditionsKEY=LightConditions.fLightConditionsKEY",
621 "fParticleTypeName" => " LEFT JOIN ParticleType ON " . $fromtable . ".fParticleTypeKEY=ParticleType.fParticleTypeKEY ",
622 "fFitsFileName" => " LEFT JOIN FitsFile ON " . $fromtable . ".fFitsFileKEY=FitsFile.fFitsFileKEY",
623 "fObjectName" => " LEFT JOIN Object ON " . $fromtable . ".fObjectKEY=Object.fObjectKEY ",
624 "fStatusName" => " LEFT JOIN Status ON " . $fromtable . ".fStatusKEY=Status.fStatusKEY ",
625 );
626
627
628 $join="";
629 if (!empty($joins[$val]))
630 $join=$joins[$val];
631 return $join;
632}
633
634
635?>
Note: See TracBrowser for help on using the repository browser.