CMS 3D CMS Logo

TEcnaObject.cc
Go to the documentation of this file.
1 //---------Author's Name: B.Fabbro DSM/IRFU/SPP CEA-Saclay
2 //----------Copyright: Those valid for CEA sofware
3 //----------Modified: 29/01/2014
5 
6 //--------------------------------------
7 // TEcnaObject.cc
8 // Class creation: 15 October 2010
9 // Documentation: see TEcnaObject.h
10 //--------------------------------------
11 
13 //______________________________________________________________________________
14 //
15 
17  //destructor
18 
19  // std::cout << "[Info Management] CLASS: TEcnaObject. DESTROY OBJECT: this = " << this << std::endl;
20 }
21 
22 //===================================================================
23 //
24 // Constructors
25 //
26 //===================================================================
28  // Constructor without argument
29 
30  // std::cout << "[Info Management] CLASS: TEcnaObject. CREATE OBJECT: this = " << this << std::endl;
31 
32  Long_t PointerValue = (Long_t)this;
33  Int_t un = 1;
34  NumberCreateObjectMessage("TEcnaObject", PointerValue, un);
35 
36  Init();
37 }
38 
40  fgMaxCar = (Int_t)512;
41  fTTBELL = '\007';
42 
43  //................ Init pointers to TEcna Objects
44  fObjectTEcnaGui = 0;
53  fObjectTEcnaRead = 0;
56  fObjectTEcnaRun = 0;
58 
59  //................ Init counters of TEcna Object creation
74 
75  //................ Init counters of TEcna Object re-using
90 
91 } // end of Init()
92 
93 //=======================================================================================
94 //
95 // P O I N T E R / O B J E C T M A N A G E M E N T
96 //
97 // TEcnaObject not in list because it is the manager
98 //
99 //=======================================================================================
100 Bool_t TEcnaObject::RegisterPointer(const TString& ClassName, const Long_t& PointerValue) {
101  Bool_t ClassFound = kFALSE;
102 
103  if (ClassName == "TEcnaGui") {
104  ClassFound = kTRUE;
105  fObjectTEcnaGui = PointerValue;
108  }
109 
110  if (ClassName == "TEcnaHeader") {
111  ClassFound = kTRUE;
112  fObjectTEcnaHeader = PointerValue;
115  }
116 
117  if (ClassName == "TEcnaHistos") {
118  ClassFound = kTRUE;
119  fObjectTEcnaHistos = PointerValue;
122  }
123 
124  if (ClassName == "TEcnaNArrayD") {
125  ClassFound = kTRUE;
126  fObjectTEcnaNArrayD = PointerValue;
129  }
130 
131  if (ClassName == "TEcnaNumbering") {
132  ClassFound = kTRUE;
133  fObjectTEcnaNumbering = PointerValue;
136  }
137 
138  if (ClassName == "TEcnaParCout") {
139  ClassFound = kTRUE;
140  fObjectTEcnaParCout = PointerValue;
143  }
144 
145  if (ClassName == "TEcnaParEcal") {
146  ClassFound = kTRUE;
147  fObjectTEcnaParEcal = PointerValue;
150  }
151 
152  if (ClassName == "TEcnaParHistos") {
153  ClassFound = kTRUE;
154  fObjectTEcnaParHistos = PointerValue;
157  }
158 
159  if (ClassName == "TEcnaParPaths") {
160  ClassFound = kTRUE;
161  fObjectTEcnaParPaths = PointerValue;
164  }
165 
166  if (ClassName == "TEcnaRead") {
167  ClassFound = kTRUE;
168  fObjectTEcnaRead = PointerValue;
171  }
172 
173  if (ClassName == "TEcnaResultType") {
174  ClassFound = kTRUE;
175  fObjectTEcnaResultType = PointerValue;
178  }
179 
180  if (ClassName == "TEcnaRootFile") {
181  ClassFound = kTRUE;
182  fObjectTEcnaRootFile = PointerValue;
185  }
186 
187  if (ClassName == "TEcnaRun") {
188  ClassFound = kTRUE;
189  fObjectTEcnaRun = PointerValue;
192  }
193 
194  if (ClassName == "TEcnaWrite") {
195  ClassFound = kTRUE;
196  fObjectTEcnaWrite = PointerValue;
199  }
200 
201  //.........................................................................................
202  if (ClassFound == kFALSE) {
203  std::cout << "!TEcnaObject::RegisterPointer(...)> Class " << ClassName << " not found." << fTTBELL << std::endl;
204  }
205 
206  return ClassFound;
207 } // end of RegisterPointer(...)
208 
209 Long_t TEcnaObject::GetPointerValue(const TString& ClassName) {
210  Long_t PointerValue = (Long_t)0;
211 
212  if (ClassName == "TEcnaGui") {
213  PointerValue = fObjectTEcnaGui;
216  }
217 
218  if (ClassName == "TEcnaHeader") {
219  PointerValue = fObjectTEcnaHeader;
222  }
223 
224  if (ClassName == "TEcnaHistos") {
225  PointerValue = fObjectTEcnaHistos;
228  }
229 
230  if (ClassName == "TEcnaNArrayD") {
231  PointerValue = fObjectTEcnaNArrayD;
234  }
235 
236  if (ClassName == "TEcnaNumbering") {
237  PointerValue = fObjectTEcnaNumbering;
240  }
241 
242  if (ClassName == "TEcnaParCout") {
243  PointerValue = fObjectTEcnaParCout;
246  }
247 
248  if (ClassName == "TEcnaParEcal") {
249  PointerValue = fObjectTEcnaParEcal;
252  }
253 
254  if (ClassName == "TEcnaParHistos") {
255  PointerValue = fObjectTEcnaParHistos;
258  }
259 
260  if (ClassName == "TEcnaParPaths") {
261  PointerValue = fObjectTEcnaParPaths;
264  }
265 
266  if (ClassName == "TEcnaRead") {
267  PointerValue = fObjectTEcnaRead;
270  }
271 
272  if (ClassName == "TEcnaResultType") {
273  PointerValue = fObjectTEcnaResultType;
276  }
277 
278  if (ClassName == "TEcnaRootFile") {
279  PointerValue = fObjectTEcnaRootFile;
282  }
283 
284  if (ClassName == "TEcnaRun") {
285  PointerValue = fObjectTEcnaRun;
288  }
289 
290  if (ClassName == "TEcnaWrite") {
291  PointerValue = fObjectTEcnaWrite;
294  }
295 
296  return PointerValue;
297 }
298 
300  const Long_t& PointerValue,
301  const Int_t& NbOfObjects) {
302 #define NOCM
303 #ifndef NOCM
304  std::cout << "*TEcnaObject::NumberCreateObjectMessage(...)> New ECNA object (pointer = " << PointerValue
305  << ") from TEcnaObject " << this << ". Object# = " << std::setw(8) << NbOfObjects
306  << ", Class: " << ClassName;
307  if (NbOfObjects > 1) {
308  std::cout << " (INFO: more than 1 object)";
309  }
310  std::cout << std::endl;
311 #endif // NOCM
312 }
313 
315  const Long_t& PointerValue,
316  const Int_t& NbOfObjects) {
317 #define NOCR
318 #ifndef NOCR
319  if (PointerValue != (Long_t)0) {
320  std::cout << "*TEcnaObject::NumberReuseObjectMessage(...)> INFO: pointer " << PointerValue
321  << " used again from TEcnaObject " << this << ". " << std::setw(8) << NbOfObjects
322  << " times, class: " << ClassName;
323  }
324  std::cout << std::endl;
325 #endif // NOCR
326 }
TEcnaObject::fObjectTEcnaNumbering
Long_t fObjectTEcnaNumbering
Definition: TEcnaObject.h:38
TEcnaObject::fCounterReusingTEcnaParCout
Int_t fCounterReusingTEcnaParCout
Definition: TEcnaObject.h:71
TEcnaObject::fCounterCreateTEcnaWrite
Int_t fCounterCreateTEcnaWrite
Definition: TEcnaObject.h:63
TEcnaObject::TEcnaObject
TEcnaObject()
Definition: TEcnaObject.cc:27
TEcnaObject::fObjectTEcnaParEcal
Long_t fObjectTEcnaParEcal
Definition: TEcnaObject.h:40
TEcnaObject::fObjectTEcnaRead
Long_t fObjectTEcnaRead
Definition: TEcnaObject.h:43
TEcnaObject::fCounterReusingTEcnaParHistos
Int_t fCounterReusingTEcnaParHistos
Definition: TEcnaObject.h:73
TEcnaObject::~TEcnaObject
~TEcnaObject() override
Definition: TEcnaObject.cc:16
gather_cfg.cout
cout
Definition: gather_cfg.py:144
TEcnaObject::fCounterCreateTEcnaParPaths
Int_t fCounterCreateTEcnaParPaths
Definition: TEcnaObject.h:58
TEcnaObject::fCounterCreateTEcnaRead
Int_t fCounterCreateTEcnaRead
Definition: TEcnaObject.h:59
TEcnaObject::fCounterReusingTEcnaNArrayD
Int_t fCounterReusingTEcnaNArrayD
Definition: TEcnaObject.h:69
TEcnaObject::fCounterReusingTEcnaHeader
Int_t fCounterReusingTEcnaHeader
Definition: TEcnaObject.h:67
TEcnaObject::fCounterCreateTEcnaHeader
Int_t fCounterCreateTEcnaHeader
Definition: TEcnaObject.h:51
TEcnaObject::fCounterReusingTEcnaParEcal
Int_t fCounterReusingTEcnaParEcal
Definition: TEcnaObject.h:72
TEcnaObject::fObjectTEcnaWrite
Long_t fObjectTEcnaWrite
Definition: TEcnaObject.h:47
TEcnaObject::fCounterCreateTEcnaResultType
Int_t fCounterCreateTEcnaResultType
Definition: TEcnaObject.h:60
TEcnaObject::fCounterReusingTEcnaNumbering
Int_t fCounterReusingTEcnaNumbering
Definition: TEcnaObject.h:70
TEcnaObject::fObjectTEcnaParCout
Long_t fObjectTEcnaParCout
Definition: TEcnaObject.h:39
TEcnaObject::fCounterCreateTEcnaRun
Int_t fCounterCreateTEcnaRun
Definition: TEcnaObject.h:62
TEcnaObject::RegisterPointer
Bool_t RegisterPointer(const TString &, const Long_t &)
Definition: TEcnaObject.cc:100
TEcnaObject::fObjectTEcnaRun
Long_t fObjectTEcnaRun
Definition: TEcnaObject.h:46
TEcnaObject::fCounterCreateTEcnaParCout
Int_t fCounterCreateTEcnaParCout
Definition: TEcnaObject.h:55
TEcnaObject::fCounterCreateTEcnaNArrayD
Int_t fCounterCreateTEcnaNArrayD
Definition: TEcnaObject.h:53
TEcnaObject::fCounterReusingTEcnaRootFile
Int_t fCounterReusingTEcnaRootFile
Definition: TEcnaObject.h:77
TEcnaObject::fCounterCreateTEcnaGui
Int_t fCounterCreateTEcnaGui
Definition: TEcnaObject.h:50
TEcnaObject.h
ClassName
Definition: ClassName.h:36
TEcnaObject::fCounterReusingTEcnaResultType
Int_t fCounterReusingTEcnaResultType
Definition: TEcnaObject.h:76
TEcnaObject::fCounterReusingTEcnaRun
Int_t fCounterReusingTEcnaRun
Definition: TEcnaObject.h:78
TEcnaObject::fCounterReusingTEcnaHistos
Int_t fCounterReusingTEcnaHistos
Definition: TEcnaObject.h:68
ClassImp
ClassImp(TEcnaObject)
TEcnaObject
Definition: TEcnaObject.h:25
TEcnaObject::fCounterCreateTEcnaRootFile
Int_t fCounterCreateTEcnaRootFile
Definition: TEcnaObject.h:61
TEcnaObject::fCounterCreateTEcnaHistos
Int_t fCounterCreateTEcnaHistos
Definition: TEcnaObject.h:52
TEcnaObject::fCounterReusingTEcnaParPaths
Int_t fCounterReusingTEcnaParPaths
Definition: TEcnaObject.h:74
TEcnaObject::fCounterReusingTEcnaGui
Int_t fCounterReusingTEcnaGui
Definition: TEcnaObject.h:66
TEcnaObject::fObjectTEcnaNArrayD
Long_t fObjectTEcnaNArrayD
Definition: TEcnaObject.h:37
TEcnaObject::fObjectTEcnaHistos
Long_t fObjectTEcnaHistos
Definition: TEcnaObject.h:36
TEcnaObject::fgMaxCar
Int_t fgMaxCar
Definition: TEcnaObject.h:29
TEcnaObject::fTTBELL
TString fTTBELL
Definition: TEcnaObject.h:31
TEcnaObject::fObjectTEcnaParPaths
Long_t fObjectTEcnaParPaths
Definition: TEcnaObject.h:42
TEcnaObject::fCounterCreateTEcnaParEcal
Int_t fCounterCreateTEcnaParEcal
Definition: TEcnaObject.h:56
TEcnaObject::fObjectTEcnaRootFile
Long_t fObjectTEcnaRootFile
Definition: TEcnaObject.h:45
TEcnaObject::NumberCreateObjectMessage
void NumberCreateObjectMessage(const TString &, const Long_t &, const Int_t &)
Definition: TEcnaObject.cc:299
TEcnaObject::fCounterCreateTEcnaNumbering
Int_t fCounterCreateTEcnaNumbering
Definition: TEcnaObject.h:54
TEcnaObject::fObjectTEcnaHeader
Long_t fObjectTEcnaHeader
Definition: TEcnaObject.h:35
TEcnaObject::fCounterCreateTEcnaParHistos
Int_t fCounterCreateTEcnaParHistos
Definition: TEcnaObject.h:57
TEcnaObject::fCounterReusingTEcnaWrite
Int_t fCounterReusingTEcnaWrite
Definition: TEcnaObject.h:79
TEcnaObject::fCounterReusingTEcnaRead
Int_t fCounterReusingTEcnaRead
Definition: TEcnaObject.h:75
TEcnaObject::NumberReuseObjectMessage
void NumberReuseObjectMessage(const TString &, const Long_t &, const Int_t &)
Definition: TEcnaObject.cc:314
TEcnaObject::Init
void Init()
Definition: TEcnaObject.cc:39
TEcnaObject::fObjectTEcnaParHistos
Long_t fObjectTEcnaParHistos
Definition: TEcnaObject.h:41
TEcnaObject::fObjectTEcnaGui
Long_t fObjectTEcnaGui
Definition: TEcnaObject.h:34
TEcnaObject::fObjectTEcnaResultType
Long_t fObjectTEcnaResultType
Definition: TEcnaObject.h:44
TEcnaObject::GetPointerValue
Long_t GetPointerValue(const TString &)
Definition: TEcnaObject.cc:209