CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AsciiRollingChart.h
Go to the documentation of this file.
1 #ifndef EVENTFILTER_UTILITIES_ASCIIROLLINGCHART_H
2 #define EVENTFILTER_UTILITIES_ASCIIROLLINGCHART_H
3 
5 
6 #include <string>
7 #include <deque>
8 
9 namespace evf{
10 
12 
13  public:
14  AsciiRollingChart(std::string title, int nbins) : h_(title,nbins,0.,float(nbins)), roll_(nbins,0.)
15  {
16 
17  }
18  void flip(unsigned int ind, float x){
19  if(ind==1){for(unsigned int i = 0; i < roll_.size(); i++) roll_[i]=0.;}
20  if(ind<roll_.size())roll_[ind]=x;
21  else{
22  roll_.pop_front();
23  roll_.push_back(x);
24  }
25  //h_.fill(&(roll_.front()));
27  }
28  std::string &draw(){return h_.draw();}
29 
30  private:
32  std::deque<float> roll_;
33  };
34 
35 }
36 #endif
void fillDeque(std::deque< float > &cont)
Definition: AsciiHisto.h:38
int i
Definition: DBlmapReader.cc:9
std::string & draw()
Definition: AsciiHisto.h:56
void flip(unsigned int ind, float x)
AsciiRollingChart(std::string title, int nbins)
std::deque< float > roll_
Definition: DDAxes.h:10