CMS 3D CMS Logo

CaloCrystalCluster.h
Go to the documentation of this file.
1 #ifndef DataFormats_L1TCalorimeterPhase2_CaloCrystalsCluster_h
2 #define DataFormats_L1TCalorimeterPhase2_CaloCrystalsCluster_h
3 
4 #include <ap_int.h>
5 #include <vector>
6 #include <map>
7 #include <string>
8 #include <algorithm>
11 
12 namespace l1tp2 {
13 
15  public:
17  : l1t::L1Candidate(),
18  calibratedPt_(0.),
19  hovere_(0.),
20  iso_(0.),
21  puCorrPt_(0.),
22  bremStrength_(0.),
23  e2x2_(0.),
24  e2x5_(0.),
25  e3x5_(0.),
26  e5x5_(0.),
27  standaloneWP_(0.),
28  electronWP98_(0.),
29  photonWP80_(0.),
30  electronWP90_(0.),
32  stage2effMatch_(0.){};
33 
35  float calibratedPt,
36  float hovere,
37  float iso,
39  float puCorrPt = 0.,
40  float bremStrength = 0.,
41  float e2x2 = 0.,
42  float e2x5 = 0.,
43  float e3x5 = 0.,
44  float e5x5 = 0.,
45  bool standaloneWP = false,
46  bool electronWP98 = false,
47  bool photonWP80 = false,
48  bool electronWP90 = false,
49  bool looseL1TkMatchWP = false,
50  bool stage2effMatch = false)
51  : l1t::L1Candidate(p4),
53  hovere_(hovere),
54  iso_(iso),
58  e2x2_(e2x2),
59  e2x5_(e2x5),
60  e3x5_(e3x5),
61  e5x5_(e5x5),
68 
69  ~CaloCrystalCluster() override{};
70  inline float calibratedPt() const { return calibratedPt_; };
71  inline float hovere() const { return hovere_; };
72  inline float isolation() const { return iso_; };
73  inline float puCorrPt() const { return puCorrPt_; };
74  inline float bremStrength() const { return bremStrength_; };
75  inline DetId seedCrystal() const { return seedCrystal_; };
76  void setCrystalPtInfo(std::vector<float> info) {
77  std::sort(info.begin(), info.end());
78  std::reverse(info.begin(), info.end());
80  };
81  void setExperimentalParams(const std::map<std::string, float> &params) { experimentalParams_ = params; };
82  const std::map<std::string, float> &getExperimentalParams() const { return experimentalParams_; };
83  inline float experimentalParam(const std::string &name) const {
84  auto iter = experimentalParams_.find(name);
85  if (iter != experimentalParams_.end()) {
86  return iter->second;
87  } else {
89  return -99.;
90  }
91  };
92 
93  inline float e2x2() const { return e2x2_; };
94  inline float e2x5() const { return e2x5_; };
95  inline float e3x5() const { return e3x5_; };
96  inline float e5x5() const { return e5x5_; };
97  inline float standaloneWP() const { return standaloneWP_; };
98  inline float electronWP98() const { return electronWP98_; };
99  inline float photonWP80() const { return photonWP80_; };
100  inline float electronWP90() const { return electronWP90_; };
101  inline float looseL1TkMatchWP() const { return looseL1TkMatchWP_; };
102  inline float stage2effMatch() const { return stage2effMatch_; };
103 
104  // The index range depends on the algorithm eta,phi window, currently 3x5
105  // The pt should always be ordered.
106  inline float crystalPt(unsigned int index) const { return (index < crystalPt_.size()) ? crystalPt_[index] : 0.; };
107 
108  private:
109  static void warningNoMapping(const std::string &name);
110  // pT calibrated to Stage-2 (Phase-I) L1EG Objects. NOTE
111  // all working points are defined with respect to cluster.pt(),
112  // not cluster.calibratedPt()
114  // HCal energy in region behind cluster (for size, look in producer) / ECal energy in cluster
115  float hovere_;
116  // ECal isolation (for outer window size, again look in producer)
117  float iso_;
118  // DetId of seed crystal used to make cluster (could be EBDetId or EEDetId)
120  // Pileup-corrected energy deposit, not studied carefully yet, don't use
121  float puCorrPt_;
122  // Bremstrahlung strength, should be proportional to the likelihood of a brem.
124  // Shower shape variable - max 2x2 energy containing seed crystal
125  float e2x2_;
126  // Shower shape variable - max 2x5 energy containing seed crystal, phi centered
127  float e2x5_;
128  // Shower shape variable - 3x5 energy containing seed crystal, phi centered
129  float e3x5_;
130  // Shower shape variable - 5x5 energy containing centered on seed crystal
131  float e5x5_;
132  // Standalone L1EG WP
134  // 98% efficient electron WP, for electrons above 35 GeV
136  // 80% efficient photon WP, for photons above 35 GeV
138  // 90% efficient electron based WP, early rise to efficiency plateau
140  // loose isolation and shower shape requirements to be used in conjunction with L1Trk matching
142  // Stage-2 L1EG efficiency matched WP, for rate comparisons
144  // Crystal pt (in order of strength) for all crystals in the cluster
145  std::vector<float> crystalPt_;
146  // For investigating novel algorithm parameters
147  std::map<std::string, float> experimentalParams_;
148  };
149 
150  // Concrete collection of output objects (with extra tuning information)
151  typedef std::vector<l1tp2::CaloCrystalCluster> CaloCrystalClusterCollection;
152 } // namespace l1tp2
153 #endif
static const TGPicture * info(bool iBackgroundIsBlack)
std::map< std::string, float > experimentalParams_
delete x;
Definition: CaloConfig.h:22
const LorentzVector & p4() const final
four-momentum Lorentz vector
std::vector< float > crystalPt_
CaloCrystalCluster(const PolarLorentzVector &p4, float calibratedPt, float hovere, float iso, DetId seedCrystal, float puCorrPt=0., float bremStrength=0., float e2x2=0., float e2x5=0., float e3x5=0., float e5x5=0., bool standaloneWP=false, bool electronWP98=false, bool photonWP80=false, bool electronWP90=false, bool looseL1TkMatchWP=false, bool stage2effMatch=false)
float crystalPt(unsigned int index) const
const std::map< std::string, float > & getExperimentalParams() const
Definition: DetId.h:17
unsigned int index
index type
Definition: Candidate.h:50
std::vector< l1tp2::CaloCrystalCluster > CaloCrystalClusterCollection
float experimentalParam(const std::string &name) const
void setExperimentalParams(const std::map< std::string, float > &params)
static void warningNoMapping(const std::string &name)
def move(src, dest)
Definition: eostools.py:511
void setCrystalPtInfo(std::vector< float > info)
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38