Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 1919)
+++ trunk/MagicSoft/Mars/Changelog	(revision 1920)
@@ -1,3 +1,21 @@
                                                  -*-*- END OF LINE -*-*-
+
+ 2003/04/08: Nicola Galante and Antonio Stamerra
+
+   * mhist/MHMcTriggerLvl2.[h,cc]
+      - New class added (histograms for the MMcTriggerLvl2 class)
+
+   * mhist/Makefile
+     - Added MHMcTrigggerLvl2 in SRCFILES
+
+   * manalysis/Makefile
+     - Reintroduced MMcTriggerLvl2 and MMcTriggerLvl2Calc 
+       (they were removed!!)
+
+   * manalysis/MMcTriggerLvl2.h
+     - 'const' added in inline functions Get****
+
+   * manalysis/MMcTriggerLvl2Calc.cc
+     - added call to Fill method of MHMcTriggerLvl2
 
 
Index: trunk/MagicSoft/Mars/macros/dohtml.C
===================================================================
--- trunk/MagicSoft/Mars/macros/dohtml.C	(revision 1919)
+++ trunk/MagicSoft/Mars/macros/dohtml.C	(revision 1920)
@@ -80,3 +80,4 @@
     html.Convert("starplot.C",      "MARS - Plots data from a STAR-file into a mars histogram");
     html.Convert("testenv.C",       "MARS - Example to use TEnv and Mars Eventloops");
+    html.Convert("triglvl2.C",       "MARS - Example to use MMcTriggerLvl2 class, using filters and creating histograms");
 }
Index: trunk/MagicSoft/Mars/macros/triglvl2.C
===================================================================
--- trunk/MagicSoft/Mars/macros/triglvl2.C	(revision 1919)
+++ trunk/MagicSoft/Mars/macros/triglvl2.C	(revision 1920)
@@ -2,5 +2,6 @@
 //  Macro to use the class MMcTriggerLvl2, which calculates the 
 //   2nd level trigger (L2T) selection parameters.
-//  Filters to select events using these parameter are also created.
+//  Filters to select events using these parameter and 
+//  histograms with selection variables distributions are also created.
 //
 //   Inputs:
@@ -22,5 +23,5 @@
     // An instance of the class MMcTriggerLvl2 is created and added to the 
     //  parameter list
-    MMcTriggerLvl2 cell;      
+    MMcTriggerLvl2 cell;     
     parlist.AddToList(&cell);
 
@@ -29,9 +30,11 @@
     cell.SetCompactNN(3);
     //  USER:       --^
+
     //
     //  A filter to select events using the L2T parameters is created
     //
-    //    MF lvl2filter("MMcTriggerLvl2.fLutPseudoSize > 6");
-    MF lvl2filter("MMcTriggerLvl2.fSizeBiggerCell > 16");
+    MF lvl2filter("MMcTriggerLvl2.fLutPseudoSize > 8");
+    // MF lvl2filter("MMcTriggerLvl2.fSizeBiggerCell > 16");
+
     //
     // A second filter is created using the class MFTriggerLvl2
@@ -43,5 +46,5 @@
     // A selection on the number and energy of the events 
     //
-    MF energyfilter("MMcEvt.fEnergy > 10");
+    MF energyfilter("MMcEvt.fEnergy > 100");
     MFEventSelector selector;
     selector.SetNumSelectEvts(4000);
@@ -69,23 +72,24 @@
 
     //
+    //  Task to calculate and plot the effective area
+    //
+    MMcCollectionAreaCalc effi;
+    tasklist.AddToList(&effi);
+
+    //
+    // The filter list selects events for the effective area calculation
+    //
+    effi.SetFilter(&flist);
+ 
+    //
+    // The filter list is added to the task list
+    //
+    tasklist.AddToList(&flist);
+
+    //
     // The task to calculate the L2T parameter is added to the task list
     //
     MMcTriggerLvl2Calc fill("MMcTriggerLvl2","MMcTriggerLvl2");  
     tasklist.AddToList(&fill);
