ROOT  6.06/09
Reference Guide
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 
33 ;
34 
35 
36 ////////////////////////////////////////////////////////////////////////////////
37 /// Constructor with threshold value and associated category value
38 
40  _thresh(inThresh), _cat(inCat)
41 {
42 }
43 
44 
45 
46 ////////////////////////////////////////////////////////////////////////////////
47 /// Copy constructor
48 
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 
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 
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:487
virtual Int_t Compare(const TObject *) const
Implement TObject Compare() operator to facilitate sorting of RooThreshEntry object in ROOT collectio...
Double_t _thresh
int Int_t
Definition: RtypesCore.h:41
STL namespace.
void Class()
Definition: Class.C:29
double Double_t
Definition: RtypesCore.h:55
Mother of all ROOT objects.
Definition: TObject.h:58
ClassImp(RooThreshEntry)