CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes | Private Member Functions | Friends
PhysicsTGraphPayload Class Reference

#include <PhysicsTGraphPayload.h>

Public Member Functions

 operator TGraph () const
 conversion to TGraph More...
 
 PhysicsTGraphPayload ()
 default constructor More...
 
 PhysicsTGraphPayload (const TGraph &graph)
 constructor from TGraph object More...
 
void print (std::ostream &stream) const
 print points of TGraph object More...
 

Protected Attributes

std::string name_
 
int numPoints_
 
std::vector< float > x_
 
std::vector< float > y_
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Definition at line 22 of file PhysicsTGraphPayload.h.

Constructor & Destructor Documentation

◆ PhysicsTGraphPayload() [1/2]

PhysicsTGraphPayload::PhysicsTGraphPayload ( )

default constructor

Definition at line 7 of file PhysicsTGraphPayload.cc.

7 : numPoints_(0) {}

◆ PhysicsTGraphPayload() [2/2]

PhysicsTGraphPayload::PhysicsTGraphPayload ( const TGraph &  graph)

constructor from TGraph object

Definition at line 9 of file PhysicsTGraphPayload.cc.

9  : numPoints_(0) {
10  if (graph.GetN() >= 1) {
11  name_ = graph.GetName();
12  numPoints_ = graph.GetN();
13  x_.resize(numPoints_);
14  y_.resize(numPoints_);
15  for (int iPoint = 0; iPoint < numPoints_; ++iPoint) {
16  Double_t xPoint, yPoint;
17  graph.GetPoint(iPoint, xPoint, yPoint);
18  x_[iPoint] = xPoint;
19  y_[iPoint] = yPoint;
20  }
21  }
22 }

References name_, numPoints_, x_, and y_.

Member Function Documentation

◆ operator TGraph()

PhysicsTGraphPayload::operator TGraph ( ) const

conversion to TGraph

Definition at line 24 of file PhysicsTGraphPayload.cc.

24  {
25  if (numPoints_ >= 1) {
26  TGraph graph(numPoints_);
27  graph.SetName(name_.data());
28  for (int iPoint = 0; iPoint < numPoints_; ++iPoint) {
29  graph.SetPoint(iPoint, x_[iPoint], y_[iPoint]);
30  }
31  return graph;
32  } else {
33  throw cms::Exception("PhysicsTGraphPayload") << "Invalid TGraph object !!\n";
34  }
35 }

References Exception.

◆ print()

void PhysicsTGraphPayload::print ( std::ostream &  stream) const

print points of TGraph object

Definition at line 37 of file PhysicsTGraphPayload.cc.

37  {
38  stream << "<PhysicsTGraphPayload::print (name = " << name_ << ")>:" << std::endl;
39  for (int iPoint = 0; iPoint < numPoints_; ++iPoint) {
40  stream << "point #" << iPoint << ": x = " << x_[iPoint] << ", y = " << y_[iPoint] << std::endl;
41  }
42 }

References name_, numPoints_, cms::cuda::stream, x_, and y_.

◆ serialize()

template<class Archive >
void PhysicsTGraphPayload::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 42 of file PhysicsTGraphPayload.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 42 of file PhysicsTGraphPayload.h.

Member Data Documentation

◆ name_

std::string PhysicsTGraphPayload::name_
protected

Definition at line 37 of file PhysicsTGraphPayload.h.

Referenced by PhysicsTGraphPayload(), and print().

◆ numPoints_

int PhysicsTGraphPayload::numPoints_
protected

Definition at line 38 of file PhysicsTGraphPayload.h.

Referenced by PhysicsTGraphPayload(), and print().

◆ x_

std::vector<float> PhysicsTGraphPayload::x_
protected

Definition at line 39 of file PhysicsTGraphPayload.h.

Referenced by PhysicsTGraphPayload(), and print().

◆ y_

std::vector<float> PhysicsTGraphPayload::y_
protected

Definition at line 40 of file PhysicsTGraphPayload.h.

Referenced by PhysicsTGraphPayload(), and print().

PhysicsTGraphPayload::name_
std::string name_
Definition: PhysicsTGraphPayload.h:37
cms::cuda::stream
cudaStream_t stream
Definition: HistoContainer.h:57
PhysicsTGraphPayload::y_
std::vector< float > y_
Definition: PhysicsTGraphPayload.h:40
PhysicsTGraphPayload::x_
std::vector< float > x_
Definition: PhysicsTGraphPayload.h:39
PhysicsTGraphPayload::numPoints_
int numPoints_
Definition: PhysicsTGraphPayload.h:38
Exception
Definition: hltDiff.cc:245