CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ecaldqm::MESetTrend Class Reference

#include <MESetTrend.h>

Inheritance diagram for ecaldqm::MESetTrend:
ecaldqm::MESetEcal ecaldqm::MESet

Public Member Functions

void book (DQMStore::IBooker &) override
 
bool canShiftAxis () const
 
MESetclone (std::string const &="") const override
 
void fill (DetId const &, double, double=1., double=1.) override
 
void fill (EcalElectronicsId const &, double, double=1., double=1.) override
 
void fill (int, double, double=1., double=1.) override
 
void fill (double, double=1., double=1.) override
 
int findBin (DetId const &, double, double=0.) const override
 
int findBin (EcalElectronicsId const &, double, double=0.) const override
 
int findBin (int, double, double=0.) const override
 
int findBin (double, double=0.) const
 
bool isCumulative () const
 
bool isMinutely () const
 
bool isVariableBinning () const override
 
 MESetTrend (std::string const &, binning::ObjectType, binning::BinningType, MonitorElement::Kind, binning::AxisSpecs const *=0, binning::AxisSpecs const *=0)
 
 MESetTrend (MESetTrend const &)
 
MESetoperator= (MESet const &) override
 
void setCumulative ()
 
void setMinutely ()
 
void setShiftAxis ()
 
 ~MESetTrend () override
 
- Public Member Functions inherited from ecaldqm::MESetEcal
std::vector< std::string > generatePaths () const
 
double getBinContent (DetId const &, int) const override
 
double getBinContent (EcalElectronicsId const &, int) const override
 
double getBinContent (int, int) const override
 
double getBinEntries (DetId const &, int) const override
 
double getBinEntries (EcalElectronicsId const &, int) const override
 
double getBinEntries (int, int) const override
 
double getBinError (DetId const &, int) const override
 
double getBinError (EcalElectronicsId const &, int) const override
 
double getBinError (int, int) const override
 
 MESetEcal (std::string const &, binning::ObjectType, binning::BinningType, MonitorElement::Kind, unsigned, binning::AxisSpecs const *=0, binning::AxisSpecs const *=0, binning::AxisSpecs const *=0)
 
 MESetEcal (MESetEcal const &)
 
bool retrieve (DQMStore::IGetter &, std::string *=0) const override
 
void setBinContent (DetId const &, int, double) override
 
void setBinContent (EcalElectronicsId const &, int, double) override
 
void setBinContent (int, int, double) override
 
void setBinEntries (DetId const &, int, double) override
 
void setBinEntries (EcalElectronicsId const &, int, double) override
 
void setBinEntries (int, int, double) override
 
void setBinError (DetId const &, int, double) override
 
void setBinError (EcalElectronicsId const &, int, double) override
 
void setBinError (int, int, double) override
 
 ~MESetEcal () override
 
- Public Member Functions inherited from ecaldqm::MESet
virtual const_iterator begin () const
 
virtual iterator begin ()
 
virtual const_iterator beginChannel () const
 
virtual iterator beginChannel ()
 
virtual void clear () const
 
virtual const_iterator end () const
 
virtual iterator end ()
 
std::string formPath (PathReplacements const &) const
 
bool getBatchMode () const
 
binning::BinningType getBinType () const
 
MonitorElement::Kind getKind () const
 
bool getLumiFlag () const
 
virtual MonitorElement const * getME (unsigned _iME) const
 
virtual MonitorElementgetME (unsigned _iME)
 
binning::ObjectType getObjType () const
 
virtual std::string const & getPath () const
 
bool isActive () const
 
virtual bool maskMatches (DetId const &, uint32_t, StatusManager const *) const
 
 MESet ()
 
 MESet (std::string const &, binning::ObjectType, binning::BinningType, MonitorElement::Kind)
 
 MESet (MESet const &)
 
virtual void recoverStats ()
 
virtual void reset (double=0., double=0., double=0.)
 
virtual void resetAll (double=0., double=0., double=0.)
 
virtual void setAxisTitle (std::string const &, int=1)
 
void setBatchMode ()
 
