File indexing completed on 2024-04-06 12:15:33
0001 #ifndef HeavyFlavorAnalysis_RecoDecay_BPHPlusMinusVertex_h
0002 #define HeavyFlavorAnalysis_RecoDecay_BPHPlusMinusVertex_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHDecayVertex.h"
0017
0018
0019
0020
0021 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHPlusMinusCandidatePtr.h"
0022 #include "TrackingTools/PatternTools/interface/ClosestApproachInRPhi.h"
0023 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0024
0025 class BPHEventSetupWrapper;
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 class BPHPlusMinusVertex : public virtual BPHDecayVertex {
0036 public:
0037
0038
0039
0040
0041 BPHPlusMinusVertex(const BPHPlusMinusVertex& x) = delete;
0042 BPHPlusMinusVertex& operator=(const BPHPlusMinusVertex& x) = delete;
0043
0044
0045
0046 ~BPHPlusMinusVertex() override;
0047
0048
0049
0050
0051 virtual const ClosestApproachInRPhi& cAppInRPhi() const;
0052
0053 protected:
0054 BPHPlusMinusVertex(const BPHEventSetupWrapper* es);
0055
0056
0057 template <class T>
0058 static bool chkName(const T& cont, const std::string& name, const std::string& msg);
0059 template <class T>
0060 static bool chkSize(const T& cont, const std::string& msg);
0061 bool chkSize(const std::string& msg) const;
0062
0063
0064 void setNotUpdated() const override;
0065
0066 private:
0067
0068 mutable bool oldA;
0069 mutable ClosestApproachInRPhi* inRPhi;
0070
0071
0072 virtual void computeApp() const;
0073 };
0074
0075 template <class T>
0076 bool BPHPlusMinusVertex::chkName(const T& cont, const std::string& name, const std::string& msg) {
0077 if (cont.find(name) != cont.end())
0078 return true;
0079 edm::LogPrint("ParticleNotFound") << msg << ", " << name << " not found";
0080 return false;
0081 }
0082
0083 template <class T>
0084 bool BPHPlusMinusVertex::chkSize(const T& cont, const std::string& msg) {
0085 int n = cont.size();
0086 if (n == 2)
0087 return true;
0088 edm::LogPrint("WrongDataSize") << msg << ", size = " << n;
0089 return false;
0090 }
0091
0092 #endif