Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 2369)
+++ trunk/MagicSoft/Mars/Changelog	(revision 2370)
@@ -1,3 +1,18 @@
                                                  -*-*- END OF LINE -*-*-
+
+  
+  2003/10/01: Nicola Galante
+
+   * mhistmc/MHMcTriggerLvl2.[h,cc]:
+     - in method MHMcTriggerLvl2::Fill added filling of 2D histograms
+       of fLutPseudoSize vs. energy and of fSizeBiggerCell vs. energy
+     - modified method MHMcTriggerLvl2::GetHistByName which now
+       can return any histogram (data member) of the class
+       MHMcTriggerLvl2 (now it returns a (TObject *) not a (TH1F *))
+     - Updated option list of the methid MHMcTriggerLvl2::DrawClone
+
+   * macros/triglvl2.C:
+     - Updated according with changes in class MHMcTriggerLvl2
+
 
 
Index: trunk/MagicSoft/Mars/macros/triglvl2.C
===================================================================
--- trunk/MagicSoft/Mars/macros/triglvl2.C	(revision 2369)
+++ trunk/MagicSoft/Mars/macros/triglvl2.C	(revision 2370)
@@ -181,17 +181,20 @@
     parlist.FindObject("MHMcTriggerLvl2")->DrawClone("lps");
     parlist.FindObject("MHMcTriggerLvl2")->DrawClone();
-    parlist.FindObject("MHMcTriggerLvl2")->DrawClone("energy");
+    //parlist.FindObject("MHMcTriggerLvl2")->DrawClone("energy");
+    parlist.FindObject("MHMcTriggerLvl2")->DrawClone("size-energy");
 
     // Returns histogram of the class MHMcTriggerLvl2  
 
     MHMcTriggerLvl2 *htrig = (MHMcTriggerLvl2 *)parlist.FindObject("MHMcTriggerLvl2");
-    TH1F *h1 = htrig->GetHistByName("fHistPseudoSize");
-    TH2D *h2 = htrig->GetHistPseudoSizeEnergy();
-
-    // h2->DrawClone();
+    TH1F *h1 = (TH1F *)htrig->GetHistByName("fHistPseudoSize");
+    TH2D *h2 = htrig->GetHistSizeBiggerCellEnergy();
+    TH2D *h3 = (TH2D *)htrig->GetHistByName("fHistLutPseudoSizeEnergy");
+    //csbce = new TCanvas();
+    //h2->DrawClone();
 
     hfile = new TFile("HistFileLUT.root", "RECREATE");
     h1->Write();
     h2->Write();
+    h3->Write();
     hfile->Close();
 
Index: trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.cc
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.cc	(revision 2369)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.cc	(revision 2370)
@@ -61,4 +61,7 @@
 Int_t MHMcTriggerLvl2::fColorPs = 1;
 Int_t MHMcTriggerLvl2::fColorPsE = 1;
+Int_t MHMcTriggerLvl2::fColorLPsE = 1;
+Int_t MHMcTriggerLvl2::fColorSBCE = 1;
+
 
 ClassImp(MHMcTriggerLvl2);
@@ -106,4 +109,6 @@
 
     fHistPseudoSizeEnergy = new TH2D("fHistPseudoSizeEnergy","Ps Size vs Energy", 40, 1, 5, 397, 0,397);
+    fHistLutPseudoSizeEnergy = new TH2D("fHistLutPseudoSizeEnergy","Ps Size vs Energy", 40, 1, 5, 397, 0,397);
+    fHistSizeBiggerCellEnergy = new TH2D("fHistSizeBiggerCellEnergy","Ps Size vs Energy", 40, 1, 5, 397, 0,397);
  
     fHistPseudoSizeEnergy->SetName("fHistPseudoSizeEnergy");
@@ -112,4 +117,17 @@
     fHistPseudoSizeEnergy->SetYTitle("PseudoSize");
 
+    fHistLutPseudoSizeEnergy->SetName("fHistLutPseudoSizeEnergy");
+    fHistLutPseudoSizeEnergy->SetTitle("LutPseudoSize vs. Energy");
+    fHistLutPseudoSizeEnergy->SetXTitle("Log(E[GeV])");
+    fHistLutPseudoSizeEnergy->SetYTitle("LutPseudoSize");
+
+    fHistSizeBiggerCellEnergy->SetName("fHistSizeBiggerCellEnergy");
+    fHistSizeBiggerCellEnergy->SetTitle("Size Bigger Cell vs. Energy");
+    fHistSizeBiggerCellEnergy->SetXTitle("Log(E[GeV])");
+    fHistSizeBiggerCellEnergy->SetYTitle("Size Bigger Cell");
+
+		
+
+		
     fFNorm = new TF1("FNorm", "1", -1, 397);
 }
@@ -128,5 +146,6 @@
     delete fHistSizeBiggerCellNorm;
     delete fHistPseudoSizeEnergy;
-
+    delete fHistLutPseudoSizeEnergy;
+    delete fHistSizeBiggerCellEnergy;
     delete fFNorm;
 }
@@ -145,6 +164,7 @@
   fHistPseudoSize->Fill(h.GetPseudoSize());
   fHistSizeBiggerCell->Fill(h.GetSizeBiggerCell());
-  //fHistPseudoSizeEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetPseudoSize());
-  fHistPseudoSizeEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetLutPseudoSize());
+  fHistPseudoSizeEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetPseudoSize());
+  fHistLutPseudoSizeEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetLutPseudoSize());
+  fHistSizeBiggerCellEnergy->Fill(TMath::Log10(h.GetEnergy()), h.GetSizeBiggerCell());
 
   return kTRUE;
