8#include <tracking/modules/trackFinderVXDTests/StudyMaterialEffectsModule.h>
10#include <framework/pcore/ProcHandler.h>
11#include <framework/logging/Logger.h>
13#include <mdst/dataobjects/MCParticle.h>
14#include <svd/dataobjects/SVDCluster.h>
16#include <vxd/geometry/SensorInfoBase.h>
18#include <Math/Vector3D.h>
28 setDescription(
"StudyMaterialEffects- should be used with single track pGuns and without magnetic field.");
38 m_file =
new TFile(
"materialStudy.root",
"RECREATE");
42 m_tree.registerInDataStore();
43 m_tree.construct(
"materialEffectsStudyTree",
"Raw data of two-hit-combinations for a sectorMap");
66 B2WARNING(
"StudyMaterialEffectsModule::initialize: nBranches: " <<
m_tree->get().GetNbranches());
83 bool wasFoundL3(
false);
84 bool wasFoundL4(
false);
85 bool wasFoundL6(
false);
89 VxdID vxdID = aSP.getVxdID();
91 if (trueHit ==
nullptr)
continue;
98 l3HitPosBegin = entryHitPos;
99 l3HitPosEnd = exitHitPos;
100 l3MomentumBegin = entryMomentum;
101 l3MomentumEnd = exitMomentum;
105 l4HitPosBegin = entryHitPos;
106 l4MomentumBegin = entryMomentum;
110 l6HitPosEnd = exitHitPos;
111 l6MomentumEnd = exitMomentum;
116 if (!wasFoundL3 or !wasFoundL4 or !wasFoundL6)
return;
141 m_distXY = (l3HitPosBegin - l4HitPosBegin).Perp();
DataType Phi() const
The azimuth angle.
DataType Theta() const
The polar angle.
DataType Mag() const
The magnitude (rho in spherical coordinate system).
DataType Angle(const B2Vector3< DataType > &q) const
The angle w.r.t.
In the store you can park objects that have to be accessed by various modules.
A Class to store the Monte Carlo particle information.
@ c_PrimaryParticle
bit 0: Particle is primary particle.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
@ c_TerminateInAllProcesses
When using parallel processing, call this module's terminate() function in all processes().
static bool isOutputProcess()
Return true if the process is an output process.
static bool parallelProcessingUsed()
Returns true if multiple processes have been spawned, false in single-core mode.
RelationVector< TO > getRelationsTo(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from this object to another store array.
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
Class SVDTrueHit - Records of tracks that either enter or leave the sensitive volume.
SpacePoint typically is build from 1 PXDCluster or 1-2 SVDClusters.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
double m_ScatterAngleL3L6
residual of hit.scatteringAngle (sqrt(theta^2 + phi^2)) between layer 3 begin and 6 end.
double m_deltaPL3L6
residual of hit.momentum between layer 3 begin and 6 end.
double m_distXY
residual of hit distance between layer 3 begin and 4 begin.
double m_ScatterAngleGradL3L6
residual of hit.scatteringAngle ((outerHit-innerHit).Angle(innerHit))*180/pi between layer 3 begin an...
B2Vector3D getGlobalPosition(const SVDTrueHit *trueHit, VxdID vxdID, bool useEntry)
takes SVDTrueHit and sensorID to get global position of the hit.
double m_ScatterAngleV3GradL3L4
residual of hit.scatteringAngle (outerHit.Momentum).Angle(innerHit.Momentum))*180/pi between layer 3 ...
B2Vector3D getGlobalMomentumVector(const SVDTrueHit *trueHit, VxdID vxdID, bool useEntry)
takes SVDTrueHit and sensorID to get global momentum of the hit.
void initialize() override
Init the module.
double m_PhiL3L6
residual of hit.phi between layer 3 begin and 6 end.
StoreArray< Belle2::SpacePoint > m_spacePoints
Space Points.
double m_PhiL3L4
residual of hit.phi between layer 3 begin and 4 begin.
const SVDTrueHit * getTrueHit(const SpacePoint &aSP)
takes SpacePoint to get the (first) corresponding trueHit connected to the same particle.
void event() override
Show progress.
double m_ThetaL3L6
residual of hit.theta between layer 3 begin and 6 end.
double m_ScatterAngleGradL3L4
residual of hit.scatteringAngle ((outerHit-innerHit).Angle(innerHit))*180/pi between layer 3 begin an...
void terminate() override
Don't break the terminal.
int m_COUNTERsuccessfullEvents
Counter for successfully processed events.
double m_ScatterAngleL3L3
residual of hit.scatteringAngle (sqrt(theta^2 + phi^2)) between layer 3 begin and 3 end.
double m_PhiL3L3
residual of hit.phi between layer 3 begin and 3 end.
double m_deltaPL3L4
residual of hit.momentum between layer 3 begin and 4 begin.
TFile * m_file
a pointer to the file where the Tree shall be stored.
double m_ScatterAngleV3GradL3L6
residual of hit.scatteringAngle (outerHit.Momentum).Angle(innerHit.Momentum))*180/pi between layer 3 ...
double m_ScatterAngleL3L4
residual of hit.scatteringAngle (sqrt(theta^2 + phi^2)) between layer 3 begin and 4 begin.
double m_ThetaL3L3
residual of hit.theta between layer 3 begin and 3 end.
StoreObjPtr< RootMergeable< TTree > > m_tree
ROOT Tree.
double m_ScatterAngleGradL3L3
residual of hit.scatteringAngle ((outerHit-innerHit).Angle(innerHit))*180/pi between layer 3 begin an...
double m_ScatterAngleV3GradL3L3
residual of hit.scatteringAngle ((outerHit.Momentum).Angle(innerHit.Momentum))*180/pi between layer 3...
StudyMaterialEffectsModule()
Constructor.
double m_ThetaL3L4
residual of hit.theta between layer 3 begin and 4 begin.
double m_deltaPL3L3
residual of hit.momentum between layer 3 begin and 3 end.
ROOT::Math::XYZVector getExitMomentum() const
Return momentum at the endpoint of the track.
float getEntryU() const
Return local u coordinate of hit when entering silicon.
ROOT::Math::XYZVector getEntryMomentum() const
Return momentum at the start point of the track.
float getExitU() const
Return local u coordinate of hit at the endpoint of the track.
float getExitV() const
Return local v coordinate of hit at the endpoint of the track.
float getEntryV() const
Return local v coordinate of the start point of the track.
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
static GeoCache & getInstance()
Return a reference to the singleton instance.
Base class to provide Sensor Information for PXD and SVD.
ROOT::Math::XYZVector pointToGlobal(const ROOT::Math::XYZVector &local, bool reco=false) const
Convert a point from local to global coordinates.
ROOT::Math::XYZVector vectorToGlobal(const ROOT::Math::XYZVector &local, bool reco=false) const
Convert a vector from local to global coordinates.
Class to uniquely identify a any structure of the PXD and SVD.
baseType getLayerNumber() const
Get the layer id.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.