PandaRoot
PndMvdConvertApv.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 // ---- PndMvdConvertApv header file ---
15 // ---- Created 06.01.09 by Lars Ackermann ---
16 // ---- on the basic of the ana tool of dts ---
17 // --------------------------------------------------------
18 
23 #ifndef PNDMVDCONVERTAPV_H
24 #define PNDMVDCONVERTAPV_H
25 
26 #include "TFile.h"
27 #include "TTree.h"
28 #include "TClonesArray.h"
29 #include "TString.h"
30 #include "TObject.h"
31 #include <iostream>
32 #include <vector>
33 #include <fstream>
34 #include <map>
35 #include "PndMvdApvHit.h"
36 #include "PndGeoHandling.h"
37 
38 // class PndMvdApv;
39 #include "PndSdsDigiStrip.h"
40 
41 #include "PndMvdTsEvent.h"
42 
52  public:
55  : fCalibPars(), fNofEvents(0), fEvent(-1), fLastEvent(0), fNoCalib(kFALSE), fHitFileName(""), fDataFile(), fhitlist(), fTopModuleID(0), fBottomModuleID(0), fFake(kFALSE),
56  f(nullptr), t(nullptr), tsEv(nullptr), arr(nullptr), fGeoH(nullptr){};
57 
63  PndMvdConvertApv(const TString &CalibFileName, const TString &HitFileName);
64 
66  virtual ~PndMvdConvertApv() { fDataFile.close(); };
67 
68  PndMvdConvertApv(const PndMvdConvertApv &) = delete;
69 
70  PndMvdConvertApv &operator=(const PndMvdConvertApv &) = delete;
71 
77  long int GetNofEvents();
78 
85  std::vector<PndSdsDigiStrip> ReadAll();
86 
93  std::vector<PndSdsDigiStrip> ReadNext();
94 
100  Bool_t Init();
101 
109  void SetFakePair(Int_t TopModuleID, Int_t BottomModuleID);
110 
111  private:
130  // void LoadCalibration(TString CalibFileName, std::vector<Int_t> modules);
131  void LoadCalibration(TString CalibFileName);
139  std::vector<PndSdsDigiStrip> Calc(std::vector<PndMvdApvHit> hitlist);
140 
142  // std::vector<std::map<Int_t, std::vector<double> > > fCalibPars;
143  std::map<Int_t, std::map<Int_t, double>> fCalibPars;
144 
146  long int fNofEvents;
147 
149  long int fEvent;
150 
152  long int fLastEvent;
153 
155  bool fNoCalib;
156 
158  TString fHitFileName;
159 
161  std::ifstream fDataFile;
162 
164  std::vector<PndMvdApvHit> fhitlist;
165 
167  Int_t fTopModuleID;
168 
170  Int_t fBottomModuleID;
171 
173  Bool_t fFake;
174 
175  TFile *f;
176  TTree *t;
177  PndMvdTsEvent *tsEv;
178 
179  TClonesArray *arr;
180 
181  PndGeoHandling *fGeoH;
182 
183  ClassDef(PndMvdConvertApv, 1);
184 };
185 
186 #endif
void SetFakePair(Int_t TopModuleID, Int_t BottomModuleID)
virtual ~PndMvdConvertApv()
Convert meassured data into PndSdsDigiStrip.
std::vector< PndSdsDigiStrip > ReadAll()
Class to access the naming information of the MVD.
PndMvdConvertApv & operator=(const PndMvdConvertApv &)=delete
std::vector< PndSdsDigiStrip > ReadNext()
long int GetNofEvents()