@@ -122,21 +122,26 @@ InitStatus R3BLosOnlineSpectra::Init()
122122
123123 // ------------------------------------------------------------------------
124124 // Los detector
125- TCanvas* cLos[fNofLosDetectors ];
126- TCanvas* cLos_diagnosis[fNofLosDetectors ];
125+ TCanvas* cLos[fNofLosDetectors ]; // NOLINT
126+ TCanvas* cLos_diagnosis[fNofLosDetectors ]; // NOLINT
127+ TCanvas* cLos_mapped_channels[fNofLosDetectors ]; // NOLINT
127128 if (fMappedItems .at (DET_LOS ))
128129 {
129130 for (Int_t iloscount = 0 ; iloscount < fNofLosDetectors ; iloscount++)
130131 {
132+
131133 char detName[255 ];
132134 sprintf (detName, " LOS%d" , iloscount + 1 );
133-
134135 cLos[iloscount] = new TCanvas (detName, detName, 10 , 10 , 1010 , 810 );
135136
136137 char detName2[255 ];
137138 sprintf (detName2, " LOS%d_diagnosis" , iloscount + 1 );
138139 cLos_diagnosis[iloscount] = new TCanvas (detName2, detName2, 10 , 10 , 1010 , 810 );
139140
141+ char detName3[255 ];
142+ sprintf (detName3, " LOS_mapped_channels%d" , iloscount + 1 );
143+ cLos_mapped_channels[iloscount] = new TCanvas (detName3, detName3, 10 , 10 , 1010 , 810 );
144+
140145 fh_los_channels[iloscount] =
141146 new TH1F (Form (" %s_channels" , detName), Form (" %s channels" , detName), 20 , 0 ., 20 .);
142147 fh_los_channels[iloscount]->GetXaxis ()->SetTitle (" Channel number" );
@@ -240,6 +245,14 @@ InitStatus R3BLosOnlineSpectra::Init()
240245 fh_los_vftx_tamex[iloscount]->GetXaxis ()->SetTitle (" Ttamex-Tvftx / ns" );
241246 fh_los_vftx_tamex[iloscount]->SetFillColor (31 );
242247
248+ fh_los_mapped.resize (24 );
249+ const char * names[] = { " VFTX" , " TMX_L" , " TMX_T" };
250+ for (Int_t t = 0 ; t < 24 ; t++)
251+ {
252+ TString title = Form (" %s_%s_los_channels_%d" , detName, names[t / 8 ], t % 8 );
253+ fh_los_mapped[t] = new TH1F (title, title, 2048 , 0 , 4 * 2048 * 5 .);
254+ }
255+
243256 cLos[iloscount]->Divide (3 , 3 );
244257 cLos[iloscount]->cd (1 );
245258 fh_los_channels[iloscount]->Draw ();
@@ -288,6 +301,15 @@ InitStatus R3BLosOnlineSpectra::Init()
288301 gPad ->SetLogy ();
289302 fh_los_vftx_tamex[iloscount]->Draw ();
290303 mainfol->Add (cLos_diagnosis[iloscount]);
304+
305+ cLos_mapped_channels[iloscount]->Divide (8 , 3 );
306+
307+ for (int t = 0 ; t < 24 ; t++)
308+ {
309+ cLos_mapped_channels[iloscount]->cd (t + 1 );
310+ fh_los_mapped[t]->Draw ();
311+ }
312+ mainfol->Add (cLos_mapped_channels[iloscount]);
291313 }
292314
293315 run->AddObject (mainfol);
@@ -459,8 +481,11 @@ void R3BLosOnlineSpectra::Exec(Option_t* option)
459481 Int_t iDet = hit->GetDetector (); // 1..
460482 Int_t iCha = hit->GetChannel (); // 1..
461483 Int_t iTyp = hit->GetType (); // 0,1,2,3
484+ // Int_t iFT = hit->GetTimeFine();
485+ Int_t iCT = hit->GetTimeCoarse ();
462486 if (iTyp == 0 || iTyp == 1 )
463487 fh_los_channels[iDet - 1 ]->Fill (8 * iTyp + iCha); // exclude MTDC data
488+ fh_los_mapped[8 * iTyp + iCha - 1 ]->Fill (iCT * 5 );
464489 }
465490 }
466491
@@ -718,22 +743,33 @@ void R3BLosOnlineSpectra::Exec(Option_t* option)
718743 xV_cm[iDet - 1 ][iPart] = (xV_cm[iDet - 1 ][iPart] - flosOffsetXV[iDet - 1 ]) * flosVeffXV[iDet - 1 ];
719744 yV_cm[iDet - 1 ][iPart] = (yV_cm[iDet - 1 ][iPart] - flosOffsetYV[iDet - 1 ]) * flosVeffYV[iDet - 1 ];
720745
746+ // // Position from ToT:
747+ // if (tot[iDet - 1][iPart][1] > 0. && tot[iDet - 1][iPart][2] > 0. && tot[iDet - 1][iPart][5] > 0.
748+ // &&
749+ // tot[iDet - 1][iPart][6] > 0. && tot[iDet - 1][iPart][0] > 0. && tot[iDet - 1][iPart][3] > 0.
750+ // && tot[iDet - 1][iPart][4] > 0. && tot[iDet - 1][iPart][7] > 0.)
751+ // {
752+ // xToT_cm[iDet - 1][iPart] = (((tot[iDet - 1][iPart][5] + tot[iDet - 1][iPart][6]) / 2. -
753+ // (tot[iDet - 1][iPart][1] + tot[iDet - 1][iPart][2]) / 2.) /
754+ // ((tot[iDet - 1][iPart][1] + tot[iDet - 1][iPart][2] +
755+ // tot[iDet - 1][iPart][5] + tot[iDet - 1][iPart][6]) /
756+ // 4.));
757+
758+ // yToT_cm[iDet - 1][iPart] = (((tot[iDet - 1][iPart][0] + tot[iDet - 1][iPart][7]) / 2. -
759+ // (tot[iDet - 1][iPart][3] + tot[iDet - 1][iPart][4]) / 2.) /
760+ // ((tot[iDet - 1][iPart][7] + tot[iDet - 1][iPart][0] +
761+ // tot[iDet - 1][iPart][3] + tot[iDet - 1][iPart][4]) /
762+ // 4.));
763+ // }
764+
721765 // Position from ToT:
722- if (tot[iDet - 1 ][iPart][1 ] > 0 . && tot[iDet - 1 ][iPart][2 ] > 0 . && tot[iDet - 1 ][iPart][5 ] > 0 . &&
723- tot[iDet - 1 ][iPart][6 ] > 0 . && tot[iDet - 1 ][iPart][0 ] > 0 . && tot[iDet - 1 ][iPart][3 ] > 0 . &&
724- tot[iDet - 1 ][iPart][4 ] > 0 . && tot[iDet - 1 ][iPart][7 ] > 0 .)
766+ if (tot[iDet - 1 ][iPart][1 ] > 0 . && tot[iDet - 1 ][iPart][5 ] > 0 . && tot[iDet - 1 ][iPart][3 ] > 0 . &&
767+ tot[iDet - 1 ][iPart][7 ] > 0 .)
725768 {
726- xToT_cm[iDet - 1 ][iPart] = (((tot[iDet - 1 ][iPart][5 ] + tot[iDet - 1 ][iPart][6 ]) / 2 . -
727- (tot[iDet - 1 ][iPart][1 ] + tot[iDet - 1 ][iPart][2 ]) / 2 .) /
728- ((tot[iDet - 1 ][iPart][1 ] + tot[iDet - 1 ][iPart][2 ] +
729- tot[iDet - 1 ][iPart][5 ] + tot[iDet - 1 ][iPart][6 ]) /
730- 4 .));
731-
732- yToT_cm[iDet - 1 ][iPart] = (((tot[iDet - 1 ][iPart][0 ] + tot[iDet - 1 ][iPart][7 ]) / 2 . -
733- (tot[iDet - 1 ][iPart][3 ] + tot[iDet - 1 ][iPart][4 ]) / 2 .) /
734- ((tot[iDet - 1 ][iPart][7 ] + tot[iDet - 1 ][iPart][0 ] +
735- tot[iDet - 1 ][iPart][3 ] + tot[iDet - 1 ][iPart][4 ]) /
736- 4 .));
769+ xToT_cm[iDet - 1 ][iPart] = (tot[iDet - 1 ][iPart][5 ] - tot[iDet - 1 ][iPart][1 ]) /
770+ ((tot[iDet - 1 ][iPart][5 ] + tot[iDet - 1 ][iPart][1 ]) / 2 .);
771+ yToT_cm[iDet - 1 ][iPart] = (tot[iDet - 1 ][iPart][7 ] - tot[iDet - 1 ][iPart][3 ]) /
772+ ((tot[iDet - 1 ][iPart][7 ] + tot[iDet - 1 ][iPart][3 ]) / 2 .);
737773 }
738774
739775 xToT_cm[iDet - 1 ][iPart] =
0 commit comments