File indexing completed on 2025-02-21 10:00:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #pragma once
0012
0013 #include "Generic2D.h"
0014 #include <AIDA/IProfile1D.h>
0015 #include <Gaudi/Histograming/Sink/Utils.h>
0016 #include <GaudiKernel/DataObject.h>
0017 #include <TProfile2D.h>
0018
0019 #include <nlohmann/json.hpp>
0020
0021 #include <mutex>
0022
0023 namespace Gaudi {
0024
0025
0026
0027
0028
0029
0030
0031 class GAUDI_API Profile2D : public DataObject, public Generic2D<AIDA::IProfile2D, TProfile2D> {
0032 public:
0033
0034 Profile2D() : Base( new TProfile2D() ) {
0035 m_classType = "IProfile2D";
0036 m_rep->SetErrorOption( "s" );
0037 m_rep->SetDirectory( nullptr );
0038 }
0039
0040 Profile2D( TProfile2D* rep );
0041
0042
0043 bool fill( double x, double y, double z, double weight ) override {
0044
0045 auto guard = std::scoped_lock{ m_fillSerialization };
0046 m_rep->Fill( x, y, z, weight );
0047 return true;
0048 }
0049 friend void reset( Profile2D& h ) { h.reset(); }
0050
0051 friend void to_json( nlohmann::json& j, Profile2D const& p ) { j = *p.m_rep.get(); }
0052
0053 const CLID& clID() const override { return classID(); }
0054 static const CLID& classID() { return CLID_ProfileH2; }
0055
0056 private:
0057 std::mutex m_fillSerialization;
0058 };
0059 }