Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:27:56

0001 #ifndef RecoTBCalo_EcalTBHodoscopeReconstructor_EcalTBHodoscopeRecInfoAlgo_HH
0002 #define RecoTBCalo_EcalTBHodoscopeReconstructor_EcalTBHodoscopeRecInfoAlgo_HH
0003 
0004 #include "TBDataFormats/EcalTBObjects/interface/EcalTBHodoscopeRawInfo.h"
0005 #include "TBDataFormats/EcalTBObjects/interface/EcalTBHodoscopeRecInfo.h"
0006 #include "Geometry/EcalTestBeam/interface/EcalTBHodoscopeGeometry.h"
0007 
0008 #include <vector>
0009 #include <cmath>
0010 
0011 class EcalTBHodoscopeRecInfoAlgo {
0012 public:
0013   EcalTBHodoscopeRecInfoAlgo();
0014 
0015   explicit EcalTBHodoscopeRecInfoAlgo(int fitMethod,
0016                                       const std::vector<double>& planeShift,
0017                                       const std::vector<double>& zPosition);
0018 
0019   EcalTBHodoscopeRecInfo reconstruct(const EcalTBHodoscopeRawInfo& hodoscopeRawInfo) const;
0020 
0021 private:
0022   //! Class to hold track information
0023   class BeamTrack {
0024   public:
0025     float x;
0026     float xS;
0027     float xQ;
0028 
0029     bool operator<(BeamTrack& b2) { return (fabs(xS) < fabs(b2.xS)); }
0030 
0031     BeamTrack(float x0, float xs, float xq) : x(x0), xS(xs), xQ(xq) {}
0032 
0033     ~BeamTrack() {}
0034 
0035   private:
0036     BeamTrack() {}
0037   };
0038 
0039   //Methods taken from h4ana. They can change in a future version
0040 
0041   void clusterPos(float& x, float& xQuality, const int& ipl, const int& xclus, const int& wclus) const;
0042 
0043   void fitHodo(float& x,
0044                float& xQuality,
0045                const int& ipl,
0046                const int& nclus,
0047                const std::vector<int>& xclus,
0048                const std::vector<int>& wclus) const;
0049 
0050   void fitLine(float& x,
0051                float& xSlope,
0052                float& xQuality,
0053                const int& ipl1,
0054                const int& nclus1,
0055                const std::vector<int>& xclus1,
0056                const std::vector<int>& wclus1,
0057                const int& ipl2,
0058                const int& nclus2,
0059                const std::vector<int>& xclus2,
0060                const std::vector<int>& wclus2) const;
0061 
0062   int fitMethod_;
0063 
0064   std::vector<double> planeShift_;
0065   std::vector<double> zPosition_;
0066 
0067   //for the moment mantaining it here
0068   EcalTBHodoscopeGeometry myGeometry_;
0069 };
0070 
0071 #endif