138 fHM->Create1<TH1D>(
"fhNofEvents",
"fhNofEvents;Entries", 1, 0.5, 1.5);
139 fHM->Create1<TH1D>(
"fhNofCbmEvents",
"fhNofCbmEvents;Entries", 1, 0.5, 1.5);
140 fHM->Create1<TH1D>(
"fhNofCbmEventsRing",
"fhNofCbmEventsRing;Entries", 1, 0.5, 1.5);
142 fHM->Create1<TH1D>(
"fhNofBlobEvents",
"fhNofBlobEvents;Entries", 1, 0.5, 1.5);
143 fHM->Create1<TH1D>(
"fhNofBlobsInEvent",
"fhNofBlobsInEvent;Entries", 36, 0.5, 36.5);
146 fHM->Create2<TH2D>(
"fhRichHitXY",
"fhRichHitXY;RICH hit X [cm];RICH hit Y [cm];Entries", 67, -20.1 +
fXOffsetHisto,
148 fHM->Create2<TH2D>(
"fhRichHitXY_fromRing",
"fhRichHitXY_fromRing;RICH hit X [cm];RICH hit Y [cm];Entries", 67,
152 fHM->Create1<TH1D>(
"fhRichDigisToT",
"fhRichDigisToT;ToT [ns];Entries", 601, 9.975, 40.025);
153 fHM->Create1<TH1D>(
"fhRichHitToT",
"fhRichHitToT;ToT [ns];Entries", 601, 9.975, 40.025);
156 fHM->Create2<TH2D>(
"fhRichRingXY",
"fhRichRingXY;Ring center X [cm];Ring center Y [cm];Entries", 67,
158 fHM->Create1<TH1D>(
"fhRichRingRadius",
"fhRichRingRadius;Ring radius [cm];Entries", 100, 0., 7.);
159 fHM->Create1<TH1D>(
"fhNofHitsInRing",
"fhNofHitsInRing;# hits in ring;Entries", 50, -0.5, 49.5);
160 fHM->Create2<TH2D>(
"fhICD",
"fhICD;channel;DeltaTime", 2305, -0.5, 2304.5, 130, -6.5, 6.5);
162 fHM->Create2<TH2D>(
"fhRichRingRadiusY",
"fhRichRingRadiusY;Ring Radius [cm]; Y position[cm];Entries", 70, -0.05, 6.95,
164 fHM->Create2<TH2D>(
"fhRichHitsRingRadius",
"fhRichHitsRingRadius;#Rich Hits/Ring; Ring Radius [cm];Entries", 50, -0.5,
165 49.5, 70, -0.05, 6.95);
167 fHM->Create1<TH1D>(
"fhRingDeltaTime",
"fhRingDeltaTime; \\Delta Time/ns;Entries", 101, -10.1, 10.1);
168 fHM->Create1<TH1D>(
"fhRingChi2",
"fhRingChi2; \\Chi^2 ;Entries", 101, 0.0, 10.1);
170 fHM->Create2<TH2D>(
"fhRichRingCenterXChi2",
"fhRichRingCenterXChi2;Ring Center X [cm];\\Chi^2 ;;Entries", 67,
172 fHM->Create2<TH2D>(
"fhRichRingCenterYChi2",
"fhRichRingCenterYChi2;Ring Center Y [cm];\\Chi^2 ;;Entries", 84, -25.2,
173 25.2, 101, 0.0, 10.1);
174 fHM->Create2<TH2D>(
"fhRichRingRadiusChi2",
"fhRichRingRadiusChi2; Ring Radius [cm];\\Chi^2 ;;Entries", 70, -0.05,
175 6.95, 101, 0.0, 10.1);
177 fHM->Create1<TH1D>(
"fhHitTimeEvent",
"fhHitTimeEvent;time [ns];Entries", 400, -100., 300);
180 fHM->Create2<TH2D>(
"fhDigisInChnl",
"fhDigisInChnl;channel;#Digis;", 2304, -0.5, 2303.5, 500, -0.5, 499.5);
181 fHM->Create2<TH2D>(
"fhDigisInDiRICH",
"fhDigisInDiRICH;DiRICH;#Digis;", 72, -0.5, 71.5, 3000, -0.5, 2999.5);
184 fHM->Create2<TH2D>(
"fhHitsTimeTot",
"fhHitsTimeTot;LE [ns]; ToT [ns];#Digis;", 200, -50., 150., 300, 15.0, 30.0);
191 fHM->H1(
"fhNofEvents")->Fill(1);
193 cout <<
"CbmRichMCbmQaRichOnly, event No. " <<
fEventNum << endl;
195 std::array<unsigned int, 2304> chnlDigis;
196 for (
auto& c : chnlDigis)
200 fHM->H1(
"fhRichDigisToT")->Fill(richDigi->
GetToT());
201 uint16_t addrDiRICH = (richDigi->
GetAddress() >> 16) & 0xFFFF;
202 uint16_t addrChnl = richDigi->
GetAddress() & 0xFFFF;
203 uint16_t dirichNmbr = ((addrDiRICH >> 8) & 0xF) * 18 + ((addrDiRICH >> 4) & 0xF) * 2 + ((addrDiRICH >> 0) & 0xF);
204 uint32_t fullNmbr = (dirichNmbr << 5) | (addrChnl - 1);
205 chnlDigis[fullNmbr]++;
209 unsigned int sum = 0;
210 for (uint16_t i = 0; i < 2304; ++i) {
211 if (chnlDigis[i] != 0)
fHM->H1(
"fhDigisInChnl")->Fill(i, chnlDigis[i]);
214 uint16_t dirich = i / 32;
215 if (sum != 0)
fHM->H1(
"fhDigisInDiRICH")->Fill(dirich, sum);
221 int nofRichHits =
fRichHits->GetEntriesFast();
222 for (
int iH = 0; iH < nofRichHits; iH++) {
224 fHM->H2(
"fhRichHitXY")->Fill(richHit->
GetX(), richHit->
GetY());
225 fHM->H1(
"fhRichHitToT")->Fill(richHit->
GetToT());
230 auto fNCbmEvent =
fCbmEvent->GetEntriesFast();
232 for (
int i = 0; i < fNCbmEvent; i++) {
233 fHM->H1(
"fhNofCbmEvents")->Fill(1);
239 std::vector<int> ringIndx;
240 std::vector<int> evRichHitIndx;
241 std::array<uint32_t, 36> pmtHits;
242 for (
auto& a : pmtHits)
248 evRichHitIndx.push_back(iRichHit);
254 uint32_t pmtId = (((richHit->
GetAddress()) >> 20) & 0xF) + (((richHit->
GetAddress()) >> 24) & 0xF) * 9;
257 int nofRichRings =
fRichRings->GetEntriesFast();
258 for (
int l = 0; l < nofRichRings; l++) {
262 for (
int m = 0; m < NofRingHits; m++) {
263 auto RingHitIndx = ring->
GetHit(m);
264 if (RingHitIndx == iRichHit) {
266 for (
auto check : ringIndx) {
272 if (used ==
false) ringIndx.push_back(l);
280 for (
auto a : pmtHits) {
286 fHM->H1(
"fhNofBlobEvents")->Fill(1);
287 fHM->H1(
"fhNofBlobsInEvent")->Fill(blob);
290 if (ringIndx.size() != 0)
fHM->H1(
"fhNofCbmEventsRing")->Fill(1);
293 for (
unsigned int k = 0; k < ringIndx.size(); ++k) {
296 if (ring ==
nullptr)
continue;
307 for (
int j = 0; j < ring->
GetNofHits(); ++j) {
310 if (
nullptr == hit)
continue;
311 fHM->H2(
"fhRichHitXY_fromRing")->Fill(hit->
GetX(), hit->
GetY());
499 TCanvas* c =
nullptr;
501 c =
fHM->CreateCanvas(ss.str().c_str(), ss.str().c_str(), 800, 800);
504 c =
fHM->CreateCanvas(ss.str().c_str(), ss.str().c_str(), 500, 500);
506 c->SetGrid(
true,
true);
509 pad =
new TH2D(ss.str().c_str(), (ss.str() +
";X [cm];Y [cm]").c_str(), 1, -15., 10., 1, -5., 20);
512 pad =
new TH2D(ss.str().c_str(), (ss.str() +
";X [cm];Y [cm]").c_str(), 1, -5., 5., 1, -5., 5);
515 pad->SetStats(
false);
520 TLine* line0 =
new TLine(-6.25, 8, -6.25, 15.9);
522 TLine* line1 =
new TLine(-6.25, 15.9, -1.05, 15.9);
524 TLine* line2 =
new TLine(-1.05, 15.9, -1.05, 13.2);
526 TLine* line3 =
new TLine(-1.05, 13.2, +4.25, 13.2);
528 TLine* line4 =
new TLine(4.25, 13.2, +4.25, 8);
530 TLine* line5 =
new TLine(4.25, 8, -6.25, 8);
540 double xmin = 99999., xmax = -99999., ymin = 99999., ymax = -99999.;
541 for (
int i = 0; i < ring->
GetNofHits(); i++) {
544 if (
nullptr == hit)
continue;
545 if (xmin > hit->
GetX()) xmin = hit->
GetX();
546 if (xmax < hit->GetX()) xmax = hit->
GetX();
547 if (ymin > hit->
GetY()) ymin = hit->
GetY();
548 if (ymax < hit->GetY()) ymax = hit->
GetY();
550 xCur = (xmin + xmax) / 2.;
551 yCur = (ymin + ymax) / 2.;
556 circle->SetFillStyle(0);
557 circle->SetLineWidth(3);
563 uint nofDrawHits = 0;
566 for (
int i = 0; i < ring->
GetNofHits(); i++) {
569 if (
nullptr == hit)
continue;
570 TEllipse* hitDr =
new TEllipse(hit->
GetX() - xCur, hit->
GetY() - yCur, .25);
573 hitDr->SetFillColor(kRed);
576 hitDr->SetFillColor(kBlue);
585 ss2 <<
"(x,y,r,n)=(" << setprecision(3) << ring->
GetCenterX() <<
", " << ring->
GetCenterY() <<
", "
587 TLatex* latex =
nullptr;
592 latex =
new TLatex(-4., 4., ss2.str().c_str());
677 std::cout <<
"analyse a Ring" << std::endl;
679 Double_t meanTime = 0.;
680 unsigned int hitCnt = 0;
681 Double_t minRHit2 = std::numeric_limits<Double_t>::max();
682 for (
int i = 0; i < ring->
GetNofHits(); i++) {
685 if (
nullptr == hit)
continue;
692 const Float_t tmpHitRadius2 = (diffX * diffX + diffY * diffY);
694 if (tmpHitRadius2 < minRHit2) {
695 minRHit2 = tmpHitRadius2;
698 meanTime = meanTime / hitCnt;
701 for (
int i = 0; i < ring->
GetNofHits(); i++) {
704 if (
nullptr == hit)
continue;
706 fHM->H1(
"fhRingDeltaTime")->Fill(
static_cast<Double_t
>(meanTime - hit->
GetTime()));
708 fHM->H1(
"fhRingToTs")->Fill(hit->
GetToT());
714 if ((Tdiff_ring > 20.) && (Tdiff_ring < 30.)) {
723 int InnerHitCnt_cut = 0;
727 if (
nullptr == richHit)
continue;
731 if (diffX * diffX + diffY * diffY < minRHit2) {
734 if ((Tdiff_inner > 20.) && (Tdiff_inner < 30.)) {
737 std::cout << ev->
GetNumber() <<
" Address_inner: " << std::hex
744 fHM->H1(
"fhInnerRingDeltaTime")->Fill(
static_cast<Double_t
>(meanTime - richHit->
GetTime()));
745 fHM->H1(
"fhInnerRingToTs")->Fill(richHit->
GetToT());
749 if (InnerHitCnt == 0) {
750 fHM->H1(
"fhInnerRingFlag")->Fill(1);
753 fHM->H1(
"fhInnerRingFlag")->Fill(0);
755 fHM->H1(
"fhNofInnerHits")->Fill(InnerHitCnt);
784 std::cout << gSystem->pwd() << std::endl;
786 std::ifstream icd_file(Form(
"icd_offset_it_%u.data", iteration));
787 unsigned int lineCnt = 0;
788 if (icd_file.is_open()) {
789 while (getline(icd_file, line)) {
790 if (line[0] ==
'#')
continue;
791 std::istringstream iss(line);
792 unsigned int addr = 0;
794 if (!(iss >> addr >> value)) {
795 std::cout <<
"A Problem accured in line " << lineCnt <<
"\n";
799 ICD_offsets.at(addr) += value;
804 std::cout <<
"Unable to open inter channel delay file icd_offset_it_" << iteration <<
".data\n";
void DrawH1(TH1 *hist, HistScale logx, HistScale logy, const string &drawOpt, Int_t color, Int_t lineWidth, Int_t lineStyle, Int_t markerSize, Int_t markerStyle)