ROOT
6.06/09
Reference Guide
ROOT Home Page
Main Page
Related Pages
User's Classes
Namespaces
All Classes
Files
Release Notes
File List
File Members
roofit
roofitcore
src
RooThreshEntry.cxx
Go to the documentation of this file.
1
/*****************************************************************************
2
* Project: RooFit *
3
* Package: RooFitCore *
4
* @(#)root/roofitcore:$Id$
5
* Authors: *
6
* WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7
* DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8
* *
9
* Copyright (c) 2000-2005, Regents of the University of California *
10
* and Stanford University. All rights reserved. *
11
* *
12
* Redistribution and use in source and binary forms, *
13
* with or without modification, are permitted according to the terms *
14
* listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15
*****************************************************************************/
16
17
//////////////////////////////////////////////////////////////////////////////
18
//
19
// BEGIN_HTML
20
// Class RooThreshEntry is a utility class for RooThresholdCategory
21
// END_HTML
22
//
23
24
#include "
RooFit.h
"
25
26
#include "
TClass.h
"
27
#include "
TClass.h
"
28
#include "
RooThreshEntry.h
"
29
30
using namespace
std
;
31
32
ClassImp
(
RooThreshEntry
)
33
;
34
35
36
////////////////////////////////////////////////////////////////////////////////
37
/// Constructor with threshold value and associated category value
38
39
RooThreshEntry::RooThreshEntry
(
Double_t
inThresh,
const
RooCatType
& inCat) :
40
_thresh(inThresh), _cat(inCat)
41
{
42
}
43
44
45
46
////////////////////////////////////////////////////////////////////////////////
47
/// Copy constructor
48
49
RooThreshEntry::RooThreshEntry
(
const
RooThreshEntry
& other) :
50
TObject
(other), _thresh(other._thresh), _cat(other._cat)
51
{
52
}
53
54
55
56
////////////////////////////////////////////////////////////////////////////////
57
/// Implement TObject Compare() operator to facilitate sorting of
58
/// RooThreshEntry object in ROOT collection. Only comparison
59
/// to other RooThreshEntry objects is supported
60
61
Int_t
RooThreshEntry::Compare
(
const
TObject
* other)
const
62
{
63
// Can only compare objects of same type
64
if
(!other->IsA()->
InheritsFrom
(
RooThreshEntry::Class
()))
return
0 ;
65
66
RooThreshEntry
* otherTE = (
RooThreshEntry
*) other ;
67
return
(_thresh < otherTE->
_thresh
) ? -1 : 1 ;
68
}
69
70
TClass.h
TObject::InheritsFrom
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition:
TObject.cxx:487
RooThreshEntry::Compare
virtual Int_t Compare(const TObject *) const
Implement TObject Compare() operator to facilitate sorting of RooThreshEntry object in ROOT collectio...
Definition:
RooThreshEntry.cxx:61
RooThreshEntry::_thresh
Double_t _thresh
Definition:
RooThreshEntry.h:39
Int_t
int Int_t
Definition:
RtypesCore.h:41
std
STL namespace.
Class
void Class()
Definition:
Class.C:29
RooCatType
Definition:
RooCatType.h:23
RooThreshEntry
Definition:
RooThreshEntry.h:23
RooThreshEntry::RooThreshEntry
RooThreshEntry()
Definition:
RooThreshEntry.h:25
Double_t
double Double_t
Definition:
RtypesCore.h:55
TObject
Mother of all ROOT objects.
Definition:
TObject.h:58
ClassImp
ClassImp(RooThreshEntry)
RooFit.h
RooThreshEntry.h