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
void link_tk2em(Region &r, std::vector< int > &tk2em) const
match all tracks to the closest EM cluster
Definition: PFAlgo3.cc:303
bool useTrackCaloSigma_
Definition: PFAlgo3.h:16
void unlinkedcalo_algo(Region &r) const
process unmatched calo clusters
Definition: PFAlgo3.cc:890
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
float caloReLinkThreshold_
Definition: PFAlgo3.h:22
bool trackEmMayUseCaloMomenta_
Definition: PFAlgo3.h:23
void save_muons(Region &r, const std::vector< int > &tk2mu) const
save muons in output list
Definition: PFAlgo3.cc:901
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
PFAlgo3(const edm::ParameterSet &)
Definition: PFAlgo3.cc:19
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
void runPF(Region &r) const override
Definition: PFAlgo3.cc:69
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
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
float caloReLinkDr_
Definition: PFAlgo3.h:22
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
void link_tk2calo(Region &r, std::vector< int > &tk2calo) const
track to calo matching
Definition: PFAlgo3.cc:538
float ptMatchHigh_
Definition: PFAlgo3.h:15
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
bool emCaloUseAlsoCaloSigma_
Definition: PFAlgo3.h:23
float emHadSubtractionPtSlope_
Definition: PFAlgo3.h:19
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
float tightTrackMaxInvisiblePt_
Definition: PFAlgo3.h:26
float tightTrackMaxChi2_
Definition: PFAlgo3.h:26
float ptMinFracMatchEm_
Definition: PFAlgo3.h:18
bool trackEmUseAlsoTrackSigma_
Definition: PFAlgo3.h:23
enum l1tpf_impl::PFAlgo3::MuMatchMode muMatchMode_
bool caloReLinkStep_
Definition: PFAlgo3.h:21
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
unsigned int tightTrackMinStubs_
Definition: PFAlgo3.h:25
TkCaloLinkMetric tkCaloLinkMetric_
Definition: PFAlgo3.h:20
bool rescaleUnmatchedTrack_
Definition: PFAlgo3.h:16
float maxInvisiblePt_
Definition: PFAlgo3.h:15
bool caloTrkWeightedAverage_
Definition: PFAlgo3.h:16
void unlinkedtk_algo(Region &r, const std::vector< int > &tk2calo) const
promote unlinked low pt tracks to hadrons
Definition: PFAlgo3.cc:650
float drMatchEmHad_
Definition: PFAlgo3.h:18
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