#include <MedianCommonModeCalculator.h>
Public Member Functions | |
TkCommonMode * | commonMode () |
ApvAnalysis::PedestalType | doIt (ApvAnalysis::PedestalType) |
float | getCMSlope () |
MedianCommonModeCalculator () | |
void | newEvent () |
void | setCM (TkCommonMode *in) |
void | setCM (std::vector< float > in) |
virtual | ~MedianCommonModeCalculator () |
Protected Member Functions | |
void | calculateCommonMode (ApvAnalysis::PedestalType &) |
Protected Attributes | |
bool | alreadyUsedEvent |
float | slope |
std::vector< float > | theCommonModeValues |
TkCommonMode * | theTkCommonMode |
Concrete implementation of TkCommonModeCalculator for Median.
Definition at line 11 of file MedianCommonModeCalculator.h.
MedianCommonModeCalculator::MedianCommonModeCalculator | ( | ) |
Definition at line 5 of file MedianCommonModeCalculator.cc.
References gather_cfg::cout.
: // theNoiseCalculator(noise_calc), // theApvMask(mask_calc), alreadyUsedEvent(false) { if (0) cout << "Constructing MedianCommonMode Calculator ..." << endl; // cutToAvoidSignal = sig_cut; }
MedianCommonModeCalculator::~MedianCommonModeCalculator | ( | ) | [virtual] |
Definition at line 16 of file MedianCommonModeCalculator.cc.
References gather_cfg::cout.
{ if (0) cout << "Destructing TT6CommonModeCalculator " << endl; }
void MedianCommonModeCalculator::calculateCommonMode | ( | ApvAnalysis::PedestalType & | indat | ) | [protected] |
Definition at line 41 of file MedianCommonModeCalculator.cc.
References alreadyUsedEvent, getHLTprescales::index, setCM(), python::multivaluedict::sort(), and theCommonModeValues.
{ if (alreadyUsedEvent == false) { alreadyUsedEvent = true; theCommonModeValues.clear(); double avVal = 0.0; sort(indat.begin(),indat.end()); uint16_t index = indat.size()%2 ? indat.size()/2 : indat.size()/2-1; if ( !indat.empty() ) { avVal = indat[index]; } theCommonModeValues.push_back(static_cast<float>(avVal)); MedianCommonModeCalculator::setCM(theCommonModeValues); } }
TkCommonMode* MedianCommonModeCalculator::commonMode | ( | ) | [inline, virtual] |
Get CM value
Implements TkCommonModeCalculator.
Definition at line 22 of file MedianCommonModeCalculator.h.
References theTkCommonMode.
{return theTkCommonMode;}
ApvAnalysis::PedestalType MedianCommonModeCalculator::doIt | ( | ApvAnalysis::PedestalType | ) | [virtual] |
Return CM-subtracted data in APV
Implements TkCommonModeCalculator.
Definition at line 23 of file MedianCommonModeCalculator.cc.
References i, and dbtoconf::out.
{ ApvAnalysis::PedestalType out; calculateCommonMode(indat); int setNumber; if(theCommonModeValues.size() >0) { for (unsigned int i=0; i<indat.size(); i++){ setNumber = theTkCommonMode->topology().setOfStrip(i); out.push_back(indat[i] - theCommonModeValues[setNumber]); } }else{ out = indat; } return out; }
float MedianCommonModeCalculator::getCMSlope | ( | ) | [inline, virtual] |
Get Slope
Implements TkCommonModeCalculator.
Definition at line 25 of file MedianCommonModeCalculator.h.
References slope.
{ return slope;}
void MedianCommonModeCalculator::newEvent | ( | ) | [virtual] |
Tell CM calculator that a new event is available
Reimplemented from TkCommonModeCalculator.
Definition at line 67 of file MedianCommonModeCalculator.cc.
References alreadyUsedEvent.
{ alreadyUsedEvent = false; }
void MedianCommonModeCalculator::setCM | ( | std::vector< float > | in | ) | [inline, virtual] |
Implements TkCommonModeCalculator.
Definition at line 21 of file MedianCommonModeCalculator.h.
References TkCommonMode::setCommonMode(), and theTkCommonMode.
void MedianCommonModeCalculator::setCM | ( | TkCommonMode * | in | ) | [inline, virtual] |
Implements TkCommonModeCalculator.
Definition at line 20 of file MedianCommonModeCalculator.h.
References recoMuon::in, and theTkCommonMode.
Referenced by calculateCommonMode().
{theTkCommonMode = in;}
bool MedianCommonModeCalculator::alreadyUsedEvent [protected] |
Definition at line 33 of file MedianCommonModeCalculator.h.
Referenced by calculateCommonMode(), and newEvent().
float MedianCommonModeCalculator::slope [protected] |
Definition at line 34 of file MedianCommonModeCalculator.h.
Referenced by getCMSlope().
std::vector<float> MedianCommonModeCalculator::theCommonModeValues [protected] |
Definition at line 32 of file MedianCommonModeCalculator.h.
Referenced by calculateCommonMode().
TkCommonMode* MedianCommonModeCalculator::theTkCommonMode [protected] |
Definition at line 31 of file MedianCommonModeCalculator.h.
Referenced by commonMode(), and setCM().