00001 #ifndef ANP_FILLSHORTVAR_H
00002 #define ANP_FILLSHORTVAR_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <map>
00011
00012
00013
00014 #include "PhysicsNtuple/AlgSnarl.h"
00015 #include "PhysicsNtuple/ShortMu/StripLink.h"
00016
00017 class VldContext;
00018
00019 namespace Anp
00020 {
00021
00022 class FillShortVar: public AlgSnarl
00023 {
00024 public:
00025
00026 FillShortVar();
00027 virtual ~FillShortVar();
00028
00029 bool Run(Record &record);
00030
00031 void Config(const Registry ®);
00032
00033 void End(const DataBlock &);
00034
00035 private:
00036
00037 typedef StripLink* StripLinkIter;
00038 typedef std::map<short,float> DataMap;
00039 typedef std::map<unsigned short, std::vector<Anp::StripIter> > PlaneMap;
00040 typedef std::map<unsigned short, std::vector<StripLinkIter> > PlaneMapList;
00041
00042 private:
00043
00044 bool Study(Track &track, const Record &record,DataMap& dmap, string StripMin);
00045 void Fill(DataMap& dmapout, DataMap dmapin, int base);
00046 bool GetTrackMap(Track &track, const Record &record, PlaneMap& track_map,std::map<int,float>& other_map,string StripMin) const;
00047
00048 std::vector<Anp::StripIter> Get(const Track &track,
00049 unsigned short plane,
00050 const Record &record, std::map<int,float> other_map, string StripMin) const;
00051
00052 bool GetScatter(PlaneMap track_map, float& pear, float& dpear, int keyval) const;
00053 double BVD_BestLine(PlaneMap& map) const ;
00054 double GetProbability(StripLink* cur, StripLink* cmp) const;
00055 float GetWPos(const short plane, std::map<int,float> pmap) const;
00056 const VldContext GetVldc(const Header &header) const;
00057 float TrackStripEnergy(StripIter si, short index, string StripMin) const;
00058 float OtherStripEnergy(StripIter sp, const VldContext &vldc,
00059 const float lpos, string StripMin) const;
00060 bool IsGoodTrack(TrackIter itrack, Record& record);
00061 float GetStripChargeCut(string StripMin) const;
00062 std::vector<Anp::StripIter> FirstPassOtherStrip(const std::vector<StripIter> instrip, const std::vector<StripIter> track_strip, double minT, double maxT) const;
00063 private:
00064 int fMinNPlane;
00065 int fMaxNPlane;
00066 int fEndNPlane;
00067 int fKeyBase;
00068 double fTimeWindow;
00069 int fStripWindow;
00070 double fMinStripADC;
00071 double fMinStripMIP;
00072 bool fFillEvent;
00073 bool fDebug;
00074 bool fErase;
00075
00076 bool fqeltrack;
00077 double ftruelowE;
00078 double frecolowE;
00079 int fselectsign;
00080
00081
00082
00083 int fNTrackAll;
00084 int fNTrackAdd;
00085 };
00086 }
00087
00088 #endif