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

Last change on this file since 8181 was 8181, checked in by Daniela Dorner, 18 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 37.6 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 "fWobble" => "Wobble",
268 "fComment" => "Comment",
269 "fExcessEvents*60/fEffOnTime" => "Exc<br>Rate",
270 "fBackgroundEvents*60/fEffOnTime" => "Bg<br>Rate",
271 "fSignalEvents*60/fEffOnTime" => "Sign<br>Rate",
272 "Round(fSignificance/Sqrt(fEffOnTime/3600),2)" => "Signf<br>Rate",
273 "SUM(fRunTime)/3600" => "Time [h]",
274 "SUM(fNumEvents)" => "Evts",
275 "Min(fZenithDistanceMin)" => "ZDMin",
276 "Max(fZenithDistanceMax)" => "ZDMax",
277 "Min(fZenithDistance)" => "ZdMin",
278 "Max(fZenithDistance)" => "ZdMax",
279// "fArrTimeLimit" => "ArrTRms",
280 "fArrTimeLimit" => "ArrTime",
281 "fPulsePosLimit" => "PulsePos",
282 "fRunTimeLimit" => "UpTime",
283 "fPedRmsInLimit" => "PedRms",
284 "fMuonRateLimit" => "MuonRate",
285 "fMuonNumLimit" => "# Muons",
286 "fMuonCalLimit" => "MuonCal",
287 "fPSFLimit" => "PSF",
288 "fInhomLimit" => "Inhom.",
289 "fNumIslLimit" => "# Islands",
290 "fImgRateLimit" => "ImgRate",
291 "fSkyBrightLimit" => "SkyBrightness",
292 "fNumStarsLimit" => "# id. Stars",
293 "fNumStarsCorLimit" => "# cor. Stars",
294 "fUnsInLimit" => "Unsuit.In",
295 "fIsoInLimit" => "Isol.In",
296 "fIMCLimit" => "IMC",
297 "fMaxHumLimit" => "Humidity",
298 "fZdMinLimit" => "ZdMin",
299 "fZdMaxLimit" => "ZdMax",
300 "fRelTimeLimit" => "Rel.Ontime",
301 "fEMin" => "Emin",
302 "fEMax" => "Emax",
303 "fParticleTypeName" => "Particle",
304 "fStartTime" => "Process",
305 "fFailedTime" => "Failed",
306 "fReturnCode" => "Ret<br>Code",
307 "fFailedCode" => "Err<br>Code",
308 "fFailedCodeAdd" => "Code<br>Add",
309 "fTimestamp" => "Time",
310 "fExposure" => "Exposure",
311 "fFitsFileName" => "FitsFile",
312 "fObjectName" => "Object",
313 "fSkyLevel" => "SkyLevel",
314 "fFWHM" => "FWHM",
315 "fApertureRadius" => "Ap.Rad.",
316 "fInstrumentalMag" => "Instr.Mag.",
317 "fInstrumentalMagErr" => "Instr.Mag.Err.",
318 "fStatusName" => "StatusCode",
319// "COUNT(*)" => "# Runs",
320// "COUNT(*)" => "Sequence",
321 );
322
323
324$rightalign = array
325 (
326 $alias["fRawFileKEY"] => "1",
327 $alias["fFormatVersion"] => "1",
328 $alias["fRunNumber"] => "1",
329 $alias["fZenithDistance"] => "1",
330 $alias["fAzimuth"] => "1",
331 $alias["fMeanTriggerRate"] => "1",
332 $alias["fDaqTriggerRate"] => "1",
333 $alias["fDaqStoreRate"] => "1",
334 $alias["fL2RatePresc"] => "1",
335 $alias["fL2RateUnpresc"] => "1",
336 $alias["fSequenceFirst"] => "1",
337 $alias["fNumEvents"] => "1",
338 $alias["fRunTime/60"] => "1",
339 $alias["fSequenceLast"] => "1",
340 $alias["fZenithDistanceMin"] => "1",
341 $alias["fZenithDistanceMax"] => "1",
342 $alias["fAzimuthMin"] => "1",
343 $alias["fAzimuthMax"] => "1",
344 $alias["fUnsuitableOuter"] => "1",
345 $alias["fUnreliableOuter"] => "1",
346 $alias["fUnsuitableInner"] => "1",
347 $alias["fUnreliableInner"] => "1",
348 $alias["fIsolatedOuter"] => "1",
349 $alias["fIsolatedInner"] => "1",
350 $alias["fMeanPedRmsOuter"] => "1",
351 $alias["fMeanPedRmsInner"] => "1",
352 $alias["fArrTimeMeanInner"] => "1",
353 $alias["fArrTimeMeanOuter"] => "1",
354 $alias["fArrTimeRmsInner"] => "1",
355 $alias["fArrTimeRmsOuter"] => "1",
356 $alias["fMeanSignalInner"] => "1",
357 $alias["fMeanSignalOuter"] => "1",
358 $alias["fPulsePosMean"] => "1",
359 $alias["fConvFactorInner"] => "1",
360 $alias["fConvFactorOuter"] => "1",
361 $alias["fIsolatedMaxCluster"] => "1",
362 $alias["fMeanNumberIslands"] => "1",
363 $alias["fPSF"] => "1",
364 $alias["fRatio"] => "1",
365 $alias["fMuonNumber"] => "1",
366 $alias["fEffOnTime"] => "1",
367 $alias["fEffOnTime/fRunTime"] => "1",
368 $alias["fEffOnTime/3600"] => "1",
369 $alias["fMuonRate"] => "1",
370 $alias["fInhomogeneity"] => "1",
371 $alias["fDataRate"] => "1",
372 $alias["fMaxHumidity"] => "1",
373 $alias["fBrightnessMed"] => "1",
374 $alias["fBrightnessRMS"] => "1",
375 $alias["fNumStarsMed"] => "1",
376 $alias["fNumStarsRMS"] => "1",
377 $alias["fNumStarsCorMed"] => "1",
378 $alias["fNumStarsCorRMS"] => "1",
379 $alias["fDate"] => "1",
380 $alias["fCaCoFileFound"] => "1",
381 $alias["fTest"] => "1",
382 $alias["fSourceKEY"] => "1",
383 $alias["fEvents"] => "1",
384 $alias["fPositionSignal"] => "1",
385 $alias["fPositionFWHM"] => "1",
386 $alias["fHeightSignal"] => "1",
387 $alias["fHeightFWHM"] => "1",
388 $alias["fHasSignal"] => "1",
389 $alias["fHasPedestal"] => "1",
390 $alias["fPositionAsym"] => "1",
391 $alias["fHeightAsym"] => "1",
392 $alias["fEventsInterlaced"] => "1",
393 $alias["fPositionSignalInterlaced"] => "1",
394 $alias["fPositionFWHMInterlaced"] => "1",
395 $alias["fHeightSignalInterlaced"] => "1",
396 $alias["fHeightFWHMInterlaced"] => "1",
397 $alias["fHasSignalInterlaced"] => "1",
398 $alias["fHasPedestalInterlaced"] => "1",
399 $alias["fPositionAsymInterlaced"] => "1",
400 $alias["fHeightAsymInterlaced"] => "1",
401 $alias["fReturnCode"] => "1",
402 $alias["fFailedCode"] => "1",
403 $alias["fFailedCodeAdd"] => "1",
404 "Time" => "1",
405// "Time [h]" => "1",
406 "ZDMin" => "1",
407 "ZDMax" => "1",
408// "Evts#" => "1",
409// "Runs#" => "1"
410 "Runs" => "1",
411 "Evts" => "1",
412);
413
414function GetCheck($fromtable, $val)
415{
416 $checks = array
417 (
418 "fRunTypeName" => $fromtable . ".fRunTypeKEY",
419 "fProjectName" => $fromtable . ".fProjectKEY",
420 "fSourceName" => $fromtable . ".fSourceKEY",
421 "fMagicNumberName" => $fromtable . ".fMagicNumberKEY",
422 "fL1TriggerTableName" => $fromtable . ".fL1TriggerTableKEY",
423 "fL2TriggerTableName" => $fromtable . ".fL2TriggerTableKEY",
424 "fHvSettingsName" => $fromtable . ".fHvSettingsKEY",
425 "fCalibrationScriptName" => $fromtable . ".fCalibrationScriptKEY",
426 "fExcludedFDAName" => $fromtable . ".fExcludedFDAKEY",
427 "fManuallyChangedName" => $fromtable . ".fManuallyChangedKEY",
428 "fObservationModeName" => $fromtable . ".fObservationModeKEY",
429 "fDiscriminatorThresholdTableName" => $fromtable . ".fDiscriminatorThresholdTableKEY",
430 "fTriggerDelayTableName" => $fromtable . ".fTriggerDelayTableKEY",
431 "fTestFlagName" => $fromtable . ".fTestFlagKEY",
432 "fLightConditionsName" => $fromtable . ".fLightConditionsKEY",
433 "fParticleTypeName" => $fromtable . ".fParticleTypeKEY",
434 "fFitsFileName" => $fromtable . ".fFitsFileKEY",
435 "fObjectName" => $fromtable . ".fObjectKEY",
436 "fStatusName" => $fromtable . ".fStatusKEY",
437 );
438
439 $check="";
440 if (!empty($checks[$val]))
441 $check=$checks[$val];
442 return $check;
443}
444
445
446function GetTable($fromtable, $val)
447{
448 $tables = array
449 (
450 "fSequenceFirst" => $fromtable . ".fSequenceFirst",
451 "fSequenceLast" => $fromtable . ".fSequenceLast",
452 "fNumEvents" => $fromtable . ".fNumEvents",
453 "fRunStart" => $fromtable . ".fRunStart",
454 "fLastUpdate" => $fromtable . ".fLastUpdate",
455 "fRunTime" => $fromtable . ".fRunTime",
456 "fRunTime/60" => $fromtable . ".fRunTime/60",
457 "fAzimuthMin" => $fromtable . ".fAzimuthMin",
458 "fAzimuthMax" => $fromtable . ".fAzimuthMax",
459 "fZenithDistanceMin" => $fromtable . ".fZenithDistanceMin",
460 "fZenithDistanceMax" => $fromtable . ".fZenithDistanceMax",
461 "fRunNumber" => "RunData.fRunNumber",
462 "fRunStop" => "RunData.fRunStop",
463 "fAzimuth" => "RunData.fAzimuth",
464 "fZenithDistance" => "RunData.fZenithDistance",
465 "fFormatVersion" => "RunData.fFormatVersion",
466 "fRunTypeName" => "RunType.fRunTypeName",
467 "fDaqStoreRate" => "RunData.fDaqStoreRate",
468 "fDaqTriggerRate" => "RunData.fDaqTriggerRate",
469 "fMeanTriggerRate" => "RunData.fMeanTriggerRate",
470 "fL2RatePresc" => "RunData.fL2RatePresc",
471 "fL2RateUnpresc" => "RunData.fL2RateUnpresc",
472 "fMagicNumberName" => "MagicNumber.fMagicNumberName",
473 "fExcludedFDAName" => "ExcludedFDA.fExcludedFDAName",
474 "fProjectName" => "Project.fProjectName",
475 "fSourceName" => "Source.fSourceName",
476 "fL1TriggerTableName" => "L1TriggerTable.fL1TriggerTableName",
477 "fL2TriggerTableName" => "L2TriggerTable.fL2TriggerTableName",
478 "fHvSettingsName" => "HvSettings.fHvSettingsName",
479 "fManuallyChangedName" => "ManuallyChanged.fManuallyChangedName",
480 "fObservationModeName" => "ObservationMode.fObservationModeName",
481 "fTriggerDelayTableName" => "TriggerDelayTable.fTriggerDelayTableName",
482 "fDiscriminatorThresholdTableName" => "DiscriminatorThresholdTable.fDiscriminatorThesholdTableName",
483 "fCalibrationScriptName" => "CalibrationScript.fCalibrationScriptName",
484 "fTestFlagName" => "TestFlag.fTestFlagName",
485 "fLightConditionsName" => "LightConditions.fLightConditionsName",
486 "fRawFileAvail" => "RunProcessStatus.fRawFileAvail",
487 "fCCFileAvail" => "RunProcessStatus.fCCFileAvail",
488 "fCaCoFileAvail" => "RunProcessStatus.fCaCoFileAvail",
489 "fCaCoFileFound" => "RunProcessStatus.fCaCoFileFound",
490 "fTimingCorrection" => "RunProcessStatus.fTimingCorrection",
491// "fFillDotRaw" => "RunProcessStatus.fFillDotRaw",
492 "fSequenceFileWritten" => "SequenceProcessStatus.fSequenceFileWritten",
493 "fAllFilesAvail" => "SequenceProcessStatus.fAllFilesAvail",
494 "fCallisto" => "SequenceProcessStatus.fCallisto",
495 "fFillCallisto" => "SequenceProcessStatus.fFillCallisto",
496 "fStar" => "SequenceProcessStatus.fStar",
497 "fFillStar" => "SequenceProcessStatus.fFillStar",
498 "fUnsuitableInner" => "Calibration.fUnsuitableInner",
499 "fUnsuitableOuter" => "Calibration.fUnsuitableOuter",
500 "fUnreliableInner" => "Calibration.fUnreliableInner",
501 "fUnreliableOuter" => "Calibration.fUnreliableOuter",
502 "fIsolatedInner" => "Calibration.fIsolatedInner",
503 "fIsolatedOuter" => "Calibration.fIsolatedOuter",
504 "fIsolatedMaxCluster" => "Calibration.fIsolatedMaxCluster",
505 "fLastUpdate" => "Calibration.fLastUpdate",
506 "fMeanPedRmsInner" => "Calibration.fMeanPedRmsInner",
507 "fMeanPedRmsOuter" => "Calibration.fMeanPedRmsOuter",
508 "fArrTimeMeanInner" => "Calibration.fArrTimeMeanInner",
509 "fArrTimeMeanOuter" => "Calibration.fArrTimeMeanOuter",
510 "fArrTimeRmsInner" => "Calibration.fArrTimeRmsInner",
511 "fArrTimeRmsOuter" => "Calibration.fArrTimeRmsOuter",
512 "fMeanSignalInner" => "Calibration.fMeanSignalInner",
513 "fMeanSignalOuter" => "Calibration.fMeanSignalOuter",
514 "fPulsePosMean" => "Calibration.fPulsePosMean",
515 "fConvFactorInner" => "Calibration.fConvFactorInner",
516 "fConvFactorOuter" => "Calibration.fConvFactorOuter",
517 "fMeanNumberIslands" => "Star.fMeanNumberIslands",
518 "fPSF" => "Star.fPSF",
519 "fRatio" => "Star.fRatio",
520 "fMuonNumber" => "Star.fMuonNumber",
521 "fEffOnTime" => "fEffOnTime",
522 "fEffOnTime/fRunTime" => "Sequences.fRunTime/Star.fEffOnTime",
523 "fEffOnTime/3600" => "fEffOnTime/3600",
524// "fEffOnTime" => $fromtable . ".fEffOnTime",
525 "fMuonRate" => "Star.fMuonRate",
526 "fInhomogeneity" => "Star.fInhomogeneity",
527 "fDataRate" => "Star.fDataRate",
528 "fMaxHumidity" => "Star.fMaxHumidity",
529 "fBrightnessMed" => "Star.fBrightnessMed",
530 "fBrightnessRMS" => "Star.fBrightnessRMS",
531 "fNumStarsMed" => "Star.fNumStarsMed",
532 "fNumStarsRMS" => "Star.fNumStarsRMS",
533 "fNumStarsCorMed" => "Star.fNumStarsCorMed",
534 "fNumStarsCorRMS" => "Star.fNumStarsCorRMS",
535 "fDataSetNumber" => $fromtable . ".fDataSetNumber",
536 "fDataSetInserted" => "DataSetProcessStatus.fDataSetInserted",
537 "fStarFilesAvail" => "DataSetProcessStatus.fStarFilesAvail",
538 "fGanymed" => "DataSetProcessStatus.fGanymed",
539 "fFillGanymed" => "DataSetProcessStatus.fFillGanymed",
540 "fWobble" => "DataSets.fWobble",
541 "fComment" => "DataSets.fComment",
542 "fEvents" => "DataCheck.fEvents",
543 "fPositionSignal" => "DataCheck.fPositionSignal",
544 "fPositionFWHM" => "DataCheck.fPositionFWHM",
545 "fHeightSignal" => "DataCheck.fHeightSignal",
546 "fHeightFWHM" => "DataCheck.fHeightFWHM",
547 "fHasSignal" => "DataCheck.fHasSignal",
548 "fHasPedestal" => "DataCheck.fHasPedestal",
549 "fPositionAsym" => "DataCheck.fPositionAsym",
550 "fHeightAsym" => "DataCheck.fHeightAsym",
551 "fEventsInterlaced" => "DataCheck.fEventsInterlaced",
552 "fPositionSignalInterlaced" => "DataCheck.fPositionSignalInterlaced",
553 "fPositionFWHMInterlaced" => "DataCheck.fPositionFWHMInterlaced",
554 "fHeightSignalInterlaced" => "DataCheck.fHeightSignalInterlaced",
555 "fHeightFWHMInterlaced" => "DataCheck.fHeightFWHMInterlaced",
556 "fHasSignalInterlaced" => "DataCheck.fHasSignalInterlaced",
557 "fHasPedestalInterlaced" => "DataCheck.fHasPedestalInterlaced",
558 "fPositionAsymInterlaced" => "DataCheck.fPositionAsymInterlaced",
559 "fHeightAsymInterlaced" => "DataCheck.fHeightAsymInterlaced",
560 "fExcessEvents" => "Ganymed.fExcessEvents",
561 "fBackgroundEvents" => "Ganymed.fBackgroundEvents",
562 "fSignalEvents" => "Ganymed.fSignalEvents",
563 "fSignificance" => "Ganymed.fSignificance",
564 "fScaleFactor" => "Ganymed.fScaleFactor",
565 "fExcessEvents*60/fEffOnTime" => "fExcessEvents*60/fEffOnTime",
566 "fBackgroundEvents*60/fEffOnTime" => "fBackgroundEvents*60/fEffOnTime",
567 "fSignalEvents*60/fEffOnTime" => "fSignalEvents*60/fEffOnTime",
568 "Round(fSignificance/Sqrt(fEffOnTime/3600),2)" => "Round(fSignificance/Sqrt(fEffOnTime/3600),2)",
569 "SUM(fRunTime)/3600" => "'Time [h]'",
570 "SUM(fNumEvents)" => "'Evts'",
571 "Min(fZenithDistanceMin)" => "'ZDMin'",
572 "Max(fZenithDistanceMax)" => "'ZDMax'",
573 "Min(fZenithDistance)" => "'ZdMin'",
574 "Max(fZenithDistance)" => "'ZdMax'",
575// "COUNT(*)" => "'Sequence'",
576 "fStartTime" => "fStartTime",
577 "fFailedTime" => "fFailedTime",
578 "fReturnCode" => "fReturnCode",
579 "fFailedCode" => "fFailedCode",
580 "fFailedCodeAdd" => "fFailedCodeAdd",
581 "fParticleTypeName" => "ParticleType.fParticleTypeName",
582 "fFitsFileName" => "FitsFile.fFitsFileName",
583 "fObjectName" => "Object.fObjectName",
584 "fStatusName" => "Status.fStatusName",
585 );
586
587 $table="";
588 if (!empty($tables[$val]))
589 $table=$tables[$val];
590 if ($val=="NumRuns")
591 $table="'# Runs'";
592 if ($val=="NumSequ")
593 $table="'# Sequ'";
594 if ($val=="NumDS")
595 $table="'# Datasets'";
596 if ($val=="NumDays")
597 $table="'# days'";
598 if (empty($table))
599 $table=$val;
600 return $table;
601}
602
603
604function GetJoin($fromtable, $val)
605{
606 $joins = array
607 (
608 "fRunTypeName" => " LEFT JOIN RunType ON " . $fromtable . ".fRunTypeKEY=RunType.fRunTypeKEY ",
609 "fProjectName" => " LEFT JOIN Project ON " . $fromtable . ".fProjectKEY=Project.fProjectKEY ",
610 "fSourceName" => " LEFT JOIN Source ON " . $fromtable . ".fSourceKEY=Source.fSourceKEY ",
611 "fMagicNumberName" => " LEFT JOIN MagicNumber ON " . $fromtable . ".fMagicNumberKEY=MagicNumber.fMagicNumberKEY ",
612 "fL1TriggerTableName" => " LEFT JOIN L1TriggerTable ON " . $fromtable . ".fL1TriggerTableKEY=L1TriggerTable.fL1TriggerTableKEY",
613 "fL2TriggerTableName" => " LEFT JOIN L2TriggerTable ON " . $fromtable . ".fL2TriggerTableKEY=L2TriggerTable.fL2TriggerTableKEY",
614 "fHvSettingsName" => " LEFT JOIN HvSettings ON " . $fromtable . ".fHvSettingsKEY=HvSettings.fHvSettingsKEY",
615 "fCalibrationScriptName" => " LEFT JOIN CalibrationScript ON " . $fromtable . ".fCalibrationScriptKEY=CalibrationScript.fCalibrationScriptKEY",
616 "fExcludedFDAName" => " LEFT JOIN ExcludedFDA ON " . $fromtable . ".fExcludedFDAKEY=ExcludedFDA.fExcludedFDAKEY",
617 "fManuallyChangedName" => " LEFT JOIN ManuallyChanged ON " . $fromtable . ".fManuallyChangedKEY=ManuallyChanged.fManuallyChangedKEY ",
618 "fObservationModeName" => " LEFT JOIN ObservationMode ON " . $fromtable . ".fObservationModeKEY=ObservationMode.fObservationModeKEY ",
619 "fDiscriminatorThresholdTableName" => " LEFT JOIN DiscriminatorThresholdTable ON " . $fromtable . ".fDiscriminatorThresholdTableKEY=DiscriminatorThresholdTable.fDiscriminatorThresholdTableKEY ",
620 "fTriggerDelayTableName" => " LEFT JOIN TriggerDelayTable ON " . $fromtable . ".fTriggerDelayTableKEY=TriggerDelayTable.fTriggerDelayTableKEY ",
621 "fTestFlagName" => " LEFT JOIN TestFlag ON " . $fromtable . ".fTestFlagKEY=TestFlag.fTestFlagKEY",
622 "fLightConditionsName" => " LEFT JOIN LightConditions ON " . $fromtable . ".fLightConditionsKEY=LightConditions.fLightConditionsKEY",
623 "fParticleTypeName" => " LEFT JOIN ParticleType ON " . $fromtable . ".fParticleTypeKEY=ParticleType.fParticleTypeKEY ",
624 "fFitsFileName" => " LEFT JOIN FitsFile ON " . $fromtable . ".fFitsFileKEY=FitsFile.fFitsFileKEY",
625 "fObjectName" => " LEFT JOIN Object ON " . $fromtable . ".fObjectKEY=Object.fObjectKEY ",
626 "fStatusName" => " LEFT JOIN Status ON " . $fromtable . ".fStatusKEY=Status.fStatusKEY ",
627 );
628
629
630 $join="";
631 if (!empty($joins[$val]))
632 $join=$joins[$val];
633 return $join;
634}
635
636
637?>
Note: See TracBrowser for help on using the repository browser.