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

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