9 #include <alignment/modules/CopyRecoTracksWithOverlap/CopyRecoTracksWithOverlapModule.h>
11 #include <analysis/dataobjects/Particle.h>
12 #include <analysis/dataobjects/ParticleList.h>
13 #include <framework/datastore/StoreArray.h>
14 #include <framework/datastore/StoreObjPtr.h>
15 #include <mdst/dataobjects/Track.h>
16 #include <tracking/dataobjects/RecoTrack.h>
31 setPropertyFlags(c_ParallelProcessingCertified);
33 setDescription(
"Copy RecoTracks with overlap hits in VXD to a new StoreArray (Will need a refit).\n"
34 "If particleList is specified, take only RecoTracks associated to the particles (allows to make prior cuts at analysis level)."
37 addParam(
"overlapRecoTracksStoreArrayName", m_overlapRecoTracksArrayName,
"Name of StoreArray with output RecoTracks with overlaps",
38 m_overlapRecoTracksArrayName);
39 addParam(
"particleList", m_particleListName,
"Name of particle list for which associated RecoTracks should be copied",
60 for (
unsigned int iParticle = 0; iParticle < nParticles; ++iParticle) {
62 auto track = particle->getTrack();
64 B2ERROR(
"No Track for particle.");
67 auto recoTrack = track->getRelatedTo<
RecoTrack>();
69 B2ERROR(
"No RecoTrack for Track");
84 std::array<int, 6> nHitsInLayer = {0, 0, 0, 0, 0, 0};
87 for (
auto hit : track.getPXDHitList())
88 ++nHitsInLayer.at(hit->getSensorID().getLayerNumber() - 1);
91 for (
auto hit : track.getSVDHitList())
92 ++nHitsInLayer.at(hit->getSensorID().getLayerNumber() - 1);
94 bool hasOverlap =
false;
101 if (nHitsInLayer[0] == 2) hasOverlap =
true;
102 if (nHitsInLayer[1] == 2) hasOverlap =
true;
104 if (nHitsInLayer[2] == 4) hasOverlap =
true;
105 if (nHitsInLayer[3] == 4) hasOverlap =
true;
106 if (nHitsInLayer[4] == 4) hasOverlap =
true;
107 if (nHitsInLayer[5] == 4) hasOverlap =
true;
112 overlapTrack->addHitsFromRecoTrack(&track);
Copy RecoTracks with overlap hits in VXD to a new StoreArray (Will need a refit).
std::string m_particleListName
Name of particle list for which associated RecoTracks should be copied.
virtual void initialize() override
init
virtual void event() override
Copy RecoTracks with overlaps (for particle if specified)
void processRecoTrack(const RecoTrack &track)
Check if RecoTrack has overlap hits -> if yes, copy to a new array.
StoreArray< RecoTrack > m_OverlappingRecoTracks
Overlapping tracks.
StoreObjPtr< ParticleList > m_ParticleList
Particle list.
StoreArray< RecoTrack > m_RecoTracks
Tracks.
std::string m_overlapRecoTracksArrayName
Name of StoreArray with output RecoTracks with overlaps.
This is the Reconstruction Event-Data Model Track.
static void registerRequiredRelations(StoreArray< RecoTrack > &recoTracks, std::string const &pxdHitsStoreArrayName="", std::string const &svdHitsStoreArrayName="", std::string const &cdcHitsStoreArrayName="", std::string const &bklmHitsStoreArrayName="", std::string const &eklmHitsStoreArrayName="", std::string const &recoHitInformationStoreArrayName="")
Convenience method which registers all relations required to fully use a RecoTrack.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.