9#include <reconstruction/modules/CDCDedxPID/CDCDedxScanModule.h>
10#include <reconstruction/modules/CDCDedxPID/LineHelper.h>
12#include <reconstruction/dataobjects/CDCDedxTrack.h>
13#include <reconstruction/dataobjects/DedxConstants.h>
15#include <cdc/geometry/CDCGeometryPar.h>
16#include <vxd/geometry/GeoCache.h>
18#include <genfit/MaterialEffects.h>
20#include <boost/shared_ptr.hpp>
21#include <boost/make_shared.hpp>
36 setDescription(
"Extract dE/dx and corresponding log-likelihood from fitted tracks and hits in the CDC, SVD and PXD.");
51 if (!genfit::MaterialEffects::getInstance()->isInitialized()) {
52 B2FATAL(
"Need to have SetupGenfitExtrapolationModule in path before this one");
70 boost::shared_ptr<CDCDedxTrack> dedxTrack = boost::make_shared<CDCDedxTrack>();
72 for (
int i = 0; i < 56; ++i) {
82 double cellHeight = outer - inner;
83 double topHeight = outer - wirePosF.Rho();
84 double bottomHeight = wirePosF.Rho() - inner;
85 double topHalfWidth = M_PI * outer / nWires;
86 double bottomHalfWidth = M_PI * inner / nWires;
87 double cellHalfWidth = M_PI * wirePosF.Rho() / nWires;
96 for (
int j = 0; j < 100; ++j) {
97 for (
int k = 0; k < 100; ++k) {
98 double doca = j * cellHalfWidth / 50.0 - cellHalfWidth;
99 double entAng = k * M_PI / 100.0 - M_PI_2;
102 double cellR = 2 * cellHalfWidth / cellHeight;
104 if (std::abs(2 *
atan(1) - std::abs(entAng)) < 0.01)tana = 100 * (entAng / std::abs(entAng));
105 else tana = std::tan(entAng);
106 double docaRS = doca * std::sqrt((1 + cellR * cellR * tana * tana) / (1 + tana * tana));
107 double entAngRS = std::atan(tana / cellR);
110 double celldx = c.dx(doca, entAng);
111 if (!c.isValid())
continue;
113 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,
114 1.0, 0, 0.0, 0.0, 0.0);
124 B2INFO(
"CDCDedxScanModule exiting");
virtual void initialize() override
Initialize the module.
virtual void event() override
This method is called for each event.
CDCDedxScanModule()
Default constructor.
StoreArray< CDCDedxTrack > m_dedxArray
array of output dE/dx tracks
virtual void terminate() override
End of the event processing.
virtual ~CDCDedxScanModule()
Destructor.
The Class for CDC Geometry Parameters.
const B2Vector3D wireForwardPosition(uint layerId, int cellId, EWirePosition set=c_Base) const
Returns the forward position of the input sense wire.
unsigned nWiresInLayer(int layerId) const
Returns wire numbers in a layer.
const double * innerRadiusWireLayer() const
Returns an array of inner radius of wire layers.
static CDCGeometryPar & Instance(const CDCGeometry *=nullptr)
Static method to get a reference to the CDCGeometryPar instance.
const double * outerRadiusWireLayer() const
Returns an array of outer radius of wire layers.
A class to hold the geometry of a cell.
A collection of classes that are useful for making a simple path length correction to the dE/dx measu...
void setDescription(const std::string &description)
Sets the description of the module.
static GeoCache & getInstance()
Return a reference to the singleton instance.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
double atan(double a)
atan for double
Abstract base class for different kinds of events.