PandaRoot
PndMvdEventAna.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 //
14 // C++ Interface: PndMvdMCEventAna
15 //
16 // Description:
17 //
18 //
19 // Author: t.stockmanns <stockman@ikp455>, (C) 2007
20 //
21 // Copyright: See COPYING file that comes with this distribution
22 //
23 //
24 #ifndef PNDMVDEVENTANA_H
25 #define PNDMVDEVENTANA_H
26 
27 #include "PndSdsMCPoint.h"
28 #include "PndGeoHandling.h"
29 #include "TTree.h"
30 #include "TCanvas.h"
31 #include "TH1.h"
32 #include "TH2.h"
33 #include "TFile.h"
34 #include "TClonesArray.h"
35 #include "TString.h"
36 
37 #include <map>
38 #include <vector>
46  public:
48  PndMvdEventAna(TString fileName);
49  virtual ~PndMvdEventAna(){};
50 
51  virtual void Init(TString fileName);
52  void InitCanvas();
53 
54  void AnaEvents(Int_t count);
55  void AnaEventNr(Int_t Nr);
56  void NextEvent();
57  void DrawHistos();
58  void DrawHisto(TString path, TString opt = "");
59  void SetCanvasColumns(Int_t col) { fCancol = col; };
60  void SetDrawOption(TString histoName, TString option);
61  void SetSelection(TString sel) { fSelection = sel; };
62  void FillVector();
63  void DrawVector(Int_t index, TString opt);
64  Int_t GetEventNr() const { return fActiveEvent; };
65  TString GetSelection() const { return fSelection; };
66  TH1 *GetHisto(TString histoName) { return fHistos[histoName]; };
67  TH1 *GetHisto(Int_t i) { return fHistoVector[i]; };
68  virtual void InitBranch() = 0; // set fClassName and fBranchName here
69  virtual void InitHistos() = 0;
70  virtual void AnaHits();
71  virtual void AnaHitNr(Int_t i){};
72  virtual void BeginOfEventAction(){};
73  virtual void EndOfEventAction(){};
74  virtual void ClearHistos(){};
75 
76  protected:
77  Int_t fActiveEvent;
78  Int_t fAnaEvents;
79  TFile *fFile;
80  TTree *fTree;
81  TClonesArray *fHitArray;
82  TString fClassName; // has to be set in constructor of derived class
83  TString fBranchName; // has to be set in constructor of derived class
84  TString fSelection; // will be passed to derived classes to do an event selection
85  TCanvas *fCan;
86  std::map<TString, TH1 *> fHistos;
87  std::map<TString, TString> fDrawOption; // stores the drawOption for the Draw command
88  std::vector<TH1 *> fHistoVector;
89  Int_t fCancol;
91 
93 };
94 
95 #endif
std::vector< TH1 * > fHistoVector
virtual void InitBranch()=0
void DrawHisto(TString path, TString opt="")
TH1 * GetHisto(Int_t i)
TCanvas * fCan
void SetCanvasColumns(Int_t col)
TString fSelection
virtual void ClearHistos()
void SetDrawOption(TString histoName, TString option)
void SetSelection(TString sel)
PndGeoHandling * fGeoH
unsigned int i
Definition: P4_F32vec4.h:33
ClassDef(PndMvdEventAna, 1)
TString GetSelection() const
TString fBranchName
virtual void Init(TString fileName)
Class to access the naming information of the MVD.
void DrawVector(Int_t index, TString opt)
TH1 * GetHisto(TString histoName)
TClonesArray * fHitArray
virtual void BeginOfEventAction()
std::map< TString, TString > fDrawOption
virtual void AnaHits()
virtual void InitHistos()=0
virtual ~PndMvdEventAna()
virtual void AnaHitNr(Int_t i)
TString fClassName
void AnaEventNr(Int_t Nr)
void AnaEvents(Int_t count)
virtual void EndOfEventAction()
Int_t GetEventNr() const
std::map< TString, TH1 * > fHistos