Index: /trunk/interface/FuncDef.h
===================================================================
--- /trunk/interface/FuncDef.h	(revision 17)
+++ /trunk/interface/FuncDef.h	(revision 17)
@@ -0,0 +1,167 @@
+#ifndef __FuncDef__
+#define __FuncDef__
+
+#include "TStyle.h"
+#include "TCanvas.h"
+#include "TH1F.h"
+#include "TLegend.h"
+#include "TPad.h"
+#include "TTree.h"
+#include "TFile.h"
+#include "THStack.h"
+#include "TLine.h"
+#include "TArrow.h"
+#include "TMarker.h"
+#include "TStyle.h"
+#include "TROOT.h"
+
+#include <iomanip>
+#include <vector>
+#include <iostream>
+#include <string>
+#include "TPaveText.h"
+#include "TProfile.h"
+#include "TF1.h"
+#include "TGraph.h"
+#include "TGraphErrors.h"
+
+#include "interface/TdrStyle.h"
+
+using namespace std;
+
+TPaveText * MakeTPave(Float_t xmin,Float_t ymin,Float_t xmax,Float_t ymax,string text)
+{
+
+ TPaveText *leg1 = new TPaveText(xmin,ymin,xmax,ymax,"NDC");
+ leg1->AddText(text.c_str());
+ leg1->SetFillColor(10);
+ leg1->SetBorderSize(0);
+ leg1->SetTextFont(42);
+ leg1->SetTextSize(0.03791469);
+ return leg1;
+
+
+}
+
+
+TLegend * MakeLegend(Int_t FilledColor,Int_t BorderSize,Float_t TextSize,Double_t x1 = 0.60, Double_t y1 = 0.71, Double_t x2= 0.92, Double_t y2 = 0.92)
+{
+  TLegend *leg = new TLegend(x1,y1,x2,y2,NULL,"NDC");
+  leg->SetFillColor(FilledColor);
+  leg->SetBorderSize(BorderSize);
+  leg->SetTextSize(TextSize);
+  leg->SetTextFont(42);
+
+  return leg;
+}
+
+TH1F * MakeNormTH1F(Int_t numBin,Float_t minX,Float_t maxX, TTree * Analyze,string histo, Int_t Lcolor, Int_t Fcolor, Int_t Lstyle,Int_t width=2,bool Log=false)
+{
+  string temp = histo;
+  string nom = histo.erase(0,histo.find(">>")+2);
+  TH1F *h = new TH1F(nom.c_str(),"pt_lept ",numBin,minX,maxX);
+  //Analyze->Draw(temp.c_str(),"(JetPTResol.NonSmearePT >0 && JetPTResol.NonSmearePT < 20)");
+  Analyze->Draw(temp.c_str());
+  h->SetLineColor(Lcolor);
+  h->SetFillColor(Fcolor);
+  h->SetLineStyle(Lstyle);  
+  h->SetLineWidth(width); 
+  if(Log)gPad->SetLogy();
+  if(h->Integral()!=0)h->Scale(1./h->Integral());
+  return h;
+}
+
+void GaussValues(TTree * Analyze,string histo,double &rms, double &mean, string min, string max)
+{
+  string temp = histo;
+  string mintemp = min;
+  string maxtemp = max;
+
+  string nom = histo.erase(0,histo.find(">>")+2);
+  TH1F *h = new TH1F(nom.c_str(),"",50,0.5,1.5);
+  Analyze->Draw(temp.c_str(),mintemp.c_str(),maxtemp.c_str());
+  h->SetMarkerSize(0.6);
+  TF1 *Gauss = new TF1("Gauss","gausn",0.8,1.3);
+  h->Fit("Gauss","R");
+  h->Fit("Gauss","RI");
+  h->Fit("Gauss","RI");
+  Double_t* params = Gauss->GetParameters();
+  rms=params[2];
+  mean=params[1];
+  h->Draw("P");
+  h->GetXaxis()->SetTitle("E_{T}^{rec}/E_{T}^{MC} [GeV]");
+}
+
+
+TH1F * HiggsMakeNormTH1F(Float_t Scale, Int_t numBin,Float_t minX,Float_t maxX, TTree * Analyze,string histo, Int_t Lcolor, Int_t Fcolor, Int_t Lstyle,Int_t width=2,bool Log=false)
+{
+  string temp = histo;
+  string nom = histo.erase(0,histo.find(">>")+2);
+  TH1F *h = new TH1F(nom.c_str(),"pt_lept ",numBin,minX,maxX);
+  Analyze->Draw(temp.c_str());
+  h->SetLineColor(Lcolor);
+  h->SetFillColor(Fcolor);
+  h->SetLineStyle(Lstyle);
+  h->SetLineWidth(width);
+  if(Log)gPad->SetLogy();
+  if(h->Integral()!=0)h->Scale(1*Scale);
+  return h;
+}
+
+
+TH1F * MakeNormTH1FSum(Int_t numBin,Float_t minX,Float_t maxX,TTree * analyze1,TTree * analyze2,TTree * analyze3,
+string * histo,float * weight, Int_t Lcolor, Int_t Fcolor, Int_t Lstyle,Int_t width=2,bool Log=false)
+{
+
+  TTree *analyse[3]={analyze1,analyze2,analyze3};
+  TH1F *hq = new TH1F("hq","pt_lept ",numBin,minX,maxX);
+
+  for(unsigned int i=0; i<3; i++) 
+     {
+       string temp = histo[i];
+       string nom = histo[i].erase(0,histo[i].find(">>")+2);
+       TH1F *h = new TH1F(nom.c_str(),"pt_lept ",numBin,minX,maxX);
+       analyse[i]->Draw(temp.c_str());
+       h->Scale(weight[i]);
+       hq->Add(h);
+     }
+
+  hq->SetLineColor(Lcolor);
+  hq->SetFillColor(Fcolor);
+  hq->SetLineStyle(Lstyle);
+  hq->SetLineWidth(width);
+  if(Log)gPad->SetLogy();
+  if(hq->Integral()!=0)hq->Scale(1./hq->Integral());
+
+  return hq;
+}
+
+TH1F * HiggsMakeNormTH1FSum(Int_t numBin,Float_t minX,Float_t maxX,TTree * analyze1,TTree * analyze2,TTree * analyze3,
+string * histo,float * weight, Int_t Lcolor, Int_t Fcolor, Int_t Lstyle,Int_t width=2,bool Log=false)
+{
+
+  TTree *analyse[3]={analyze1,analyze2,analyze3};
+  TH1F *hq = new TH1F("hq","pt_lept ",numBin,minX,maxX);
+
+  for(unsigned int i=0; i<3; i++)
+     {
+       string temp = histo[i];
+       string nom = histo[i].erase(0,histo[i].find(">>")+2);
+       TH1F *h = new TH1F(nom.c_str(),"pt_lept ",numBin,minX,maxX);
+       analyse[i]->Draw(temp.c_str());
+       h->Scale(weight[i]);
+       hq->Add(h);
+     }
+
+  hq->SetLineColor(Lcolor);
+  hq->SetFillColor(Fcolor);
+  hq->SetLineStyle(Lstyle);
+  hq->SetLineWidth(width);
+  if(Log)gPad->SetLogy();
+  if(hq->Integral()!=0)hq->Scale(1./hq->Integral());
+
+  return hq;
+}
+
+
+#endif
Index: /trunk/interface/TreeClasses.h
===================================================================
--- /trunk/interface/TreeClasses.h	(revision 17)
+++ /trunk/interface/TreeClasses.h	(revision 17)
@@ -0,0 +1,392 @@
+#ifndef TreeClasses_h
+#define TreeClasses_h
+
+#include "TObject.h"
+#include "Utilities/ExRootAnalysis/interface/BlockCompare.h"
+#include "Utilities/ExRootAnalysis/interface/BlockClasses.h"
+
+// Tree for h_bb.cc
+
+//------------------------------------------------------------------------------
+
+class RESOLJET : public TSortableObject
+{
+public:
+Float_t SmearePT;
+Float_t NonSmearePT;
+
+  static TCompare *fgCompare; //!
+  const TCompare *GetCompare() const { return fgCompare; }
+
+
+ ClassDef(RESOLJET,1)
+
+};
+
+
+//------------------------------------------------------------------------------
+
+class RESOLELEC : public TSortableObject
+{
+public:
+Float_t SmeareE;
+Float_t NonSmeareE;
+
+  static TCompare *fgCompare; //!
+  const TCompare *GetCompare() const { return fgCompare; }
+
+
+ ClassDef(RESOLELEC,1)
+
+};
+
+//------------------------------------------------------------------------------
+
+class RESOLMUON : public TSortableObject
+{
+public:
+Float_t OneoverSmearePT;
+Float_t OneoverNonSmearePT;
+
+  static TCompare *fgCompare; //!
+  const TCompare *GetCompare() const { return fgCompare; }
+
+
+ ClassDef(RESOLMUON,1)
+
+};
+
+//------------------------------------------------------------------------------
+
+class TAUHAD : public TSortableObject
+{
+public:
+Float_t EnergieCen;
+Float_t NumTrack;
+
+  static TCompare *fgCompare; //!
+  const TCompare *GetCompare() const { return fgCompare; }
+
+
+ ClassDef(TAUHAD,1)
+
+};
+
+class ETMIS : public TSortableObject
+{
+public:
+Float_t Et;
+Float_t EtSmeare;
+
+ static TCompare *fgCompare; //!
+  const TCompare *GetCompare() const { return fgCompare; }
+
+
+ ClassDef(ETMIS,1)
+
+};
+
+
+
+
+
+//qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
+
+//------------------------------------------------------------------------------
+
+class RECZ : public TObject
+{
+public:
+
+Float_t M;
+
+  ClassDef(RECZ,1)
+};
+
+//------------------------------------------------------------------------------
+
+class HWWT : public TObject
+{
+public:
+
+Float_t DeltaPhi;
+Float_t DeltaEta;
+Float_t M;
+  ClassDef(HWWT,1)
+};
+
+
+//------------------------------------------------------------------------------
+
+class RECW : public TObject
+{
+public:
+
+Float_t M;
+
+  ClassDef(RECW,1)
+};
+
+//------------------------------------------------------------------------------
+
+class RECH : public TObject
+{
+public:
+
+Float_t M;
+
+  ClassDef(RECH,1)
+};
+
+
+class TRACKOF : public TObject
+{
+public:
+
+Float_t SUM;
+Float_t NUM;
+
+
+  ClassDef(TRACKOF,1)
+};
+
+
+//------------------------------------------------------------------------------
+
+class TRACK : public TObject
+{
+public:
+
+Float_t SUM;
+Float_t NUM;
+
+
+  ClassDef(TRACK,1)
+};
+
+class TRACKhbb : public TObject
+{
+public:
+
+Float_t SUM;
+Float_t NUM;
+
+
+  ClassDef(TRACKhbb,1)
+};
+
+
+//------------------------------------------------------------------------------
+
+class PTMIS : public TObject
+{
+public:
+
+Float_t PT;
+
+  ClassDef(PTMIS,1)
+};
+
+
+//------------------------------------------------------------------------------
+
+class ASYM: public TObject
+{
+public:
+
+Float_t Val;
+
+  ClassDef(ASYM, 1)
+};
+
+//------------------------------------------------------------------------------
+
+class HFENERGY : public TObject
+{
+public:
+
+Float_t E;
+
+  ClassDef(HFENERGY,1)
+};
+
+//------------------------------------------------------------------------------
+
+class NUMLEPT : public TObject
+{
+public:
+
+Int_t Num;
+
+  ClassDef(NUMLEPT,1)
+};
+
+//------------------------------------------------------------------------------
+class LEPT1: public TObject
+{
+public:
+
+Float_t lept1PT;
+Float_t lept1ETA;
+
+  ClassDef(LEPT1, 1)
+};
+
+//------------------------------------------------------------------------------
+
+class LEPT2: public TObject
+{
+public:
+
+Float_t lept2PT;
+Float_t lept2ETA;
+
+  ClassDef(LEPT2, 1)
+};
+
+//------------------------------------------------------------------------------
+
+class LEPT3: public TObject
+{
+public:
+
+Float_t lept3PT;
+Float_t lept3ETA;
+
+  ClassDef(LEPT3, 1)
+};
+
+
+//------------------------------------------------------------------------------
+
+class NUMBJET: public TObject
+{
+public:
+
+Int_t Num;
+
+  ClassDef(NUMBJET,1)
+};
+
+//------------------------------------------------------------------------------
+
+class BJET1: public TObject
+{
+public:
+
+Float_t bjet1PT;
+Float_t bjet1ETA;
+
+  ClassDef(BJET1, 1)
+};
+
+//------------------------------------------------------------------------------
+
+class BJET2: public TObject
+{
+public:
+
+Float_t bjet2PT;
+Float_t bjet2ETA;
+
+  ClassDef(BJET2, 1)
+};
+//------------------------------------------------------------------------------
+
+class BJET3: public TObject
+{
+public:
+
+Float_t bjet3PT;
+Float_t bjet3ETA;
+
+  ClassDef(BJET3, 1)
+};
+
+//------------------------------------------------------------------------------
+
+class JET1: public TObject
+{
+public:
+
+Float_t jet1PT;
+Float_t jet1ETA;
+
+  ClassDef(JET1, 1)
+};
+
+//------------------------------------------------------------------------------
+
+class JET2: public TObject
+{
+public:
+
+Float_t jet2PT;
+Float_t jet2ETA;
+
+  ClassDef(JET2, 1)
+};
+
+//------------------------------------------------------------------------------
+
+class JET3: public TObject
+{
+public:
+
+Float_t jet3PT;
+Float_t jet3ETA;
+
+  ClassDef(JET3, 1)
+};
+
+//------------------------------------------------------------------------------
+
+class VSUM: public TObject
+{
+public:
+
+Float_t Scalar;
+Float_t Vector;
+Float_t VectorEta;
+Float_t ScalarJet;
+
+  ClassDef(VSUM, 1)
+};
+
+
+//------------------------------------------------------------------------------
+
+class NUMJET : public TObject
+{
+public:
+
+Int_t Num;
+
+  ClassDef(NUMJET,1)
+};
+
+
+//------------------------------------------------------------------------------
+
+class TWOLEPTON : public TObject
+{
+public:
+
+Float_t INV;
+Float_t PHISEP;
+
+ClassDef(TWOLEPTON,1)
+};
+
+
+class ETASEP : public TObject
+{
+public:
+
+Float_t Val;
+
+  ClassDef(ETASEP,1)
+};
+
+
+#endif /* TreeClasses_h */
Index: /trunk/src/TreeClasses.cc
===================================================================
--- /trunk/src/TreeClasses.cc	(revision 17)
+++ /trunk/src/TreeClasses.cc	(revision 17)
@@ -0,0 +1,8 @@
+#include "interface/TreeClasses.h"
+
+TCompare *RESOLJET::fgCompare =0;
+TCompare *RESOLELEC::fgCompare =0;
+TCompare *RESOLMUON::fgCompare =0;
+TCompare *TAUHAD::fgCompare =0;
+TCompare *ETMIS::fgCompare=0;
+
Index: /trunk/src/TreeClassesLinkDef.h
===================================================================
--- /trunk/src/TreeClassesLinkDef.h	(revision 17)
+++ /trunk/src/TreeClassesLinkDef.h	(revision 17)
@@ -0,0 +1,44 @@
+#include "interface/TreeClasses.h"
+
+
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class NUMLEPT;
+#pragma link C++ class LEPT1;
+#pragma link C++ class LEPT2;
+#pragma link C++ class LEPT3;
+#pragma link C++ class NUMBJET;
+#pragma link C++ class BJET1;
+#pragma link C++ class BJET2;
+#pragma link C++ class BJET3;
+#pragma link C++ class JET1;
+#pragma link C++ class JET2;
+#pragma link C++ class JET3;
+#pragma link C++ class RECW;
+#pragma link C++ class RECH;
+#pragma link C++ class RECZ;
+#pragma link C++ class HWWT;
+#pragma link C++ class VSUM;
+#pragma link C++ class NUMJET;
+#pragma link C++ class HFENERGY;
+#pragma link C++ class PTMIS;
+#pragma link C++ class TRACK;
+#pragma link C++ class TRACKhbb;
+#pragma link C++ class TRACKOF;
+#pragma link C++ class ASYM;
+#pragma link C++ class ETASEP;
+#pragma link C++ class TWOLEPTON;
+
+
+//$$$$$$$$$$$$$$$$$$
+#pragma link C++ class RESOLJET;
+#pragma link C++ class RESOLELEC;
+#pragma link C++ class RESOLMUON;
+#pragma link C++ class TAUHAD;
+#pragma link C++ class ETMIS;
+
+#endif
