20#include "FairLogger.h"
21#include "FairRootManager.h"
22#include "R3BLosHitData.h"
24#include "TClonesArray.h"
33 , fFirstPlaneHorisontal(kFALSE)
41 : FairTask(name, iVerbose)
43 , fFirstPlaneHorisontal(kFALSE)
54 FairRootManager* fMan = FairRootManager::Instance();
57 LOG(fatal) <<
"FairRootManager not found";
59 fLandDigi =
dynamic_cast<TClonesArray*
>(fMan->GetObject(
"NeulandHits"));
60 fLosHit =
dynamic_cast<TClonesArray*
>(fMan->GetObject(
"LosHit"));
68 if (!fLosHit || fLosHit->GetEntriesFast() == 0)
71 R3BLosHitData* losHit =
dynamic_cast<R3BLosHitData*
>(fLosHit->At(0));
73 Double_t startTime = 0;
77 if (fLandDigi && fLandDigi->GetEntriesFast() > 0)
79 Int_t nLandDigi = fLandDigi->GetEntriesFast();
82 Double_t time, tof, norm_tof;
83 Double_t qdc, qdcL, qdcR;
88 for (Int_t i = 0; i < nLandDigi; i++)
100 l = TMath::Sqrt(x * x + y * y + z * z);
105 fh_land_qdcbarid->Fill(barId, qdc);
106 fh_land_yx->Fill(x, y);
109 fh_land_yx1->Fill(x, y);
111 else if (barId < 101)
113 fh_land_yx2->Fill(x, y);
116 fh_los_corr->Fill(time, startTime);
118 fh_land_barid->Fill(barId);
119 fh_land_timebarid->Fill(barId, time);
120 tof = time - startTime - fTimeOffset;
122 norm_tof = tof - (l - 1300.) / beta;
123 fh_land_qdctof->Fill(norm_tof, qdc);
124 fh_land_tofbarid->Fill(barId, tof);
125 fh_land_lbarid->Fill(barId, l);
126 fh_land_ltime->Fill(tof, l);
127 fh_land_betabarid->Fill(barId, beta);
128 fh_land_tof->Fill(tof);
129 if (beta > 29.7 && beta < 30.2)
130 fh_land_norm_tof->Fill(norm_tof);
132 fh_land_beta->Fill(beta);
133 fh_land_qdc->Fill(qdc);
134 if (beta > 16 && beta < 26)
135 fh_land_qdc_cut->Fill(qdc);
139 if (0 == (fnEvents % 100000))
141 LOG(info) <<
"R3BNeulandHitHist : " << fnEvents <<
" events collected, start time=" << startTime;
144 LOG(info) <<
", mean time=" << (tmean / (Double_t)count);
153void R3BNeulandHitHist::CreateHistos()
155 fh_land_barid =
new TH1F(
"h_land_barid",
"Bar ID", fNofBars, (Double_t)fNofBars + 0.5, 100.5);
157 new TH2F(
"h_land_qdcbarid",
"QDC vs Bar ID", fNofBars, 0.5, (Double_t)fNofBars + 0.5, 2000, 0., 40.);
159 new TH2F(
"h_land_timebarid",
"Time vs Bar ID", fNofBars, 0.5, (Double_t)fNofBars + 0.5, 4000, 0., 2000.);
161 new TH2F(
"h_land_tofbarid",
"ToF vs Bar ID", fNofBars, 0.5, (Double_t)fNofBars + 0.5, 1000, 0., 100.);
162 fh_land_tof =
new TH1F(
"h_land_tof",
"ToF", 1000, 0., 100.);
163 fh_land_qdctof =
new TH2F(
"h_land_qdctof",
"QDC vs ToF", 2000, -50., 150., 2000, 0., 40.);
165 new TH2F(
"h_land_betabarid",
"Velocity vs Bar ID", fNofBars, 0.5, (Double_t)fNofBars + 0.5, 500, 0., 50.);
167 new TH2F(
"h_land_lbarid",
"Length vs Bar ID", fNofBars, 0.5, (Double_t)fNofBars + 0.5, 1000, 700., 900.);
168 fh_land_ltime =
new TH2F(
"h_land_ltime",
"Length vs Bar ID", 4000, 0., 2000., 1000, 700., 900.);
169 fh_land_yx =
new TH2F(
"h_land_yx",
"Y vs X", 340, -170., 170., 340, -170., 170.);
170 if (fFirstPlaneHorisontal)
172 fh_land_yx1 =
new TH2F(
"h_land_yx1",
"Y vs X", 340, -170., 170., 68, -170., 170.);
173 fh_land_yx2 =
new TH2F(
"h_land_yx2",
"Y vs X", 68, -170., 170., 340, -170., 170.);
177 fh_land_yx1 =
new TH2F(
"h_land_yx1",
"Y vs X", 68, -170., 170., 340, -170., 170.);
178 fh_land_yx2 =
new TH2F(
"h_land_yx2",
"Y vs X", 340, -170., 170., 68, -170., 170.);
180 fh_land_beta =
new TH1F(
"h_land_beta",
"Velocity", 4500, -10., 35.);
181 fh_land_qdc =
new TH1F(
"h_land_qdc",
"QDC", 2000, 0., 40.);
182 fh_land_qdc_cut =
new TH1F(
"h_land_qdc_cut",
"QDC cut", 2000, 0., 40.);
183 fh_los_time =
new TH1F(
"h_los_time",
"LOS Time", 2000, -1000., -800.);
184 fh_los_corr =
new TH2F(
"h_los_corr",
"LOS vs NeuLAND", 2000, 700., 900., 2000, -1000., -800.);
186 fh_land_norm_tof =
new TH1F(
"h_land_norm_tof",
"norm. ToF", 1000, 40., 50.);
189void R3BNeulandHitHist::WriteHistos()
191 fh_land_barid->Write();
192 fh_land_qdcbarid->Write();
193 fh_land_tof->Write();
194 fh_land_qdctof->Write();
195 fh_land_timebarid->Write();
196 fh_land_tofbarid->Write();
198 fh_land_yx1->Write();
199 fh_land_yx2->Write();
200 fh_land_lbarid->Write();
201 fh_land_ltime->Write();
202 fh_land_beta->Write();
203 fh_land_qdc->Write();
204 fh_land_qdc_cut->Write();
205 fh_land_betabarid->Write();
206 fh_los_time->Write();
207 fh_los_corr->Write();
208 fh_land_norm_tof->Write();
ClassImp(R3B::Neuland::Cal2HitPar)
virtual void Exec(Option_t *option)
virtual ~R3BNeulandHitHist()
virtual void FinishTask()
virtual InitStatus Init()
auto GetQdcR() const -> double
auto GetPaddle() const -> int
auto GetT() const -> double
auto GetPosition() const -> TVector3
auto GetQdcL() const -> double
auto GetE() const -> double