CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TEcnaResultType.cc
Go to the documentation of this file.
1 //----------Author's Names:FX. Gentit, B.Fabbro DSM/IRFU/SPP CEA-Saclay
2 //----------Copyright:Those valid for CEA sofware
3 //----------Modified: 24/03/2011
4 
6 #include "Riostream.h"
7 
8 //--------------------------------------
9 // TEcnaResultType.cc
10 // Class creation: 03 Dec 2002
11 // Documentation: see TEcnaResultType.h
12 //--------------------------------------
13 
14 ClassImp(TEcnaResultType)
15 //___________________________________________________________________________
16 //
17 
18 // INFO ========> fMatMat and fMatHis Type is TEcnaNArrayD (visible in TEcnaResultType.h only)
19 //
20 //.... Constructor without Arguments
21 
23 {
24 
25  // cout << "[Info Management] CLASS: TEcnaResultType. CREATE OBJECT: this = " << this << endl;
26 
27  fMatMat.ReSet(1,1);
28  fMatHis.ReSet(1,1);
29 }
30 
32 {
33 
34  // cout << "[Info Management] CLASS: TEcnaResultType. CREATE OBJECT: this = " << this << endl;
35 
36  Long_t i_this = (Long_t)this;
37  pObjectManager->RegisterPointer("TEcnaResultType", i_this);
38 
39  fMatMat.ReSet(1,1);
40  fMatHis.ReSet(1,1);
41 }
42 
43 #define CWAR
44 #ifndef CWAR
45 
47  Int_t xArgNrowMat, Int_t xArgNcolMat,
48  Int_t xArgNrowHis, Int_t xArgNcolHis)
49 {
50 //constructor
51 
52  // cout << "[Info Management] CLASS: TEcnaResultType. CREATE OBJECT: this = " << this << endl;
53 
54  fTypOfCnaResult = typ;
55  fIthElement = i;
56 
57  fMatMat.ReSet(1,1);
58  fMatHis.ReSet(1,1);
59 
60  if ( (xArgNrowMat>0) && (xArgNcolMat>0) )
61  {fMatMat.ReSet(xArgNrowMat,xArgNcolMat);}
62  else
63  {fMatMat.ReSet(1,1);}
64 
65  if ( (xArgNrowHis>0) && (xArgNcolHis>0) )
66  {fMatHis.ReSet(xArgNrowHis,xArgNcolHis);}
67  else
68  {fMatHis.ReSet(1,1);}
69 }
70 
71 #endif // CWAR
72 
74 //destructor
75 
76  // cout << "[Info Management] CLASS: TEcnaResultType. DESTROY OBJECT: this = " << this << endl;
77 }
78 
79 void TEcnaResultType::SetSizeMat(Int_t nrow, Int_t ncol) {
80 //Set size of fMatMat
81  nrow = TMath::Abs(nrow);
82  ncol = TMath::Abs(ncol);
83  if ((nrow>0) && (ncol>0)) fMatMat.ReSet(nrow,ncol);
84  else fMatMat.ReSet(1,1);
85 }
86 
87 void TEcnaResultType::SetSizeHis(Int_t nrow, Int_t ncol) {
88 //Set size of fMatHis
89  nrow = TMath::Abs(nrow);
90  ncol = TMath::Abs(ncol);
91  if ((nrow>0) && (ncol>0)) fMatHis.ReSet(nrow,ncol);
92  else fMatHis.ReSet(1,1);
93 }
94 
96 {
97 //Gives the type of the kth entry
98 
99 //.......... List of the different types and associated parameters:
100 //
101 // Nb of Type of array Type Type
102 // arrays Number
103 //
104 // 1 fMatHis(1,tower) ( 0) cTypNumbers
105 // 1 fMatHis(channel, sample) ( 1) cTypMSp
106 // 1 fMatHis(channel, sample) ( 2) cTypSSp
107 // channel fMatHis(sample, bins) ( 3) cTypAvTno,
108 // 1 fMatHis(channel, sample) ( 4) cTypAvLfn
109 // 1 fMatHis(channel, sample) ( 5) cTypAvHfn
110 // sample fMatMat(channel, channel) ( 6) cTypHfCov
111 // sample fMatMat(channel, channel) ( 7) cTypHfCor
112 // channel fMatMat(sample, sample) ( 8) cTypCovCss
113 // channel fMatMat(sample, sample) ( 9) cTypCorCss
114 // 1 fMatHis(1,channel) (10) cTypMeanCorss
115 // 1 fMatHis(1,channel) (11) cTypSigCorss
116 // 1 fMatHis(channel, sample) (12) cTypAvPed
117 // channel fMatMat(sample, sample) (13) cTypAvMeanCorss
118 // channel fMatMat(sample, sample) (14) cTypAvSigCorss
119 // 1 fMatHis(channel, sample) (15) cTypNbOfEvts
120 // 1 fMatHis(1,channel) (16) cTypPed
121 // 1 fMatHis(1,channel) (17) cTypTno
122 // 1 fMatHis(1,channel) (18) cTypLfn
123 // 1 fMatHis(1,channel) (19) cTypHfn
124 // channel fMatHis(sample, bins) (20) cTypAdcEvt
125 // 1 fMatMat(channel, channel) (21) cTypLfCov
126 // 1 fMatMat(channel, channel) (22) cTypLfCor
127 // 1 fMatMat(channel, channel) (23) cTypLFccMoStins
128 // 1 fMatMat(channel, channel) (24) cTypHFccMoStins
129 // 1 fMatMat(tower, bin_evt) (25) cTypEvtNbInLoop
130 
131  CnaResultTyp xResultType = cTypNumbers; // (default)
132 
133  if( kEntry == 0 ){xResultType = cTypNumbers;}
134  if( kEntry == 1 ){xResultType = cTypMSp;}
135  if( kEntry == 2 ){xResultType = cTypSSp;}
136 
137  if( kEntry == 3 ){xResultType = cTypAvTno;}
138  if( kEntry == 4 ){xResultType = cTypAvLfn;}
139  if( kEntry == 5 ){xResultType = cTypAvHfn;}
140 
141  if( kEntry == 6 ){xResultType = cTypHfCov;}
142  if( kEntry == 7 ){xResultType = cTypHfCor;}
143 
144  if( kEntry == 8 ){xResultType = cTypCovCss;}
145  if( kEntry == 9 ){xResultType = cTypCorCss;}
146 
147  if( kEntry == 10 ){xResultType = cTypMeanCorss;}
148  if( kEntry == 11 ){xResultType = cTypSigCorss;}
149 
150  if( kEntry == 12 ){xResultType = cTypAvPed;}
151  if( kEntry == 13 ){xResultType = cTypAvMeanCorss;}
152  if( kEntry == 14 ){xResultType = cTypAvSigCorss;}
153 
154  if( kEntry == 15 ){xResultType = cTypNbOfEvts;}
155 
156  if( kEntry == 16 ){xResultType = cTypPed;}
157  if( kEntry == 17 ){xResultType = cTypTno;}
158  if( kEntry == 18 ){xResultType = cTypLfn;}
159  if( kEntry == 19 ){xResultType = cTypHfn;}
160 
161  if( kEntry == 20 ){xResultType = cTypAdcEvt;}
162 
163  if( kEntry == 21 ){xResultType = cTypLfCov;}
164  if( kEntry == 22 ){xResultType = cTypLfCor;}
165 
166  if( kEntry == 23 ){xResultType = cTypLFccMoStins;}
167  if( kEntry == 24 ){xResultType = cTypHFccMoStins;}
168 
169  if( kEntry == 25 ){xResultType = cTypEvtNbInLoop;} // (FREE)
170 
171  return xResultType;
172 }
TEcnaNArrayD fMatMat
int i
Definition: DBlmapReader.cc:9
CnaResultTyp
void SetSizeHis(Int_t, Int_t)
TEcnaNArrayD fMatHis
CnaResultTyp fTypOfCnaResult
Bool_t RegisterPointer(const TString, const Long_t &)
Definition: TEcnaObject.cc:102
void SetSizeMat(Int_t, Int_t)
void ReSet(Int_t)
CnaResultTyp GetTypOfEntry(Int_t)