CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
ESTrendTask Class Reference

#include <ESTrendTask.h>

Inheritance diagram for ESTrendTask:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 ESTrendTask (const edm::ParameterSet &ps)
 
virtual ~ESTrendTask ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void beginJob (void)
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 
void cleanup (void)
 
void endJob (void)
 
void endRun (const edm::Run &r, const edm::EventSetup &c)
 
void reset (void)
 
void setup (void)
 
void shift2Left (TProfile *p, int bins=1)
 
void shift2Right (TProfile *p, int bins=1)
 
void updateTime (const edm::Event &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Attributes

long int current_time_
 
edm::EDGetTokenT
< ESRawDataCollection
dccCollections_
 
DQMStoredqmStore_
 
bool enableCleanup_
 
MonitorElementhESFiberErrTrend_
 
MonitorElementhESFiberErrTrendHr_
 
MonitorElementhESRecHitTrend_ [2][2]
 
MonitorElementhESRecHitTrendHr_ [2][2]
 
MonitorElementhESSLinkErrTrend_
 
MonitorElementhESSLinkErrTrendHr_
 
int ievt_
 
bool init_
 
long int last_time_
 
bool mergeRuns_
 
std::string prefixME_
 
edm::EDGetTokenT
< ESRecHitCollection
rechittoken_
 
long int start_time_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 16 of file ESTrendTask.h.

Constructor & Destructor Documentation

ESTrendTask::ESTrendTask ( const edm::ParameterSet ps)

Definition at line 23 of file ESTrendTask.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), i, j, and cppFunctionSkipper::operator.

23  {
24 
25  init_ = false;
26 
28 
29  prefixME_ = ps.getUntrackedParameter<string>("prefixME", "EcalPreshower");
30  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);
31  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);
32  rechittoken_ = consumes<ESRecHitCollection>(ps.getParameter<InputTag>("RecHitLabel"));
33  dccCollections_ = consumes<ESRawDataCollection>(ps.getParameter<InputTag>("ESDCCCollections"));
34 
35  for (int i=0; i<2; ++i)
36  for (int j=0; j<2; ++j) {
37  hESRecHitTrend_[i][j] = 0;
38  hESRecHitTrendHr_[i][j] = 0;
39  }
40 
45 
46  start_time_ = 0;
47  current_time_ = 0;
48  last_time_ = 0;
49 
50 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
MonitorElement * hESRecHitTrendHr_[2][2]
Definition: ESTrendTask.h:80
edm::EDGetTokenT< ESRecHitCollection > rechittoken_
Definition: ESTrendTask.h:73
std::string prefixME_
Definition: ESTrendTask.h:67
MonitorElement * hESSLinkErrTrendHr_
Definition: ESTrendTask.h:81
long int current_time_
Definition: ESTrendTask.h:87
edm::EDGetTokenT< ESRawDataCollection > dccCollections_
Definition: ESTrendTask.h:74
long int start_time_
Definition: ESTrendTask.h:86
MonitorElement * hESRecHitTrend_[2][2]
Definition: ESTrendTask.h:76
bool mergeRuns_
Definition: ESTrendTask.h:71
MonitorElement * hESFiberErrTrend_
Definition: ESTrendTask.h:78
int j
Definition: DBlmapReader.cc:9
long int last_time_
Definition: ESTrendTask.h:88
DQMStore * dqmStore_
Definition: ESTrendTask.h:65
MonitorElement * hESFiberErrTrendHr_
Definition: ESTrendTask.h:82
bool enableCleanup_
Definition: ESTrendTask.h:69
MonitorElement * hESSLinkErrTrend_
Definition: ESTrendTask.h:77
ESTrendTask::~ESTrendTask ( )
virtual

Definition at line 52 of file ESTrendTask.cc.

52  {
53 }

Member Function Documentation

void ESTrendTask::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Implements edm::EDAnalyzer.

Definition at line 178 of file ESTrendTask.cc.

