9#include <cdc/modules/CDCDedxSkimCDST/CDCDedxSkimCDST.h>
11#include <analysis/dataobjects/Particle.h>
12#include <analysis/dataobjects/ParticleList.h>
13#include <mdst/dataobjects/PIDLikelihood.h>
14#include <mdst/dataobjects/Track.h>
16#include <framework/datastore/SelectSubset.h>
18#include <unordered_set>
27 setDescription(
"Extract dE/dx information for calibration development.");
37 B2INFO(
"Selecting two good tracks for radiative bhabha candidates...");
57 std::unordered_set<int> indicesToKeep;
65 for (
int iList = 0; iList < nParticleList; iList++) {
68 if (!particlelist or particlelist->getListSize(
true) == 0) {
75 for (
unsigned int iPGen1 = 0; iPGen1 < particlelist->getListSize(
true); iPGen1++) {
77 Particle* fPartGen1 = particlelist->getParticle(iPGen1,
true);
79 B2WARNING(
"No particles in the list...");
85 for (
unsigned iPGen2 = 0; iPGen2 < fPartGen1->
getNDaughters(); ++iPGen2) {
91 B2WARNING(
"Searching w/ 2nd Gen >> No related PID likelihood found");
97 B2WARNING(
"Searching w/ 2nd Gen >> No related Track found");
103 B2WARNING(
"Searching w/ 2nd Gen >> No related CDCDedxTrack found");
114 B2WARNING(
"No related PID likelihood found");
120 B2WARNING(
"No related Track found");
126 B2WARNING(
"No related CDCDedxTrack found");
137 auto selector = [indicesToKeep](
const CDCDedxTrack * d) ->
bool {
138 if (indicesToKeep.size() > 2)
140 std::cout <<
"More than three good tracks!" << std::endl;
143 int idx = d->getArrayIndex();
144 if (indicesToKeep.count(idx) == 1)
return true;
152 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.