diff --git a/PhysicsTools/BPHNano/plugins/BToTrkLLBuilder.cc b/PhysicsTools/BPHNano/plugins/BToTrkLLBuilder.cc
index 2178c48de419..24c5f325dc47 100644
--- a/PhysicsTools/BPHNano/plugins/BToTrkLLBuilder.cc
+++ b/PhysicsTools/BPHNano/plugins/BToTrkLLBuilder.cc
@@ -32,38 +32,31 @@
 
 class BToTrkLLBuilder : public edm::global::EDProducer<> {
   // perhaps we need better structure here (begin run etc)
- public:
+public:
   typedef std::vector<reco::TransientTrack> TransientTrackCollection;
 
   explicit BToTrkLLBuilder(const edm::ParameterSet &cfg)
       : bFieldToken_{esConsumes<MagneticField, IdealMagneticFieldRecord>()},
         pre_vtx_selection_{cfg.getParameter<std::string>("preVtxSelection")},
         post_vtx_selection_{cfg.getParameter<std::string>("postVtxSelection")},
-        dileptons_{consumes<pat::CompositeCandidateCollection>(
-            cfg.getParameter<edm::InputTag>("dileptons"))},
-        leptons_ttracks_{consumes<TransientTrackCollection>(
-            cfg.getParameter<edm::InputTag>("leptonTransientTracks"))},
-        kaons_{consumes<pat::CompositeCandidateCollection>(
-            cfg.getParameter<edm::InputTag>("kaons"))},
-        kaons_ttracks_{consumes<TransientTrackCollection>(
-            cfg.getParameter<edm::InputTag>("kaonsTransientTracks"))},
+        dileptons_{consumes<pat::CompositeCandidateCollection>(cfg.getParameter<edm::InputTag>("dileptons"))},
+        leptons_ttracks_{consumes<TransientTrackCollection>(cfg.getParameter<edm::InputTag>("leptonTransientTracks"))},
+        kaons_{consumes<pat::CompositeCandidateCollection>(cfg.getParameter<edm::InputTag>("kaons"))},
+        kaons_ttracks_{consumes<TransientTrackCollection>(cfg.getParameter<edm::InputTag>("kaonsTransientTracks"))},
         track_mass_{cfg.getParameter<double>("trackMass")},
-        pu_tracks_(consumes<pat::CompositeCandidateCollection>(
-            cfg.getParameter<edm::InputTag>("PUtracks"))),
-        beamspot_{consumes<reco::BeamSpot>(
-            cfg.getParameter<edm::InputTag>("beamSpot"))},
+        pu_tracks_(consumes<pat::CompositeCandidateCollection>(cfg.getParameter<edm::InputTag>("PUtracks"))),
+        beamspot_{consumes<reco::BeamSpot>(cfg.getParameter<edm::InputTag>("beamSpot"))},
         dilepton_constraint_{cfg.getParameter<bool>("dileptonMassContraint")} {
     produces<pat::CompositeCandidateCollection>();
   }
 
   ~BToTrkLLBuilder() override {}
 
-  void produce(edm::StreamID, edm::Event &,
-               const edm::EventSetup &) const override;
+  void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override;
 
   static void fillDescriptions(edm::ConfigurationDescriptions &descriptions) {}
 
- private:
+private:
   const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> bFieldToken_;
 
   // selections
@@ -81,8 +74,7 @@ class BToTrkLLBuilder : public edm::global::EDProducer<> {
   const bool dilepton_constraint_;
 };
 
-void BToTrkLLBuilder::produce(edm::StreamID, edm::Event &evt,
-                              edm::EventSetup const &iSetup) const {
+void BToTrkLLBuilder::produce(edm::StreamID, edm::Event &evt, edm::EventSetup const &iSetup) const {
   // input
   edm::Handle<pat::CompositeCandidateCollection> dileptons;
   evt.getByToken(dileptons_, dileptons);
@@ -105,14 +97,12 @@ void BToTrkLLBuilder::produce(edm::StreamID, edm::Event &evt,
   AnalyticalImpactPointExtrapolator extrapolator(&bField);
 
   // output
-  std::unique_ptr<pat::CompositeCandidateCollection> ret_val(
-      new pat::CompositeCandidateCollection());
+  std::unique_ptr<pat::CompositeCandidateCollection> ret_val(new pat::CompositeCandidateCollection());
 
   for (size_t k_idx = 0; k_idx < kaons->size(); ++k_idx) {
     edm::Ptr<pat::CompositeCandidate> k_ptr(kaons, k_idx);
 
-    math::PtEtaPhiMLorentzVector k_p4(k_ptr->pt(), k_ptr->eta(), k_ptr->phi(),
-                                      K_MASS);
+    math::PtEtaPhiMLorentzVector k_p4(k_ptr->pt(), k_ptr->eta(), k_ptr->phi(), K_MASS);
 
     for (size_t ll_idx = 0; ll_idx < dileptons->size(); ++ll_idx) {
       edm::Ptr<pat::CompositeCandidate> ll_prt(dileptons, ll_idx);
@@ -139,53 +129,44 @@ void BToTrkLLBuilder::produce(edm::StreamID, edm::Event &evt,
       cand.addUserFloat("min_dr", dr_info.first);
       cand.addUserFloat("max_dr", dr_info.second);
 
-      if (!pre_vtx_selection_(cand)) continue;
+      if (!pre_vtx_selection_(cand))
+        continue;
 
-      KinVtxFitter fitter(
-          {leptons_ttracks->at(l1_idx), leptons_ttracks->at(l2_idx),
-           kaons_ttracks->at(k_idx)},
-          {l1_ptr->mass(), l2_ptr->mass(), K_MASS},
-          {LEP_SIGMA, LEP_SIGMA, K_SIGMA}
-          // some small sigma for the lepton mass
+      KinVtxFitter fitter({leptons_ttracks->at(l1_idx), leptons_ttracks->at(l2_idx), kaons_ttracks->at(k_idx)},
+                          {l1_ptr->mass(), l2_ptr->mass(), K_MASS},
+                          {LEP_SIGMA, LEP_SIGMA, K_SIGMA}  // some small sigma for the lepton mass
       );
 
-      if (!fitter.success()) continue;  // hardcoded, but do we need otherwise?
-      cand.setVertex(reco::Candidate::Point(fitter.fitted_vtx().x(),
-                                            fitter.fitted_vtx().y(),
-                                            fitter.fitted_vtx().z()));
+      if (!fitter.success())
+        continue;  // hardcoded, but do we need otherwise?
+      cand.setVertex(reco::Candidate::Point(fitter.fitted_vtx().x(), fitter.fitted_vtx().y(), fitter.fitted_vtx().z()));
       cand.addUserInt("sv_OK", fitter.success());
       cand.addUserFloat("sv_chi2", fitter.chi2());
       cand.addUserFloat("sv_ndof", fitter.dof());  // float??
       cand.addUserFloat("sv_prob", fitter.prob());
-      cand.addUserFloat("fitted_mll",
-                        (fitter.daughter_p4(0) + fitter.daughter_p4(1)).mass());
+      cand.addUserFloat("fitted_mll", (fitter.daughter_p4(0) + fitter.daughter_p4(1)).mass());
       auto fit_p4 = fitter.fitted_p4();
       cand.addUserFloat("fitted_pt", fit_p4.pt());
       cand.addUserFloat("fitted_eta", fit_p4.eta());
       cand.addUserFloat("fitted_phi", fit_p4.phi());
       cand.addUserFloat("fitted_mass", fitter.fitted_candidate().mass());
-      cand.addUserFloat(
-          "fitted_massErr",
-          sqrt(fitter.fitted_candidate().kinematicParametersError().matrix()(
-              6, 6)));
+      cand.addUserFloat("fitted_massErr", sqrt(fitter.fitted_candidate().kinematicParametersError().matrix()(6, 6)));
 
-      cand.addUserFloat("cos_theta_2D",
-                        cos_theta_2D(fitter, *beamspot, cand.p4()));
-      cand.addUserFloat("fitted_cos_theta_2D",
-                        cos_theta_2D(fitter, *beamspot, fit_p4));
+      cand.addUserFloat("cos_theta_2D", cos_theta_2D(fitter, *beamspot, cand.p4()));
+      cand.addUserFloat("fitted_cos_theta_2D", cos_theta_2D(fitter, *beamspot, fit_p4));
 
       auto lxy = l_xy(fitter, *beamspot);
       cand.addUserFloat("l_xy", lxy.value());
       cand.addUserFloat("l_xy_unc", lxy.error());
       // track impact parameter from SV
-      TrajectoryStateOnSurface tsos = extrapolator.extrapolate(
-          kaons_ttracks->at(k_idx).impactPointState(), fitter.fitted_vtx());
-      std::pair<bool, Measurement1D> cur2DIP = signedTransverseImpactParameter(
-          tsos, fitter.fitted_refvtx(), *beamspot);
+      TrajectoryStateOnSurface tsos =
+          extrapolator.extrapolate(kaons_ttracks->at(k_idx).impactPointState(), fitter.fitted_vtx());
+      std::pair<bool, Measurement1D> cur2DIP = signedTransverseImpactParameter(tsos, fitter.fitted_refvtx(), *beamspot);
       cand.addUserFloat("k_svip2d", cur2DIP.second.value());
       cand.addUserFloat("k_svip2d_err", cur2DIP.second.error());
 
-      if (!post_vtx_selection_(cand)) continue;
+      if (!post_vtx_selection_(cand))
+        continue;
 
       cand.addUserFloat("vtx_x", cand.vx());
       cand.addUserFloat("vtx_y", cand.vy());
@@ -203,14 +184,11 @@ void BToTrkLLBuilder::produce(edm::StreamID, edm::Event &evt,
       std::vector<std::string> dnames{"l1", "l2", "trk"};
 
       for (size_t idaughter = 0; idaughter < dnames.size(); idaughter++) {
-        cand.addUserFloat("fitted_" + dnames[idaughter] + "_pt",
-                          fitter.daughter_p4(idaughter).pt());
+        cand.addUserFloat("fitted_" + dnames[idaughter] + "_pt", fitter.daughter_p4(idaughter).pt());
 
-        cand.addUserFloat("fitted_" + dnames[idaughter] + "_eta",
-                          fitter.daughter_p4(idaughter).eta());
+        cand.addUserFloat("fitted_" + dnames[idaughter] + "_eta", fitter.daughter_p4(idaughter).eta());
 
-        cand.addUserFloat("fitted_" + dnames[idaughter] + "_phi",
-                          fitter.daughter_p4(idaughter).phi());
+        cand.addUserFloat("fitted_" + dnames[idaughter] + "_phi", fitter.daughter_p4(idaughter).phi());
       }
 
       // compute isolation
@@ -231,38 +209,31 @@ void BToTrkLLBuilder::produce(edm::StreamID, edm::Event &evt,
       const double jpsi_bin[2] = {2.8, 3.35};
       const double psi2s_bin[2] = {3.45, 3.85};
 
-      if (dilepton_constraint_ &&
-          ((dilepton_mass > jpsi_bin[0] && dilepton_mass < jpsi_bin[1]) ||
-           (dilepton_mass > psi2s_bin[0] && dilepton_mass < psi2s_bin[1]))) {
+      if (dilepton_constraint_ && ((dilepton_mass > jpsi_bin[0] && dilepton_mass < jpsi_bin[1]) ||
+                                   (dilepton_mass > psi2s_bin[0] && dilepton_mass < psi2s_bin[1]))) {
         ParticleMass JPsi_mass = 3.0969;   // Jpsi mass 3.096900±0.000006
         ParticleMass Psi2S_mass = 3.6861;  // Psi2S mass 3.6861093±0.0000034
-        ParticleMass mass_constraint =
-            (dilepton_mass < jpsi_bin[1]) ? JPsi_mass : Psi2S_mass;
+        ParticleMass mass_constraint = (dilepton_mass < jpsi_bin[1]) ? JPsi_mass : Psi2S_mass;
 
         // Mass constraint is applied to the first two particles in the
         // "particles" vector Make sure that the first two particles are the
         // ones you want to constrain
         KinVtxFitter constraint_fitter(
-            {leptons_ttracks->at(l1_idx), leptons_ttracks->at(l2_idx),
-             kaons_ttracks->at(k_idx)},
+            {leptons_ttracks->at(l1_idx), leptons_ttracks->at(l2_idx), kaons_ttracks->at(k_idx)},
             {l1_ptr->mass(), l2_ptr->mass(), K_MASS},
-            {LEP_SIGMA, LEP_SIGMA, K_SIGMA}, mass_constraint);
+            {LEP_SIGMA, LEP_SIGMA, K_SIGMA},
+            mass_constraint);
         if (constraint_fitter.success()) {
           auto constraint_p4 = constraint_fitter.fitted_p4();
           cand.addUserFloat("constraint_sv_prob", constraint_fitter.prob());
           cand.addUserFloat("constraint_pt", constraint_p4.pt());
           cand.addUserFloat("constraint_eta", constraint_p4.eta());
           cand.addUserFloat("constraint_phi", constraint_p4.phi());
-          cand.addUserFloat("constraint_mass",
-                            constraint_fitter.fitted_candidate().mass());
+          cand.addUserFloat("constraint_mass", constraint_fitter.fitted_candidate().mass());
           cand.addUserFloat("constraint_massErr",
-                            sqrt(constraint_fitter.fitted_candidate()
-                                     .kinematicParametersError()
-                                     .matrix()(6, 6)));
+                            sqrt(constraint_fitter.fitted_candidate().kinematicParametersError().matrix()(6, 6)));
           cand.addUserFloat("constraint_mll",
-                            (constraint_fitter.daughter_p4(0) +
-                             constraint_fitter.daughter_p4(1))
-                                .mass());
+                            (constraint_fitter.daughter_p4(0) + constraint_fitter.daughter_p4(1)).mass());
         }
       }
 
diff --git a/PhysicsTools/BPHNano/plugins/BToTrkTrkLLBuilder.cc b/PhysicsTools/BPHNano/plugins/BToTrkTrkLLBuilder.cc
index bdd619604238..1f8ff3597802 100644
--- a/PhysicsTools/BPHNano/plugins/BToTrkTrkLLBuilder.cc
+++ b/PhysicsTools/BPHNano/plugins/BToTrkTrkLLBuilder.cc
@@ -31,7 +31,7 @@
 
 class BToTrkTrkLLBuilder : public edm::global::EDProducer<> {
   // perhaps we need better structure here (begin run etc)
- public:
+public:
   typedef std::vector<reco::TransientTrack> TransientTrackCollection;
 
   explicit BToTrkTrkLLBuilder(const edm::ParameterSet &cfg)
@@ -40,20 +40,14 @@ class BToTrkTrkLLBuilder : public edm::global::EDProducer<> {
         pre_vtx_selection_{cfg.getParameter<std::string>("preVtxSelection")},
         post_vtx_selection_{cfg.getParameter<std::string>("postVtxSelection")},
         // inputs
-        dileptons_{consumes<pat::CompositeCandidateCollection>(
-            cfg.getParameter<edm::InputTag>("dileptons"))},
+        dileptons_{consumes<pat::CompositeCandidateCollection>(cfg.getParameter<edm::InputTag>("dileptons"))},
         // dileptons_kinVtxs_{consumes<std::vector<KinVtxFitter> >(
         // cfg.getParameter<edm::InputTag>("dileptonKinVtxs") )},
-        ditracks_{consumes<pat::CompositeCandidateCollection>(
-            cfg.getParameter<edm::InputTag>("ditracks"))},
-        leptons_ttracks_{consumes<TransientTrackCollection>(
-            cfg.getParameter<edm::InputTag>("leptonTransientTracks"))},
-        ditracks_ttracks_{consumes<TransientTrackCollection>(
-            cfg.getParameter<edm::InputTag>("transientTracks"))},
-        pu_tracks_(consumes<pat::CompositeCandidateCollection>(
-            cfg.getParameter<edm::InputTag>("PUtracks"))),
-        beamspot_{consumes<reco::BeamSpot>(
-            cfg.getParameter<edm::InputTag>("beamSpot"))},
+        ditracks_{consumes<pat::CompositeCandidateCollection>(cfg.getParameter<edm::InputTag>("ditracks"))},
+        leptons_ttracks_{consumes<TransientTrackCollection>(cfg.getParameter<edm::InputTag>("leptonTransientTracks"))},
+        ditracks_ttracks_{consumes<TransientTrackCollection>(cfg.getParameter<edm::InputTag>("transientTracks"))},
+        pu_tracks_(consumes<pat::CompositeCandidateCollection>(cfg.getParameter<edm::InputTag>("PUtracks"))),
+        beamspot_{consumes<reco::BeamSpot>(cfg.getParameter<edm::InputTag>("beamSpot"))},
         dilepton_constraint_{cfg.getParameter<bool>("dileptonMassContraint")} {
     // output
     produces<pat::CompositeCandidateCollection>();
@@ -61,12 +55,11 @@ class BToTrkTrkLLBuilder : public edm::global::EDProducer<> {
 
   ~BToTrkTrkLLBuilder() override {}
 
-  void produce(edm::StreamID, edm::Event &,
-               const edm::EventSetup &) const override;
+  void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override;
 
   static void fillDescriptions(edm::ConfigurationDescriptions &descriptions) {}
 
- private:
+private:
   const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> bFieldToken_;
 
   // selections
@@ -84,8 +77,7 @@ class BToTrkTrkLLBuilder : public edm::global::EDProducer<> {
   const bool dilepton_constraint_;
 };
 
-void BToTrkTrkLLBuilder::produce(edm::StreamID, edm::Event &evt,
-                                 edm::EventSetup const &iSetup) const {
+void BToTrkTrkLLBuilder::produce(edm::StreamID, edm::Event &evt, edm::EventSetup const &iSetup) const {
   // input
   edm::Handle<pat::CompositeCandidateCollection> dileptons;
   evt.getByToken(dileptons_, dileptons);
@@ -110,11 +102,9 @@ void BToTrkTrkLLBuilder::produce(edm::StreamID, edm::Event &evt,
   AnalyticalImpactPointExtrapolator extrapolator(&bField);
 
   // output
-  std::unique_ptr<pat::CompositeCandidateCollection> ret_val(
-      new pat::CompositeCandidateCollection());
+  std::unique_ptr<pat::CompositeCandidateCollection> ret_val(new pat::CompositeCandidateCollection());
 
-  for (size_t ditracks_idx = 0; ditracks_idx < ditracks->size();
-       ++ditracks_idx) {
+  for (size_t ditracks_idx = 0; ditracks_idx < ditracks->size(); ++ditracks_idx) {
     // both k*,phi and lep pair already passed cuts; no need for more
     // preselection
     edm::Ptr<pat::CompositeCandidate> ditracks_ptr(ditracks, ditracks_idx);
@@ -133,8 +123,7 @@ void BToTrkTrkLLBuilder::produce(edm::StreamID, edm::Event &evt,
       // B0 candidate
       pat::CompositeCandidate cand;
       cand.setP4(ll_ptr->p4() + ditracks_ptr->p4());
-      cand.setCharge(l1_ptr->charge() + l2_ptr->charge() + trk1_ptr->charge() +
-                     trk2_ptr->charge());
+      cand.setCharge(l1_ptr->charge() + l2_ptr->charge() + trk1_ptr->charge() + trk2_ptr->charge());
 
       // save daughters - unfitted
       cand.addUserCand("l1", l1_ptr);
@@ -161,47 +150,49 @@ void BToTrkTrkLLBuilder::produce(edm::StreamID, edm::Event &evt,
 
       trk1_p4.SetM(K_MASS);
       trk2_p4.SetM(K_MASS);
-      cand.addUserFloat("unfitted_B_mass_KK",
-                        (trk1_p4 + trk2_p4 + lep1_p4 + lep2_p4).M());
+      cand.addUserFloat("unfitted_B_mass_KK", (trk1_p4 + trk2_p4 + lep1_p4 + lep2_p4).M());
       trk1_p4.SetM(K_MASS);
       trk2_p4.SetM(PI_MASS);
-      cand.addUserFloat("unfitted_B_mass_Kpi",
-                        (trk1_p4 + trk2_p4 + lep1_p4 + lep2_p4).M());
+      cand.addUserFloat("unfitted_B_mass_Kpi", (trk1_p4 + trk2_p4 + lep1_p4 + lep2_p4).M());
       trk2_p4.SetM(K_MASS);
       trk1_p4.SetM(PI_MASS);
-      cand.addUserFloat("unfitted_B_mass_piK",
-                        (trk1_p4 + trk2_p4 + lep1_p4 + lep2_p4).M());
+      cand.addUserFloat("unfitted_B_mass_piK", (trk1_p4 + trk2_p4 + lep1_p4 + lep2_p4).M());
 
       auto dr_info = min_max_dr({l1_ptr, l2_ptr, trk1_ptr, trk2_ptr});
       cand.addUserFloat("min_dr", dr_info.first);
       cand.addUserFloat("max_dr", dr_info.second);
 
       // check if pass pre vertex cut
-      if (!pre_vtx_selection_(cand)) continue;
-
-      KinVtxFitter fitter(
-          {leptons_ttracks->at(l1_idx), leptons_ttracks->at(l2_idx),
-           ditracks_ttracks->at(trk1_idx), ditracks_ttracks->at(trk2_idx)},
-          {l1_ptr->mass(), l2_ptr->mass(), K_MASS, K_MASS},
-          {LEP_SIGMA, LEP_SIGMA, K_SIGMA, K_SIGMA});
-      if (!fitter.success()) continue;
-      KinVtxFitter fitter_Kpi(
-          {leptons_ttracks->at(l1_idx), leptons_ttracks->at(l2_idx),
-           ditracks_ttracks->at(trk1_idx), ditracks_ttracks->at(trk2_idx)},
-          {l1_ptr->mass(), l2_ptr->mass(), K_MASS, PI_MASS},
-          {LEP_SIGMA, LEP_SIGMA, K_SIGMA, K_SIGMA});
-      if (!fitter_Kpi.success()) continue;
-      KinVtxFitter fitter_piK(
-          {leptons_ttracks->at(l1_idx), leptons_ttracks->at(l2_idx),
-           ditracks_ttracks->at(trk1_idx), ditracks_ttracks->at(trk2_idx)},
-          {l1_ptr->mass(), l2_ptr->mass(), PI_MASS, K_MASS},
-          {LEP_SIGMA, LEP_SIGMA, K_SIGMA, K_SIGMA});
-      if (!fitter_piK.success()) continue;
+      if (!pre_vtx_selection_(cand))
+        continue;
+
+      KinVtxFitter fitter({leptons_ttracks->at(l1_idx),
+                           leptons_ttracks->at(l2_idx),
+                           ditracks_ttracks->at(trk1_idx),
+                           ditracks_ttracks->at(trk2_idx)},
+                          {l1_ptr->mass(), l2_ptr->mass(), K_MASS, K_MASS},
+                          {LEP_SIGMA, LEP_SIGMA, K_SIGMA, K_SIGMA});
+      if (!fitter.success())
+        continue;
+      KinVtxFitter fitter_Kpi({leptons_ttracks->at(l1_idx),
+                               leptons_ttracks->at(l2_idx),
+                               ditracks_ttracks->at(trk1_idx),
+                               ditracks_ttracks->at(trk2_idx)},
+                              {l1_ptr->mass(), l2_ptr->mass(), K_MASS, PI_MASS},
+                              {LEP_SIGMA, LEP_SIGMA, K_SIGMA, K_SIGMA});
+      if (!fitter_Kpi.success())
+        continue;
+      KinVtxFitter fitter_piK({leptons_ttracks->at(l1_idx),
+                               leptons_ttracks->at(l2_idx),
+                               ditracks_ttracks->at(trk1_idx),
+                               ditracks_ttracks->at(trk2_idx)},
+                              {l1_ptr->mass(), l2_ptr->mass(), PI_MASS, K_MASS},
+                              {LEP_SIGMA, LEP_SIGMA, K_SIGMA, K_SIGMA});
+      if (!fitter_piK.success())
+        continue;
 
       // B0 position
-      cand.setVertex(reco::Candidate::Point(fitter.fitted_vtx().x(),
-                                            fitter.fitted_vtx().y(),
-                                            fitter.fitted_vtx().z()));
+      cand.setVertex(reco::Candidate::Point(fitter.fitted_vtx().x(), fitter.fitted_vtx().y(), fitter.fitted_vtx().z()));
 
       // vertex vars
       cand.addUserFloat("sv_chi2", fitter.chi2());
@@ -209,31 +200,16 @@ void BToTrkTrkLLBuilder::produce(edm::StreamID, edm::Event &evt,
       cand.addUserFloat("sv_prob", fitter.prob());
 
       // refitted kinematic vars
-      cand.addUserFloat("fitted_ditrack_mass_KK",
-                        (fitter.daughter_p4(2) + fitter.daughter_p4(3)).mass());
-      cand.addUserFloat(
-          "fitted_ditrack_mass_Kpi",
-          (fitter_Kpi.daughter_p4(2) + fitter_Kpi.daughter_p4(3)).mass());
-      cand.addUserFloat(
-          "fitted_ditrack_mass_piK",
-          (fitter_piK.daughter_p4(2) + fitter_piK.daughter_p4(3)).mass());
-      cand.addUserFloat(
-          "fitted_massErr_KK",
-          sqrt(fitter.fitted_candidate().kinematicParametersError().matrix()(
-              6, 6)));
-      cand.addUserFloat(
-          "fitted_massErr_Kpi",
-          sqrt(
-              fitter_Kpi.fitted_candidate().kinematicParametersError().matrix()(
-                  6, 6)));
-      cand.addUserFloat(
-          "fitted_massErr_piK",
-          sqrt(
-              fitter_piK.fitted_candidate().kinematicParametersError().matrix()(
-                  6, 6)));
-
-      cand.addUserFloat("fitted_mll",
-                        (fitter.daughter_p4(0) + fitter.daughter_p4(1)).mass());
+      cand.addUserFloat("fitted_ditrack_mass_KK", (fitter.daughter_p4(2) + fitter.daughter_p4(3)).mass());
+      cand.addUserFloat("fitted_ditrack_mass_Kpi", (fitter_Kpi.daughter_p4(2) + fitter_Kpi.daughter_p4(3)).mass());
+      cand.addUserFloat("fitted_ditrack_mass_piK", (fitter_piK.daughter_p4(2) + fitter_piK.daughter_p4(3)).mass());
+      cand.addUserFloat("fitted_massErr_KK", sqrt(fitter.fitted_candidate().kinematicParametersError().matrix()(6, 6)));
+      cand.addUserFloat("fitted_massErr_Kpi",
+                        sqrt(fitter_Kpi.fitted_candidate().kinematicParametersError().matrix()(6, 6)));
+      cand.addUserFloat("fitted_massErr_piK",
+                        sqrt(fitter_piK.fitted_candidate().kinematicParametersError().matrix()(6, 6)));
+
+      cand.addUserFloat("fitted_mll", (fitter.daughter_p4(0) + fitter.daughter_p4(1)).mass());
 
       auto fit_p4 = fitter.fitted_p4();
       cand.addUserFloat("fitted_pt", fit_p4.pt());
@@ -245,35 +221,32 @@ void BToTrkTrkLLBuilder::produce(edm::StreamID, edm::Event &evt,
       cand.addUserFloat("fitted_mass_piK", fitter_piK.fitted_p4().mass());
 
       // other vars
-      cand.addUserFloat("cos_theta_2D",
-                        cos_theta_2D(fitter, *beamspot, cand.p4()));
+      cand.addUserFloat("cos_theta_2D", cos_theta_2D(fitter, *beamspot, cand.p4()));
 
-      cand.addUserFloat("fitted_cos_theta_2D",
-                        cos_theta_2D(fitter, *beamspot, fit_p4));
+      cand.addUserFloat("fitted_cos_theta_2D", cos_theta_2D(fitter, *beamspot, fit_p4));
 
       auto lxy = l_xy(fitter, *beamspot);
       cand.addUserFloat("l_xy", lxy.value());
       cand.addUserFloat("l_xy_unc", lxy.error());
       // track impact parameter from dilepton SV
 
-      TrajectoryStateOnSurface tsos1 = extrapolator.extrapolate(
-          ditracks_ttracks->at(trk1_idx).impactPointState(),
-          fitter.fitted_vtx());
-      std::pair<bool, Measurement1D> cur2DIP1 = signedTransverseImpactParameter(
-          tsos1, fitter.fitted_refvtx(), *beamspot);
+      TrajectoryStateOnSurface tsos1 =
+          extrapolator.extrapolate(ditracks_ttracks->at(trk1_idx).impactPointState(), fitter.fitted_vtx());
+      std::pair<bool, Measurement1D> cur2DIP1 =
+          signedTransverseImpactParameter(tsos1, fitter.fitted_refvtx(), *beamspot);
       cand.addUserFloat("trk1_svip2d", cur2DIP1.second.value());
       cand.addUserFloat("trk1_svip2d_err", cur2DIP1.second.error());
 
-      TrajectoryStateOnSurface tsos2 = extrapolator.extrapolate(
-          ditracks_ttracks->at(trk2_idx).impactPointState(),
-          fitter.fitted_vtx());
-      std::pair<bool, Measurement1D> cur2DIP2 = signedTransverseImpactParameter(
-          tsos2, fitter.fitted_refvtx(), *beamspot);
+      TrajectoryStateOnSurface tsos2 =
+          extrapolator.extrapolate(ditracks_ttracks->at(trk2_idx).impactPointState(), fitter.fitted_vtx());
+      std::pair<bool, Measurement1D> cur2DIP2 =
+          signedTransverseImpactParameter(tsos2, fitter.fitted_refvtx(), *beamspot);
       cand.addUserFloat("trk2_svip2d", cur2DIP2.second.value());
       cand.addUserFloat("trk2_svip2d_err", cur2DIP2.second.error());
 
       // post fit selection
-      if (!post_vtx_selection_(cand)) continue;
+      if (!post_vtx_selection_(cand))
+        continue;
 
       cand.addUserFloat("vtx_x", cand.vx());
       cand.addUserFloat("vtx_y", cand.vy());
@@ -291,12 +264,9 @@ void BToTrkTrkLLBuilder::produce(edm::StreamID, edm::Event &evt,
       std::vector<std::string> dnames{"l1", "l2", "trk1", "trk2"};
 
       for (size_t idaughter = 0; idaughter < dnames.size(); idaughter++) {
-        cand.addUserFloat("fitted_" + dnames[idaughter] + "_pt",
-                          fitter.daughter_p4(idaughter).pt());
-        cand.addUserFloat("fitted_" + dnames[idaughter] + "_eta",
-                          fitter.daughter_p4(idaughter).eta());
-        cand.addUserFloat("fitted_" + dnames[idaughter] + "_phi",
-                          fitter.daughter_p4(idaughter).phi());
+        cand.addUserFloat("fitted_" + dnames[idaughter] + "_pt", fitter.daughter_p4(idaughter).pt());
+        cand.addUserFloat("fitted_" + dnames[idaughter] + "_eta", fitter.daughter_p4(idaughter).eta());
+        cand.addUserFloat("fitted_" + dnames[idaughter] + "_phi", fitter.daughter_p4(idaughter).phi());
       }
 
       // compute isolation
@@ -321,36 +291,43 @@ void BToTrkTrkLLBuilder::produce(edm::StreamID, edm::Event &evt,
       const double jpsi_bin[2] = {2.8, 3.35};
       const double psi2s_bin[2] = {3.45, 3.85};
 
-      if (dilepton_constraint_ &&
-          ((dilepton_mass > jpsi_bin[0] && dilepton_mass < jpsi_bin[1]) ||
-           (dilepton_mass > psi2s_bin[0] && dilepton_mass < psi2s_bin[1]))) {
+      if (dilepton_constraint_ && ((dilepton_mass > jpsi_bin[0] && dilepton_mass < jpsi_bin[1]) ||
+                                   (dilepton_mass > psi2s_bin[0] && dilepton_mass < psi2s_bin[1]))) {
         ParticleMass JPsi_mass = 3.0969;   // Jpsi mass 3.096900±0.000006
         ParticleMass Psi2S_mass = 3.6861;  // Psi2S mass 3.6861093±0.0000034
-        ParticleMass mass_constraint =
-            (dilepton_mass < jpsi_bin[1]) ? JPsi_mass : Psi2S_mass;
+        ParticleMass mass_constraint = (dilepton_mass < jpsi_bin[1]) ? JPsi_mass : Psi2S_mass;
 
         // Mass constraint is applied to the first two particles in the
         // "particles" vector Make sure that the first two particles are the
         // ones you want to constrain
 
-        KinVtxFitter constraint_fitter_KK(
-            {leptons_ttracks->at(l1_idx), leptons_ttracks->at(l2_idx),
-             ditracks_ttracks->at(trk1_idx), ditracks_ttracks->at(trk2_idx)},
-            {l1_ptr->mass(), l2_ptr->mass(), K_MASS, K_MASS},
-            {LEP_SIGMA, LEP_SIGMA, K_SIGMA, K_SIGMA}, mass_constraint);
-        if (!constraint_fitter_KK.success()) continue;
-        KinVtxFitter constraint_fitter_Kpi(
-            {leptons_ttracks->at(l1_idx), leptons_ttracks->at(l2_idx),
-             ditracks_ttracks->at(trk1_idx), ditracks_ttracks->at(trk2_idx)},
-            {l1_ptr->mass(), l2_ptr->mass(), K_MASS, PI_MASS},
-            {LEP_SIGMA, LEP_SIGMA, K_SIGMA, K_SIGMA}, mass_constraint);
-        if (!constraint_fitter_Kpi.success()) continue;
-        KinVtxFitter constraint_fitter_piK(
-            {leptons_ttracks->at(l1_idx), leptons_ttracks->at(l2_idx),
-             ditracks_ttracks->at(trk1_idx), ditracks_ttracks->at(trk2_idx)},
-            {l1_ptr->mass(), l2_ptr->mass(), PI_MASS, K_MASS},
-            {LEP_SIGMA, LEP_SIGMA, K_SIGMA, K_SIGMA}, mass_constraint);
-        if (!constraint_fitter_piK.success()) continue;
+        KinVtxFitter constraint_fitter_KK({leptons_ttracks->at(l1_idx),
+                                           leptons_ttracks->at(l2_idx),
+                                           ditracks_ttracks->at(trk1_idx),
+                                           ditracks_ttracks->at(trk2_idx)},
+                                          {l1_ptr->mass(), l2_ptr->mass(), K_MASS, K_MASS},
+                                          {LEP_SIGMA, LEP_SIGMA, K_SIGMA, K_SIGMA},
+                                          mass_constraint);
+        if (!constraint_fitter_KK.success())
+          continue;
+        KinVtxFitter constraint_fitter_Kpi({leptons_ttracks->at(l1_idx),
+                                            leptons_ttracks->at(l2_idx),
+                                            ditracks_ttracks->at(trk1_idx),
+                                            ditracks_ttracks->at(trk2_idx)},
+                                           {l1_ptr->mass(), l2_ptr->mass(), K_MASS, PI_MASS},
+                                           {LEP_SIGMA, LEP_SIGMA, K_SIGMA, K_SIGMA},
+                                           mass_constraint);
+        if (!constraint_fitter_Kpi.success())
+          continue;
+        KinVtxFitter constraint_fitter_piK({leptons_ttracks->at(l1_idx),
+                                            leptons_ttracks->at(l2_idx),
+                                            ditracks_ttracks->at(trk1_idx),
+                                            ditracks_ttracks->at(trk2_idx)},
+                                           {l1_ptr->mass(), l2_ptr->mass(), PI_MASS, K_MASS},
+                                           {LEP_SIGMA, LEP_SIGMA, K_SIGMA, K_SIGMA},
+                                           mass_constraint);
+        if (!constraint_fitter_piK.success())
+          continue;
 
         if (constraint_fitter_KK.success()) {
           auto constraint_p4 = constraint_fitter_KK.fitted_p4();
@@ -358,28 +335,17 @@ void BToTrkTrkLLBuilder::produce(edm::StreamID, edm::Event &evt,
           cand.addUserFloat("constraint_pt", constraint_p4.pt());
           cand.addUserFloat("constraint_eta", constraint_p4.eta());
           cand.addUserFloat("constraint_phi", constraint_p4.phi());
-          cand.addUserFloat("constraint_mass_KK",
-                            constraint_fitter_KK.fitted_candidate().mass());
+          cand.addUserFloat("constraint_mass_KK", constraint_fitter_KK.fitted_candidate().mass());
           cand.addUserFloat("constraint_massErr_KK",
-                            sqrt(constraint_fitter_KK.fitted_candidate()
-                                     .kinematicParametersError()
-                                     .matrix()(6, 6)));
-          cand.addUserFloat("constraint_mass_Kpi",
-                            constraint_fitter_Kpi.fitted_candidate().mass());
+                            sqrt(constraint_fitter_KK.fitted_candidate().kinematicParametersError().matrix()(6, 6)));
+          cand.addUserFloat("constraint_mass_Kpi", constraint_fitter_Kpi.fitted_candidate().mass());
           cand.addUserFloat("constraint_massErr_Kpi",
-                            sqrt(constraint_fitter_Kpi.fitted_candidate()
-                                     .kinematicParametersError()
-                                     .matrix()(6, 6)));
-          cand.addUserFloat("constraint_mass_piK",
-                            constraint_fitter_piK.fitted_candidate().mass());
+                            sqrt(constraint_fitter_Kpi.fitted_candidate().kinematicParametersError().matrix()(6, 6)));
+          cand.addUserFloat("constraint_mass_piK", constraint_fitter_piK.fitted_candidate().mass());
           cand.addUserFloat("constraint_massErr_piK",
-                            sqrt(constraint_fitter_piK.fitted_candidate()
-                                     .kinematicParametersError()
-                                     .matrix()(6, 6)));
+                            sqrt(constraint_fitter_piK.fitted_candidate().kinematicParametersError().matrix()(6, 6)));
           cand.addUserFloat("constraint_mll",
-                            (constraint_fitter_KK.daughter_p4(0) +
-                             constraint_fitter_KK.daughter_p4(1))
-                                .mass());
+                            (constraint_fitter_KK.daughter_p4(0) + constraint_fitter_KK.daughter_p4(1)).mass());
         }
       }
 
diff --git a/PhysicsTools/BPHNano/plugins/BToV0LLBuilder.cc b/PhysicsTools/BPHNano/plugins/BToV0LLBuilder.cc
index c505f53037b6..01c2f579327d 100644
--- a/PhysicsTools/BPHNano/plugins/BToV0LLBuilder.cc
+++ b/PhysicsTools/BPHNano/plugins/BToV0LLBuilder.cc
@@ -38,39 +38,32 @@
 
 class BToV0LLBuilder : public edm::global::EDProducer<> {
   // perhaps we need better structure here (begin run etc)
- public:
+public:
   typedef std::vector<reco::TransientTrack> TransientTrackCollection;
 
   explicit BToV0LLBuilder(const edm::ParameterSet &cfg)
       : bFieldToken_{esConsumes<MagneticField, IdealMagneticFieldRecord>()},
         pre_vtx_selection_{cfg.getParameter<std::string>("preVtxSelection")},
         post_vtx_selection_{cfg.getParameter<std::string>("postVtxSelection")},
-        dileptons_{consumes<pat::CompositeCandidateCollection>(
-            cfg.getParameter<edm::InputTag>("dileptons"))},
+        dileptons_{consumes<pat::CompositeCandidateCollection>(cfg.getParameter<edm::InputTag>("dileptons"))},
         //    dileptons_kinVtxs_{consumes<std::vector<KinVtxFitter> >(
         //    cfg.getParameter<edm::InputTag>("dileptonKinVtxs") )},
-        leptons_ttracks_{consumes<TransientTrackCollection>(
-            cfg.getParameter<edm::InputTag>("leptonTransientTracks"))},
-        v0s_{consumes<pat::CompositeCandidateCollection>(
-            cfg.getParameter<edm::InputTag>("v0s"))},
-        v0_ttracks_{consumes<TransientTrackCollection>(
-            cfg.getParameter<edm::InputTag>("v0TransientTracks"))},
-        pu_tracks_(consumes<pat::CompositeCandidateCollection>(
-            cfg.getParameter<edm::InputTag>("PUtracks"))),
-        beamspot_{consumes<reco::BeamSpot>(
-            cfg.getParameter<edm::InputTag>("beamSpot"))},
+        leptons_ttracks_{consumes<TransientTrackCollection>(cfg.getParameter<edm::InputTag>("leptonTransientTracks"))},
+        v0s_{consumes<pat::CompositeCandidateCollection>(cfg.getParameter<edm::InputTag>("v0s"))},
+        v0_ttracks_{consumes<TransientTrackCollection>(cfg.getParameter<edm::InputTag>("v0TransientTracks"))},
+        pu_tracks_(consumes<pat::CompositeCandidateCollection>(cfg.getParameter<edm::InputTag>("PUtracks"))),
+        beamspot_{consumes<reco::BeamSpot>(cfg.getParameter<edm::InputTag>("beamSpot"))},
         dilepton_constraint_{cfg.getParameter<bool>("dileptonMassContraint")} {
     produces<pat::CompositeCandidateCollection>();
   }
 
   ~BToV0LLBuilder() override {}
 
-  void produce(edm::StreamID, edm::Event &,
-               const edm::EventSetup &) const override;
+  void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override;
 
   static void fillDescriptions(edm::ConfigurationDescriptions &descriptions) {}
 
- private:
+private:
   const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> bFieldToken_;
 
   // selection
@@ -88,8 +81,7 @@ class BToV0LLBuilder : public edm::global::EDProducer<> {
   const bool dilepton_constraint_;
 };
 
-void BToV0LLBuilder::produce(edm::StreamID, edm::Event &evt,
-                             edm::EventSetup const &iSetup) const {
+void BToV0LLBuilder::produce(edm::StreamID, edm::Event &evt, edm::EventSetup const &iSetup) const {
   // input
   edm::Handle<pat::CompositeCandidateCollection> dileptons;
   evt.getByToken(dileptons_, dileptons);
@@ -114,8 +106,7 @@ void BToV0LLBuilder::produce(edm::StreamID, edm::Event &evt,
   AnalyticalImpactPointExtrapolator extrapolator(&bField);
 
   // output
-  std::unique_ptr<pat::CompositeCandidateCollection> ret_val(
-      new pat::CompositeCandidateCollection());
+  std::unique_ptr<pat::CompositeCandidateCollection> ret_val(new pat::CompositeCandidateCollection());
 
   // access V0
   for (size_t v0_idx = 0; v0_idx < v0s->size(); ++v0_idx) {
@@ -143,24 +134,22 @@ void BToV0LLBuilder::produce(edm::StreamID, edm::Event &evt,
       cand.addUserFloat("max_dr", dr_info.second);
 
       // built B
-      if (!pre_vtx_selection_(cand)) continue;
+      if (!pre_vtx_selection_(cand))
+        continue;
 
-      KinVtxFitter fitter({leptons_ttracks->at(l1_idx),
-                           leptons_ttracks->at(l2_idx), v0_ttracks->at(v0_idx)},
+      KinVtxFitter fitter({leptons_ttracks->at(l1_idx), leptons_ttracks->at(l2_idx), v0_ttracks->at(v0_idx)},
                           {l1_ptr->mass(), l2_ptr->mass(), v0_ptr->mass()},
                           {LEP_SIGMA, LEP_SIGMA, v0_ptr->userFloat("massErr")});
 
-      if (!fitter.success()) continue;
+      if (!fitter.success())
+        continue;
 
-      cand.setVertex(reco::Candidate::Point(fitter.fitted_vtx().x(),
-                                            fitter.fitted_vtx().y(),
-                                            fitter.fitted_vtx().z()));
+      cand.setVertex(reco::Candidate::Point(fitter.fitted_vtx().x(), fitter.fitted_vtx().y(), fitter.fitted_vtx().z()));
 
       cand.addUserFloat("sv_chi2", fitter.chi2());
       cand.addUserFloat("sv_ndof", fitter.dof());
       cand.addUserFloat("sv_prob", fitter.prob());
-      cand.addUserFloat("fitted_mll",
-                        (fitter.daughter_p4(0) + fitter.daughter_p4(1)).mass());
+      cand.addUserFloat("fitted_mll", (fitter.daughter_p4(0) + fitter.daughter_p4(1)).mass());
       cand.addUserFloat("fitted_v0_mass", fitter.daughter_p4(2).mass());
 
       auto fit_p4 = fitter.fitted_p4();
@@ -168,27 +157,22 @@ void BToV0LLBuilder::produce(edm::StreamID, edm::Event &evt,
       cand.addUserFloat("fitted_eta", fit_p4.eta());
       cand.addUserFloat("fitted_phi", fit_p4.phi());
       cand.addUserFloat("fitted_mass", fitter.fitted_candidate().mass());
-      cand.addUserFloat(
-          "fitted_massErr",
-          sqrt(fitter.fitted_candidate().kinematicParametersError().matrix()(
-              6, 6)));
-      cand.addUserFloat("cos_theta_2D",
-                        cos_theta_2D(fitter, *beamspot, cand.p4()));
-      cand.addUserFloat("fitted_cos_theta_2D",
-                        cos_theta_2D(fitter, *beamspot, fit_p4));
+      cand.addUserFloat("fitted_massErr", sqrt(fitter.fitted_candidate().kinematicParametersError().matrix()(6, 6)));
+      cand.addUserFloat("cos_theta_2D", cos_theta_2D(fitter, *beamspot, cand.p4()));
+      cand.addUserFloat("fitted_cos_theta_2D", cos_theta_2D(fitter, *beamspot, fit_p4));
 
       auto lxy = l_xy(fitter, *beamspot);
       cand.addUserFloat("l_xy", lxy.value());
       cand.addUserFloat("l_xy_unc", lxy.error());
 
-      TrajectoryStateOnSurface tsos = extrapolator.extrapolate(
-          v0_ttracks->at(v0_idx).impactPointState(), fitter.fitted_vtx());
-      std::pair<bool, Measurement1D> cur2DIP = signedTransverseImpactParameter(
-          tsos, fitter.fitted_refvtx(), *beamspot);
+      TrajectoryStateOnSurface tsos =
+          extrapolator.extrapolate(v0_ttracks->at(v0_idx).impactPointState(), fitter.fitted_vtx());
+      std::pair<bool, Measurement1D> cur2DIP = signedTransverseImpactParameter(tsos, fitter.fitted_refvtx(), *beamspot);
       cand.addUserFloat("v0_svip2d", cur2DIP.second.value());
       cand.addUserFloat("v0_svip2d_err", cur2DIP.second.error());
 
-      if (!post_vtx_selection_(cand)) continue;
+      if (!post_vtx_selection_(cand))
+        continue;
 
       cand.addUserFloat("vtx_x", cand.vx());
       cand.addUserFloat("vtx_y", cand.vy());
@@ -205,12 +189,9 @@ void BToV0LLBuilder::produce(edm::StreamID, edm::Event &evt,
       // refitted daughters (leptons/tracks)
       std::vector<std::string> dnames{"l1", "l2", "v0"};
       for (size_t idaughter = 0; idaughter < dnames.size(); idaughter++) {
-        cand.addUserFloat("fitted_" + dnames[idaughter] + "_pt",
-                          fitter.daughter_p4(idaughter).pt());
-        cand.addUserFloat("fitted_" + dnames[idaughter] + "_eta",
-                          fitter.daughter_p4(idaughter).eta());
-        cand.addUserFloat("fitted_" + dnames[idaughter] + "_phi",
-                          fitter.daughter_p4(idaughter).phi());
+        cand.addUserFloat("fitted_" + dnames[idaughter] + "_pt", fitter.daughter_p4(idaughter).pt());
+        cand.addUserFloat("fitted_" + dnames[idaughter] + "_eta", fitter.daughter_p4(idaughter).eta());
+        cand.addUserFloat("fitted_" + dnames[idaughter] + "_phi", fitter.daughter_p4(idaughter).phi());
       }
 
       // compute isolation
@@ -231,20 +212,17 @@ void BToV0LLBuilder::produce(edm::StreamID, edm::Event &evt,
       const double jpsi_bin[2] = {2.8, 3.35};
       const double psi2s_bin[2] = {3.45, 3.85};
 
-      if (dilepton_constraint_ &&
-          ((dilepton_mass > jpsi_bin[0] && dilepton_mass < jpsi_bin[1]) ||
-           (dilepton_mass > psi2s_bin[0] && dilepton_mass < psi2s_bin[1]))) {
+      if (dilepton_constraint_ && ((dilepton_mass > jpsi_bin[0] && dilepton_mass < jpsi_bin[1]) ||
+                                   (dilepton_mass > psi2s_bin[0] && dilepton_mass < psi2s_bin[1]))) {
         ParticleMass JPsi_mass = 3.0969;   // Jpsi mass 3.096900±0.000006
         ParticleMass Psi2S_mass = 3.6861;  // Psi2S mass 3.6861093±0.0000034
-        ParticleMass mass_constraint =
-            (dilepton_mass < jpsi_bin[1]) ? JPsi_mass : Psi2S_mass;
+        ParticleMass mass_constraint = (dilepton_mass < jpsi_bin[1]) ? JPsi_mass : Psi2S_mass;
 
         // Mass constraint is applied to the first two particles in the
         // "particles" vector Make sure that the first two particles are the
         // ones you want to constrain
         KinVtxFitter constraint_fitter(
-            {leptons_ttracks->at(l1_idx), leptons_ttracks->at(l2_idx),
-             v0_ttracks->at(v0_idx)},
+            {leptons_ttracks->at(l1_idx), leptons_ttracks->at(l2_idx), v0_ttracks->at(v0_idx)},
             {l1_ptr->mass(), l2_ptr->mass(), v0_ptr->mass()},
             {LEP_SIGMA, LEP_SIGMA, v0_ptr->userFloat("massErr")},
             mass_constraint);
@@ -254,16 +232,11 @@ void BToV0LLBuilder::produce(edm::StreamID, edm::Event &evt,
           cand.addUserFloat("constraint_pt", constraint_p4.pt());
           cand.addUserFloat("constraint_eta", constraint_p4.eta());
           cand.addUserFloat("constraint_phi", constraint_p4.phi());
-          cand.addUserFloat("constraint_mass",
-                            constraint_fitter.fitted_candidate().mass());
+          cand.addUserFloat("constraint_mass", constraint_fitter.fitted_candidate().mass());
           cand.addUserFloat("constraint_massErr",
-                            sqrt(constraint_fitter.fitted_candidate()
-                                     .kinematicParametersError()
-                                     .matrix()(6, 6)));
+                            sqrt(constraint_fitter.fitted_candidate().kinematicParametersError().matrix()(6, 6)));
           cand.addUserFloat("constraint_mll",
-                            (constraint_fitter.daughter_p4(0) +
-                             constraint_fitter.daughter_p4(1))
-                                .mass());
+                            (constraint_fitter.daughter_p4(0) + constraint_fitter.daughter_p4(1)).mass());
         }
       }
 
diff --git a/PhysicsTools/BPHNano/plugins/CandMCMatchTableProducerBPH.cc b/PhysicsTools/BPHNano/plugins/CandMCMatchTableProducerBPH.cc
index dbb0f54aeacf..e64f1dfc6fe3 100644
--- a/PhysicsTools/BPHNano/plugins/CandMCMatchTableProducerBPH.cc
+++ b/PhysicsTools/BPHNano/plugins/CandMCMatchTableProducerBPH.cc
@@ -17,18 +17,15 @@
 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
 
 class CandMCMatchTableProducerBPH : public edm::global::EDProducer<> {
- public:
+public:
   CandMCMatchTableProducerBPH(edm::ParameterSet const& params)
       : objName_(params.getParameter<std::string>("objName")),
         objBranchName_(params.getParameter<std::string>("objBranchName")),
         genBranchName_(params.getParameter<std::string>("genBranchName")),
         doc_(params.getParameter<std::string>("docString")),
-        recoObjects_(consumes<reco::CandidateView>(
-            params.getParameter<edm::InputTag>("recoObjects"))),
-        genParts_(consumes<reco::GenParticleCollection>(
-            params.getParameter<edm::InputTag>("genParts"))),
-        candMap_(consumes<edm::Association<reco::GenParticleCollection>>(
-            params.getParameter<edm::InputTag>("mcMap"))) {
+        recoObjects_(consumes<reco::CandidateView>(params.getParameter<edm::InputTag>("recoObjects"))),
+        genParts_(consumes<reco::GenParticleCollection>(params.getParameter<edm::InputTag>("genParts"))),
+        candMap_(consumes<edm::Association<reco::GenParticleCollection>>(params.getParameter<edm::InputTag>("mcMap"))) {
     produces<nanoaod::FlatTable>();
     const std::string& type = params.getParameter<std::string>("objType");
     if (type == "Muon")
@@ -44,8 +41,7 @@ class CandMCMatchTableProducerBPH : public edm::global::EDProducer<> {
     else if (type == "Other")
       type_ = MOther;
     else
-      throw cms::Exception("Configuration",
-                           "Unsupported objType '" + type + "'\n");
+      throw cms::Exception("Configuration", "Unsupported objType '" + type + "'\n");
 
     std::cout << "type = " << type << std::endl;
     switch (type_) {
@@ -64,8 +60,7 @@ class CandMCMatchTableProducerBPH : public edm::global::EDProducer<> {
             "511 = from B0, 521 = from B+/-, 0 = unknown or unmatched";
         break;
       case MPhoton:
-        flavDoc_ =
-            "1 = prompt photon, 13 = prompt electron, 0 = unknown or unmatched";
+        flavDoc_ = "1 = prompt photon, 13 = prompt electron, 0 = unknown or unmatched";
         break;
       case MTau:
         flavDoc_ =
@@ -84,15 +79,14 @@ class CandMCMatchTableProducerBPH : public edm::global::EDProducer<> {
     }
 
     if (type_ == MTau) {
-      candMapVisTau_ = consumes<edm::Association<reco::GenParticleCollection>>(
-          params.getParameter<edm::InputTag>("mcMapVisTau"));
+      candMapVisTau_ =
+          consumes<edm::Association<reco::GenParticleCollection>>(params.getParameter<edm::InputTag>("mcMapVisTau"));
     }
   }
 
   ~CandMCMatchTableProducerBPH() override {}
 
-  void produce(edm::StreamID id, edm::Event& iEvent,
-               const edm::EventSetup& iSetup) const override {
+  void produce(edm::StreamID id, edm::Event& iEvent, const edm::EventSetup& iSetup) const override {
     edm::Handle<reco::CandidateView> cands;
     iEvent.getByToken(recoObjects_, cands);
     unsigned int ncand = cands->size();
@@ -101,10 +95,8 @@ class CandMCMatchTableProducerBPH : public edm::global::EDProducer<> {
     iEvent.getByToken(genParts_, gen_parts);
     unsigned int ngen = gen_parts->size();
 
-    auto tab =
-        std::make_unique<nanoaod::FlatTable>(ncand, objName_, false, true);
-    auto tab_reverse =
-        std::make_unique<nanoaod::FlatTable>(ngen, "GenPart", false, true);
+    auto tab = std::make_unique<nanoaod::FlatTable>(ncand, objName_, false, true);
+    auto tab_reverse = std::make_unique<nanoaod::FlatTable>(ngen, "GenPart", false, true);
 
     edm::Handle<edm::Association<reco::GenParticleCollection>> map;
     iEvent.getByToken(candMap_, map);
@@ -142,32 +134,24 @@ class CandMCMatchTableProducerBPH : public edm::global::EDProducer<> {
           break;
         case MElectron:
           if (match->isPromptFinalState())
-            flav[i] =
-                (match->pdgId() == 22 ? 22 : 1);  // prompt electron or photon
+            flav[i] = (match->pdgId() == 22 ? 22 : 1);  // prompt electron or photon
           else
             flav[i] = getParentHadronFlag(match);  // pdgId of mother
           break;
         case MPhoton:
           if (match->isPromptFinalState())
-            flav[i] =
-                (match->pdgId() == 22 ? 1 : 13);  // prompt electron or photon
+            flav[i] = (match->pdgId() == 22 ? 1 : 13);  // prompt electron or photon
           break;
         case MTau:
           // CV: assignment of status codes according to
           // https://twiki.cern.ch/twiki/bin/viewauth/CMS/HiggsToTauTauWorking2016#MC_Matching
-          if (match.isNonnull() && match->statusFlags().isPrompt() &&
-              abs(match->pdgId()) == 11)
+          if (match.isNonnull() && match->statusFlags().isPrompt() && abs(match->pdgId()) == 11)
             flav[i] = 1;
-          else if (match.isNonnull() && match->statusFlags().isPrompt() &&
-                   abs(match->pdgId()) == 13)
+          else if (match.isNonnull() && match->statusFlags().isPrompt() && abs(match->pdgId()) == 13)
             flav[i] = 2;
-          else if (match.isNonnull() &&
-                   match->isDirectPromptTauDecayProductFinalState() &&
-                   abs(match->pdgId()) == 11)
+          else if (match.isNonnull() && match->isDirectPromptTauDecayProductFinalState() && abs(match->pdgId()) == 11)
             flav[i] = 3;
-          else if (match.isNonnull() &&
-                   match->isDirectPromptTauDecayProductFinalState() &&
-                   abs(match->pdgId()) == 13)
+          else if (match.isNonnull() && match->isDirectPromptTauDecayProductFinalState() && abs(match->pdgId()) == 13)
             flav[i] = 4;
           else if (matchVisTau.isNonnull())
             flav[i] = 5;
@@ -183,12 +167,9 @@ class CandMCMatchTableProducerBPH : public edm::global::EDProducer<> {
       };
     }
 
-    tab->addColumn<int>(objBranchName_ + "Idx", key,
-                        "Index into genParticle list for " + doc_);
-    tab->addColumn<int>(objBranchName_ + "Flav", flav,
-                        "Flavour of genParticle for " + doc_ + ": " + flavDoc_);
-    tab_reverse->addColumn<int>(genBranchName_ + "Idx", genkey,
-                                "Index into genParticle list for " + doc_);
+    tab->addColumn<int>(objBranchName_ + "Idx", key, "Index into genParticle list for " + doc_);
+    tab->addColumn<int>(objBranchName_ + "Flav", flav, "Flavour of genParticle for " + doc_ + ": " + flavDoc_);
+    tab_reverse->addColumn<int>(genBranchName_ + "Idx", genkey, "Index into genParticle list for " + doc_);
 
     iEvent.put(std::move(tab));
     iEvent.put(std::move(tab_reverse));
@@ -198,7 +179,8 @@ class CandMCMatchTableProducerBPH : public edm::global::EDProducer<> {
     for (unsigned int im = 0, nm = match->numberOfMothers(); im < nm; ++im) {
       reco::GenParticleRef mom = match->motherRef(im);
       assert(mom.isNonnull() && mom.isAvailable());  // sanity
-      if (mom.key() >= match.key()) continue;        // prevent circular refs
+      if (mom.key() >= match.key())
+        continue;  // prevent circular refs
       int id = std::abs(mom->pdgId());
       return id;
     }
@@ -207,8 +189,7 @@ class CandMCMatchTableProducerBPH : public edm::global::EDProducer<> {
 
   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
     edm::ParameterSetDescription desc;
-    desc.add<std::string>("objName")->setComment(
-        "name of the nanoaod::FlatTable to extend with this table");
+    desc.add<std::string>("objName")->setComment("name of the nanoaod::FlatTable to extend with this table");
     desc.add<std::string>("objBranchName")
         ->setComment(
             "name of the column to write (the final branch in the nanoaod will "
@@ -217,8 +198,7 @@ class CandMCMatchTableProducerBPH : public edm::global::EDProducer<> {
         ->setComment(
             "name of the column to write (the final branch in the nanoaod will "
             "be <objName>_<branchName>Idx and <objName>_<branchName>Flav");
-    desc.add<std::string>("docString")
-        ->setComment("documentation to forward to the output");
+    desc.add<std::string>("docString")->setComment("documentation to forward to the output");
     desc.add<edm::InputTag>("recoObjects")
         ->setComment(
             "physics object collection for the reconstructed objects (e.g. "
@@ -240,14 +220,12 @@ class CandMCMatchTableProducerBPH : public edm::global::EDProducer<> {
     descriptions.add("candMcMatchTable", desc);
   }
 
- protected:
+protected:
   const std::string objName_, objBranchName_, genBranchName_, doc_;
   const edm::EDGetTokenT<reco::CandidateView> recoObjects_;
   const edm::EDGetTokenT<reco::GenParticleCollection> genParts_;
-  const edm::EDGetTokenT<edm::Association<reco::GenParticleCollection>>
-      candMap_;
-  edm::EDGetTokenT<edm::Association<reco::GenParticleCollection>>
-      candMapVisTau_;
+  const edm::EDGetTokenT<edm::Association<reco::GenParticleCollection>> candMap_;
+  edm::EDGetTokenT<edm::Association<reco::GenParticleCollection>> candMapVisTau_;
   enum MatchType { MMuon, MElectron, MTau, MPhoton, MTrack, MOther } type_;
   std::string flavDoc_;
 };
diff --git a/PhysicsTools/BPHNano/plugins/DiLeptonBuilder.cc b/PhysicsTools/BPHNano/plugins/DiLeptonBuilder.cc
index 55ecc8d25432..38219efbccf5 100644
--- a/PhysicsTools/BPHNano/plugins/DiLeptonBuilder.cc
+++ b/PhysicsTools/BPHNano/plugins/DiLeptonBuilder.cc
@@ -23,7 +23,7 @@
 template <typename Lepton>
 class DiLeptonBuilder : public edm::global::EDProducer<> {
   // perhaps we need better structure here (begin run etc)
- public:
+public:
   typedef std::vector<Lepton> LeptonCollection;
   typedef std::vector<reco::TransientTrack> TransientTrackCollection;
 
@@ -32,35 +32,28 @@ class DiLeptonBuilder : public edm::global::EDProducer<> {
         l2_selection_{cfg.getParameter<std::string>("lep2Selection")},
         pre_vtx_selection_{cfg.getParameter<std::string>("preVtxSelection")},
         post_vtx_selection_{cfg.getParameter<std::string>("postVtxSelection")},
-        src_{
-            consumes<LeptonCollection>(cfg.getParameter<edm::InputTag>("src"))},
-        ttracks_src_{consumes<TransientTrackCollection>(
-            cfg.getParameter<edm::InputTag>("transientTracksSrc"))} {
+        src_{consumes<LeptonCollection>(cfg.getParameter<edm::InputTag>("src"))},
+        ttracks_src_{consumes<TransientTrackCollection>(cfg.getParameter<edm::InputTag>("transientTracksSrc"))} {
     produces<pat::CompositeCandidateCollection>("SelectedDiLeptons");
   }
 
   ~DiLeptonBuilder() override {}
 
-  void produce(edm::StreamID, edm::Event &,
-               const edm::EventSetup &) const override;
+  void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override;
 
   static void fillDescriptions(edm::ConfigurationDescriptions &descriptions) {}
 
- private:
-  const StringCutObjectSelector<Lepton> l1_selection_;  // cut on leading lepton
-  const StringCutObjectSelector<Lepton>
-      l2_selection_;  // cut on sub-leading lepton
-  const StringCutObjectSelector<pat::CompositeCandidate>
-      pre_vtx_selection_;  // cut on the di-lepton before the SV fit
-  const StringCutObjectSelector<pat::CompositeCandidate>
-      post_vtx_selection_;  // cut on the di-lepton after the SV fit
+private:
+  const StringCutObjectSelector<Lepton> l1_selection_;                         // cut on leading lepton
+  const StringCutObjectSelector<Lepton> l2_selection_;                         // cut on sub-leading lepton
+  const StringCutObjectSelector<pat::CompositeCandidate> pre_vtx_selection_;   // cut on the di-lepton before the SV fit
+  const StringCutObjectSelector<pat::CompositeCandidate> post_vtx_selection_;  // cut on the di-lepton after the SV fit
   const edm::EDGetTokenT<LeptonCollection> src_;
   const edm::EDGetTokenT<TransientTrackCollection> ttracks_src_;
 };
 
 template <typename Lepton>
-void DiLeptonBuilder<Lepton>::produce(edm::StreamID, edm::Event &evt,
-                                      edm::EventSetup const &) const {
+void DiLeptonBuilder<Lepton>::produce(edm::StreamID, edm::Event &evt, edm::EventSetup const &) const {
   // input
   edm::Handle<LeptonCollection> leptons;
   evt.getByToken(src_, leptons);
@@ -69,18 +62,18 @@ void DiLeptonBuilder<Lepton>::produce(edm::StreamID, edm::Event &evt,
   evt.getByToken(ttracks_src_, ttracks);
 
   // output
-  std::unique_ptr<pat::CompositeCandidateCollection> ret_value(
-      new pat::CompositeCandidateCollection());
-  std::unique_ptr<std::vector<KinVtxFitter> > kinVtx_out(
-      new std::vector<KinVtxFitter>);
+  std::unique_ptr<pat::CompositeCandidateCollection> ret_value(new pat::CompositeCandidateCollection());
+  std::unique_ptr<std::vector<KinVtxFitter> > kinVtx_out(new std::vector<KinVtxFitter>);
 
   for (size_t l1_idx = 0; l1_idx < leptons->size(); ++l1_idx) {
     edm::Ptr<Lepton> l1_ptr(leptons, l1_idx);
-    if (!l1_selection_(*l1_ptr)) continue;
+    if (!l1_selection_(*l1_ptr))
+      continue;
 
     for (size_t l2_idx = l1_idx + 1; l2_idx < leptons->size(); ++l2_idx) {
       edm::Ptr<Lepton> l2_ptr(leptons, l2_idx);
-      if (!l2_selection_(*l2_ptr)) continue;
+      if (!l2_selection_(*l2_ptr))
+        continue;
 
       pat::CompositeCandidate lepton_pair;
       lepton_pair.setP4(l1_ptr->p4() + l2_ptr->p4());
@@ -98,27 +91,21 @@ void DiLeptonBuilder<Lepton>::produce(edm::StreamID, edm::Event &evt,
         continue;  // before making the SV, cut on the info we have
 
       KinVtxFitter fitter(
-          {ttracks->at(l1_idx), ttracks->at(l2_idx)},
-          {l1_ptr->mass(), l2_ptr->mass()},
-          {LEP_SIGMA, LEP_SIGMA}  // some small sigma for the particle mass
+          {ttracks->at(l1_idx), ttracks->at(l2_idx)}, {l1_ptr->mass(), l2_ptr->mass()}, {LEP_SIGMA, LEP_SIGMA}
+          // some small sigma for the particle mass
       );
-      if (!fitter.success()) continue;
-      lepton_pair.setVertex(reco::Candidate::Point(fitter.fitted_vtx().x(),
-                                                   fitter.fitted_vtx().y(),
-                                                   fitter.fitted_vtx().z()));
+      if (!fitter.success())
+        continue;
+      lepton_pair.setVertex(
+          reco::Candidate::Point(fitter.fitted_vtx().x(), fitter.fitted_vtx().y(), fitter.fitted_vtx().z()));
       lepton_pair.addUserInt("sv_ok", fitter.success() ? 1 : 0);
       lepton_pair.addUserFloat("sv_chi2", fitter.chi2());
       lepton_pair.addUserFloat("sv_ndof", fitter.dof());  // float??
       lepton_pair.addUserFloat("sv_prob", fitter.prob());
+      lepton_pair.addUserFloat("fitted_mass", fitter.success() ? fitter.fitted_candidate().mass() : -1);
       lepton_pair.addUserFloat(
-          "fitted_mass",
-          fitter.success() ? fitter.fitted_candidate().mass() : -1);
-      lepton_pair.addUserFloat("fitted_massErr",
-                               fitter.success()
-                                   ? sqrt(fitter.fitted_candidate()
-                                              .kinematicParametersError()
-                                              .matrix()(6, 6))
-                                   : -1);
+          "fitted_massErr",
+          fitter.success() ? sqrt(fitter.fitted_candidate().kinematicParametersError().matrix()(6, 6)) : -1);
       lepton_pair.addUserFloat("vtx_x", lepton_pair.vx());
       lepton_pair.addUserFloat("vtx_y", lepton_pair.vy());
       lepton_pair.addUserFloat("vtx_z", lepton_pair.vz());
@@ -126,7 +113,8 @@ void DiLeptonBuilder<Lepton>::produce(edm::StreamID, edm::Event &evt,
       // if needed, add here more stuff
 
       // cut on the SV info
-      if (!post_vtx_selection_(lepton_pair)) continue;
+      if (!post_vtx_selection_(lepton_pair))
+        continue;
       ret_value->push_back(lepton_pair);
     }
   }
diff --git a/PhysicsTools/BPHNano/plugins/DiTrackBuilder.cc b/PhysicsTools/BPHNano/plugins/DiTrackBuilder.cc
index 9d4d4fecc3f9..306549fbec88 100644
--- a/PhysicsTools/BPHNano/plugins/DiTrackBuilder.cc
+++ b/PhysicsTools/BPHNano/plugins/DiTrackBuilder.cc
@@ -26,7 +26,7 @@
 #include "helper.h"
 
 class DiTrackBuilder : public edm::global::EDProducer<> {
- public:
+public:
   typedef std::vector<reco::TransientTrack> TransientTrackCollection;
 
   explicit DiTrackBuilder(const edm::ParameterSet &cfg)
@@ -34,12 +34,9 @@ class DiTrackBuilder : public edm::global::EDProducer<> {
         trk2_selection_{cfg.getParameter<std::string>("trk2Selection")},
         pre_vtx_selection_{cfg.getParameter<std::string>("preVtxSelection")},
         post_vtx_selection_{cfg.getParameter<std::string>("postVtxSelection")},
-        pfcands_{consumes<pat::CompositeCandidateCollection>(
-            cfg.getParameter<edm::InputTag>("tracks"))},
-        ttracks_{consumes<TransientTrackCollection>(
-            cfg.getParameter<edm::InputTag>("transientTracks"))},
-        beamspot_{consumes<reco::BeamSpot>(
-            cfg.getParameter<edm::InputTag>("beamSpot"))},
+        pfcands_{consumes<pat::CompositeCandidateCollection>(cfg.getParameter<edm::InputTag>("tracks"))},
+        ttracks_{consumes<TransientTrackCollection>(cfg.getParameter<edm::InputTag>("transientTracks"))},
+        beamspot_{consumes<reco::BeamSpot>(cfg.getParameter<edm::InputTag>("beamSpot"))},
         trk1_mass_{cfg.getParameter<double>("trk1Mass")},
         trk2_mass_{cfg.getParameter<double>("trk2Mass")} {
     // output
@@ -48,31 +45,24 @@ class DiTrackBuilder : public edm::global::EDProducer<> {
 
   ~DiTrackBuilder() override {}
 
-  void produce(edm::StreamID, edm::Event &,
-               const edm::EventSetup &) const override;
+  void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override;
 
   static void fillDescriptions(edm::ConfigurationDescriptions &descriptions) {}
 
- private:
-  const StringCutObjectSelector<pat::CompositeCandidate>
-      trk1_selection_;  // cuts on leading cand
-  const StringCutObjectSelector<pat::CompositeCandidate>
-      trk2_selection_;  // sub-leading cand
-  const StringCutObjectSelector<pat::CompositeCandidate>
-      pre_vtx_selection_;  // cut on the di-track before the SV fit
-  const StringCutObjectSelector<pat::CompositeCandidate>
-      post_vtx_selection_;  // cut on the di-track after the SV fit
+private:
+  const StringCutObjectSelector<pat::CompositeCandidate> trk1_selection_;      // cuts on leading cand
+  const StringCutObjectSelector<pat::CompositeCandidate> trk2_selection_;      // sub-leading cand
+  const StringCutObjectSelector<pat::CompositeCandidate> pre_vtx_selection_;   // cut on the di-track before the SV fit
+  const StringCutObjectSelector<pat::CompositeCandidate> post_vtx_selection_;  // cut on the di-track after the SV fit
   const edm::EDGetTokenT<pat::CompositeCandidateCollection>
-      pfcands_;  // input PF cands this is sorted in pT in previous step
-  const edm::EDGetTokenT<TransientTrackCollection>
-      ttracks_;  // input TTracks of PF cands
+      pfcands_;                                               // input PF cands this is sorted in pT in previous step
+  const edm::EDGetTokenT<TransientTrackCollection> ttracks_;  // input TTracks of PF cands
   const edm::EDGetTokenT<reco::BeamSpot> beamspot_;
   double trk1_mass_;
   double trk2_mass_;
 };
 
-void DiTrackBuilder::produce(edm::StreamID, edm::Event &evt,
-                             edm::EventSetup const &) const {
+void DiTrackBuilder::produce(edm::StreamID, edm::Event &evt, edm::EventSetup const &) const {
   // inputs
   edm::Handle<pat::CompositeCandidateCollection> pfcands;
   evt.getByToken(pfcands_, pfcands);
@@ -82,19 +72,19 @@ void DiTrackBuilder::produce(edm::StreamID, edm::Event &evt,
   evt.getByToken(beamspot_, beamspot);
 
   // output
-  std::unique_ptr<pat::CompositeCandidateCollection> ditrack_out(
-      new pat::CompositeCandidateCollection());
+  std::unique_ptr<pat::CompositeCandidateCollection> ditrack_out(new pat::CompositeCandidateCollection());
 
   // main loop
   for (size_t trk1_idx = 0; trk1_idx < pfcands->size(); ++trk1_idx) {
     edm::Ptr<pat::CompositeCandidate> trk1_ptr(pfcands, trk1_idx);
-    if (!trk1_selection_(*trk1_ptr)) continue;
+    if (!trk1_selection_(*trk1_ptr))
+      continue;
 
-    for (size_t trk2_idx = trk1_idx + 1; trk2_idx < pfcands->size();
-         ++trk2_idx) {
+    for (size_t trk2_idx = trk1_idx + 1; trk2_idx < pfcands->size(); ++trk2_idx) {
       edm::Ptr<pat::CompositeCandidate> trk2_ptr(pfcands, trk2_idx);
       // if (trk1_ptr->charge() == trk2_ptr->charge()) continue;
-      if (!trk2_selection_(*trk2_ptr)) continue;
+      if (!trk2_selection_(*trk2_ptr))
+        continue;
 
       pat::CompositeCandidate ditrack_cand;
       auto trk1_p4 = trk1_ptr->polarP4();
@@ -103,8 +93,7 @@ void DiTrackBuilder::produce(edm::StreamID, edm::Event &evt,
       trk2_p4.SetM(K_MASS);
       ditrack_cand.setP4(trk1_p4 + trk2_p4);
       ditrack_cand.setCharge(trk1_ptr->charge() + trk2_ptr->charge());
-      ditrack_cand.addUserFloat("trk_deltaR",
-                                reco::deltaR(*trk1_ptr, *trk2_ptr));
+      ditrack_cand.addUserFloat("trk_deltaR", reco::deltaR(*trk1_ptr, *trk2_ptr));
       // save indices
       ditrack_cand.addUserInt("trk1_idx", trk1_idx);
       ditrack_cand.addUserInt("trk2_idx", trk2_idx);
@@ -123,67 +112,52 @@ void DiTrackBuilder::produce(edm::StreamID, edm::Event &evt,
       trk2_p4.SetM(K_MASS);
       trk1_p4.SetM(K_MASS);
 
-      if (!pre_vtx_selection_(ditrack_cand)) continue;
+      if (!pre_vtx_selection_(ditrack_cand))
+        continue;
 
-      KinVtxFitter fitter({ttracks->at(trk1_idx), ttracks->at(trk2_idx)},
-                          {K_MASS, K_MASS},
-                          {K_SIGMA, K_SIGMA}  // K and PI sigma equal...
+      KinVtxFitter fitter({ttracks->at(trk1_idx), ttracks->at(trk2_idx)}, {K_MASS, K_MASS}, {K_SIGMA, K_SIGMA}
+                          // K and PI sigma equal...
       );
-      if (!fitter.success()) continue;
-      ditrack_cand.addUserFloat("fitted_mass_KK",
-                                fitter.fitted_candidate().mass());
-      ditrack_cand.addUserFloat(
-          "fitted_mass_KK_Err",
-          sqrt(fitter.fitted_candidate().kinematicParametersError().matrix()(
-              6, 6)));
+      if (!fitter.success())
+        continue;
+      ditrack_cand.addUserFloat("fitted_mass_KK", fitter.fitted_candidate().mass());
+      ditrack_cand.addUserFloat("fitted_mass_KK_Err",
+                                sqrt(fitter.fitted_candidate().kinematicParametersError().matrix()(6, 6)));
       // fits required in order to calculate the error of the mass for each mass
       // hypothesis.
-      KinVtxFitter fitter_Kpi({ttracks->at(trk1_idx), ttracks->at(trk2_idx)},
-                              {K_MASS, PI_MASS},
-                              {K_SIGMA, K_SIGMA}  // K and PI sigma equal...
+      KinVtxFitter fitter_Kpi({ttracks->at(trk1_idx), ttracks->at(trk2_idx)}, {K_MASS, PI_MASS}, {K_SIGMA, K_SIGMA}
+                              // K and PI sigma equal...
       );
-      if (!fitter_Kpi.success()) continue;
-      ditrack_cand.addUserFloat("fitted_mass_Kpi",
-                                fitter_Kpi.fitted_candidate().mass());
-      ditrack_cand.addUserFloat(
-          "fitted_mass_Kpi_Err",
-          sqrt(
-              fitter_Kpi.fitted_candidate().kinematicParametersError().matrix()(
-                  6, 6)));
-      KinVtxFitter fitter_piK({ttracks->at(trk1_idx), ttracks->at(trk2_idx)},
-                              {PI_MASS, K_MASS},
-                              {K_SIGMA, K_SIGMA}  // K and PI sigma equal...
+      if (!fitter_Kpi.success())
+        continue;
+      ditrack_cand.addUserFloat("fitted_mass_Kpi", fitter_Kpi.fitted_candidate().mass());
+      ditrack_cand.addUserFloat("fitted_mass_Kpi_Err",
+                                sqrt(fitter_Kpi.fitted_candidate().kinematicParametersError().matrix()(6, 6)));
+      KinVtxFitter fitter_piK({ttracks->at(trk1_idx), ttracks->at(trk2_idx)}, {PI_MASS, K_MASS}, {K_SIGMA, K_SIGMA}
+                              // K and PI sigma equal...
       );
-      if (!fitter_piK.success()) continue;
-      ditrack_cand.addUserFloat("fitted_mass_piK",
-                                fitter_piK.fitted_candidate().mass());
-      ditrack_cand.addUserFloat(
-          "fitted_mass_piK_Err",
-          sqrt(
-              fitter_piK.fitted_candidate().kinematicParametersError().matrix()(
-                  6, 6)));
-
-      ditrack_cand.setVertex(reco::Candidate::Point(fitter.fitted_vtx().x(),
-                                                    fitter.fitted_vtx().y(),
-                                                    fitter.fitted_vtx().z()));
+      if (!fitter_piK.success())
+        continue;
+      ditrack_cand.addUserFloat("fitted_mass_piK", fitter_piK.fitted_candidate().mass());
+      ditrack_cand.addUserFloat("fitted_mass_piK_Err",
+                                sqrt(fitter_piK.fitted_candidate().kinematicParametersError().matrix()(6, 6)));
+
+      ditrack_cand.setVertex(
+          reco::Candidate::Point(fitter.fitted_vtx().x(), fitter.fitted_vtx().y(), fitter.fitted_vtx().z()));
       // save quantities after fit
       auto lxy = l_xy(fitter, *beamspot);
       ditrack_cand.addUserFloat("l_xy", lxy.value());
       ditrack_cand.addUserFloat("l_xy_unc", lxy.error());
       ditrack_cand.addUserInt("sv_ok", fitter.success() ? 1 : 0);
       auto fit_p4 = fitter.fitted_p4();
-      ditrack_cand.addUserFloat("fitted_cos_theta_2D",
-                                cos_theta_2D(fitter, *beamspot, fit_p4));
+      ditrack_cand.addUserFloat("fitted_cos_theta_2D", cos_theta_2D(fitter, *beamspot, fit_p4));
       // The following quantities do not independent on the mass hypothesis
       ditrack_cand.addUserFloat("sv_chi2", fitter.chi2());
       ditrack_cand.addUserFloat("sv_ndof", fitter.dof());
       ditrack_cand.addUserFloat("sv_prob", fitter.prob());
-      ditrack_cand.addUserFloat(
-          "fitted_pt", fitter.fitted_candidate().globalMomentum().perp());
-      ditrack_cand.addUserFloat(
-          "fitted_eta", fitter.fitted_candidate().globalMomentum().eta());
-      ditrack_cand.addUserFloat(
-          "fitted_phi", fitter.fitted_candidate().globalMomentum().phi());
+      ditrack_cand.addUserFloat("fitted_pt", fitter.fitted_candidate().globalMomentum().perp());
+      ditrack_cand.addUserFloat("fitted_eta", fitter.fitted_candidate().globalMomentum().eta());
+      ditrack_cand.addUserFloat("fitted_phi", fitter.fitted_candidate().globalMomentum().phi());
       ditrack_cand.addUserFloat("vtx_x", ditrack_cand.vx());
       ditrack_cand.addUserFloat("vtx_y", ditrack_cand.vy());
       ditrack_cand.addUserFloat("vtx_z", ditrack_cand.vz());
@@ -196,7 +170,8 @@ void DiTrackBuilder::produce(edm::StreamID, edm::Event &evt,
       ditrack_cand.addUserFloat("vtx_czy", covMatrix.czy());
 
       // after fit selection
-      if (!post_vtx_selection_(ditrack_cand)) continue;
+      if (!post_vtx_selection_(ditrack_cand))
+        continue;
       ditrack_out->emplace_back(ditrack_cand);
     }  // end for(size_t trk2_idx = trk1_idx + 1
   }  // for(size_t trk1_idx = 0
diff --git a/PhysicsTools/BPHNano/plugins/KinVtxFitter.cc b/PhysicsTools/BPHNano/plugins/KinVtxFitter.cc
index 9f9351eab88f..f66dfdb0b04d 100644
--- a/PhysicsTools/BPHNano/plugins/KinVtxFitter.cc
+++ b/PhysicsTools/BPHNano/plugins/KinVtxFitter.cc
@@ -13,15 +13,13 @@ KinVtxFitter::KinVtxFitter(const std::vector<reco::TransientTrack> tracks,
   KinematicParticleFactoryFromTransientTrack factory;
   std::vector<RefCountedKinematicParticle> particles;
   for (size_t i = 0; i < tracks.size(); ++i) {
-    particles.emplace_back(factory.particle(tracks.at(i), masses.at(i),
-                                            kin_chi2_, kin_ndof_, sigmas[i]));
+    particles.emplace_back(factory.particle(tracks.at(i), masses.at(i), kin_chi2_, kin_ndof_, sigmas[i]));
   }
 
   KinematicParticleVertexFitter kcv_fitter;
   RefCountedKinematicTree vtx_tree = kcv_fitter.fit(particles);
 
-  if (vtx_tree->isEmpty() || !vtx_tree->isValid() ||
-      !vtx_tree->isConsistent()) {
+  if (vtx_tree->isEmpty() || !vtx_tree->isValid() || !vtx_tree->isConsistent()) {
     success_ = false;
     return;
   }
@@ -29,8 +27,7 @@ KinVtxFitter::KinVtxFitter(const std::vector<reco::TransientTrack> tracks,
   vtx_tree->movePointerToTheTop();
   fitted_particle_ = vtx_tree->currentParticle();
   fitted_vtx_ = vtx_tree->currentDecayVertex();
-  if (!fitted_particle_->currentState().isValid() ||
-      !fitted_vtx_->vertexIsValid()) {
+  if (!fitted_particle_->currentState().isValid() || !fitted_vtx_->vertexIsValid()) {
     success_ = false;
     return;
   }
@@ -46,22 +43,20 @@ KinVtxFitter::KinVtxFitter(const std::vector<reco::TransientTrack> tracks,
 
 KinVtxFitter::KinVtxFitter(const std::vector<reco::TransientTrack> tracks,
                            const std::vector<double> masses,
-                           std::vector<float> sigmas, ParticleMass dilep_mass)
+                           std::vector<float> sigmas,
+                           ParticleMass dilep_mass)
     : n_particles_{masses.size()} {
   KinematicParticleFactoryFromTransientTrack factory;
   std::vector<RefCountedKinematicParticle> particles;
   for (size_t i = 0; i < tracks.size(); ++i) {
-    particles.emplace_back(factory.particle(tracks.at(i), masses.at(i),
-                                            kin_chi2_, kin_ndof_, sigmas[i]));
+    particles.emplace_back(factory.particle(tracks.at(i), masses.at(i), kin_chi2_, kin_ndof_, sigmas[i]));
   }
 
-  MultiTrackKinematicConstraint* dilep_c =
-      new TwoTrackMassKinematicConstraint(dilep_mass);
+  MultiTrackKinematicConstraint* dilep_c = new TwoTrackMassKinematicConstraint(dilep_mass);
   KinematicConstrainedVertexFitter kcv_fitter;
   RefCountedKinematicTree vtx_tree = kcv_fitter.fit(particles, dilep_c);
 
-  if (vtx_tree->isEmpty() || !vtx_tree->isValid() ||
-      !vtx_tree->isConsistent()) {
+  if (vtx_tree->isEmpty() || !vtx_tree->isValid() || !vtx_tree->isConsistent()) {
     success_ = false;
     return;
   }
@@ -69,8 +64,7 @@ KinVtxFitter::KinVtxFitter(const std::vector<reco::TransientTrack> tracks,
   vtx_tree->movePointerToTheTop();
   fitted_particle_ = vtx_tree->currentParticle();
   fitted_vtx_ = vtx_tree->currentDecayVertex();
-  if (!fitted_particle_->currentState().isValid() ||
-      !fitted_vtx_->vertexIsValid()) {
+  if (!fitted_particle_->currentState().isValid() || !fitted_vtx_->vertexIsValid()) {
     success_ = false;
     return;
   }
diff --git a/PhysicsTools/BPHNano/plugins/KinVtxFitter.h b/PhysicsTools/BPHNano/plugins/KinVtxFitter.h
index a0bbb999b05b..b3191c9eaaf9 100644
--- a/PhysicsTools/BPHNano/plugins/KinVtxFitter.h
+++ b/PhysicsTools/BPHNano/plugins/KinVtxFitter.h
@@ -10,19 +10,16 @@
 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
 
 class KinVtxFitter {
- public:
-  KinVtxFitter()
-      : fitted_vtx_{},
-        fitted_state_{},
-        fitted_particle_{},
-        fitted_children_{},
-        fitted_track_{} {};
+public:
+  KinVtxFitter() : fitted_vtx_{}, fitted_state_{}, fitted_particle_{}, fitted_children_{}, fitted_track_{} {};
 
   KinVtxFitter(const std::vector<reco::TransientTrack> tracks,
-               const std::vector<double> masses, std::vector<float> sigmas);
+               const std::vector<double> masses,
+               std::vector<float> sigmas);
 
   KinVtxFitter(const std::vector<reco::TransientTrack> tracks,
-               const std::vector<double> masses, std::vector<float> sigmas,
+               const std::vector<double> masses,
+               std::vector<float> sigmas,
                ParticleMass dilep_mass);
 
   ~KinVtxFitter() {};
@@ -30,23 +27,16 @@ class KinVtxFitter {
   bool success() const { return success_; }
   float chi2() const { return success_ ? fitted_vtx_->chiSquared() : 999; }
   float dof() const { return success_ ? fitted_vtx_->degreesOfFreedom() : -1; }
-  float prob() const {
-    return success_ ? ChiSquaredProbability(chi2(), dof()) : 0.;
-  }
-  float kin_chi2() const {
-    return kin_chi2_;
-  }  // should they be merged in a single value?
+  float prob() const { return success_ ? ChiSquaredProbability(chi2(), dof()) : 0.; }
+  float kin_chi2() const { return kin_chi2_; }  // should they be merged in a single value?
   float kin_ndof() const { return kin_ndof_; }
 
-  const KinematicState fitted_daughter(size_t i) const {
-    return fitted_children_.at(i)->currentState();
-  }
+  const KinematicState fitted_daughter(size_t i) const { return fitted_children_.at(i)->currentState(); }
 
   const math::PtEtaPhiMLorentzVector daughter_p4(size_t i) const {
     const auto& state = fitted_children_.at(i)->currentState();
     return math::PtEtaPhiMLorentzVector(
-        state.globalMomentum().perp(), state.globalMomentum().eta(),
-        state.globalMomentum().phi(), state.mass());
+        state.globalMomentum().perp(), state.globalMomentum().eta(), state.globalMomentum().phi(), state.mass());
   }
 
   const KinematicState fitted_candidate() const { return fitted_state_; }
@@ -60,15 +50,13 @@ class KinVtxFitter {
                                         fitted_state_.mass());
   }
 
-  const reco::TransientTrack& fitted_candidate_ttrk() const {
-    return fitted_track_;
-  }
+  const reco::TransientTrack& fitted_candidate_ttrk() const { return fitted_track_; }
 
   GlobalPoint fitted_vtx() const { return fitted_vtx_->position(); }
 
   GlobalError fitted_vtx_uncertainty() const { return fitted_vtx_->error(); }
 
- private:
+private:
   float kin_chi2_ = 0.;
   float kin_ndof_ = 0.;
   size_t n_particles_ = 0;
diff --git a/PhysicsTools/BPHNano/plugins/MCFinalStateSelector.cc b/PhysicsTools/BPHNano/plugins/MCFinalStateSelector.cc
index d1ea3cdc029b..cf8700107b4e 100644
--- a/PhysicsTools/BPHNano/plugins/MCFinalStateSelector.cc
+++ b/PhysicsTools/BPHNano/plugins/MCFinalStateSelector.cc
@@ -14,15 +14,13 @@
 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
 
 class MCFinalStateSelector : public edm::global::EDProducer<> {
- public:
+public:
   MCFinalStateSelector(edm::ParameterSet const& params)
       : objName_(params.getParameter<std::string>("objName")),
         branchName_(params.getParameter<std::string>("branchName")),
         doc_(params.getParameter<std::string>("docString")),
-        src_(consumes<reco::CandidateView>(
-            params.getParameter<edm::InputTag>("src"))),
-        candMap_(consumes<edm::Association<reco::GenParticleCollection>>(
-            params.getParameter<edm::InputTag>("mcMap"))) {
+        src_(consumes<reco::CandidateView>(params.getParameter<edm::InputTag>("src"))),
+        candMap_(consumes<edm::Association<reco::GenParticleCollection>>(params.getParameter<edm::InputTag>("mcMap"))) {
     produces<nanoaod::FlatTable>();
     const std::string& type = params.getParameter<std::string>("objType");
     if (type == "Muon")
@@ -40,8 +38,7 @@ class MCFinalStateSelector : public edm::global::EDProducer<> {
     else if (type == "Other")
       type_ = MOther;
     else
-      throw cms::Exception("Configuration",
-                           "Unsupported objType '" + type + "'\n");
+      throw cms::Exception("Configuration", "Unsupported objType '" + type + "'\n");
 
     std::cout << "type = " << type << std::endl;
     switch (type_) {
@@ -60,8 +57,7 @@ class MCFinalStateSelector : public edm::global::EDProducer<> {
             "511 = from B0, 521 = from B+/-, 0 = unknown or unmatched";
         break;
       case MPhoton:
-        flavDoc_ =
-            "1 = prompt photon, 13 = prompt electron, 0 = unknown or unmatched";
+        flavDoc_ = "1 = prompt photon, 13 = prompt electron, 0 = unknown or unmatched";
         break;
       case MTau:
         flavDoc_ =
@@ -83,21 +79,19 @@ class MCFinalStateSelector : public edm::global::EDProducer<> {
     }
 
     if (type_ == MTau) {
-      candMapVisTau_ = consumes<edm::Association<reco::GenParticleCollection>>(
-          params.getParameter<edm::InputTag>("mcMapVisTau"));
+      candMapVisTau_ =
+          consumes<edm::Association<reco::GenParticleCollection>>(params.getParameter<edm::InputTag>("mcMapVisTau"));
     }
   }
 
   ~MCFinalStateSelector() override {}
 
-  void produce(edm::StreamID id, edm::Event& iEvent,
-               const edm::EventSetup& iSetup) const override {
+  void produce(edm::StreamID id, edm::Event& iEvent, const edm::EventSetup& iSetup) const override {
     edm::Handle<reco::CandidateView> cands;
     iEvent.getByToken(src_, cands);
     unsigned int ncand = cands->size();
 
-    auto tab =
-        std::make_unique<nanoaod::FlatTable>(ncand, objName_, false, true);
+    auto tab = std::make_unique<nanoaod::FlatTable>(ncand, objName_, false, true);
 
     edm::Handle<edm::Association<reco::GenParticleCollection>> map;
     iEvent.getByToken(candMap_, map);
@@ -132,32 +126,24 @@ class MCFinalStateSelector : public edm::global::EDProducer<> {
           break;
         case MElectron:
           if (match->isPromptFinalState())
-            flav[i] =
-                (match->pdgId() == 22 ? 22 : 1);  // prompt electron or photon
+            flav[i] = (match->pdgId() == 22 ? 22 : 1);  // prompt electron or photon
           else
             flav[i] = getParentHadronFlag(match);  // pdgId of mother
           break;
         case MPhoton:
           if (match->isPromptFinalState())
-            flav[i] =
-                (match->pdgId() == 22 ? 1 : 13);  // prompt electron or photon
+            flav[i] = (match->pdgId() == 22 ? 1 : 13);  // prompt electron or photon
           break;
         case MTau:
           // CV: assignment of status codes according to
           // https://twiki.cern.ch/twiki/bin/viewauth/CMS/HiggsToTauTauWorking2016#MC_Matching
-          if (match.isNonnull() && match->statusFlags().isPrompt() &&
-              abs(match->pdgId()) == 11)
+          if (match.isNonnull() && match->statusFlags().isPrompt() && abs(match->pdgId()) == 11)
             flav[i] = 1;
-          else if (match.isNonnull() && match->statusFlags().isPrompt() &&
-                   abs(match->pdgId()) == 13)
+          else if (match.isNonnull() && match->statusFlags().isPrompt() && abs(match->pdgId()) == 13)
             flav[i] = 2;
-          else if (match.isNonnull() &&
-                   match->isDirectPromptTauDecayProductFinalState() &&
-                   abs(match->pdgId()) == 11)
+          else if (match.isNonnull() && match->isDirectPromptTauDecayProductFinalState() && abs(match->pdgId()) == 11)
             flav[i] = 3;
-          else if (match.isNonnull() &&
-                   match->isDirectPromptTauDecayProductFinalState() &&
-                   abs(match->pdgId()) == 13)
+          else if (match.isNonnull() && match->isDirectPromptTauDecayProductFinalState() && abs(match->pdgId()) == 13)
             flav[i] = 4;
           else if (matchVisTau.isNonnull())
             flav[i] = 5;
@@ -179,14 +165,12 @@ class MCFinalStateSelector : public edm::global::EDProducer<> {
       };
     }
 
-    tab->addColumn<int>(branchName_ + "Idx", key,
-                        "Index into genParticle list for " + doc_);
+    tab->addColumn<int>(branchName_ + "Idx", key, "Index into genParticle list for " + doc_);
     // for(auto ij : flav) std::cout << " flav = " << ij << " " << (uint8_t)ij
     // << std::endl; tab->addColumn<uint8_t>(branchName_+"Flav", flav, "Flavour
     // of genParticle for "+doc_+": "+flavDoc_,
     // nanoaod::FlatTable::UInt8Column);
-    tab->addColumn<int>(branchName_ + "Flav", flav,
-                        "Flavour of genParticle for " + doc_ + ": " + flavDoc_);
+    tab->addColumn<int>(branchName_ + "Flav", flav, "Flavour of genParticle for " + doc_ + ": " + flavDoc_);
 
     iEvent.put(std::move(tab));
   }
@@ -195,7 +179,8 @@ class MCFinalStateSelector : public edm::global::EDProducer<> {
     for (unsigned int im = 0, nm = match->numberOfMothers(); im < nm; ++im) {
       reco::GenParticleRef mom = match->motherRef(im);
       assert(mom.isNonnull() && mom.isAvailable());  // sanity
-      if (mom.key() >= match.key()) continue;        // prevent circular refs
+      if (mom.key() >= match.key())
+        continue;  // prevent circular refs
       int id = std::abs(mom->pdgId());
       return id;
     }
@@ -204,14 +189,12 @@ class MCFinalStateSelector : public edm::global::EDProducer<> {
 
   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
     edm::ParameterSetDescription desc;
-    desc.add<std::string>("objName")->setComment(
-        "name of the nanoaod::FlatTable to extend with this table");
+    desc.add<std::string>("objName")->setComment("name of the nanoaod::FlatTable to extend with this table");
     desc.add<std::string>("branchName")
         ->setComment(
             "name of the column to write (the final branch in the nanoaod will "
             "be <objName>_<branchName>Idx and <objName>_<branchName>Flav");
-    desc.add<std::string>("docString")
-        ->setComment("documentation to forward to the output");
+    desc.add<std::string>("docString")->setComment("documentation to forward to the output");
     desc.add<edm::InputTag>("src")->setComment(
         "physics object collection for the reconstructed objects (e.g. "
         "leptons)");
@@ -228,22 +211,12 @@ class MCFinalStateSelector : public edm::global::EDProducer<> {
     descriptions.add("mcFinalStatesTable", desc);
   }
 
- protected:
+protected:
   const std::string objName_, branchName_, doc_;
   const edm::EDGetTokenT<reco::CandidateView> src_;
-  const edm::EDGetTokenT<edm::Association<reco::GenParticleCollection>>
-      candMap_;
-  edm::EDGetTokenT<edm::Association<reco::GenParticleCollection>>
-      candMapVisTau_;
-  enum MatchType {
-    MMuon,
-    MElectron,
-    MTau,
-    MPhoton,
-    MTrack,
-    MOther,
-    MKshort
-  } type_;
+  const edm::EDGetTokenT<edm::Association<reco::GenParticleCollection>> candMap_;
+  edm::EDGetTokenT<edm::Association<reco::GenParticleCollection>> candMapVisTau_;
+  enum MatchType { MMuon, MElectron, MTau, MPhoton, MTrack, MOther, MKshort } type_;
   std::string flavDoc_;
 };
 
diff --git a/PhysicsTools/BPHNano/plugins/MatchEmbedder.cc b/PhysicsTools/BPHNano/plugins/MatchEmbedder.cc
index 8035448d6d78..3fe8e23f9d57 100644
--- a/PhysicsTools/BPHNano/plugins/MatchEmbedder.cc
+++ b/PhysicsTools/BPHNano/plugins/MatchEmbedder.cc
@@ -21,32 +21,28 @@ template <typename PATOBJ>
 class MatchEmbedder : public edm::global::EDProducer<> {
   // perhaps we need better structure here (begin run etc)
 
- public:
+public:
   explicit MatchEmbedder(const edm::ParameterSet &cfg)
-      : src_{consumes<PATOBJCollection>(
-            cfg.getParameter<edm::InputTag>("src"))},
-        matching_{consumes<edm::Association<reco::GenParticleCollection> >(
-            cfg.getParameter<edm::InputTag>("matching"))} {
+      : src_{consumes<PATOBJCollection>(cfg.getParameter<edm::InputTag>("src"))},
+        matching_{
+            consumes<edm::Association<reco::GenParticleCollection> >(cfg.getParameter<edm::InputTag>("matching"))} {
     produces<PATOBJCollection>();
   }
 
   ~MatchEmbedder() override {}
 
-  void produce(edm::StreamID, edm::Event &,
-               const edm::EventSetup &) const override;
+  void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override;
 
   static void fillDescriptions(edm::ConfigurationDescriptions &descriptions) {}
 
- private:
+private:
   typedef std::vector<PATOBJ> PATOBJCollection;
   const edm::EDGetTokenT<PATOBJCollection> src_;
-  const edm::EDGetTokenT<edm::Association<reco::GenParticleCollection> >
-      matching_;
+  const edm::EDGetTokenT<edm::Association<reco::GenParticleCollection> > matching_;
 };
 
 template <typename PATOBJ>
-void MatchEmbedder<PATOBJ>::produce(edm::StreamID, edm::Event &evt,
-                                    edm::EventSetup const &iSetup) const {
+void MatchEmbedder<PATOBJ>::produce(edm::StreamID, edm::Event &evt, edm::EventSetup const &iSetup) const {
   // input
   edm::Handle<PATOBJCollection> src;
   evt.getByToken(src_, src);
diff --git a/PhysicsTools/BPHNano/plugins/MuonTriggerSelector.cc b/PhysicsTools/BPHNano/plugins/MuonTriggerSelector.cc
index e6ed841aabc8..895ad39d8251 100644
--- a/PhysicsTools/BPHNano/plugins/MuonTriggerSelector.cc
+++ b/PhysicsTools/BPHNano/plugins/MuonTriggerSelector.cc
@@ -30,11 +30,11 @@ using namespace std;
 constexpr bool debug = false;
 
 class MuonTriggerSelector : public edm::stream::EDProducer<> {
- public:
+public:
   explicit MuonTriggerSelector(const edm::ParameterSet &iConfig);
   ~MuonTriggerSelector() override {};
 
- private:
+private:
   void produce(edm::Event &, const edm::EventSetup &) override;
   const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> bFieldToken_;
   edm::EDGetTokenT<std::vector<pat::Muon>> muonSrc_;
@@ -50,18 +50,14 @@ class MuonTriggerSelector : public edm::stream::EDProducer<> {
 
 MuonTriggerSelector::MuonTriggerSelector(const edm::ParameterSet &iConfig)
     : bFieldToken_(esConsumes<MagneticField, IdealMagneticFieldRecord>()),
-      muonSrc_(consumes<std::vector<pat::Muon>>(
-          iConfig.getParameter<edm::InputTag>("muonCollection"))),
-      triggerBits_(consumes<edm::TriggerResults>(
-          iConfig.getParameter<edm::InputTag>("bits"))),
-      triggerObjects_(consumes<std::vector<pat::TriggerObjectStandAlone>>(
-          iConfig.getParameter<edm::InputTag>("objects"))),
-      triggerPrescales_(consumes<pat::PackedTriggerPrescales>(
-          iConfig.getParameter<edm::InputTag>("prescales"))),
+      muonSrc_(consumes<std::vector<pat::Muon>>(iConfig.getParameter<edm::InputTag>("muonCollection"))),
+      triggerBits_(consumes<edm::TriggerResults>(iConfig.getParameter<edm::InputTag>("bits"))),
+      triggerObjects_(
+          consumes<std::vector<pat::TriggerObjectStandAlone>>(iConfig.getParameter<edm::InputTag>("objects"))),
+      triggerPrescales_(consumes<pat::PackedTriggerPrescales>(iConfig.getParameter<edm::InputTag>("prescales"))),
       muon_selection_{iConfig.getParameter<std::string>("muonSelection")},
       maxdR_(iConfig.getParameter<double>("maxdR_matching")),
-      HLTPaths_(iConfig.getParameter<std::vector<std::string>>(
-          "HLTPaths"))  // multiple paths with comma
+      HLTPaths_(iConfig.getParameter<std::vector<std::string>>("HLTPaths"))  // multiple paths with comma
 {
   // outputs
   produces<pat::MuonCollection>("AllMuons");
@@ -69,8 +65,7 @@ MuonTriggerSelector::MuonTriggerSelector(const edm::ParameterSet &iConfig)
   produces<TransientTrackCollection>("SelectedTransientMuons");
 }
 
-void MuonTriggerSelector::produce(edm::Event &iEvent,
-                                  const edm::EventSetup &iSetup) {
+void MuonTriggerSelector::produce(edm::Event &iEvent, const edm::EventSetup &iSetup) {
   const auto &bField = iSetup.getData(bFieldToken_);
 
   edm::Handle<edm::TriggerResults> triggerBits;
@@ -85,8 +80,7 @@ void MuonTriggerSelector::produce(edm::Event &iEvent,
 
   std::unique_ptr<pat::MuonCollection> allmuons_out(new pat::MuonCollection);
   std::unique_ptr<pat::MuonCollection> muons_out(new pat::MuonCollection);
-  std::unique_ptr<TransientTrackCollection> trans_muons_out(
-      new TransientTrackCollection);
+  std::unique_ptr<TransientTrackCollection> trans_muons_out(new TransientTrackCollection);
 
   edm::Handle<std::vector<pat::Muon>> muons;
   iEvent.getByToken(muonSrc_, muons);
@@ -108,8 +102,7 @@ void MuonTriggerSelector::produce(edm::Event &iEvent,
 
   for (const pat::Muon &muon : *muons) {
     if (debug)
-      std::cout << "Muon Pt=" << muon.pt() << " Eta=" << muon.eta()
-                << " Phi=" << muon.phi() << endl;
+      std::cout << "Muon Pt=" << muon.pt() << " Eta=" << muon.eta() << " Phi=" << muon.phi() << endl;
 
     std::vector<int> frs(HLTPaths_.size(), 0);  // path fires for each reco muon
     std::vector<float> temp_matched_to(HLTPaths_.size(), 1000.);
@@ -135,45 +128,41 @@ void MuonTriggerSelector::produce(edm::Event &iEvent,
       // matched with the reco muon.
       if (!muon.triggerObjectMatches().empty()) {
         for (size_t i = 0; i < muon.triggerObjectMatches().size(); i++) {
-          if (muon.triggerObjectMatch(i) != nullptr &&
-              muon.triggerObjectMatch(i)->hasPathName(cstr, true, true)) {
+          if (muon.triggerObjectMatch(i) != nullptr && muon.triggerObjectMatch(i)->hasPathName(cstr, true, true)) {
             frs[ipath] = 1;
-            float dr = deltaR(muon.eta(), muon.phi(),
-                              muon.triggerObjectMatch(i)->eta(),
-                              muon.triggerObjectMatch(i)->phi());
-            float dpt = (muon.triggerObjectMatch(i)->pt() - muon.pt()) /
-                        muon.triggerObjectMatch(i)->pt();
+            float dr =
+                deltaR(muon.eta(), muon.phi(), muon.triggerObjectMatch(i)->eta(), muon.triggerObjectMatch(i)->phi());
+            float dpt = (muon.triggerObjectMatch(i)->pt() - muon.pt()) / muon.triggerObjectMatch(i)->pt();
             temp_dr[i] = dr;
             temp_dpt[i] = dpt;
             temp_pt[i] = muon.triggerObjectMatch(i)->pt();
-            if (debug) std::cout << "Path=" << cstr << endl;
+            if (debug)
+              std::cout << "Path=" << cstr << endl;
             if (debug)
               std::cout << "HLT  Pt=" << muon.triggerObjectMatch(i)->pt()
-                        << " Eta=" << muon.triggerObjectMatch(i)->eta()
-                        << " Phi=" << muon.triggerObjectMatch(i)->phi() << endl;
+                        << " Eta=" << muon.triggerObjectMatch(i)->eta() << " Phi=" << muon.triggerObjectMatch(i)->phi()
+                        << endl;
+            if (debug)
+              std::cout << "Muon Pt=" << muon.pt() << " Eta=" << muon.eta() << " Phi=" << muon.phi() << endl;
             if (debug)
-              std::cout << "Muon Pt=" << muon.pt() << " Eta=" << muon.eta()
-                        << " Phi=" << muon.phi() << endl;
-            if (debug) std::cout << "DR = " << temp_dr[i] << endl;
+              std::cout << "DR = " << temp_dr[i] << endl;
           }
         }
         // and now we find the real minimum between the reco muon and all its
         // matched HLT objects.
         temp_DR[ipath] = *min_element(temp_dr.begin(), temp_dr.end());
-        int position =
-            std::min_element(temp_dr.begin(), temp_dr.end()) - temp_dr.begin();
+        int position = std::min_element(temp_dr.begin(), temp_dr.end()) - temp_dr.begin();
         temp_DPT[ipath] = temp_dpt[position];
         temp_matched_to[ipath] = temp_pt[position];
       }
     }
     // and now since we have found the minimum DR we save a few variables for
     // plots
-    fires.push_back(frs);  // This is used in order to see if a reco muon fired
-                           // a Trigger (1) or not (0).
-    matcher.push_back(
-        temp_matched_to);  // This is used in order to see if a reco muon is
-                           // matched with a HLT object. PT of the reco muon is
-                           // saved in this vector.
+    fires.push_back(frs);                // This is used in order to see if a reco muon fired
+                                         // a Trigger (1) or not (0).
+    matcher.push_back(temp_matched_to);  // This is used in order to see if a reco muon is
+                                         // matched with a HLT object. PT of the reco muon is
+                                         // saved in this vector.
     DR.push_back(temp_DR);
     DPT.push_back(temp_DPT);
   }
@@ -181,11 +170,9 @@ void MuonTriggerSelector::produce(edm::Event &iEvent,
   for (unsigned int path = 0; path < HLTPaths_.size(); path++) {
     for (unsigned int iMuo = 0; iMuo < muons->size(); iMuo++) {
       for (unsigned int im = (iMuo + 1); im < muons->size(); im++) {
-        if (matcher[iMuo][path] != 1000. &&
-            matcher[iMuo][path] == matcher[im][path]) {
-          if (DR[iMuo][path] <
-              DR[im][path]) {  // Keep the one that has the minimum DR with the
-                               // HLT object
+        if (matcher[iMuo][path] != 1000. && matcher[iMuo][path] == matcher[im][path]) {
+          if (DR[iMuo][path] < DR[im][path]) {  // Keep the one that has the minimum DR with the
+                                                // HLT object
             fires[im][path] = 0;
             matcher[im][path] = 1000.;
             DR[im][path] = 1000.;
@@ -209,12 +196,15 @@ void MuonTriggerSelector::produce(edm::Event &iEvent,
   // save the reco muon in both collections
   for (const pat::Muon &muon : *muons) {
     unsigned int iMuo(&muon - &(muons->at(0)));
-    if (!muon_selection_(muon)) continue;  // selection cuts
+    if (!muon_selection_(muon))
+      continue;  // selection cuts
     const reco::TransientTrack muonTT((*(muon.bestTrack())), &bField);
-    if (!muonTT.isValid()) continue;
+    if (!muonTT.isValid())
+      continue;
 
     allmuons_out->emplace_back(muon);
-    if (muonIsTrigger[iMuo] != 1) continue;
+    if (muonIsTrigger[iMuo] != 1)
+      continue;
 
     muons_out->emplace_back(muon);
     muons_out->back().addUserInt("isTriggering", muonIsTrigger[iMuo]);
diff --git a/PhysicsTools/BPHNano/plugins/PVertexBPHTable.cc b/PhysicsTools/BPHNano/plugins/PVertexBPHTable.cc
index 283e541e873a..c7852e8141af 100644
--- a/PhysicsTools/BPHNano/plugins/PVertexBPHTable.cc
+++ b/PhysicsTools/BPHNano/plugins/PVertexBPHTable.cc
@@ -41,13 +41,13 @@
 //
 
 class PVertexBPHTable : public edm::stream::EDProducer<> {
- public:
+public:
   explicit PVertexBPHTable(const edm::ParameterSet&);
   ~PVertexBPHTable() override;
 
   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
 
- private:
+private:
   void beginStream(edm::StreamID) override;
   void produce(edm::Event&, const edm::EventSetup&) override;
   void endStream() override;
@@ -64,10 +64,8 @@ class PVertexBPHTable : public edm::stream::EDProducer<> {
 // constructors and destructor
 //
 PVertexBPHTable::PVertexBPHTable(const edm::ParameterSet& params)
-    : pvs_(consumes<std::vector<reco::Vertex>>(
-          params.getParameter<edm::InputTag>("pvSrc"))),
-      pvsScore_(consumes<edm::ValueMap<float>>(
-          params.getParameter<edm::InputTag>("pvSrc"))),
+    : pvs_(consumes<std::vector<reco::Vertex>>(params.getParameter<edm::InputTag>("pvSrc"))),
+      pvsScore_(consumes<edm::ValueMap<float>>(params.getParameter<edm::InputTag>("pvSrc"))),
       goodPvCut_(params.getParameter<std::string>("goodPvCut"), true),
       pvName_(params.getParameter<std::string>("pvName"))
 
@@ -87,15 +85,13 @@ PVertexBPHTable::~PVertexBPHTable() {
 
 // ------------ method called to produce the data  ------------
 
-void PVertexBPHTable::produce(edm::Event& iEvent,
-                              const edm::EventSetup& iSetup) {
+void PVertexBPHTable::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
   using namespace edm;
   const auto& pvsScoreProd = iEvent.get(pvsScore_);
   auto pvsCol = iEvent.getHandle(pvs_);
 
   auto selCandPv = std::make_unique<PtrVector<reco::Candidate>>();
-  std::vector<float> pvscore, chi2, covXX, covYY, covZZ, covXY, covXZ, covYZ,
-      vx, vy, vz, pt, eta, phi, mass, ndof;
+  std::vector<float> pvscore, chi2, covXX, covYY, covZZ, covXY, covXZ, covYZ, vx, vy, vz, pt, eta, phi, mass, ndof;
   std::vector<int> charge, ntracks;
 
   size_t i = 0;
@@ -124,8 +120,7 @@ void PVertexBPHTable::produce(edm::Event& iEvent,
     ndof.push_back(pv.ndof());
     i++;
   }
-  auto table = std::make_unique<nanoaod::FlatTable>(pvscore.size(), pvName_,
-                                                    false, false);
+  auto table = std::make_unique<nanoaod::FlatTable>(pvscore.size(), pvName_, false, false);
   table->addColumn<float>("score", pvscore, "", 10);
   table->addColumn<float>("vx", vx, "", 10);
   table->addColumn<float>("vy", vy, "", 10);
@@ -157,15 +152,13 @@ void PVertexBPHTable::endStream() {}
 
 // ------------ method fills 'descriptions' with the allowed parameters for the
 // module  ------------
-void PVertexBPHTable::fillDescriptions(
-    edm::ConfigurationDescriptions& descriptions) {
+void PVertexBPHTable::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
   edm::ParameterSetDescription desc;
 
   desc.add<edm::InputTag>("pvSrc")->setComment(
       "std::vector<reco::Vertex> and ValueMap<float> primary vertex input "
       "collections");
-  desc.add<std::string>("goodPvCut")
-      ->setComment("selection on the primary vertex");
+  desc.add<std::string>("goodPvCut")->setComment("selection on the primary vertex");
 
   desc.add<std::string>("pvName")->setComment("name of the flat table ouput");
 
diff --git a/PhysicsTools/BPHNano/plugins/SimpleFlatTableProducerBPHPlugins.cc b/PhysicsTools/BPHNano/plugins/SimpleFlatTableProducerBPHPlugins.cc
index 821cf96ed7c8..a1cd571a3f48 100644
--- a/PhysicsTools/BPHNano/plugins/SimpleFlatTableProducerBPHPlugins.cc
+++ b/PhysicsTools/BPHNano/plugins/SimpleFlatTableProducerBPHPlugins.cc
@@ -1,7 +1,6 @@
 #include "DataFormats/PatCandidates/interface/CompositeCandidate.h"
 #include "PhysicsTools/NanoAOD/interface/SimpleFlatTableProducer.h"
-typedef SimpleFlatTableProducer<pat::CompositeCandidate>
-    SimpleCompositeCandidateFlatTableProducer;
+typedef SimpleFlatTableProducer<pat::CompositeCandidate> SimpleCompositeCandidateFlatTableProducer;
 
 // not really useful in the end because lowptgsf tracks come with BDT taht is
 // not part of GsfTracks
diff --git a/PhysicsTools/BPHNano/plugins/TrackMerger.cc b/PhysicsTools/BPHNano/plugins/TrackMerger.cc
index 95b8956c1fba..6ce8e891bcd0 100644
--- a/PhysicsTools/BPHNano/plugins/TrackMerger.cc
+++ b/PhysicsTools/BPHNano/plugins/TrackMerger.cc
@@ -25,39 +25,31 @@
 #include "helper.h"
 
 class TrackMerger : public edm::global::EDProducer<> {
- public:
+public:
   // would it be useful to give this a bit more standard structure?
   explicit TrackMerger(const edm::ParameterSet &cfg)
       : bFieldToken_(esConsumes<MagneticField, IdealMagneticFieldRecord>()),
-        beamSpotSrc_(consumes<reco::BeamSpot>(
-            cfg.getParameter<edm::InputTag>("beamSpot"))),
-        tracksToken_(consumes<pat::PackedCandidateCollection>(
-            cfg.getParameter<edm::InputTag>("tracks"))),
-        lostTracksToken_(consumes<pat::PackedCandidateCollection>(
-            cfg.getParameter<edm::InputTag>("lostTracks"))),
-        dileptonToken_(consumes<pat::CompositeCandidateCollection>(
-            cfg.getParameter<edm::InputTag>("dileptons"))),
-        muonToken_(consumes<pat::MuonCollection>(
-            cfg.getParameter<edm::InputTag>("muons"))),
-        eleToken_(consumes<pat::ElectronCollection>(
-            cfg.getParameter<edm::InputTag>("electrons"))),
+        beamSpotSrc_(consumes<reco::BeamSpot>(cfg.getParameter<edm::InputTag>("beamSpot"))),
+        tracksToken_(consumes<pat::PackedCandidateCollection>(cfg.getParameter<edm::InputTag>("tracks"))),
+        lostTracksToken_(consumes<pat::PackedCandidateCollection>(cfg.getParameter<edm::InputTag>("lostTracks"))),
+        dileptonToken_(consumes<pat::CompositeCandidateCollection>(cfg.getParameter<edm::InputTag>("dileptons"))),
+        muonToken_(consumes<pat::MuonCollection>(cfg.getParameter<edm::InputTag>("muons"))),
+        eleToken_(consumes<pat::ElectronCollection>(cfg.getParameter<edm::InputTag>("electrons"))),
         maxDzDilep_(cfg.getParameter<double>("maxDzDilep")),
         dcaSig_(cfg.getParameter<double>("dcaSig")),
         track_selection_(cfg.getParameter<std::string>("trackSelection")) {
     produces<pat::CompositeCandidateCollection>("SelectedTracks");
     produces<TransientTrackCollection>("SelectedTransientTracks");
-    produces<edm::Association<pat::CompositeCandidateCollection>>(
-        "SelectedTracks");
+    produces<edm::Association<pat::CompositeCandidateCollection>>("SelectedTracks");
   }
 
   ~TrackMerger() override {}
 
-  void produce(edm::StreamID, edm::Event &,
-               const edm::EventSetup &) const override;
+  void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override;
 
   static void fillDescriptions(edm::ConfigurationDescriptions &descriptions) {}
 
- private:
+private:
   const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> bFieldToken_;
   const edm::EDGetTokenT<reco::BeamSpot> beamSpotSrc_;
   const edm::EDGetTokenT<pat::PackedCandidateCollection> tracksToken_;
@@ -72,8 +64,7 @@ class TrackMerger : public edm::global::EDProducer<> {
   const StringCutObjectSelector<pat::PackedCandidate> track_selection_;
 };
 
-void TrackMerger::produce(edm::StreamID, edm::Event &evt,
-                          edm::EventSetup const &stp) const {
+void TrackMerger::produce(edm::StreamID, edm::Event &evt, edm::EventSetup const &stp) const {
   // input
   edm::Handle<reco::BeamSpot> beamSpotHandle;
   evt.getByToken(beamSpotSrc_, beamSpotHandle);
@@ -100,13 +91,10 @@ void TrackMerger::produce(edm::StreamID, edm::Event &evt,
   unsigned int totalTracks = nTracks + lostTracks->size();
 
   // ok this was CompositeCandidateCollection
-  std::unique_ptr<pat::CompositeCandidateCollection> tracks_out(
-      new pat::CompositeCandidateCollection);
-  std::unique_ptr<TransientTrackCollection> trans_tracks_out(
-      new TransientTrackCollection);
+  std::unique_ptr<pat::CompositeCandidateCollection> tracks_out(new pat::CompositeCandidateCollection);
+  std::unique_ptr<TransientTrackCollection> trans_tracks_out(new TransientTrackCollection);
 
-  std::vector<std::pair<pat::CompositeCandidate, reco::TransientTrack>>
-      vectrk_ttrk;
+  std::vector<std::pair<pat::CompositeCandidate, reco::TransientTrack>> vectrk_ttrk;
   // try topreserve same logic avoiding the copy of the full collection
   /*
   //correct logic but a bit convoluted -> changing to smthn simpler
@@ -117,12 +105,14 @@ void TrackMerger::produce(edm::StreamID, edm::Event &evt,
   std::vector<int> match_indices(totalTracks, -1);
   // for loop is better to be range based - especially for large ensembles
   for (unsigned int iTrk = 0; iTrk < totalTracks; ++iTrk) {
-    const pat::PackedCandidate &trk =
-        (iTrk < nTracks) ? (*tracks)[iTrk] : (*lostTracks)[iTrk - nTracks];
+    const pat::PackedCandidate &trk = (iTrk < nTracks) ? (*tracks)[iTrk] : (*lostTracks)[iTrk - nTracks];
     // arranging cuts for speed
-    if (!trk.hasTrackDetails()) continue;
-    if (fabs(trk.pdgId()) != 211) continue;  // do we want also to keep muons?
-    if (!track_selection_(trk)) continue;
+    if (!trk.hasTrackDetails())
+      continue;
+    if (fabs(trk.pdgId()) != 211)
+      continue;  // do we want also to keep muons?
+    if (!track_selection_(trk))
+      continue;
 
     bool skipTrack = true;
     float dzTrg = 0.0;
@@ -136,27 +126,27 @@ void TrackMerger::produce(edm::StreamID, edm::Event &evt,
     }
 
     // if track is far from all dilepton candidate
-    if (skipTrack) continue;
+    if (skipTrack)
+      continue;
 
     // high purity requirment applied only in packedCands
-    if (iTrk < nTracks && !trk.trackHighPurity()) continue;
+    if (iTrk < nTracks && !trk.trackHighPurity())
+      continue;
     const reco::TransientTrack trackTT((*trk.bestTrack()), &bField);
 
     // distance closest approach in x,y wrt beam spot
     std::pair<double, double> DCA = computeDCA(trackTT, beamSpot);
     float DCABS = DCA.first;
     float DCABSErr = DCA.second;
-    float DCASig = (DCABSErr != 0 && float(DCABSErr) == DCABSErr)
-                       ? fabs(DCABS / DCABSErr)
-                       : -1;
-    if (DCASig > dcaSig_ && dcaSig_ > 0) continue;
+    float DCASig = (DCABSErr != 0 && float(DCABSErr) == DCABSErr) ? fabs(DCABS / DCABSErr) : -1;
+    if (DCASig > dcaSig_ && dcaSig_ > 0)
+      continue;
 
     // clean tracks wrt to all muons
     int matchedToMuon = 0;
     for (const pat::Muon &imutmp : *muons) {
       for (unsigned int i = 0; i < imutmp.numberOfSourceCandidatePtrs(); ++i) {
-        if (!((imutmp.sourceCandidatePtr(i)).isNonnull() &&
-              (imutmp.sourceCandidatePtr(i)).isAvailable()))
+        if (!((imutmp.sourceCandidatePtr(i)).isNonnull() && (imutmp.sourceCandidatePtr(i)).isAvailable()))
           continue;
 
         const edm::Ptr<reco::Candidate> &source = imutmp.sourceCandidatePtr(i);
@@ -171,8 +161,7 @@ void TrackMerger::produce(edm::StreamID, edm::Event &evt,
     int matchedToEle = 0;
     for (const pat::Electron &ietmp : *pfele) {
       for (unsigned int i = 0; i < ietmp.numberOfSourceCandidatePtrs(); ++i) {
-        if (!((ietmp.sourceCandidatePtr(i)).isNonnull() &&
-              (ietmp.sourceCandidatePtr(i)).isAvailable()))
+        if (!((ietmp.sourceCandidatePtr(i)).isNonnull() && (ietmp.sourceCandidatePtr(i)).isAvailable()))
           continue;
         const edm::Ptr<reco::Candidate> &source = ietmp.sourceCandidatePtr(i);
         if (source.id() == tracks.id() && source.key() == iTrk) {
@@ -219,8 +208,7 @@ void TrackMerger::produce(edm::StreamID, edm::Event &evt,
     if (iTrk < nTracks)
       pcand.addUserCand("cand", edm::Ptr<pat::PackedCandidate>(tracks, iTrk));
     else
-      pcand.addUserCand(
-          "cand", edm::Ptr<pat::PackedCandidate>(lostTracks, iTrk - nTracks));
+      pcand.addUserCand("cand", edm::Ptr<pat::PackedCandidate>(lostTracks, iTrk - nTracks));
 
     // in order to avoid revoking the sxpensive ttrack builder many times and
     // still have everything sorted, we add them to vector of pairs
@@ -233,11 +221,9 @@ void TrackMerger::produce(edm::StreamID, edm::Event &evt,
 
   // sort to be uniform with leptons
   // sort by index since we want to update the match too
-  std::sort(sort_indices.begin(), sort_indices.end(),
-            [&vectrk_ttrk](auto &iTrk1, auto &iTrk2) -> bool {
-              return (vectrk_ttrk[iTrk1].first).pt() >
-                     (vectrk_ttrk[iTrk2].first).pt();
-            });
+  std::sort(sort_indices.begin(), sort_indices.end(), [&vectrk_ttrk](auto &iTrk1, auto &iTrk2) -> bool {
+    return (vectrk_ttrk[iTrk1].first).pt() > (vectrk_ttrk[iTrk2].first).pt();
+  });
   // std::sort( vectrk_ttrk.begin(), vectrk_ttrk.end(),
   //            [] ( auto & trk1, auto & trk2) ->
   //            bool {return (trk1.first).pt() > (trk2.first).pt();}
@@ -255,12 +241,12 @@ void TrackMerger::produce(edm::StreamID, edm::Event &evt,
   }
 
   // Now point the match indices to the sorted output collection
-  std::transform(match_indices.begin(), match_indices.end(),
-                 match_indices.begin(),
-                 [&reverse_sort_indices](int iUnsortedTrack) {
-                   if (iUnsortedTrack < 0) return -1;
-                   return reverse_sort_indices[iUnsortedTrack];
-                 });
+  std::transform(
+      match_indices.begin(), match_indices.end(), match_indices.begin(), [&reverse_sort_indices](int iUnsortedTrack) {
+        if (iUnsortedTrack < 0)
+          return -1;
+        return reverse_sort_indices[iUnsortedTrack];
+      });
 
   int unassoc = 0;
   for (auto iTrkAssoc : match_indices) {
@@ -274,15 +260,11 @@ void TrackMerger::produce(edm::StreamID, edm::Event &evt,
   evt.put(std::move(trans_tracks_out), "SelectedTransientTracks");
 
   // Associate PackedCandidates to the merged Track collection
-  auto tracks_out_match =
-      std::make_unique<edm::Association<pat::CompositeCandidateCollection>>(
-          tracks_orphan_handle);
-  edm::Association<pat::CompositeCandidateCollection>::Filler filler(
-      *tracks_out_match);
+  auto tracks_out_match = std::make_unique<edm::Association<pat::CompositeCandidateCollection>>(tracks_orphan_handle);
+  edm::Association<pat::CompositeCandidateCollection>::Filler filler(*tracks_out_match);
 
   filler.insert(tracks, match_indices.begin(), match_indices.begin() + nTracks);
-  filler.insert(lostTracks, match_indices.begin() + nTracks,
-                match_indices.end());
+  filler.insert(lostTracks, match_indices.begin() + nTracks, match_indices.end());
   filler.fill();
 
   evt.put(std::move(tracks_out_match), "SelectedTracks");
diff --git a/PhysicsTools/BPHNano/plugins/TriggerObjectTable.cc b/PhysicsTools/BPHNano/plugins/TriggerObjectTable.cc
index fca36d80d3aa..8190da0b8ae5 100644
--- a/PhysicsTools/BPHNano/plugins/TriggerObjectTable.cc
+++ b/PhysicsTools/BPHNano/plugins/TriggerObjectTable.cc
@@ -22,25 +22,22 @@
 #include "FWCore/Utilities/interface/StreamID.h"
 
 class TriggerObjectTableBParkProducer : public edm::stream::EDProducer<> {
- public:
+public:
   explicit TriggerObjectTableBParkProducer(const edm::ParameterSet &iConfig)
       : name_(iConfig.getParameter<std::string>("name")),
-        src_(consumes<std::vector<pat::TriggerObjectStandAlone>>(
-            iConfig.getParameter<edm::InputTag>("src"))),
-        l1Muon_(consumes<l1t::MuonBxCollection>(
-            iConfig.getParameter<edm::InputTag>("l1Muon"))) {
-    std::vector<edm::ParameterSet> selPSets =
-        iConfig.getParameter<std::vector<edm::ParameterSet>>("selections");
+        src_(consumes<std::vector<pat::TriggerObjectStandAlone>>(iConfig.getParameter<edm::InputTag>("src"))),
+        l1Muon_(consumes<l1t::MuonBxCollection>(iConfig.getParameter<edm::InputTag>("l1Muon"))) {
+    std::vector<edm::ParameterSet> selPSets = iConfig.getParameter<std::vector<edm::ParameterSet>>("selections");
     sels_.reserve(selPSets.size());
     std::stringstream idstr, qualitystr;
     idstr << "ID of the object: ";
     for (auto &pset : selPSets) {
       sels_.emplace_back(pset);
       idstr << sels_.back().id << " = " << sels_.back().name;
-      if (sels_.size() < selPSets.size()) idstr << ", ";
+      if (sels_.size() < selPSets.size())
+        idstr << ", ";
       if (!sels_.back().qualityBitsDoc.empty()) {
-        qualitystr << sels_.back().qualityBitsDoc << " for "
-                   << sels_.back().name << "; ";
+        qualitystr << sels_.back().qualityBitsDoc << " for " << sels_.back().name << "; ";
       }
     }
     idDoc_ = idstr.str();
@@ -51,7 +48,7 @@ class TriggerObjectTableBParkProducer : public edm::stream::EDProducer<> {
 
   ~TriggerObjectTableBParkProducer() override {}
 
- private:
+private:
   void produce(edm::Event &, edm::EventSetup const &) override;
 
   std::string name_;
@@ -82,39 +79,31 @@ class TriggerObjectTableBParkProducer : public edm::stream::EDProducer<> {
           qualityBits(pset.getParameter<std::string>("qualityBits")),
           qualityBitsDoc(pset.getParameter<std::string>("qualityBitsDoc")) {
       if (pset.existsAs<std::string>("l1seed")) {
-        l1cut = StringCutObjectSelector<pat::TriggerObjectStandAlone>(
-            pset.getParameter<std::string>("l1seed"));
+        l1cut = StringCutObjectSelector<pat::TriggerObjectStandAlone>(pset.getParameter<std::string>("l1seed"));
         l1DR2 = std::pow(pset.getParameter<double>("l1deltaR"), 2);
       }
       if (pset.existsAs<std::string>("l1seed_2")) {
-        l1cut_2 = StringCutObjectSelector<pat::TriggerObjectStandAlone>(
-            pset.getParameter<std::string>("l1seed_2"));
+        l1cut_2 = StringCutObjectSelector<pat::TriggerObjectStandAlone>(pset.getParameter<std::string>("l1seed_2"));
         l1DR2_2 = std::pow(pset.getParameter<double>("l1deltaR_2"), 2);
       }
       if (pset.existsAs<std::string>("l2seed")) {
-        l2cut = StringCutObjectSelector<pat::TriggerObjectStandAlone>(
-            pset.getParameter<std::string>("l2seed"));
+        l2cut = StringCutObjectSelector<pat::TriggerObjectStandAlone>(pset.getParameter<std::string>("l2seed"));
         l2DR2 = std::pow(pset.getParameter<double>("l2deltaR"), 2);
       }
     }
 
-    bool match(const pat::TriggerObjectStandAlone &obj) const {
-      return cut(obj);
-    }
+    bool match(const pat::TriggerObjectStandAlone &obj) const { return cut(obj); }
   };
 
   std::vector<SelectedObject> sels_;
 };
 
 // ------------ method called to produce the data  ------------
-void TriggerObjectTableBParkProducer::produce(edm::Event &iEvent,
-                                              const edm::EventSetup &iSetup) {
+void TriggerObjectTableBParkProducer::produce(edm::Event &iEvent, const edm::EventSetup &iSetup) {
   edm::Handle<std::vector<pat::TriggerObjectStandAlone>> src;
   iEvent.getByToken(src_, src);
 
-  std::vector<
-      std::pair<const pat::TriggerObjectStandAlone *, const SelectedObject *>>
-      selected;
+  std::vector<std::pair<const pat::TriggerObjectStandAlone *, const SelectedObject *>> selected;
   for (const auto &obj : *src) {
     for (const auto &sel : sels_) {
       if (sel.match(obj)) {
@@ -134,10 +123,8 @@ void TriggerObjectTableBParkProducer::produce(edm::Event &iEvent,
     for (unsigned int j = 0; j < i; ++j) {
       const auto &obj2 = *selected[j].first;
       const auto &sel2 = *selected[j].second;
-      if (sel.id == sel2.id && abs(obj.pt() - obj2.pt()) < 1e-6 &&
-          deltaR2(obj, obj2) < 1e-6) {
-        selected_bits[&obj2] |=
-            selected_bits[&obj];  // Keep filters from all the objects
+      if (sel.id == sel2.id && abs(obj.pt() - obj2.pt()) < 1e-6 && deltaR2(obj, obj2) < 1e-6) {
+        selected_bits[&obj2] |= selected_bits[&obj];  // Keep filters from all the objects
         selected.erase(selected.begin() + i);
         i--;
       }
@@ -149,8 +136,7 @@ void TriggerObjectTableBParkProducer::produce(edm::Event &iEvent,
 
   std::vector<pair<pat::TriggerObjectStandAlone, int>> l1Objects;
 
-  for (l1t::MuonBxCollection::const_iterator it = l1Muon->begin(0);
-       it != l1Muon->end(0); it++) {
+  for (l1t::MuonBxCollection::const_iterator it = l1Muon->begin(0); it != l1Muon->end(0); it++) {
     pat::TriggerObjectStandAlone l1obj(it->p4());
     l1obj.setCollection("L1Mu");
     l1obj.addTriggerObjectType(trigger::TriggerL1Mu);
@@ -159,10 +145,8 @@ void TriggerObjectTableBParkProducer::produce(edm::Event &iEvent,
   }
 
   unsigned int nobj = selected.size();
-  std::vector<float> pt(nobj, 0), eta(nobj, 0), phi(nobj, 0), l1pt(nobj, 0),
-      l1pt_2(nobj, 0), l2pt(nobj, 0);
-  std::vector<int> id(nobj, 0), bits(nobj, 0), l1iso(nobj, 0),
-      l1charge(nobj, 0);
+  std::vector<float> pt(nobj, 0), eta(nobj, 0), phi(nobj, 0), l1pt(nobj, 0), l1pt_2(nobj, 0), l2pt(nobj, 0);
+  std::vector<int> id(nobj, 0), bits(nobj, 0), l1iso(nobj, 0), l1charge(nobj, 0);
   for (unsigned int i = 0; i < nobj; ++i) {
     const auto &obj = *selected[i].first;
     const auto &sel = *selected[i].second;
@@ -212,13 +196,9 @@ void TriggerObjectTableBParkProducer::produce(edm::Event &iEvent,
   tab->addColumn<float>("l1pt", l1pt, "pt of associated L1 seed", 8);
   tab->addColumn<int>("l1iso", l1iso, "iso of associated L1 seed");
   tab->addColumn<int>("l1charge", l1charge, "charge of associated L1 seed");
-  tab->addColumn<float>("l1pt_2", l1pt_2, "pt of associated secondary L1 seed",
-                        8);
-  tab->addColumn<float>(
-      "l2pt", l2pt, "pt of associated 'L2' seed (i.e. HLT before tracking/PF)",
-      10);
-  tab->addColumn<int>("filterBits", bits,
-                      "extra bits of associated information: " + bitsDoc_);
+  tab->addColumn<float>("l1pt_2", l1pt_2, "pt of associated secondary L1 seed", 8);
+  tab->addColumn<float>("l2pt", l2pt, "pt of associated 'L2' seed (i.e. HLT before tracking/PF)", 10);
+  tab->addColumn<int>("filterBits", bits, "extra bits of associated information: " + bitsDoc_);
   iEvent.put(std::move(tab));
 }
 
diff --git a/PhysicsTools/BPHNano/plugins/V0ReBuilder.cc b/PhysicsTools/BPHNano/plugins/V0ReBuilder.cc
index 993c85b97dec..ccc4db14f580 100644
--- a/PhysicsTools/BPHNano/plugins/V0ReBuilder.cc
+++ b/PhysicsTools/BPHNano/plugins/V0ReBuilder.cc
@@ -38,7 +38,7 @@
 
 class V0ReBuilder : public edm::global::EDProducer<> {
   // perhaps we need better structure here (begin run etc)
- public:
+public:
   typedef std::vector<reco::TransientTrack> TransientTrackCollection;
   typedef std::vector<reco::VertexCompositePtrCandidate> V0Collection;
 
@@ -48,11 +48,9 @@ class V0ReBuilder : public edm::global::EDProducer<> {
         pre_vtx_selection_{cfg.getParameter<std::string>("V0Selection")},
         post_vtx_selection_{cfg.getParameter<std::string>("postVtxSelection")},
         v0s_{consumes<V0Collection>(cfg.getParameter<edm::InputTag>("V0s"))},
-        beamspot_{consumes<reco::BeamSpot>(
-            cfg.getParameter<edm::InputTag>("beamSpot"))},
-        track_match_{
-            consumes<edm::Association<pat::CompositeCandidateCollection>>(
-                cfg.getParameter<edm::InputTag>("track_match"))},
+        beamspot_{consumes<reco::BeamSpot>(cfg.getParameter<edm::InputTag>("beamSpot"))},
+        track_match_{consumes<edm::Association<pat::CompositeCandidateCollection>>(
+            cfg.getParameter<edm::InputTag>("track_match"))},
         isLambda_{cfg.getParameter<bool>("isLambda")} {
     produces<pat::CompositeCandidateCollection>("SelectedV0Collection");
     produces<TransientTrackCollection>("SelectedV0TransientCollection");
@@ -60,26 +58,22 @@ class V0ReBuilder : public edm::global::EDProducer<> {
 
   ~V0ReBuilder() override {}
 
-  void produce(edm::StreamID, edm::Event &,
-               const edm::EventSetup &) const override;
+  void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override;
 
   static void fillDescriptions(edm::ConfigurationDescriptions &descriptions) {}
 
- private:
+private:
   const edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> theB_;
   const StringCutObjectSelector<pat::PackedCandidate> trk_selection_;
-  const StringCutObjectSelector<reco::VertexCompositePtrCandidate>
-      pre_vtx_selection_;
+  const StringCutObjectSelector<reco::VertexCompositePtrCandidate> pre_vtx_selection_;
   const StringCutObjectSelector<pat::CompositeCandidate> post_vtx_selection_;
   const edm::EDGetTokenT<V0Collection> v0s_;
   const edm::EDGetTokenT<reco::BeamSpot> beamspot_;
-  const edm::EDGetTokenT<edm::Association<pat::CompositeCandidateCollection>>
-      track_match_;
+  const edm::EDGetTokenT<edm::Association<pat::CompositeCandidateCollection>> track_match_;
   const bool isLambda_;
 };
 
-void V0ReBuilder::produce(edm::StreamID, edm::Event &evt,
-                          edm::EventSetup const &iSetup) const {
+void V0ReBuilder::produce(edm::StreamID, edm::Event &evt, edm::EventSetup const &iSetup) const {
   // input
   auto const theB = &iSetup.getData(theB_);
   edm::Handle<V0Collection> V0s;
@@ -90,45 +84,42 @@ void V0ReBuilder::produce(edm::StreamID, edm::Event &evt,
   auto &track_match = evt.get(track_match_);
 
   // output
-  std::unique_ptr<pat::CompositeCandidateCollection> ret_val(
-      new pat::CompositeCandidateCollection());
-  std::unique_ptr<TransientTrackCollection> trans_out(
-      new TransientTrackCollection);
+  std::unique_ptr<pat::CompositeCandidateCollection> ret_val(new pat::CompositeCandidateCollection());
+  std::unique_ptr<TransientTrackCollection> trans_out(new TransientTrackCollection);
 
   size_t v0_idx = 0;
-  for (reco::VertexCompositePtrCandidateCollection::const_iterator v0 =
-           V0s->begin();
-       v0 != V0s->end(); v0++) {
+  for (reco::VertexCompositePtrCandidateCollection::const_iterator v0 = V0s->begin(); v0 != V0s->end(); v0++) {
     reco::VertexCompositePtrCandidate V0 = V0s->at(v0_idx);
     v0_idx++;
 
     // selection on V0s
-    if (v0->numberOfDaughters() != 2) continue;
-    if (!pre_vtx_selection_(V0)) continue;
+    if (v0->numberOfDaughters() != 2)
+      continue;
+    if (!pre_vtx_selection_(V0))
+      continue;
 
-    pat::PackedCandidate v0daughter1 =
-        *(dynamic_cast<const pat::PackedCandidate *>(v0->daughter(0)));
-    pat::PackedCandidate v0daughter2 =
-        *(dynamic_cast<const pat::PackedCandidate *>(v0->daughter(1)));
+    pat::PackedCandidate v0daughter1 = *(dynamic_cast<const pat::PackedCandidate *>(v0->daughter(0)));
+    pat::PackedCandidate v0daughter2 = *(dynamic_cast<const pat::PackedCandidate *>(v0->daughter(1)));
 
-    if (!v0daughter1.hasTrackDetails()) continue;
-    if (!v0daughter2.hasTrackDetails()) continue;
+    if (!v0daughter1.hasTrackDetails())
+      continue;
+    if (!v0daughter2.hasTrackDetails())
+      continue;
 
     if (fabs(v0daughter1.pdgId()) != 211)
       continue;  // This cut do not affect the Lambda->proton pion candidates
     if (fabs(v0daughter2.pdgId()) != 211)
       continue;  // This cut do not affect the Lambda->proton pion candidates
 
-    if (!trk_selection_(v0daughter1) || !trk_selection_(v0daughter2)) continue;
+    if (!trk_selection_(v0daughter1) || !trk_selection_(v0daughter2))
+      continue;
 
-    reco::TransientTrack
-        v0daughter1_ttrack;  // 1st daughter, leading daughter to be assigned.
-                             // Proton mass will be assigned for the
-                             // Lambda->Proton Pion mode, Pion mass will be
-                             // assigned for the Kshort->PionPion mode.
-    reco::TransientTrack
-        v0daughter2_ttrack;  // 2nd daughter, subleading daughter to be
-                             // assigned. It hass always the pion mass
+    reco::TransientTrack v0daughter1_ttrack;  // 1st daughter, leading daughter to be assigned.
+                                              // Proton mass will be assigned for the
+                                              // Lambda->Proton Pion mode, Pion mass will be
+                                              // assigned for the Kshort->PionPion mode.
+    reco::TransientTrack v0daughter2_ttrack;  // 2nd daughter, subleading daughter to be
+                                              // assigned. It hass always the pion mass
 
     if (v0daughter1.p() > v0daughter2.p()) {
       v0daughter1_ttrack = theB->build(v0daughter1.bestTrack());
@@ -143,16 +134,14 @@ void V0ReBuilder::produce(edm::StreamID, edm::Event &evt,
     float Track2_mass = PI_MASS;
     float Track2_sigma = PI_SIGMA;
     // create V0 vertex
-    KinVtxFitter fitter({v0daughter1_ttrack, v0daughter2_ttrack},
-                        {Track1_mass, Track2_mass},
-                        {Track1_sigma, Track2_sigma});
+    KinVtxFitter fitter(
+        {v0daughter1_ttrack, v0daughter2_ttrack}, {Track1_mass, Track2_mass}, {Track1_sigma, Track2_sigma});
 
-    if (!fitter.success()) continue;
+    if (!fitter.success())
+      continue;
 
     pat::CompositeCandidate cand;
-    cand.setVertex(reco::Candidate::Point(fitter.fitted_vtx().x(),
-                                          fitter.fitted_vtx().y(),
-                                          fitter.fitted_vtx().z()));
+    cand.setVertex(reco::Candidate::Point(fitter.fitted_vtx().x(), fitter.fitted_vtx().y(), fitter.fitted_vtx().z()));
     auto fit_p4 = fitter.fitted_p4();
     cand.setP4(fit_p4);
 
@@ -160,19 +149,15 @@ void V0ReBuilder::produce(edm::StreamID, edm::Event &evt,
     cand.addUserFloat("sv_chi2", fitter.chi2());
     cand.addUserFloat("sv_prob", fitter.prob());
     cand.addUserFloat("fitted_mass", fitter.fitted_candidate().mass());
-    cand.addUserFloat(
-        "massErr",
-        sqrt(fitter.fitted_candidate().kinematicParametersError().matrix()(6,
-                                                                           6)));
-    cand.addUserFloat("cos_theta_2D",
-                      cos_theta_2D(fitter, *beamspot, cand.p4()));
-    cand.addUserFloat("fitted_cos_theta_2D",
-                      cos_theta_2D(fitter, *beamspot, fit_p4));
+    cand.addUserFloat("massErr", sqrt(fitter.fitted_candidate().kinematicParametersError().matrix()(6, 6)));
+    cand.addUserFloat("cos_theta_2D", cos_theta_2D(fitter, *beamspot, cand.p4()));
+    cand.addUserFloat("fitted_cos_theta_2D", cos_theta_2D(fitter, *beamspot, fit_p4));
     auto lxy = l_xy(fitter, *beamspot);
     cand.addUserFloat("l_xy", lxy.value());
     cand.addUserFloat("l_xy_unc", lxy.error());
 
-    if (!post_vtx_selection_(cand)) continue;
+    if (!post_vtx_selection_(cand))
+      continue;
 
     cand.addUserFloat("vtx_x", cand.vx());
     cand.addUserFloat("vtx_y", cand.vy());
diff --git a/PhysicsTools/BPHNano/plugins/helper.h b/PhysicsTools/BPHNano/plugins/helper.h
index 2c89507253d9..ed86a56a4429 100644
--- a/PhysicsTools/BPHNano/plugins/helper.h
+++ b/PhysicsTools/BPHNano/plugins/helper.h
@@ -36,8 +36,7 @@ constexpr float PROT_SIGMA = 0.000016;
 constexpr float MUON_MASS = 0.10565837;
 constexpr float ELECTRON_MASS = 0.000511;
 
-inline std::pair<float, float> min_max_dr(
-    const std::vector<edm::Ptr<reco::Candidate>>& cands) {
+inline std::pair<float, float> min_max_dr(const std::vector<edm::Ptr<reco::Candidate>>& cands) {
   float min_dr = std::numeric_limits<float>::max();
   float max_dr = 0.;
   for (size_t i = 0; i < cands.size(); ++i) {
@@ -51,9 +50,9 @@ inline std::pair<float, float> min_max_dr(
 }
 
 template <typename FITTER, typename LORENTZ_VEC>
-inline double cos_theta_2D(const FITTER& fitter, const reco::BeamSpot& bs,
-                           const LORENTZ_VEC& p4) {
-  if (!fitter.success()) return -2;
+inline double cos_theta_2D(const FITTER& fitter, const reco::BeamSpot& bs, const LORENTZ_VEC& p4) {
+  if (!fitter.success())
+    return -2;
   GlobalPoint point = fitter.fitted_vtx();
   auto bs_pos = bs.position(point.z());
   math::XYZVector delta(point.x() - bs_pos.x(), point.y() - bs_pos.y(), 0.);
@@ -64,7 +63,8 @@ inline double cos_theta_2D(const FITTER& fitter, const reco::BeamSpot& bs,
 
 template <typename FITTER>
 inline Measurement1D l_xy(const FITTER& fitter, const reco::BeamSpot& bs) {
-  if (!fitter.success()) return {-2, -2};
+  if (!fitter.success())
+    return {-2, -2};
   GlobalPoint point = fitter.fitted_vtx();
   GlobalError err = fitter.fitted_vtx_uncertainty();
   auto bs_pos = bs.position(point.z());
@@ -82,23 +82,18 @@ bm.dxdz()), -1*( (bm.y0()-Bvtx.y()) + (Bvtx.z()-bm.z0()) * bm.dydz()), 0);
 }
 */
 
-inline float CosA(
-    GlobalPoint& dist,
-    ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>& Bp4) {
+inline float CosA(GlobalPoint& dist, ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double>>& Bp4) {
   math::XYZVector vperp(dist.x(), dist.y(), 0);
   math::XYZVector pperp(Bp4.Px(), Bp4.Py(), 0);
   return vperp.Dot(pperp) / (vperp.R() * pperp.R());
 }
 
-inline std::pair<double, double> computeDCA(const reco::TransientTrack& trackTT,
-                                            const reco::BeamSpot& beamSpot) {
+inline std::pair<double, double> computeDCA(const reco::TransientTrack& trackTT, const reco::BeamSpot& beamSpot) {
   double DCABS = -1.;
   double DCABSErr = -1.;
 
-  TrajectoryStateClosestToPoint theDCAXBS =
-      trackTT.trajectoryStateClosestToPoint(
-          GlobalPoint(beamSpot.position().x(), beamSpot.position().y(),
-                      beamSpot.position().z()));
+  TrajectoryStateClosestToPoint theDCAXBS = trackTT.trajectoryStateClosestToPoint(
+      GlobalPoint(beamSpot.position().x(), beamSpot.position().y(), beamSpot.position().z()));
   if (theDCAXBS.isValid()) {
     DCABS = theDCAXBS.perigeeParameters().transverseImpactParameter();
     DCABSErr = theDCAXBS.perigeeError().transverseImpactParameterError();
@@ -107,11 +102,9 @@ inline std::pair<double, double> computeDCA(const reco::TransientTrack& trackTT,
   return std::make_pair(DCABS, DCABSErr);
 }
 
-inline bool track_to_lepton_match(edm::Ptr<reco::Candidate> l_ptr,
-                                  auto iso_tracks_id, unsigned int iTrk) {
+inline bool track_to_lepton_match(edm::Ptr<reco::Candidate> l_ptr, auto iso_tracks_id, unsigned int iTrk) {
   for (unsigned int i = 0; i < l_ptr->numberOfSourceCandidatePtrs(); ++i) {
-    if (!((l_ptr->sourceCandidatePtr(i)).isNonnull() &&
-          (l_ptr->sourceCandidatePtr(i)).isAvailable()))
+    if (!((l_ptr->sourceCandidatePtr(i)).isNonnull() && (l_ptr->sourceCandidatePtr(i)).isAvailable()))
       continue;
     const edm::Ptr<reco::Candidate>& source = l_ptr->sourceCandidatePtr(i);
     if (source.id() == iso_tracks_id && source.key() == iTrk) {
@@ -121,43 +114,42 @@ inline bool track_to_lepton_match(edm::Ptr<reco::Candidate> l_ptr,
   return false;
 }
 
-inline std::pair<bool, Measurement1D> absoluteImpactParameter(
-    const TrajectoryStateOnSurface& tsos, RefCountedKinematicVertex vertex,
-    VertexDistance& distanceComputer) {
+inline std::pair<bool, Measurement1D> absoluteImpactParameter(const TrajectoryStateOnSurface& tsos,
+                                                              RefCountedKinematicVertex vertex,
+                                                              VertexDistance& distanceComputer) {
   if (!tsos.isValid()) {
     return std::pair<bool, Measurement1D>(false, Measurement1D(0., 0.));
   }
   GlobalPoint refPoint = tsos.globalPosition();
   GlobalError refPointErr = tsos.cartesianError().position();
   GlobalPoint vertexPosition = vertex->vertexState().position();
-  GlobalError vertexPositionErr =
-      RecoVertex::convertError(vertex->vertexState().error());
+  GlobalError vertexPositionErr = RecoVertex::convertError(vertex->vertexState().error());
   return std::pair<bool, Measurement1D>(
       true,
-      distanceComputer.distance(VertexState(vertexPosition, vertexPositionErr),
-                                VertexState(refPoint, refPointErr)));
+      distanceComputer.distance(VertexState(vertexPosition, vertexPositionErr), VertexState(refPoint, refPointErr)));
 }
 
-inline std::pair<bool, Measurement1D> absoluteImpactParameter3D(
-    const TrajectoryStateOnSurface& tsos, RefCountedKinematicVertex vertex) {
+inline std::pair<bool, Measurement1D> absoluteImpactParameter3D(const TrajectoryStateOnSurface& tsos,
+                                                                RefCountedKinematicVertex vertex) {
   VertexDistance3D dist;
   return absoluteImpactParameter(tsos, vertex, dist);
 }
 
-inline std::pair<bool, Measurement1D> absoluteTransverseImpactParameter(
-    const TrajectoryStateOnSurface& tsos, RefCountedKinematicVertex vertex) {
+inline std::pair<bool, Measurement1D> absoluteTransverseImpactParameter(const TrajectoryStateOnSurface& tsos,
+                                                                        RefCountedKinematicVertex vertex) {
   VertexDistanceXY dist;
   return absoluteImpactParameter(tsos, vertex, dist);
 }
 
-inline std::pair<bool, Measurement1D> signedImpactParameter3D(
-    const TrajectoryStateOnSurface& tsos, RefCountedKinematicVertex vertex,
-    const reco::BeamSpot& bs, double pv_z) {
+inline std::pair<bool, Measurement1D> signedImpactParameter3D(const TrajectoryStateOnSurface& tsos,
+                                                              RefCountedKinematicVertex vertex,
+                                                              const reco::BeamSpot& bs,
+                                                              double pv_z) {
   VertexDistance3D dist;
 
-  std::pair<bool, Measurement1D> result =
-      absoluteImpactParameter(tsos, vertex, dist);
-  if (!result.first) return result;
+  std::pair<bool, Measurement1D> result = absoluteImpactParameter(tsos, vertex, dist);
+  if (!result.first)
+    return result;
 
   // Compute Sign
   auto bs_pos = bs.position(vertex->vertexState().position().z());
@@ -174,19 +166,18 @@ inline std::pair<bool, Measurement1D> signedImpactParameter3D(
   double sign = (prod >= 0) ? 1. : -1.;
 
   // Apply sign to the result
-  return std::pair<bool, Measurement1D>(
-      result.first,
-      Measurement1D(sign * result.second.value(), result.second.error()));
+  return std::pair<bool, Measurement1D>(result.first,
+                                        Measurement1D(sign * result.second.value(), result.second.error()));
 }
 
-inline std::pair<bool, Measurement1D> signedTransverseImpactParameter(
-    const TrajectoryStateOnSurface& tsos, RefCountedKinematicVertex vertex,
-    const reco::BeamSpot& bs) {
+inline std::pair<bool, Measurement1D> signedTransverseImpactParameter(const TrajectoryStateOnSurface& tsos,
+                                                                      RefCountedKinematicVertex vertex,
+                                                                      const reco::BeamSpot& bs) {
   VertexDistanceXY dist;
 
-  std::pair<bool, Measurement1D> result =
-      absoluteImpactParameter(tsos, vertex, dist);
-  if (!result.first) return result;
+  std::pair<bool, Measurement1D> result = absoluteImpactParameter(tsos, vertex, dist);
+  if (!result.first)
+    return result;
 
   // Compute Sign
   auto bs_pos = bs.position(vertex->vertexState().position().z());
@@ -194,29 +185,30 @@ inline std::pair<bool, Measurement1D> signedTransverseImpactParameter(
   GlobalVector IPVec(impactPoint.x() - vertex->vertexState().position().x(),
                      impactPoint.y() - vertex->vertexState().position().y(),
                      0.);
-  GlobalVector direction(vertex->vertexState().position().x() - bs_pos.x(),
-                         vertex->vertexState().position().y() - bs_pos.y(), 0);
+  GlobalVector direction(
+      vertex->vertexState().position().x() - bs_pos.x(), vertex->vertexState().position().y() - bs_pos.y(), 0);
 
   double prod = IPVec.dot(direction);
   double sign = (prod >= 0) ? 1. : -1.;
 
   // Apply sign to the result
-  return std::pair<bool, Measurement1D>(
-      result.first,
-      Measurement1D(sign * result.second.value(), result.second.error()));
+  return std::pair<bool, Measurement1D>(result.first,
+                                        Measurement1D(sign * result.second.value(), result.second.error()));
 }
 
-inline std::vector<float> TrackerIsolation(
-    edm::Handle<pat::CompositeCandidateCollection>& tracks,
-    pat::CompositeCandidate& B, std::vector<std::string>& dnames) {
+inline std::vector<float> TrackerIsolation(edm::Handle<pat::CompositeCandidateCollection>& tracks,
+                                           pat::CompositeCandidate& B,
+                                           std::vector<std::string>& dnames) {
   std::vector<float> iso(dnames.size(), 0);
   for (size_t k_idx = 0; k_idx < tracks->size(); ++k_idx) {
     edm::Ptr<pat::CompositeCandidate> trk_ptr(tracks, k_idx);
     for (size_t iname = 0; iname < dnames.size(); ++iname) {
       float dr = deltaR(B.userFloat("fitted_" + dnames[iname] + "_eta"),
                         B.userFloat("fitted_" + dnames[iname] + "_phi"),
-                        trk_ptr->eta(), trk_ptr->phi());
-      if (dr > 0 && dr < 0.4) iso[iname] += trk_ptr->pt();
+                        trk_ptr->eta(),
+                        trk_ptr->phi());
+      if (dr > 0 && dr < 0.4)
+        iso[iname] += trk_ptr->pt();
     }
   }
   return iso;
