Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:20

0001 
0002 //
0003 // Levels:
0004 //
0005 //    0   Neither recentering nor flattening is done.  The final weights are applied.
0006 //    1   The sums over the sines and cosines are recentered.
0007 //    2   Final results including both recentering and flattening.  Default if the level is not specified.
0008 //    3   Calculation where all weights are set to unity.
0009 //
0010 //
0011 
0012 #ifndef DataFormats_EvtPlane_h
0013 #define DataFormats_EvtPlane_h
0014 
0015 #include <vector>
0016 #include <string>
0017 #include <cmath>
0018 
0019 namespace reco {
0020   class EvtPlane {
0021   public:
0022     EvtPlane(int epindx = 0,
0023              int level = 2,
0024              double planeA = 0,
0025              double sumSin = 0,
0026              double sumCos = 0,
0027              double sumw = 0,
0028              double sumw2 = 0,
0029              double pe = 0,
0030              double pe2 = 0,
0031              uint mult = 0);
0032     virtual ~EvtPlane();
0033     void addLevel(int level, double ang, double sumsin, double sumcos);
0034     int indx() const { return indx_; }
0035     float angle(int level = 2) const { return (level >= 0 && level < 4) ? angle_[level] : angle_[2]; }
0036     float sumSin(int level = 2) const { return (level >= 0 && level < 4) ? sumSin_[level] : sumSin_[2]; }
0037     float sumCos(int level = 2) const { return (level >= 0 && level < 4) ? sumCos_[level] : sumCos_[2]; }
0038     float sumw() const { return sumw_; }
0039     float sumw2() const { return sumw2_; }
0040     float sumPtOrEt() const { return sumPtOrEt_; }
0041     float sumPtOrEt2() const { return sumPtOrEt2_; }
0042     float mult() const { return mult_; }
0043     float qy(int level = 2) const { return sumSin(level); }
0044     float qx(int level = 2) const { return sumCos(level); }
0045     float q(int level = 2) const {
0046       return ((pow(qx(level), 2) + pow(qy(level), 2)) > 0) ? sqrt(pow(qx(level), 2) + pow(qy(level), 2)) : 0.;
0047     }
0048     float vn(int level = 2) const { return (q(level) > 0 && fabs(sumw()) > 0) ? q(level) / fabs(sumw()) : 0.; }
0049 
0050   private:
0051     int indx_;
0052     float angle_[4];
0053     float sumSin_[4];
0054     float sumCos_[4];
0055     float sumw_;
0056     float sumw2_;
0057     float sumPtOrEt_;
0058     float sumPtOrEt2_;
0059     uint mult_;
0060   };
0061 
0062   typedef std::vector<EvtPlane> EvtPlaneCollection;
0063 }  // namespace reco
0064 
0065 #endif