MpdFemtoBaseParticleCut.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /**
  2. * \class MpdFemtoBaseParticleCut
  3. * \brief The pure virtual base class for the particle cut.
  4. *
  5. * All particle cuts must inherit from this one
  6. *
  7. * \author Grigory Nigmatkulov (NRNU MEPhI)
  8. * \date May 18, 2019
  9. * \email nigmatkulov@gmail.comm
  10. */
  11. #ifndef MpdFemtoBaseParticleCut_h
  12. #define MpdFemtoBaseParticleCut_h
  13. // C++ headers
  14. #include <iostream>
  15. // MpdFemtoMaker headers
  16. #include "MpdFemtoTypes.h"
  17. #include "MpdFemtoCutMonitorHandler.h"
  18. // ROOT headers
  19. #include "TList.h"
  20. #include "TObjString.h"
  21. #include "TString.h"
  22. // Forward declaration
  23. class MpdFemtoBaseAnalysis;
  24. //_________________
  25. class MpdFemtoBaseParticleCut : public MpdFemtoCutMonitorHandler {
  26. public:
  27. /// Default constructor
  28. MpdFemtoBaseParticleCut();
  29. /// Copy constructor
  30. MpdFemtoBaseParticleCut(const MpdFemtoBaseParticleCut& copy);
  31. /// Assignment operator
  32. MpdFemtoBaseParticleCut& operator=(const MpdFemtoBaseParticleCut& c);
  33. /// Default destructor
  34. virtual ~MpdFemtoBaseParticleCut() {
  35. /* no-op */
  36. }
  37. /// User-written method to return string describing cuts
  38. virtual MpdFemtoString report() = 0;
  39. /// User-written list of settings which is stored in the result file
  40. virtual TList *listSettings();
  41. /// Return mass of the particle to be selected
  42. double mass() {
  43. return mMass;
  44. }
  45. /// Set mass of the particle to be selected
  46. virtual void setMass(const double& mass) {
  47. mMass = mass;
  48. }
  49. /// Declare event start
  50. virtual void eventBegin(const MpdFemtoEvent*) {
  51. /* no-op */
  52. }
  53. /// Declare event end
  54. virtual void eventEnd(const MpdFemtoEvent*) {
  55. /* no-op */
  56. }
  57. /// Clone base particle cut
  58. virtual MpdFemtoBaseParticleCut* clone() {
  59. return nullptr;
  60. }
  61. /// Return particle type
  62. virtual MpdFemtoParticleType type() = 0;
  63. /// The following allows "back-pointing" from the CorrFctn
  64. /// to the "parent" Analysis
  65. friend class MpdFemtoBaseAnalysis;
  66. /// Return a pointer to the analysis
  67. MpdFemtoBaseAnalysis* hbtAnalysis() {
  68. return mBaseAnalysis;
  69. }
  70. /// Set analysis
  71. void setAnalysis(MpdFemtoBaseAnalysis* ana) {
  72. mBaseAnalysis = ana;
  73. }
  74. protected:
  75. /// Particle mass
  76. double mMass;
  77. /// Pointer to the base analysis
  78. MpdFemtoBaseAnalysis* mBaseAnalysis; //!<!
  79. ClassDef(MpdFemtoBaseParticleCut, 0)
  80. };
  81. //_________________
  82. inline MpdFemtoBaseParticleCut::MpdFemtoBaseParticleCut() : MpdFemtoCutMonitorHandler(), mMass(0), mBaseAnalysis(nullptr) {
  83. /* empty */
  84. }
  85. //_________________
  86. inline MpdFemtoBaseParticleCut::MpdFemtoBaseParticleCut(const MpdFemtoBaseParticleCut& c) :
  87. MpdFemtoCutMonitorHandler(c), mMass(c.mMass), mBaseAnalysis(c.mBaseAnalysis) {
  88. /* empty */
  89. }
  90. //_________________
  91. inline MpdFemtoBaseParticleCut& MpdFemtoBaseParticleCut::operator=(const MpdFemtoBaseParticleCut& c) {
  92. if (this != &c) {
  93. MpdFemtoCutMonitorHandler::operator=(c);
  94. mBaseAnalysis = c.mBaseAnalysis;
  95. mMass = c.mMass;
  96. }
  97. return *this;
  98. }
  99. //_________________
  100. inline TList *MpdFemtoBaseParticleCut::listSettings() {
  101. TList *listOfSettings = new TList();
  102. listOfSettings->Add(new TObjString(Form("MpdFemtoBaseParticleCut::mass = %5.3f", mMass)));
  103. return listOfSettings;
  104. }
  105. #endif // #define MpdFemtoBaseParticleCut_h