CbmRoot
Loading...
Searching...
No Matches
CbmRichMCbmToTShifter.h
Go to the documentation of this file.
1/* Copyright (C) 2019-2020 Justus-Liebig-Universitaet Giessen, Giessen
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Adrian Amatus Weber [committer] */
4
5#ifndef MCBM_RICH_TOTSHIFTER
6#define MCBM_RICH_TOTSHIFTER
7
8#include "FairTask.h"
10class TClonesArray;
11class CbmHistManager;
12class TVector3;
13class CbmDigiManager;
14
15#include "TH1D.h"
16
17#include <map>
18#include <vector>
19
20using namespace std;
21
22
23class CbmRichMCbmToTShifter : public FairTask {
24
25 public:
30
35
39 virtual InitStatus Init();
40
44 virtual void Exec(Option_t* option);
45
49 virtual void Finish();
50
55 void SetOutputDir(const string& dir) { fOutputDir = dir; }
56
57
61 void GeneratePDF(Bool_t b = true) { fGeneratePDFs = b; };
62
66 void ShowTdcId(Bool_t b = true) { fShowTdcId = b; };
67
68
69 private:
71
72 Int_t fEventNum;
73
74 std::string fOutputDir; // output dir for results
75
76 std::map<Int_t, std::map<Int_t, TH1*>> fhTotMap;
77
79
80 Bool_t fShowTdcId;
81
85 TH1* GetTotH1(Int_t tdc, Int_t channel);
86
87
88 uint16_t calcDirichAddr(uint32_t cnt)
89 {
90 return (0x7 << 12) | ((cnt / 18) << 8) | (((cnt % 18) / 2) << 4) | ((cnt % 2) << 0);
91 };
92
96 std::string printEmpty();
97
102
103
107 inline int getDirichAddress(const int dirich) { return (dirich >> 16) & 0xffff; }
108
112 inline int getDirichChannel(const int dirich) { return (dirich) &0xffff; }
113
117 Double_t GetMaxH1(TH1* h);
118
123
128
129
130 ClassDef(CbmRichMCbmToTShifter, 1)
131};
132
133#endif
CbmDigiManager.
Histogram manager.
void ShowTdcId(Bool_t b=true)
Flag Funtion to control printout for ParameterFile.
TH1 * GetTotH1(Int_t tdc, Int_t channel)
Handler for TH1 Histograms.
void SetOutputDir(const string &dir)
Set output directory where you want to write results (figures and json).
CbmRichMCbmToTShifter & operator=(const CbmRichMCbmToTShifter &)
Assignment operator.
std::string printEmpty()
Fill output lines with 0's if DiRICh Address is not in use in input file.
int getDirichAddress(const int dirich)
Extract the Tdc Address from the encoded DiRICH Address.
int getDirichChannel(const int dirich)
Extract the channel Address from the encoded DiRICH Address.
CbmRichMCbmToTShifter(const CbmRichMCbmToTShifter &)
Copy constructor.
void GeneratePDF(Bool_t b=true)
Flag Funtion to control PDF output.
virtual void Exec(Option_t *option)
Inherited from FairTask.
virtual ~CbmRichMCbmToTShifter()
Standard destructor.
Double_t GetMaxH1(TH1 *h)
Find the Maximum in a TH1 Histogram.
virtual InitStatus Init()
Inherited from FairTask.
std::map< Int_t, std::map< Int_t, TH1 * > > fhTotMap
uint16_t calcDirichAddr(uint32_t cnt)
virtual void Finish()
Inherited from FairTask.
void InitHistograms()
Initialize histograms.
CbmRichMCbmToTShifter()
Standard constructor.
Data class with information on a STS local track.
Hash for CbmL1LinkKey.