1 | // $Id: RecoTreePainter.hh 2703 2006-06-01 09:42:14Z pesce $ |
---|
2 | // Author: Dmitry.Naumov 2006/02/03 |
---|
3 | |
---|
4 | /***************************************************************************** |
---|
5 | * ESAF: Euso Simulation and Analysis Framework * |
---|
6 | * * |
---|
7 | * Id: RecoTreePainter * |
---|
8 | * Package: <packagename> * |
---|
9 | * Coordinator: <coordinator> * |
---|
10 | * * |
---|
11 | *****************************************************************************/ |
---|
12 | |
---|
13 | #ifndef __RECOTREEPAINTER_HH__ |
---|
14 | #define __RECOTREEPAINTER_HH__ |
---|
15 | |
---|
16 | #include "EsafMsgSource.hh" |
---|
17 | |
---|
18 | #include <TObject.h> |
---|
19 | #include <TCut.h> |
---|
20 | #include <TString.h> |
---|
21 | #include <TSystem.h> |
---|
22 | #include <Riostream.h> |
---|
23 | #include <map> |
---|
24 | |
---|
25 | using std::map; |
---|
26 | class TTree; |
---|
27 | class RecoRootEvent; |
---|
28 | class TH1; |
---|
29 | class TList; |
---|
30 | class TF1; |
---|
31 | class TCanvas; |
---|
32 | class TEventList; |
---|
33 | class EGViewer; |
---|
34 | //////////////////////////////////////////////////////////////////////////////// |
---|
35 | // // |
---|
36 | // RecoTreePainter // |
---|
37 | // // |
---|
38 | // <brief class description> // |
---|
39 | // // |
---|
40 | //////////////////////////////////////////////////////////////////////////////// |
---|
41 | |
---|
42 | class RecoTreePainter : public TObject, public EsafMsgSource { |
---|
43 | public: |
---|
44 | RecoTreePainter(TTree*); |
---|
45 | virtual ~RecoTreePainter(); |
---|
46 | void Loop(); |
---|
47 | void DrawAll(); |
---|
48 | //void DrawDirection(); |
---|
49 | void DrawTheta(); |
---|
50 | void DrawPhi(); |
---|
51 | void DrawEnergy(); |
---|
52 | void SaveAsPs( Option_t* ="A", const char* prefix = ""); |
---|
53 | TH1* GetHisto(const char *name, const char *title, Option_t *opt, Int_t, Float_t, Float_t, Int_t, Float_t, Float_t); |
---|
54 | void SetFileName(TString f) { fFilename = f; } |
---|
55 | inline void SetEnergyIndependentFromDir(Bool_t b=kTRUE) { fEnergyIndependentFromDir = b;} |
---|
56 | inline void SetUseAA1(Bool_t b=kTRUE) { fUseAA1 = b; } |
---|
57 | inline void SaveEpsFiles(TString t); |
---|
58 | |
---|
59 | const char* GetCut() const { return fCut.GetTitle(); } |
---|
60 | void SetCut( const char* cut ) { fCut = cut; } |
---|
61 | void SetCut( const TCut& cut ) { fCut = cut; } |
---|
62 | Long64_t UpdateEventList(); |
---|
63 | Long64_t UpdateEventList( const char* selection ); |
---|
64 | Long64_t GetEntry( Int_t i=0 ); |
---|
65 | TTree* GetTree() { return fTree; } |
---|
66 | private: |
---|
67 | void FillHistos(); |
---|
68 | void SaveHistos(); |
---|
69 | void FillSimHistos(); |
---|
70 | void FillThetaHistos(); |
---|
71 | void FillPhiHistos(); |
---|
72 | void FillDirectionHistos(); |
---|
73 | void FillEnergyHistos(); |
---|
74 | void FillAngularResolutions(); |
---|
75 | void MakeBaseDataMap(); |
---|
76 | Bool_t AcceptDirection(); |
---|
77 | Bool_t AcceptEnergy(); |
---|
78 | |
---|
79 | // if true, in the energy plots accept also |
---|
80 | // the events rejected from the direction module |
---|
81 | Bool_t fEnergyIndependentFromDir; |
---|
82 | |
---|
83 | TTree *fTree; |
---|
84 | RecoRootEvent *fEvent; |
---|
85 | TEventList *fEventList; |
---|
86 | TCut fCut; |
---|
87 | Int_t fNevents; |
---|
88 | TList *fHistoList; |
---|
89 | EGViewer *fEnergyViewer; |
---|
90 | EGViewer *fThetaViewer; |
---|
91 | EGViewer *fPhiViewer; |
---|
92 | map <string,Float_t> fRec; |
---|
93 | map <string,Float_t> fSim; |
---|
94 | map <string,Float_t> left_edge; |
---|
95 | map <string,Float_t> right_edge; |
---|
96 | map <string,Bool_t> fCuts; |
---|
97 | map <string,Bool_t> fEnergyCuts; |
---|
98 | TString fFilename; |
---|
99 | Bool_t fSaveEpsFiles; |
---|
100 | Bool_t fUseAA1; // use the AA1 method track direction data |
---|
101 | TString fEpsDir; |
---|
102 | |
---|
103 | ClassDef(RecoTreePainter,0) |
---|
104 | }; |
---|
105 | inline void RecoTreePainter::SaveEpsFiles(TString t) { |
---|
106 | // |
---|
107 | // |
---|
108 | // |
---|
109 | fSaveEpsFiles = kTRUE; |
---|
110 | fEpsDir = t; |
---|
111 | gSystem->mkdir(t,kTRUE); |
---|
112 | } |
---|
113 | |
---|
114 | #endif /* __RECOTREEPAINTER_HH__ */ |
---|
115 | |
---|