PandaRoot
PndMvdAllDataEventAna.h
Go to the documentation of this file.
1 #ifndef PNDMVDALLDATAEVENTANA_H
2 #define PNDMVDALLDATAEVENTANA_H
3 
4 //
5 // C++ Interface: PndMvdMCEventAna
6 //
7 // Description:
8 //
9 //
10 // Author: t.stockmanns <stockman@ikp455>, (C) 2007
11 //
12 // Copyright: See COPYING file that comes with this distribution
13 //
14 //
15 
16 #include "PndMvdEventAna.h"
17 #include "PndSdsMCPoint.h"
18 #include "PndSdsDigiPixel.h"
19 #include "PndSdsHit.h"
20 #include "PndSdsCluster.h"
21 #include "PndSdsCalcFePixel.h"
22 #include "PndEventDisplay.h"
23 #include "TTree.h"
24 #include "TCanvas.h"
25 #include "TH1.h"
26 #include "TH2.h"
27 #include "TH3.h"
28 #include "TFile.h"
29 #include "TClonesArray.h"
30 #include "TVector3.h"
31 #include "TGeoNode.h"
32 
33 #include <vector>
34 
40  public:
42  PndMvdAllDataEventAna(TString fileName);
44 
45  virtual void Init(TString filename);
46  virtual void InitBranch();
47  virtual void InitHistos();
48  virtual void AnaHits();
49  virtual void BeginOfEventAction() { ClearAllVectors(); };
50  virtual void EndOfEventAction() { Create3DGeoHits(); };
51  virtual void ClearHistos();
52 
53  void PrintHitArray();
54  void PrintDigiArray();
55  void PrintClusterArray();
56  void PrintRecoArray();
57 
58  void FillHitHistos();
59  void FillDigiHistos();
60  void FillClusterHistos();
61  void FillRecoHistos();
64  void Fill3DHisto();
65  void FillHitProjHistos();
66 
67  void DrawHitHisto(TString detName, TCanvas *extCan = nullptr, Int_t pad = 0);
68  void DrawDigiHisto(TString detName, TCanvas *extCan = nullptr, Int_t pad = 0);
69  void DrawClusterHisto(TString detName, TCanvas *extCan = nullptr, Int_t pad = 0);
70  void DrawRecoHisto(TString detName, TCanvas *extCan = nullptr, Int_t pad = 0);
71  void DrawAllHistos(TString detName, TCanvas *extCan = nullptr);
72  void DrawAllHistos(Int_t i, TCanvas *extCan = nullptr);
73  void Draw3D(TString opt = "", TCanvas *extCan = nullptr, Int_t pad = 0);
74  void DrawAllTracks(TCanvas *extCan = nullptr, Int_t pad = 0);
75  void DrawHitTracks(TCanvas *extCan = nullptr, Int_t pad = 0);
76  void DrawEvent(bool tracks = false, TCanvas *extCan = nullptr);
77  void DrawTopVolume(TCanvas *extCan = nullptr, Int_t pad = 0, const char *opt = "");
78  void DrawHisxy(TCanvas *extCan = nullptr, Int_t pad = 0);
79  void DrawHisrz(TCanvas *extCan = nullptr, Int_t pad = 0);
80  void DrawHistoVec(std::vector<TH1 *> *vec, TCanvas *extCan = nullptr, Int_t pad = 0) const;
81  void DrawHisto(TH1 *histo, TCanvas *extCan = nullptr, Int_t pad = 0) const;
82  void DrawHitPerCluster(TCanvas *extCan = nullptr, Int_t pad = 0) { DrawHisto(fAllHitPerClusterHistos, extCan, pad); };
83  void DrawResolution(TCanvas *extCan = nullptr, Int_t pad = 0) { DrawHisto(fAllHitResolutionHistos, extCan, pad); };
84 
85  void Create3DGeoHits();
86 
87  void ClearHistoMaps(std::map<TString, TH1 *> *myHistos) const;
88  void ClearAllHMaps();
89  void ClearHistoVector(std::vector<TH1 *> *myVectors) const;
90  void ClearAllVectors();
91 
92  TVector3 GetLocalHitPoints(TString detName, TVector3 input);
93  std::vector<Int_t> GetHitPerCluster(PndSdsCluster *clusterCand);
94  std::vector<TString> GetModulesHit();
95  TVector3 CalcMeanHitPos(std::vector<Int_t> points);
96 
97  protected:
98  TClonesArray *fDigiArray;
99  TClonesArray *fClusterArray;
100  TClonesArray *fRecoArray;
101  TClonesArray *fGeoTrackArray;
102  TClonesArray *fTrackFArray;
103 
104  private:
105  std::map<TString, TH1 *> fDigiHistos;
106  std::map<TString, TH1 *> fClusterHistos;
107  std::map<TString, TH1 *> fRecoHistos;
108  std::map<TString, TH1 *> fHitPerClusterHistos;
109  std::map<TString, TH1 *> fHitResolutionHistos;
110 
111  std::vector<TH1 *> fHitHistoVec;
112  std::vector<TH1 *> fDigiHistoVec;
113  std::vector<TH1 *> fClusterHistoVec;
114  std::vector<TH1 *> fRecoHistoVec;
115 
116  TGeoVolume *fMvdTopVolume;
117  TGeoVolume *fRecoTopVolume;
118  TGeoVolume *fRecoVolume;
119 
120  TH1 *fRecoErrorHisto;
121  TH1 *fAllHitPerClusterHistos;
122  TH1 *fAllHitResolutionHistos;
123  TH3D *f3DMCHisto;
124  TH3D *f3DRecoHisto;
125  std::vector<TH1 *> fSimHisxy;
126  std::vector<TH1 *> fSimHisrz;
127  std::vector<TH1 *> fRecoHisxy;
128  std::vector<TH1 *> fRecoHisrz;
129 
130  TCanvas *fCan1;
131  TCanvas *fCan2;
132 
133  PndSdsCalcFePixel *fPixelCon;
134  PndEventDisplay *fGeoList;
135 
136  ClassDef(PndMvdAllDataEventAna, 1);
137 };
138 
139 #endif
TVector3 CalcMeanHitPos(std::vector< Int_t > points)
void DrawHisrz(TCanvas *extCan=nullptr, Int_t pad=0)
void DrawHisxy(TCanvas *extCan=nullptr, Int_t pad=0)
void DrawTopVolume(TCanvas *extCan=nullptr, Int_t pad=0, const char *opt="")
Class to store the Digis which belong to one cluster This class holds the information which Digi belo...
Definition: PndSdsCluster.h:18
virtual void InitBranch()
void DrawAllHistos(TString detName, TCanvas *extCan=nullptr)
display of hits inside the gGeoManager
virtual void InitHistos()
unsigned int i
Definition: P4_F32vec4.h:21
void DrawHitPerCluster(TCanvas *extCan=nullptr, Int_t pad=0)
void DrawAllTracks(TCanvas *extCan=nullptr, Int_t pad=0)
virtual void ClearHistos()
TVector3 GetLocalHitPoints(TString detName, TVector3 input)
void DrawHisto(TH1 *histo, TCanvas *extCan=nullptr, Int_t pad=0) const
void Draw3D(TString opt="", TCanvas *extCan=nullptr, Int_t pad=0)
void DrawHitHisto(TString detName, TCanvas *extCan=nullptr, Int_t pad=0)
void DrawEvent(bool tracks=false, TCanvas *extCan=nullptr)
void ClearHistoVector(std::vector< TH1 *> *myVectors) const
void DrawClusterHisto(TString detName, TCanvas *extCan=nullptr, Int_t pad=0)
void DrawRecoHisto(TString detName, TCanvas *extCan=nullptr, Int_t pad=0)
void DrawDigiHisto(TString detName, TCanvas *extCan=nullptr, Int_t pad=0)
void DrawHistoVec(std::vector< TH1 *> *vec, TCanvas *extCan=nullptr, Int_t pad=0) const
std::vector< TString > GetModulesHit()
virtual void AnaHits()
void DrawResolution(TCanvas *extCan=nullptr, Int_t pad=0)
std::vector< Int_t > GetHitPerCluster(PndSdsCluster *clusterCand)
void DrawHitTracks(TCanvas *extCan=nullptr, Int_t pad=0)
Class to calculate the position of digis on a front-end from the digis on a sensor.
void ClearHistoMaps(std::map< TString, TH1 *> *myHistos) const
virtual void Init(TString filename)
virtual void BeginOfEventAction()