CbmRoot
CbmTofDigiPar.cxx
Go to the documentation of this file.
1 #include "CbmTofDigiPar.h"
2 
3 #include "CbmTofCell.h" // for CbmTofCell
4 
5 #include <FairLogger.h> // for LOG, Logger
6 #include <FairParGenericSet.h> // for FairParGenericSet
7 #include <FairParamList.h> // for FairParamList
8 
9 #include <TArrayD.h> // for TArrayD
10 #include <TArrayI.h> // for TArrayI
11 #include <TString.h> // for TString
12 
13 #include <utility> // for pair
14 
16 
17  CbmTofDigiPar::CbmTofDigiPar(const char* name,
18  const char* title,
19  const char* context)
20  : FairParGenericSet(name, title, context)
21  , fCellMap()
22  , fCellIdArray()
23  , fCellXArray()
24  , fCellYArray()
25  , fCellZArray()
26  , fCellDxArray()
27  , fCellDyArray()
28  , fNrOfCells(-1) {
29  detName = "Tof";
30 }
31 
33  LOG(debug4) << "Enter CbmTofDigiPar destructor";
34  std::map<Int_t, CbmTofCell*>::iterator fCellMapIt;
35  for (fCellMapIt = fCellMap.begin(); fCellMapIt != fCellMap.end();
36  ++fCellMapIt) {
37  delete fCellMapIt->second;
38  }
39  fCellMap.clear();
40  clear();
41  LOG(debug4) << "Leave CbmTofDigiPar destructor";
42 }
43 
45  status = kFALSE;
46  resetInputVersions();
47 }
48 
49 void CbmTofDigiPar::putParams(FairParamList* l) {
50  if (!l) { return; }
51 
52  l->add("NrOfCells", fNrOfCells);
53  l->add("CellIdArray", fCellIdArray);
54  l->add("CellXArray", fCellXArray);
55  l->add("CellYArray", fCellYArray);
56  l->add("CellZArray", fCellZArray);
57  l->add("CellDxArray", fCellDxArray);
58  l->add("CellDyArray", fCellDyArray);
59 }
60 
61 Bool_t CbmTofDigiPar::getParams(FairParamList* l) {
62  if (!l) { return kFALSE; }
63 
64  LOG(debug2) << "Get the tof digitization parameters.";
65 
66  if (!l->fill("NrOfCells", &fNrOfCells)) return kFALSE;
67 
68  LOG(debug2) << "There are " << fNrOfCells << " cells to be read.";
69 
71  if (!l->fill("CellIdArray", &fCellIdArray)) return kFALSE;
72 
74  if (!l->fill("CellXArray", &fCellXArray)) return kFALSE;
75 
77  if (!l->fill("CellYArray", &fCellYArray)) return kFALSE;
78 
80  if (!l->fill("CellZArray", &fCellZArray)) return kFALSE;
81 
83  if (!l->fill("CellDxArray", &fCellDxArray)) return kFALSE;
84 
86  if (!l->fill("CellDyArray", &fCellDyArray)) return kFALSE;
87 
88 
89  for (Int_t i = 0; i < fNrOfCells; i++) {
91  fCellXArray[i],
92  fCellYArray[i],
93  fCellZArray[i],
94  fCellDxArray[i],
95  fCellDyArray[i]);
96  }
97  return kTRUE;
98 }
CbmTofDigiPar::fCellIdArray
TArrayI fCellIdArray
Definition: CbmTofDigiPar.h:60
CbmTofDigiPar::fCellXArray
TArrayD fCellXArray
Definition: CbmTofDigiPar.h:61
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmTofDigiPar::fCellYArray
TArrayD fCellYArray
Definition: CbmTofDigiPar.h:62
CbmTofDigiPar.h
CbmTofDigiPar::~CbmTofDigiPar
~CbmTofDigiPar(void)
Definition: CbmTofDigiPar.cxx:32
CbmTofDigiPar::putParams
void putParams(FairParamList *)
Definition: CbmTofDigiPar.cxx:49
CbmTofDigiPar::fCellDxArray
TArrayD fCellDxArray
Definition: CbmTofDigiPar.h:64
CbmTofDigiPar::CbmTofDigiPar
CbmTofDigiPar(const char *name="CbmTofDigiPar", const char *title="Digitization parameters for the TOF detector", const char *context="TestDefaultContext")
CbmTofDigiPar::fCellZArray
TArrayD fCellZArray
Definition: CbmTofDigiPar.h:63
CbmTofDigiPar::getParams
Bool_t getParams(FairParamList *)
Definition: CbmTofDigiPar.cxx:61
CbmTofCell
Definition: CbmTofCell.h:8
CbmTofDigiPar::fCellDyArray
TArrayD fCellDyArray
Definition: CbmTofDigiPar.h:65
CbmTofDigiPar::fCellMap
std::map< Int_t, CbmTofCell * > fCellMap
Definition: CbmTofDigiPar.h:58
CbmTofCell.h
ClassImp
ClassImp(CbmTofDigiPar) CbmTofDigiPar
Definition: CbmTofDigiPar.cxx:15
CbmTofDigiPar
Definition: CbmTofDigiPar.h:18
CbmTofDigiPar::clear
void clear(void)
Definition: CbmTofDigiPar.cxx:44
CbmTofDigiPar::fNrOfCells
Int_t fNrOfCells
Definition: CbmTofDigiPar.h:66