Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:34

0001 /*
0002  *  See header file for a description of this class.
0003  *
0004  *  \author Paolo Ronchese INFN Padova
0005  *
0006  */
0007 
0008 //-----------------------
0009 // This Class' Header --
0010 //-----------------------
0011 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHPlusMinusVertex.h"
0012 
0013 //-------------------------------
0014 // Collaborating Class Headers --
0015 //-------------------------------
0016 #include "HeavyFlavorAnalysis/RecoDecay/interface/BPHAnalyzerTokenWrapper.h"
0017 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
0018 
0019 //---------------
0020 // C++ Headers --
0021 //---------------
0022 using namespace std;
0023 
0024 //-------------------
0025 // Initializations --
0026 //-------------------
0027 
0028 //----------------
0029 // Constructors --
0030 //----------------
0031 BPHPlusMinusVertex::BPHPlusMinusVertex(const BPHEventSetupWrapper* es)
0032     : BPHDecayVertex(es), oldA(true), inRPhi(nullptr) {}
0033 
0034 //--------------
0035 // Destructor --
0036 //--------------
0037 BPHPlusMinusVertex::~BPHPlusMinusVertex() { delete inRPhi; }
0038 
0039 //--------------
0040 // Operations --
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 }