Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:27

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitCore                                                       *
0004  *    File: $Id: RooThresholdCategory.h,v 1.8 2007/05/11 09:11:30 verkerke Exp $
0005  * Authors:                                                                  *
0006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
0007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
0008  *                                                                           *
0009  * Copyright (c) 2000-2005, Regents of the University of California          *
0010  *                          and Stanford University. All rights reserved.    *
0011  *                                                                           *
0012  * Redistribution and use in source and binary forms,                        *
0013  * with or without modification, are permitted according to the terms        *
0014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
0015  *****************************************************************************/
0016 #ifndef ROO_THRESHOLD_CATEGORY
0017 #define ROO_THRESHOLD_CATEGORY
0018 
0019 #include "RooAbsCategory.h"
0020 #include "RooRealProxy.h"
0021 #include <vector>
0022 #include <utility>
0023 
0024 class RooThresholdCategory : public RooAbsCategory {
0025 
0026 public:
0027   // Constructors etc.
0028   RooThresholdCategory() {};
0029   RooThresholdCategory(const char *name, const char *title, RooAbsReal& inputVar,
0030       const char* defCatName="Default", Int_t defCatIdx=0);
0031   RooThresholdCategory(const RooThresholdCategory& other, const char *name=nullptr) ;
0032   TObject* clone(const char* newname) const override { return new RooThresholdCategory(*this, newname); }
0033 
0034   // Mapping function
0035   bool addThreshold(double upperLimit, const char* catName, Int_t catIdx=-99999) ;
0036 
0037   // Printing interface (human readable)
0038   void printMultiline(std::ostream& os, Int_t content, bool verbose=false, TString indent="") const override ;
0039 
0040   void writeToStream(std::ostream& os, bool compact) const override ;
0041 
0042 protected:
0043 
0044   RooRealProxy _inputVar ;
0045   const value_type _defIndex{std::numeric_limits<value_type>::min()};
0046   std::vector<std::pair<double,value_type>> _threshList;
0047 
0048   value_type evaluate() const override ;
0049   /// No shape recomputation is necessary. This category does not depend on other categories.
0050   void recomputeShape() override { }
0051 
0052   ClassDefOverride(RooThresholdCategory, 3) // Real-to-Category function defined by series of thresholds
0053 };
0054 
0055 #endif