]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Count instances (for debug) (Laurent)
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 20 Oct 2006 16:04:08 +0000 (16:04 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 20 Oct 2006 16:04:08 +0000 (16:04 +0000)
MUON/mapping/AliMpSegFactory.cxx
MUON/mapping/AliMpSegFactory.h

index 25ad52d11c72731be90417261d2c0fbb911724bc..2ca59be4e60ad67940dc7ffe00f4e75fbc626e8f 100644 (file)
@@ -49,6 +49,8 @@
 ClassImp(AliMpSegFactory)
 /// \endcond
 
+Int_t AliMpSegFactory::fgNumberOfInstances(0);
+
 //______________________________________________________________________________
 AliMpSegFactory::AliMpSegFactory()
 : TObject(),
@@ -58,6 +60,7 @@ AliMpSegFactory::AliMpSegFactory()
     /// Standard constructor
     AliDebug(1,"");
     fMpMap->SetOwner(true);
+    ++fgNumberOfInstances;
 }
 
 //______________________________________________________________________________
@@ -68,6 +71,7 @@ AliMpSegFactory::~AliMpSegFactory()
 
   // The segmentations is supposed to be deleted in the client code
   AliDebug(1,"");
+  --fgNumberOfInstances;
 }
 
 //
@@ -81,7 +85,7 @@ AliMpSegFactory::FillMpMap(Int_t detElemId)
 /// Fill the map of electronic cards IDs to segmentations for
 /// given detElemId
 
-  AliDebug(1,Form("detElemId=%d",detElemId));
+  AliDebugStream(2) << "detElemId=" << detElemId << endl;;
   
   AliMpExMap* mde = new AliMpExMap(true);
   mde->SetOwner(kFALSE);
@@ -132,8 +136,9 @@ AliMpSegFactory::CreateMpSegmentation(Int_t detElemId, Int_t cath)
   TObject* object = fMpSegmentations.Get(deName);
   if ( object ) return (AliMpVSegmentation*)object;
 
-  AliDebug(1,Form("Creating segmentation for detElemId=%d cath=%d",
-                  detElemId,cath));
+  AliDebugStream(3)
+    << "Creating segmentation for detElemId=" << detElemId 
+    << " cath=" << cath << endl;
   
   // Read mapping data and create segmentation
   //
index 6d46c8c277b8d7d874cb95139877a7104a4c84bc..7377234d000fabb31d5534b58d204d0756cadf26 100644 (file)
@@ -44,6 +44,8 @@ class AliMpSegFactory : public  TObject {
 
     void DeleteSegmentations();
 
+    static Int_t NumberOfInstances() { return fgNumberOfInstances; }
+    
   private:
     AliMpSegFactory(const AliMpSegFactory& rhs);
     AliMpSegFactory& operator=(const AliMpSegFactory& rhs);
@@ -53,6 +55,8 @@ class AliMpSegFactory : public  TObject {
     AliMpStringObjMap  fMpSegmentations;///< Map of mapping segmentations to DE names
     AliMpExMap*        fMpMap;          ///< Map of el. cards IDs to segmentations
       
+    static Int_t fgNumberOfInstances; ///< number of AliMpSegFactory objects...
+    
   ClassDef(AliMpSegFactory,0)  // The factory for building mapping segmentations
 };