#include <CalibTracker/SiStripAPVAnalysis/interface/TT6ApvMask.h>
Public Member Functions | |
void | calculateMask (ApvAnalysis::PedestalType) |
MaskType | mask () |
void | setMask (MaskType in) |
TT6ApvMask (int ctype, float ncut, float dcut, float tcut) | |
virtual | ~TT6ApvMask () |
Protected Member Functions | |
bool | defineNoisy (float avrg, float rms, float noise) |
Private Attributes | |
int | theCalculationFlag_ |
float | theDeadCut_ |
MaskType | theMask_ |
float | theNoiseCut_ |
float | theTruncationCut_ |
Definition at line 10 of file TT6ApvMask.h.
TT6ApvMask::TT6ApvMask | ( | int | ctype, | |
float | ncut, | |||
float | dcut, | |||
float | tcut | |||
) |
Definition at line 9 of file TT6ApvMask.cc.
References theCalculationFlag_, theDeadCut_, theNoiseCut_, and theTruncationCut_.
00009 { 00010 theCalculationFlag_ = ctype; 00011 theNoiseCut_ = ncut; 00012 theDeadCut_ = dcut; 00013 theTruncationCut_ = tcut; 00014 }
TT6ApvMask::~TT6ApvMask | ( | ) | [virtual] |
Definition at line 19 of file TT6ApvMask.cc.
References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().
void TT6ApvMask::calculateMask | ( | ApvAnalysis::PedestalType | in | ) | [virtual] |
Implements TkApvMask.
Definition at line 25 of file TT6ApvMask.cc.
References GenMuonPlsPt100GeV_cfg::cout, TkApvMask::dead, defineNoisy(), lat::endl(), i, int, TkApvMask::noisy, TkApvMask::ok, python::multivaluedict::sort(), funct::sqrt(), theDeadCut_, theMask_, and theTruncationCut_.
00025 { 00026 00027 theMask_.clear(); 00028 ApvAnalysis::PedestalType temp_in(in); 00029 double sumVal,sqSumVal,avVal,sqAvVal,rmsVal; 00030 sort(temp_in.begin(), temp_in.end()); 00031 int nSize = in.size(); 00032 int cutLow = int(nSize * theTruncationCut_); 00033 int cutHigh = int(nSize * theTruncationCut_); 00034 int effSize = nSize - cutLow - cutHigh; 00035 sumVal = 0.0; 00036 sqSumVal = 0.0; 00037 sumVal = accumulate((temp_in.begin()+cutLow), (temp_in.end()-cutHigh), 0.0); 00038 sqSumVal = inner_product((temp_in.begin()+cutLow), (temp_in.end()-cutHigh), 00039 (temp_in.begin()+cutLow), 0.0); 00040 00041 avVal = (effSize) ? sumVal/float(effSize):0.0; 00042 sqAvVal = (effSize) ? sqSumVal/float(effSize):0.0; 00043 rmsVal = (sqAvVal - avVal*avVal > 0.0) ? sqrt(sqAvVal - avVal*avVal):0.0; 00044 if (0) cout << " TT6ApvMask::calculateMask Mean " << avVal << 00045 " RMS " << rmsVal << " " << effSize << endl; 00046 for (unsigned int i=0; i<in.size(); i++){ 00047 if (defineNoisy( static_cast<float>(avVal), 00048 static_cast<float>(rmsVal),in[i])) { 00049 theMask_.push_back(noisy); 00050 } else if (in[i] < theDeadCut_*avVal) { 00051 theMask_.push_back(dead); 00052 } else { 00053 theMask_.push_back(ok); 00054 } 00055 } 00056 }
bool TT6ApvMask::defineNoisy | ( | float | avrg, | |
float | rms, | |||
float | noise | |||
) | [protected] |
Definition at line 62 of file TT6ApvMask.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), pyDBSRunClass::temp, theCalculationFlag_, and theNoiseCut_.
Referenced by calculateMask().
00062 { 00063 bool temp; 00064 temp=false; 00065 if (theCalculationFlag_ == 1){ 00066 if ((noise-avrg) > theNoiseCut_*rms) { 00067 temp=true; 00068 if (0) cout << " Mean " << avrg << " rms " << rms << " Noise " << noise << endl; 00069 } 00070 } else if (theCalculationFlag_ == 2){ 00071 if ((noise-avrg) > avrg*theNoiseCut_) temp=true; 00072 } else if (theCalculationFlag_ == 3){ 00073 if (noise > theNoiseCut_) temp=true; 00074 } 00075 return temp; 00076 }
MaskType TT6ApvMask::mask | ( | ) | [inline, virtual] |
Implements TkApvMask.
Definition at line 19 of file TT6ApvMask.h.
References theMask_.
00019 {return theMask_;}
int TT6ApvMask::theCalculationFlag_ [private] |
float TT6ApvMask::theDeadCut_ [private] |
MaskType TT6ApvMask::theMask_ [private] |
float TT6ApvMask::theNoiseCut_ [private] |
float TT6ApvMask::theTruncationCut_ [private] |