Newer
Older
TB_Chris / TbAlgorithms / src / .svn / text-base / TbTrackPlots.cpp.svn-base
  1. // ROOT
  2. #include "TMath.h"
  3.  
  4. // Gaudi
  5. #include "GaudiKernel/PhysicalConstants.h"
  6. #include "GaudiUtils/HistoLabels.h"
  7.  
  8. // Tb/TbEvent
  9. #include "Event/TbHit.h"
  10.  
  11. // Tb/TbKernel
  12. #include "TbKernel/TbConstants.h"
  13. #include "TbKernel/TbModule.h"
  14.  
  15. #include "GaudiUtils/Aida2ROOT.h"
  16. #include "TH1D.h"
  17. #include "TF1.h"
  18. #include "TFile.h"
  19. // Local
  20. #include "TbTrackPlots.h"
  21.  
  22. using namespace Gaudi::Utils::Histos;
  23.  
  24. DECLARE_ALGORITHM_FACTORY(TbTrackPlots)
  25.  
  26. //=============================================================================
  27. // Standard constructor
  28. //=============================================================================
  29. TbTrackPlots::TbTrackPlots(const std::string& name, ISvcLocator* pSvcLocator)
  30. : TbAlgorithm(name, pSvcLocator),
  31. m_parChi2("", 0., 30., 300),
  32. m_parResidualsXY("", -0.2, 0.2, 500),
  33. m_parResidualsT("", -50., 50., 2000),
  34. m_parXY("", -20, 20, 500),
  35. m_parSlope("", -0.0001, 0.0001, 500),
  36. m_parCentral("", 4, 10, 1),
  37. m_trackFit(nullptr) {
  38.  
  39. declareProperty("TrackLocation",
  40. m_trackLocation = LHCb::TbTrackLocation::Default);
  41. declareProperty("ClusterLocation",
  42. m_clusterLocation = LHCb::TbClusterLocation::Default);
  43. declareProperty("TrackFitTool", m_trackFitTool = "TbTrackFit");
  44.  
  45. declareProperty("ParametersChi2", m_parChi2);
  46. declareProperty("ParametersResidualsXY", m_parResidualsXY);
  47. declareProperty("ParametersResidualsT", m_parResidualsT);
  48. declareProperty("ParametersXY", m_parXY);
  49. declareProperty("ParametersSlope", m_parSlope);
  50. declareProperty("ParametersCentral", m_parCentral);
  51. }
  52.  
  53. //=============================================================================
  54. // Initialization
  55. //=============================================================================
  56. StatusCode TbTrackPlots::initialize() {
  57.  
  58. // Initialise the base class.
  59. StatusCode sc = TbAlgorithm::initialize();
  60. if (sc.isFailure()) return sc;
  61. // Setup the track fit tool.
  62. m_trackFit = tool<ITbTrackFit>(m_trackFitTool, "Fitter", this);
  63. if (!m_trackFit) return Error("Cannot retrieve track fit tool.");
  64. setupPlots();
  65. return StatusCode::SUCCESS;
  66. }
  67.  
  68. //=============================================================================
  69. // Finalizer
  70. //=============================================================================
  71. StatusCode TbTrackPlots::finalize() {
  72.  
  73. // Fill plots used after all events have been evaluated.
  74. for (unsigned int i = 0; i < m_nPlanes; ++i) {
  75. double num =
  76. m_hnTrackedClusters->binHeight(m_hnTrackedClusters->coordToIndex(i));
  77. double denom =
  78. m_hnClustersPerPlane->binHeight(m_hnClustersPerPlane->coordToIndex(i));
  79. double frac = num / denom;
  80. m_hFractionTrackedClusters->fill(i, frac);
  81.  
  82. num = m_hnTracksInterceptCentral->binHeight(
  83. m_hnTracksInterceptCentral->coordToIndex(i));
  84. denom = m_hnClustersPerPlaneCentral->binHeight(
  85. m_hnClustersPerPlaneCentral->coordToIndex(i));
  86. frac = num / denom;
  87. m_hRatioTracksClustersCentral->fill(i, frac);
  88. }
  89.  
  90. // Code for saving some residuals in a more useful format.
  91. // TFile * fOut = new TFile("UnbiasedLocalResolutionsPerPlane.root",
  92. // "RECREATE");
  93. // TH1F * xPerPlane = new TH1F("xPerPlane", "xPerPlane", m_nPlanes, 0,
  94. // m_nPlanes);
  95. // TH1F * yPerPlane = new TH1F("yPerPlane", "yPerPlane", m_nPlanes, 0,
  96. // m_nPlanes);
  97. //
  98. // for (unsigned int i = 0; i < m_nPlanes; ++i) {
  99. // if (masked(i)) continue;
  100. // TH1D * proper_UnbiasedResLocalX =
  101. // Gaudi::Utils::Aida2ROOT::aida2root(m_hUnbiasedResLX[i]);
  102. // TH1D * proper_UnbiasedResLocalY =
  103. // Gaudi::Utils::Aida2ROOT::aida2root(m_hUnbiasedResLY[i]);
  104. //
  105. // proper_UnbiasedResLocalX->Fit("gaus");
  106. // proper_UnbiasedResLocalY->Fit("gaus");
  107. //
  108. // xPerPlane->SetBinContent(i+1,
  109. // proper_UnbiasedResLocalX->GetFunction("gaus")->GetParameter(2));
  110. // yPerPlane->SetBinContent(i+1,
  111. // proper_UnbiasedResLocalY->GetFunction("gaus")->GetParameter(2));
  112. // }
  113. //
  114. // xPerPlane->Write();
  115. // yPerPlane->Write();
  116.  
  117. return TbAlgorithm::finalize();
  118. }
  119.  
  120. //=============================================================================
  121. // Main execution
  122. //=============================================================================
  123. StatusCode TbTrackPlots::execute() {
  124.  
  125. // Grab the tracks.
  126. LHCb::TbTracks* tracks = getIfExists<LHCb::TbTracks>(m_trackLocation);
  127. if (!tracks) {
  128. return Error("No tracks in " + m_trackLocation);
  129. }
  130.  
  131. // Fill plots that loop over tracks.
  132. fillTrackLoopPlots(tracks);
  133.  
  134. // Fill plots that loop over clusters (that have tracking information).
  135. for (unsigned int i = 0; i < m_nPlanes; ++i) {
  136. // Get the clusters for this plane.
  137. const std::string clusterLocation = m_clusterLocation + std::to_string(i);
  138. LHCb::TbClusters* clusters = getIfExists<LHCb::TbClusters>(clusterLocation);
  139. if (!clusters) continue;
  140. fillClusterLoopPlots(clusters, i);
  141. }
  142.  
  143. return StatusCode::SUCCESS;
  144. }
  145.  
  146. //=============================================================================
  147. // Fill track loop plots.
  148. //=============================================================================
  149. void TbTrackPlots::fillTrackLoopPlots(LHCb::TbTracks* tracks) {
  150.  
  151. for (LHCb::TbTrack* track : *tracks) {
  152. m_hChi2->fill(track->chi2PerNdof());
  153. m_hTrackSize->fill(track->size());
  154. m_hProb->fill(TMath::Prob(track->chi2(), track->ndof()));
  155. m_hSlopeXZ->fill(track->firstState().tx());
  156. m_hSlopeYZ->fill(track->firstState().ty());
  157. m_hFirstStateX->fill(track->firstState().x());
  158. m_hFirstStateY->fill(track->firstState().y());
  159. m_hSlopeXvsX->fill(track->firstState().tx(), track->firstState().x());
  160. m_hSlopeYvsY->fill(track->firstState().ty(), track->firstState().y());
  161. // Calculate the intercept of the track with the detector planes.
  162. for (unsigned int i = 0; i < m_nPlanes; ++i) {
  163. const Gaudi::XYZPoint intercept = geomSvc()->intercept(track, i);
  164. m_hIntercepts[i]->fill(intercept.x(), intercept.y());
  165. // Plot the intercepts of tracks with/without an associated trigger.
  166. if (track->triggers().empty()) {
  167. m_hInterceptsNonAssociated[i]->fill(intercept.x(), intercept.y());
  168. } else {
  169. m_hInterceptsAssociated[i]->fill(intercept.x(), intercept.y());
  170. }
  171. if (intercept.x() > m_parCentral.lowEdge() &&
  172. intercept.x() < m_parCentral.highEdge() &&
  173. intercept.y() > m_parCentral.lowEdge() &&
  174. intercept.y() < m_parCentral.highEdge())
  175. m_hnTracksInterceptCentral->fill(i);
  176. }
  177. const auto triggers = track->triggers();
  178. for (auto trigger : triggers) {
  179. m_hTimeDifferenceTrackTrigger->fill(trigger->htime() - track->htime());
  180. }
  181. fillResiduals(track);
  182.  
  183. // Delta angle.
  184. LHCb::TbTrack track1, track2;
  185. for (unsigned int i = 0; i < track->clusters().size(); i++) {
  186. if (track->clusters()[i]->plane() < 4)
  187. track1.addToClusters(track->clusters()[i]);
  188. else
  189. track2.addToClusters(track->clusters()[i]);
  190. }
  191. if (track2.clusters().size() > 2 && track1.clusters().size() > 2) {
  192. m_trackFit->fit(&track1);
  193. m_trackFit->fit(&track2);
  194. const double dtx = track2.firstState().tx() - track1.firstState().tx();
  195. const double dty = track2.firstState().ty() - track1.firstState().ty();
  196. plot(dtx, "delAngleArmsX", "delAngleArmsX", -0.001, 0.001, 300);
  197. plot(dty, "delAngleArmsY", "delAngleArmsY", -0.001, 0.001, 300);
  198. }
  199. }
  200. }
  201.  
  202. //=============================================================================
  203. // Fill residual distributions.
  204. //=============================================================================
  205. void TbTrackPlots::fillResiduals(LHCb::TbTrack* track) {
  206.  
  207. const auto clusters = track->clusters();
  208. for (auto it = clusters.cbegin(), end = clusters.cend(); it != end; ++it) {
  209. const unsigned int plane = (*it)->plane();
  210.  
  211. // Mask the plane under consideration to calculate the unbiased residuals.
  212. m_trackFit->maskPlane(plane);
  213. m_trackFit->fit(track);
  214.  
  215. // Calculate the global unbiased residuals.
  216. const auto interceptUG = geomSvc()->intercept(track, plane);
  217. const double dxug = (*it)->x() - interceptUG.x();
  218. const double dyug = (*it)->y() - interceptUG.y();
  219. m_hUnbiasedResGX[plane]->fill(dxug);
  220. m_hUnbiasedResGY[plane]->fill(dyug);
  221.  
  222. // Calculate the local unbiased residuals.
  223. const auto interceptUL = geomSvc()->globalToLocal(interceptUG, plane);
  224. const double dxul = (*it)->xloc() - interceptUL.x();
  225. const double dyul = (*it)->yloc() - interceptUL.y();
  226. m_hUnbiasedResLX[plane]->fill(dxul);
  227. m_hUnbiasedResLY[plane]->fill(dyul);
  228.  
  229. // Re-include the plane under consideration in the fit and refit.
  230. m_trackFit->unmaskPlane(plane);
  231. m_trackFit->fit(track);
  232.  
  233. // Calculate the global biased residuals in x and y.
  234. const Gaudi::XYZPoint interceptG = geomSvc()->intercept(track, plane);
  235. const double dxg = (*it)->x() - interceptG.x();
  236. const double dyg = (*it)->y() - interceptG.y();
  237. m_hBiasedResGX[plane]->fill(dxg);
  238. m_hBiasedResGY[plane]->fill(dyg);
  239.  
  240. // Calculate the local biased residuals.
  241. const auto interceptL = geomSvc()->globalToLocal(interceptG, plane);
  242. const double dxl = (*it)->xloc() - interceptL.x();
  243. const double dyl = (*it)->yloc() - interceptL.y();
  244. m_hBiasedResLX[plane]->fill(dxl);
  245. m_hBiasedResLY[plane]->fill(dyl);
  246.  
  247. // Biased global residuals as function of local x/y.
  248. m_hBiasedResGXvsLX[plane]->fill((*it)->xloc(), dxg);
  249. m_hBiasedResGYvsLY[plane]->fill((*it)->yloc(), dyg);
  250. // Unbiased global residuals as function of global x/y.
  251. m_hUnbiasedResGXvsGX[plane]->fill((*it)->x(), dxug);
  252. m_hUnbiasedResGYvsGY[plane]->fill((*it)->y(), dyug);
  253.  
  254. const double trprob = TMath::Prob(track->chi2(), track->ndof());
  255. m_hBiasedResGXvsTrackProb[plane]->fill(trprob, dxg);
  256. m_hBiasedResGYvsTrackProb[plane]->fill(trprob, dyg);
  257.  
  258. // Time residuals.
  259. const double dt = (*it)->htime() - track->htime();
  260. m_hBiasedResT[plane]->fill(dt);
  261. m_hBiasedResTvsGX[plane]->fill((*it)->x(), dt);
  262.  
  263. auto hits = (*it)->hits();
  264. for (auto ith = hits.cbegin(), hend = hits.cend(); ith != hend; ++ith) {
  265. const double delt = (*ith)->htime() - track->htime();
  266. m_hBiasedResPixelTvsColumn[plane]->fill((*ith)->col(), delt);
  267. }
  268.  
  269. /// Fill time synchronisation histograms, with respect to chip zero,
  270. /// and also the synchronisation stability
  271. if (plane != 0) continue;
  272. for (auto jt = clusters.cbegin(); jt != end; ++jt) {
  273. const double dt0 = (*it)->htime() - (*jt)->htime();
  274. m_hSyncDifferences[(*jt)->plane()]->fill(dt0);
  275. m_syncInRun[(*jt)->plane()]->fill((*it)->time() / Tb::minute, dt0);
  276. }
  277. }
  278. }
  279.  
  280. //=============================================================================
  281. // Fill cluster loop plots.
  282. //=============================================================================
  283. void TbTrackPlots::fillClusterLoopPlots(const LHCb::TbClusters* clusters,
  284. const unsigned int plane) {
  285. unsigned int nTrackedClusters = 0;
  286. unsigned int nClustersCentral = 0;
  287. for (const LHCb::TbCluster* cluster : *clusters) {
  288. if (cluster->associated()) ++nTrackedClusters;
  289. if (cluster->x() > m_parCentral.lowEdge() &&
  290. cluster->x() < m_parCentral.highEdge() &&
  291. cluster->y() > m_parCentral.lowEdge() &&
  292. cluster->y() < m_parCentral.highEdge())
  293. nClustersCentral++;
  294. }
  295.  
  296. m_hnTrackedClusters->fill(plane, nTrackedClusters);
  297. m_hnClustersPerPlane->fill(plane, clusters->size());
  298. m_hnClustersPerPlaneCentral->fill(plane, nClustersCentral);
  299. }
  300.  
  301. //=============================================================================
  302. // Setup plots
  303. //=============================================================================
  304. void TbTrackPlots::setupPlots() {
  305.  
  306. unsigned int bins = m_parChi2.bins();
  307. double low = m_parChi2.lowEdge();
  308. double high = m_parChi2.highEdge();
  309. m_hChi2 = book1D("Chi2PerDof", low, high, bins);
  310. setAxisLabels(m_hChi2, "#chi^{2} / n_{dof}", "entries");
  311.  
  312. m_hProb = book1D("Probability", 0., 1., 1000);
  313. setAxisLabels(m_hProb, "probability", "entries");
  314.  
  315. m_hTrackSize = book1D("TrackSize", 0.5, 12.5, 12);
  316. setAxisLabels(m_hTrackSize, "number of clusters", "entries");
  317.  
  318. m_hnClustersPerPlane = book1D("TrackingEfficiency/nClustersPerPlane",
  319. "nClustersPerPlane", -0.5, 12.5, 13);
  320. setAxisLabels(m_hnClustersPerPlane, "plane", "clusters");
  321.  
  322. m_hnTrackedClusters = book1D("TrackingEfficiency/nTrackedClusters",
  323. "nTrackedClusters", -0.5, 12.5, 13);
  324. setAxisLabels(m_hnTrackedClusters, "plane", "clusters");
  325.  
  326. m_hFractionTrackedClusters =
  327. book1D("TrackingEfficiency/FractionTrackedClusters",
  328. "FractionTrackedClusters", -0.5, 12.5, 13);
  329. setAxisLabels(m_hFractionTrackedClusters, "plane", "Fraction");
  330.  
  331. m_hnClustersPerPlaneCentral =
  332. book1D("TrackingEfficiency/nClustersPerPlaneCentral",
  333. "nClustersPerPlaneCentral", -0.5, 12.5, 13);
  334. setAxisLabels(m_hnClustersPerPlaneCentral, "plane", "clusters");
  335.  
  336. m_hnTracksInterceptCentral =
  337. book1D("TrackingEfficiency/nTracksInterceptCentral",
  338. "nTracksInterceptCentral", -0.5, 12.5, 13);
  339. setAxisLabels(m_hnTracksInterceptCentral, "plane", "tracks");
  340.  
  341. m_hRatioTracksClustersCentral =
  342. book1D("TrackingEfficiency/RatioTracksClustersCentral",
  343. "RatioTracksClustersCentral", -0.5, 12.5, 13);
  344. setAxisLabels(m_hRatioTracksClustersCentral, "plane", "Fraction");
  345.  
  346. bins = m_parSlope.bins();
  347. low = m_parSlope.lowEdge();
  348. high = m_parSlope.highEdge();
  349. m_hSlopeXZ = book1D("SlopeXZ", low, high, bins);
  350. m_hSlopeYZ = book1D("SlopeYZ", low, high, bins);
  351. setAxisLabels(m_hSlopeXZ, "#it{t}_{x}", "entries");
  352. setAxisLabels(m_hSlopeYZ, "#it{t}_{y}", "entries");
  353.  
  354. bins = m_parXY.bins();
  355. low = m_parXY.lowEdge();
  356. high = m_parXY.highEdge();
  357. m_hFirstStateX = book1D("FirstStateX", low, high, bins);
  358. m_hFirstStateY = book1D("FirstStateY", low, high, bins);
  359.  
  360. m_hSlopeXvsX =
  361. book2D("SlopeXZvsFirstStateX", "t_{x} vs x", m_parSlope.lowEdge(),
  362. m_parSlope.highEdge(), m_parSlope.bins(), low, high, bins);
  363. m_hSlopeYvsY =
  364. book2D("SlopeYZvsFirstStateY", "t_{y} vs y", m_parSlope.lowEdge(),
  365. m_parSlope.highEdge(), m_parSlope.bins(), low, high, bins);
  366.  
  367. setAxisLabels(m_hSlopeXvsX, "#it{t}_{x}", "#it{x}_{0} [mm]");
  368. setAxisLabels(m_hSlopeYvsY, "#it{t}_{y}", "#it{y}_{0} [mm]");
  369.  
  370. setAxisLabels(m_hFirstStateX, "#it{x}_{0} [mm]", "entries");
  371. setAxisLabels(m_hFirstStateY, "#it{y}_{0} [mm]", "entries");
  372.  
  373. const std::string labelx = "#it{x} - #it{x}_{track} [mm]";
  374. const std::string labely = "#it{y} - #it{y}_{track} [mm]";
  375. const std::string labelt = "#it{t} - #it{t}_{track} [ns]";
  376. for (unsigned int i = 0; i < m_nPlanes; ++i) {
  377. const std::string plane = std::to_string(i);
  378. const std::string title = geomSvc()->modules().at(i)->id();
  379. // Track intercepts
  380. bins = m_parXY.bins();
  381. low = m_parXY.lowEdge();
  382. high = m_parXY.highEdge();
  383. std::string name = "Intercepts/Plane" + plane;
  384. m_hIntercepts.push_back(
  385. book2D(name, title, low, high, bins, low, high, bins));
  386. name = "InterceptsAssociated/Plane" + plane;
  387. m_hInterceptsAssociated.push_back(
  388. book2D(name, title, low, high, bins, low, high, bins));
  389. name = "InterceptsNonAssociated/Plane" + plane;
  390. m_hInterceptsNonAssociated.push_back(
  391. book2D(name, title, low, high, bins, low, high, bins));
  392. setAxisLabels(m_hIntercepts[i], "global #it{x} [mm]", "global #it{y} [mm]");
  393. setAxisLabels(m_hInterceptsAssociated[i], "global #it{x} [mm]",
  394. "global #it{y} [mm]");
  395. setAxisLabels(m_hInterceptsNonAssociated[i], "global #it{x} [mm]",
  396. "global #it{y} [mm]");
  397.  
  398. // Biased x/y residuals
  399. bins = m_parResidualsXY.bins();
  400. low = m_parResidualsXY.lowEdge();
  401. high = m_parResidualsXY.highEdge();
  402. name = "BiasedResiduals/GlobalX/Plane" + plane;
  403. m_hBiasedResGX.push_back(book1D(name, title, low, high, bins));
  404. name = "BiasedResiduals/GlobalY/Plane" + plane;
  405. m_hBiasedResGY.push_back(book1D(name, title, low, high, bins));
  406. name = "BiasedResiduals/LocalX/Plane" + plane;
  407. m_hBiasedResLX.push_back(book1D(name, title, low, high, bins));
  408. name = "BiasedResiduals/LocalY/Plane" + plane;
  409. m_hBiasedResLY.push_back(book1D(name, title, low, high, bins));
  410. setAxisLabels(m_hBiasedResGX[i], labelx, "entries");
  411. setAxisLabels(m_hBiasedResGY[i], labely, "entries");
  412. setAxisLabels(m_hBiasedResLX[i], labelx, "entries");
  413. setAxisLabels(m_hBiasedResLY[i], labely, "entries");
  414.  
  415. // Biased residuals vs. x/y
  416. const unsigned int binsXY = m_parXY.bins();
  417. const double lowXY = m_parXY.lowEdge();
  418. const double highXY = m_parXY.highEdge();
  419. name = "BiasedResiduals/GlobalResXvsLocalX/Plane" + plane;
  420. m_hBiasedResGXvsLX.push_back(
  421. book2D(name, title, lowXY, highXY, binsXY, low, high, bins));
  422. name = "BiasedResiduals/GlobalResYvsLocalY/Plane" + plane;
  423. m_hBiasedResGYvsLY.push_back(
  424. book2D(name, title, lowXY, highXY, binsXY, low, high, bins));
  425. setAxisLabels(m_hBiasedResGXvsLX[i], "local #it{x} [mm]", labelx);
  426. setAxisLabels(m_hBiasedResGYvsLY[i], "local #it{y} [mm]", labely);
  427.  
  428. // Unbiased x/y residuals
  429. name = "UnbiasedResiduals/GlobalX/Plane" + plane;
  430. m_hUnbiasedResGX.push_back(book1D(name, title, low, high, bins));
  431. name = "UnbiasedResiduals/GlobalY/Plane" + plane;
  432. m_hUnbiasedResGY.push_back(book1D(name, title, low, high, bins));
  433. name = "UnbiasedResiduals/LocalX/Plane" + plane;
  434. m_hUnbiasedResLX.push_back(book1D(name, title, low, high, bins));
  435. name = "UnbiasedResiduals/LocalY/Plane" + plane;
  436. m_hUnbiasedResLY.push_back(book1D(name, title, low, high, bins));
  437. setAxisLabels(m_hUnbiasedResGX[i], labelx, "entries");
  438. setAxisLabels(m_hUnbiasedResGY[i], labely, "entries");
  439. setAxisLabels(m_hUnbiasedResLX[i], labelx, "entries");
  440. setAxisLabels(m_hUnbiasedResLY[i], labely, "entries");
  441.  
  442. // Unbiased residuals vs. x/y
  443. name = "UnbiasedResiduals/GlobalResXvsGlobalX/Plane" + plane;
  444. m_hUnbiasedResGXvsGX.push_back(
  445. book2D(name, title, lowXY, highXY, binsXY, low, high, bins));
  446. name = "UnbiasedResiduals/GlobalResYvsGlobalY/Plane" + plane;
  447. m_hUnbiasedResGYvsGY.push_back(
  448. book2D(name, title, lowXY, highXY, binsXY, low, high, bins));
  449. setAxisLabels(m_hUnbiasedResGXvsGX[i], "global #it{x} [mm]", labelx);
  450. setAxisLabels(m_hUnbiasedResGYvsGY[i], "global #it{y} [mm]", labely);
  451.  
  452. // Biased residuals vs. track probability
  453. name = "BiasedResiduals/GlobalXvsTrackProb/Plane" + plane;
  454. m_hBiasedResGXvsTrackProb.push_back(
  455. book2D(name, title, 0.0, 1.0, 1000, low, high, bins));
  456. name = "BiasedResiduals/GlobalYvsTrackProb/Plane" + plane;
  457. m_hBiasedResGYvsTrackProb.push_back(
  458. book2D(name, title, 0.0, 1.0, 1000, low, high, bins));
  459.  
  460. // Time residuals
  461. bins = m_parResidualsT.bins();
  462. low = m_parResidualsT.lowEdge();
  463. high = m_parResidualsT.highEdge();
  464. name = "BiasedResiduals/Time/Plane" + plane;
  465. m_hBiasedResT.push_back(book1D(name, title, low, high, bins));
  466. setAxisLabels(m_hBiasedResT[i], labelt, "entries");
  467.  
  468. // Residuals with respect to plane zero
  469. name = "MisalignmentFrom0/Plane" + plane;
  470. m_hSyncDifferences.push_back(book1D(name, title, -35.0, 35.0, 2000));
  471. setAxisLabels(m_hSyncDifferences[i], labelt, "entries");
  472.  
  473. name = "MisalignmentFrom0Profile/Plane" + plane;
  474. m_syncInRun.push_back(bookProfile1D(name, title, 0, 120.0, 120));
  475. setAxisLabels(m_syncInRun[i], "#it{t}_{track} [minutes]",
  476. "#LT #it{t} - #it{t}_{track} #GT [ns]");
  477.  
  478. name = "BiasedResiduals/ResTimeVsGlobalX/Plane" + plane;
  479. m_hBiasedResTvsGX.push_back(
  480. book2D(name, title, -12, 3, 256, low, high, bins));
  481. setAxisLabels(m_hBiasedResTvsGX[i], "#it{x} [mm]", labelt);
  482. name = "BiasedResiduals/ResHitTimeVsColumn/Plane" + plane;
  483. m_hBiasedResPixelTvsColumn.push_back(
  484. book2D(name, title, -0.5, 255.5, 256, low, high, bins));
  485. setAxisLabels(m_hBiasedResPixelTvsColumn[i], "column",
  486. "#it{t}_{hit} - #it{t}_{track} [ns]");
  487.  
  488. // Time difference between tracks and triggers
  489. name = "TimeDifferenceTrackTriggers";
  490. m_hTimeDifferenceTrackTrigger = book1D(name, "#Deltat", -1000., 1000., 500);
  491. setAxisLabels(m_hTimeDifferenceTrackTrigger,
  492. "#it{t}_{trigger} - #it{t}_track [ns]", "entries");
  493. }
  494. }