9#include <reconstruction/modules/CDCDedxSkimCDST/CDCDedxSkimCDST.h>
11#include <mdst/dataobjects/Track.h>
12#include <mdst/dataobjects/PIDLikelihood.h>
14#include <framework/datastore/SelectSubset.h>
16#include <unordered_set>
26 setDescription(
"Extract dE/dx information for calibration development.");
36 B2INFO(
"Selecting two good tracks for radiative bhabha candidates...");
56 std::unordered_set<int> indicesToKeep;
64 for (
int iList = 0; iList < nParticleList; iList++) {
67 if (!particlelist or particlelist->getListSize(
true) == 0) {
74 for (
unsigned int iPGen1 = 0; iPGen1 < particlelist->getListSize(
true); iPGen1++) {
76 Particle* fPartGen1 = particlelist->getParticle(iPGen1,
true);
78 B2WARNING(
"No particles in the list...");
84 for (
unsigned iPGen2 = 0; iPGen2 < fPartGen1->
getNDaughters(); ++iPGen2) {
90 B2WARNING(
"Searching w/ 2nd Gen >> No related PID likelihood found");
96 B2WARNING(
"Searching w/ 2nd Gen >> No related Track found");
102 B2WARNING(
"Searching w/ 2nd Gen >> No related CDCDedxTrack found");
113 B2WARNING(
"No related PID likelihood found");
119 B2WARNING(
"No related Track found");
125 B2WARNING(
"No related CDCDedxTrack found");
136 auto selector = [indicesToKeep](
const CDCDedxTrack * d) ->
bool {
137 if (indicesToKeep.size() > 2)
139 std::cout <<
"More than three good tracks!" << std::endl;
142 int idx = d->getArrayIndex();
143 if (indicesToKeep.count(idx) == 1)
return true;
151 B2INFO(
"CDCDedxSkimCDST terminated: \n");
CDCDedxSkimCDSTModule()
Default constructor.
virtual void initialize() override
Initialize the module.
virtual void event() override
Selection function to skim DataStore.
virtual void terminate() override
End of the event processing.
bool isRecList
set particle list type FS or reco particle list
virtual ~CDCDedxSkimCDSTModule()
Destructor.
SelectSubset< CDCDedxTrack > m_selector
Used to get a subset of the input array.
StoreArray< CDCDedxTrack > m_dedxTracks
Input array of CDCDedxTracks.
std::vector< std::string > m_strParticleList
Vector of ParticleLists to write out.
Debug output for CDCDedxPID module.
void setDescription(const std::string &description)
Sets the description of the module.
Class to collect log likelihoods from TOP, ARICH, dEdx, ECL and KLM aimed for output to mdst includes...
Class to store reconstructed particles.
unsigned getNDaughters(void) const
Returns number of daughter particles.
const Particle * getDaughter(unsigned i) const
Returns a pointer to the i-th daughter particle.
int getArrayIndex() const
Returns this object's array index (in StoreArray), or -1 if not found.
TO * getRelatedTo(const std::string &name="", const std::string &namedRelation="") const
Get the object to which this object has a relation.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
Accessor to arrays stored in the data store.
Type-safe access to single objects in the data store.
Class that bundles various TrackFitResults.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.