]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVE/EveDet/AliEveListAnalyserEditor.cxx
fix user histogram management and style (Ben)
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEveListAnalyserEditor.cxx
index be764e857fc5f95548fdd7a030b58f0819f0eef0..15494f2d0550a83c741dd5107059d59ca51ebd9d 100644 (file)
@@ -1297,17 +1297,14 @@ const Char_t *fGeneralMacroTemplate[7] = {
 "  r = 0x0;\n"
 "  if (!object) return;\n"
 
-,"  if (!object) return 0x0;\n"
-"  TH1* h = 0x0;\n\n"
-"// Set bins, xmin and xmax here\n"
+,"  if (!object) return 0x0;\n\n"
+"// Set bins, xmin and xmax here - you can also use a different histogram type (but must inherit from TH1)\n"
 "  Int_t n = 1;\n"
 "  Double_t xmin = 0;\n"
 "  Double_t xmax = 100;\n\n" 
-"  if(!(h = (TH1*)gROOT->FindObject(\"h\"))){\n"
-"    h = new TH1(\"h\", \"Title\", n, xmin, xmax);\n"
-"    h->GetXaxis()->SetTitle("");\n"
-"    h->GetYaxis()->SetTitle("");\n"
-"  } else h->Reset();\n"
+"  TH1S* h = new TH1S(\"h\", \"Your title\", n, xmin, xmax);\n"
+"  h->GetXaxis()->SetTitle("");\n"
+"  h->GetYaxis()->SetTitle("");\n"
 
 ,"  if (!object) return kFALSE;\n"
 "  if (!object2) return kFALSE;\n"
@@ -1318,17 +1315,14 @@ const Char_t *fGeneralMacroTemplate[7] = {
 "  if (!object2) return;\n"
 
 ,"  if (!object) return 0x0;\n"
-"  if (!object2) return 0x0;\n"
-"  TH1* h = 0x0;\n\n"
-"// Set bins, xmin and xmax here\n"
+"  if (!object2) return 0x0;\n\n"
+"// Set bins, xmin and xmax here - you can also use a different histogram type (but must inherit from TH1)\n"
 "  Int_t n = 1;\n"
 "  Double_t xmin = 0;\n"
-"  Double_t xmax = 100;\n\n" 
-"  if(!(h = (TH1*)gROOT->FindObject(\"h\"))){\n"
-"    h = new TH1(\"h\", \"Title\", n, xmin, xmax);\n"
-"    h->GetXaxis()->SetTitle("");\n"
-"    h->GetYaxis()->SetTitle("");\n"
-"  } else h->Reset();\n"
+"  Double_t xmax = 100;\n\n"
+"  TH1S* h = new TH1S(\"h\", \"Your title\", n, xmin, xmax);\n"
+"  h->GetXaxis()->SetTitle("");\n"
+"  h->GetYaxis()->SetTitle("");\n"
 };
 
 //______________________________________________________