@@ -221,4 +241,8 @@
 //      "sbc" for the fSizeBiggerCell histogram;
 //      "ps" for the fPseudoSize histogram;
+//      "lut-energy" for the fLutPseudoSize vs. energy 2D histogram
+//      "size-energy" for the fPseudoSize vs. energy 2D histogram
+//      "big-energy" for the fSizeBiggerCell vs. energy 2D histogram
+//      
 //      default: "ps"
 //
@@ -233,7 +257,9 @@
         !str.Contains("sbc", TString::kIgnoreCase) &&
         !str.Contains("ps",  TString::kIgnoreCase) &&
-        !str.Contains("energy",  TString::kIgnoreCase))
+        !str.Contains("lut-energy",  TString::kIgnoreCase) &&
+	!str.Contains("size-energy",  TString::kIgnoreCase) &&
+	!str.Contains("big-energy",  TString::kIgnoreCase))
     {
-        *fLog << "ARGH!@! Possible options are \"lps\", \"sbc\", \"ps\" or NULL!" <<endl;
+        *fLog << "ARGH!@! Possible options are \"lps\", \"sbc\", \"ps\", \"lut-energy\", \"size-energy\", \"big-energy\" or NULL!" <<endl;
         return NULL;
     }
@@ -254,6 +280,13 @@
     }
 
-    if (str.Contains("energy",TString::kIgnoreCase))
+    if (str.Contains("size-energy",TString::kIgnoreCase))
       return Draw2DHist(*fHistPseudoSizeEnergy, "CanvasPSE", fColorPsE);
+
+    if (str.Contains("lut-energy",TString::kIgnoreCase))
+      return Draw2DHist(*fHistLutPseudoSizeEnergy, "CanvasLPSE", fColorLPsE);
+
+    if (str.Contains("big-energy",TString::kIgnoreCase))
+      return Draw2DHist(*fHistSizeBiggerCellEnergy, "CanvasSBCE", fColorSBCE);
+    
 
     return NULL;
@@ -293,7 +326,8 @@
 // --------------------------------------------------------------------------
 //
-//  Return the histogram by its name
-//
-TH1 *MHMcTriggerLvl2::GetHistByName(const TString name)
+//  Return the histogram by its name. This method returns a (TObject *)
+//  so remember to cast the returned object if you want to work with it.
+//
+TObject *MHMcTriggerLvl2::GetHistByName(const TString name) const
 {
     if (name.Contains("fHistLutPseudoSize", TString::kIgnoreCase))
@@ -311,4 +345,11 @@
         return fHistPseudoSizeNorm;
 
+    if (name.Contains("fHistLutPseudoSizeEnergy", TString::kIgnoreCase))
+	return fHistLutPseudoSizeEnergy;
+    if (name.Contains("fHistSizeBiggerCellEnergy", TString::kIgnoreCase))
+        return fHistSizeBiggerCellEnergy;
+    if (name.Contains("fHistPseudoSizeEnergy", TString::kIgnoreCase))
+        return fHistPseudoSizeEnergy;
+	    
     return NULL;
 }
Index: trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.h
===================================================================
--- trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.h	(revision 2369)
+++ trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.h	(revision 2370)
@@ -21,5 +21,7 @@
     TH1F *fHistSizeBiggerCell;       // Histogram of fSizeBiggerCell
     TH1F *fHistSizeBiggerCellNorm;   // Histogram of fSizeBiggerCell normalized on integral of distribution
-    TH2D *fHistPseudoSizeEnergy;           // 2D-Histogram of fPseudoSize vs. Energy
+    TH2D *fHistPseudoSizeEnergy;     // 2D-Histogram of fPseudoSize vs. Energy
+    TH2D *fHistLutPseudoSizeEnergy;  // 2D-Histogram of fLutPseudoSize vs. Energy
+    TH2D *fHistSizeBiggerCellEnergy; // 2D-Histogram of fSizeBiggerCell vs. Energy
     TF1* fFNorm;                     // Function used to normalize histograms
 
@@ -28,4 +30,7 @@
     static Int_t fColorPs;
     static Int_t fColorPsE;
+    static Int_t fColorLPsE;
+    static Int_t fColorSBCE;
+    
 
     TObject *DrawHist(TH1 &hist, TH1 &histNorm, const TString &canvasname, Int_t &colore) const;
@@ -37,6 +42,6 @@
 
     Bool_t Fill(const MParContainer *par, const Stat_t w=1);
-    //    Bool_t Fill(const Double_t energy, const MParContainer *par, const Stat_t w=1);
-    TH1 *GetHistByName(const TString name);
+
+    TObject *GetHistByName(const TString name) const;
 
     TH1F *GetHistLutPseudoSize() const { return fHistLutPseudoSize; }
@@ -46,5 +51,8 @@
     TH1F *GetHistSizeBiggerCell()  const { return fHistSizeBiggerCell; }
     TH1F *GetHistSizeBiggerCellNorm()  const { return fHistSizeBiggerCellNorm; }
+    TH2D *GetHistLutPseudoSizeEnergy() const { return fHistLutPseudoSizeEnergy; }
     TH2D *GetHistPseudoSizeEnergy() const { return fHistPseudoSizeEnergy; }
+    TH2D *GetHistSizeBiggerCellEnergy() const { return fHistSizeBiggerCellEnergy; }
+    
 
     void Draw(Option_t *opt=NULL);
