FairRoot/PandaRoot
PndTutPar.cxx
Go to the documentation of this file.
1 #include <iostream>
2 #include "PndTutPar.h"
3 #include "TMath.h"
4 
5 PndTutPar::PndTutPar(const char* name, const char* title, const char* context)
6  : FairParGenericSet(name,title,context)
7 {
8  clear();
9 }
10 
11 void PndTutPar::putParams(FairParamList* list)
12 {
13  std::cout<<"-I- PndTutPar::putParams() called"<<std::endl;
14  if(!list) return;
15  list->add("top_pitch", fTopPitch);
16  list->add("top_anchor_x", (Double_t)fTopAnchor.X());
17  list->add("top_anchor_y", (Double_t)fTopAnchor.Y());
18  list->add("top_anchor_z", (Double_t)fTopAnchor.Z());
19  list->add("nr_fe_top", fTopNrFE);
20  list->add("fe_Type", fFeType);
21 }
22 
23 Bool_t PndTutPar::getParams(FairParamList* list)
24 {
25  std::cout<<"-I- PndTutPar::getParams() called"<<std::endl;
26  if (!list) return kFALSE;
27  std::cout<<"-I- PndTutPar::getParams() 1 ";
28 
29  if (!list->fill("top_pitch", &fTopPitch)) return kFALSE;
30  std::cout<<"2 ";
31  Double_t x,y,z;
32  if (!list->fill("top_anchor_x", &x)) return kFALSE;
33  if (!list->fill("top_anchor_y", &y)) return kFALSE;
34  if (!list->fill("top_anchor_z", &z)) return kFALSE;
35  fTopAnchor.SetXYZ(x,y,z);
36  std::cout<<"3 ";
37  if (!list->fill("nr_fe_top", &fTopNrFE)) return kFALSE;
38  Text_t feName[80];
39  std::cout<<"4 "<<std::endl;
40  if (!list->fill("fe_Type",feName,80)) return kFALSE;
41  fFeType = feName;
42  return kTRUE;
43 }
44 
46 
48 {
49  std::cout<<"Tutorial Parameters:"<<std::endl;
50  std::cout<<" Top Pitch = "<<fTopPitch<<std::endl;
51  std::cout<<" Top Anchor = ("<<fTopAnchor.X()<<","<<fTopAnchor.Y()<<","<<fTopAnchor.Z()<<")"<<std::endl;
52  std::cout<<" Nr of Frontends (Top Side) = "<<fTopNrFE<<std::endl;
53  std::cout<<" Frontend type name is = "<<fFeType.Data()<<std::endl;
54 }
ClassImp(PndTutPar)
TString fFeType
Definition: PndTutPar.h:41
void putParams(FairParamList *list)
Definition: PndTutPar.cxx:11
Bool_t getParams(FairParamList *list)
Definition: PndTutPar.cxx:23
Int_t fTopNrFE
Definition: PndTutPar.h:40
void clear(void)
Definition: PndTutPar.h:20
TVector3 fTopAnchor
Definition: PndTutPar.h:39
Double_t
Double_t z
TString name
Double_t x
Double_t fTopPitch
Definition: PndTutPar.h:38
PndTutPar(const char *name="PndTutParTest", const char *title="Tutorial parameter", const char *context="TestDefaultContext")
Definition: PndTutPar.cxx:5
Double_t y
void Print()
Definition: PndTutPar.cxx:47