Belle II Software development
CDCCRTestModule.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include "cdc/modules/cdcCRTest/CDCCRTestModule.h"
10#include <TTree.h>
11#include <framework/gearbox/Const.h>
12#include <framework/core/HistoModule.h>
13#include <framework/datastore/StoreObjPtr.h>
14#include <framework/datastore/RelationArray.h>
15
16#include <genfit/TrackPoint.h>
17#include <genfit/KalmanFitterInfo.h>
18#include <genfit/MeasurementOnPlane.h>
19#include <genfit/MeasuredStateOnPlane.h>
20#include <genfit/StateOnPlane.h>
21
22#include <cdc/translators/RealisticCDCGeometryTranslator.h>
23#include <cdc/translators/RealisticTDCCountTranslator.h>
24#include <cdc/dataobjects/CDCRecoHit.h>
25#include <cdc/dataobjects/CDCSimHit.h>
26#include <TDirectory.h>
27#include <Math/ProbFuncMathCore.h>
28
29using namespace std;
30using namespace Belle2;
31using namespace CDC;
32using namespace genfit;
33//-----------------------------------------------------------------
34// Register the Module
35//-----------------------------------------------------------------
36REG_MODULE(CDCCRTest);
37
38// Implementation
40{
41 setDescription("CDC Cosmic ray test module");
42 setPropertyFlags(c_ParallelProcessingCertified); // specify this flag if you need parallel processing
43 addParam("CorrectToF", m_ToF, "if true, time of flight will take account in t", true);
44 addParam("CorrectToP", m_ToP, "if true, time of Propagation will take account in t", true);
45 addParam("RecoTracksColName", m_recoTrackArrayName, "Name of collection hold genfit::Track", std::string(""));
46 addParam("histogramDirectoryName", m_histogramDirectoryName,
47 "Track fit results histograms will be put into this directory", std::string("trackfit"));
48 addParam("NameOfTree", m_treeName, "name of tree in output file", string("tree"));
49 addParam("fillExpertHistograms", m_fillExpertHistos, "Fill additional histograms", true);
50 addParam("noBFit", m_noBFit, "If true -> #Params ==4, #params ==5 for calculate P-Val", false);
51 addParam("plotResidual", m_plotResidual, "plot biased residual, normalized res and xtplot for all layer", false);
52 addParam("calExpectedDriftTime", m_calExpectedDriftTime, "if true module will calculate expected drift time, it take a time",
53 true);
54 addParam("hitEfficiency", m_hitEfficiency, "calculate hit efficiency(Not work now) true:yes false:No", false);
55 addParam("TriggerPos", m_TriggerPos, "Trigger position use for cut and reconstruct Trigger image", std::vector<double> { -0.6, -13.25, 17.3});
56 addParam("NormTriggerPlaneDirection", m_TriggerPlaneDirection, "Normal trigger plane direction and reconstruct Trigger image",
57 std::vector<double> { 0, 1, 0});
58 addParam("TriggerSize", m_TriggerSize, "Trigger Size, (Width x length)", std::vector<double> {100, 50});
59 addParam("IwireLow", m_low, "Lower boundary of hit dist. Histogram", std::vector<int> {0, 0, 0, 0, 0, 0, 0, 0, 0});
60 addParam("IwireUpper", m_up, "Upper boundary of hit dist. Histogram", std::vector<int> {161, 161, 193, 225, 257, 289, 321, 355, 385});
61 addParam("StoreCDCSimHitInfo", m_StoreCDCSimHitInfo, "Store simulation info related to hit, driftLeng, flight time,z_onwire",
62 false);
63 addParam("EstimateResultForUnFittedLayer", m_EstimateResultForUnFittedLayer,
64 "Calculate residual for Layer that is set unUseInFit", true);
65 addParam("SmallerOutput", m_SmallerOutput, "If true, trigghit position, residual cov,absRes, will not be stored", false);
66 addParam("StoreTrackParams", m_StoreTrackParams, "Store Track Parameter or not, it will be multicount for each hit", true);
67 addParam("StoreHitDistribution", m_MakeHitDist, "Make hit distribution or not", true);
68 addParam("EventT0Extraction", m_EventT0Extraction, "use event t0 extract t0 or not", true);
69 addParam("MinimumPt", m_MinimumPt, "Tracks with transverse momentum smaller than this will not be recorded", 0.);
70}
71
76//------------------------------------------------------------------
77// Function to define histograms
78//-----------------------------------------------------------------
80{
81 m_tree = new TTree(m_treeName.c_str(), "tree");
82 m_tree->Branch("x_mea", &x_mea, "x_mea/D");
83 m_tree->Branch("x_u", &x_u, "x_u/D");
84 m_tree->Branch("x_b", &x_b, "x_b/D");
85 m_tree->Branch("z", &z, "z/D");
86 m_tree->Branch("alpha", &alpha, "alpha/D");
87 m_tree->Branch("theta", &theta, "theta/D");
88 m_tree->Branch("t", &t, "t/D");
89 m_tree->Branch("evtT0", &evtT0, "evtT0/D");
90 m_tree->Branch("adc", &adc, "adc/s");
91 m_tree->Branch("boardID", &boardID, "boardID/I");
92 m_tree->Branch("lay", &lay, "lay/I");
93 m_tree->Branch("weight", &weight, "weight/D");
94 m_tree->Branch("IWire", &IWire, "IWire/I");
95 m_tree->Branch("Pval", &Pval, "Pval/D");
96 m_tree->Branch("ndf", &ndf, "ndf/D");
97 // m_tree->Branch("trighit", &trighit, "trighit/I");
99 m_tree->Branch("d0", &d0, "d0/D");
100 m_tree->Branch("z0", &z0, "z0/D");
101 m_tree->Branch("phi0", &phi0, "phi0/D");
102 m_tree->Branch("tanL", &tanL, "tanL/D");
103 m_tree->Branch("omega", &omega, "omega/D");
104 m_tree->Branch("Pt", &Pt, "Pt/D");
105 }
107 m_tree->Branch("z_sim", &z_sim, "z_sim/D");
108 m_tree->Branch("x_sim", &x_sim, "x_sim/D");
109 m_tree->Branch("dt_flight_sim", &dt_flight_sim, "dt_flight_sim/D");
110 }
111 if (m_calExpectedDriftTime) { // expected drift time, calculated form xfit
112 m_tree->Branch("t_fit", &t_fit, "t_fit/D");
113 }
114 if (!m_SmallerOutput) {
115 m_tree->Branch("tdc", &tdc, "tdc/I");
116 m_tree->Branch("z_prop", &z_prop, "z_prop/D");
117 m_tree->Branch("res_b", &res_b, "res_b/D");
118 m_tree->Branch("res_u", &res_u, "res_u/D");
119 m_tree->Branch("lr", &lr, "lr/I");
120 m_tree->Branch("trigHitPos_x", &trigHitPos_x, "trigHitPos_x/D");
121 m_tree->Branch("trigHitPos_z", &trigHitPos_z, "trigHitPos_z/D");
122 m_tree->Branch("numhits", &numhits, "numhits/I");
123 m_tree->Branch("res_b_err", &res_b_err, "res_b_err/D");
124 m_tree->Branch("res_u_err", &res_u_err, "res_u_err/D");
125 m_tree->Branch("absRes_u", &absRes_u, "absRes_u/D");
126 m_tree->Branch("absRes_b", &absRes_b, "absRes_b/D");
127 m_tree->Branch("dt_prop", &dt_prop, "dt_prop/D");
128 m_tree->Branch("dt_flight", &dt_flight, "dt_flight/D");
129 }
130
131 // int N =m_Nchannel;//Number of Wire per Layer used;
132 TDirectory* oldDir = gDirectory;
133 TDirectory* histDir = oldDir->mkdir(m_histogramDirectoryName.c_str());
134 histDir->cd();
135 m_hNTracks = getHist("hNTracks", "number of tracks", 3, 0, 3);
136 m_hNTracks->GetXaxis()->SetBinLabel(1, "fitted, converged");
137 m_hNTracks->GetXaxis()->SetBinLabel(2, "fitted, not converged");
138 m_hNTracks->GetXaxis()->SetBinLabel(3, "TrackCand, but no Track");
139
140 m_hNDF = getHist("hNDF", "NDF of fitted track;NDF;Tracks", 71, -1, 150);
141 m_hNHits = getHist("hNHits", "#hit of fitted track;#hit;Tracks", 61, -1, 150);
142 m_hNHits_trackcand = getHist("hNHits_trackcand", "#hit of track candidate;#hit;Tracks", 71, -1, 150);
143 m_hNTracksPerEvent = getHist("hNTracksPerEvent", "#tracks/Event;#Tracks;Event", 20, 0, 20);
144 m_hNTracksPerEventFitted = getHist("hNTracksPerEventFitted", "#tracks/Event After Fit;#Tracks;Event", 20, 0, 20);
145 m_hChi2 = getHist("hChi2", "#chi^{2} of tracks;#chi^{2};Tracks", 400, 0, 400);
146 m_hPhi0 = getHist("hPhi0", "#Phi_{0} of tracks;#phi_{0} (Degree);Tracks", 400, -190, 190);
147 m_hAlpha = getHist("hAlpha", "#alpha Dist.;#alpha (Degree);Hits", 360, -90, 90);
148 m_hTheta = getHist("hTheta", "#theta Dist.;#theta (Degree);Hits", 360, 0, 180);
149 m_hPval = getHist("hPval", "p-values of tracks;pVal;Tracks", 1000, 0, 1);
150 m_hEvtT0 = getHist("hEvtT0", "Event T0; EvtT0 (ns); #event", 200, -100, 100);
151
152 m_hTriggerHitZX = getHist("TriggerHitZX", "Hit Position on trigger counter;z(cm);x(cm)", 300, -100, 100, 120, -15, 15);
153 if (m_MakeHitDist) {
154 m_h2DHitDistInCDCHit = getHist("2DHitDistInCDCHit", " CDCHit;WireID;LayerID",
155 m_up[8] - m_low[0], m_low[0], m_up[8], 56, 0, 56);
156 m_h2DHitDistInTrCand = getHist("2DHitDistInTrCand", "Track Cand ;WireID;LayerID",
157 m_up[8] - m_low[0], m_low[0], m_up[8], 56, 0, 56);
158 m_h2DHitDistInTrack = getHist("2DHitDistInTrack", "Fitted Track ;WireID;LayerID",
159 m_up[8] - m_low[0], m_low[0], m_up[8], 56, 0, 56);
160 }
161 if (m_fillExpertHistos) {
162 m_hNDFChi2 = getHist("hNDFChi2", "#chi^{2} of tracks;NDF;#chi^{2};Tracks", 8, 0, 8, 800, 0, 200);
163 m_hNDFPval = getHist("hNDFPval", "p-values of tracks;NDF;pVal;Tracks", 8, 0, 8, 100, 0, 1);
164 }
165 int sl;
166 for (int i = 0; i < 56; ++i) {
167 if (m_hitEfficiency) {
168 m_hHitEff_soft[i] = getHistProfile(Form("hHitEff_soft_L%d", i),
169 Form("hit efficiency(soft) of Layer %d ;Drift distance;Software Efficiency", i), 200, -1, 1);
170 }
171 if (m_MakeHitDist) {
172 if (i < 8) {sl = 0;} else { sl = floor((i - 8) / 6) + 1;}
173 m_hHitDistInCDCHit[i] = getHist(Form("hHitDistInCDCHit_layer%d", i), Form("Hit Dist. ICLayer_%d;WireID;#Hits", i),
174 m_up.at(sl) - m_low.at(sl), m_low.at(sl), m_up.at(sl));
175 m_hHitDistInCDCHit[i]->SetLineColor(kGreen);
176 m_hHitDistInTrCand[i] = getHist(Form("hHitDistInTrCand_layer%d", i), Form("Hit Dist. ICLayer_%d;WireID;#Hits", i),
177 m_up.at(sl) - m_low.at(sl), m_low.at(sl), m_up.at(sl));
178 m_hHitDistInTrCand[i]->SetLineColor(kRed);
179 m_hHitDistInTrack[i] = getHist(Form("hHitDistInTrack_layer%d", i), Form("Hit Dist. ICLayer_%d;WireID;#Hits", i),
180 m_up.at(sl) - m_low.at(sl), m_low.at(sl), m_up.at(sl));
181 }
182 const double normResRange = 20;
183 const double residualRange = 0.3;
184 std::string title, name;
185 if (m_plotResidual) {
186 name = (boost::format("hist_ResidualsU%1%") % i).str();
187 title = (boost::format("unnormalized, unbiased residuals in layer %1%;cm;Tracks") % i).str();
188 m_hResidualU[i] = getHist(name, title, 500, -residualRange, residualRange);
189
190 name = (boost::format("hNormalizedResidualsU%1%") % i).str();
191 title = (boost::format("normalized, unbiased residuals in layer %1%;NDF;#sigma (cm);Tracks") % i).str();
192 m_hNormalizedResidualU[i] = getHist(name, title, 500, -normResRange, normResRange);
193
194 name = (boost::format("DxDt%1%") % i).str();
195 title = (boost::format("Drift Length vs Drift time at Layer_%1%;Drift Length (cm);Drift time (ns)") % i).str();
196 m_hDxDt[i] = getHist(name, title, 200, -1, 1, 450, -50, 400);
197 }
198 if (m_fillExpertHistos) {
199 name = (boost::format("hNDFResidualsU%1%") % i).str();
200 title = (boost::format("unnormalized, unbiased residuals along U in layer %1%;NDF;cm;Tracks") % i).str();
201 m_hNDFResidualU[i] = getHist(name, title, 8, 0, 8, 1000, -residualRange, residualRange);
202
203 name = (boost::format("hNDFNormalizedResidualsU%1%") % i).str();
204 title = (boost::format("normalized, unbiased residuals in layer %1%;NDF;#sigma (cm);Tracks") % i).str();
205 m_hNDFNormalizedResidualU[i] = getHist(name, title, 8, 0, 8, 1000, -normResRange, normResRange);
206 }
207 }
208 oldDir->cd();
209}
210
212{
213 REG_HISTOGRAM
214 m_Tracks.isRequired(m_trackArrayName);
217 m_CDCHits.isRequired(m_cdcHitArrayName);
219 //Store names to speed up creation later
220 m_relRecoTrackTrackName = relRecoTrackTrack.getName();
221
222 for (size_t i = 0; i < m_allHistos.size(); ++i) {
223 m_allHistos[i]->Reset();
224 }
225 B2ASSERT("Trigger Position (TriggerPos) must be 3 components.", m_TriggerPos.size() == 3);
226 B2ASSERT("Normal vector of Trigger Plane (NormTriggerPlaneDirection) must be 3 components.", m_TriggerPlaneDirection.size() == 3);
227 B2ASSERT("Trigger size (TriggerSize) must be 2 component width and length(z direction)", m_TriggerSize.size() == 2);
228 B2ASSERT("List of Lower boundary (IWireLow) ( for histo must be 9 components, equivalent 9 supper layers", m_low.size() == 9);
229 B2ASSERT("List of Upper boundary (IWireUp) for histo must be 9 components, equivalent 9 supper layers", m_low.size() == 9);
230 B2INFO("Trigger Position (" << m_TriggerPos.at(0) << " ," << m_TriggerPos.at(1) << " ," << m_TriggerPos.at(2) << ")");
231}
232
234{
235 evtT0 = 0.;
237
238 /* CDCHit distribution */
239 if (m_MakeHitDist) {
240 for (int i = 0; i < m_CDCHits.getEntries(); ++i) {
241 const Belle2::CDCHit* hit = m_CDCHits[i];
242 m_hHitDistInCDCHit[getICLayer(hit->getISuperLayer(), hit->getILayer())]->Fill(hit->getIWire());
243 m_h2DHitDistInCDCHit->Fill(hit->getIWire(), getICLayer(hit->getISuperLayer(), hit->getILayer()));
244 }
245 }
246 // Loop over Recotracks
247 int nTr = m_RecoTracks.getEntries();
248 m_hNTracksPerEvent->Fill(nTr);
249
250 int nfitted = 0;
251
252 for (int i = 0; i < nTr; ++i) {
253 RecoTrack* track = m_RecoTracks[i];
254 if (track->getDirtyFlag()) {B2INFO("Dirty flag was set for track: " << track->getPositionSeed().Y()); continue;}
255 m_hNHits_trackcand->Fill(track->getNumberOfCDCHits());
256 if (m_MakeHitDist) {
258 }
259 if (!track->hasTrackFitStatus()) {
260 m_hNTracks->Fill("Track not fitted", 1.0);
261 continue;
262 }
263 const genfit::FitStatus* fs = track->getTrackFitStatus();
264 if (!fs || !fs->isFitted()) {
265 m_hNTracks->Fill("Track not fitted", 1.0);
266 continue;
267 }
268 if (!fs->isFitConverged()) {//not fully convergence
269 m_hNTracks->Fill("fitted, not converged", 1.0);
270 B2DEBUG(99, "------Fitted but not converged");
271 continue;
272 }
273
274 m_hNTracks->Fill("fitted, converged", 1.0);
275 B2DEBUG(99, "-------Fitted and Converged");
276
277 nfitted = nfitted + 1;
279 const Belle2::Track* b2track = track->getRelatedFrom<Belle2::Track>();
280 if (!b2track) {B2DEBUG(99, "No relation found"); continue;}
282
283 if (!fitresult) {
284 B2WARNING("track was fitted but Relation not found");
285 continue;
286 }
287
288 if (m_noBFit) {ndf = fs->getNdf() + 1;} // in case no Magnetic field, NDF=4;
289 else {ndf = fs->getNdf();}
290 double Chi2 = fs->getChi2();
291 TrPval = std::max(0., ROOT::Math::chisquared_cdf_c(Chi2, ndf));
292 m_hPval->Fill(TrPval);
293 m_hNDF->Fill(ndf);
294 if (ndf < 15) continue;
296 // event with is fail to extract t0 will be exclude from analysis
297 if (m_eventTimeStoreObject.isValid() && m_eventTimeStoreObject->hasEventT0()) {
298 evtT0 = m_eventTimeStoreObject->getEventT0();
299 m_hEvtT0->Fill(evtT0);
300 } else { continue;}
301 }
302
303 d0 = fitresult->getD0();
304 z0 = fitresult->getZ0();
305 tanL = fitresult->getTanLambda();
306 omega = fitresult->getOmega();
307 phi0 = fitresult->getPhi0() * 180 / M_PI;
308 Pt = fitresult->getMomentum().Rho();
309 m_hPhi0->Fill(phi0);
310 m_hChi2->Fill(Chi2);
311 if (Pt < m_MinimumPt) continue;
312 if (m_hitEfficiency && track->getNumberOfCDCHits() > 30 && TrPval > 0.001) {
313 HitEfficiency(track);
314 }
315 if (m_fillExpertHistos) {
316 m_hNDFChi2->Fill(ndf, fs->getChi2());
317 m_hNDFPval->Fill(ndf, TrPval);
318 }
319 try {
320 plotResults(track);
321 } catch (const genfit::Exception& e) {
322 // at least log that there was something going very wrong
323 B2ERROR("Exception when calling the plotResults method" << e.what());
324 }
325
327 //try {
328 // DONT IGNORE THE EXCEPTION BEING THROWN HERE
330 // plotResults(track);
331 //} catch (...) {
332 //B2ERROR (" fatal 2! ");
333
334 //}
335 }
336 }
337
338 m_hNTracksPerEventFitted->Fill(nfitted);
339}
340
342{
347 bool hittrig = (sqrt((m_trigHitPos.X() - m_TriggerPos[0]) * (m_trigHitPos.X() - m_TriggerPos[0]) +
348 (m_trigHitPos.Y() - m_TriggerPos[1]) * (m_trigHitPos.Y() - m_TriggerPos[1])) < m_TriggerSize[0] / 2
349 && fabs(m_trigHitPos.Z() - m_TriggerPos[2]) < m_TriggerSize[1] / 2) ? true : false;
350 if (hittrig) {trighit = 1;}
351 else {trighit = 0;}
352 static CDCGeometryPar& cdcgeo = CDCGeometryPar::Instance();
354 m_hNHits->Fill(track->getNumberOfCDCHits());
355
356 std::vector<genfit::TrackPoint*> tps = track->getHitPointsWithMeasurement();
357 numhits = tps.size();
358 for (genfit::TrackPoint* tp : tps) {
359 if (!tp->hasRawMeasurements())
360 continue;
361
362 const genfit::AbsMeasurement* raw = tp->getRawMeasurement(0);
363 const CDCRecoHit* rawCDC = dynamic_cast<const CDCRecoHit*>(raw);
364 if (rawCDC) {
365 WireID wireid = rawCDC->getWireID();
366 const genfit::KalmanFitterInfo* kfi = tp->getKalmanFitterInfo();
367 if (!kfi) {B2DEBUG(199, "No Fitter Info: Layer " << wireid.getICLayer()); continue;}
368
369 for (unsigned int iMeas = 0; iMeas < kfi->getNumMeasurements(); ++iMeas) {
370 if ((kfi->getWeights().at(iMeas)) > 0.5) {
371 const genfit::MeasurementOnPlane& residual_b = kfi->getResidual(iMeas, true);
372 const genfit::MeasurementOnPlane& residual_u = kfi->getResidual(iMeas, false);
373 lay = wireid.getICLayer();
374 IWire = wireid.getIWire();
375 if (m_MakeHitDist) {
378 }
379 boardID = cdcgeo.getBoardID(wireid);
380 Pval = TrPval;
381 tdc = rawCDC->getCDCHit()->getTDCCount();
382 adc = rawCDC->getCDCHit()->getADCCount();
383
384 const genfit::MeasuredStateOnPlane& mop = kfi->getFittedState();
385 const B2Vector3D pocaOnWire = mop.getPlane()->getO();//Local wire position
386 const B2Vector3D pocaMom = mop.getMom();
387 alpha = cdcgeo.getAlpha(pocaOnWire, pocaMom) ;
388 theta = cdcgeo.getTheta(pocaMom);
389 //Convert to outgoing
390 x_mea = kfi->getMeasurementOnPlane(iMeas)->getState()(0);
391 x_b = kfi->getFittedState(true).getState()(3);// x fit biased
392 res_b = residual_b.getState()(0);
393 x_u = kfi->getFittedState(false).getState()(3);//x fit unbiased
394 res_u = residual_u.getState()(0);
395 if (x_u > 0) lr = 1;
396 else lr = 0;
397 if (fabs(alpha) > M_PI / 2) {
398 x_b *= -1;
399 res_b *= -1;
400 x_u *= -1;
401 res_u *= -1;
402 }
403 x_mea = copysign(x_mea, x_u);
404 lr = cdcgeo.getOutgoingLR(lr, alpha);
406 alpha = cdcgeo.getOutgoingAlpha(alpha);
407 B2DEBUG(199, "x_unbiased " << x_u << " |left_right " << lr);
408 if (m_calExpectedDriftTime) { t_fit = cdcgeo.getDriftTime(std::abs(x_u), lay, lr, alpha, theta);}
409 alpha *= 180 / M_PI;
410 theta *= 180 / M_PI;
411 m_hAlpha->Fill(alpha);
412 m_hTheta->Fill(theta);
413
414 //B2INFO("resi V " <<residual.getState()(1));
415 // weight_res = residual.getWeight();
416 absRes_b = std::abs(x_b + res_b) - std::abs(x_b);
417 absRes_u = std::abs(x_u + res_u) - std::abs(x_u);
418 weight = residual_u.getWeight();
419 res_b_err = std::sqrt(residual_b.getCov()(0, 0));
420 res_u_err = std::sqrt(residual_u.getCov()(0, 0));
421
422 t = tdcTrans->getDriftTime(tdc, wireid, mop.getTime(), pocaOnWire.Z(), adc);
423 z = pocaOnWire.Z();
424
425 // t = getCorrectedDriftTime(wireid, tdc, adc, z, z0);
427 const CDCSimHit* simhit = rawCDC->getCDCHit()->getRelated<Belle2::CDCSimHit>();
428 if (simhit) {
429 x_sim = simhit->getDriftLength();
430 z_sim = simhit->getPosWire().Z();
431 dt_flight_sim = simhit->getFlightTime();
432 }
433 }
434 m_tree->Fill();
435 if (m_plotResidual) {
436 m_hDxDt[lay]->Fill(x_u, t);
437 m_hResidualU[lay]->Fill(res_b, weight);
438 m_hNormalizedResidualU[lay]->Fill(res_b / sqrt(residual_b.getCov()(0, 0)), weight);
439 }
440 if (m_fillExpertHistos) {
442 m_hNDFResidualU[lay]->Fill(ndf, res_b);
443 m_hNDFNormalizedResidualU[lay]->Fill(ndf, res_b / std::sqrt(residual_b.getCov()(0, 0)), weight);
444 }
445 } //NDF
446 // }//end of if isU
447 }//end of for
448 }//end of rawCDC
449 }//end of for tp
450}//end of func
451
453{
454 for (const RecoHitInformation::UsedCDCHit* cdchit : track->getCDCHitList()) {
455 int iclay = getICLayer(cdchit->getISuperLayer(), cdchit->getILayer());
456 B2DEBUG(99, "In TrackCand: ICLayer: " << iclay << "IWire: " << cdchit->getIWire());
457 m_hHitDistInTrCand[iclay]->Fill(cdchit->getIWire());
458 m_h2DHitDistInTrCand->Fill(cdchit->getIWire(), iclay);
459 }
460}
461
463{
464 B2Vector3D trigpos(m_TriggerPos.at(0), m_TriggerPos.at(1), m_TriggerPos.at(2));
466 const genfit::AbsTrackRep* trackRepresentation = track->getCardinalRepresentation();
467 B2Vector3D pos(-200, 200, 200);
468 try {
469 genfit::MeasuredStateOnPlane mop = track->getMeasuredStateOnPlaneClosestTo(ROOT::Math::XYZVector(trigpos), trackRepresentation);
470 double l = mop.extrapolateToPlane(genfit::SharedPlanePtr(new genfit::DetPlane(trigpos, trigDir)));
471 if (fabs(l) < 1000) pos = mop.getPos();
472 } catch (const genfit::Exception& er) {
473 B2WARNING("extrapolate to Trigger counter failure" << er.what());
474 } catch (const std::runtime_error& er) {
475 B2WARNING("Runtime error encountered: " << er.what());
476 } catch (...) {
477 B2WARNING("Undefined exception encountered.");
478 }
479 return pos;
480}
482{
483 /* static CDCGeometryPar& cdcgeo = CDCGeometryPar::Instance();
484 for (int i = 0; i < 56; ++i) {
485 double rcell = (rinnerlayer[i] + routerlayer[i]) / 2;
486 double arcL = h.getArcLength2DAtCylindricalR(rcell);
487 const B2Vector3D hitpos = h.getPositionAtArcLength2D(arcL);
488 int cellID = cdcgeo.cellId(i, hitpos);
489 B2INFO("Hit at LayerID - CellID: " << i << "-" << cellID);
490 }
491 */
493 for (const RecoHitInformation::UsedCDCHit* cdchit : track->getCDCHitList()) {
494 WireID Wid = WireID(cdchit->getID());
495 const genfit::TrackPoint* tp = track->getCreatedTrackPoint(track->getRecoHitInformation(cdchit));
496 //some hit didn't take account in fitting, so I use left/right info from track finding results.
497 int RLInfo = 0;
498 RecoHitInformation::RightLeftInformation rightLeftHitInformation = track->getRecoHitInformation(cdchit)->getRightLeftInformation();
499 if (rightLeftHitInformation == RecoHitInformation::RightLeftInformation::c_left) {
500 RLInfo = -1;
501 } else if (rightLeftHitInformation == RecoHitInformation::RightLeftInformation::c_right) {
502 RLInfo = 1;
503 } else continue;
504
505 if (!tp->hasRawMeasurements())
506 continue;
507 const genfit::KalmanFitterInfo* kfi = tp->getKalmanFitterInfo();
508 if (!kfi) continue;
509
510 // double max = std::max_element(kfi->getWeights(),kfi->getNumMeasurements());
511 double max = 0.;
512 unsigned short imea = 0;
513 for (unsigned int iMeas = 0; iMeas < kfi->getNumMeasurements(); ++iMeas) {
514 double ww = kfi->getWeights().at(iMeas);
515 if (ww > max) {max = ww; imea = iMeas;}
516 }
517 double xx = kfi->getMeasurementOnPlane(imea)->getState()(0);
518 m_hHitEff_soft[Wid.getICLayer()]->Fill(std::copysign(xx, RLInfo), max);
519 }
521}
522
524{
525 B2INFO("Start estimate residual for un-fitted layer");
526 B2INFO("position seed" << track->getPositionSeed().Y());
527 static CDCGeometryPar& cdcgeo = CDCGeometryPar::Instance();
529 const genfit::AbsTrackRep* trackRepresentation = track->getCardinalRepresentation();
530 x_b = 0; res_b = 0; res_b_err = 0;
531 x_u = 0; res_u = 0; res_u_err = 0;
532 z = 0; dt_flight_sim = 0; z_prop = 0; t = 0;
533 dt_prop = 0; dt_flight = 0; alpha = 0; theta = 0;
534 tdc = 0; adc = 0; lay = 0; IWire = 0;
535 // ndf =0; Pval=0; numhits=0; trigHitPos_x= 0; trigHitPos_z=0;
536 // trighit=1; lr=-1;
537 B2INFO("number of cdchit" << track->getCDCHitList().size());
538 B2INFO("number of point use int fit" << ndf + 4);
539
540 typedef std::pair<double, const RecoHitInformation*> SortingRecoHitPair;
541
542 for (const RecoHitInformation::UsedCDCHit* cdchit : track->getCDCHitList()) {
543 // RecoHitInformation* recoHitInfo = track->getRecoHitInformation(cdchit);
544 if (track->getRecoHitInformation(cdchit)->useInFit()) continue;
545 // yeah is true, but better to check for the above
546 //if ((recoHitInfo->getCreatedTrackPoint())) continue;
547 // This was wrong: the sorting parameter is not the hitID
548 int hitSortingParameter = track->getRecoHitInformation(cdchit)->getSortingParameter();
549
550 SortingRecoHitPair frontSideHit = std::make_pair(0, nullptr);;
551 SortingRecoHitPair backsideSideHit = std::make_pair(0, nullptr);;
552 SortingRecoHitPair hit4extraction; // = std::make_pair(0, nullptr); avoid cppcheck warning.
553
554 //find closest hit to hit which do not fit
555 // if (hitID < track->getNumberOfCDCHits() / 2) { //case for first part of track, searching forward, stop at first choice
556 for (const RecoHitInformation::UsedCDCHit* hit : track->getCDCHitList()) {
557 RecoHitInformation const* recoHitInfo_fw = track->getRecoHitInformation(hit);
558 if (recoHitInfo_fw->useInFit()) { //may be should check fit status of that hit, do it later.
559 frontSideHit = std::make_pair(recoHitInfo_fw->getSortingParameter(), recoHitInfo_fw);
560 break;
561 }
562 }
563 //}
564 // if (hitID > track->getNumberOfCDCHits() / 2) { //case for last part of track, searching backward, and stop at the first choice
565 auto hitListReverse = track->getCDCHitList();
566 std::reverse(hitListReverse.begin(), hitListReverse.end());
567 for (const RecoHitInformation::UsedCDCHit* hit : hitListReverse) {
568 RecoHitInformation const* recoHitInfo_bkw = track->getRecoHitInformation(hit);
569 if (recoHitInfo_bkw->useInFit()) {
570 // also get proper id here
571 backsideSideHit = std::make_pair(recoHitInfo_bkw->getSortingParameter(), recoHitInfo_bkw);
572 break;
573 }
574 }
575 B2DEBUG(99, "forward sorting parameter: " << frontSideHit.first << " |backward sorting parameter = " << backsideSideHit.first);
576 if (std::fabs(frontSideHit.first - hitSortingParameter) < std::fabs(backsideSideHit.first - hitSortingParameter)) {
577 hit4extraction = frontSideHit;
578 } else {
579 hit4extraction = backsideSideHit;
580 }
581
582 // no proper neighbouring hit found
583 if (hit4extraction.second == nullptr)
584 continue;
585
586 auto closestHitTrackPoint = track->getCreatedTrackPoint(hit4extraction.second);
587 // now we need to find the hit behind this sorting param !
588 // but easy: we have already the TrackPoint via the RecoHitInformation
589 genfit::MeasuredStateOnPlane meaOnPlane = closestHitTrackPoint->getFitterInfo(trackRepresentation)->getFittedState(
590 true /* biased version */);
591
592 //start to extrapolation
593 WireID wireid = WireID(cdchit->getID());
594 // double flightTime1 = meaOnPlane.getTime();
595 //Now reconstruct plane for hit
596 genfit::SharedPlanePtr plane = nullptr;
597 try {
598 plane = constructPlane(meaOnPlane, wireid);
599 } catch (const genfit::Exception& e) {
600 B2WARNING("Error happen, can not reconstruct plan for extrapolating" << e.what());
601 continue;
602 }
603 double segmentLength;
604 try {
605 segmentLength = meaOnPlane.extrapolateToPlane(plane);
606 } catch (const genfit::Exception& e) {
607 B2WARNING("Could not extrapolate the fit" << e.what());
608 continue;
609 }
610 IWire = wireid.getIWire();
611 lay = wireid.getICLayer();
612 const B2Vector3D pocaOnWire = meaOnPlane.getPlane()->getO();//Local wire position
613 const B2Vector3D pocaMom = meaOnPlane.getMom();
614 x_u = meaOnPlane.getState()(3);
615 alpha = cdcgeo.getAlpha(pocaOnWire, pocaMom) ;
616 theta = cdcgeo.getTheta(pocaMom);
617 z = pocaOnWire.Z();
618 z_prop = z - cdcgeo.wireBackwardPosition(wireid, CDCGeometryPar::c_Aligned).Z();
619 dt_prop = z_prop / 27.25;
620 //Convert to outgoing
621 if (x_u > 0) lr = 1;
622 else lr = 0;
623 if (fabs(alpha) > M_PI / 2) {
624 x_u *= -1;
625 }
626 lr = cdcgeo.getOutgoingLR(lr, alpha);
628 alpha = cdcgeo.getOutgoingAlpha(alpha);
629 dt_flight = meaOnPlane.getTime();
630 x_mea = tdcTrans->getDriftLength(cdchit->getTDCCount(), wireid, dt_flight, lr, pocaOnWire.Z(), alpha, theta, cdchit->getADCCount());
631 x_mea = std::copysign(x_mea, x_u);
632 res_u = x_mea - x_u;
633 absRes_u = fabs(x_mea) - fabs(x_u);
634 alpha *= 180 / M_PI;
635 theta *= 180 / M_PI;
636 m_hAlpha->Fill(alpha);
637 m_hTheta->Fill(theta);
639 const CDCSimHit* simhit = cdchit->getRelated<Belle2::CDCSimHit>();
640 if (simhit) {
641 x_sim = simhit->getDriftLength();
642 z_sim = simhit->getPosWire().Z();
643 dt_flight_sim = simhit->getFlightTime();
644 }
645 }
646 B2DEBUG(199, "we calculate residua for lay - IWire: " << lay << " - " << IWire);
647 B2DEBUG(199, "distance between two hit" << segmentLength);
648 B2DEBUG(199, "Flight Time (extra | sim)" << dt_flight << " - " << dt_flight_sim);
649 B2DEBUG(199, "DriftLength (cal | sim)" << x_mea << " - " << x_sim);
650 m_tree->Fill();
651 }
652}
653
654const genfit::SharedPlanePtr CDCCRTestModule::constructPlane(const genfit::MeasuredStateOnPlane& state, WireID m_wireID)
655{
656 // We reconstruct plane from measuedStateOnPlane from one fitted hit.
657 // because I don't want to change state of this plane so I create other state to extrapolate.
658 // first: extrapolate to wire (ideal geometry, nosag) to find z pos than get virtual wire pos due to sag,
659 // extrapolate again to found z pos and U.
661 const StateOnPlane stateOnPlane = StateOnPlane(state.getState(), state.getPlane(), state.getRep());
662 genfit::StateOnPlane st(stateOnPlane);
663
664 const B2Vector3D& Wire1PosIdeal(cdcgeoTrans->getWireBackwardPosition(m_wireID));
665 const B2Vector3D& Wire2PosIdeal(cdcgeoTrans->getWireForwardPosition(m_wireID));
666
667 // unit vector of wire direction
668 B2Vector3D WireDirectionIdeal = Wire2PosIdeal - Wire1PosIdeal;
669 WireDirectionIdeal.SetMag(1.);//normalized
670
671 // extrapolate to find z
672 const genfit::AbsTrackRep* rep = state.getRep();
673 rep->extrapolateToLine(st, Wire1PosIdeal, WireDirectionIdeal);
674 const B2Vector3D& PocaIdeal = rep->getPos(st);
675
676 double zPOCA = (Wire1PosIdeal.Z()
677 + WireDirectionIdeal.Dot(PocaIdeal - Wire1PosIdeal) * WireDirectionIdeal.Z());
678
679 // Now re-extrapolate to new wire direction, wire sag was taking account.
680 const B2Vector3D& wire1(cdcgeoTrans->getWireBackwardPosition(m_wireID, zPOCA));
681 const B2Vector3D& wire2(cdcgeoTrans->getWireForwardPosition(m_wireID, zPOCA));
682
683 // unit vector of wire direction (include sag)
684 B2Vector3D wireDirection = wire2 - wire1;
685 wireDirection.SetMag(1.);
686
687 // extrapolate to find poca
688 rep->extrapolateToLine(st, wire1, wireDirection);
689 const B2Vector3D& poca = rep->getPos(st);
690 B2Vector3D dirInPoca = rep->getMom(st);
691 dirInPoca.SetMag(1.);
692 const B2Vector3D& pocaOnWire = wire1 + wireDirection.Dot(poca - wire1) * wireDirection;
693 if (fabs(wireDirection.Angle(dirInPoca)) < 0.01) {
694 B2WARNING("cannot construct det plane, track parallel with wire");
695 }
696 // construct orthogonal (unit) vector for plane
697 const B2Vector3D& U = wireDirection.Cross(dirInPoca);
698 genfit::SharedPlanePtr pl = genfit::SharedPlanePtr(new genfit::DetPlane(pocaOnWire, U, wireDirection));
699 return pl;
700}
701
void SetMag(DataType mag)
Set magnitude keeping theta and phi constant.
Definition B2Vector3.h:184
DataType Z() const
access variable Z (= .at(2) without boundary check)
Definition B2Vector3.h:439
B2Vector3< DataType > Cross(const B2Vector3< DataType > &p) const
Cross product.
Definition B2Vector3.h:298
DataType Dot(const B2Vector3< DataType > &p) const
Scalar product.
Definition B2Vector3.h:292
DataType Angle(const B2Vector3< DataType > &q) const
The angle w.r.t.
Definition B2Vector3.h:304
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Definition CDCHit.h:40
unsigned short getIWire() const
Getter for iWire.
Definition CDCHit.h:166
short getTDCCount() const
Getter for TDC count.
Definition CDCHit.h:219
unsigned short getADCCount() const
Getter for integrated charge.
Definition CDCHit.h:230
unsigned short getISuperLayer() const
Getter for iSuperLayer.
Definition CDCHit.h:184
unsigned short getILayer() const
Getter for iLayer.
Definition CDCHit.h:172
This class is used to transfer CDC information to the track fit.
Definition CDCRecoHit.h:32
WireID getWireID() const
Getter for WireID object.
Definition CDCRecoHit.h:49
const CDCHit * getCDCHit() const
get the pointer to the CDCHit object that was used to create this CDCRecoHit object.
Definition CDCRecoHit.h:112
Example Detector.
Definition CDCSimHit.h:21
double getFlightTime() const
The method to get flight time.
Definition CDCSimHit.h:183
B2Vector3D getPosWire() const
The method to get position on wire.
Definition CDCSimHit.h:198
double getDriftLength() const
The method to get drift length.
Definition CDCSimHit.h:180
StoreObjPtr< EventT0 > m_eventTimeStoreObject
Event timing.
std::string m_recoTrackArrayName
Belle2::RecoTrack StoreArray name.e.
double m_MinimumPt
Minimum Transverse momentum of tracks.
TProfile * getHistProfile(const char *name, const char *title, int nBins, double x0, double x1)
Create profile plot.
int trighit
Trigger hit information.
bool m_calExpectedDriftTime
Calculate expected drift time from x_fit or not.
double x_sim
Simulation DriftLength .
TTree * m_tree
Output tree recording the information of each hit.
double res_b
Biased residual.
double alpha
Entrance Azimuthal angle of hit (degree).
void getHitDistInTrackCand(const RecoTrack *track)
Make hit distribution from track candidate.
TH1 * m_hNHits
Number of Hits per track.
bool m_plotResidual
Process track to get the hit information of fitted track.
double res_u_err
Unbiased residual error.
TH1 * m_hNHits_trackcand
Number of Hits per trackCand.
B2Vector3D m_trigHitPos
Trigger position.
void initialize() override
Initializes the Module.
StoreArray< TrackFitResult > m_TrackFitResults
Track fit results.
double absRes_b
absolute value of biased residual.
bool m_StoreTrackParams
Store Track parameter or not.
void event() override
Event action (main routine).
double dt_flight
Time of flight.
bool m_SmallerOutput
make output smaller by ignore some variable.
void HitEfficiency(const Belle2::RecoTrack *track)
Cal Hit eff.
TH1 * m_hHitDistInTrack[56]
Hit Dist.
std::string m_cdcHitArrayName
Belle2::CDCHit StoreArray name.
double res_u
Unbiased residual.
TH1 * m_hPhi0
Phi0 of ttrack, see Helix.
TH1 * m_hNormalizedResidualU[56]
Residual distribution normalized with tracking error.
TH1 * m_hNTracks
Number of track fitted, Convergence, not conv, not fit.
static int getICLayer(int slayer, int ilayer)
Convert slayer and ilayer to iclayer.
TH1 * m_hHitDistInCDCHit[56]
Hit Dist.
double z0
Track Parameter, z0.
bool m_hitEfficiency
calculate hit eff or not, Haven't finished.
std::string m_relRecoTrackTrackName
Relation between RecoTrack and Belle2:Track.
std::vector< int > m_low
lower channel list for each board.
void plotResults(Belle2::RecoTrack *track)
Plot track parameters and related variables.
const genfit::SharedPlanePtr constructPlane(const genfit::MeasuredStateOnPlane &state, WireID m_wireID)
Construct a plane for the hit.
TH2 * m_hNDFNormalizedResidualU[56]
Normalized residual vs.
double Pval
P-value of fitted track.
double z_prop
Propagation Length along the sense wire.
double res_b_err
Biased residual error.
double t
Measurement Drift time.
TH2 * m_hNDFPval
Degree-of-freedom vs Probability histo.
TH1 * m_hTheta
Theta of each Hit.
TH1 * m_hNTracksPerEvent
Number of TrackCand per Event.
std::string m_histogramDirectoryName
subdir where to place the histograms.
void getResidualOfUnFittedLayer(Belle2::RecoTrack *track)
Calculate residual for Layers which didn't use int fitting.
double omega
Track Parameter, omega.
double weight
Weight of hit.
double Pt
Transverse momentum.
double x_b
X_fit for biased track fit.
double t_fit
Drift time calculated from x_fit.
bool m_fillExpertHistos
Fill some histogram for monitoring fit quality.
TH1 * m_hAlpha
Alpha of each Hit.
std::string m_trackArrayName
Belle2::Track StoreArray name.
double z_sim
Z of hit on wire (simulation).
const Belle2::TrackFitResult * fitresult
Track fit result.
double TrPval
P-value of fitted track.
bool m_MakeHitDist
Switch to make histograms of hit distribution.
TH2 * m_hNDFChi2
Chi2 vs degree-of-freedom histo.
bool m_noBFit
fit incase no magnetic Field of not, if true, NDF=4 in cal P-value
bool m_EstimateResultForUnFittedLayer
Calculate residual for layer that we do not use in track fitting.
int boardID
Electrical Board ID.
double z
Z of hit on wire.
std::vector< TH1 * > m_allHistos
A list of 1d histograms.
TProfile * m_hHitEff_soft[56]
Hit efficiency of each layer, software.
TH2 * m_h2DHitDistInTrack
2D Hit Dist..(ICLay vs IWire) have weight>0.5 after fit with DAF
double trigHitPos_x
X-position of track at trigger counter.
std::string m_trackFitResultArrayName
Belle2::TrackFitResult StoreArray name.
double dt_prop
Time of propagation.
bool m_ToP
Enable to correct ToP if true.
double x_u
X_fit for unbiased track fit.
double theta
Entrance Polar angle of hit (degree).
std::vector< int > m_up
upper channel list for each board.
TH1 * m_hNTracksPerEventFitted
Number of TrackCand per Event.
bool m_ToF
Enable to correct ToF if true.
TH1 * m_hPval
Fit Probability histo.
B2Vector3D getTriggerHitPosition(Belle2::RecoTrack *track)
extrapolation track to trigger counter plane (y position).
std::string m_treeName
Name of tree for the output file.
double d0
Track Parameter, d0.
StoreArray< RecoTrack > m_RecoTracks
Tracks.
TH1 * m_hHitDistInTrCand[56]
Hit Dist.
StoreArray< Track > m_Tracks
Tracks.
virtual ~CDCCRTestModule() override
Destructor.
TH2 * m_h2DHitDistInTrCand
2D Hit Dist.
std::vector< double > m_TriggerPlaneDirection
Nominal center position of trigger counter.
TH2 * m_hDxDt[56]
Unbiased x_fit vs.
TH2 * m_hNDFResidualU[56]
Residual vs.
double tanL
Track Parameter, tanL.
unsigned short adc
adc value.
bool m_StoreCDCSimHitInfo
Store CDCSimHit Information.
double phi0
Track Parameter, phi0.
double trigHitPos_z
Z-position of track at trigger counter.
std::vector< double > m_TriggerPos
Nominal center position of trigger counter.
bool m_EventT0Extraction
use Event T0 extract t0 or not.
double ndf
degree of freedom.
double absRes_u
absolute value of unbiased residual.
TH1 * m_hNDF
Number of Degree Freedom.
TH1 * m_hResidualU[56]
Residual distribution (in cm)
TH2 * m_hTriggerHitZX
Trigger hit image.
std::vector< double > m_TriggerSize
Size of trigger counter (Width x length).
TH2 * m_h2DHitDistInCDCHit
2D Hit Dist.
TH1 * getHist(const char *name, const char *title, int nBins, double x0, double x1)
Create 1D histogram.
double dt_flight_sim
Time of flight (Simulation).
void defineHisto() override
Histogram definitions such as TH1(), TH2(), TNtuple(), TTree()....
StoreArray< CDCHit > m_CDCHits
CDC hits.
double x_mea
measure drift length (signed by left right).
The Class for CDC Geometry Parameters.
double getTheta(const B2Vector3D &momentum) const
Returns track incident angle (theta in rad.).
unsigned short getBoardID(const WireID &wID) const
Returns frontend board id. corresponding to the wire id.
static unsigned short getOutgoingLR(const unsigned short lr, const double alpha)
Converts incoming-lr to outgoing-lr.
double getAlpha(const B2Vector3D &posOnWire, const B2Vector3D &momentum) const
Returns track incident angle in rphi plane (alpha in rad.).
const B2Vector3D wireBackwardPosition(uint layerId, int cellId, EWirePosition set=c_Base) const
Returns the backward position of the input sense wire.
static double getOutgoingAlpha(const double alpha)
Converts incoming- to outgoing-alpha.
double getDriftTime(double dist, unsigned short layer, unsigned short lr, double alpha, double theta) const
Return the drift time to the sense wire.
static double getOutgoingTheta(const double alpha, const double theta)
Converts incoming- to outgoing-theta.
static CDCGeometryPar & Instance(const CDCGeometry *=nullptr)
Static method to get a reference to the CDCGeometryPar instance.
This class uses the realistic detector geometry (the one after alignment procedure) for the translati...
const B2Vector3D getWireBackwardPosition(const WireID &wireID) override
Get wire position at backward end.
const B2Vector3D getWireForwardPosition(const WireID &wireID) override
Get wire position at forward end.
Translator mirroring the realistic Digitization.
double getDriftLength(unsigned short tdcCount, const WireID &wireID=WireID(), double timeOfFlightEstimator=0, bool leftRight=false, double z=0, double alpha=0, double theta=static_cast< double >(TMath::Pi()/2.), unsigned short adcCount=0) override
Get Drift length.
double getDriftTime(unsigned short tdcCount, const WireID &wireID, double timeOfFlightEstimator, double z, unsigned short adcCount) override
Get Drift time.
static const ChargedStable muon
muon particle
Definition Const.h:661
HistoModule()
Constructor.
Definition HistoModule.h:32
void setDescription(const std::string &description)
Sets the description of the module.
Definition Module.cc:214
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition Module.cc:208
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition Module.h:80
This class stores additional information to every CDC/SVD/PXD hit stored in a RecoTrack.
RightLeftInformation
The RightLeft information of the hit which is only valid for CDC hits.
CDCHit UsedCDCHit
Define, use of CDC hits as CDC hits (for symmetry).
bool useInFit() const
Get the flag, whether this his should be used in a fit or not.
unsigned int getSortingParameter() const
Get the sorting parameter.
This is the Reconstruction Event-Data Model Track.
Definition RecoTrack.h:79
Low-level class to create/modify relations between StoreArrays.
T * getRelated(const std::string &name="", const std::string &namedRelation="") const
Get the object to or from which this object has a relation.
const std::string & getName() const
Return name under which the object is saved in the DataStore.
double getChi2() const
Get chi2 given NDF and p-value.
Class that bundles various TrackFitResults.
Definition Track.h:25
const TrackFitResult * getTrackFitResult(const Const::ChargedStable &chargedStable) const
Default Access to TrackFitResults.
Definition Track.cc:30
Class to identify a wire inside the CDC.
Definition WireID.h:34
unsigned short getICLayer() const
Getter for continuous layer numbering.
Definition WireID.cc:24
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition Module.h:559
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition Module.h:649
B2Vector3< double > B2Vector3D
typedef for common usage with double
Definition B2Vector3.h:522
double sqrt(double a)
sqrt for double
Definition beamHelpers.h:28
Abstract base class for different kinds of events.
STL namespace.