13#include <FairRootManager.h>
16#include <TDirectory.h>
36 fHM->
Create1<TH1D>(
"fhDigiDt",
"same address consecutive digis time diff;dt [ns];entries", 1001, -0.5, 10000.5);
38 fHM->
Create1<TH1D>(
"fhDigiDtEdge",
"same address consecutive digis time diff;dt [ns];entries", 101, -0.5, 100.5);
40 fHM->
Create1<TH1D>(
"fhDigiDistH",
"horizontal distance of digis same pmt;DIndX [in pixels];entries", 11, -0.5, 10.5);
42 fHM->
Create1<TH1D>(
"fhDigiDistV",
"vertical distance of digis same pmt;DIndY [in pixels];entries", 11, -0.5, 10.5);
44 fHM->
Create2<TH2D>(
"fhDigiNeighbours",
"digi neighbours same pmt;DIndX [in pixels];DIndY [in pixels];entries", 5,
45 -2.5, 2.5, 5, -2.5, 2.5);
50 LOG(debug) << GetName() <<
" Event " <<
fEventNum;
54 for (Int_t i = 0; i < nofDigis; i++) {
72 std::sort(times.begin(), times.end());
73 for (
auto it = times.begin(); it != times.end(); ++it) {
75 LOG(warn) <<
"Digi time < 0.: "
76 <<
"address: " << address <<
" time: " << *it <<
" ns";
78 if (it != times.begin()) {
79 Double_t dt = *it - *std::prev(it);
80 fHM->
H1(
"fhDigiDt")->Fill(dt);
82 fHM->
H1(
"fhDigiDtEdge")->Fill(dt);
90 std::sort(digis.begin(), digis.end());
91 for (
auto it0 = digis.begin(); it0 != digis.end(); ++it0) {
94 for (
auto it1 = it0 + 1; it1 != digis.end(); ++it1) {
98 if (indX0 == indX1 && indY0 == indY1)
continue;
99 if (indY0 == indY1)
fHM->
H1(
"fhDigiDistH")->Fill(indX1 - indX0);
100 if (indX0 == indX1)
fHM->
H1(
"fhDigiDistV")->Fill(indY1 - indY0);
101 if (abs(indX0 - indX1) > 1 || abs(indY0 - indY1) > 1)
continue;
102 fHM->
H2(
"fhDigiNeighbours")->Fill(indX1 - indX0, indY0 - indY1);
117 TDirectory* oldir = gDirectory;
118 TFile* outFile = FairRootManager::Instance()->GetOutFile();
119 if (outFile !=
nullptr) {
120 outFile->mkdir(GetName());
121 outFile->cd(GetName());
124 gDirectory->cd(oldir->GetPath());
@ kRich
Ring-Imaging Cherenkov Detector.
static Int_t GetNofDigis(ECbmModuleId systemId)
static Bool_t IsPresent(ECbmModuleId systemId)
Presence of a digi branch.
InitStatus Init()
Initialisation.
const Digi * Get(Int_t index) const
Get a digi object.
static CbmDigiManager * Instance()
Static instance.
TH2 * H2(const std::string &name) const
Return pointer to TH2 histogram.
void Create2(const std::string &name, const std::string &title, Int_t nofBinsX, Double_t minBinX, Double_t maxBinX, Int_t nofBinsY, Double_t minBinY, Double_t maxBinY)
Helper function for creation of 2-dimensional histograms and profiles. Template argument is a real ob...
void WriteToFile()
Write all objects to current opened file.
void Create1(const std::string &name, const std::string &title, Int_t nofBins, Double_t minBin, Double_t maxBin)
Helper function for creation of 1-dimensional histograms and profiles. Template argument is a real ob...
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
static CbmRichDigiMapManager & GetInstance()
Return Instance of CbmRichGeoManager.
CbmRichPixelData * GetPixelDataByAddress(Int_t address)
Return CbmRichDataPixel by digi address.
std::map< Int_t, std::vector< std::pair< Double_t, Int_t > > > fPmtDigisTimeAddress
CbmDigiManager * fDigiMan
void Exec(Option_t *option)
std::map< Int_t, std::vector< Double_t > > fFiredTimes
Double_t fNeighbourTimeLimit
int32_t GetAddress() const