New function, CreateRootHisto(). Just to seperate it from Draw
authorvestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Jul 2002 09:35:09 +0000 (09:35 +0000)
committervestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Jul 2002 09:35:09 +0000 (09:35 +0000)
HLT/hough/AliL3Histogram.cxx
HLT/hough/AliL3Histogram.h

index 9c0fbf5516f6e3658220781468c1d94bf7922720..7abd0d9400a45fa5f567a339c9c3ecd644f8f7bf 100644 (file)
@@ -245,7 +245,8 @@ Double_t AliL3Histogram::GetBinCenterY(Int_t ybin)
 void AliL3Histogram::Draw(Char_t *option)
 {
 #ifdef use_root
-  fRootHisto = new TH2F(fName,"",fNxbins,fXmin,fXmax,fNybins,fYmin,fYmax);
+  if(!fRootHisto)
+    CreateRootHisto();
   for(Int_t bin=0; bin<fNcells; bin++)
     {
       fRootHisto->AddBinContent(bin,GetBinContent(bin));
@@ -258,3 +259,12 @@ void AliL3Histogram::Draw(Char_t *option)
   cerr<<"AliL3Histogram::Draw : You need to compile with ROOT in order to draw histogram"<<endl;
   
 }
+
+void AliL3Histogram::CreateRootHisto()
+{
+#ifdef use_root
+  fRootHisto = new TH2F(fName,"",fNxbins,fXmin,fXmax,fNybins,fYmin,fYmax);
+  return;
+#endif
+  cerr<<"AliL3Histogram::CreateRootHisto : You need to compile with ROOT in order to create ROOT histogram"<<endl;
+}
index 399ffbd50f6b0019030f1e9b44c1bc454bb2c0cb..7cb59a0b1d121b04d35e3a120ba07cf75655ab9f 100644 (file)
@@ -52,6 +52,7 @@ class AliL3Histogram {
   void Add(AliL3Histogram *h1,Double_t weight=1);
   void SetThreshold(Int_t i) {fThreshold = i;}
   void Draw(Char_t *option="hist");
+  void CreateRootHisto();
 
 #ifdef use_root
   TH2F *GetRootHisto();