KaliVeda
Toolkit for HIC analysis
KVFAZIAUpDater.cpp
1 //Created by KVClassFactory on Mon Sep 14 10:58:04 2015
2 //Author: ,,,
3 
4 #include "KVFAZIAUpDater.h"
5 #include "KVFAZIADB.h"
6 #include "KVDBParameterList.h"
7 #include "KVDBParameterSet.h"
8 #include "KVFAZIA.h"
9 #include "KVSignal.h"
10 #include "KVFAZIADetector.h"
11 #include "KVCalibrator.h"
12 
14 
15 // BEGIN_HTML <!--
17 /* -->
18 <h2>KVFAZIAUpDater</h2>
19 <h4>handle FAZIA detectors configuration for a given run</h4>
20 <!-- */
21 // --> END_HTML
23 
24 
25 
29 {
30  // Default constructor
31 }
32 
33 
34 
37 
39 {
40  // Destructor
41 }
42 
43 
44 
46 
48 {
50 
51  SetPSAParameters(dbrun);
52 }
53 
54 
55 
59 
61 {
62  //Put all signals in standard configuration
63  //PSA parameters, threshold ...
64  TIter ld(fArray->GetDetectors());
65  KVFAZIADetector* det = 0;
66  KVSignal* sig = 0;
67 
68  while ((det = (KVFAZIADetector*)ld())) {
69  TIter ls(det->GetListOfSignals());
70  while ((sig = (KVSignal*)ls())) {
71  sig->LoadPSAParameters();
72  }
73  }
74 
75  //Loop on exceptions stores in the database
76  //and update parameters for each concerned signal
77  KVDBParameterList* par = 0;
78  TList* list = (TList*)dbrun->GetLinks("Exceptions");
79  TIter next(list);
80  while ((par = (KVDBParameterList*)next())) {
81  TString sdet(par->GetParameters()->GetStringValue("Detector"));
82  TString ssig(par->GetParameters()->GetStringValue("Signal"));
83  if (!fArray) {
84  Error("SetPSAParameters", "fArray object not defined");
85  return;
86  }
87  det = (KVFAZIADetector*)fArray->GetDetector(sdet.Data());
88  if (det) {
89  sig = det->GetSignal(ssig.Data());
90  if (sig) {
91  sig->UpdatePSAParameter(par);
92  }
93  else {
94  Warning("SetPSAParameters", "Unkonwn signal %s", ssig.Data());
95  }
96  }
97  else {
98  Warning("SetPSAParameters", "Unkonwn detector %s", sdet.Data());
99  }
100  }
101 }
102 
103 
105 
107 {
108  Obsolete("SetCalibrations", "1.11", "1.12");
109 }
110 
111 
112 // if use of KVMultiDetArray::CheckStatusOfDetectors does not work for FAZIA, it should be made
113 // virtual & then this method should be implemented as a method of KVFAZIA
114 //
115 //void KVFAZIAUpDater::CheckStatusOfDetectors(KVDBRun* kvrun)
116 //{
117 
118 // KVRList* ooodet = kvrun->GetLinks("OoO Detectors");
119 
120 // TIter next(fArray->GetDetectors());
121 // KVDetector* det;
122 
123 // Int_t ndet_ooo = 0;
124 
125 // while ((det = (KVDetector*)next())) {
126 // //Test de la presence ou non du detecteur
127 // det->SetPresent();
128 // if (det->IsPresent()) {
129 // //Test du bon fonctionnement ou non du detecteur
130 // if (!ooodet) {
131 // det->SetDetecting();
132 // }
133 // else {
134 // if (ooodet->FindObject(det->GetName(), "OoO Detector")) {
135 // det->SetDetecting(kFALSE);
136 // ndet_ooo += 1;
137 // }
138 // else {
139 // det->SetDetecting();
140 // }
141 // }
142 // }
143 // }
144 
145 // Info("CheckStatusOfDetectors", "%d detectors do not work", ndet_ooo);
146 
147 //}
148 
void Obsolete(const char *function, const char *asOfVers, const char *removedFromVers)
To store calibration parameters in a database ,.
KVNameValueList * GetParameters()
virtual KVRList * GetLinks(const Char_t *key) const
Returns the list of records linked to this record in table "key".
Definition: KVDBRecord.cpp:206
Description of an experimental run in database ,,.
Definition: KVDBRun.h:36
Base class for FAZIA detectors.
KVSignal * GetSignal(const Char_t *name) const
const KVSeqCollection * GetListOfSignals() const
Handle run-dependent configuration settings for FAZIA experiment.
virtual ~KVFAZIAUpDater()
Destructor.
void SetPSAParameters(KVDBRun *)
void SetCalibrations(KVDBRun *)
virtual void SetCalibParameters(KVDBRun *)
KVDetector * GetDetector(const Char_t *name) const
Return detector in this structure with given name.
const KVSeqCollection * GetDetectors() const
const Char_t * GetStringValue(const Char_t *name) const
virtual void UpdatePSAParameter(KVDBParameterList *par)
Definition: KVSignal.cpp:359
virtual void LoadPSAParameters()
Definition: KVSignal.cpp:387
KVMultiDetArray * fArray
associated array
Definition: KVUpDater.h:29
virtual void SetCalibParameters(KVDBRun *)
Override in child classes to set specific calibrations.
Definition: KVUpDater.cpp:217
const char * Data() const
void Error(const char *location, const char *fmt,...)
void Warning(const char *location, const char *fmt,...)
ClassImp(TPyArg)