Go to the documentation of this file.00001 #ifndef EVENTFILTER_UTILITIES_ASCIIROLLINGCHART_H
00002 #define EVENTFILTER_UTILITIES_ASCIIROLLINGCHART_H
00003
00004 #include "EventFilter/Utilities/interface/AsciiHisto.h"
00005
00006 #include <string>
00007 #include <deque>
00008
00009 namespace evf{
00010
00011 class AsciiRollingChart{
00012
00013 public:
00014 AsciiRollingChart(std::string title, int nbins) : h_(title,nbins,0.,float(nbins)), roll_(nbins,0.)
00015 {
00016
00017 }
00018 void flip(unsigned int ind, float x){
00019 if(ind==1){for(unsigned int i = 0; i < roll_.size(); i++) roll_[i]=0.;}
00020 if(ind<roll_.size())roll_[ind]=x;
00021 else{
00022 roll_.pop_front();
00023 roll_.push_back(x);
00024 }
00025
00026 h_.fillDeque(roll_);
00027 }
00028 std::string &draw(){return h_.draw();}
00029
00030 private:
00031 AsciiHisto h_;
00032 std::deque<float> roll_;
00033 };
00034
00035 }
00036 #endif