8#include <svd/modules/svddEdxCalibrationCollector/SVDdEdxCollectorModule.h>
10#include <analysis/dataobjects/ParticleList.h>
11#include <reconstruction/dataobjects/VXDDedxTrack.h>
12#include <mdst/dataobjects/Track.h>
32 setDescription(
"Collector module used to create the ROOT ntuples used to produce dE/dx calibration payloads");
42 B2INFO(
"Initialisation of the trees");
43 std::string objectNameLambda =
"Lambda";
44 std::string objectNameDstar =
"Dstar";
45 std::string objectNameGamma =
"Gamma";
47 TTree* LambdaTree =
new TTree(objectNameLambda.c_str(),
"");
48 TTree* DstarTree =
new TTree(objectNameDstar.c_str(),
"");
49 TTree* GammaTree =
new TTree(objectNameGamma.c_str(),
"");
52 LambdaTree->Branch<
int>(
"event", &
m_evt);
53 LambdaTree->Branch<
int>(
"exp", &
m_exp);
54 LambdaTree->Branch<
int>(
"run", &
m_run);
55 LambdaTree->Branch<
double>(
"time", &
m_time);
57 DstarTree->Branch<
int>(
"event", &
m_evt);
58 DstarTree->Branch<
int>(
"exp", &
m_exp);
59 DstarTree->Branch<
int>(
"run", &
m_run);
60 DstarTree->Branch<
double>(
"time", &
m_time);
62 GammaTree->Branch<
int>(
"event", &
m_evt);
63 GammaTree->Branch<
int>(
"exp", &
m_exp);
64 GammaTree->Branch<
int>(
"run", &
m_run);
65 GammaTree->Branch<
double>(
"time", &
m_time);
71 LambdaTree->Branch<
double>(
"PionLambdaMomentum", &
m_pionLambdap);
75 DstarTree->Branch<
double>(
"D0InvM", &
m_InvMD0);
76 DstarTree->Branch<
double>(
"deltaM", &
m_DeltaM);
79 DstarTree->Branch<
double>(
"PionDMomentum", &
m_pionDp);
93 registerObject<TTree>(objectNameLambda, LambdaTree);
94 registerObject<TTree>(objectNameDstar, DstarTree);
95 registerObject<TTree>(objectNameGamma, GammaTree);
100 const Track* track = particle->getTrack();
128 if (LambdaParticles->getListSize() > 0) {
129 for (
unsigned int iParticle = 0; iParticle < LambdaParticles->getListSize(); ++iParticle) {
131 std::vector<int> indicesLambda = LambdaParticles->getParticle(0)->getDaughterIndices();
132 if (indicesLambda.size() != 2)
134 const Particle* partLambda = LambdaParticles->getParticle(0);
135 const Particle* partPFromLambda = LambdaParticles->getParticle(0)->getDaughter(0);
136 const Particle* partPiFromLambda = LambdaParticles->getParticle(0)->getDaughter(1);
144 if (!dedxTrackPFromLambda) {
151 if (!dedxTrackPiFromLambda) {
156 getObjectPtr<TTree>(
"Lambda")->Fill();
160 if (DstarParticles->getListSize() > 0) {
161 for (
unsigned int iParticle = 0; iParticle < DstarParticles->getListSize(); ++iParticle) {
163 std::vector<int> indicesDstar = DstarParticles->getParticle(0)->getDaughterIndices();
164 if (indicesDstar.size() != 2)
167 const Particle* partDstar = DstarParticles->getParticle(0);
168 const Particle* partD0 = DstarParticles->getParticle(0)->getDaughter(0);
169 const Particle* partPiS = DstarParticles->getParticle(0)->getDaughter(1);
170 const Particle* partKFromD = DstarParticles->getParticle(0)->getDaughter(0)->getDaughter(0);
171 const Particle* partPiFromD = DstarParticles->getParticle(0)->getDaughter(0)->getDaughter(1);
183 if (!dedxTrackKFromD) {
190 if (!dedxTrackPiFromD) {
202 getObjectPtr<TTree>(
"Dstar")->Fill();
206 if (GammaParticles->getListSize() > 0) {
207 for (
unsigned int iParticle = 0; iParticle < GammaParticles->getListSize(); ++iParticle) {
208 std::vector<int> indicesGamma = GammaParticles->getParticle(0)->getDaughterIndices();
209 if (indicesGamma.size() != 2)
212 const Particle* partGamma = GammaParticles->getParticle(0);
213 const Particle* partE1FromGamma = GammaParticles->getParticle(0)->getDaughter(0);
214 const Particle* partE2FromGamma = GammaParticles->getParticle(0)->getDaughter(1);
222 if (!dedxTrackE1FromGamma) {
229 if (!dedxTrackE2FromGamma) {
235 getObjectPtr<TTree>(
"Gamma")->Fill();
Calibration collector module base class.
StoreObjPtr< EventMetaData > m_emd
Current EventMetaData.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Class to store reconstructed particles.
double getMomentumMagnitude() const
Returns momentum magnitude.
double getMass() const
Returns invariant mass (= nominal for FS particles)
double m_secondElectronSVDdEdx
SVD dE/dx response for the second electron.
void prepare() override final
Initialize the module.
double m_kaonSVDdEdx
SVD dE/dx response for the kaon from the D0.
double m_firstElectronMomentum
momentum for the first electron
double m_protonMomentum
momentum for the proton from the Lambda
double m_pionLambdap
momentum for the pion from the Lambda
SVDdEdxCollectorModule()
Constructor.
std::string m_LambdaListName
Name of the Lambda particle list.
double m_pionDp
momentum for the pion from the D0
double m_protonSVDdEdx
SVD dE/dx response for the proton from the Lambda.
double m_InvMDstar
Invariant mass of Dstar candidates.
double m_InvMD0
Invariant mass of D0 candidates.
double m_slowPionMomentum
momentum for the pion from the Dstar
double m_slowPionSVDdEdx
SVD dE/dx response for the pion from the Dstar.
void collect() override final
Event processor.
double m_DeltaM
deltaM = m(Dstar)-m(D0)
double m_InvMGamma
Invariant mass of converted photon candidates.
int m_exp
experiment number
double m_firstElectronSVDdEdx
SVD dE/dx response for the first electron.
double m_InvMLambda
Invariant mass of Lambda candidates.
double m_pionLambdaSVDdEdx
SVD dE/dx response for the pion from the Lambda.
std::string m_DstarListName
Name of the Dstar particle list.
double m_pionDSVDdEdx
SVD dE/dx response for the pion from the D0.
std::string m_GammaListName
Name of the Gamma particle list.
double m_secondElectronMomentum
momentum for the second electron
double m_kaonMomentum
momentum for the kaon from the D0
Type-safe access to single objects in the data store.
bool isValid() const
Check whether the object was created.
Class that bundles various TrackFitResults.
Debug output for VXDDedxPID module.
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.
double getDedx(Const::EDetector detector) const
Get dE/dx truncated mean for given detector.
VXDDedxTrack const * getSVDDedxFromParticle(Particle const *particle)
SVD dEdx value from particle.
Abstract base class for different kinds of events.