MpdFemtoBaseCutMonitor.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /**
  2. * \class MpdFemtoBaseCutMonitor
  3. * \brief The base class for cut monitors
  4. *
  5. * A cut monitor saves attributes of the entities that have passed or failed
  6. * the given cut. This class is the base class which is present to
  7. * provide a common interface for storing data.
  8. *
  9. * Cut monitors are to be used in conjunction with cut monitor handlers
  10. * (MpdFemtoCutMonitorHandler) - of which all standard cuts (e.g.
  11. * MpdFemtoEventCut) inherit from. Your cut monitor objects get added to the
  12. * monitorhandlers via their addCutMonitor methods, and the Fill commands get
  13. * called by the handler upon their fillCutMonitor method, with the particular
  14. * entity type.
  15. *
  16. * The default behavior of this base class is to do nothing with the
  17. * incoming data, as no data members are provided. It is up to the user to use
  18. * (or write) a subclass with relevant histograms.
  19. *
  20. * To implement a custom cut monitor, subclass this class and overload the
  21. * Fill method(s) corresponding to the entity type(s) you wish to monitor.
  22. * All other 'fill' methods should be implemented to avoid 'member hiding'
  23. * compiler warnings.
  24. *
  25. * All methods of this class are empty except report which returns an empty
  26. * string and getOutputList which returns a pointer to an empty list.
  27. *
  28. * \author Grigory Nigmatkulov (NRNU MEPhI)
  29. * \date May 18, 2019
  30. * \email nigmatkulov@gmail.com
  31. */
  32. #ifndef MpdFemtoBaseCutMonitor_h
  33. #define MpdFemtoBaseCutMonitor_h
  34. // Forward declarations
  35. class MpdFemtoEvent;
  36. class MpdFemtoTrack;
  37. class MpdFemtoV0;
  38. class MpdFemtoXi;
  39. class MpdFemtoKink;
  40. class MpdFemtoPair;
  41. // C++ headers
  42. #include <iostream>
  43. // MpdFemtoMaker headers
  44. #include "MpdFemtoString.h"
  45. #include "MpdFemtoParticleCollection.h"
  46. // ROOT headers
  47. #include "TList.h"
  48. //_________________
  49. class MpdFemtoBaseCutMonitor {
  50. public:
  51. /// Default constructor
  52. MpdFemtoBaseCutMonitor() {
  53. /* no-op */
  54. };
  55. /// Default destructor
  56. virtual ~MpdFemtoBaseCutMonitor() {
  57. /* no-op */
  58. };
  59. /// Report details
  60. virtual MpdFemtoString report();
  61. /// Start event processing
  62. virtual void eventBegin(const MpdFemtoEvent*) {
  63. /* no-op */
  64. }
  65. /// Finish event processing
  66. virtual void eventEnd(const MpdFemtoEvent*) {
  67. /* no-op */
  68. }
  69. /// Returns pointer to empty list
  70. virtual TList* getOutputList();
  71. /// Fill method for event
  72. virtual void fill(const MpdFemtoEvent*);
  73. /// Fill method for track
  74. virtual void fill(const MpdFemtoTrack*);
  75. /// Fill method for v0
  76. virtual void fill(const MpdFemtoV0*);
  77. /// Fill method for xi
  78. virtual void fill(const MpdFemtoXi*);
  79. /// Fill method for kink
  80. virtual void fill(const MpdFemtoKink*);
  81. /// Fill method for pair
  82. virtual void fill(const MpdFemtoPair*);
  83. /// Fill method for particle collection
  84. virtual void fill(const MpdFemtoParticleCollection*);
  85. /// Fill method for event and particle collection
  86. virtual void fill(const MpdFemtoEvent*, const MpdFemtoParticleCollection*);
  87. /// Fill method for two particle collections
  88. virtual void fill(const MpdFemtoParticleCollection*, const MpdFemtoParticleCollection*);
  89. /// Finish
  90. virtual void finish();
  91. /// Initialize cut monitor
  92. virtual void init();
  93. ClassDef(MpdFemtoBaseCutMonitor, 0)
  94. };
  95. //_________________
  96. inline TList* MpdFemtoBaseCutMonitor::getOutputList() {
  97. TList *mOutputList = new TList();
  98. return mOutputList;
  99. }
  100. //_________________
  101. inline MpdFemtoString MpdFemtoBaseCutMonitor::report() {
  102. MpdFemtoString defReport("*** no user defined fill(const MpdFemtoEvent*), take from base class");
  103. return defReport;
  104. }
  105. #endif //#define MpdFemtoBaseCutMonitor_h