1 #include "ERNeuRadDigiPar.h" 3 #include "FairParamList.h" 4 #include "FairDetParIo.h" 6 #include "FairGenericParAsciiFileIo.h" 7 #include "FairGenericParRootFileIo.h" 8 #include "FairParAsciiFileIo.h" 9 #include "FairParRootFileIo.h" 20 : FairParGenericSet(name, title, context),
23 fUseCrosstalks(kFALSE),
25 fPixelQuantumEfficiency(NULL),
28 fPixelCrosstalks(NULL),
29 fFiberCrosstalks(NULL)
31 std::cout <<
"ERNeuRadDigiPar" << std::endl;
50 fRowNofFibers = (Int_t)TMath::Sqrt(fNofPixels);
52 std::cout <<
"*****************************************" << std::endl;
53 std::cout <<
" ERNeuRadDigiPar " << std::endl;
54 std::cout <<
"*****************************************" << std::endl;
55 std::cout <<
" ERNeuRadNofModules: " << fNofModules << std::endl;
56 std::cout <<
" ERNeuRadNofPixels: " << fNofPixels << std::endl;
57 std::cout <<
" ERNeuRadPixelQuantumEfficiency: " << std::endl;
58 for (Int_t iFiber = 0; iFiber < fRowNofFibers; iFiber++){
60 for (Int_t jFiber = 0; jFiber < fRowNofFibers; jFiber++)
61 std::cout <<(*fPixelQuantumEfficiency)[iFiber*fRowNofFibers + jFiber] <<
"\t";
62 std::cout << std::endl;
64 std::cout <<
"*****************************************" << std::endl;
66 std::cout <<
" ERNeuRadPixelGain: " << std::endl;
67 for (Int_t iFiber = 0; iFiber < fRowNofFibers; iFiber++){
69 for (Int_t jFiber = 0; jFiber < fRowNofFibers; jFiber++)
70 std::cout <<(*fPixelGain)[iFiber*fRowNofFibers + jFiber] <<
"\t";
71 std::cout << std::endl;
73 std::cout <<
"*****************************************" << std::endl;
75 std::cout <<
" ERNeuRadPixelSigma: " << std::endl;
76 for (Int_t iFiber = 0; iFiber < fRowNofFibers; iFiber++){
78 for (Int_t jFiber = 0; jFiber < fRowNofFibers; jFiber++)
79 std::cout <<(*fPixelSigma)[iFiber*fRowNofFibers + jFiber] <<
"\t";
80 std::cout << std::endl;
83 std::cout <<
"*****************************************" << std::endl;
87 void ERNeuRadDigiPar::putParams(FairParamList* l)
92 Bool_t ERNeuRadDigiPar::getParams(FairParamList* l)
94 std::cout <<
"ERNeuRadDigiPar Filling ..." << std::endl;
97 fNofPixels = setup->RowNofPixels()*setup->RowNofPixels();
98 fNofModules = setup->RowNofModules()*setup->RowNofModules();
100 std::cout <<
"fNofPixels " << fNofPixels << std::endl;
102 fPixelQuantumEfficiency =
new TArrayF(fNofPixels);
103 fPixelGain =
new TArrayF(fNofPixels);
104 fPixelSigma =
new TArrayF(fNofPixels),
105 fPixelCrosstalks =
new TArrayF(fNofPixels*9);
106 fFiberCrosstalks =
new TArrayF(fNofPixels*9);
108 if (!l) {
return kFALSE; }
109 if ( ! l->fill(
"ERNeuRadPixelQuantumEfficiency", fPixelQuantumEfficiency) ) {
return kFALSE; }
110 if ( ! l->fill(
"ERNeuRadPixelGain", fPixelGain) ) {
return kFALSE; }
111 if ( ! l->fill(
"ERNeuRadPixelSigma", fPixelSigma) ) {
return kFALSE; }
112 if ( ! l->fill(
"ERNeuRadPixelCrosstalks", fPixelCrosstalks) ) {
113 std::cerr <<
"ERNeuRadDigiPar: can`t find ERNeuRadPixelCrosstalks" << std::endl;
115 fUseCrosstalks = kTRUE;
117 if ( ! l->fill(
"ERNeuRadFiberCrosstalks", fFiberCrosstalks) ) {
118 std::cerr <<
"ERNeuRadDigiPar: can`t find ERNeuRadFiberCrosstalks" << std::endl;
120 fUseCrosstalks = kTRUE;
123 fPixelQuantumEfficiency->Set(fNofPixels);
124 fPixelGain->Set(fNofPixels);
125 fPixelSigma->Set(fNofPixels),
126 fPixelCrosstalks->Set(fNofPixels*9);
127 fFiberCrosstalks->Set(fNofPixels*9);
128 std::cout <<
"fPixelQuantumEfficiency " << fPixelQuantumEfficiency->GetSize() << std::endl;
134 std::cout << input->getFilename() << std::endl;
135 if ( TString(input->getFilename()).Contains(
".digi")){
136 FairGenericParAsciiFileIo* p=
new FairGenericParAsciiFileIo(((FairParAsciiFileIo*)input)->getFile());
137 return p->init(
this);
139 if ( TString(input->getFilename()).Contains(
".root")){
140 FairGenericParRootFileIo* p=
new FairGenericParRootFileIo(((FairParRootFileIo*)input)->getParRootFile());
141 return p->init(
this);
147 void ERNeuRadDigiPar::Crosstalks(Int_t iPixel, TArrayF& crosstalks)
const {
152 Int_t shift = iPixel*9;
153 for (Int_t i = 0; i < 9; i++){
154 crosstalks[i] = (*fPixelCrosstalks)[shift + i]+(*fFiberCrosstalks)[shift + i];
virtual ~ERNeuRadDigiPar()
virtual Bool_t init(FairParIo *input)
ERNeuRadDigiPar(const char *name="ERNeuRadDigiPar", const char *title="ERNeuRad Digitization Parameters", const char *context="Default")