CbmRoot
CbmRichMCbmToTShifter.h
Go to the documentation of this file.
1 #ifndef MCBM_RICH_TOTSHIFTER
2 #define MCBM_RICH_TOTSHIFTER
3 
4 #include "FairTask.h"
6 class TClonesArray;
7 class CbmHistManager;
8 class TVector3;
9 class CbmDigiManager;
10 
11 #include "TH1D.h"
12 #include <map>
13 #include <vector>
14 
15 using namespace std;
16 
17 
18 class CbmRichMCbmToTShifter : public FairTask {
19 
20 public:
25 
29  virtual ~CbmRichMCbmToTShifter() {};
30 
34  virtual InitStatus Init();
35 
39  virtual void Exec(Option_t* option);
40 
44  virtual void Finish();
45 
50  void SetOutputDir(const string& dir) { fOutputDir = dir; }
51 
52 
56  void GeneratePDF(Bool_t b = true) { fGeneratePDFs = b; };
57 
61  void ShowTdcId(Bool_t b = true) { fShowTdcId = b; };
62 
63 
64 private:
66 
67  Int_t fEventNum;
68 
69  std::string fOutputDir; // output dir for results
70 
71  std::map<Int_t, std::map<Int_t, TH1*>> fhTotMap;
72 
73  Bool_t fGeneratePDFs;
74 
75  Bool_t fShowTdcId;
76 
80  TH1* GetTotH1(Int_t tdc, Int_t channel);
81 
82 
83  uint16_t calcDirichAddr(uint32_t cnt) {
84  return (0x7 << 12) | ((cnt / 18) << 8) | (((cnt % 18) / 2) << 4)
85  | ((cnt % 2) << 0);
86  };
87 
91  std::string printEmpty();
92 
97 
98 
102  inline int getDirichAddress(const int dirich) {
103  return (dirich >> 16) & 0xffff;
104  }
105 
109  inline int getDirichChannel(const int dirich) { return (dirich) &0xffff; }
110 
114  Double_t GetMaxH1(TH1* h);
115 
120 
125 
126 
127  ClassDef(CbmRichMCbmToTShifter, 1)
128 };
129 
130 #endif
CbmRichMCbmToTShifter::getDirichChannel
int getDirichChannel(const int dirich)
Extract the channel Address from the encoded DiRICH Address.
Definition: CbmRichMCbmToTShifter.h:109
CbmRichMCbmToTShifter::fOutputDir
std::string fOutputDir
Definition: CbmRichMCbmToTShifter.h:69
h
Generates beam ions for transport simulation.
Definition: CbmBeamGenerator.h:17
CbmRichMCbmToTShifter::CbmRichMCbmToTShifter
CbmRichMCbmToTShifter(const CbmRichMCbmToTShifter &)
Copy constructor.
CbmRichMCbmToTShifter::SetOutputDir
void SetOutputDir(const string &dir)
Set output directory where you want to write results (figures and json).
Definition: CbmRichMCbmToTShifter.h:50
CbmRichMCbmToTShifter::operator=
CbmRichMCbmToTShifter & operator=(const CbmRichMCbmToTShifter &)
Assignment operator.
CbmRichMCbmToTShifter
Definition: CbmRichMCbmToTShifter.h:18
CbmMcbm2018RichPar
Definition: CbmMcbm2018RichPar.h:13
CbmRichMCbmToTShifter::calcDirichAddr
uint16_t calcDirichAddr(uint32_t cnt)
Definition: CbmRichMCbmToTShifter.h:83
CbmRichMCbmToTShifter::fhTotMap
std::map< Int_t, std::map< Int_t, TH1 * > > fhTotMap
Definition: CbmRichMCbmToTShifter.h:71
CbmHistManager
Histogram manager.
Definition: CbmHistManager.h:41
CbmRichMCbmToTShifter::ShowTdcId
void ShowTdcId(Bool_t b=true)
Flag Funtion to control printout for ParameterFile.
Definition: CbmRichMCbmToTShifter.h:61
CbmRichMCbmToTShifter::fGeneratePDFs
Bool_t fGeneratePDFs
Definition: CbmRichMCbmToTShifter.h:73
CbmRichMCbmToTShifter::getDirichAddress
int getDirichAddress(const int dirich)
Extract the Tdc Address from the encoded DiRICH Address.
Definition: CbmRichMCbmToTShifter.h:102
CbmRichMCbmToTShifter::fShowTdcId
Bool_t fShowTdcId
Definition: CbmRichMCbmToTShifter.h:75
CbmDigiManager
CbmDigiManager.
Definition: CbmDigiManager.h:37
fDigiMan
CbmDigiManager * fDigiMan
Definition: CbmTofAnaTestbeam.cxx:88
CbmRichMCbmToTShifter::GeneratePDF
void GeneratePDF(Bool_t b=true)
Flag Funtion to control PDF output.
Definition: CbmRichMCbmToTShifter.h:56
CbmRichMCbmToTShifter::InitHistograms
void InitHistograms()
Initialize histograms.
CbmRichMCbmToTShifter::fEventNum
Int_t fEventNum
Definition: CbmRichMCbmToTShifter.h:67
CbmRichMCbmToTShifter::~CbmRichMCbmToTShifter
virtual ~CbmRichMCbmToTShifter()
Standard destructor.
Definition: CbmRichMCbmToTShifter.h:29