Index: trunk/inc/LauDaughters.hh =================================================================== --- trunk/inc/LauDaughters.hh (revision 565) +++ trunk/inc/LauDaughters.hh (revision 566) @@ -1,210 +1,219 @@ /* Copyright 2004 University of Warwick Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Laura++ package authors: John Back Paul Harrison Thomas Latham */ /*! \file LauDaughters.hh \brief File containing declaration of LauDaughters class. */ /*! \class LauDaughters \brief Class that defines the particular 3-body decay under study. The decay has the form P -> h1 h2 h3 (P stands for the parent particle, and h for the daughters). The constructor accepts both string name and PDG code types to describe the particles. */ #ifndef LAU_DAUGHTERS #define LAU_DAUGHTERS #include #include "TString.h" #include "LauKinematics.hh" class LauParticlePDG; class LauDaughters { public: //! Constructor from PDG codes /*! \param [in] codeParent the parent particle PDG code \param [in] code1 the first daughter PDG code \param [in] code2 the second daughter PDG code \param [in] code3 the third daughter PDG code \param [in] useSquareDP the boolean flag decision to use Square Dalitz plot (kTRUE) or standard Dalitz plot (kFALSE). Default value is kFALSE. */ LauDaughters(Int_t codeParent, Int_t code1, Int_t code2, Int_t code3, Bool_t useSquareDP = kFALSE); //! Constructor from particle names /*! \param [in] nameParent the parent particle string name \param [in] name1 the first daughter string name \param [in] name2 the second daughter string name \param [in] name3 the third daughter string name \param [in] useSquareDP the boolean flag decision to use Square Dalitz plot (kTRUE) or standard Dalitz plot (kFALSE). Default value is kFALSE. */ LauDaughters(const TString& nameParent, const TString& name1, const TString& name2, const TString& name3, Bool_t useSquareDP = kFALSE); //! Destructor virtual ~LauDaughters(); //! Copy constructor LauDaughters( const LauDaughters& rhs ); //! Is Dalitz plot symmetric, i.e. 2 identical particles /*! \return true/false whether the DP is symmetric */ Bool_t gotSymmetricalDP() const {return symmetricalDP_;} //! Is Dalitz plot fully symmetric, i.e. 3 identical particles /*! \return true/false whether the DP is fully symmetric */ Bool_t gotFullySymmetricDP() const {return fullySymmetricDP_;} //! Is Dalitz plot flavour-conjugate, i.e. CP(d1) = d2 and CP(d3) = d3 /*! \return true/false whether the DP is flavour-conjugate */ Bool_t gotFlavourConjugateDP() const {return flavourConjugateDP_;} //! Determine to use or not the square Dalitz plot /*! \return true/false to use the squareDP model */ Bool_t squareDP() const {return kinematics_->squareDP();} //! Get mass of first daughter particle Double_t getMassDaug1() const; //! Get mass of second daughter particle Double_t getMassDaug2() const; //! Get mass of third daughter particle Double_t getMassDaug3() const; //! Get mass of the parent particle Double_t getMassParent() const; //! Get name of the first daughter particle TString getNameDaug1() const; //! Get name of the second daughter particle TString getNameDaug2() const; //! Get name of the third daughter particle TString getNameDaug3() const; //! Get name of the parent particle TString getNameParent() const; + //! Get sanitised name of the first daughter particle + TString getSanitisedNameDaug1() const; + //! Get sanitised name of the second daughter particle + TString getSanitisedNameDaug2() const; + //! Get sanitised name of the third daughter particle + TString getSanitisedNameDaug3() const; + //! Get sanitised name of the parent particle + TString getSanitisedNameParent() const; + //! Get PDG code of the first daughter particle Int_t getTypeDaug1() const; //! Get PDG code of the second daughter particle Int_t getTypeDaug2() const; //! Get PDG code of the third daughter particle Int_t getTypeDaug3() const; //! Get PDG code of the parent particle Int_t getTypeParent() const; //! Get charge of the first daughter particle Int_t getChargeDaug1() const; //! Get charge of the second daughter particle Int_t getChargeDaug2() const; //! Get charge of the third daughter particle Int_t getChargeDaug3() const; //! Get charge of the parent particle Int_t getChargeParent() const; //! Get charge of a particular two-daughter combination /*! \param [in] resPairAmpInt the index of the daughter not in the combination \return the charge of the two-daughter combination */ Int_t getCharge(Int_t resPairAmpInt) const; //! Retrieve the Dalitz plot kinematics /*! \return the Dalitz plot kinematics */ LauKinematics* getKinematics() {return kinematics_;} //! Retrieve the Dalitz plot kinematics /*! \return the Dalitz plot kinematics */ const LauKinematics* getKinematics() const {return kinematics_;} protected: //! Create list of all the allowed parent/daughter particles void createParticleLists(); //! Set the parent particle type /*! \param [in] nameParent the name of the parent particle */ void setParentType(const TString& nameParent); //! Set the three daughter types /*! \param [in] name1 the name of the first daughter \param [in] name2 the name of the second daughter \param [in] name3 the name of the third daughter */ void setDaugType(const TString& name1, const TString& name2, const TString& name3); //! Check whether there is a symmetrical Dalitz plot void testDPSymmetry(); //! Check masses and charges of daughters void sanityCheck(); private: //! Copy assignment operator (not implemented) LauDaughters& operator=( const LauDaughters& rhs ); //! Dalitz plot kinematics LauKinematics* kinematics_; //! All possible daughter types std::vector allowedDaughters_; //! All possible parent types std::vector allowedParents_; //! The parent particle const LauParticlePDG* parent_; //! The daughter particles std::vector daughters_; //! Boolean flag for symmetrical Dalitz plot Bool_t symmetricalDP_; //! Boolean flag for fully symmetric Dalitz plot Bool_t fullySymmetricDP_; //! Flavour-conjugate Dalitz plot Bool_t flavourConjugateDP_; ClassDef(LauDaughters, 0) }; #endif Index: trunk/src/LauDaughters.cc =================================================================== --- trunk/src/LauDaughters.cc (revision 565) +++ trunk/src/LauDaughters.cc (revision 566) @@ -1,325 +1,345 @@ /* Copyright 2004 University of Warwick Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Laura++ package authors: John Back Paul Harrison Thomas Latham */ /*! \file LauDaughters.cc \brief File containing implementation of LauDaughters class. */ #include #include "TSystem.h" #include "LauDatabasePDG.hh" #include "LauDaughters.hh" #include "LauKinematics.hh" #include "LauParticlePDG.hh" ClassImp(LauDaughters) LauDaughters::LauDaughters(Int_t codeParent, Int_t code1, Int_t code2, Int_t code3, Bool_t useSquareDP) : kinematics_(0), parent_(0), symmetricalDP_(kFALSE), fullySymmetricDP_(kFALSE), flavourConjugateDP_(kFALSE) { this->createParticleLists(); TString nameParent = LauDatabasePDG::string( codeParent ); TString name1 = LauDatabasePDG::string( code1 ); TString name2 = LauDatabasePDG::string( code2 ); TString name3 = LauDatabasePDG::string( code3 ); this->setParentType(nameParent); this->setDaugType(name1, name2, name3); // Create kinematics object kinematics_ = new LauKinematics(this->getMassDaug1(), this->getMassDaug2(), this->getMassDaug3(), this->getMassParent(), useSquareDP, symmetricalDP_, fullySymmetricDP_); } LauDaughters::LauDaughters(const TString& nameParent, const TString& name1, const TString& name2, const TString& name3, Bool_t useSquareDP) : kinematics_(0), parent_(0), symmetricalDP_(kFALSE), fullySymmetricDP_(kFALSE), flavourConjugateDP_(kFALSE) { this->createParticleLists(); this->setParentType(nameParent); this->setDaugType(name1, name2, name3); // Create kinematics object kinematics_ = new LauKinematics(this->getMassDaug1(), this->getMassDaug2(), this->getMassDaug3(), this->getMassParent(), useSquareDP, symmetricalDP_, fullySymmetricDP_); } LauDaughters::~LauDaughters() { delete kinematics_; kinematics_ = 0; } LauDaughters::LauDaughters( const LauDaughters& rhs ) : kinematics_(0), parent_(0), symmetricalDP_(kFALSE), fullySymmetricDP_(kFALSE), flavourConjugateDP_(kFALSE) { this->createParticleLists(); this->setParentType( rhs.getNameParent() ); this->setDaugType( rhs.getNameDaug1() , rhs.getNameDaug2() , rhs.getNameDaug3() ); // Create kinematics object kinematics_ = new LauKinematics(this->getMassDaug1(), this->getMassDaug2(), this->getMassDaug3(), this->getMassParent(), rhs.squareDP(), rhs.gotSymmetricalDP(), rhs.gotFullySymmetricDP()); } void LauDaughters::createParticleLists() { // Create list of allowed daughters allowedDaughters_.clear(); allowedDaughters_.push_back(LauDatabasePDG::particle("pi+")); allowedDaughters_.push_back(LauDatabasePDG::particle("pi-")); allowedDaughters_.push_back(LauDatabasePDG::particle("pi0")); allowedDaughters_.push_back(LauDatabasePDG::particle("K+")); allowedDaughters_.push_back(LauDatabasePDG::particle("K-")); allowedDaughters_.push_back(LauDatabasePDG::particle("K_S0")); allowedDaughters_.push_back(LauDatabasePDG::particle("eta")); allowedDaughters_.push_back(LauDatabasePDG::particle("eta'")); allowedDaughters_.push_back(LauDatabasePDG::particle("D+")); allowedDaughters_.push_back(LauDatabasePDG::particle("D-")); allowedDaughters_.push_back(LauDatabasePDG::particle("D0")); allowedDaughters_.push_back(LauDatabasePDG::particle("D0_bar")); allowedDaughters_.push_back(LauDatabasePDG::particle("D_s+")); allowedDaughters_.push_back(LauDatabasePDG::particle("D_s-")); // Create list of allowed parents allowedParents_.clear(); allowedParents_.push_back(LauDatabasePDG::particle("B+")); allowedParents_.push_back(LauDatabasePDG::particle("B-")); allowedParents_.push_back(LauDatabasePDG::particle("B0")); allowedParents_.push_back(LauDatabasePDG::particle("B0_bar")); allowedParents_.push_back(LauDatabasePDG::particle("B_s0")); allowedParents_.push_back(LauDatabasePDG::particle("B_s0_bar")); allowedParents_.push_back(LauDatabasePDG::particle("D+")); allowedParents_.push_back(LauDatabasePDG::particle("D-")); allowedParents_.push_back(LauDatabasePDG::particle("D0")); allowedParents_.push_back(LauDatabasePDG::particle("D0_bar")); allowedParents_.push_back(LauDatabasePDG::particle("D_s+")); allowedParents_.push_back(LauDatabasePDG::particle("D_s-")); } void LauDaughters::setParentType(const TString& nameParent) { parent_ = 0; const Int_t codeParent = LauDatabasePDG::code( nameParent ); for ( std::vector::const_iterator iter = allowedParents_.begin(); iter != allowedParents_.end(); ++iter ) { const Int_t code = (*iter)->code(); if ( codeParent == code ) { parent_ = (*iter); std::cout<<"INFO in LauDaughters::setParentType : Setting parent to be "<string()<<" == "<code()<Exit(EXIT_FAILURE); } } void LauDaughters::setDaugType(const TString& name1, const TString& name2, const TString& name3) { const TString names[3] = { name1, name2, name3 }; const Int_t codes[3] = { LauDatabasePDG::code( name1 ), LauDatabasePDG::code( name2 ), LauDatabasePDG::code( name3 ) }; daughters_.clear(); daughters_.resize(3); for ( int i(0); i<3; ++i ) { for ( std::vector::const_iterator iter = allowedDaughters_.begin(); iter != allowedDaughters_.end(); ++iter ) { Int_t code = (*iter)->code(); if ( codes[i] == code ) { daughters_[i] = (*iter); std::cout<<"INFO in LauDaughters::setDaugType : Setting daughter "<string()<<" == "<code()<Exit(EXIT_FAILURE); } } // Initialise the various data members concerning particle masses this->sanityCheck(); // Check whether we have a symmetrical Dalitz plot this->testDPSymmetry(); } void LauDaughters::testDPSymmetry() { // Check to see if we have a symmetrical or flavour-conjugate DP. symmetricalDP_ = kFALSE; fullySymmetricDP_ = kFALSE; flavourConjugateDP_ = kFALSE; if ( daughters_[0]->code() == daughters_[1]->code() && daughters_[0]->code() == daughters_[2]->code() ) { std::cout<<"INFO in LauDaughters::testDPSymmetry : We have a fully symmetric DP. "<code() == daughters_[1]->code() ) { std::cout<<"INFO in LauDaughters::testDPSymmetry : We have a symmetrical DP. "<code() == daughters_[2]->code() ) { std::cerr<<"ERROR in LauDaughters::testDPSymmetry : daughter 1 and daughter 3 are both "<string()<<" but DP can only fold on daughters 1 and 2."<Exit(EXIT_FAILURE); } else if ( daughters_[1]->code() == daughters_[2]->code() ) { std::cerr<<"ERROR in LauDaughters::testDPSymmetry : daughter 2 and daughter 3 are both "<string()<<" but DP can only fold on daughters 1 and 2."<Exit(EXIT_FAILURE); } else if ( daughters_[0]->type() == daughters_[1]->type() && daughters_[2]->charge() == 0 ) { std::cout<<"INFO in LauDaughters::testDPSymmetry : We have a flavour-conjugate DP. "<type() == daughters_[2]->type() && daughters_[1]->charge() == 0 ) { std::cerr<<"WARNING in LauDaughters::testDPSymmetry : it looks like we have a flavour-conjugate DP but the "<string()<<" and "<string()<<" are not positioned as daughters 1 and 2." << std::endl; } else if ( daughters_[1]->type() == daughters_[2]->type() && daughters_[0]->charge() == 0 ) { std::cerr<<"WARNING in LauDaughters::testDPSymmetry : it looks like we have a flavour-conjugate DP but the "<string()<<" and "<string()<<" are not positioned as daughters 1 and 2." << std::endl; } } void LauDaughters::sanityCheck() { // Check masses and charges of daughters Int_t totCharge(0); Double_t totMass(0.0); for ( std::vector::const_iterator iter = daughters_.begin(); iter != daughters_.end(); ++iter ) { totCharge += (*iter)->charge(); totMass += (*iter)->mass(); } if (totCharge != parent_->charge()) { std::cerr<<"ERROR in LauDaughters::sanityCheck : Total charge of daughters ("<charge()<<")."<Exit(EXIT_FAILURE); } if (totMass > parent_->mass()) { std::cerr<<"ERROR in LauDaughters::sanityCheck : Total mass of daughters ("<mass()<<")."<Exit(EXIT_FAILURE); } } Double_t LauDaughters::getMassDaug1() const { return daughters_[0]->mass(); } Double_t LauDaughters::getMassDaug2() const { return daughters_[1]->mass(); } Double_t LauDaughters::getMassDaug3() const { return daughters_[2]->mass(); } Double_t LauDaughters::getMassParent() const { return parent_->mass(); } TString LauDaughters::getNameDaug1() const { return daughters_[0]->string(); } TString LauDaughters::getNameDaug2() const { return daughters_[1]->string(); } TString LauDaughters::getNameDaug3() const { return daughters_[2]->string(); } TString LauDaughters::getNameParent() const { return parent_->string(); } +TString LauDaughters::getSanitisedNameDaug1() const +{ + return daughters_[0]->stringAlphaNum(); +} + +TString LauDaughters::getSanitisedNameDaug2() const +{ + return daughters_[1]->stringAlphaNum(); +} + +TString LauDaughters::getSanitisedNameDaug3() const +{ + return daughters_[2]->stringAlphaNum(); +} + +TString LauDaughters::getSanitisedNameParent() const +{ + return parent_->stringAlphaNum(); +} + Int_t LauDaughters::getTypeDaug1() const { return daughters_[0]->code(); } Int_t LauDaughters::getTypeDaug2() const { return daughters_[1]->code(); } Int_t LauDaughters::getTypeDaug3() const { return daughters_[2]->code(); } Int_t LauDaughters::getTypeParent() const { return parent_->code(); } Int_t LauDaughters::getChargeDaug1() const { return daughters_[0]->charge(); } Int_t LauDaughters::getChargeDaug2() const { return daughters_[1]->charge(); } Int_t LauDaughters::getChargeDaug3() const { return daughters_[2]->charge(); } Int_t LauDaughters::getChargeParent() const { return parent_->charge(); } Int_t LauDaughters::getCharge(Int_t resPairAmpInt) const { Int_t charge = this->getChargeParent(); if ( resPairAmpInt>0 && resPairAmpInt<4 ) { charge -= daughters_[resPairAmpInt-1]->charge(); } return charge; }