File indexing completed on 2024-04-06 12:15:34
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHPlusMinusVertex.h"
0012
0013
0014
0015
0016 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHAnalyzerTokenWrapper.h"
0017 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
0018
0019
0020
0021
0022 using namespace std;
0023
0024
0025
0026
0027
0028
0029
0030
0031 BPHPlusMinusVertex::BPHPlusMinusVertex(const BPHEventSetupWrapper* es)
0032 : BPHDecayVertex(es), oldA(true), inRPhi(nullptr) {}
0033
0034
0035
0036
0037 BPHPlusMinusVertex::~BPHPlusMinusVertex() { delete inRPhi; }
0038
0039
0040
0041
0042 const ClosestApproachInRPhi& BPHPlusMinusVertex::cAppInRPhi() const {
0043 if (oldA)
0044 computeApp();
0045 if (inRPhi == nullptr) {
0046 static const ClosestApproachInRPhi ca;
0047 return ca;
0048 }
0049 return *inRPhi;
0050 }
0051
0052 bool BPHPlusMinusVertex::chkSize(const string& msg) const { return chkSize(daughters(), msg); }
0053
0054 void BPHPlusMinusVertex::setNotUpdated() const {
0055 BPHDecayVertex::setNotUpdated();
0056 oldA = true;
0057 return;
0058 }
0059
0060 void BPHPlusMinusVertex::computeApp() const {
0061 static const string msg = "BPHPlusMinusVertex::computeApp: incomplete, no closest approach available";
0062 delete inRPhi;
0063 if (!chkSize(msg)) {
0064 inRPhi = nullptr;
0065 return;
0066 }
0067 inRPhi = new ClosestApproachInRPhi;
0068 const vector<reco::TransientTrack>& ttk = transientTracks();
0069 const reco::TransientTrack& ttp = ttk[0];
0070 const reco::TransientTrack& ttn = ttk[1];
0071 inRPhi->calculate(ttp.impactPointTSCP().theState(), ttn.impactPointTSCP().theState());
0072 oldA = false;
0073 return;
0074 }