virtual void setBinContent (DetId const &, double)
 
virtual void setBinContent (EcalElectronicsId const &, double)
 
virtual void setBinContent (int, double)
 
virtual void setBinEntries (DetId const &, double)
 
virtual void setBinEntries (EcalElectronicsId const &, double)
 
virtual void setBinEntries (int, double)
 
virtual void setBinError (DetId const &, double)
 
virtual void setBinError (EcalElectronicsId const &, double)
 
virtual void setBinError (int, double)
 
void setLumiFlag ()
 
virtual void softReset ()
 
virtual ~MESet ()
 

Private Member Functions

bool shift_ (unsigned)
 

Private Attributes

int currentBin_
 
bool minutely_
 
bool shiftAxis_
 

Additional Inherited Members

- Public Types inherited from ecaldqm::MESet
typedef std::map< std::string, std::string > PathReplacements
 
- Protected Member Functions inherited from ecaldqm::MESet
virtual void checkME_ (unsigned _iME) const
 
virtual void fill_ (unsigned, int, double)
 
virtual void fill_ (unsigned, int, double, double)
 
virtual void fill_ (unsigned, double, double, double)
 
void throw_ (std::string const &_message) const
 
- Protected Attributes inherited from ecaldqm::MESetEcal
unsigned logicalDimensions_
 
binning::AxisSpecs const * xaxis_
 
binning::AxisSpecs const * yaxis_
 
binning::AxisSpecs const * zaxis_
 
- Protected Attributes inherited from ecaldqm::MESet
bool active_
 
bool batchMode_
 
binning::BinningType btype_
 
MonitorElement::Kind kind_
 
bool lumiFlag_
 
std::vector< MonitorElement * > mes_
 
binning::ObjectType otype_
 
std::string path_
 

Detailed Description

Definition at line 13 of file MESetTrend.h.

Constructor & Destructor Documentation

ecaldqm::MESetTrend::MESetTrend ( std::string const &  _fullPath,
binning::ObjectType  _otype,
binning::BinningType  _btype,
MonitorElement::Kind  _kind,
binning::AxisSpecs const *  _xaxis = 0,
binning::AxisSpecs const *  _yaxis = 0 
)

Definition at line 7 of file MESetTrend.cc.

References MonitorElement::DQM_KIND_TH1F, MonitorElement::DQM_KIND_TH2F, MonitorElement::DQM_KIND_TPROFILE, MonitorElement::DQM_KIND_TPROFILE2D, ecaldqm::MESet::kind_, and ecaldqm::MESet::throw_().

Referenced by clone().

7  :
8  MESetEcal(_fullPath, _otype, _btype, _kind, 1, _xaxis, _yaxis),
9  minutely_(false),
10  shiftAxis_(false),
11  currentBin_(-1)
12  {
13  switch(kind_){
18  break;
19  default:
20  throw_("Unsupported MonitorElement kind");
21  }
22  }
MonitorElement::Kind kind_
Definition: MESet.h:134
void throw_(std::string const &_message) const
Definition: MESet.h:124
MESetEcal(std::string const &, binning::ObjectType, binning::BinningType, MonitorElement::Kind, unsigned, binning::AxisSpecs const *=0, binning::AxisSpecs const *=0, binning::AxisSpecs const *=0)
Definition: MESetEcal.cc:11
ecaldqm::MESetTrend::MESetTrend ( MESetTrend const &  _orig)

Definition at line 24 of file MESetTrend.cc.

24  :
25  MESetEcal(_orig),
26  minutely_(_orig.minutely_),
27  shiftAxis_(_orig.shiftAxis_),
28  currentBin_(_orig.currentBin_)
29  {
30  }
MESetEcal(std::string const &, binning::ObjectType, binning::BinningType, MonitorElement::Kind, unsigned, binning::AxisSpecs const *=0, binning::AxisSpecs const *=0, binning::AxisSpecs const *=0)
Definition: MESetEcal.cc:11
ecaldqm::MESetTrend::~MESetTrend ( )
inlineoverride

Definition at line 18 of file MESetTrend.h.

