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

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