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.");
27 addParam(
"particleLists", m_strParticleList,
"Vector of ParticleLists to save", std::vector<std::string>());
28 addParam(
"ListsType", isRecList,
"Yes for reco particle list else No ",
true);
36 B2INFO(
"Selecting two good tracks for radiative bhabha candidates...");
39 m_dedxTracks.isRequired();
44 m_selector.registerSubset(set);
55 int nParticleList = m_strParticleList.size();
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;
146 m_selector.select(selector);
151 B2INFO(
"CDCDedxSkimCDST terminated: \n");
Extracts dE/dx information for calibration testing.
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.
virtual ~CDCDedxSkimCDSTModule()
Destructor.
Debug output for CDCDedxPID 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.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.