References book(), clone(), fill(), findBin(), operator=(), and AlCaHLTBitMon_QueryRunRegistry::string.

18 {}

Member Function Documentation

void ecaldqm::MESetTrend::book ( DQMStore::IBooker _ibooker)
overridevirtual

Reimplemented from ecaldqm::MESetEcal.

Definition at line 56 of file MESetTrend.cc.

References ecaldqm::MESetEcal::book(), ecaldqm::binning::AxisSpecs::high, ecaldqm::binning::AxisSpecs::low, ecaldqm::MESet::mes_, minutely_, ecaldqm::binning::AxisSpecs::nbins, ecaldqm::MESet::setAxisTitle(), ntuplemaker::time, and ecaldqm::MESetEcal::xaxis_.

Referenced by ~MESetTrend().

57  {
58  binning::AxisSpecs xaxis;
59  if(xaxis_) xaxis = *xaxis_;
60  else{
61  xaxis.nbins = 200;
62  xaxis.low = 0.;
63  xaxis.high = 2000.;
64  }
65 
66  if(minutely_){
67  time_t localTime(time(nullptr));
68  struct tm timeBuffer;
69  gmtime_r(&localTime, &timeBuffer); // gmtime() is not thread safe
70  unsigned utcTime(mktime(&timeBuffer));
71 
72  xaxis.low = utcTime;
73  if(xaxis_) xaxis.high = utcTime + xaxis_->high - xaxis_->low;
74  else xaxis.high = xaxis.low + 200 * 60.;
75  }
76 
77  binning::AxisSpecs const* xaxisTemp(xaxis_);
78  xaxis_ = &xaxis;
79 
80  MESetEcal::book(_ibooker);
81 
82  xaxis_ = xaxisTemp;
83 
84  if(minutely_){
85  for(unsigned iME(0); iME < mes_.size(); ++iME)
86  mes_[iME]->getTH1()->GetXaxis()->SetTimeDisplay(1);
87  setAxisTitle("UTC");
88  }
89  else
90  setAxisTitle("LumiSections");
91  }
virtual void setAxisTitle(std::string const &, int=1)
Definition: MESet.cc:100
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
binning::AxisSpecs const * xaxis_
Definition: MESetEcal.h:68
void book(DQMStore::IBooker &) override
Definition: MESetEcal.cc:69
bool ecaldqm::MESetTrend::canShiftAxis ( ) const
inline

Definition at line 42 of file MESetTrend.h.

References shiftAxis_.

42 { return shiftAxis_; }
MESet * ecaldqm::MESetTrend::clone ( std::string const &  _path = "") const
overridevirtual

Reimplemented from ecaldqm::MESetEcal.

Definition at line 46 of file MESetTrend.cc.

References popcon2dropbox::copy(), MESetTrend(), callgraph::path, ecaldqm::MESet::path_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ~MESetTrend().

47  {
49  if(_path != "") path_ = _path;
50  MESet* copy(new MESetTrend(*this));
51  path_ = path;
52  return copy;
53  }
MESetTrend(std::string const &, binning::ObjectType, binning::BinningType, MonitorElement::Kind, binning::AxisSpecs const *=0, binning::AxisSpecs const *=0)
Definition: MESetTrend.cc:7
std::string path_
Definition: MESet.h:131
void ecaldqm::MESetTrend::fill ( DetId const &  _id,
double  _t,
double  _wy = 1.,
double  _w = 1. 
)
overridevirtual

Reimplemented from ecaldqm::MESetEcal.

Definition at line 94 of file MESetTrend.cc.

References ecaldqm::MESet::active_, ecaldqm::MESet::checkME_(), ecaldqm::MESet::fill_(), ecaldqm::binning::findPlotIndex(), ecaldqm::MESet::otype_, and shift_().

Referenced by ~MESetTrend().

