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

Last change on this file since 8135 was 8135, 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 );
49
50$limitsmax = array
51 (
52 "fZdMaxLimit" => "fZenithDistanceMax",
53 "fUnsInLimit" => "fUnsuitableInner",
54 "fIsoInLimit" => "fIsolatedInner",
55 "fIMCLimit" => "fIsolatedMaxCluster",
56 "fMaxHumLimit" => "fMaxHumidity",
57 "fRelTimeLimit" => "fEffOnTime/fRunTime",
58 );
59
60$checkwhere = array
61 (
62 "fRunTypeName" => CheckWhere("fRunTypeKEY", $_GET),
63 "fProjectName" => CheckWhere("fProjectKEY", $_GET),
64 "fSourceName" => CheckWhere("fSourceKEY", $_GET),
65 "fMagicNumberName" => CheckWhere("fMagicNumberKEY", $_GET),
66 "fL1TriggerTableName" => CheckWhere("fL1TriggerTableKEY", $_GET),
67 "fL2TriggerTableName" => CheckWhere("fL2TriggerTableKEY", $_GET),
68 "fHvSettingsName" => CheckWhere("fHvSettingsKEY", $_GET),
69 "fCalibrationScriptName" => CheckWhere("fCalibrationScriptKEY", $_GET),
70 "fExcludedFDAName" => CheckWhere("fExcludedFDAKEY", $_GET),
71 "fManuallyChangedName" => CheckWhere("fManuallyChangedKEY", $_GET),
72 "fObservationModeName" => CheckWhere("fObservationModeKEY", $_GET),
73 "fDiscriminatorThresholdTableName" => CheckWhere("fDiscriminatorThresholdTableKEY", $_GET),
74 "fTriggerDelayTableName" => CheckWhere("fTriggerDelayTableKEY", $_GET),
75 "fTestFlagName" => CheckWhere("fTestFlagKEY", $_GET),
76 "fLightConditionsName" => CheckWhere("fLightConditionsKEY", $_GET),
77 "fParticleTypeName" => CheckWhere("fParticleTypeKEY", $_GET),
78 "fFitsFileName" => CheckWhere("fFitsFileKEY", $_GET),
79 "fObjectName" => CheckWhere("fObjectKEY", $_GET),
80 "fStatusName" => CheckWhere("fStatusKEY", $_GET),
81 );
82
83$checkgroup = array
84 (
85 "fRunTypeName" => CheckGroup("fRunTypeKEY", $_GET),
86 "fProjectName" => CheckGroup("fProjectKEY", $_GET),
87 "fSourceName" => CheckGroup("fSourceKEY", $_GET),
88 "fMagicNumberName" => CheckGroup("fMagicNumberKEY", $_GET),
89 "fL1TriggerTableName" => CheckGroup("fL1TriggerTableKEY", $_GET),
90 "fL2TriggerTableName" => CheckGroup("fL2TriggerTableKEY", $_GET),
91 "fHvSettingsName" => CheckGroup("fHvSettingsKEY", $_GET),
92 "fCalibrationScriptName" => CheckGroup("fCalibrationScriptKEY", $_GET),
93 "fExcludedFDAName" => CheckGroup("fExcludedFDAKEY", $_GET),
94 "fManuallyChangedName" => CheckGroup("fManuallyChangedKEY", $_GET),
95 "fObservationModeName" => CheckGroup("fObservationModeKEY", $_GET),
96 "fDiscriminatorThresholdTableName" => CheckGroup("fDiscriminatorThresholdTableKEY", $_GET),
97 "fTriggerDelayTableName" => CheckGroup("fTriggerDelayTableKEY", $_GET),
98 "fTestFlagName" => CheckGroup("fTestFlagKEY", $_GET),
99 "fLightConditionsName" => CheckGroup("fLightConditionsKEY", $_GET),
100 "fParticleTypeName" => CheckGroup("fParticleTypeKEY", $_GET),
101 "fFitsFileName" => CheckGroup("fFitsFileKEY", $_GET),
102 "fObjectName" => CheckGroup("fObjectKEY", $_GET),
103 "fStatusName" => CheckGroup("fStatusKEY", $_GET),
104 );
105
106
107$checkstatusgroup = array
108 (
109 "fCCFilled" => CheckStatusGroup("fCCFilledStatus", $_GET),
110 "fExclusionsDone" => CheckStatusGroup("fExclusionsDoneStatus", $_GET),
111 "fSequenceEntriesBuilt" => CheckStatusGroup("fSequenceEntriesBuiltStatus",$_GET),
112 "fCCFileAvail" => CheckStatusGroup("fCCFileAvailStatus", $_GET),
113 "fCaCoFileAvail" => CheckStatusGroup("fCaCoFileAvailStatus", $_GET),
114 "fCaCoFileFound" => CheckStatusGroup("fCaCoFileFoundStatus", $_GET),
115 "fRawFileAvail" => CheckStatusGroup("fRawFileAvailStatus", $_GET),
116 "fTimingCorrection" => CheckStatusGroup("fTimingCorrectionStatus", $_GET),
117 "fDataCheckDone" => CheckStatusGroup("fDataCheckDoneStatus", $_GET),
118// "fFillDotRaw" => CheckStatusGroup("fFillDotRawStatus", $_GET),
119 "fSequenceFileWritten" => CheckStatusGroup("fSequenceFileWrittenStatus", $_GET),
120 "fAllFilesAvail" => CheckStatusGroup("fAllFilesAvailStatus", $_GET),
121 "fCallisto" => CheckStatusGroup("fCallistoStatus", $_GET),
122 "fFillCallisto" => CheckStatusGroup("fFillCallistoStatus", $_GET),
123 "fStar" => CheckStatusGroup("fStarStatus", $_GET),
124 "fFillStar" => CheckStatusGroup("fFillStarStatus", $_GET),
125 "fDataSetInserted" => CheckStatusGroup("fDataSetInsertedStatus", $_GET),
126 "fStarFilesAvail" => CheckStatusGroup("fStarFilesAvailStatus", $_GET),
127 "fGanymed" => CheckStatusGroup("fGanymedStatus", $_GET),
128 "fFillGanymed" => CheckStatusGroup("fFillGanymedStatus", $_GET),
129 );
130
131
132$checkenumgroup = array
133 (
134 "fHasSignal" => CheckEnumGroup("fHasSignalEnum", $_GET),
135 "fHasPedestal" => CheckEnumGroup("fHasPedestalEnum", $_GET),
136 "fHasSignalInterlaced" => CheckEnumGroup("fHasSignalInterlacedEnum", $_GET),
137 "fHasPedestalInterlaced" => CheckEnumGroup("fHasPedestalInterlacedEnum", $_GET),
138 );
139
140
141
142$alias = array
143 (
144 "fRawFileKEY" => "Idx",
145 "fMagicNumberName" => "Magic#",
146 "fFormatVersion" => "F-Ver",
147 "fLastUpdate" => "LastUpd",
148 "fRunNumber" => "Run#",
149 "fRunTypeName" => "RunType",
150 "fMeanTriggerRate" => "Rate<br>[Hz]",
151 "fDaqTriggerRate" => "Daq<br>TRate<br>[Hz]",
152 "fDaqStoreRate" => "Daq<br>SRate<br>[Hz]",
153 "fL2RatePresc" => "L2<br>pRate<br>[Hz]",
154 "fL2RateUnpresc" => "L2<br>upRate<br>[Hz]",
155 "fManuallyChangedName" => "Manually<br>Changed",
156 "fObservationModeName" => "Obs.<br>Mode",
157 "fLastUpdate" => "LastUpd",
158 "fSequenceFirst" => "Sequ",
159 "fProjectName" => "Project",
160 "fSourceName" => "Source",
161 "fNumEvents" => "#Evts",
162 "fRunTime/60" => "Up<br>Time<br>[min]",
163 "fRunStart" => "Start",
164 "fRunStop" => "Stop",
165// "fRunStart" => "StartTime",
166 "fSequenceLast" => "Last<br>Run",
167 "fL1TriggerTableName" => "L1Trig<br>Table",
168 "fL2TriggerTableName" => "L2Trig<br>Table",
169 "fHvSettingsName" => "HV Settings",
170 "fCalibrationScriptName" => "Cal Script",
171 "fTestFlagName" => "Testflag",
172 "fLightConditionsName" => "Lightcond",
173 "fTriggerDelayTableName" => "TrigDelay",
174 "fDiscriminatorThresholdTableName" => "DT",
175 "fExcludedFDAName" => "Exclusion",
176 "fZenithDistance" => "Zd",
177 "fAzimuth" => "Az",
178 "fZenithDistanceMin" => "Zd<br>Min",
179 "fZenithDistanceMax" => "Zd<br>Max",
180 "fAzimuthMin" => "Az<br>Min",
181 "fAzimuthMax" => "Az<br>Max",
182 "fTest" => "Test",
183 "fSourceKEY" => "KEY",
184 "fDate" => "Date",
185 "fCCFilled" => "CCFilled",
186 "fExclusionsDone" => "Exclusions",
187 "fSequenceEntriesBuilt" => "Sequences",
188 "fCCFileAvail" => "CCFile",
189 "fCaCoFileAvail" => "CaCoFile",
190 "fCaCoFileFound" => "CaCoRun",
191 "fRawFileAvail" => "RawFile",
192 "fTimingCorrection" => "TimingCorr",
193 "fDataCheckDone" => "Datacheck",
194// "fFillDotRaw" => "Filldotraw",
195 "fSequenceFileWritten" => "SequFile",
196 "fAllFilesAvail" => "FilesAvail",
197 "fCallisto" => "Callisto",
198 "fStar" => "Star",
199 "fFillCallisto" => "FillCal",
200 "fFillStar" => "FillStar",
201 "fDataSetInserted" => "DataSet",
202 "fStarFilesAvail" => "FilesAvail",
203 "fGanymed" => "Ganymed",
204 "fFillGanymed" => "FillGanymed",
205 "fUnsuitableOuter" => "Un<br>suit.<br>Out",
206 "fUnreliableOuter" => "Un<br>rel.<br>Out",
207 "fUnreliableInner" => "Un<br>rel.<br>In",
208 "fUnsuitableInner" => "Un<br>suit.<br>In",
209 "fIsolatedOuter" => "Isol.<br>Out",
210 "fIsolatedInner" => "Isol.<br>In",
211 "fMeanPedRmsOuter" => "Ped<br>Rms<br>Out",
212 "fMeanPedRmsInner" => "Ped<br>Rms<br>In",
213 "fArrTimeMeanInner" => "Arr<br>Time<br>In",
214 "fArrTimeMeanOuter" => "Arr<br>Time<br>Out",
215 "fArrTimeRmsInner" => "Rms<br>ArrT<br>In",
216 "fArrTimeRmsOuter" => "Rms<br>ArrT<br>Out",
217 "fMeanSignalInner" => "Sign<br>In",
218 "fMeanSignalOuter" => "Sign<br>Out",
219 "fPulsePosMean" => "Puls<br>Pos",
220 "fConvFactorInner" => "Conv<br>In",
221 "fConvFactorOuter" => "Conv<br>Out",
222 // "fConvFactorInner" => "Conv Inner<BR>[ph/FADC]",
223 // "fConvFactorOuter" => "Conv Outer<BR>[ph/FADC]",
224 "fIsolatedMaxCluster" => "Isol.<br>Max<br>Cl",
225 "fMeanNumberIslands" => "Mean<br>Num<br>Isl",
226 "fPSF" => "PSF<br>[mm]",
227 "fRatio" => "Ratio<br>[%]",
228 "fMuonNumber" => "#<br>Muons",
229 "fEffOnTime" => "EffOn<br>Time<br>[s]",
230 "fEffOnTime/fRunTime" => "RelOn<br>Time",
231 "fEffOnTime/3600" => "EffOn<br>Time<br>[h]",
232 "fMuonRate" => "Muon<br>Rate<br>[Hz]",
233 "fInhomogeneity" => "Inhom",
234 "fDataRate" => "Img.<br>Rate<br>[Hz]",
235 "fMaxHumidity" => "Max<br>Hum<br>[%]",
236 "fBrightnessMed" => "Sky<br>Brightness<br>Med",
237 "fBrightnessRMS" => "Sky<br>Brightness<br>RMS",
238 "fNumStarsMed" => "#<br>id.<br>stars",
239 "fNumStarsRMS" => "RMS<br>id.<br>stars",
240 "fNumStarsCorMed" => "#<br>cor.<br>stars",
241 "fNumStarsCorRMS" => "RMS<br>cor.<br>stars",
242 "fEvents" => "DataEvents",
243 "fPositionSignal" => "ArrTime",
244 "fPositionFWHM" => "ArrTimeFWHM",
245 "fHeightSignal" => "Signal",
246 "fHeightFWHM" => "SignalFWHM",
247 "fHasSignal" => "HasSignal",
248 "fHasPedestal" => "HasPedestal",
249 "fPositionAsym" => "ArrTimeAsym",
250 "fHeightAsym" => "SignalAsym",
251 "fEventsInterlaced" => "CalEvents",
252 "fPositionSignalInterlaced" => "ArrTimeCal",
253 "fPositionFWHMInterlaced" => "ArrTimeFWHMCal",
254 "fHeightSignalInterlaced" => "SignalCal",
255 "fHeightFWHMInterlaced" => "SignalFWHMCal",
256 "fHasSignalInterlaced" => "HasSignalCal",
257 "fHasPedestalInterlaced" => "HasPedestalCal",
258 "fPositionAsymInterlaced" => "ArrTimeAsymCal",
259 "fHeightAsymInterlaced" => "SignalAsymCal",
260 "fExcessEvents" => "Exc<br>Evts",
261 "fBackgroundEvents" => "Bg<br>Evts",
262 "fSignalEvents" => "Sign<br>Evts",
263 "fSignificance" => "Sign",
264 "fScaleFactor" => "Scale",
265 "fDataSetNumber" => "Data<br>Set#",
266 "fWobble" => "Wobble",
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 "fPedRmsInLimit" => "PedRms",
282 "fMuonRateLimit" => "MuonRate",
283 "fMuonNumLimit" => "# Muons",
284 "fMuonCalLimit" => "MuonCal",
285 "fPSFLimit" => "PSF",
286 "fInhomLimit" => "Inhom.",
287 "fNumIslLimit" => "# Islands",
288 "fImgRateLimit" => "ImgRate",
289 "fSkyBrightLimit" => "SkyBrightness",
290 "fNumStarsLimit" => "# id. Stars",
291 "fNumStarsCorLimit" => "# cor. Stars",
292 "fUnsInLimit" => "Unsuit.In",
293 "fIsoInLimit" => "Isol.In",
294 "fIMCLimit" => "IMC",
295 "fMaxHumLimit" => "Humidity",
296 "fZdMinLimit" => "ZdMin",
297 "fZdMaxLimit" => "ZdMax",
298 "fRelTimeLimit" => "Rel.Ontime",
299 "fEMin" => "Emin",
300 "fEMax" => "Emax",
301 "fParticleTypeName" => "Particle",
302 "fStartTime" => "Process",
303 "fFailedTime" => "Failed",
304 "fReturnCode" => "Ret<br>Code",
305 "fFailedCode" => "Err<br>Code",
306 "fFailedCodeAdd" => "Code<br>Add",
307 "fTimestamp" => "Time",
308 "fExposure" => "Exposure",
309 "fFitsFileName" => "FitsFile",
310 "fObjectName" => "Object",
311 "fSkyLevel" => "SkyLevel",
312 "fFWHM" => "FWHM",
313 "fApertureRadius" => "Ap.Rad.",
314 "fInstrumentalMag" => "Instr.Mag.",
315 "fInstrumentalMagErr" => "Instr.Mag.Err.",
316 "fStatusName" => "StatusCode",
317// "COUNT(*)" => "# Runs",
318// "COUNT(*)" => "Sequence",
319 );
320
321
322$rightalign = array
323 (
324 $alias["fRawFileKEY"] => "1",
325 $alias["fFormatVersion"] => "1",
326 $alias["fRunNumber"] => "1",
327 $alias["fZenithDistance"] => "1",
328 $alias["fAzimuth"] => "1",
329 $alias["fMeanTriggerRate"] => "1",
330 $alias["fDaqTriggerRate"] => "1",
331 $alias["fDaqStoreRate"] => "1",
332 $alias["fL2RatePresc"] => "1",
333 $alias["fL2RateUnpresc"] => "1",
334 $alias["fSequenceFirst"] => "1",
335 $alias["fNumEvents"] => "1",
336 $alias["fRunTime/60"] => "1",
337 $alias["fSequenceLast"] => "1",
338 $alias["fZenithDistanceMin"] => "1",
339 $alias["fZenithDistanceMax"] => "1",
340 $alias["fAzimuthMin"] => "1",
341 $alias["fAzimuthMax"] => "1",
342 $alias["fUnsuitableOuter"] => "1",
343 $alias["fUnreliableOuter"] => "1",
344 $alias["fUnsuitableInner"] => "1",
345 $alias["fUnreliableInner"] => "1",
346 $alias["fIsolatedOuter"] => "1",
347 $alias["fIsolatedInner"] => "1",
348 $alias["fMeanPedRmsOuter"] => "1",
349 $alias["fMeanPedRmsInner"] => "1",
350 $alias["fArrTimeMeanInner"] => "1",
351 $alias["fArrTimeMeanOuter"] => "1",
352 $alias["fArrTimeRmsInner"] => "1",
353 $alias["fArrTimeRmsOuter"] => "1",
354 $alias["fMeanSignalInner"] => "1",
355 $alias["fMeanSignalOuter"] => "1",
356 $alias["fPulsePosMean"] => "1",
357 $alias["fConvFactorInner"] => "1",
358 $alias["fConvFactorOuter"] => "1",
359 $alias["fIsolatedMaxCluster"] => "1",
360 $alias["fMeanNumberIslands"] => "1",
361 $alias["fPSF"] => "1",
362 $alias["fRatio"] => "1",
363 $alias["fMuonNumber"] => "1",
364 $alias["fEffOnTime"] => "1",
365 $alias["fEffOnTime/fRunTime"] => "1",
366 $alias["fEffOnTime/3600"] => "1",
367 $alias["fMuonRate"] => "1",
368 $alias["fInhomogeneity"] => "1",
369 $alias["fDataRate"] => "1",
370 $alias["fMaxHumidity"] => "1",
371 $alias["fBrightnessMed"] => "1",
372 $alias["fBrightnessRMS"] => "1",
373 $alias["fNumStarsMed"] => "1",
374 $alias["fNumStarsRMS"] => "1",
375 $alias["fNumStarsCorMed"] => "1",
376 $alias["fNumStarsCorRMS"] => "1",
377 $alias["fDate"] => "1",
378 $alias["fCaCoFileFound"] => "1",
379 $alias["fTest"] => "1",
380 $alias["fSourceKEY"] => "1",
381 $alias["fEvents"] => "1",
382 $alias["fPositionSignal"] => "1",
383 $alias["fPositionFWHM"] => "1",
384 $alias["fHeightSignal"] => "1",
385 $alias["fHeightFWHM"] => "1",
386 $alias["fHasSignal"] => "1",
387 $alias["fHasPedestal"] => "1",
388 $alias["fPositionAsym"] => "1",
389 $alias["fHeightAsym"] => "1",
390 $alias["fEventsInterlaced"] => "1",
391 $alias["fPositionSignalInterlaced"] => "1",
392 $alias["fPositionFWHMInterlaced"] => "1",
393 $alias["fHeightSignalInterlaced"] => "1",
394 $alias["fHeightFWHMInterlaced"] => "1",
395 $alias["fHasSignalInterlaced"] => "1",
396 $alias["fHasPedestalInterlaced"] => "1",
397 $alias["fPositionAsymInterlaced"] => "1",
398 $alias["fHeightAsymInterlaced"] => "1",
399 $alias["fReturnCode"] => "1",
400 $alias["fFailedCode"] => "1",
401 $alias["fFailedCodeAdd"] => "1",
402 "Time" => "1",
403// "Time [h]" => "1",
404 "ZDMin" => "1",
405 "ZDMax" => "1",
406// "Evts#" => "1",
407// "Runs#" => "1"
408 "Runs" => "1",
409 "Evts" => "1",
410);
411
412function GetCheck($fromtable, $val)
413{
414 $checks = array
415 (
416 "fRunTypeName" => $fromtable . ".fRunTypeKEY",
417 "fProjectName" => $fromtable . ".fProjectKEY",
418 "fSourceName" => $fromtable . ".fSourceKEY",
419 "fMagicNumberName" => $fromtable . ".fMagicNumberKEY",
420 "fL1TriggerTableName" => $fromtable . ".fL1TriggerTableKEY",
421 "fL2TriggerTableName" => $fromtable . ".fL2TriggerTableKEY",
422 "fHvSettingsName" => $fromtable . ".fHvSettingsKEY",
423 "fCalibrationScriptName" => $fromtable . ".fCalibrationScriptKEY",
424 "fExcludedFDAName" => $fromtable . ".fExcludedFDAKEY",
425 "fManuallyChangedName" => $fromtable . ".fManuallyChangedKEY",
426 "fObservationModeName" => $fromtable . ".fObservationModeKEY",
427 "fDiscriminatorThresholdTableName" => $fromtable . ".fDiscriminatorThresholdTableKEY",
428 "fTriggerDelayTableName" => $fromtable . ".fTriggerDelayTableKEY",
429 "fTestFlagName" => $fromtable . ".fTestFlagKEY",
430 "fLightConditionsName" => $fromtable . ".fLightConditionsKEY",
431 "fParticleTypeName" => $fromtable . ".fParticleTypeKEY",
432 "fFitsFileName" => $fromtable . ".fFitsFileKEY",
433 "fObjectName" => $fromtable . ".fObjectKEY",
434 "fStatusName" => $fromtable . ".fStatusKEY",
435 );
436
437 $check="";
438 if (!empty($checks[$val]))
439 $check=$checks[$val];
440 return $check;
441}
442
443
444function GetTable($fromtable, $val)
445{
446 $tables = array
447 (
448 "fSequenceFirst" => $fromtable . ".fSequenceFirst",
449 "fSequenceLast" => $fromtable . ".fSequenceLast",
450 "fNumEvents" => $fromtable . ".fNumEvents",
451 "fRunStart" => $fromtable . ".fRunStart",
452 "fLastUpdate" => $fromtable . ".fLastUpdate",
453 "fRunTime" => $fromtable . ".fRunTime",
454 "fRunTime/60" => $fromtable . ".fRunTime/60",
455 "fAzimuthMin" => $fromtable . ".fAzimuthMin",
456 "fAzimuthMax" => $fromtable . ".fAzimuthMax",
457 "fZenithDistanceMin" => $fromtable . ".fZenithDistanceMin",
458 "fZenithDistanceMax" => $fromtable . ".fZenithDistanceMax",
459 "fRunNumber" => "RunData.fRunNumber",
460 "fRunStop" => "RunData.fRunStop",
461 "fAzimuth" => "RunData.fAzimuth",
462 "fZenithDistance" => "RunData.fZenithDistance",
463 "fFormatVersion" => "RunData.fFormatVersion",
464 "fRunTypeName" => "RunType.fRunTypeName",
465 "fDaqStoreRate" => "RunData.fDaqStoreRate",
466 "fDaqTriggerRate" => "RunData.fDaqTriggerRate",
467 "fMeanTriggerRate" => "RunData.fMeanTriggerRate",
468 "fL2RatePresc" => "RunData.fL2RatePresc",
469 "fL2RateUnpresc" => "RunData.fL2RateUnpresc",
470 "fMagicNumberName" => "MagicNumber.fMagicNumberName",
471 "fExcludedFDAName" => "ExcludedFDA.fExcludedFDAName",
472 "fProjectName" => "Project.fProjectName",
473 "fSourceName" => "Source.fSourceName",
474 "fL1TriggerTableName" => "L1TriggerTable.fL1TriggerTableName",
475 "fL2TriggerTableName" => "L2TriggerTable.fL2TriggerTableName",
476 "fHvSettingsName" => "HvSettings.fHvSettingsName",
477 "fManuallyChangedName" => "ManuallyChanged.fManuallyChangedName",
478 "fObservationModeName" => "ObservationMode.fObservationModeName",
479 "fTriggerDelayTableName" => "TriggerDelayTable.fTriggerDelayTableName",
480 "fDiscriminatorThresholdTableName" => "DiscriminatorThresholdTable.fDiscriminatorThesholdTableName",
481 "fCalibrationScriptName" => "CalibrationScript.fCalibrationScriptName",
482 "fTestFlagName" => "TestFlag.fTestFlagName",
483 "fLightConditionsName" => "LightConditions.fLightConditionsName",
484 "fRawFileAvail" => "RunProcessStatus.fRawFileAvail",
485 "fCCFileAvail" => "RunProcessStatus.fCCFileAvail",
486 "fCaCoFileAvail" => "RunProcessStatus.fCaCoFileAvail",
487 "fCaCoFileFound" => "RunProcessStatus.fCaCoFileFound",
488 "fTimingCorrection" => "RunProcessStatus.fTimingCorrection",
489// "fFillDotRaw" => "RunProcessStatus.fFillDotRaw",
490 "fSequenceFileWritten" => "SequenceProcessStatus.fSequenceFileWritten",
491 "fAllFilesAvail" => "SequenceProcessStatus.fAllFilesAvail",
492 "fCallisto" => "SequenceProcessStatus.fCallisto",
493 "fFillCallisto" => "SequenceProcessStatus.fFillCallisto",
494 "fStar" => "SequenceProcessStatus.fStar",
495 "fFillStar" => "SequenceProcessStatus.fFillStar",
496 "fUnsuitableInner" => "Calibration.fUnsuitableInner",
497 "fUnsuitableOuter" => "Calibration.fUnsuitableOuter",
498 "fUnreliableInner" => "Calibration.fUnreliableInner",
499 "fUnreliableOuter" => "Calibration.fUnreliableOuter",
500 "fIsolatedInner" => "Calibration.fIsolatedInner",
501 "fIsolatedOuter" => "Calibration.fIsolatedOuter",
502 "fIsolatedMaxCluster" => "Calibration.fIsolatedMaxCluster",
503 "fLastUpdate" => "Calibration.fLastUpdate",
504 "fMeanPedRmsInner" => "Calibration.fMeanPedRmsInner",
505 "fMeanPedRmsOuter" => "Calibration.fMeanPedRmsOuter",
506 "fArrTimeMeanInner" => "Calibration.fArrTimeMeanInner",
507 "fArrTimeMeanOuter" => "Calibration.fArrTimeMeanOuter",
508 "fArrTimeRmsInner" => "Calibration.fArrTimeRmsInner",
509 "fArrTimeRmsOuter" => "Calibration.fArrTimeRmsOuter",
510 "fMeanSignalInner" => "Calibration.fMeanSignalInner",
511 "fMeanSignalOuter" => "Calibration.fMeanSignalOuter",
512 "fPulsePosMean" => "Calibration.fPulsePosMean",
513 "fConvFactorInner" => "Calibration.fConvFactorInner",
514 "fConvFactorOuter" => "Calibration.fConvFactorOuter",
515 "fMeanNumberIslands" => "Star.fMeanNumberIslands",
516 "fPSF" => "Star.fPSF",
517 "fRatio" => "Star.fRatio",
518 "fMuonNumber" => "Star.fMuonNumber",
519 "fEffOnTime" => "fEffOnTime",
520 "fEffOnTime/fRunTime" => "Sequences.fRunTime/Star.fEffOnTime",
521 "fEffOnTime/3600" => "fEffOnTime/3600",
522// "fEffOnTime" => $fromtable . ".fEffOnTime",
523 "fMuonRate" => "Star.fMuonRate",
524 "fInhomogeneity" => "Star.fInhomogeneity",
525 "fDataRate" => "Star.fDataRate",
526 "fMaxHumidity" => "Star.fMaxHumidity",
527 "fBrightnessMed" => "Star.fBrightnessMed",
528 "fBrightnessRMS" => "Star.fBrightnessRMS",
529 "fNumStarsMed" => "Star.fNumStarsMed",
530 "fNumStarsRMS" => "Star.fNumStarsRMS",
531 "fNumStarsCorMed" => "Star.fNumStarsCorMed",
532 "fNumStarsCorRMS" => "Star.fNumStarsCorRMS",
533 "fDataSetNumber" => $fromtable . ".fDataSetNumber",
534 "fDataSetInserted" => "DataSetProcessStatus.fDataSetInserted",
535 "fStarFilesAvail" => "DataSetProcessStatus.fStarFilesAvail",
536 "fGanymed" => "DataSetProcessStatus.fGanymed",
537 "fFillGanymed" => "DataSetProcessStatus.fFillGanymed",
538 "fWobble" => "DataSets.fWobble",
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.