CMS 3D CMS Logo

PFAlgo3.h
Go to the documentation of this file.
1 #ifndef L1Trigger_Phase2L1ParticleFlow_PFAlgo3_h
2 #define L1Trigger_Phase2L1ParticleFlow_PFAlgo3_h
3 
5 
6 namespace l1tpf_impl {
7  class PFAlgo3 : public PFAlgoBase {
8  public:
9  PFAlgo3(const edm::ParameterSet &);
10  void runPF(Region &r) const override;
11 
12  protected:
13  float drMatchMu_;
17  enum class TkCaloLinkMetric { BestByDR = 0, BestByDRPt = 1, BestByDR2Pt2 = 2 };
25  unsigned int tightTrackMinStubs_;
29 
31  void link_tk2mu(Region &r, std::vector<int> &tk2mu, std::vector<int> &mu2tk) const;
32 
34  // tk2em[itrack] = iem, or -1 if unmatched
35  void link_tk2em(Region &r, std::vector<int> &tk2em) const;
36 
38  // em2calo[iem] = icalo or -1
39  void link_em2calo(Region &r, std::vector<int> &em2calo) const;
40 
42  void sum_tk2em(Region &r,
43  const std::vector<int> &tk2em,
44  std::vector<int> &em2ntk,
45  std::vector<float> &em2sumtkpt,
46  std::vector<float> &em2sumtkpterr) const;
47 
49  void emcalo_algo(Region &r,
50  const std::vector<int> &em2ntk,
51  const std::vector<float> &em2sumtkpt,
52  const std::vector<float> &em2sumtkpterr) const;
53 
55  void emtk_algo(Region &r,
56  const std::vector<int> &tk2em,
57  const std::vector<int> &em2ntk,
58  const std::vector<float> &em2sumtkpterr) const;
59 
61  void sub_em2calo(Region &r, const std::vector<int> &em2calo) const;
62 
64  // tk2calo[itk] = icalo or -1
65  void link_tk2calo(Region &r, std::vector<int> &tk2calo) const;
66 
68  void sum_tk2calo(Region &r,
69  const std::vector<int> &tk2calo,
70  std::vector<int> &calo2ntk,
71  std::vector<float> &calo2sumtkpt,
72  std::vector<float> &calo2sumtkpterr) const;
73 
75  void unlinkedtk_algo(Region &r, const std::vector<int> &tk2calo) const;
76 
78  // take hadrons that are not track matched, close by a hadron which has an excess of track pt vs calo pt
79  // add this pt to the calo pt of the other cluster
80  // off by default, as it seems to not do much in jets even if it helps remove tails in single-pion events
81  void calo_relink(Region &r,
82  const std::vector<int> &calo2ntk,
83  const std::vector<float> &calo2sumtkpt,
84  const std::vector<float> &calo2sumtkpterr) const;
85 
87  // alpha[icalo] = x < 1 if all tracks linked to icalo must have their pt rescaled by x
88  void linkedcalo_algo(Region &r,
89  const std::vector<int> &calo2ntk,
90  const std::vector<float> &calo2sumtkpt,
91  const std::vector<float> &calo2sumtkpterr,
92  std::vector<float> &calo2alpha) const;
93 
95  void linkedtk_algo(Region &r,
96  const std::vector<int> &tk2calo,
97  const std::vector<int> &calo2ntk,
98  const std::vector<float> &calo2alpha) const;
99 
101  void unlinkedcalo_algo(Region &r) const;
102 
104  void save_muons(Region &r, const std::vector<int> &tk2mu) const;
105  };
106 
107 } // namespace l1tpf_impl
108 
109 #endif
l1tpf_impl::PFAlgo3::emCaloUseAlsoCaloSigma_
bool emCaloUseAlsoCaloSigma_
Definition: PFAlgo3.h:23
l1tpf_impl::PFAlgo3::GoodTK_Calo_TkPt
Definition: PFAlgo3.h:27
l1tpf_impl::PFAlgo3::tightTrackMaxChi2_
float tightTrackMaxChi2_
Definition: PFAlgo3.h:26
l1tpf_impl::PFAlgo3::emHadSubtractionPtSlope_
float emHadSubtractionPtSlope_
Definition: PFAlgo3.h:19
l1tpf_impl::PFAlgo3::ptMinFracMatchEm_
float ptMinFracMatchEm_
Definition: PFAlgo3.h:18
l1tpf_impl::PFAlgo3::TkCaloLinkMetric::BestByDR2Pt2
l1tpf_impl
Definition: BitwisePFAlgo.h:8
l1tpf_impl::PFAlgo3::drMatch_
float drMatch_
Definition: PFAlgo3.h:15
l1tpf_impl::PFAlgo3::MuMatchMode::BoxBestByPtRatio
l1tpf_impl::PFAlgo3::TkCaloLinkMetric::BestByDRPt
l1tpf_impl::PFAlgo3::tightTrackMaxInvisiblePt_
float tightTrackMaxInvisiblePt_
Definition: PFAlgo3.h:26
l1tpf_impl::PFAlgo3::GoodTk_Calo_CaloPt
Definition: PFAlgo3.h:27
l1tpf_impl::PFAlgo3::rescaleTracks_
bool rescaleTracks_
Definition: PFAlgo3.h:23
l1tpf_impl::PFAlgo3::BadTrackStatus
BadTrackStatus
Definition: PFAlgo3.h:28
l1tpf_impl::PFAlgo3::trackEmUseAlsoTrackSigma_
bool trackEmUseAlsoTrackSigma_
Definition: PFAlgo3.h:23
l1tpf_impl::PFAlgo3::muMatchMode_
enum l1tpf_impl::PFAlgo3::MuMatchMode muMatchMode_
l1tpf_impl::PFAlgo3::tightTrackMinStubs_
unsigned int tightTrackMinStubs_
Definition: PFAlgo3.h:25
l1tpf_impl::PFAlgo3::tkCaloLinkMetric_
TkCaloLinkMetric tkCaloLinkMetric_
Definition: PFAlgo3.h:20
l1tpf_impl::PFAlgo3::emcalo_algo
void emcalo_algo(Region &r, const std::vector< int > &em2ntk, const std::vector< float > &em2sumtkpt, const std::vector< float > &em2sumtkpterr) const
process ecal clusters after linking
Definition: PFAlgo3.cc:376
l1tpf_impl::PFAlgo3::caloReLinkStep_
bool caloReLinkStep_
Definition: PFAlgo3.h:21
l1tpf_impl::PFAlgo3::caloTrkWeightedAverage_
bool caloTrkWeightedAverage_
Definition: PFAlgo3.h:16
PFAlgoBase.h
l1tpf_impl::PFAlgo3::ecalPriority_
bool ecalPriority_
Definition: PFAlgo3.h:23
l1tpf_impl::PFAlgo3::sumTkCaloErr2_
bool sumTkCaloErr2_
Definition: PFAlgo3.h:23
l1tpf_impl::PFAlgo3::drMatchMu_
float drMatchMu_
Definition: PFAlgo3.h:13
l1tpf_impl::PFAlgo3::unlinkedtk_algo
void unlinkedtk_algo(Region &r, const std::vector< int > &tk2calo) const
promote unlinked low pt tracks to hadrons
Definition: PFAlgo3.cc:650
l1tpf_impl::PFAlgo3::rescaleUnmatchedTrack_
bool rescaleUnmatchedTrack_
Definition: PFAlgo3.h:16
l1tpf_impl::PFAlgo3::maxInvisiblePt_
float maxInvisiblePt_
Definition: PFAlgo3.h:15
l1tpf_impl::PFAlgo3::GoodTrackStatus
GoodTrackStatus
Definition: PFAlgo3.h:27
l1tpf_impl::PFAlgo3::link_tk2em
void link_tk2em(Region &r, std::vector< int > &tk2em) const
match all tracks to the closest EM cluster
Definition: PFAlgo3.cc:303
l1tpf_impl::PFAlgo3::sum_tk2calo
void sum_tk2calo(Region &r, const std::vector< int > &tk2calo, std::vector< int > &calo2ntk, std::vector< float > &calo2sumtkpt, std::vector< float > &calo2sumtkpterr) const
for each calo, compute the sum of the track pt
Definition: PFAlgo3.cc:625
l1tpf_impl::PFAlgo3::unlinkedcalo_algo
void unlinkedcalo_algo(Region &r) const
process unmatched calo clusters
Definition: PFAlgo3.cc:890
l1tpf_impl::PFAlgo3::link_em2calo
void link_em2calo(Region &r, std::vector< int > &em2calo) const
match all em to the closest had (can happen in parallel to the above)
Definition: PFAlgo3.cc:327
l1tpf_impl::PFAlgo3::drMatchEmHad_
float drMatchEmHad_
Definition: PFAlgo3.h:18
l1tpf_impl::Region
Definition: Region.h:8
edm::ParameterSet
Definition: ParameterSet.h:36
l1tpf_impl::PFAlgo3::useTrackCaloSigma_
bool useTrackCaloSigma_
Definition: PFAlgo3.h:16
l1tpf_impl::PFAlgo3::trackEmMayUseCaloMomenta_
bool trackEmMayUseCaloMomenta_
Definition: PFAlgo3.h:23
l1tpf_impl::PFAlgo3::save_muons
void save_muons(Region &r, const std::vector< int > &tk2mu) const
save muons in output list
Definition: PFAlgo3.cc:901
l1tpf_impl::PFAlgo3::linkedcalo_algo
void linkedcalo_algo(Region &r, const std::vector< int > &calo2ntk, const std::vector< float > &calo2sumtkpt, const std::vector< float > &calo2sumtkpterr, std::vector< float > &calo2alpha) const
process matched calo clusters, compare energy to sum track pt, compute track rescaling factor if need...
Definition: PFAlgo3.cc:736
l1tpf_impl::PFAlgo3::drMatchEm_
float drMatchEm_
Definition: PFAlgo3.h:18
l1tpf_impl::PFAlgo3::PFAlgo3
PFAlgo3(const edm::ParameterSet &)
Definition: PFAlgo3.cc:19
l1tpf_impl::PFAlgo3::MuMatchMode::DrBestByPtDiff
l1tpf_impl::PFAlgo3::GoodTK_NoCalo
Definition: PFAlgo3.h:27
l1tpf_impl::PFAlgo3::link_tk2mu
void link_tk2mu(Region &r, std::vector< int > &tk2mu, std::vector< int > &mu2tk) const
do muon track linking (also sets track.muonLink)
Definition: PFAlgo3.cc:216
l1tpf_impl::PFAlgo3::caloReLinkThreshold_
float caloReLinkThreshold_
Definition: PFAlgo3.h:22
l1tpf_impl::PFAlgo3::calo_relink
void calo_relink(Region &r, const std::vector< int > &calo2ntk, const std::vector< float > &calo2sumtkpt, const std::vector< float > &calo2sumtkpterr) const
try to recover split hadron showers (v1.0):
Definition: PFAlgo3.cc:672
l1tpf_impl::PFAlgoBase
Definition: PFAlgoBase.h:11
l1tpf_impl::PFAlgo3::BadTK_NoCalo
Definition: PFAlgo3.h:28
l1tpf_impl::PFAlgo3::TkCaloLinkMetric
TkCaloLinkMetric
Definition: PFAlgo3.h:17
alignCSCRings.r
r
Definition: alignCSCRings.py:93
l1tpf_impl::PFAlgo3::TkCaloLinkMetric::BestByDR
l1tpf_impl::PFAlgo3::runPF
void runPF(Region &r) const override
Definition: PFAlgo3.cc:69
l1tpf_impl::PFAlgo3::MuMatchMode
MuMatchMode
Definition: PFAlgo3.h:14
l1tpf_impl::PFAlgo3::sub_em2calo
void sub_em2calo(Region &r, const std::vector< int > &em2calo) const
subtract EM component from Calo clusters for all photons and electrons (within tracker coverage)
Definition: PFAlgo3.cc:476
l1tpf_impl::PFAlgo3::ptMatchLow_
float ptMatchLow_
Definition: PFAlgo3.h:15
l1tpf_impl::PFAlgo3::ptMatchHigh_
float ptMatchHigh_
Definition: PFAlgo3.h:15
l1tpf_impl::PFAlgo3::MuMatchMode::DrBestByPtRatio
l1tpf_impl::PFAlgo3
Definition: PFAlgo3.h:7
l1tpf_impl::PFAlgo3::emtk_algo
void emtk_algo(Region &r, const std::vector< int > &tk2em, const std::vector< int > &em2ntk, const std::vector< float > &em2sumtkpterr) const
promote all flagged tracks to electrons
Definition: PFAlgo3.cc:444
l1tpf_impl::PFAlgo3::link_tk2calo
void link_tk2calo(Region &r, std::vector< int > &tk2calo) const
track to calo matching
Definition: PFAlgo3.cc:538
l1tpf_impl::PFAlgo3::caloReLinkDr_
float caloReLinkDr_
Definition: PFAlgo3.h:22
l1tpf_impl::PFAlgo3::linkedtk_algo
void linkedtk_algo(Region &r, const std::vector< int > &tk2calo, const std::vector< int > &calo2ntk, const std::vector< float > &calo2alpha) const
process matched tracks, if necessary rescale or average
Definition: PFAlgo3.cc:828
l1tpf_impl::PFAlgo3::sum_tk2em
void sum_tk2em(Region &r, const std::vector< int > &tk2em, std::vector< int > &em2ntk, std::vector< float > &em2sumtkpt, std::vector< float > &em2sumtkpterr) const
for each EM cluster, count and add up the pt of all the corresponding tracks (skipping muons)
Definition: PFAlgo3.cc:353
l1tpf_impl::PFAlgo3::GoodTK_Calo_TkCaloPt
Definition: PFAlgo3.h:27