StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
digadc.cxx
1 // //
3 // DIGADC //
4 // //
5 // Class containing the ADC/discri features //
6 // (Nbits, thresholds, etc.) //
7 // //
8 // //
9 // //
10 // //
11 // //
13 #include "digadc.h"
14 #include <TROOT.h> // for gROOT object
15 #include <TMath.h>
16 #include <TMatrixD.h>
17 #include <TCanvas.h>
18 #include <TGraph.h>
19 #include <TAxis.h>
20 #include <TRandom3.h>
21 #include <TFile.h>
22 #include <TTree.h>
23 #include <TBranch.h>
24 #include <TClonesArray.h>
25 using namespace std;
26 
27 //==============================================================================
28 ClassImp(DIGADC)
29 
30 DIGADC::DIGADC()
31 {
32  //
33  // default constructor
34  //
35 
36 }
37 //______________________________________________________________________________
38 //
39 
40 DIGADC::~DIGADC() { //
41  // virtual destructor
42  //
43  // delete fLayers;
44 }
45 //______________________________________________________________________________
46 //
47 void DIGADC::SetNbits(Int_t Nbits){
48  fNbits = Nbits;
49 }
50 //______________________________________________________________________________
51 //
52 void DIGADC::SetNThresholds(Int_t NThresholds){
53  fNThresholds = NThresholds;
54 }
55 //______________________________________________________________________________
56 //
57 void DIGADC::SetADC_linear(Bool_t ADC_linear){
58  fADC_linear = ADC_linear;
59 }
60 //______________________________________________________________________________
61 //
62 void DIGADC::SetLSB(Float_t LSB){
63  fLSB = LSB;
64 }
65 //______________________________________________________________________________
66 //
67 void DIGADC::SetElectron_Conversion(Float_t Electron_Conversion){
68  fElectron_Conversion = Electron_Conversion;
69 }
70 //______________________________________________________________________________
71 //
72 void DIGADC::SetADC_thresholds(Float_t ADC_thresholds[], Int_t NThresholds){
73  for (Int_t i = 0; i <NThresholds ; i++){
74  fADC_thresholds[i] = ADC_thresholds[i];
75  }
76 }
77 //______________________________________________________________________________
78 //
79 void DIGADC::PrintInfo(){
80  std::cout<<"-------- ADC INFOS "<<endl;
81  std::cout<<"fNbits fNThresholds fADC_linear fLSB fElectron_Conversion"<<endl;
82  std::cout<<fNbits<<" "<< fNThresholds<< " "<< fADC_linear<<" "<< fLSB<<" "<< fElectron_Conversion<<endl;
83  Int_t Nthtoprint = fNThresholds;
84  if(Nthtoprint < 33){
85  for (Int_t i = 0; i <Nthtoprint; i++){
86  std::cout<<i<<" "<<fADC_thresholds[i] <<endl;
87  }
88  }else{
89  Nthtoprint = 32;
90  for (Int_t i = 0; i <Nthtoprint; i++){
91  std::cout<<i<<" "<<fADC_thresholds[i] <<endl;
92  }
93  std::cout<<" etc. "<<endl;
94  }
95 }
96 //______________________________________________________________________________
97 //
98 
99 //==============================================================================
Definition: digadc.h:36