Skip to content

Commit

Permalink
ENH: add possibility to reset the histograms
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLP committed Apr 10, 2016
1 parent ecb7f05 commit 40e3802
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pybar_fei4_interpreter/Interpret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,14 @@ void Interpret::resetEventVariables()
tTotalHits = 0;
}

void Interpret::resetHistograms()
{
resetTriggerErrorCounterArray();
resetErrorCounterArray();
resetTdcCounterArray();
resetServiceRecordCounterArray();
}

void Interpret::createMetaDataWordIndex(bool CreateMetaDataWordIndex)
{
debug("createMetaDataWordIndex");
Expand Down
1 change: 1 addition & 0 deletions pybar_fei4_interpreter/Interpret.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Interpret: public Basis
//initializers, should be called before first call of interpretRawData() with new data file
void resetCounters(); //reset summary counters
void resetEventVariables(); //resets event variables before starting new event
void resetHistograms(); //reset the histograms (TDC, trigger error, event status ...)

//analysis options
void setHitsArraySize(const unsigned int &rSize); //set the siye of the hit array, has to be able to hold hits of one event
Expand Down
3 changes: 3 additions & 0 deletions pybar_fei4_interpreter/data_interpreter.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ cdef extern from "Interpret.h":
unsigned int getHitSize()

void reset()
void resetHistograms()
void resetMetaDataCounter()

unsigned int getNhits()
Expand Down Expand Up @@ -211,6 +212,8 @@ cdef class PyDataInterpreter:
self.thisptr.reset()
def reset_meta_data_counter(self):
self.thisptr.resetMetaDataCounter()
def reset_histograms(self):
self.thisptr.resetHistograms()
def get_n_hits(self):
return <unsigned int> self.thisptr.getNhits()
def get_n_events(self):
Expand Down

0 comments on commit 40e3802

Please sign in to comment.