-
-    //
-    //  Task to calculate and plot the effective area
-    //
-    MMcCollectionAreaCalc effi;
-    tasklist.AddToList(&effi);
-    //
-    // The filter list selects events for the effective area calculation
-    //
-    effi.SetFilter(&flist);
-
-    //
-    // The filter list is added to the task list
-    //
-    tasklist.AddToList(&flist);
 
     //
@@ -101,11 +105,9 @@
     magic.SetProgressBar(&bar);
 
-    if (!magic.PreProcess())
-      return;
-
     if (!magic.Eventloop())
       return;
 
     tasklist.PrintStatistics();
+ 
     //
     // Now the histogram we wanted to get out of the data is
@@ -114,5 +116,11 @@
     parlist.FindObject("MHMcCollectionArea")->DrawClone();
 
-    magic.PostProcess();
+    parlist.FindObject("MHMcTriggerLvl2")->DrawClone("lps");
+    parlist.FindObject("MHMcTriggerLvl2")->DrawClone();
 
+    // Returns histogram of the class MHMcTriggerLvl2  
+    //parlist.FindObject("MHMcTriggerLvl2")->GetHistByName("hfPseudoSize");
+ 
+    
+    
 }
Index: trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h	(revision 1919)
+++ trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h	(revision 1920)
@@ -62,4 +62,7 @@
 #pragma link C++ class MParameterD+;
 
+#pragma link C++ class MMcTriggerLvl2+;
+#pragma link C++ class MMcTriggerLvl2Calc+;
+
 #pragma link C++ class MCT1SupercutsCalc+;
 
Index: trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2.cc	(revision 1919)
+++ trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2.cc	(revision 1920)
@@ -254,5 +254,4 @@
   fSizeBiggerCell = GetCellNumberFired(CalcBiggerFiredCell());
  
-
 }
 
Index: trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2.h	(revision 1919)
+++ trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2.h	(revision 1920)
@@ -51,8 +51,8 @@
   void SetCompactNN(Int_t neighpix)     {fCompactNN=neighpix;}
 
-  Int_t GetPseudoSize()     {return fPseudoSize;}
-  Int_t GetLutPseudoSize()  {return fLutPseudoSize;}
-  Int_t GetSizeBiggerCell() {return fSizeBiggerCell;}
-  Int_t GetCompactNN()      {return fCompactNN;}
+  Int_t GetPseudoSize()     const {return fPseudoSize;}
+  Int_t GetLutPseudoSize()  const {return fLutPseudoSize;}
+  Int_t GetSizeBiggerCell() const {return fSizeBiggerCell;}
+  Int_t GetCompactNN()      const {return fCompactNN;}
 
   Int_t GetCellNumberFired(int cell);
Index: trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.cc	(revision 1919)
+++ trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.cc	(revision 1920)
@@ -37,5 +37,5 @@
 #include "MMcTriggerLvl2Calc.h"
 #include "MMcTriggerLvl2.h"
-
+#include "MHMcTriggerLvl2.h"
 
 #include "MParList.h"
@@ -47,5 +47,4 @@
 #include "MMcRunHeader.hxx"
 
-#include <TH1.h>
 
 ClassImp(MMcTriggerLvl2Calc);
@@ -61,10 +60,4 @@
   fTitle = title ? title : "Task to Fill the MMcTriggerLvl2 object";
   
-  //  AddToBranchList("MMcEvt.fEnergy");
-  //AddToBranchList(Form("%s.fNumFirstLevel", "MMcTrig"));
-  //AddToBranchList(Form("%s.fPixelsFirst[73][4]", "MMcTrig"));
-
-
-  // h1 = new TH1F("h1","h1",30,0,30);
 } 
 
@@ -100,4 +93,11 @@
     }
 
+    fMHMcTriggerLvl2 = (MHMcTriggerLvl2*)pList->FindCreateObj("MHMcTriggerLvl2");
+    if (!fMHMcTriggerLvl2)
+    {
+        *fLog << err << dbginf << "MHMcTriggerLvl2 not found... exit." << endl;
+        return kFALSE;
+    }
+
     // Check if the variable fCompactNN has been correctly set;
     //  accepted values for fCompactNN are (up to now) 2 and 3.
@@ -125,12 +125,12 @@
 
   fMMcTriggerLvl2->SetLv1(fMcTrig);
+ 
   fMMcTriggerLvl2->Calc();
