CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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: 24/03/2011
5 
6 //--------------------------------------
7 // TEcnaObject.cc
8 // Class creation: 15 October 2010
9 // Documentation: see TEcnaObject.h
10 //--------------------------------------
11 
12 ClassImp(TEcnaObject)
13 //______________________________________________________________________________
14 //
15 
17 {
18 //destructor
19 
20  // cout << "[Info Management] CLASS: TEcnaObject. DESTROY OBJECT: this = " << this << endl;
21 }
22 
23 //===================================================================
24 //
25 // Constructors
26 //
27 //===================================================================
29 {
30 // Constructor without argument
31 
32  // cout << "[Info Management] CLASS: TEcnaObject. CREATE OBJECT: this = " << this << endl;
33 
34  Long_t PointerValue = (Long_t)this;
35  Int_t un = 1;
36  NumberCreateObjectMessage("TEcnaObject", PointerValue, un);
37 
38  Init();
39 
40 }
41 
43 {
44  fgMaxCar = 512;
45  fTTBELL = '\007';
46 
47  //................ Init pointers to TEcna Objects
48  fObjectTEcnaGui = 0;
56  fObjectTEcnaRead = 0;
59  fObjectTEcnaRun = 0;
61 
62  //................ Init counters of TEcna Object creation
76 
77  //................ Init counters of TEcna Object re-using
91 
92 }// end of Init()
93 
94 
95 //=======================================================================================
96 //
97 // P O I N T E R / O B J E C T M A N A G E M E N T
98 //
99 // TEcnaObject not in list because it is the manager
100 //
101 //=======================================================================================
102 Bool_t TEcnaObject::RegisterPointer(const TString& ClassName, const Long_t& PointerValue)
103 {
104  Bool_t ClassFound = kFALSE;
105 
106  if( ClassName == "TEcnaGui" )
107  {
108  ClassFound = kTRUE;
109  fObjectTEcnaGui = PointerValue;
111  NumberCreateObjectMessage(ClassName.Data(), PointerValue, fCounterCreateTEcnaGui);
112  }
113 
114  if( ClassName == "TEcnaHeader" )
115  {
116  ClassFound = kTRUE;
117  fObjectTEcnaHeader = PointerValue;
119  NumberCreateObjectMessage(ClassName.Data(), PointerValue, fCounterCreateTEcnaHeader);
120  }
121 
122  if( ClassName == "TEcnaHistos" )
123  {
124  ClassFound = kTRUE;
125  fObjectTEcnaHistos = PointerValue;
127  NumberCreateObjectMessage(ClassName.Data(), PointerValue, fCounterCreateTEcnaHistos);
128  }
129 
130  if( ClassName == "TEcnaNArrayD" )
131  {
132  ClassFound = kTRUE;
133  fObjectTEcnaNArrayD = PointerValue;
135  NumberCreateObjectMessage(ClassName.Data(), PointerValue, fCounterCreateTEcnaNArrayD);
136  }
137 
138  if( ClassName == "TEcnaNumbering" )
139  {
140  ClassFound = kTRUE;
141  fObjectTEcnaNumbering = PointerValue;
143  NumberCreateObjectMessage(ClassName.Data(), PointerValue, fCounterCreateTEcnaNumbering);
144  }
145 
146  if( ClassName == "TEcnaParCout" )
147  {
148  ClassFound = kTRUE;
149  fObjectTEcnaParCout = PointerValue;
151  NumberCreateObjectMessage(ClassName.Data(), PointerValue, fCounterCreateTEcnaParCout);
152  }
153 
154  if( ClassName == "TEcnaParEcal" )
155  {
156  ClassFound = kTRUE;
157  fObjectTEcnaParEcal = PointerValue;
159  NumberCreateObjectMessage(ClassName.Data(), PointerValue, fCounterCreateTEcnaParEcal);
160  }
161 
162  if( ClassName == "TEcnaParHistos" )
163  {
164  ClassFound = kTRUE;
165  fObjectTEcnaParHistos = PointerValue;
167  NumberCreateObjectMessage(ClassName.Data(), PointerValue, fCounterCreateTEcnaParHistos);
168  }
169 
170  if( ClassName == "TEcnaParPaths" )
171  {
172  ClassFound = kTRUE;
173  fObjectTEcnaParPaths = PointerValue;
175  NumberCreateObjectMessage(ClassName.Data(), PointerValue, fCounterCreateTEcnaParPaths);
176  }
177 
178  if( ClassName == "TEcnaRead" )
179  {
180  ClassFound = kTRUE;
181  fObjectTEcnaRead = PointerValue;
183  NumberCreateObjectMessage(ClassName.Data(), PointerValue, fCounterCreateTEcnaRead);
184  }
185 
186  if( ClassName == "TEcnaResultType" )
187  {
188  ClassFound = kTRUE;
189  fObjectTEcnaResultType = PointerValue;
191  NumberCreateObjectMessage(ClassName.Data(), PointerValue, fCounterCreateTEcnaResultType);
192  }
193 
194  if( ClassName == "TEcnaRootFile" )
195  {
196  ClassFound = kTRUE;
197  fObjectTEcnaRootFile = PointerValue;
199  NumberCreateObjectMessage(ClassName.Data(), PointerValue, fCounterCreateTEcnaRootFile);
200  }
201 
202  if( ClassName == "TEcnaRun" )
203  {
204  ClassFound = kTRUE;
205  fObjectTEcnaRun = PointerValue;
207  NumberCreateObjectMessage(ClassName.Data(), PointerValue, fCounterCreateTEcnaRun);
208  }
209 
210  if( ClassName == "TEcnaWrite" )
211  {
212  ClassFound = kTRUE;
213  fObjectTEcnaWrite = PointerValue;
215  NumberCreateObjectMessage(ClassName.Data(), PointerValue, fCounterCreateTEcnaWrite);
216  }
217 
218  //.........................................................................................
219  if( ClassFound == kFALSE )
220  {
221  cout << "!TEcnaObject::RegisterPointer(...)> Class " << ClassName
222  << " not found." << fTTBELL << endl;
223  }
224 
225  return ClassFound;
226 } // end of RegisterPointer(...)
227 
228 
230 {
231  Long_t PointerValue = 0;
232 
233  if( ClassName == "TEcnaGui" )
234  {
235  PointerValue = fObjectTEcnaGui;
237  NumberReuseObjectMessage(ClassName.Data(), PointerValue, fCounterReusingTEcnaGui);
238  }
239 
240  if( ClassName == "TEcnaHeader" )
241  {
242  PointerValue = fObjectTEcnaHeader;
244  NumberReuseObjectMessage(ClassName.Data(), PointerValue, fCounterReusingTEcnaHeader);
245  }
246 
247  if( ClassName == "TEcnaHistos" )
248  {
249  PointerValue = fObjectTEcnaHistos;
251  NumberReuseObjectMessage(ClassName.Data(), PointerValue, fCounterReusingTEcnaHistos);
252  }
253 
254  if( ClassName == "TEcnaNArrayD" )
255  {
256  PointerValue = fObjectTEcnaNArrayD;
258  NumberReuseObjectMessage(ClassName.Data(), PointerValue, fCounterReusingTEcnaNArrayD);
259  }
260 
261  if( ClassName == "TEcnaNumbering" )
262  {
263  PointerValue = fObjectTEcnaNumbering;
265  NumberReuseObjectMessage(ClassName.Data(), PointerValue, fCounterReusingTEcnaNumbering);
266  }
267 
268  if( ClassName == "TEcnaParCout" )
269  {
270  PointerValue = fObjectTEcnaParCout;
272  NumberReuseObjectMessage(ClassName.Data(), PointerValue, fCounterReusingTEcnaParCout);
273  }
274 
275  if( ClassName == "TEcnaParEcal" )
276  {
277  PointerValue = fObjectTEcnaParEcal;
279  NumberReuseObjectMessage(ClassName.Data(), PointerValue, fCounterReusingTEcnaParEcal);
280  }
281 
282  if( ClassName == "TEcnaParHistos" )
283  {
284  PointerValue = fObjectTEcnaParHistos;
286  NumberReuseObjectMessage(ClassName.Data(), PointerValue, fCounterReusingTEcnaParHistos);
287  }
288 
289  if( ClassName == "TEcnaParPaths" )
290  {
291  PointerValue = fObjectTEcnaParPaths;
293  NumberReuseObjectMessage(ClassName.Data(), PointerValue, fCounterReusingTEcnaParPaths);
294  }
295 
296  if( ClassName == "TEcnaRead" )
297  {
298  PointerValue = fObjectTEcnaRead;
300  NumberReuseObjectMessage(ClassName.Data(), PointerValue, fCounterReusingTEcnaRead);
301  }
302 
303  if( ClassName == "TEcnaResultType" )
304  {
305  PointerValue = fObjectTEcnaResultType;
307  NumberReuseObjectMessage(ClassName.Data(), PointerValue, fCounterReusingTEcnaResultType);
308  }
309 
310  if( ClassName == "TEcnaRootFile" )
311  {
312  PointerValue = fObjectTEcnaRootFile;
314  NumberReuseObjectMessage(ClassName.Data(), PointerValue, fCounterReusingTEcnaRootFile);
315  }
316 
317  if( ClassName == "TEcnaRun" )
318  {
319  PointerValue = fObjectTEcnaRun;
321  NumberReuseObjectMessage(ClassName.Data(), PointerValue, fCounterReusingTEcnaRun);
322  }
323 
324  if( ClassName == "TEcnaWrite" )
325  {
326  PointerValue = fObjectTEcnaWrite;
328  NumberReuseObjectMessage(ClassName.Data(), PointerValue, fCounterReusingTEcnaWrite);
329  }
330 
331  return PointerValue;
332 }
333 
334 void TEcnaObject::NumberCreateObjectMessage(const TString& ClassName, const Long_t& PointerValue, const Int_t& NbOfObjects)
335 {
336 #define NOCM
337 #ifndef NOCM
338  cout << "*TEcnaObject::NumberCreateObjectMessage(...)> New ECNA object (pointer = "
339  << PointerValue << ") from TEcnaObject " << this
340  << ". Object# = " << setw(8) << NbOfObjects
341  << ", Class: " << ClassName;
342  if( NbOfObjects > 1 ){cout << " (INFO: more than 1 object)";}
343  cout << endl;
344 #endif // NOCM
345 }
346 
347 void TEcnaObject::NumberReuseObjectMessage(const TString& ClassName, const Long_t& PointerValue, const Int_t& NbOfObjects)
348 {
349 #define NOCR
350 #ifndef NOCR
351  if( PointerValue != 0 )
352  {
353  cout << "*TEcnaObject::GetPointerValue(...)> INFO: pointer " << PointerValue
354  << " used again from TEcnaObject " << this
355  << ". " << setw(8) << NbOfObjects << " times, class: " << ClassName;
356  }
357  cout << endl;
358 #endif // NOCR
359 }
Long_t fObjectTEcnaResultType
Definition: TEcnaObject.h:46
Int_t fCounterReusingTEcnaWrite
Definition: TEcnaObject.h:81
Int_t fCounterReusingTEcnaParHistos
Definition: TEcnaObject.h:75
Long_t fObjectTEcnaRead
Definition: TEcnaObject.h:45
Int_t fCounterReusingTEcnaNArrayD
Definition: TEcnaObject.h:71
Int_t fCounterCreateTEcnaWrite
Definition: TEcnaObject.h:65
Long_t fObjectTEcnaGui
Definition: TEcnaObject.h:36
Long_t fObjectTEcnaParEcal
Definition: TEcnaObject.h:42
Int_t fCounterCreateTEcnaRead
Definition: TEcnaObject.h:61
Int_t fCounterCreateTEcnaHeader
Definition: TEcnaObject.h:53
Int_t fCounterCreateTEcnaParPaths
Definition: TEcnaObject.h:60
Int_t fCounterCreateTEcnaResultType
Definition: TEcnaObject.h:62
Int_t fCounterCreateTEcnaRun
Definition: TEcnaObject.h:64
Int_t fCounterReusingTEcnaParEcal
Definition: TEcnaObject.h:74
Int_t fCounterReusingTEcnaNumbering
Definition: TEcnaObject.h:72
Bool_t RegisterPointer(const TString &, const Long_t &)
Definition: TEcnaObject.cc:102
Int_t fCounterReusingTEcnaHeader
Definition: TEcnaObject.h:69
Int_t fCounterCreateTEcnaNArrayD
Definition: TEcnaObject.h:55
Int_t fCounterCreateTEcnaGui
Definition: TEcnaObject.h:52
Long_t fObjectTEcnaRun
Definition: TEcnaObject.h:48
Int_t fCounterReusingTEcnaResultType
Definition: TEcnaObject.h:78
Int_t fCounterReusingTEcnaRootFile
Definition: TEcnaObject.h:79
Int_t fCounterReusingTEcnaGui
Definition: TEcnaObject.h:68
Long_t fObjectTEcnaWrite
Definition: TEcnaObject.h:49
Long_t fObjectTEcnaParCout
Definition: TEcnaObject.h:41
Int_t fCounterCreateTEcnaParCout
Definition: TEcnaObject.h:57
Int_t fCounterReusingTEcnaRun
Definition: TEcnaObject.h:80
Int_t fCounterReusingTEcnaHistos
Definition: TEcnaObject.h:70
Int_t fCounterCreateTEcnaHistos
Definition: TEcnaObject.h:54
TString fTTBELL
Definition: TEcnaObject.h:33
void NumberCreateObjectMessage(const TString &, const Long_t &, const Int_t &)
Definition: TEcnaObject.cc:334
Int_t fgMaxCar
Definition: TEcnaObject.h:31
Long_t fObjectTEcnaNArrayD
Definition: TEcnaObject.h:39
Int_t fCounterCreateTEcnaRootFile
Definition: TEcnaObject.h:63
Long_t fObjectTEcnaHistos
Definition: TEcnaObject.h:38
Int_t fCounterReusingTEcnaParPaths
Definition: TEcnaObject.h:76
Int_t fCounterCreateTEcnaNumbering
Definition: TEcnaObject.h:56
Long_t fObjectTEcnaParHistos
Definition: TEcnaObject.h:43
Int_t fCounterCreateTEcnaParHistos
Definition: TEcnaObject.h:59
tuple cout
Definition: gather_cfg.py:121
void NumberReuseObjectMessage(const TString &, const Long_t &, const Int_t &)
Definition: TEcnaObject.cc:347
Int_t fCounterReusingTEcnaRead
Definition: TEcnaObject.h:77
Int_t fCounterCreateTEcnaParEcal
Definition: TEcnaObject.h:58
void Init()
Definition: TEcnaObject.cc:42
Long_t fObjectTEcnaRootFile
Definition: TEcnaObject.h:47
Long_t fObjectTEcnaHeader
Definition: TEcnaObject.h:37
Long_t GetPointerValue(const TString &)
Definition: TEcnaObject.cc:229
Long_t fObjectTEcnaNumbering
Definition: TEcnaObject.h:40
Int_t fCounterReusingTEcnaParCout
Definition: TEcnaObject.h:73
Long_t fObjectTEcnaParPaths
Definition: TEcnaObject.h:44