11 #include <reconstruction/modules/CDCDedxPID/CDCDedxScanModule.h>
12 #include <reconstruction/modules/CDCDedxPID/LineHelper.h>
14 #include <reconstruction/dataobjects/CDCDedxTrack.h>
15 #include <reconstruction/dataobjects/DedxConstants.h>
17 #include <cdc/geometry/CDCGeometryPar.h>
18 #include <vxd/geometry/GeoCache.h>
20 #include <genfit/MaterialEffects.h>
22 #include <boost/shared_ptr.hpp>
23 #include <boost/make_shared.hpp>
38 setDescription(
"Extract dE/dx and corresponding log-likelihood from fitted tracks and hits in the CDC, SVD and PXD.");
47 m_dedxArray.registerInDataStore();
53 if (!genfit::MaterialEffects::getInstance()->isInitialized()) {
54 B2FATAL(
"Need to have SetupGenfitExtrapolationModule in path before this one");
72 boost::shared_ptr<CDCDedxTrack> dedxTrack = boost::make_shared<CDCDedxTrack>();
74 for (
int i = 0; i < 56; ++i) {
80 const TVector3 wireDir = (wirePosB - wirePosF).
Unit();
86 double cellHeight = outer - inner;
87 double topHeight = outer - wirePosF.Perp();
88 double bottomHeight = wirePosF.Perp() - inner;
89 double topHalfWidth = M_PI * outer / nWires;
90 double bottomHalfWidth = M_PI * inner / nWires;
91 double cellHalfWidth = M_PI * wirePosF.Perp() / nWires;
100 for (
int j = 0; j < 100; ++j) {
101 for (
int k = 0; k < 100; ++k) {
102 double doca = j * cellHalfWidth / 50.0 - cellHalfWidth;
103 double entAng = k * 3.14159265 / 100.0 - 3.14159265 / 2.0;
106 double cellR = 2 * cellHalfWidth / cellHeight;
108 if (std::abs(2 * atan(1) - std::abs(entAng)) < 0.01)tana = 100 * (entAng / std::abs(entAng));
109 else tana = std::tan(entAng);
110 double docaRS = doca * std::sqrt((1 + cellR * cellR * tana * tana) / (1 + tana * tana));
111 double entAngRS = std::atan(tana / cellR);
114 double celldx = c.dx(doca, entAng);
115 if (!c.isValid())
continue;
117 dedxTrack->addHit(0, 0, i, doca, docaRS, entAng, entAngRS, 0, 0, 0.0, celldx, 0.0, cellHeight, cellHalfWidth, 0, 0.0, 0.0, 1.0, 1.0,
118 1.0, 0, 0.0, 0.0, 0.0);
121 m_dedxArray.appendNew(*dedxTrack);
128 B2INFO(
"CDCDedxScanModule exiting");