Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

FillSnarl.h

Go to the documentation of this file.
00001 #ifndef ANP_FILLSNARL_H
00002 #define ANP_FILLSNARL_H
00003 
00004 // $Id: FillSnarl.h,v 1.2 2008/03/31 17:25:35 rustem Exp $
00005 //
00006 // Fill snarl data and summary of snarl strips
00007 //
00008 
00009 // C++
00010 #include <algorithm>
00011 #include <vector>
00012 
00013 // Local
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 &reg);
00028 
00029    private:
00030 
00031       bool fData; // fill summary of all strips in snarl
00032       int  fBase; // base key for snarl data
00033       int  fJump; // starting value for pulse height threshold scan
00034       int  fStep; // step for pulse height threshold scan
00035       int  fStop; // maximum value for pulse height threshold scan
00036 
00037       unsigned int fOver; // maximum number of times strip can appear in same snarl
00038    };
00039 
00040    //
00041    // Utility function that counts equal strips
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    // Utility function that count strips below and above threshold
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

Generated on Mon Feb 15 11:06:42 2010 for loon by  doxygen 1.3.9.1