From 06f2c0e26245b9ca52fcb6c00120d45d79990cd7 Mon Sep 17 00:00:00 2001 From: marian Date: Thu, 20 Sep 2007 15:47:17 +0000 Subject: [PATCH] Adding AliComparisonDraw (Marian) --- PWG1/AliComparisonDraw.cxx | 100 +++++++++++++++++++++++++++++++++++++ PWG1/AliComparisonDraw.h | 52 +++++++++++++++++++ PWG1/PWG1LinkDef.h | 1 + PWG1/libPWG1.pkg | 4 +- 4 files changed, 155 insertions(+), 2 deletions(-) create mode 100644 PWG1/AliComparisonDraw.cxx create mode 100644 PWG1/AliComparisonDraw.h diff --git a/PWG1/AliComparisonDraw.cxx b/PWG1/AliComparisonDraw.cxx new file mode 100644 index 00000000000..df0e11a1d5f --- /dev/null +++ b/PWG1/AliComparisonDraw.cxx @@ -0,0 +1,100 @@ +// The class definition in esdClus.h has been generated automatically +// by the ROOT utility TTree::MakeSelector(). This class is derived +// from the ROOT class TSelector. For more information on the TSelector +// framework see $ROOTSYS/README/README.SELECTOR or the ROOT User Manual. + +// The following methods are defined in this file: +// Begin(): called everytime a loop on the tree starts, +// a convenient place to create your histograms. +// SlaveBegin(): called after Begin(), when on PROOF called only on the +// slave servers. +// Process(): called for each event, in this function you decide what +// to read and fill your histograms. +// SlaveTerminate: called at the end of the loop on the tree, when on PROOF +// called only on the slave servers. +// Terminate(): called at the end of the loop on the tree, +// a convenient place to draw/fit your histograms. +// + +// +// Comaprison draw +// Comapre the MC information with the reconstructed +// + + + +#include "TSystem.h" +#include +#include +#include "TCint.h" +#include "TH1I.h" +#include "TTimeStamp.h" +#include "TProof.h" +#include "TTree.h" +#include "TH2F.h" +#include "TH1F.h" + +// +#include "AliTracker.h" +#include "AliMagF.h" +// +#include "AliESDEvent.h" // new container +#include "AliESD.h" +#include "AliESDtrack.h" +#include "AliESDfriend.h" +#include "AliESDfriendTrack.h" +#include "AliTPCseed.h" +#include "AliTPCclusterMI.h" +// +#include "AliComparisonDraw.h" + + +ClassImp(AliComparisonDraw) + + + +AliComparisonDraw::AliComparisonDraw(): + TObject(), + fPtResolLPT(0), + fPtResolHPT(0) +{ + InitHisto(); +} + +void AliComparisonDraw::InitHisto(){ + // + // + // + fPtResolLPT = new TH2F("Pt resol","pt resol",10, 0.1,3,200,-0.2,0.2); + fPtResolHPT = new TH2F("Pt resol","pt resol",10, 2,100,200,-0.3,0.3); + // + fPtPoolLPT = new TH2F("Pt pool","pt pool",10, 0.1,3,200,-6,6); + fPtPoolHPT = new TH2F("Pt pool","pt pool",10, 2,100,200,-6,6); +} + +void AliComparisonDraw::Process(AliMCInfo* infoMC, AliESDRecInfo *infoRC){ + // + // + // + Float_t mcpt = infoMC->GetParticle().Pt(); + + // + // + if (infoRC->GetStatus(1)==0) return; + if (!infoRC->GetESDtrack()) return; //buggy line + + + if (infoRC->GetESDtrack()->GetTPCNcls()<10) return; + + // printf("Pt\t%f\t%f\n",mcpt, infoRC->GetESDtrack()->Pt()); + + Float_t deltaPt= (mcpt-infoRC->GetESDtrack()->Pt())/mcpt; + Float_t poolPt= (1/mcpt-infoRC->GetESDtrack()->OneOverPt())/ + TMath::Sqrt(infoRC->GetESDtrack()->GetSigma1Pt2()); + fPtResolLPT->Fill(mcpt,deltaPt); + fPtResolHPT->Fill(mcpt,deltaPt); + fPtPoolLPT->Fill(mcpt,poolPt); + fPtPoolHPT->Fill(mcpt,poolPt); + +} + diff --git a/PWG1/AliComparisonDraw.h b/PWG1/AliComparisonDraw.h new file mode 100644 index 00000000000..97550d8f0a5 --- /dev/null +++ b/PWG1/AliComparisonDraw.h @@ -0,0 +1,52 @@ + +#ifndef AliComparisonDraw_h +#define AliComparisonDraw_h + +#include +#include +using namespace std; +#include + +#include +#include +#include +#include "AliGenInfo.h" +#include "AliRecInfo.h" + +class AliESDEvent; +class AliESD; +class AliESDfriend; +class TH1I; + + +class AliComparisonDraw : public TObject { +public : + AliComparisonDraw(); + virtual Bool_t IsFolder(){return kTRUE;} + void InitHisto(); + void Process(AliMCInfo* infoMC, AliESDRecInfo *infoRC); + //TH1F GetPtResol(Float_t pt0, Float_t pt1); +public: + TH2F* fPtResolLPT; // pt resolution - low pt + TH2F* fPtResolHPT; // pt resolution - high pt + TH2F* fPtPoolLPT; // pt resolution - low pt + TH2F* fPtPoolHPT; // pt resolution - high pt +protected: + ClassDef(AliComparisonDraw,1); +}; + + + + + + + + + + + + + + + +#endif diff --git a/PWG1/PWG1LinkDef.h b/PWG1/PWG1LinkDef.h index 408463d0099..9a5de5f46d9 100644 --- a/PWG1/PWG1LinkDef.h +++ b/PWG1/PWG1LinkDef.h @@ -17,5 +17,6 @@ #pragma link C++ class AliESDRecKinkInfo+; // #pragma link C++ class AliRecInfoMaker+; +#pragma link C++ class AliComparisonDraw+; #endif diff --git a/PWG1/libPWG1.pkg b/PWG1/libPWG1.pkg index eba2550fbb0..a2df0d9459a 100644 --- a/PWG1/libPWG1.pkg +++ b/PWG1/libPWG1.pkg @@ -1,8 +1,8 @@ SRCS:= AliTreeDraw.cxx \ AliGenInfo.cxx AliGenInfoMaker.cxx \ - AliRecInfo.cxx AliRecInfoMaker.cxx - + AliRecInfo.cxx AliRecInfoMaker.cxx \ + AliComparisonDraw.cxx HDRS:= $(SRCS:.cxx=.h) DHDR:= PWG1LinkDef.h -- 2.39.3