+
+  fMHMcTriggerLvl2->Fill(fMMcTriggerLvl2);
 
   //fMMcTriggerLvl2->DrawLv1();
   //fMMcTriggerLvl2->DrawCell(fMMcTriggerLvl2->GetBiggerFiredCell() );
   //fMMcTriggerLvl2->Print();
-
-  //      h1->Fill(fMMcTriggerLvl2->GetLutPseudoSize() );
-
 
   return kTRUE;
@@ -146,8 +146,4 @@
 { 
   
-  //   *fLog << inf << "Filling..." << endl;
- 
-  //    h1->Draw();
-      
     return kTRUE;
 }
Index: trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.h	(revision 1919)
+++ trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.h	(revision 1920)
@@ -12,4 +12,5 @@
 
 class MMcTriggerLvl2;
+class MHMcTriggerLvl2;
 
 class TH1F;
@@ -22,4 +23,5 @@
 
   MMcTriggerLvl2 *fMMcTriggerLvl2;
+  MHMcTriggerLvl2 *fMHMcTriggerLvl2;
     
  public:
Index: trunk/MagicSoft/Mars/manalysis/Makefile
===================================================================
--- trunk/MagicSoft/Mars/manalysis/Makefile	(revision 1919)
+++ trunk/MagicSoft/Mars/manalysis/Makefile	(revision 1920)
@@ -69,4 +69,6 @@
 	   MNewImageParCalc.cc \
            MParameters.cc \
+	   MMcTriggerLvl2.cc \
+	   MMcTriggerLvl2Calc.cc \
            MCT1SupercutsCalc.cc 
 
Index: trunk/MagicSoft/Mars/mhist/HistLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/HistLinkDef.h	(revision 1919)
+++ trunk/MagicSoft/Mars/mhist/HistLinkDef.h	(revision 1920)
@@ -57,4 +57,6 @@
 #pragma link C++ class MHMcCT1CollectionArea+;
 
+#pragma link C++ class MHMcTriggerLvl2+;
+
 #pragma link C++ class MHNewImagePar+;
 