95  {
96  if(!active_) return;
97 
98  unsigned iME(binning::findPlotIndex(otype_, _id));
99  checkME_(iME);
100 
101  if(shift_(unsigned(_t)))
102  fill_(iME, _t + 0.5, _wy, _w);
103  }
virtual void checkME_(unsigned _iME) const
Definition: MESet.h:115
bool shift_(unsigned)
Definition: MESetTrend.cc:192
virtual void fill_(unsigned, int, double)
Definition: MESet.cc:278
unsigned findPlotIndex(ObjectType, DetId const &)
bool active_
Definition: MESet.h:138
binning::ObjectType otype_
Definition: MESet.h:132
void ecaldqm::MESetTrend::fill ( EcalElectronicsId const &  _id,
double  _t,
double  _wy = 1.,
double  _w = 1. 
)
overridevirtual

Reimplemented from ecaldqm::MESetEcal.

Definition at line 106 of file MESetTrend.cc.

References ecaldqm::MESet::active_, ecaldqm::MESet::checkME_(), ecaldqm::MESet::fill_(), ecaldqm::binning::findPlotIndex(), ecaldqm::MESet::otype_, and shift_().

107  {
108  if(!active_) return;
109 
110  unsigned iME(binning::findPlotIndex(otype_, _id));
111  checkME_(iME);
112 
113  if(shift_(unsigned(_t)))
114  fill_(iME, _t + 0.5, _wy, _w);
115  }
virtual void checkME_(unsigned _iME) const
Definition: MESet.h:115
bool shift_(unsigned)
Definition: MESetTrend.cc:192
virtual void fill_(unsigned, int, double)
Definition: MESet.cc:278
unsigned findPlotIndex(ObjectType, DetId const &)
bool active_
Definition: MESet.h:138
binning::ObjectType otype_
Definition: MESet.h:132
void ecaldqm::MESetTrend::fill ( int  _dcctccid,
double  _t,
double  _wy = 1.,
double  _w = 1. 
)
overridevirtual

Reimplemented from ecaldqm::MESetEcal.

Definition at line 118 of file MESetTrend.cc.

References ecaldqm::MESet::active_, ecaldqm::MESet::btype_, ecaldqm::MESet::checkME_(), ecaldqm::MESet::fill_(), ecaldqm::binning::findPlotIndex(), ecaldqm::MESet::otype_, and shift_().

119  {
120  if(!active_) return;
121 
122  unsigned iME(binning::findPlotIndex(otype_, _dcctccid, btype_));
123  checkME_(iME);
124 
125  if(shift_(unsigned(_t)))
126  fill_(iME, _t + 0.5, _wy, _w);
127  }
virtual void checkME_(unsigned _iME) const
Definition: MESet.h:115
bool shift_(unsigned)
Definition: MESetTrend.cc:192
virtual void fill_(unsigned, int, double)
Definition: MESet.cc:278
unsigned findPlotIndex(ObjectType, DetId const &)
bool active_
Definition: MESet.h:138
binning::ObjectType otype_
Definition: MESet.h:132
binning::BinningType btype_
Definition: MESet.h:133
void ecaldqm::MESetTrend::fill ( double  _t,
double  _wy = 1.,
double  _w = 1. 
)
overridevirtual

Reimplemented from ecaldqm::MESetEcal.

Definition at line 130 of file MESetTrend.cc.

References ecaldqm::MESet::active_, ecaldqm::MESet::fill_(), ecaldqm::MESet::mes_, shift_(), and ecaldqm::MESet::throw_().

131  {
132  if(!active_) return;
133  if(mes_.size() != 1)
134  throw_("MESet type incompatible");
135 
136  if(shift_(unsigned(_t)))
137  fill_(0, _t + 0.5, _wy, _w);
138  }
bool shift_(unsigned)
Definition: MESetTrend.cc:192
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
void throw_(std::string const &_message) const
Definition: MESet.h:124
virtual void fill_(unsigned, int, double)
Definition: MESet.cc:278
bool active_
Definition: MESet.h:138
int ecaldqm::MESetTrend::findBin ( DetId const &  _id,
double  _t,
double  _y = 0. 
) const
overridevirtual

Reimplemented from ecaldqm::MESetEcal.

Definition at line 141 of file MESetTrend.cc.

