PandaRoot
PndMvdAllDataEventAna.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 #ifndef PNDMVDALLDATAEVENTANA_H
14 #define PNDMVDALLDATAEVENTANA_H
15 
16 //
17 // C++ Interface: PndMvdMCEventAna
18 //
19 // Description:
20 //
21 //
22 // Author: t.stockmanns <stockman@ikp455>, (C) 2007
23 //
24 // Copyright: See COPYING file that comes with this distribution
25 //
26 //
27 
28 #include "PndMvdEventAna.h"
29 #include "PndSdsMCPoint.h"
30 #include "PndSdsDigiPixel.h"
31 #include "PndSdsHit.h"
32 #include "PndSdsCluster.h"
33 #include "PndSdsCalcFePixel.h"
34 #include "PndEventDisplay.h"
35 #include "TTree.h"
36 #include "TCanvas.h"
37 #include "TH1.h"
38 #include "TH2.h"
39 #include "TH3.h"
40 #include "TFile.h"
41 #include "TClonesArray.h"
42 #include "TVector3.h"
43 #include "TGeoNode.h"
44 
45 #include <vector>
46 
52  public:
54  PndMvdAllDataEventAna(TString fileName);
56 
57  virtual void Init(TString filename);
58  virtual void InitBranch();
59  virtual void InitHistos();
60  virtual void AnaHits();
61  virtual void BeginOfEventAction() { ClearAllVectors(); };
62  virtual void EndOfEventAction() { Create3DGeoHits(); };
63  virtual void ClearHistos();
64 
65  void PrintHitArray();
66  void PrintDigiArray();
67  void PrintClusterArray();
68  void PrintRecoArray();
69 
70  void FillHitHistos();
71  void FillDigiHistos();
72  void FillClusterHistos();
73  void FillRecoHistos();
76  void Fill3DHisto();
77  void FillHitProjHistos();
78 
79  void DrawHitHisto(TString detName, TCanvas *extCan = nullptr, Int_t pad = 0);
80  void DrawDigiHisto(TString detName, TCanvas *extCan = nullptr, Int_t pad = 0);
81  void DrawClusterHisto(TString detName, TCanvas *extCan = nullptr, Int_t pad = 0);
82  void DrawRecoHisto(TString detName, TCanvas *extCan = nullptr, Int_t pad = 0);
83  void DrawAllHistos(TString detName, TCanvas *extCan = nullptr);
84  void DrawAllHistos(Int_t i, TCanvas *extCan = nullptr);
85  void Draw3D(TString opt = "", TCanvas *extCan = nullptr, Int_t pad = 0);
86  void DrawAllTracks(TCanvas *extCan = nullptr, Int_t pad = 0);
87  void DrawHitTracks(TCanvas *extCan = nullptr, Int_t pad = 0);
88  void DrawEvent(bool tracks = false, TCanvas *extCan = nullptr);
89  void DrawTopVolume(TCanvas *extCan = nullptr, Int_t pad = 0, const char *opt = "");
90  void DrawHisxy(TCanvas *extCan = nullptr, Int_t pad = 0);
91  void DrawHisrz(TCanvas *extCan = nullptr, Int_t pad = 0);
92  void DrawHistoVec(std::vector<TH1 *> *vec, TCanvas *extCan = nullptr, Int_t pad = 0) const;
93  void DrawHisto(TH1 *histo, TCanvas *extCan = nullptr, Int_t pad = 0) const;
94  void DrawHitPerCluster(TCanvas *extCan = nullptr, Int_t pad = 0) { DrawHisto(fAllHitPerClusterHistos, extCan, pad); };
95  void DrawResolution(TCanvas *extCan = nullptr, Int_t pad = 0) { DrawHisto(fAllHitResolutionHistos, extCan, pad); };
96 
97  void Create3DGeoHits();
98 
99  void ClearHistoMaps(std::map<TString, TH1 *> *myHistos) const;
100  void ClearAllHMaps();
101  void ClearHistoVector(std::vector<TH1 *> *myVectors) const;
102  void ClearAllVectors();
103 
104  TVector3 GetLocalHitPoints(TString detName, TVector3 input);
105  std::vector<Int_t> GetHitPerCluster(PndSdsCluster *clusterCand);
106  std::vector<TString> GetModulesHit();
107  TVector3 CalcMeanHitPos(std::vector<Int_t> points);
108 
109  protected:
110  TClonesArray *fDigiArray;
111  TClonesArray *fClusterArray;
112  TClonesArray *fRecoArray;
113  TClonesArray *fGeoTrackArray;
114  TClonesArray *fTrackFArray;
115 
116  private:
117  std::map<TString, TH1 *> fDigiHistos;
118  std::map<TString, TH1 *> fClusterHistos;
119  std::map<TString, TH1 *> fRecoHistos;
120  std::map<TString, TH1 *> fHitPerClusterHistos;
121  std::map<TString, TH1 *> fHitResolutionHistos;
122 
123  std::vector<TH1 *> fHitHistoVec;
124  std::vector<TH1 *> fDigiHistoVec;
125  std::vector<TH1 *> fClusterHistoVec;
126  std::vector<TH1 *> fRecoHistoVec;
127 
128  TGeoVolume *fMvdTopVolume;
129  TGeoVolume *fRecoTopVolume;
130  TGeoVolume *fRecoVolume;
131 
132  TH1 *fRecoErrorHisto;
133  TH1 *fAllHitPerClusterHistos;
134  TH1 *fAllHitResolutionHistos;
135  TH3D *f3DMCHisto;
136  TH3D *f3DRecoHisto;
137  std::vector<TH1 *> fSimHisxy;
138  std::vector<TH1 *> fSimHisrz;
139  std::vector<TH1 *> fRecoHisxy;
140  std::vector<TH1 *> fRecoHisrz;
141 
142  TCanvas *fCan1;
143  TCanvas *fCan2;
144 
145  PndSdsCalcFePixel *fPixelCon;
146  PndEventDisplay *fGeoList;
147 
148  ClassDef(PndMvdAllDataEventAna, 1);
149 };
150 
151 #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:30
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:33
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()