00001 #ifndef ANP_FILLSNARL_H
00002 #define ANP_FILLSNARL_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <algorithm>
00011 #include <vector>
00012
00013
00014 #include "PhysicsNtuple/AlgSnarl.h"
00015
00016 namespace Anp
00017 {
00018 class FillSnarl: public AlgSnarl
00019 {
00020 public:
00021
00022 FillSnarl();
00023 virtual ~FillSnarl();
00024
00025 bool Run(Record &record);
00026
00027 void Config(const Registry ®);
00028
00029 private:
00030
00031 bool fData;
00032 int fBase;
00033 int fJump;
00034 int fStep;
00035 int fStop;
00036
00037 unsigned int fOver;
00038 };
00039
00040
00041
00042
00043 struct CountPlaneStrip : public std::unary_function<double, void>
00044 {
00045 public:
00046
00047 CountPlaneStrip();
00048 CountPlaneStrip(short plane_, short strip_);
00049
00050 void operator()(const Strip &strip);
00051
00052 unsigned int GetCount() const;
00053 short GetPlane() const;
00054 short GetStrip() const;
00055
00056 private:
00057
00058 short plane;
00059 short strip;
00060 unsigned int count;
00061 };
00062
00063 bool operator==(const CountPlaneStrip &lhs, const CountPlaneStrip &rhs);
00064
00065
00066
00067
00068 struct CountAboveBelow : public std::unary_function<double, void>
00069 {
00070 public:
00071
00072 CountAboveBelow();
00073 CountAboveBelow(float threshold_, const std::vector<std::pair<short,short> > &ivec);
00074
00075 void operator()(const Strip &strip);
00076
00077 unsigned int GetNAbove() const;
00078 unsigned int GetNBelow() const;
00079
00080 double GetMeanAbove() const;
00081 double GetMeanBelow() const;
00082
00083 private:
00084
00085 std::vector<std::pair<short,short> > ignorevec;
00086
00087 float threshold;
00088 unsigned int nabove;
00089 unsigned int nbelow;
00090
00091 double sumabove;
00092 double sumbelow;
00093 };
00094
00095 }
00096
00097 #endif