 |
Belle II Software
release-05-02-19
|
11 #include <tracking/modules/VXDTFHelperTools/VXDSimpleClusterizerModule.h>
12 #include <vxd/geometry/SensorInfoBase.h>
13 #include <vxd/geometry/GeoCache.h>
15 #include <framework/datastore/StoreObjPtr.h>
16 #include <framework/dataobjects/EventMetaData.h>
17 #include <framework/logging/Logger.h>
40 InitializeVariables();
43 setDescription(
"The VXDSimpleClusterizerModule generates PXD/SVD Clusters using TrueHits. Energy-deposit threshold and gaussian smearing can be chosen, non-primary-particles can be filtered as well. Its purpose is fast clusterizing for tracking test procedures, using standardized PXD/SVD-Cluster");
44 setPropertyFlags(c_ParallelProcessingCertified);
46 addParam(
"energyThresholdU", m_energyThresholdU,
47 "particles with energy deposit in U lower than this will not create a cluster in SVD (GeV)",
double(17.4E-6));
48 addParam(
"energyThresholdV", m_energyThresholdV,
49 "particles with energy deposit in V lower than this will not create a cluster in SVD (GeV)",
double(28.6E-6));
50 addParam(
"energyThreshold", m_energyThreshold,
51 "particles with energy deposit lower than this will not create a cluster in PXD (GeV)",
double(7E-6));
52 addParam(
"onlyPrimaries", m_onlyPrimaries,
"if true use only primary particles from the generator no particles created by Geant4",
54 addParam(
"uniSigma", m_uniSigma,
55 "you can define the sigma of the smearing. Standard value is the sigma of the unifom distribution for 0-1: 1/sqrt(12)",
56 double(1. / sqrt(12.)));
57 addParam(
"setMeasSigma", m_setMeasSigma,
58 "if positive value (in cm) is given it will be used as the sigma to smear the Clusters otherwise pitch/uniSigma will be used",
60 addParam(
"PXDTrueHits", m_pxdTrueHitsName,
61 "PXDTrueHit collection name",
string(
""));
62 addParam(
"SVDTrueHits", m_svdTrueHitsName,
63 "SVDTrueHit collection name",
string(
""));
64 addParam(
"MCParticles", m_mcParticlesName,
65 "MCParticle collection name",
string(
""));
66 addParam(
"PXDClusters", m_pxdClustersName,
67 "PXDCluster collection name",
string(
""));
68 addParam(
"SVDClusters", m_svdClustersName,
69 "SVDCluster collection name",
string(
""));
117 paramValue =
"true, means that there are no secondary hits (for 1-track events this means no ghost hits guaranteed)";
119 paramValue =
"false, means that secondary hits can occur and increase the rate of ghost hits";
121 B2INFO(
"VXDSimpleClusterizer: parameter onlyPrimaries is set to " << paramValue);
131 int discardedPXDEdeposit = 0, discardedSVDEdeposit = 0, discardedPXDFake = 0, discardedSVDFake = 0;
135 B2DEBUG(5,
"******* VXDSimpleClusterizerModule processing event number: " << eventMetaDataPtr->getEvent() <<
" *******");
140 if (nMcParticles == 0) {B2DEBUG(100,
"MCTrackFinder: MCParticlesCollection is empty!");}
143 if (nPxdTrueHits == 0) {B2DEBUG(100,
"MCTrackFinder: PXDHitsCollection is empty!");}
146 if (nSvdTrueHits == 0) {B2DEBUG(100,
"MCTrackFinder: SVDHitsCollection is empty!");}
147 B2DEBUG(175,
"found " << nMcParticles <<
"/" << nPxdTrueHits <<
"/" << nSvdTrueHits <<
" mcParticles, pxdTrueHits, svdTrueHits");
155 for (
unsigned int currentTrueHit = 0; int (currentTrueHit) not_eq nPxdTrueHits; ++currentTrueHit) {
156 B2DEBUG(175,
"begin PXD current TrueHit: " << currentTrueHit <<
" of nPxdTrueHits total: " << nPxdTrueHits);
160 unsigned int particleID = std::numeric_limits<unsigned int>::max();
162 if (aMcParticle != NULL) { particleID = aMcParticle->
getArrayIndex(); }
175 B2DEBUG(100,
" PXD, current TrueHit " << currentTrueHit <<
" connected to " << particleID <<
" has an energy deposit of " <<
176 energy * 1000.0 <<
"MeV ");
178 B2DEBUG(100,
" PXD, TrueHit discarded because of energy deposit too small");
180 discardedPXDEdeposit++;
186 double uTrue = aPxdTrueHit->
getU();
187 double vTrue = aPxdTrueHit->
getV();
195 B2DEBUG(175,
"sigU sigV: " << sigmaU <<
" " << sigmaV);
198 u = gRandom->Gaus(uTrue, sigmaU);
199 v = gRandom->Gaus(vTrue, sigmaV);
227 PXDCluster* newCluster =
m_pxdClusters.
appendNew(aVXDId, u, v, sigmaU, sigmaV, 0, 1, 1, 1, 1, 1, 1, 1);
231 if (particleID != std::numeric_limits<unsigned int>::max()) {
234 " relations to PXD clusters");
241 for (
unsigned int currentTrueHit = 0; int (currentTrueHit) not_eq nSvdTrueHits; ++currentTrueHit) {
242 B2DEBUG(175,
"begin SVD current TrueHit: " << currentTrueHit <<
" of nSvdTrueHits total: " << nSvdTrueHits);
246 unsigned int particleID = std::numeric_limits<unsigned int>::max();
256 if (aMcParticle != NULL) { particleID = aMcParticle->
getArrayIndex(); }
259 B2DEBUG(100,
" SVD, current TrueHit " << currentTrueHit <<
" connected to " << particleID <<
" has an energy deposit of " <<
260 energy * 1000.0 <<
"MeV ");
263 discardedSVDEdeposit++;
264 B2DEBUG(100,
" SVD, TrueHit discarded because of energy deposit too small");
271 double uTrue = aSvdTrueHit->
getU();
272 double vTrue = aSvdTrueHit->
getV();
280 B2DEBUG(150,
"sigU sigV: " << sigmaU <<
" " << sigmaV);
283 u = gRandom->Gaus(uTrue, sigmaU);
284 v = gRandom->Gaus(vTrue, sigmaV);
297 double timeStamp =
m_svdTrueHits[currentTrueHit]->getGlobalTime();
321 if (particleID != std::numeric_limits<unsigned int>::max()) {
325 " relations to SVD clusters");
330 B2DEBUG(10,
"------------------------------------------------------");
332 B2DEBUG(10,
"VXDSimpleClusterizerModule: Number of PXDHits: " << nPxdTrueHits);
333 B2DEBUG(10,
"VXDSimpleClusterizerModule: Number of SVDDHits: " << nSvdTrueHits);
334 B2DEBUG(10,
"VXDSimpleClusterizerModule: total Number of MCParticles: " << nMcParticles);
337 B2DEBUG(10,
"------------------------------------------------------");
339 B2DEBUG(1,
"VXDSimpleClusterizer - event " << eventMetaDataPtr->getEvent() <<
":\n" <<
"of " << nPxdTrueHits <<
"/" << nSvdTrueHits
340 <<
" PXD-/SVDTrueHits, " << discardedPXDEdeposit <<
"/" << discardedSVDEdeposit <<
" hits were discarded bec. of low E-deposit & "
341 << discardedPXDFake <<
"/" << discardedSVDFake <<
" hits were discarded bec. of being a fake. " <<
m_pxdClusters.
getEntries() <<
"/"
349 B2INFO(
"VXDSimpleClusterizerModule::EndRun:\nSimpleClusterizerModule discarded " <<
m_weakPXDHitCtr <<
" PXDTrueHits and " <<
int m_weakSVDHitCtr
counts SVDHits whose energy deposit is lower than energyThreshold
T * appendNew()
Construct a new T object at the end of the array.
std::string m_svdClustersName
SVDCluster collection name.
double m_energyThreshold
set energy threshold for PXDClusters in GeV (standard is 7E-6)
Class to uniquely identify a any structure of the PXD and SVD.
bool registerRelationTo(const StoreArray< TO > &toArray, DataStore::EDurability durability=DataStore::c_Event, DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut, const std::string &namedRelation="") const
Register a relation to the given StoreArray.
double m_uniSigma
you can define the sigma of the smearing.
Class PXDTrueHit - Records of tracks that either enter or leave the sensitive volume.
Module to convert TrueHits into Clusters using a simplified process.
StoreArray< SVDCluster > m_svdClusters
the storeArray for svdClusters as member, is faster than recreating link for each event
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
std::string m_pxdClustersName
PXDCluster collection name.
VxdID getSensorID() const
Return the Sensor ID.
void InitializeVariables()
initialize variables to avoid nondeterministic behavior
void initialize() override
Initialize the Module.
Class SVDTrueHit - Records of tracks that either enter or leave the sensitive volume.
double m_setMeasSigma
if positive value (in cm) is given it will be used as the sigma to smear the Clusters otherwise pitch...
void addRelationTo(const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
Add a relation from this object to another object (with caching).
Base class to provide Sensor Information for PXD and SVD.
int m_fakePXDHitCtr
counts PXDHits which were not caused by a primary partice
int m_fakeSVDHitCtr
counts SVDHits which were not caused by a primary partice
std::string m_pxdTrueHitsName
PXDTrueHit collection name.
int getArrayIndex() const
Get 0-based index of the particle in the corresponding MCParticle list.
RelationVector< TO > getRelationsTo(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from this object to another store array.
double getVPitch(double v=0) const
Return the pitch of the sensor.
bool hasStatus(unsigned short int bitmask) const
Return if specific status bit is set.
static GeoCache & getInstance()
Return a reference to the singleton instance.
Abstract base class for different kinds of events.
void endRun() override
This method is called if the current run ends.
Type-safe access to single objects in the data store.
float getV() const
Return local v coordinate of hit.
bool m_onlyPrimaries
set True if you do not want to have hits by secondary particles
std::string m_svdTrueHitsName
SVDTrueHit collection name.
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
int m_weakPXDHitCtr
counts PXDHits whose energy deposit is lower than energyThreshold
double m_energyThresholdU
set energy threshold for SVDClusters in u-direction in GeV (standard is 17.4E-6)
float getEnergyDep() const
Return energy deposited during traversal of sensor.
double getUPitch(double v=0) const
Return the pitch of the sensor.
@ c_ErrorIfAlreadyRegistered
If the object/array was already registered, produce an error (aborting initialisation).
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
void event() override
This method is the core of the module.
std::string m_mcParticlesName
MCParticle collection name.
StoreArray< MCParticle > m_mcParticles
the storeArray for mcParticles as member, is faster than recreating link for each event
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
A Class to store the Monte Carlo particle information.
float getU() const
Return local u coordinate of hit.
double m_energyThresholdV
set energy threshold for SVDClusters in v-direction in GeV (standard is 28.6E-6)
@ c_Event
Different object in each event, all objects/arrays are invalidated after event() function has been ca...
void beginRun() override
Called when entering a new run.
int getEntries() const
Get the number of objects in the array.
@ c_PrimaryParticle
bit 0: Particle is primary particle.
FROM * getRelatedFrom(const std::string &name="", const std::string &namedRelation="") const
Get the object from which this object has a relation.
StoreArray< PXDCluster > m_pxdClusters
the storeArray for pxdClusters as member, is faster than recreating link for each event
StoreArray< SVDTrueHit > m_svdTrueHits
the storeArray for svdTrueHits as member, is faster than recreating link for each event
StoreArray< PXDTrueHit > m_pxdTrueHits
the storeArray for pxdTrueHits as member, is faster than recreating link for each event