References ecaldqm::MESet::active_, ecaldqm::MESet::checkME_(), ecaldqm::binning::findPlotIndex(), ecaldqm::MESet::mes_, and ecaldqm::MESet::otype_.

Referenced by ~MESetTrend().

142  {
143  if(!active_) return -1;
144 
145  unsigned iME(binning::findPlotIndex(otype_, _id));
146  checkME_(iME);
147 
148  return mes_[iME]->getTH1()->FindBin(_t + 0.5, _y);
149  }
virtual void checkME_(unsigned _iME) const
Definition: MESet.h:115
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
unsigned findPlotIndex(ObjectType, DetId const &)
bool active_
Definition: MESet.h:138
binning::ObjectType otype_
Definition: MESet.h:132
int ecaldqm::MESetTrend::findBin ( EcalElectronicsId const &  _id,
double  _t,
double  _y = 0. 
) const
overridevirtual

Reimplemented from ecaldqm::MESetEcal.

Definition at line 152 of file MESetTrend.cc.

References ecaldqm::MESet::active_, ecaldqm::MESet::checkME_(), ecaldqm::binning::findPlotIndex(), ecaldqm::MESet::mes_, and ecaldqm::MESet::otype_.

153  {
154  if(!active_) return -1;
155 
156  unsigned iME(binning::findPlotIndex(otype_, _id));
157  checkME_(iME);
158 
159  return mes_[iME]->getTH1()->FindBin(_t + 0.5, _y);
160  }
virtual void checkME_(unsigned _iME) const
Definition: MESet.h:115
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
unsigned findPlotIndex(ObjectType, DetId const &)
bool active_
Definition: MESet.h:138
binning::ObjectType otype_
Definition: MESet.h:132
int ecaldqm::MESetTrend::findBin ( int  _dcctccid,
double  _t,
double  _y = 0. 
) const
overridevirtual

Reimplemented from ecaldqm::MESetEcal.

Definition at line 163 of file MESetTrend.cc.

References ecaldqm::MESet::active_, ecaldqm::MESet::btype_, ecaldqm::MESet::checkME_(), ecaldqm::binning::findPlotIndex(), ecaldqm::MESet::mes_, and ecaldqm::MESet::otype_.

164  {
165  if(!active_) return -1;
166 
167  unsigned iME(binning::findPlotIndex(otype_, _dcctccid, btype_));
168  checkME_(iME);
169 
170  return mes_[iME]->getTH1()->FindBin(_t + 0.5, _y);
171  }
virtual void checkME_(unsigned _iME) const
Definition: MESet.h:115
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
unsigned findPlotIndex(ObjectType, DetId const &)
bool active_
Definition: MESet.h:138
binning::ObjectType otype_
Definition: MESet.h:132
binning::BinningType btype_
Definition: MESet.h:133
int ecaldqm::MESetTrend::findBin ( double  _t,
double  _y = 0. 
) const

Definition at line 174 of file MESetTrend.cc.

References ecaldqm::MESet::active_, ecaldqm::MESet::mes_, and ecaldqm::MESet::throw_().

175  {
176  if(!active_) return -1;
177  if(mes_.size() != 1)
178  throw_("MESet type incompatible");
179 
180  return mes_[0]->getTH1()->FindBin(_t + 0.5, _y);
181  }
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
void throw_(std::string const &_message) const
Definition: MESet.h:124
bool active_
Definition: MESet.h:138
bool ecaldqm::MESetTrend::isCumulative ( ) const
inline

Definition at line 43 of file MESetTrend.h.

References currentBin_, and shift_().

43 { return currentBin_ > 0; }
bool ecaldqm::MESetTrend::isMinutely ( ) const
inline

Definition at line 41 of file MESetTrend.h.

References minutely_.

41 { return minutely_; }
bool ecaldqm::MESetTrend::isVariableBinning ( ) const
inlineoverridevirtual

Reimplemented from ecaldqm::MESetEcal.

Definition at line 36 of file MESetTrend.h.

36 { return true; }
MESet & ecaldqm::MESetTrend::operator= ( MESet const &  _rhs)
overridevirtual

