CMS 3D CMS Logo

ComputeClusterTime.h
Go to the documentation of this file.
1 #ifndef RecoLocalCalo_HGCalRecProducers_ComputeClusterTime_h
2 #define RecoLocalCalo_HGCalRecProducers_ComputeClusterTime_h
3 
4 // user include files
5 #include <algorithm>
6 #include <cmath>
7 #include <numeric>
8 #include <vector>
9 #include <string>
10 
11 // functions to select the hits to compute the time of a given cluster
12 // start with the only hits with timing information
13 // average among the hits contained in the chosen time interval
14 // weighted average wrt resolution or preferred function
15 
16 // N.B. time is corrected wrt vtx-calorimeter distance
17 // with straight line and light speed hypothesis
18 // for charged tracks or heavy particles (longer track length or beta < 1)
19 // need to correct the offset at analysis level
20 
22 
24  public:
25  ComputeClusterTime(float Xmix, float Xmax, float Cterm, float Aterm);
27 
28  void setParameters(float Xmix, float Xmax, float Cterm, float Aterm);
29 
30  //time resolution parametrization
31  float timeResolution(float xVal);
32 
33  float getTimeError(std::string type, float xVal);
34 
35  //time-interval based on that ~210ps wide and with the highest number of hits
36  //apply weights if provided => weighted mean
37  //return also error on the mean
38  //only effective with a minimum number of hits with time (3 from TDR time)
39  std::pair<float, float> fixSizeHighestDensity(std::vector<float>& time,
40  std::vector<float> weight = std::vector<float>(),
41  unsigned int minNhits = 3,
42  float deltaT = 0.210, /*time window in ns*/
43  float timeWidthBy = 0.5);
44 
45  private:
46  float xMin_;
47  float xMax_;
48  float cTerm_;
49  float aTerm_;
50  };
51 
52 } // namespace hgcalsimclustertime
53 
54 #endif
Definition: weight.py:1
std::pair< float, float > fixSizeHighestDensity(std::vector< float > &time, std::vector< float > weight=std::vector< float >(), unsigned int minNhits=3, float deltaT=0.210, float timeWidthBy=0.5)
float getTimeError(std::string type, float xVal)
void setParameters(float Xmix, float Xmax, float Cterm, float Aterm)