CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Calibratable.h
Go to the documentation of this file.
1 #ifndef CALIBRATABLE_H_
2 #define CALIBRATABLE_H_
3 
4 //#include <boost/shared_ptr.hpp>
5 
6 #include <vector>
7 #include <iostream>
8 
14 
15 namespace pftools {
16 
25 public:
27  reset();
28  }
29 
30  CalibratableElement(double energy, double eta, double phi, int layer,
31  double extent = 0.0, double time = 0.0) :
32  energy_(energy), eta_(eta), phi_(phi), time_(time), layer_(layer), extent_(extent) {
33  }
34 
35  double energy_, eta_, phi_, time_;
36  int layer_;
37 
38  //RMS of deltaR of hits in the cluster to its centre
39  double extent_;
40 
41  void reset() {
42  energy_ = 0.0;
43  eta_ = 0.0;
44  phi_ = 0.0;
45  layer_ = 0;
46  extent_ = 0.0;
47  time_ = 0.0;
48  }
49  bool operator<(const CalibratableElement& em) const {
50  if (em.energy_ < energy_)
51  return true;
52  return false;
53  }
54 
55 
56 };
57 
67 public:
69  reset();
70  }
71 
72  CandidateWrapper(double energy, double eta, double phi, double energyEcal,
73  double energyHcal, int type) :
74  energy_(energy), eta_(eta), phi_(phi), energyEcal_(energyEcal),
75  energyHcal_(energyHcal), type_(type) {
80 
81  }
82 
85  int type_;
86 
89 
92 
93  void reset() {
94  energy_ = 0;
95  eta_ = 0;
96  phi_ = 0;
97  energyEcal_ = 0;
98  energyHcal_ = 0;
99  cluster_numEcal_ = 0;
100  cluster_numHcal_ = 0;
101  type_ = -1;
106  }
107 
108  void recompute() {
111  }
112 };
123 public:
124 
126  reset();
127  }
128 
129  virtual ~Calibratable() {
130  }
131 
135  virtual void reset();
136 
145  //truth first
150  //set to true if this event is not real data
151  bool sim_isMC_;
152  //test beam specific
153  bool tb_isTB_;
154  //where was the TB table?
155  double tb_eta_, tb_phi_;
156  //TB run number and PDG particle type
158  //Veto counter values
160  //Erm, bit complicated this one...
162 
163  //DYNAMIC: Computed from tb_ecal_ and tb_hcal_
165  std::vector<CalibratableElement> tb_ecal_, tb_hcal_;
166  int tb_numEcal_, tb_numHcal_; //DYNAMIC
167 
169 
170  //leading track
173  //delta phi between sim particle and leading track
176 
177  //CaloWindow class (new for 3_1_X)
180 
181  //pf clusters
182  //DYNAMIC: Computed from cluster_ecal_ and cluster_hcal_
184  std::vector<CalibratableElement> cluster_ecal_, cluster_hcal_;
187 
188  //pf rechits
189  //DYNAMIC: Computed from rechits_ecal_ and rechits_hcal_
191  std::vector<CalibratableElement> rechits_ecal_, rechits_hcal_;
194 
195  //pf candidates
196  std::vector<CandidateWrapper> cands_;
198  int cands_num_; //DYNAMIC
199 
200  //DYNAMIC: Computed from cands_
202  cand_phi_;
204  int cand_type_; //DYNAMIC
205 
206  std::vector<CalibrationResultWrapper> calibrations_;
207 
208  //Recomputes cluster and rechit averages using the vectors of DepositDiets
209  //Users should call this before filling the tree.
210  virtual void recompute();
211 
217  virtual CalibratableElement computeMean(const std::vector<
218  CalibratableElement>& diets);
219 
226  const std::vector<CandidateWrapper>& wrappers);
227 
234  virtual void fillCaloWindow(const std::vector<CalibratableElement>& source,
235  CaloWindow& destination) const;
236 
237 };
238 
239 //typedef boost::shared_ptr<Calibratable> CalibratablePtr;
240 
241 std::ostream& operator<<(std::ostream& s, const Calibratable& calib_);
242 std::ostream& operator<<(std::ostream& s, const CalibratableElement& ce_);
243 
244 }
245 #endif /*CALIBRATABLE_H_*/
246 
CaloEllipse caloellipse_ecal_
Definition: Calibratable.h:90
CalibratableElement rechits_meanHcal_
Definition: Calibratable.h:193
type
Definition: HCALResponse.h:21
CandidateWrapper(double energy, double eta, double phi, double energyEcal, double energyHcal, int type)
Definition: Calibratable.h:72
Wraps essential single particle calibration data ready for export to a Root file. ...
Definition: Calibratable.h:122
CalibratableElement cluster_meanEcal_
Definition: Calibratable.h:186
Small wrapper class for storing individual rechit and cluster information.
Definition: Calibratable.h:24
bool operator<(const CalibratableElement &em) const
Definition: Calibratable.h:49
std::vector< CalibrationResultWrapper > calibrations_
Definition: Calibratable.h:206
std::vector< CalibratableElement > rechits_ecal_
Definition: Calibratable.h:191
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
CalibratableElement rechits_meanEcal_
Definition: Calibratable.h:193
CaloWindow calowindow_hcal_
Definition: Calibratable.h:179
CalibratableElement tb_meanEcal_
Definition: Calibratable.h:168
std::vector< CalibratableElement > rechits_hcal_
Definition: Calibratable.h:191
std::vector< CandidateWrapper > cands_
Definition: Calibratable.h:196
std::vector< CalibratableElement > tb_hcal_
Definition: Calibratable.h:165
virtual void reset()
std::vector< CalibratableElement > cluster_ecal_
Definition: Calibratable.h:184
CaloEllipse caloellipse_hcal_
Definition: Calibratable.h:91
virtual CalibratableElement computeMean(const std::vector< CalibratableElement > &diets)
virtual void recompute()
Definition: Calibratable.cc:45
CalibratableElement(double energy, double eta, double phi, int layer, double extent=0.0, double time=0.0)
Definition: Calibratable.h:30
std::vector< CalibratableElement > cluster_hcal_
Definition: Calibratable.h:184
CalibratableElement tb_meanHcal_
Definition: Calibratable.h:168
CalibratableElement cluster_meanHcal_
Definition: Calibratable.h:186
math::XYZTLorentzVector recotrk_momentum_
Definition: Calibratable.h:175
std::vector< CalibratableElement > tb_ecal_
Definition: Calibratable.h:165
std::ostream & operator<<(std::ostream &s, const Calibratable &calib_)
Definition: Calibratable.cc:6
CandidateWrapper cands_mean_
Definition: Calibratable.h:197
static std::string const source
Definition: EdmProvDump.cc:42
CaloWindow calowindow_ecal_
Definition: Calibratable.h:178
Small wrapper class to store information associated with PFCandidates.
Definition: Calibratable.h:66
virtual void fillCaloWindow(const std::vector< CalibratableElement > &source, CaloWindow &destination) const