Reimplemented from ecaldqm::MESetEcal.

Definition at line 33 of file MESetTrend.cc.

References currentBin_, minutely_, ecaldqm::MESetEcal::operator=(), and shiftAxis_.

Referenced by ~MESetTrend().

34  {
35  MESetTrend const* pRhs(dynamic_cast<MESetTrend const*>(&_rhs));
36  if(pRhs){
37  minutely_ = pRhs->minutely_;
38  shiftAxis_ = pRhs->shiftAxis_;
39  currentBin_ = pRhs->currentBin_;
40  }
41 
42  return MESetEcal::operator=(_rhs);
43  }
MESet & operator=(MESet const &) override
Definition: MESetEcal.cc:39
MESetTrend(std::string const &, binning::ObjectType, binning::BinningType, MonitorElement::Kind, binning::AxisSpecs const *=0, binning::AxisSpecs const *=0)
Definition: MESetTrend.cc:7
void ecaldqm::MESetTrend::setCumulative ( )

Definition at line 184 of file MESetTrend.cc.

References currentBin_, MonitorElement::DQM_KIND_TPROFILE, MonitorElement::DQM_KIND_TPROFILE2D, ecaldqm::MESet::kind_, and ecaldqm::MESet::throw_().

Referenced by ecaldqm::createMESet(), and setShiftAxis().

185  {
187  throw_("Cumulative flag set for a profile plot");
188  currentBin_ = 1;
189  }
MonitorElement::Kind kind_
Definition: MESet.h:134
void throw_(std::string const &_message) const
Definition: MESet.h:124
void ecaldqm::MESetTrend::setMinutely ( )
inline

Definition at line 38 of file MESetTrend.h.

References minutely_.

Referenced by ecaldqm::createMESet().

38 { minutely_ = true; }
void ecaldqm::MESetTrend::setShiftAxis ( )
inline

Definition at line 39 of file MESetTrend.h.

References setCumulative(), and shiftAxis_.

Referenced by ecaldqm::createMESet().

39 { shiftAxis_ = true; }
bool ecaldqm::MESetTrend::shift_ ( unsigned  _t)
private

Definition at line 192 of file MESetTrend.cc.

References stringResolutionProvider_cfi::bin, currentBin_, mps_fire::dest, MonitorElement::DQM_KIND_TH1F, MonitorElement::DQM_KIND_TH2F, MonitorElement::DQM_KIND_TPROFILE, MonitorElement::DQM_KIND_TPROFILE2D, ecaldqm::MESet::end(), MonitorElement::getBinContent(), MonitorElement::getBinEntries(), MonitorElement::getBinError(), MonitorElement::getNbinsY(), MonitorElement::getTH1(), ecaldqm::MESet::kind_, ecaldqm::MESet::mes_, MonitorElement::Reset(), SiStripPI::rms, MonitorElement::setBinContent(), MonitorElement::setBinEntries(), MonitorElement::setBinError(), MonitorElement::setEntries(), shiftAxis_, mathSSE::sqrt(), and command_line::start.

Referenced by fill(), and isCumulative().

