Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:53

0001 #ifndef RecoLocalCalo_HGCalRecProducers_ComputeClusterTime_h
0002 #define RecoLocalCalo_HGCalRecProducers_ComputeClusterTime_h
0003 
0004 // user include files
0005 #include <algorithm>
0006 #include <cmath>
0007 #include <numeric>
0008 #include <vector>
0009 #include <string>
0010 
0011 // functions to select the hits to compute the time of a given cluster
0012 // start with the only hits with timing information
0013 // average among the hits contained in the chosen time interval
0014 // weighted average wrt resolution or preferred function
0015 
0016 // N.B. time is corrected wrt vtx-calorimeter distance
0017 // with straight line and light speed hypothesis
0018 // for charged tracks or heavy particles (longer track length or beta < 1)
0019 // need to correct the offset at analysis level
0020 
0021 namespace hgcalsimclustertime {
0022 
0023   class ComputeClusterTime {
0024   public:
0025     ComputeClusterTime(float Xmix, float Xmax, float Cterm, float Aterm);
0026     ComputeClusterTime();
0027 
0028     void setParameters(float Xmix, float Xmax, float Cterm, float Aterm);
0029 
0030     //time resolution parametrization
0031     float timeResolution(float xVal);
0032 
0033     float getTimeError(std::string type, float xVal);
0034 
0035     //time-interval based on that ~210ps wide and with the highest number of hits
0036     //apply weights if provided => weighted mean
0037     //return also error on the mean
0038     //only effective with a minimum number of hits with time (3 from TDR time)
0039     std::pair<float, float> fixSizeHighestDensity(std::vector<float>& time,
0040                                                   std::vector<float> weight = std::vector<float>(),
0041                                                   unsigned int minNhits = 3,
0042                                                   float deltaT = 0.210, /*time window in ns*/
0043                                                   float timeWidthBy = 0.5);
0044 
0045   private:
0046     float xMin_;
0047     float xMax_;
0048     float cTerm_;
0049     float aTerm_;
0050   };
0051 
0052 }  // namespace hgcalsimclustertime
0053 
0054 #endif