Index: trunk/MagicSoft/Mars/mhist/MHMcTriggerLvl2.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHMcTriggerLvl2.cc	(revision 1920)
+++ trunk/MagicSoft/Mars/mhist/MHMcTriggerLvl2.cc	(revision 1920)
@@ -0,0 +1,291 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Nicola Galante 2003 <mailto:nicola.galante@pi.infn.it>
+!!
+!   Copyright: MAGIC Software Development, 2000-2002
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// MHMcTriggerLvl2
+//
+// This class contains histograms for the Trigger Level2 image parameters
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MHMcTriggerLvl2.h"
+
+#include <math.h>
+
+#include <TH1.h>
+#include <TF1.h>
+#include <TPad.h>
+#include <TStyle.h>
+#include <TCanvas.h>
+#include <TPaveLabel.h>
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MParList.h"
+
+#include "MMcTriggerLvl2.h"
+#include "MGeomCam.h"
+#include "MBinning.h"
+
+#ifndef COLOR_LINELPS
+#define COLOR_LINELPS Int_t colorlps = 1
+COLOR_LINELPS;
+#endif
+
+#ifndef COLOR_LINESBC
+#define COLOR_LINESBC Int_t colorsbc = 1
+COLOR_LINESBC;
+#endif
+
+#ifndef COLOR_LINEPS
+#define COLOR_LINEPS Int_t colorps = 1
+COLOR_LINEPS;
+#endif
+
+ClassImp(MHMcTriggerLvl2);
+
+// --------------------------------------------------------------------------
+//
+// Setup three histograms for fLutPseudoSize, fPseudoSize, fSizeBiggerCell
+//
+MHMcTriggerLvl2::MHMcTriggerLvl2(const char *name, const char *title)
+{
+    //
+    //   set the name and title of this object
+    //
+    fName  = name  ? name  : "MHMcTriggerLvl2";
+    fTitle = title ? title : "Trigger L2 image parameters";
+
+    hfLutPseudoSize  = new TH1F("hfLutPseudoSize",  "number of compact pixels in one lut",                13,   0, 12);
+    hfPseudoSize     = new TH1F("hfPseudoSize",   "Multiplicity of the cluster identified by the L2T",    13,   0, 12);
+    hfSizeBiggerCell  = new TH1F("hfSizeBiggerCell",   "Number of fired pixel in bigger cell",            37,   0, 36);
+
+    hfLutPseudoSizeNorm  = new TH1F("hfLutPseudoSizeNorm",  "Normalized Number of compact pixels in one lut",                13,   0, 12);
+    hfPseudoSizeNorm     = new TH1F("hfPseudoSizeNorm",   "Normalized Multiplicity of the cluster identified by the L2T",    13,   0, 12);
+    hfSizeBiggerCellNorm  = new TH1F("hfSizeBiggerCellNorm",   "Normalized Number of fired pixel in bigger cell",            37,   0, 36);
+
+    hfLutPseudoSize->SetDirectory(NULL);
+    hfLutPseudoSizeNorm->SetDirectory(NULL);
+    hfPseudoSize->SetDirectory(NULL);
+    hfPseudoSizeNorm->SetDirectory(NULL);
+    hfSizeBiggerCell->SetDirectory(NULL);
+    hfSizeBiggerCellNorm->SetDirectory(NULL);
+
+    hfLutPseudoSize->SetXTitle("Number of Pixels");
+    hfLutPseudoSizeNorm->SetXTitle("Number of Pixels");
+    hfPseudoSize->SetXTitle("Number of Pixels");
+    hfPseudoSizeNorm->SetXTitle("Number of Pixels");
+    hfSizeBiggerCell->SetXTitle("Number of Pixels");
+    hfSizeBiggerCellNorm->SetXTitle("Number of Pixels");
+
+    hfLutPseudoSize->SetYTitle("Counts");
+    hfLutPseudoSizeNorm->SetYTitle("Counts/Total Counts");
+    hfPseudoSize->SetYTitle("Counts");
+    hfPseudoSizeNorm->SetYTitle("Counts/Total Counts");
+    hfSizeBiggerCell->SetYTitle("Counts");
+    hfSizeBiggerCellNorm->SetYTitle("Counts/Total Counts");
+
+    f1 = new TF1("FNorm", "1", -1, 40);
+}
+
+// --------------------------------------------------------------------------
+//
+// Delete the histograms
+//
+MHMcTriggerLvl2::~MHMcTriggerLvl2()
+{
+    delete hfLutPseudoSize;
+    delete hfPseudoSize;
+    delete hfSizeBiggerCell;
+}
+
+// --------------------------------------------------------------------------
+//
+// Fill the histograms with data from a MMcTriggerLvl2-Container.
+// Be careful: Only call this with an object of type MMcTriggerLvl2
+//
+Bool_t MHMcTriggerLvl2::Fill(const MParContainer *par)
+{
+  const MMcTriggerLvl2 &h = *(MMcTriggerLvl2 *)par;
+ 
+  hfLutPseudoSize->Fill(h.GetLutPseudoSize());
+  hfPseudoSize->Fill(h.GetPseudoSize());
+  hfSizeBiggerCell->Fill(h.GetSizeBiggerCell());
+
+  return kTRUE;
+}
+
+
+// --------------------------------------------------------------------------
+//
+// This is the private function member which draw a clone of a histogram. 
+// This method is called by the DrawClone method.
+//
+TObject *MHMcTriggerLvl2::DrawHist(TH1 *hist, TH1 *histNorm, const char *canvasname, Int_t *colore) const
+{
+  ++(*colore);
+
+  if((gROOT->FindObject(canvasname) != NULL)){
+    hist->SetLineColor(*colore);
+    ((TCanvas *)gROOT->FindObject(canvasname))->cd(1);
+    hist->DrawCopy("same");
+    
+    ((TCanvas *)gROOT->FindObject(canvasname))->cd(2);
+    histNorm->SetLineColor(*colore);
+    histNorm->DrawCopy("same");
+    ((TCanvas *)gROOT->FindObject(canvasname))->cd(2);
+    return gROOT->FindObject(canvasname);
+  }
+  else{
+    TCanvas *c3 = MakeDefCanvas(canvasname,canvasname, 800, 610);
+    c3->Divide(2,1);
+    c3->cd(1);
+    hist->SetLineColor(*colore);
+    hist->DrawCopy();
+
+    c3->cd(2);
+    histNorm->SetLineColor(*colore);
+    histNorm->DrawCopy();
+
+    return c3;
+  }
+}
+ 
+
+// --------------------------------------------------------------------------
+//
+// Draw a clone of a data member histogram. So that the object can be deleted
+// and the histogram is still visible in the canvas.
+// The cloned object are deleted together with the canvas if the canvas is
+// destroyed. If you want to handle dostroying the canvas you can get a
+// pointer to it from this function
+// Possible options are:
+//      "lps" for the fLutPseudoSize histogram;
+//      "sbc" for the fSizeBiggerCell histogram;
+//      "ps" for the fPseudoSize histogram;
+//      default: "ps"
+//
+TObject *MHMcTriggerLvl2::DrawClone(Option_t *opt) const
+{
+  TString *def = new TString("ps");
+  TString str(opt);
+   
+  if(*opt == NULL) str = *def;  // Default option
+  
+  if (str.Contains("lps",TString::kIgnoreCase))
+    return this->DrawHist(hfLutPseudoSize,this->NormalizeHist(hfLutPseudoSizeNorm,hfLutPseudoSize),"CanvasLPS",&colorlps);
+  else if (str.Contains("sbc",TString::kIgnoreCase))
+    return this->DrawHist(hfSizeBiggerCell,this->NormalizeHist(hfSizeBiggerCellNorm,hfSizeBiggerCell),"CanvasSBC",&colorsbc);
+  else if (str.Contains("ps",TString::kIgnoreCase))
+    return this->DrawHist(hfPseudoSize,this->NormalizeHist(hfPseudoSizeNorm,hfPseudoSize),"CanvasPS",&colorps);
+  else{
+    *fLog << "ARGH!@! Possible options are \"lps\", \"sbc\", \"ps\" or NULL!" <<endl;
+    return NULL;
+  }
+
+}
+
+
+
+// --------------------------------------------------------------------------
+//
+// Creates a new canvas and draws the three histograms into it.
+// Be careful: The histograms belongs to this object and won't get deleted
+// together with the canvas.
+//
+void MHMcTriggerLvl2::Draw(Option_t *)
+{
+  MakeDefCanvas("c","L2T Parameters", 720, 810);
+  
+  TPad* pad1 = new TPad("pad1","Pad with fLutPseudoSize", 0.003, 0.7, 0.4, 0.997);
+  TPad* pad2 = new TPad("pad2","Pad with fSizeBiggerCell", 0.403, 0.7, 0.997, 0.997);
+  TPad* pad3 = new TPad("pad3","Pad with fPseudoSize", 0.003, 0.003, 0.997, 0.697);
+  pad1->Draw();
+  pad2->Draw();
+  pad3->Draw();
+  
+  pad1->cd();
+  hfLutPseudoSize->Draw();
+  
+  pad2->cd();
+  hfSizeBiggerCell->Draw();
+  
+  pad3->cd();
+  hfPseudoSize->Draw();
+}
+
+
+
+// --------------------------------------------------------------------------
+//
+//  Return the histogram by its name
+//
+TH1 *MHMcTriggerLvl2::GetHistByName(const TString name)
+{
+    if (name.Contains("hfLutPseudoSize", TString::kIgnoreCase))
+      return hfLutPseudoSize;
+    if (name.Contains("hfSizeBiggerCell", TString::kIgnoreCase))
+        return hfSizeBiggerCell;
+    if (name.Contains("hfPseudoSize", TString::kIgnoreCase))
+        return hfPseudoSize;
+
+    if (name.Contains("hfLutPseudoSizeNorm", TString::kIgnoreCase))
+      return hfLutPseudoSizeNorm;
+    if (name.Contains("hfSizeBiggerCellNorm", TString::kIgnoreCase))
+        return hfSizeBiggerCellNorm;
+    if (name.Contains("hfPseudoSizeNorm", TString::kIgnoreCase))
+        return hfPseudoSizeNorm;
+
+    return NULL;
+}
+
+
+
+// --------------------------------------------------------------------------
+//
+// Normalize the histogram on its integral, i.e.  normalize the
+// values of the histogram on the statistics. This method creates
+// a copy (histNorm) of the histogram to normalize (hist) and normalize
+// the copy (histNorm) on its integral. It returns histNorm.
+//
+TH1 *MHMcTriggerLvl2::NormalizeHist(TH1 *histNorm, TH1 *hist) const
+{
+  if (histNorm == hist){
+    *fLog << "ARGH!@! You cannot pass the same histogram into each argument!" << endl;
+    return NULL;
+  }
+
+  if ((hist == NULL) || (hist->Integral() == (Stat_t)0)){
+    *fLog << "ARGH!@! You are trying to normalize the histogram to 0!" << endl;
+    return NULL;
+  }
+  
+  histNorm->Reset("ICE");
+  histNorm->Add(hist, 1);
+  histNorm->Divide(f1, (Double_t)(hist->Integral()));
+
+  return histNorm;
+}
Index: trunk/MagicSoft/Mars/mhist/MHMcTriggerLvl2.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHMcTriggerLvl2.h	(revision 1920)
+++ trunk/MagicSoft/Mars/mhist/MHMcTriggerLvl2.h	(revision 1920)
@@ -0,0 +1,57 @@
+#ifndef MARS_MHMcTriggerLvl2
+#define MARS_MHMcTriggerLvl2
+
+#ifndef MARS_MH
+#include "MH.h"
+#endif
+
+class TH1F;
+class TF1;
+class MMcTriggerLvl2;
+
+class MHMcTriggerLvl2 : public MH
+{
+ public:
+ 
+
+private:
+
+    TH1F *hfLutPseudoSize;        // Histogram of fLutPseudoSize
+    TH1F *hfLutPseudoSizeNorm;    // Histogram of fLutPseudoSize normalized on integral of distribution
+    TH1F *hfPseudoSize;           // Histogram of fPseudoSize
+    TH1F *hfPseudoSizeNorm;       // Histogram of fPseudoSize normalized on integral of distribution
+    TH1F *hfSizeBiggerCell;       // Histogram of fSizeBiggerCell
+    TH1F *hfSizeBiggerCellNorm;   // Histogram of fSizeBiggerCell normalized on integral of distribution
+
+    TF1* f1;                      // Function used to normalize histograms
+    
+public:
+    MHMcTriggerLvl2(const char *name=NULL, const char *title=NULL);
+    ~MHMcTriggerLvl2();
+
+    Bool_t Fill(const MParContainer *par);
+
+    TH1 *GetHistByName(const TString name);
+
+    TH1F *GetHistfLutPseudoSize() const { return hfLutPseudoSize; }
+    TH1F *GetHistfLutPseudoSizeNorm() const { return hfLutPseudoSizeNorm; }
+    TH1F *GetHistfPseudoSize()  const { return hfPseudoSize; }
+    TH1F *GetHistfPseudoSizeNorm()  const { return hfPseudoSizeNorm; }
+    TH1F *GetHistfSizeBiggerCell()  const { return hfSizeBiggerCell; }
+    TH1F *GetHistfSizeBiggerCellNorm()  const { return hfSizeBiggerCellNorm; }
+
+    void Draw(Option_t *opt=NULL);
+    TObject *DrawClone(Option_t *opt=NULL) const;
+
+    TH1 *NormalizeHist(TH1 *histNorm, TH1 *hist) const;
+
+    ClassDef(MHMcTriggerLvl2, 1) // Container which holds histograms for the Trigger Level2 image parameters
+
+private:
+
+    TObject *DrawHist(TH1 *hist, TH1 *histNorm, const char *canvasname, Int_t *colore) const;
+
+};
+
+
+#endif
Index: trunk/MagicSoft/Mars/mhist/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mhist/Makefile	(revision 1919)
+++ trunk/MagicSoft/Mars/mhist/Makefile	(revision 1920)
@@ -71,5 +71,6 @@
 	   MHNewImagePar.cc \
 	   MHSigmaTheta.cc \
-	   MHMcCT1CollectionArea.cc
+	   MHMcCT1CollectionArea.cc \
+	   MHMcTriggerLvl2.cc
 
 SRCS    = $(SRCFILES)
