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
TT6ApvMask Class Reference

#include <TT6ApvMask.h>

Inheritance diagram for TT6ApvMask:
TkApvMask

Public Member Functions

void calculateMask (ApvAnalysis::PedestalType)
 
MaskType mask ()
 
void setMask (MaskType in)
 
 TT6ApvMask (int ctype, float ncut, float dcut, float tcut)
 
virtual ~TT6ApvMask ()
 
- Public Member Functions inherited from TkApvMask
virtual ~TkApvMask ()
 

Protected Member Functions

bool defineNoisy (float avrg, float rms, float noise)
 

Private Attributes

int theCalculationFlag_
 
float theDeadCut_
 
MaskType theMask_
 
float theNoiseCut_
 
float theTruncationCut_
 

Additional Inherited Members

- Public Types inherited from TkApvMask
typedef std::vector
< StripMaskType
MaskType
 
enum  StripMaskType { ok =0, dead =1, noisy =2 }
 

Detailed Description

Concrete implementation of TkApvMask for TT6.

Definition at line 10 of file TT6ApvMask.h.

Constructor & Destructor Documentation

TT6ApvMask::TT6ApvMask ( int  ctype,
float  ncut,
float  dcut,
float  tcut 
)

Definition at line 9 of file TT6ApvMask.cc.

9  {
10  theCalculationFlag_ = ctype;
11  theNoiseCut_ = ncut;
12  theDeadCut_ = dcut;
13  theTruncationCut_ = tcut;
14 }
int theCalculationFlag_
Definition: TT6ApvMask.h:28
float theDeadCut_
Definition: TT6ApvMask.h:30
float theNoiseCut_
Definition: TT6ApvMask.h:29
float theTruncationCut_
Definition: TT6ApvMask.h:31
TT6ApvMask::~TT6ApvMask ( )
virtual

Definition at line 19 of file TT6ApvMask.cc.

References gather_cfg::cout.

19  {
20  if (0) cout << "Destructing TT6ApvMask " << endl;
21 }
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

void TT6ApvMask::calculateMask ( ApvAnalysis::PedestalType  in)
virtual

Implements TkApvMask.

Definition at line 25 of file TT6ApvMask.cc.

References gather_cfg::cout, i, convertSQLiteXML::ok, python.multivaluedict::sort(), and mathSSE::sqrt().

25  {
26 
27  theMask_.clear();
29  double sumVal,sqSumVal,avVal,sqAvVal,rmsVal;
30  sort(temp_in.begin(), temp_in.end());
31  int nSize = in.size();
32  int cutLow = int(nSize * theTruncationCut_);
33  int cutHigh = int(nSize * theTruncationCut_);
34  int effSize = nSize - cutLow - cutHigh;
35  sumVal = 0.0;
36  sqSumVal = 0.0;
37  sumVal = accumulate((temp_in.begin()+cutLow), (temp_in.end()-cutHigh), 0.0);
38  sqSumVal = inner_product((temp_in.begin()+cutLow), (temp_in.end()-cutHigh),
39  (temp_in.begin()+cutLow), 0.0);
40 
41  avVal = (effSize) ? sumVal/float(effSize):0.0;
42  sqAvVal = (effSize) ? sqSumVal/float(effSize):0.0;
43  rmsVal = (sqAvVal - avVal*avVal > 0.0) ? sqrt(sqAvVal - avVal*avVal):0.0;
44  if (0) cout << " TT6ApvMask::calculateMask Mean " << avVal <<
45  " RMS " << rmsVal << " " << effSize << endl;
46  for (unsigned int i=0; i<in.size(); i++){
47  if (defineNoisy( static_cast<float>(avVal),
48  static_cast<float>(rmsVal),in[i])) {
49  theMask_.push_back(noisy);
50  } else if (in[i] < theDeadCut_*avVal) {
51  theMask_.push_back(dead);
52  } else {
53  theMask_.push_back(ok);
54  }
55  }
56 }
int i
Definition: DBlmapReader.cc:9
std::vector< float > PedestalType
Definition: ApvAnalysis.h:48
float theDeadCut_
Definition: TT6ApvMask.h:30
MaskType theMask_
Definition: TT6ApvMask.h:27
bool defineNoisy(float avrg, float rms, float noise)
Definition: TT6ApvMask.cc:62
T sqrt(T t)
Definition: SSEVec.h:46
tuple cout
Definition: gather_cfg.py:121
float theTruncationCut_
Definition: TT6ApvMask.h:31
bool TT6ApvMask::defineNoisy ( float  avrg,
float  rms,
float  noise 
)
protected

Definition at line 62 of file TT6ApvMask.cc.

References gather_cfg::cout, and groupFilesInBlocks::temp.

62  {
63  bool temp;
64  temp=false;
65  if (theCalculationFlag_ == 1){
66  if ((noise-avrg) > theNoiseCut_*rms) {
67  temp=true;
68  if (0) cout << " Mean " << avrg << " rms " << rms << " Noise " << noise << endl;
69  }
70  } else if (theCalculationFlag_ == 2){
71  if ((noise-avrg) > avrg*theNoiseCut_) temp=true;
72  } else if (theCalculationFlag_ == 3){
73  if (noise > theNoiseCut_) temp=true;
74  }
75  return temp;
76 }
int theCalculationFlag_
Definition: TT6ApvMask.h:28
float theNoiseCut_
Definition: TT6ApvMask.h:29
tuple cout
Definition: gather_cfg.py:121
MaskType TT6ApvMask::mask ( )
inlinevirtual

Implements TkApvMask.

Definition at line 19 of file TT6ApvMask.h.

References theMask_.

19 {return theMask_;}
MaskType theMask_
Definition: TT6ApvMask.h:27
void TT6ApvMask::setMask ( MaskType  in)
inlinevirtual

Implements TkApvMask.

Definition at line 18 of file TT6ApvMask.h.

References recoMuon::in, and theMask_.

18 {theMask_ = in;}
MaskType theMask_
Definition: TT6ApvMask.h:27

Member Data Documentation

int TT6ApvMask::theCalculationFlag_
private

Definition at line 28 of file TT6ApvMask.h.

float TT6ApvMask::theDeadCut_
private

Definition at line 30 of file TT6ApvMask.h.

MaskType TT6ApvMask::theMask_
private

Definition at line 27 of file TT6ApvMask.h.

Referenced by mask(), and setMask().

float TT6ApvMask::theNoiseCut_
private

Definition at line 29 of file TT6ApvMask.h.

float TT6ApvMask::theTruncationCut_
private

Definition at line 31 of file TT6ApvMask.h.