KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVFAZIAUpDater.cpp
Go to the documentation of this file.
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 
114 
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 
149 
int Int_t
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
const Bool_t kFALSE
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:35
Base class for detector geometry description, interface to energy-loss calculations.
Definition: KVDetector.h:121
void SetDetecting(Bool_t yes=kTRUE)
Definition: KVDetector.h:623
virtual Bool_t IsPresent() const
Definition: KVDetector.h:609
void SetPresent(Bool_t yes=kTRUE)
Definition: KVDetector.h:614
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 *)
Override in child classes to set specific calibrations.
virtual void CheckStatusOfDetectors(KVDBRun *)
Check status (present, working) of each detector for run.
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
Wrapper for TRefArray adding some functionality.
Definition: KVRList.h:36
virtual KVBase * FindObject(const Char_t *name, const Char_t *type) const
Definition: KVRList.cpp:106
virtual void UpdatePSAParameter(KVDBParameterList *par)
Definition: KVSignal.cpp:359
virtual void LoadPSAParameters()
Definition: KVSignal.cpp:387
KVMultiDetArray * fArray
associated array
Definition: KVUpDater.h:28
virtual void SetCalibParameters(KVDBRun *)
Override in child classes to set specific calibrations.
Definition: KVUpDater.cpp:230
virtual const char * GetName() const
const char * Data() const
void Info(const char *location, const char *va_(fmt),...)
void Error(const char *location, const char *va_(fmt),...)
void Warning(const char *location, const char *va_(fmt),...)