File indexing completed on 2024-04-06 12:15:33
0001 #ifndef HeavyFlavorAnalysis_RecoDecay_BPHDecayMomentum_h
0002 #define HeavyFlavorAnalysis_RecoDecay_BPHDecayMomentum_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHRecoCandidatePtr.h"
0021 #include "DataFormats/PatCandidates/interface/CompositeCandidate.h"
0022 class BPHRecoBuilder;
0023
0024
0025
0026
0027 #include <vector>
0028 #include <map>
0029 #include <string>
0030
0031
0032
0033
0034
0035 class BPHDecayMomentum {
0036 public:
0037
0038
0039
0040
0041 BPHDecayMomentum(const BPHDecayMomentum& x) = delete;
0042 BPHDecayMomentum& operator=(const BPHDecayMomentum& x) = delete;
0043
0044
0045
0046 virtual ~BPHDecayMomentum();
0047
0048
0049
0050
0051
0052 virtual const pat::CompositeCandidate& composite() const;
0053
0054
0055
0056
0057
0058 virtual const std::vector<std::string>& daugNames() const;
0059
0060
0061
0062
0063
0064 virtual const std::vector<std::string>& compNames() const;
0065
0066
0067
0068
0069
0070
0071 virtual const std::vector<const reco::Candidate*>& daughters() const;
0072
0073
0074
0075
0076
0077
0078
0079 virtual const std::vector<const reco::Candidate*>& daughFull() const;
0080
0081
0082 virtual const reco::Candidate* originalReco(const reco::Candidate* daug) const;
0083
0084
0085
0086
0087
0088 virtual const std::vector<BPHRecoConstCandPtr>& daughComp() const;
0089
0090
0091
0092 virtual const reco::Candidate* getDaug(const std::string& name) const;
0093
0094
0095
0096 virtual BPHRecoConstCandPtr getComp(const std::string& name) const;
0097
0098 const std::map<std::string, const reco::Candidate*>& daugMap() const { return dMap; }
0099
0100 const std::map<std::string, BPHRecoConstCandPtr>& compMap() const { return cMap; }
0101
0102 struct Component {
0103 const reco::Candidate* cand;
0104 double mass;
0105 double msig;
0106 std::string searchList;
0107 };
0108
0109 protected:
0110
0111 BPHDecayMomentum(int daugNum = 2, int compNum = 2);
0112 BPHDecayMomentum(const std::map<std::string, Component>& daugMap, int compNum = 2);
0113 BPHDecayMomentum(const std::map<std::string, Component>& daugMap,
0114 const std::map<std::string, BPHRecoConstCandPtr> compMap);
0115
0116
0117
0118 const std::vector<Component>& componentList() const;
0119
0120
0121
0122 virtual void addP(const std::string& name, const reco::Candidate* daug, double mass = -1.0);
0123
0124 virtual void addP(const std::string& name, const BPHRecoConstCandPtr& comp);
0125
0126
0127 virtual void setNotUpdated() const;
0128
0129
0130
0131 virtual void fill(BPHRecoCandidate* ptr, int level) const = 0;
0132
0133 private:
0134
0135
0136 std::vector<Component> compList;
0137
0138
0139 std::vector<std::string> nList;
0140 std::vector<std::string> nComp;
0141
0142
0143
0144 std::vector<const reco::Candidate*> dList;
0145 std::vector<BPHRecoConstCandPtr> cList;
0146
0147
0148
0149 std::map<std::string, const reco::Candidate*> dMap;
0150 std::map<std::string, BPHRecoConstCandPtr> cMap;
0151
0152
0153 std::map<const reco::Candidate*, const reco::Candidate*> clonesMap;
0154
0155
0156 mutable bool oldMom;
0157 mutable std::vector<const reco::Candidate*> dFull;
0158 mutable pat::CompositeCandidate compCand;
0159
0160
0161 void clonesList(const std::map<std::string, Component>& daugMap);
0162
0163
0164
0165 void dCompList();
0166
0167
0168
0169 virtual void sumMomentum(const std::vector<const reco::Candidate*>& dl, const std::vector<std::string>& dn) const;
0170
0171
0172
0173 virtual void fillDaug(std::vector<const reco::Candidate*>& ad,
0174 const std::string& name,
0175 std::vector<std::string>& an) const;
0176
0177
0178 virtual void computeMomentum() const;
0179 };
0180
0181 #endif