2626#include < TH2F.h>
2727#include < THttpServer.h>
2828#include < TMath.h>
29+ #include < cmath>
2930
3031// FAIR headers
3132#include < FairLogger.h>
@@ -285,19 +286,114 @@ InitStatus R3BAlpideOnlineSpectra::Init()
285286 // mainfol->Add(cHit_angcor);
286287
287288 auto cHit_xy = new TCanvas (" Y_vs_X" , " Correlation Y vs X in mm" , 10 , 10 , 500 , 500 );
288- fh2_y_x = R3B::root_owned<TH2F>(" fh2_y_x" , " Correlation Y vs X in mm" , 400 , -50 , 50 , 380 , -70 , 70 );
289- fh2_y_x->GetXaxis ()->SetTitle (" Wix <-- X [mm] --> Messel" );
290- fh2_y_x->GetYaxis ()->SetTitle (" Y [mm]" );
291- fh2_y_x->GetYaxis ()->SetTitleOffset (1.1 );
292- fh2_y_x->GetXaxis ()->CenterTitle (true );
293- fh2_y_x->GetYaxis ()->CenterTitle (true );
294- gPad ->SetLogz ();
295- fh2_y_x->Draw (" colz" );
296- fh2_y_x->SetStats (0 );
297289
298- mainfol->Add (cHit_xy);
290+ if (fMap_Par ->GetGeoVersion () == 202505 )
291+ {
292+ fh2_y_x.push_back (R3B::root_owned<TH2F>(" fh2_y_x" , " Correlation Y vs X in mm" , 400 , -50 , 50 , 380 , -70 , 70 ));
293+ fh2_y_x[0 ]->GetXaxis ()->SetTitle (" Wix <-- X [mm] --> Messel" );
294+ fh2_y_x[0 ]->GetYaxis ()->SetTitle (" Y [mm]" );
295+ fh2_y_x[0 ]->GetYaxis ()->SetTitleOffset (1.1 );
296+ fh2_y_x[0 ]->GetXaxis ()->CenterTitle (true );
297+ fh2_y_x[0 ]->GetYaxis ()->CenterTitle (true );
298+ gPad ->SetLogz ();
299+ fh2_y_x[0 ]->Draw (" colz" );
300+ fh2_y_x[0 ]->SetStats (0 );
301+ mainfol->Add (cHit_xy);
302+ }
303+ else
304+ {
305+ cHit_xy->Divide (1 , 2 );
306+ cHit_xy->cd (1 );
307+ fh2_y_x.push_back (R3B::root_owned<TH2F>(
308+ " fh2_y_x_flex1" , " Correlation Y vs X in mm for flex-1" , 500 , -50 , 50 , 200 , -20 , 20 ));
309+ fh2_y_x[0 ]->GetXaxis ()->SetTitle (" Wix <-- X [mm] --> Messel" );
310+ fh2_y_x[0 ]->GetYaxis ()->SetTitle (" Y [mm]" );
311+ fh2_y_x[0 ]->GetYaxis ()->SetTitleOffset (1.1 );
312+ fh2_y_x[0 ]->GetXaxis ()->CenterTitle (true );
313+ fh2_y_x[0 ]->GetYaxis ()->CenterTitle (true );
314+ gPad ->SetLogz ();
315+ fh2_y_x[0 ]->Draw (" colz" );
316+ fh2_y_x[0 ]->SetStats (0 );
317+ cHit_xy->cd (2 );
318+ fh2_y_x.push_back (R3B::root_owned<TH2F>(
319+ " fh2_y_x_flex2" , " Correlation Y vs X in mm for flex-2" , 500 , -50 , 50 , 200 , -20 , 20 ));
320+ fh2_y_x[1 ]->GetXaxis ()->SetTitle (" Wix <-- X [mm] --> Messel" );
321+ fh2_y_x[1 ]->GetYaxis ()->SetTitle (" Y [mm]" );
322+ fh2_y_x[1 ]->GetYaxis ()->SetTitleOffset (1.1 );
323+ fh2_y_x[1 ]->GetXaxis ()->CenterTitle (true );
324+ fh2_y_x[1 ]->GetYaxis ()->CenterTitle (true );
325+ gPad ->SetLogz ();
326+ fh2_y_x[1 ]->Draw (" colz" );
327+ fh2_y_x[1 ]->SetStats (0 );
328+ mainfol->Add (cHit_xy);
329+
330+ auto cHit_xy_cor =
331+ new TCanvas (" Y_vs_X_flex_cor" , " Position correlations between flex-PCBs" , 10 , 10 , 500 , 500 );
332+ cHit_xy_cor->Divide (2 , 2 );
333+ cHit_xy_cor->cd (1 );
334+ fh2_y_x_cor_det.push_back (
335+ R3B::root_owned<TH2F>(" fh2_x_x_flexes" , " Correlation X2 vs X1 in mm" , 500 , -50 , 50 , 500 , -50 , 50 ));
336+ fh2_y_x_cor_det[0 ]->GetXaxis ()->SetTitle (" Wix <-- X1 [mm] --> Messel" );
337+ fh2_y_x_cor_det[0 ]->GetYaxis ()->SetTitle (" Wix <-- X2 [mm] --> Messel" );
338+ fh2_y_x_cor_det[0 ]->GetYaxis ()->SetTitleOffset (1.1 );
339+ fh2_y_x_cor_det[0 ]->GetXaxis ()->CenterTitle (true );
340+ fh2_y_x_cor_det[0 ]->GetYaxis ()->CenterTitle (true );
341+ gPad ->SetLogz ();
342+ fh2_y_x_cor_det[0 ]->Draw (" colz" );
343+ fh2_y_x_cor_det[0 ]->SetStats (0 );
344+
345+ cHit_xy_cor->cd (2 );
346+ fh2_y_x_cor_det.push_back (
347+ R3B::root_owned<TH2F>(" fh2_y_y_flexes" , " Correlation Y2 vs Y1 in mm" , 200 , -20 , 20 , 200 , -20 , 20 ));
348+ fh2_y_x_cor_det[1 ]->GetXaxis ()->SetTitle (" Y1 [mm]" );
349+ fh2_y_x_cor_det[1 ]->GetYaxis ()->SetTitle (" Y2 [mm]" );
350+ fh2_y_x_cor_det[1 ]->GetYaxis ()->SetTitleOffset (1.1 );
351+ fh2_y_x_cor_det[1 ]->GetXaxis ()->CenterTitle (true );
352+ fh2_y_x_cor_det[1 ]->GetYaxis ()->CenterTitle (true );
353+ gPad ->SetLogz ();
354+ fh2_y_x_cor_det[1 ]->Draw (" colz" );
355+ fh2_y_x_cor_det[1 ]->SetStats (0 );
356+
357+ cHit_xy_cor->cd (3 );
358+ fh2_y_x_cor_det.push_back (
359+ R3B::root_owned<TH2F>(" fh2_y2_x1_flexes" , " Correlation Y2 vs X1 in mm" , 500 , -50 , 50 , 200 , -20 , 20 ));
360+ fh2_y_x_cor_det[2 ]->GetXaxis ()->SetTitle (" Wix <-- X1 [mm] --> Messel" );
361+ fh2_y_x_cor_det[2 ]->GetYaxis ()->SetTitle (" Y2 [mm]" );
362+ fh2_y_x_cor_det[2 ]->GetYaxis ()->SetTitleOffset (1.1 );
363+ fh2_y_x_cor_det[2 ]->GetXaxis ()->CenterTitle (true );
364+ fh2_y_x_cor_det[2 ]->GetYaxis ()->CenterTitle (true );
365+ gPad ->SetLogz ();
366+ fh2_y_x_cor_det[2 ]->Draw (" colz" );
367+ fh2_y_x_cor_det[2 ]->SetStats (0 );
368+
369+ cHit_xy_cor->cd (4 );
370+ fh2_y_x_cor_det.push_back (
371+ R3B::root_owned<TH2F>(" fh2_y1_x2_flexes" , " Correlation Y1 vs X2 in mm" , 500 , -50 , 50 , 200 , -20 , 20 ));
372+ fh2_y_x_cor_det[3 ]->GetXaxis ()->SetTitle (" Wix <-- X2 [mm] --> Messel" );
373+ fh2_y_x_cor_det[3 ]->GetYaxis ()->SetTitle (" Y1 [mm]" );
374+ fh2_y_x_cor_det[3 ]->GetYaxis ()->SetTitleOffset (1.1 );
375+ fh2_y_x_cor_det[3 ]->GetXaxis ()->CenterTitle (true );
376+ fh2_y_x_cor_det[3 ]->GetYaxis ()->CenterTitle (true );
377+ gPad ->SetLogz ();
378+ fh2_y_x_cor_det[3 ]->Draw (" colz" );
379+ fh2_y_x_cor_det[3 ]->SetStats (0 );
380+ mainfol->Add (cHit_xy_cor);
381+
382+ auto cHit_cluster =
383+ new TCanvas (" Cluster_correlations" , " Cluster size correlations between flex-PCBs" , 10 , 10 , 500 , 500 );
384+ fh2_max_clusters =
385+ R3B::root_owned<TH2F>(" fh2_max_clusters" , " Correlation max. clusters" , 70 , 0 , 70 , 70 , 0 , 70 );
386+ fh2_max_clusters->GetXaxis ()->SetTitle (" Max. cluster flex-1" );
387+ fh2_max_clusters->GetYaxis ()->SetTitle (" Max. cluster flex-2" );
388+ fh2_max_clusters->GetYaxis ()->SetTitleOffset (1.1 );
389+ fh2_max_clusters->GetXaxis ()->CenterTitle (true );
390+ fh2_max_clusters->GetYaxis ()->CenterTitle (true );
391+ gPad ->SetLogz ();
392+ fh2_max_clusters->Draw (" colz" );
393+ fh2_max_clusters->SetStats (0 );
394+ mainfol->Add (cHit_cluster);
395+ }
299396 }
300-
301397 run->AddObject (mainfol);
302398
303399 // Register command to reset histograms
@@ -354,8 +450,16 @@ void R3BAlpideOnlineSpectra::Reset_Histo()
354450 {
355451 hist->Reset ();
356452 }
453+ for (const auto & hist : fh2_y_x)
454+ {
455+ hist->Reset ();
456+ }
457+ for (const auto & hist : fh2_y_x_cor_det)
458+ {
459+ hist->Reset ();
460+ }
357461 fh2_theta_phi->Reset ();
358- fh2_y_x ->Reset ();
462+ fh2_max_clusters ->Reset ();
359463 }
360464
361465 return ;
@@ -430,6 +534,11 @@ void R3BAlpideOnlineSpectra::Exec(Option_t* /*option*/)
430534 {
431535 std::vector<int > mult (fNbSensors , 0 );
432536 auto nHits = fHitItems ->GetEntriesFast ();
537+
538+ std::vector<double > x_max (2 , NAN);
539+ std::vector<double > y_max (2 , NAN);
540+ std::vector<int > cls_size (2 , 0 );
541+
433542 for (size_t ihit = 0 ; ihit < nHits; ihit++)
434543 {
435544 auto hit = dynamic_cast <R3BAlpideHitData*>(fHitItems ->At (ihit));
@@ -438,15 +547,54 @@ void R3BAlpideOnlineSpectra::Exec(Option_t* /*option*/)
438547 auto senid = hit->GetSensorId () - 1 ;
439548 fh1_Clustersize[senid]->Fill (hit->GetClusterSize ());
440549 fh2_PosHit[senid]->Fill (hit->GetPosl (), hit->GetPost ());
441- fh2_theta_phi->Fill (hit->GetPhi () * TMath::RadToDeg (), hit->GetTheta () * TMath::RadToDeg ());
442- fh2_y_x->Fill (hit->GetX (), hit->GetY ());
550+ if (fMap_Par ->GetGeoVersion () == 202505 )
551+ {
552+ fh2_theta_phi->Fill (hit->GetPhi () * TMath::RadToDeg (), hit->GetTheta () * TMath::RadToDeg ());
553+ fh2_y_x[0 ]->Fill (hit->GetX (), hit->GetY ());
554+ }
555+ else
556+ {
557+ if (senid < 6 )
558+ {
559+ fh2_y_x[0 ]->Fill (hit->GetX (), hit->GetY ());
560+ if (hit->GetClusterSize () > cls_size[0 ])
561+ {
562+ cls_size[0 ] = hit->GetClusterSize ();
563+ x_max[0 ] = hit->GetX ();
564+ y_max[0 ] = hit->GetY ();
565+ }
566+ }
567+ else
568+ {
569+ fh2_y_x[1 ]->Fill (hit->GetX (), hit->GetY ());
570+ if (hit->GetClusterSize () > cls_size[1 ])
571+ {
572+ cls_size[1 ] = hit->GetClusterSize ();
573+ x_max[1 ] = hit->GetX ();
574+ y_max[1 ] = hit->GetY ();
575+ }
576+ }
577+ }
443578 mult[senid]++;
444579 }
445580 for (size_t s = 0 ; s < fNbSensors ; s++)
446581 if (mult[s] > 0 )
447582 fh1_Clustermult[s]->Fill (mult[s]);
448- }
449583
584+ if (fMap_Par ->GetGeoVersion () == 202506 )
585+ {
586+ if (std::isfinite (x_max[0 ]) && std::isfinite (x_max[1 ]))
587+ fh2_y_x_cor_det[0 ]->Fill (x_max[0 ], x_max[1 ]);
588+ if (std::isfinite (y_max[0 ]) && std::isfinite (y_max[1 ]))
589+ fh2_y_x_cor_det[1 ]->Fill (y_max[0 ], y_max[1 ]);
590+ if (std::isfinite (x_max[0 ]) && std::isfinite (y_max[1 ]))
591+ fh2_y_x_cor_det[2 ]->Fill (x_max[0 ], y_max[1 ]);
592+ if (std::isfinite (x_max[2 ]) && std::isfinite (y_max[0 ]))
593+ fh2_y_x_cor_det[3 ]->Fill (x_max[1 ], y_max[0 ]);
594+ if (cls_size[0 ] > 0 && cls_size[1 ] > 0 )
595+ fh2_max_clusters->Fill (cls_size[0 ], cls_size[1 ]);
596+ }
597+ }
450598 fNEvents ++;
451599 return ;
452600}
@@ -491,7 +639,15 @@ void R3BAlpideOnlineSpectra::FinishTask()
491639 if (fHitItems )
492640 {
493641 fh2_theta_phi->Write ();
494- fh2_y_x->Write ();
642+ fh2_max_clusters->Write ();
643+ for (const auto & hist : fh2_y_x)
644+ {
645+ hist->Write ();
646+ }
647+ for (const auto & hist : fh2_y_x_cor_det)
648+ {
649+ hist->Write ();
650+ }
495651 }
496652}
497653ClassImp (R3BAlpideOnlineSpectra)
0 commit comments