References edm::Event::getByToken(), ESDCCHeaderBlock::getDCCErrors(), ESDCCHeaderBlock::getFEChannelStatus(), getTProfile(), i, j, HcalObjRepresent::setup(), ecaldqm::shift2Right(), and ESDetId::zside().

178  {
179 
180  if ( ! init_ ) this->setup();
181 
182  ievt_++;
183 
184  // Collect time information
185  updateTime(e);
186 
187  long int diff_current_start = current_time_ - start_time_;
188  long int diff_last_start = last_time_ - start_time_;
189  //LogInfo("ESTrendTask") << "time difference is negative in " << ievt_ << " events\n"
190  //<< "\tcurrent - start time = " << diff_current_start
191  //<< ", \tlast - start time = " << diff_last_start << endl;
192 
193  // std::cout << "current_time : " << current_time_ << ", diff : " << diff_current_start << std::endl;
194 
195  // Calculate time interval and bin width
196  // int minuteBinWidth = int(nBasicClusterMinutely_->getTProfile()->GetXaxis()->GetBinWidth(1));
197  int minuteBinWidth = 5;
198  long int minuteBinDiff = diff_current_start/60/minuteBinWidth - diff_last_start/60/minuteBinWidth;
199  long int minuteDiff = (current_time_ - last_time_)/60;
200 
201  // int hourBinWidth = int(nBasicClusterHourly_->getTProfile()->GetXaxis()->GetBinWidth(1));
202  int hourBinWidth = 1;
203  long int hourBinDiff = diff_current_start/3600/hourBinWidth - diff_last_start/3600/hourBinWidth;
204  long int hourDiff = (current_time_ - last_time_)/3600;
205 
206  if (minuteDiff >= minuteBinWidth) {
207  while (minuteDiff >= minuteBinWidth) minuteDiff -= minuteBinWidth;
208  }
209  if (hourDiff >= hourBinWidth) {
210  while (hourDiff >= hourBinWidth) hourDiff -= hourBinWidth;
211  }
212 
213  // ES DCC
214  Int_t slinkCRCErr = 0;
215  Int_t fiberErr = 0;
216  vector<int> fiberStatus;
218  if ( e.getByToken(dccCollections_, dccs) ) {
219  for (ESRawDataCollection::const_iterator dccItr = dccs->begin(); dccItr != dccs->end(); ++dccItr) {
220  ESDCCHeaderBlock dcc = (*dccItr);
221 
222  if (dcc.getDCCErrors() == 101) slinkCRCErr++;
223 
224  fiberStatus = dcc.getFEChannelStatus();
225  for (unsigned int i=0; i<fiberStatus.size(); ++i) {
226  if (fiberStatus[i]==4 || fiberStatus[i]==8 || fiberStatus[i]==10 || fiberStatus[i]==11 || fiberStatus[i]==12)
227  fiberErr++;
228  }
229 
230  }
231  }
232 
233  shift2Right(hESSLinkErrTrend_->getTProfile(), minuteBinDiff);
234  hESSLinkErrTrend_->Fill(minuteDiff, slinkCRCErr);
235 
236  shift2Right(hESFiberErrTrend_->getTProfile(), minuteBinDiff);
237  hESFiberErrTrend_->Fill(minuteDiff, fiberErr);
238 
240  hESSLinkErrTrendHr_->Fill(hourDiff, slinkCRCErr);
241 
243  hESFiberErrTrendHr_->Fill(hourDiff, fiberErr);
244 
245  // ES RecHits
246  int zside, plane;
247  int nrh[2][2];
248  for (int i = 0; i < 2; i++ )
249  for( int j = 0; j < 2; j++) {
250  nrh[i][j] = 0;
251  }
252 
254  if ( e.getByToken(rechittoken_, ESRecHit) ) {
255 
256  for (ESRecHitCollection::const_iterator hitItr = ESRecHit->begin(); hitItr != ESRecHit->end(); ++hitItr) {
257 
258  ESDetId id = ESDetId(hitItr->id());
259 
260  zside = id.zside();
261  plane = id.plane();
262 
263  int i = (zside==1)? 0:1;
264  int j = plane-1;
265 
266  nrh[i][j]++;
267  }
268  } else {
269  LogWarning("ESTrendTask") << "RecHitCollection not available";
270  }
271 
272  for (int i=0; i<2; ++i)
273  for (int j=0; j<2; ++j) {
274  shift2Right(hESRecHitTrend_[i][j]->getTProfile(), minuteBinDiff);
275  hESRecHitTrend_[i][j]->Fill(minuteDiff, nrh[i][j]/(1072*32.));
276 
277  shift2Right(hESRecHitTrendHr_[i][j]->getTProfile(), hourBinDiff);
278  hESRecHitTrendHr_[i][j]->Fill(hourDiff, nrh[i][j]/(1072*32.));
279  }
280 
281 }
int i
Definition: DBlmapReader.cc:9
TProfile * getTProfile(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
MonitorElement * hESRecHitTrendHr_[2][2]
Definition: ESTrendTask.h:80
edm::EDGetTokenT< ESRecHitCollection > rechittoken_
Definition: ESTrendTask.h:73
std::vector< ESDCCHeaderBlock >::const_iterator const_iterator
void shift2Right(TProfile *p, int bins=1)
Definition: ESTrendTask.cc:290
MonitorElement * hESSLinkErrTrendHr_
Definition: ESTrendTask.h:81
long int current_time_
Definition: ESTrendTask.h:87
edm::EDGetTokenT< ESRawDataCollection > dccCollections_
Definition: ESTrendTask.h:74
const std::vector< int > & getFEChannelStatus() const
void Fill(long long x)
void setup(void)
Definition: ESTrendTask.cc:95
long int start_time_
Definition: ESTrendTask.h:86
MonitorElement * hESRecHitTrend_[2][2]
Definition: ESTrendTask.h:76
MonitorElement * hESFiberErrTrend_
Definition: ESTrendTask.h:78
int j
Definition: DBlmapReader.cc:9
long int last_time_
Definition: ESTrendTask.h:88
int zside() const
Definition: ESDetId.h:44
MonitorElement * hESFiberErrTrendHr_
Definition: ESTrendTask.h:82
TProfile * getTProfile(void) const
int getDCCErrors() const
void updateTime(const edm::Event &)
Definition: ESTrendTask.cc:283
MonitorElement * hESSLinkErrTrend_
Definition: ESTrendTask.h:77
void ESTrendTask::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 55 of file ESTrendTask.cc.

55  {
56 
57  ievt_ = 0;
58 
59  if ( dqmStore_ ) {
60  dqmStore_->setCurrentFolder(prefixME_ + "/ESTrendTask");
61  dqmStore_->rmdir(prefixME_ + "/ESTrendTask");
62  }
63 
64 }
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:2730
std::string prefixME_
Definition: ESTrendTask.h:67
DQMStore * dqmStore_
Definition: ESTrendTask.h:65
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void ESTrendTask::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 66 of file ESTrendTask.cc.

References edm::RunBase::beginTime(), and reset().

66  {
67 
68  if ( ! mergeRuns_ ) this->reset();
69 
70  start_time_ = (r.beginTime()).unixTime();
71 
72  //std::cout << "start time : " << start_time_ << std::endl;
73 
74 }
long int start_time_
Definition: ESTrendTask.h:86
bool mergeRuns_
Definition: ESTrendTask.h:71
void reset(void)
Definition: ESTrendTask.cc:80
Timestamp const & beginTime() const
Definition: RunBase.h:43
void ESTrendTask::cleanup ( void  )
protected

Definition at line 141 of file ESTrendTask.cc.

References i, and j.

141  {
142 
143  if ( ! init_ ) return;
144 
145  if ( dqmStore_ ) {
146  dqmStore_->setCurrentFolder(prefixME_ + "/ESTrendTask");
147 
148  for (int i=0 ; i<2; ++i)
149  for (int j=0 ; j<2; ++j) {
150  if (hESRecHitTrend_[i][j]) dqmStore_->removeElement(hESRecHitTrend_[i][j]->getName());
151  hESRecHitTrend_[i][j] = 0;
152  if (hESRecHitTrendHr_[i][j]) dqmStore_->removeElement(hESRecHitTrendHr_[i][j]->getName());
153  hESRecHitTrendHr_[i][j] = 0;
154  }
155 
157  hESSLinkErrTrend_ = 0;
159  hESFiberErrTrend_ = 0;
164  }
165 
166  init_ = false;
167 
168 }
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
MonitorElement * hESRecHitTrendHr_[2][2]
Definition: ESTrendTask.h:80
std::string prefixME_
Definition: ESTrendTask.h:67
MonitorElement * hESSLinkErrTrendHr_
Definition: ESTrendTask.h:81
MonitorElement * hESRecHitTrend_[2][2]
Definition: ESTrendTask.h:76
void removeElement(const std::string &name)
Definition: DQMStore.cc:2772
MonitorElement * hESFiberErrTrend_
Definition: ESTrendTask.h:78
int j
Definition: DBlmapReader.cc:9
DQMStore * dqmStore_
Definition: ESTrendTask.h:65
MonitorElement * hESFiberErrTrendHr_
Definition: ESTrendTask.h:82
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
MonitorElement * hESSLinkErrTrend_
Definition: ESTrendTask.h:77
void ESTrendTask::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 170 of file ESTrendTask.cc.

References edm::cleanup().

170  {
171 
172  LogInfo("ESTrendTask") << "analyzed " << ievt_ << " events";
173 
174  if ( enableCleanup_ ) this->cleanup();
175 
176 }
bool enableCleanup_
Definition: ESTrendTask.h:69
void cleanup(void)
Definition: ESTrendTask.cc:141
void ESTrendTask::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 76 of file ESTrendTask.cc.

76  {
77 
78 }
void ESTrendTask::reset ( void  )
protected

Definition at line 80 of file ESTrendTask.cc.

References i, and j.

80  {
81 
82  for (int i=0 ; i<2; ++i)
83  for (int j=0 ; j<2; ++j) {
86  }
87 
92 
93 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * hESRecHitTrendHr_[2][2]
Definition: ESTrendTask.h:80
MonitorElement * hESSLinkErrTrendHr_
Definition: ESTrendTask.h:81
MonitorElement * hESRecHitTrend_[2][2]
Definition: ESTrendTask.h:76
MonitorElement * hESFiberErrTrend_
Definition: ESTrendTask.h:78
int j
Definition: DBlmapReader.cc:9
MonitorElement * hESFiberErrTrendHr_
Definition: ESTrendTask.h:82
void Reset(void)
reset ME (ie. contents, errors, etc)
MonitorElement * hESSLinkErrTrend_
Definition: ESTrendTask.h:77
void ESTrendTask::setup ( void  )
protected

Definition at line 95 of file ESTrendTask.cc.

References timingPdfMaker::histo, i, and j.

95  {
96 
97  init_ = true;
98 
99  char histo[200];
100 
101  if ( dqmStore_ ) {
102  dqmStore_->setCurrentFolder(prefixME_ + "/ESTrendTask");
103 
104  for (int i=0 ; i<2; ++i)
105  for (int j=0 ; j<2; ++j) {
106  int iz = (i==0)? 1:-1;
107  sprintf(histo, "ES Trending RH Occ per 5 mins Z %d P %d", iz, j+1);
108  hESRecHitTrend_[i][j] = dqmStore_->bookProfile(histo, histo, 36, 0.0, 180.0, 100, 0.0, 1.0e6, "s");
109  hESRecHitTrend_[i][j]->setAxisTitle("Elapse time (Minutes)", 1);
110  hESRecHitTrend_[i][j]->setAxisTitle("ES RecHit Occupancy / 5 minutes", 2);
111 
112  sprintf(histo, "ES Trending RH Occ per hour Z %d P %d", iz, j+1);
113  hESRecHitTrendHr_[i][j] = dqmStore_->bookProfile(histo, histo, 24, 0.0, 24.0, 100, 0.0, 1.0e6, "s");
114  hESRecHitTrendHr_[i][j]->setAxisTitle("Elapse time (Hours)", 1);
115  hESRecHitTrendHr_[i][j]->setAxisTitle("ES RecHit Occupancy / hour", 2);
116  }
117 
118  sprintf(histo, "ES Trending SLink CRC Error per 5 mins");
119  hESSLinkErrTrend_ = dqmStore_->bookProfile(histo, histo, 36, 0.0, 180.0, 100, 0.0, 1.0e6, "s");
120  hESSLinkErrTrend_->setAxisTitle("Elapse time (Minutes)", 1);
121  hESSLinkErrTrend_->setAxisTitle("ES SLink CRC Err / 5 minutes", 2);
122 
123  sprintf(histo, "ES Trending Fiber Error per 5 mins");
124  hESFiberErrTrend_ = dqmStore_->bookProfile(histo, histo, 36, 0.0, 180.0, 100, 0.0, 1.0e6, "s");
125  hESFiberErrTrend_->setAxisTitle("Elapse time (Minutes)", 1);
126  hESFiberErrTrend_->setAxisTitle("ES Fiber Err / 5 minutes", 2);
127 
128  sprintf(histo, "ES Trending SLink CRC Error per hour");
129  hESSLinkErrTrendHr_ = dqmStore_->bookProfile(histo, histo, 24, 0.0, 24.0, 100, 0.0, 1.0e6, "s");
130  hESSLinkErrTrendHr_->setAxisTitle("Elapse time (Hours)", 1);
131  hESSLinkErrTrendHr_->setAxisTitle("ES SLink CRC Err / hour", 2);
132 
133  sprintf(histo, "ES Trending Fiber Error per hour");
134  hESFiberErrTrendHr_ = dqmStore_->bookProfile(histo, histo, 24, 0.0, 24.0, 100, 0.0, 1.0e6, "s");
135  hESFiberErrTrendHr_->setAxisTitle("Elapse time (Hours)", 1);
136  hESFiberErrTrendHr_->setAxisTitle("ES Fiber Err / hour", 2);
137  }
138 
139 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * hESRecHitTrendHr_[2][2]
Definition: ESTrendTask.h:80
std::string prefixME_
Definition: ESTrendTask.h:67
MonitorElement * hESSLinkErrTrendHr_
Definition: ESTrendTask.h:81
MonitorElement * hESRecHitTrend_[2][2]
Definition: ESTrendTask.h:76
MonitorElement * hESFiberErrTrend_
Definition: ESTrendTask.h:78
int j
Definition: DBlmapReader.cc:9
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1186
DQMStore * dqmStore_
Definition: ESTrendTask.h:65
MonitorElement * hESFiberErrTrendHr_
Definition: ESTrendTask.h:82
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
MonitorElement * hESSLinkErrTrend_
Definition: ESTrendTask.h:77
void ESTrendTask::shift2Left ( TProfile *  p,
int  bins = 1 
)
protected

Definition at line 317 of file ESTrendTask.cc.

References i.

317  {
318 
319  if(bins <= 0) return;
320 
321  if(!p->GetSumw2()) p->Sumw2();
322  int nBins = p->GetXaxis()->GetNbins();
323 
324  // by shifting n bin to the left, the number of entries are
325  // reduced by the number in n bins including the underflow bin.
326  double nentries = p->GetEntries();
327  for(int i=0; i<bins; i++) nentries -= p->GetBinEntries(i);
328  p->SetEntries(nentries);
329 
330  // the first bin goes to underflow
331  // each bin moves to the right
332 
333  TArrayD* sumw2 = p->GetSumw2();
334 
335  for(int i=0; i<=nBins+1-bins; i++) {
336  // GetBinContent return binContent/binEntries
337  p->SetBinContent(i, p->GetBinContent(i+bins)*p->GetBinEntries(i+bins));
338  p->SetBinEntries(i,p->GetBinEntries(i+bins));
339  sumw2->SetAt(sumw2->GetAt(i+bins),i);
340  }
341 
342 }
int i
Definition: DBlmapReader.cc:9
void ESTrendTask::shift2Right ( TProfile *  p,
int  bins = 1 
)
protected

Definition at line 290 of file ESTrendTask.cc.

References i.

290  {
291 
292  if(bins <= 0) return;
293 
294  if(!p->GetSumw2()) p->Sumw2();
295  int nBins = p->GetXaxis()->GetNbins();
296 
297  // by shifting n bin to the right, the number of entries are
298  // reduced by the number in n bins including the overflow bin.
299  double nentries = p->GetEntries();
300  for(int i=0; i<bins; i++) nentries -= p->GetBinEntries(nBins+1-bins);
301  p->SetEntries(nentries);
302 
303  // the last bin goes to overflow
304  // each bin moves to the right
305 
306  TArrayD* sumw2 = p->GetSumw2();
307 
308  for(int i=nBins+1; i>bins; i--) {
309  // GetBinContent return binContent/binEntries
310  p->SetBinContent(i, p->GetBinContent(i-bins)*p->GetBinEntries(i-bins));
311  p->SetBinEntries(i,p->GetBinEntries(i-bins));
312  sumw2->SetAt(sumw2->GetAt(i-bins),i);
313  }
314 
315 }
int i
Definition: DBlmapReader.cc:9
void ESTrendTask::updateTime ( const edm::Event e)
protected

Definition at line 283 of file ESTrendTask.cc.

References edm::EventBase::time(), and edm::Timestamp::unixTime().

283  {
284 
286  current_time_ = e.time().unixTime();
287 
288 }
long int current_time_
Definition: ESTrendTask.h:87
unsigned int unixTime() const
Time in seconds since January 1, 1970.
Definition: Timestamp.h:46
long int last_time_
Definition: ESTrendTask.h:88
edm::Timestamp time() const
Definition: EventBase.h:57

Member Data Documentation

long int ESTrendTask::current_time_
private

Definition at line 87 of file ESTrendTask.h.

edm::EDGetTokenT<ESRawDataCollection> ESTrendTask::dccCollections_
private

Definition at line 74 of file ESTrendTask.h.

DQMStore* ESTrendTask::dqmStore_
private

Definition at line 65 of file ESTrendTask.h.

bool ESTrendTask::enableCleanup_
private

Definition at line 69 of file ESTrendTask.h.

MonitorElement* ESTrendTask::hESFiberErrTrend_
private

Definition at line 78 of file ESTrendTask.h.

MonitorElement* ESTrendTask::hESFiberErrTrendHr_
private

Definition at line 82 of file ESTrendTask.h.

MonitorElement* ESTrendTask::hESRecHitTrend_[2][2]
private

Definition at line 76 of file ESTrendTask.h.

MonitorElement* ESTrendTask::hESRecHitTrendHr_[2][2]
private

Definition at line 80 of file ESTrendTask.h.

MonitorElement* ESTrendTask::hESSLinkErrTrend_
private

Definition at line 77 of file ESTrendTask.h.

MonitorElement* ESTrendTask::hESSLinkErrTrendHr_
private

Definition at line 81 of file ESTrendTask.h.

int ESTrendTask::ievt_
private

Definition at line 63 of file ESTrendTask.h.

bool ESTrendTask::init_
private

Definition at line 84 of file ESTrendTask.h.

long int ESTrendTask::last_time_
private

Definition at line 88 of file ESTrendTask.h.

bool ESTrendTask::mergeRuns_
private

Definition at line 71 of file ESTrendTask.h.

std::string ESTrendTask::prefixME_
private

Definition at line 67 of file ESTrendTask.h.

edm::EDGetTokenT<ESRecHitCollection> ESTrendTask::rechittoken_
private

Definition at line 73 of file ESTrendTask.h.

long int ESTrendTask::start_time_
private

Definition at line 86 of file ESTrendTask.h.