]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG1/AliComparisonDraw.cxx
Adding selector for producing standard histograms and views
[u/mrichter/AliRoot.git] / PWG1 / AliComparisonDraw.cxx
CommitLineData
06f2c0e2 1// The class definition in esdClus.h has been generated automatically
2// by the ROOT utility TTree::MakeSelector(). This class is derived
3// from the ROOT class TSelector. For more information on the TSelector
4// framework see $ROOTSYS/README/README.SELECTOR or the ROOT User Manual.
5
6// The following methods are defined in this file:
7// Begin(): called everytime a loop on the tree starts,
8// a convenient place to create your histograms.
9// SlaveBegin(): called after Begin(), when on PROOF called only on the
10// slave servers.
11// Process(): called for each event, in this function you decide what
12// to read and fill your histograms.
13// SlaveTerminate: called at the end of the loop on the tree, when on PROOF
14// called only on the slave servers.
15// Terminate(): called at the end of the loop on the tree,
16// a convenient place to draw/fit your histograms.
17//
18
19//
20// Comaprison draw
21// Comapre the MC information with the reconstructed
22//
23
24
25
26#include "TSystem.h"
27#include <TPDGCode.h>
28#include <TStyle.h>
29#include "TCint.h"
30#include "TH1I.h"
31#include "TTimeStamp.h"
32#include "TProof.h"
33#include "TTree.h"
34#include "TH2F.h"
35#include "TH1F.h"
36
37//
38#include "AliTracker.h"
39#include "AliMagF.h"
40//
41#include "AliESDEvent.h" // new container
42#include "AliESD.h"
43#include "AliESDtrack.h"
44#include "AliESDfriend.h"
45#include "AliESDfriendTrack.h"
46#include "AliTPCseed.h"
47#include "AliTPCclusterMI.h"
48//
49#include "AliComparisonDraw.h"
50
51
52ClassImp(AliComparisonDraw)
53
54
55
56AliComparisonDraw::AliComparisonDraw():
57 TObject(),
58 fPtResolLPT(0),
59 fPtResolHPT(0)
60{
61 InitHisto();
62}
63
64void AliComparisonDraw::InitHisto(){
65 //
66 //
67 //
68 fPtResolLPT = new TH2F("Pt resol","pt resol",10, 0.1,3,200,-0.2,0.2);
69 fPtResolHPT = new TH2F("Pt resol","pt resol",10, 2,100,200,-0.3,0.3);
70 //
71 fPtPoolLPT = new TH2F("Pt pool","pt pool",10, 0.1,3,200,-6,6);
72 fPtPoolHPT = new TH2F("Pt pool","pt pool",10, 2,100,200,-6,6);
73}
74
75void AliComparisonDraw::Process(AliMCInfo* infoMC, AliESDRecInfo *infoRC){
76 //
77 //
78 //
79 Float_t mcpt = infoMC->GetParticle().Pt();
80
81 //
82 //
83 if (infoRC->GetStatus(1)==0) return;
84 if (!infoRC->GetESDtrack()) return; //buggy line
85
86
87 if (infoRC->GetESDtrack()->GetTPCNcls()<10) return;
88
89 // printf("Pt\t%f\t%f\n",mcpt, infoRC->GetESDtrack()->Pt());
90
91 Float_t deltaPt= (mcpt-infoRC->GetESDtrack()->Pt())/mcpt;
92 Float_t poolPt= (1/mcpt-infoRC->GetESDtrack()->OneOverPt())/
93 TMath::Sqrt(infoRC->GetESDtrack()->GetSigma1Pt2());
94 fPtResolLPT->Fill(mcpt,deltaPt);
95 fPtResolHPT->Fill(mcpt,deltaPt);
96 fPtPoolLPT->Fill(mcpt,poolPt);
97 fPtPoolHPT->Fill(mcpt,poolPt);
98
99}
100