Go to the documentation of this file.
4 #include "TClonesArray.h"
8 #include "TGeoManager.h"
30 #include <boost/assign/list_of.hpp>
36 using boost::assign::list_of;
39 : FairTask(
"CbmRichMCbmToTShifter")
41 , fOutputDir(
"result_ToTOffset")
43 , fGeneratePDFs(false)
45 std::cout <<
"CbmRichMCbmToTShifter::Constructor.." << std::endl;
49 std::cout <<
"CbmRichMCbmToTShifter::Init" << std::endl;
51 FairRootManager* ioman = FairRootManager::Instance();
52 if (
nullptr == ioman) {
53 Fatal(
"CbmRichMCbmToTShifter::Init",
"RootManager not instantised!");
59 Fatal(
"CbmRichMCbmToTShifter::Init",
"No Rich Digis!");
70 for (
int i = 0;
i < nofDigis; ++
i) {
74 if (
h !=
nullptr)
h->Fill(digi->
GetToT());
81 std::cout <<
"Drawing Hists..." << std::endl;
86 for (
auto const& inner : outer.second) {
87 mean +=
static_cast<Double_t
>(inner.second->GetEntries());
92 if (mean_cnt != 0) mean /= mean_cnt;
95 s <<
"TDC 0x" << std::hex << 0xc000 <<
" " << std::dec <<
" !";
98 s <<
"TDC 0x" << std::hex << 0xc001 <<
" " << std::dec <<
" !";
103 for (
auto const& outer :
fhTotMap) {
104 int tdc = outer.first;
105 TCanvas* c =
new TCanvas(
106 Form(
"fhToT_%x", outer.first), Form(
"fhToT_%x", outer.first), 2000, 2000);
112 s <<
"TDC 0x" << std::hex <<
calcDirichAddr(cnt) <<
" " << std::dec
115 if (std::next(it) !=
fhTotMap.end()) s <<
" \\" << std::endl;
119 s <<
"TDC 0x" << std::hex << outer.first <<
" " << std::dec <<
" !";
121 for (
int i = 0;
i < 32; ++
i) {
126 if (
GetMaxH1(
h) < 20 ||
h->GetEntries() < mean * 0.1) {
138 s <<
" \\" << std::endl;
140 }
else if (std::next(it) ==
fhTotMap.end()) {
143 if (cnt == 71) s << std::endl;
146 s <<
" \\" << std::endl;
154 for (uint16_t
i = cnt;
i < 72; ++
i) {
155 s <<
" \\" << std::endl;
163 std::cout << s.str() << std::endl;
170 TString name, title, subFolder;
171 name.Form(
"ToT_tdc_0x%x_ch%u", tdc, channel);
172 title.Form(
"%s;ToT [ns];Entries", name.Data());
173 h =
new TH1D(name, title, 500, -1., 49.);
182 for (Int_t
i = 1;
i <
h->GetNbinsX(); ++
i) {
183 Double_t val =
h->GetBinContent(
i);
189 return h->GetBinCenter(b);
195 for (uint16_t
i = 0;
i < 33; ++
i) {
int getDirichChannel(const int dirich)
Extract the channel Address from the encoded DiRICH Address.
virtual InitStatus Init()
Inherited from FairTask.
Generates beam ions for transport simulation.
CbmDigiManager * fDigiMan
TH1 * GetTotH1(Int_t tdc, Int_t channel)
Handler for TH1 Histograms.
InitStatus Init()
Initialisation.
Double_t GetMaxH1(TH1 *h)
Find the Maximum in a TH1 Histogram.
virtual void Finish()
Inherited from FairTask.
uint16_t calcDirichAddr(uint32_t cnt)
static Int_t GetNofDigis(ECbmModuleId systemId)
std::map< Int_t, std::map< Int_t, TH1 * > > fhTotMap
Helper functions for drawing 1D and 2D histograms and graphs.
static Bool_t IsPresent(ECbmModuleId systemId)
Presence of a digi branch.
static CbmDigiManager * Instance()
Static instance.
const Digi * Get(Int_t index) const
Get a digi object.
Convert internal data classes to cbmroot common data classes.
int getDirichAddress(const int dirich)
Extract the Tdc Address from the encoded DiRICH Address.
@ kRich
Ring-Imaging Cherenkov Detector.
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
CbmRichMCbmToTShifter()
Standard constructor.
virtual void Exec(Option_t *option)
Inherited from FairTask.
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
std::string printEmpty()
Fill output lines with 0's if DiRICh Address is not in use in input file.