CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFTauDiscriminantManager.h
Go to the documentation of this file.
1 #ifndef RecoTauTag_TauTagTools_PFTauDiscriminantManager_h
2 #define RecoTauTag_TauTagTools_PFTauDiscriminantManager_h
3 
9 #include "TTree.h"
10 
11 namespace PFTauDiscriminants
12 {
13 
14 class Discriminant;
15 
17  public:
20 
21  typedef std::vector<const reco::Candidate*> candPtrVector;
22  //maps string (discriminant name, ( (discriminantComputer), links)
23  typedef std::map<std::string, Discriminant* const> discriminantHolder;
25  void addDiscriminant(Discriminant* const aDiscriminant);
27  bool branchTree(TTree* const treeToBranch, bool addTargetBranch = false, bool addWeightBranch = false);
29  void buildMVAComputerLink(std::vector<PhysicsTools::Variable::Value>&);
31  bool setTau(const reco::PFTauDecayMode& theTau, bool prePass = false, bool preFail = false);
34  bool setNullResult();
36  void setEvent(const edm::Event&, double eventWeight);
37 
38  void setSignalFlag(bool isSignal) { iAmSignal_ = isSignal; };
39 
40  //TODO: Discriminant should be a friend and these should be private...
41 
45  const edm::Event* getEvent() const { return eventData_; };
46 
48  const reco::Candidate* mainTrack();
50  const std::vector<const reco::Candidate*>& signalObjectsSortedByPt();
51  const std::vector<const reco::Candidate*>& signalObjectsSortedByDR();
52  const std::vector<const reco::Candidate*>& outlierObjectsSortedByPt();
53  const std::vector<const reco::Candidate*>& outlierObjectsSortedByDR();
54 
56  static std::vector<const reco::Candidate*> getLeafDaughters(const reco::Candidate* input);
57 
59  candPtrVector filterByCharge(const candPtrVector& input, bool isCharged) const;
60 
61  protected:
62 
63  private:
64  // magic variables
65  Bool_t iAmSignal_;
66  Bool_t iAmNull_;
67  Bool_t prePass_;
68  Bool_t preFail_;
69 
70  Double_t eventWeight_;
74 
75  void clearCache();
76  //cached objects
82 
83  //utility functions for filling caches
86  void computeMainTrack();
87 
88 };
89 
90 }
91 #endif
92 
const edm::Event * getEvent() const
returns associated edm::Event
void addDiscriminant(Discriminant *const aDiscriminant)
add a discriminant
bool setTau(const reco::PFTauDecayMode &theTau, bool prePass=false, bool preFail=false)
set objects for this discriminant
static std::vector< const reco::Candidate * > getLeafDaughters(const reco::Candidate *input)
return the lowest level constituent candidates of a composite candidate
const std::vector< const reco::Candidate * > & outlierObjectsSortedByPt()
std::map< std::string, Discriminant *const > discriminantHolder
const std::vector< const reco::Candidate * > & outlierObjectsSortedByDR()
void setEvent(const edm::Event &, double eventWeight)
set the current event. Must be called (once per event) before setTau or setNullResult ...
const std::vector< const reco::Candidate * > & signalObjectsSortedByPt()
accessed by Discriminant classes (caches to prevent multiple sorts)
const reco::Candidate * mainTrack()
get the &#39;main&#39; track (track computed for relevancy to tau decay resonances) (ie pi- in pi+pi+pi-) ...
const std::vector< const reco::Candidate * > & signalObjectsSortedByDR()
tuple input
Definition: collect_tpl.py:10
std::vector< const reco::Candidate * > candPtrVector
const reco::PFTauDecayMode * getDecayMode() const
returns associated PFTauDecayMode
bool branchTree(TTree *const treeToBranch, bool addTargetBranch=false, bool addWeightBranch=false)
add a set of branches ot the TTree
std::vector< const reco::Candidate * > candPtrVector
candPtrVector filterByCharge(const candPtrVector &input, bool isCharged) const
void buildMVAComputerLink(std::vector< PhysicsTools::Variable::Value > &)
connect to an MVA computer