Adding AliComparisonDraw (Marian)
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 20 Sep 2007 15:47:17 +0000 (15:47 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 20 Sep 2007 15:47:17 +0000 (15:47 +0000)
PWG1/AliComparisonDraw.cxx [new file with mode: 0644]
PWG1/AliComparisonDraw.h [new file with mode: 0644]
PWG1/PWG1LinkDef.h
PWG1/libPWG1.pkg

diff --git a/PWG1/AliComparisonDraw.cxx b/PWG1/AliComparisonDraw.cxx
new file mode 100644 (file)
index 0000000..df0e11a
--- /dev/null
@@ -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 <TPDGCode.h>
+#include <TStyle.h>
+#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 (file)
index 0000000..97550d8
--- /dev/null
@@ -0,0 +1,52 @@
+
+#ifndef AliComparisonDraw_h
+#define AliComparisonDraw_h
+
+#include <iostream>
+#include <fstream>
+using namespace std;
+#include <TSelector.h>
+
+#include <TROOT.h>
+#include <TChain.h>
+#include <TFile.h>
+#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
index 408463d..9a5de5f 100644 (file)
@@ -17,5 +17,6 @@
 #pragma link C++ class AliESDRecKinkInfo+;
 //
 #pragma link C++ class AliRecInfoMaker+;
+#pragma link C++ class AliComparisonDraw+;
 
 #endif
index eba2550..a2df0d9 100644 (file)
@@ -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