193  {
194  TAxis* tAxis(mes_[0]->getTH1()->GetXaxis());
195  int nbinsX(tAxis->GetNbins());
196  unsigned tLow(tAxis->GetBinLowEdge(1));
197  unsigned tHigh(tAxis->GetBinUpEdge(nbinsX));
198 
199  if(!shiftAxis_) return _t >= tLow && _t < tHigh;
200 
201  int dBin(0);
202  int unitsPerBin((tHigh - tLow) / nbinsX);
203 
204  if(_t >= tLow && _t < tHigh){
205  if(currentBin_ > 0){
206  int thisBin(tAxis->FindBin(_t + 0.5));
207  if(thisBin < currentBin_) return false;
208  else if(thisBin > currentBin_){
209  for(unsigned iME(0); iME < mes_.size(); iME++){
210  MonitorElement* me(mes_[iME]);
211  int nbinsY(me->getTH1()->GetNbinsY());
212  for(int iy(1); iy <= nbinsY; ++iy){
213  int orig(me->getTH1()->GetBin(currentBin_, iy));
214  double currentContent(me->getBinContent(orig));
215  double currentError(me->getBinError(orig));
216  for(int ix(currentBin_); ix <= thisBin; ++ix){
217  int dest(me->getTH1()->GetBin(ix, iy));
218  me->setBinContent(dest, currentContent);
219  me->setBinError(dest, currentError);
220  }
221  }
222  }
223  }
224  }
225 
226  return true;
227  }
228  else if(_t >= tHigh){
229  dBin = (_t - tHigh) / unitsPerBin + 1;
230  if(currentBin_ > 0) currentBin_ = nbinsX;
231  }
232  else if(_t < tLow){
233  if(currentBin_ > 0) return false; // no going back in time in case of cumulative history
234 
235  int maxBin(0);
236 
237  for(unsigned iME(0); iME < mes_.size(); iME++){
238  MonitorElement* me(mes_[iME]);
239 
240  bool filled(false);
241  int iMax(nbinsX + 1);
242  while(--iMax > 0 && !filled){
243  switch(kind_){
245  if(me->getBinContent(iMax) != 0) filled = true;
246  break;
248  if(me->getBinEntries(iMax) != 0) filled = true;
249  break;
251  for(int iy(1); iy <= me->getNbinsY(); iy++){
252  if(me->getBinContent(me->getTH1()->GetBin(iMax, iy)) != 0){
253  filled = true;
254  break;
255  }
256  }
257  break;
259  for(int iy(1); iy <= me->getNbinsY(); iy++){
260  if(me->getBinEntries(me->getTH1()->GetBin(iMax, iy)) != 0){
261  filled = true;
262  break;
263  }
264  }
265  break;
266  default:
267  break;
268  }
269  }
270 
271  if(iMax > maxBin) maxBin = iMax;
272  }
273 
274  if(_t < tLow - (nbinsX - maxBin) * unitsPerBin) return false;
275 
276  dBin = (_t - tLow) / unitsPerBin - 1;
277  }
278 
279  int start(dBin > 0 ? dBin + 1 : nbinsX + dBin);
280  int end(dBin > 0 ? nbinsX + 1 : 0);
281  int step(dBin > 0 ? 1 : -1);
282 
283  tLow += dBin * unitsPerBin;
284  tHigh += dBin * unitsPerBin;
285 
286  for(unsigned iME(0); iME < mes_.size(); iME++){
287  MonitorElement* me(mes_[iME]);
288 
289  me->getTH1()->GetXaxis()->SetLimits(tLow, tHigh);
290 
291  if((end - start) / step < 0){
292  me->Reset();
293  continue;
294  }
295 
296  me->setEntries(0.);
297  double entries(0.);
298 
299  switch(kind_){
301  {
302  int ix(start);
303  for(; ix != end; ix += step){
304  double binContent(me->getBinContent(ix));
305  entries += binContent;
306  me->setBinContent(ix - dBin, binContent);
307  me->setBinError(ix - dBin, me->getBinError(ix));
308  }
309  ix = end - dBin - 1 * step;
310  double lastContent(currentBin_ > 0 ? me->getBinContent(ix) : 0.);
311  double lastError(currentBin_ > 0 ? me->getBinContent(ix) : 0.);
312  for(ix += step; ix != end; ix += step){
313  me->setBinContent(ix, lastContent);
314  me->setBinError(ix, lastError);
315  }
316  }
317  break;
319  {
320  int ix(start);
321  for(; ix != end; ix += step){
322  double binEntries(me->getBinEntries(ix));
323  double binContent(me->getBinContent(ix));
324  entries += binEntries;
325  me->setBinEntries(ix - dBin, binEntries);
326  me->setBinContent(ix - dBin, binContent * binEntries);
327  if(binEntries > 0){
328  double rms(me->getBinError(ix) * std::sqrt(binEntries));
329  double sumw2((rms * rms + binContent * binContent) * binEntries);
330  me->setBinError(ix - dBin, std::sqrt(sumw2));
331  }
332  else
333  me->setBinError(ix - dBin, 0.);
334  }
335  ix = end - dBin;
336  for(; ix != end; ix += step){
337  me->setBinEntries(ix, 0.);
338  me->setBinContent(ix, 0.);
339  me->setBinError(ix, 0.);
340  }
341  }
342  break;
344  {
345  int ix(start);
346  int nbinsY(me->getNbinsY());
347  for(; ix != end; ix += step){
348  for(int iy(1); iy <= nbinsY; iy++){
349  int orig(me->getTH1()->GetBin(ix, iy));
350  int dest(me->getTH1()->GetBin(ix - dBin, iy));
351  double binContent(me->getBinContent(orig));
352  entries += binContent;
353  me->setBinContent(dest, binContent);
354  me->setBinError(dest, me->getBinError(orig));
355 
356  me->setBinContent(orig, 0.);
357  me->setBinError(orig, 0.);
358  }
359  }
360  ix = end - dBin - 1 * step;
361  std::vector<double> lastContent;
362  std::vector<double> lastError;
363  for(int iy(1); iy <= nbinsY; iy++){
364  lastContent.push_back(currentBin_ > 0 ? me->getBinContent(ix, iy) : 0.);
365  lastError.push_back(currentBin_ > 0 ? me->getBinError(ix, iy) : 0.);
366  }
367  for(ix += step; ix != end; ix += step){
368  for(int iy(1); iy <= nbinsY; iy++){
369  int bin(me->getTH1()->GetBin(ix, iy));
370  me->setBinContent(bin, lastContent[iy - 1]);
371  me->setBinError(bin, lastError[iy - 1]);
372  }
373  }
374  }
375  break;
377  {
378  int ix(start);
379  int nbinsY(me->getNbinsY());
380  for(; ix != end; ix += step){
381  for(int iy(1); iy <= nbinsY; iy++){
382  int orig(me->getTH1()->GetBin(ix, iy));
383  int dest(me->getTH1()->GetBin(ix - dBin, iy));
384  double binEntries(me->getBinEntries(orig));
385  double binContent(me->getBinContent(orig));
386  entries += binEntries;
387  me->setBinEntries(dest, binEntries);
388  me->setBinContent(dest, binContent * binEntries);
389  if(binEntries > 0){
390  double rms(me->getBinError(orig) * std::sqrt(binEntries));
391  double sumw2((rms * rms + binContent * binContent) * binEntries);
392  me->setBinError(dest, std::sqrt(sumw2));
393  }
394  else
395  me->setBinError(dest, 0.);
396  }
397  }
398  ix = end - dBin;
399  for(; ix != end; ix += step){
400  for(int iy(1); iy <= nbinsY; iy++){
401  int bin(me->getTH1()->GetBin(ix, iy));
402  me->setBinEntries(bin, 0.);
403  me->setBinContent(bin, 0.);
404  me->setBinError(bin, 0.);
405  }
406  }
407  }
408  break;
409  default:
410  break;
411  }
412 
413  me->setEntries(entries);
414  }
415 
416  return true;
417  }
Definition: start.py:1
MonitorElement::Kind kind_
Definition: MESet.h:134
std::vector< MonitorElement * > mes_
Definition: MESet.h:129
T sqrt(T t)
Definition: SSEVec.h:18
bin
set the eta bin as selection string.
virtual const_iterator end() const
Definition: MESet.h:286
step

Member Data Documentation

int ecaldqm::MESetTrend::currentBin_
private

Definition at line 50 of file MESetTrend.h.

Referenced by isCumulative(), operator=(), setCumulative(), and shift_().

bool ecaldqm::MESetTrend::minutely_
private

Definition at line 48 of file MESetTrend.h.

Referenced by book(), isMinutely(), operator=(), and setMinutely().

bool ecaldqm::MESetTrend::shiftAxis_
private

Definition at line 49 of file MESetTrend.h.

Referenced by canShiftAxis(), operator=(), setShiftAxis(), and shift_().