ATLAS Offline Software
Public Member Functions | Public Attributes | Private Types | Private Attributes | List of all members
Contour< T > Class Template Reference

#include <Contour.h>

Inheritance diagram for Contour< T >:
Collaboration diagram for Contour< T >:

Public Member Functions

 Contour (const std::string &s)
 
virtual ~Contour ()
 
void ranges (const std::vector< double > &d, T *t)
 
void ranges (const double *d, unsigned N, T *t)
 
T * find (double d)
 
std::string name () const
 
void Write (const std::string &s="")
 
TIDDirectorydir ()
 

Public Attributes

elements
 STL member. More...
 

Private Types

typedef std::pair< double, T * > value_type
 

Private Attributes

std::string mname
 
TIDDirectory mdir
 

Detailed Description

template<typename T>
class Contour< T >

Definition at line 24 of file Contour.h.

Member Typedef Documentation

◆ value_type

template<typename T >
typedef std::pair<double, T*> Contour< T >::value_type
private

Definition at line 26 of file Contour.h.

Constructor & Destructor Documentation

◆ Contour()

template<typename T >
Contour< T >::Contour ( const std::string &  s)
inline

Definition at line 30 of file Contour.h.

30 : mname(s), mdir(s) { }

◆ ~Contour()

template<typename T >
virtual Contour< T >::~Contour ( )
inlinevirtual

Definition at line 32 of file Contour.h.

32  {
33  for ( unsigned i=this->size()-1 ; i-- ; ) if ( this->at(i).second ) delete this->at(i).second;
34  }

Member Function Documentation

◆ dir()

template<typename T >
TIDDirectory* Contour< T >::dir ( )
inline

Definition at line 73 of file Contour.h.

73 { return &mdir; }

◆ find()

template<typename T >
T* Contour< T >::find ( double  d)
inline

Definition at line 50 of file Contour.h.

50  {
51  if ( this->empty() ) return 0;
52  for ( unsigned i=this->size()-1 ; i-- ; ) {
53  if ( d>=this->at(i).first && d<this->at(i+1).first ) return this->at(i).second;
54  }
55  return 0;
56  }

◆ name()

template<typename T >
std::string Contour< T >::name ( ) const
inline

Definition at line 58 of file Contour.h.

58 { return mname; }

◆ ranges() [1/2]

template<typename T >
void Contour< T >::ranges ( const double *  d,
unsigned  N,
T *  t 
)
inline

Definition at line 41 of file Contour.h.

41  {
42  mdir.push();
43  for ( unsigned i=1 ; i<N ; i++ ) {
44  this->push_back( value_type( d[i-1], new T(*t) ) );
45  }
46  this->push_back( value_type( d[N-1], 0 ) );
47  mdir.pop();
48  }

◆ ranges() [2/2]

template<typename T >
void Contour< T >::ranges ( const std::vector< double > &  d,
T *  t 
)
inline

Definition at line 36 of file Contour.h.

36  {
37  if ( d.empty() ) return;
38  ranges( &d[0], d.size(), t );
39  }

◆ Write()

template<typename T >
void Contour< T >::Write ( const std::string &  s = "")
inline

Definition at line 60 of file Contour.h.

60  {
61  mdir.push();
62  for ( unsigned i=this->size()-1 ; i-- ; ) {
63  if ( this->at(i).second ) {
64  char _name[64];
65  if ( s=="" ) std::sprintf( _name, "%s_%d", mname.c_str(), i-1 );
66  else std::sprintf( _name, "%s_%d", s.c_str(), i-1 );
67  this->at(i).second->Bayes()->Write(_name);
68  }
69  }
70  mdir.pop();
71  }

Member Data Documentation

◆ elements

T std::vector< T >::elements
inherited

STL member.

◆ mdir

template<typename T >
TIDDirectory Contour< T >::mdir
private

Definition at line 79 of file Contour.h.

◆ mname

template<typename T >
std::string Contour< T >::mname
private

Definition at line 77 of file Contour.h.


The documentation for this class was generated from the following file:
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
TIDDirectory::pop
void pop()
Definition: TIDDirectory.h:79
Contour::mdir
TIDDirectory mdir
Definition: Contour.h:79
hist_file_dump.d
d
Definition: hist_file_dump.py:137
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
lumiFormat.i
int i
Definition: lumiFormat.py:92
Contour::mname
std::string mname
Definition: Contour.h:77
Contour::value_type
std::pair< double, T * > value_type
Definition: Contour.h:26
TIDDirectory::push
void push()
Definition: TIDDirectory.h:78
DeMoScan.first
bool first
Definition: DeMoScan.py:534
Contour::ranges
void ranges(const std::vector< double > &d, T *t)
Definition: Contour.h:36
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35