ROOT
6.07/09
Reference Guide
ROOT Home Page
Main Page
Tutorials
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
\file RooThreshEntry.cxx
19
\class RooThreshEntry
20
\ingroup Roofitcore
21
22
Class RooThreshEntry is a utility class for RooThresholdCategory
23
**/
24
25
#include "
RooFit.h
"
26
27
#include "
TClass.h
"
28
#include "
TClass.h
"
29
#include "
RooThreshEntry.h
"
30
31
using namespace
std
;
32
33
ClassImp
(
RooThreshEntry
)
34
;
35
36
37
////////////////////////////////////////////////////////////////////////////////
38
/// Constructor with threshold value and associated category value
39
40
RooThreshEntry::RooThreshEntry
(
Double_t
inThresh,
const
RooCatType
& inCat) :
41
_thresh(inThresh), _cat(inCat)
42
{
43
}
44
45
46
47
////////////////////////////////////////////////////////////////////////////////
48
/// Copy constructor
49
50
RooThreshEntry::RooThreshEntry
(
const
RooThreshEntry
& other) :
51
TObject
(other),
_thresh
(other.
_thresh
),
_cat
(other.
_cat
)
52
{
53
}
54
55
56
57
////////////////////////////////////////////////////////////////////////////////
58
/// Implement TObject Compare() operator to facilitate sorting of
59
/// RooThreshEntry object in ROOT collection. Only comparison
60
/// to other RooThreshEntry objects is supported
61
62
Int_t
RooThreshEntry::Compare
(
const
TObject
* other)
const
63
{
64
// Can only compare objects of same type
65
if
(!other->IsA()->
InheritsFrom
(
RooThreshEntry::Class
()))
return
0 ;
66
67
RooThreshEntry
* otherTE = (
RooThreshEntry
*) other ;
68
return
(_thresh < otherTE->
_thresh
) ? -1 : 1 ;
69
}
70
71
TClass.h
TObject::InheritsFrom
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition:
TObject.cxx:488
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:62
RooThreshEntry::_thresh
Double_t _thresh
Definition:
RooThreshEntry.h:39
Int_t
int Int_t
Definition:
RtypesCore.h:41
std
STL namespace.
xmlio::Class
const char * Class
Definition:
TXMLSetup.cxx:64
RooThreshEntry::_cat
RooCatType _cat
Definition:
RooThreshEntry.h:40
RooCatType
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state...
Definition:
RooCatType.h:23
RooThreshEntry
Class RooThreshEntry is a utility class for RooThresholdCategory.
Definition:
RooThreshEntry.h:23
RooThreshEntry::RooThreshEntry
RooThreshEntry()
Definition:
RooThreshEntry.h:25
ClassImp
#define ClassImp(name)
Definition:
Rtypes.h:279
Double_t
double Double_t
Definition:
RtypesCore.h:55
TObject
Mother of all ROOT objects.
Definition:
TObject.h:44
RooFit.h
RooThreshEntry.h