48 auto run = FairRunOnline::Instance();
51 run->GetHttpServer()->Register(
"/Tasks",
this);
52 run->GetHttpServer()->RegisterCommand(
"Reset_Neuland_Reco", Form(
"/Tasks/%s/->ResetHistos()", GetName()));
55 auto ioman = FairRootManager::Instance();
58 throw std::runtime_error(
"R3BNeulandOnlineReconstruction: No FairRootManager");
61 fEventHeader =
dynamic_cast<R3BEventHeader*
>(ioman->GetObject(
"EventHeader."));
62 if (fEventHeader ==
nullptr)
64 throw std::runtime_error(
"R3BNeulandOnlineReconstruction: No R3BEventHeader");
68 fNeulandClusters.Init();
70 gStyle->SetCanvasPreferGL(kTRUE);
71 gStyle->SetPalette(kViridis);
72 gStyle->SetOptStat(0);
74 auto canvasHits =
new TCanvas(
"canvasHits",
"Neuland Hits", 10, 10, 850, 850);
75 canvasHits->Divide(3, 2);
77 hHitX =
new TH1D(
"hHitX",
"Hit X", 300, -150, 150);
80 hHitY =
new TH1D(
"hHitY",
"Hit Y", 300, -150, 150);
83 hHitZ =
new TH1D(
"hHitZ",
"Hit Z", 16, fDistanceToTarget, fDistanceToTarget + 16 * 5);
86 hHitT =
new TH1D(
"hHitT",
"Hit T", 100000, -10000, 10000);
87 hHitTadj =
new TH1D(
"hHitTadj",
"Hit Tadj", 100000, -10000, 10000);
89 hHitTadj->Draw(
"same");
92 hHitE =
new TH1D(
"hHitE",
"Hit E", 1000, 0, 100);
96 hHitMult =
new TH1D(
"hHitMult",
"Hit Multiplicity", 100, 0, 100);
101 run->AddObject(canvasHits);
104 auto canvas3D =
new TCanvas(
"canvas3D",
"Neuland 3D Hits & Clusters", 10, 10, 850, 850);
105 canvas3D->Divide(2, 2);
107 hHits3D =
new TH3D(
"hHits3D",
"Hits3D, nHits > 10", 16, 0, 16 * 5, 50, -125, 125, 50, -125, 125);
108 hHits3D->GetXaxis()->SetTitle(
"Z");
109 hHits3D->GetYaxis()->SetTitle(
"X");
110 hHits3D->GetZaxis()->SetTitle(
"Y");
111 auto lofH = hHits3D->GetListOfFunctions();
113 hHits3D->Draw(
"glcolz");
116 hClusterSize =
new TH1D(
"hClusterSize",
"Cluster Size", 100, 0, 100);
117 hClusterSize->Draw();
119 hClusters3D =
new TH3D(
"hClusters3D",
"Hits 3D, nHits > 10", 16, 0, 16 * 5, 50, -125, 125, 50, -125, 125);
120 hClusters3D->GetXaxis()->SetTitle(
"Z");
121 hClusters3D->GetYaxis()->SetTitle(
"X");
122 hClusters3D->GetZaxis()->SetTitle(
"Y");
123 auto lofC = hClusters3D->GetListOfFunctions();
125 hClusters3D->Draw(
"glcolz");
128 hClusterMult =
new TH1D(
"hClusterMult",
"Cluster Multiplicity", 50, 0, 50);
129 hClusterMult->Draw();
133 run->AddObject(canvas3D);
136 auto canvasCalibr =
new TCanvas(
"canvasCalibr",
"canvasCalibr", 10, 10, 850, 850);
137 canvasCalibr->Divide(2, 2);
139 hEtotVSNClusters =
new TH2D(
"hEtotVSNClusters",
"Calibr", 300, 0, 3000, 50, 0, 50);
140 hEtotVSNClusters->GetXaxis()->SetTitle(
"Total Energy [MeV]");
141 hEtotVSNClusters->GetYaxis()->SetTitle(
"Number of Clusters");
142 hEtotVSNClusters->Draw(
"colz");
144 hEtot =
new TH1D(
"hEtot",
"Etot", 300, 0, 3000);
149 run->AddObject(canvasCalibr);
157 if (std::isnan(fEventHeader->GetTStart()))
162 const auto hits = fNeulandHits.Retrieve();
163 const auto nHits = hits.size();
168 hHitMult->Fill(nHits);
170 for (
const auto& hit : hits)
172 hHitX->Fill(hit->GetPosition().X());
173 hHitY->Fill(hit->GetPosition().Y());
174 hHitZ->Fill(hit->GetPosition().Z());
175 hHitT->Fill(hit->GetT());
176 hHitTadj->Fill(fDistanceToTarget / hit->GetPosition().Mag() * hit->GetT());
177 hHitE->Fill(hit->GetE());
180 const auto clusters = fNeulandClusters.Retrieve();
181 const auto nClusters = clusters.size();
182 hClusterMult->Fill(nClusters);
183 for (
const auto& cluster : clusters)
185 hClusterSize->Fill(cluster->GetSize());
188 if (hits.size() > 10)
190 hHits3D->Reset(
"ICES");
191 for (
const auto& hit : hits)
193 hHits3D->Fill(hit->GetPosition().Z() - fDistanceToTarget,
194 hit->GetPosition().X(),
195 hit->GetPosition().Y(),
198 hClusters3D->Reset(
"ICES");
199 for (
const auto& cluster : clusters)
201 hClusters3D->Fill(cluster->GetPosition().Z() - fDistanceToTarget,
202 cluster->GetPosition().X(),
203 cluster->GetPosition().Y(),
208 const double etot = std::accumulate(clusters.begin(),
214 hEtotVSNClusters->Fill(etot, nClusters);