CMS 3D CMS Logo

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 (const ApvAnalysis::PedestalType &) override
 
MaskType mask () override
 
void setMask (const MaskType &in) override
 
 TT6ApvMask (int ctype, float ncut, float dcut, float tcut)
 
 ~TT6ApvMask () override
 
- 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< StripMaskTypeMaskType
 
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::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 }

◆ ~TT6ApvMask()

TT6ApvMask::~TT6ApvMask ( )
override

Definition at line 19 of file TT6ApvMask.cc.

19  {
20  if (false)
21  cout << "Destructing TT6ApvMask " << endl;
22 }

References gather_cfg::cout.

Member Function Documentation

◆ calculateMask()

void TT6ApvMask::calculateMask ( const ApvAnalysis::PedestalType in)
overridevirtual

Implements TkApvMask.

Definition at line 26 of file TT6ApvMask.cc.

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), (temp_in.begin() + cutLow), 0.0);
39 
40  avVal = (effSize) ? sumVal / float(effSize) : 0.0;
41  sqAvVal = (effSize) ? sqSumVal / float(effSize) : 0.0;
42  rmsVal = (sqAvVal - avVal * avVal > 0.0) ? sqrt(sqAvVal - avVal * avVal) : 0.0;
43  if (false)
44  cout << " TT6ApvMask::calculateMask Mean " << avVal << " RMS " << rmsVal << " " << effSize << endl;
45  for (unsigned int i = 0; i < in.size(); i++) {
46  if (defineNoisy(static_cast<float>(avVal), static_cast<float>(rmsVal), in[i])) {
47  theMask_.push_back(noisy);
48  } else if (in[i] < theDeadCut_ * avVal) {
49  theMask_.push_back(dead);
50  } else {
51  theMask_.push_back(ok);
52  }
53  }
54 }

References gather_cfg::cout, mps_fire::i, recoMuon::in, createfilelist::int, convertSQLiteXML::ok, and mathSSE::sqrt().

◆ defineNoisy()

bool TT6ApvMask::defineNoisy ( float  avrg,
float  rms,
float  noise 
)
protected

Definition at line 60 of file TT6ApvMask.cc.

60  {
61  bool temp;
62  temp = false;
63  if (theCalculationFlag_ == 1) {
64  if ((noise - avrg) > theNoiseCut_ * rms) {
65  temp = true;
66  if (false)
67  cout << " Mean " << avrg << " rms " << rms << " Noise " << noise << endl;
68  }
69  } else if (theCalculationFlag_ == 2) {
70  if ((noise - avrg) > avrg * theNoiseCut_)
71  temp = true;
72  } else if (theCalculationFlag_ == 3) {
73  if (noise > theNoiseCut_)
74  temp = true;
75  }
76  return temp;
77 }

References gather_cfg::cout, hgcalDigitizer_cfi::noise, SiStripPI::rms, and groupFilesInBlocks::temp.

◆ mask()

MaskType TT6ApvMask::mask ( )
inlineoverridevirtual

Implements TkApvMask.

Definition at line 18 of file TT6ApvMask.h.

18 { return theMask_; }

References theMask_.

◆ setMask()

void TT6ApvMask::setMask ( const MaskType in)
inlineoverridevirtual

Implements TkApvMask.

Definition at line 17 of file TT6ApvMask.h.

17 { theMask_ = in; }

References recoMuon::in, and theMask_.

Member Data Documentation

◆ theCalculationFlag_

int TT6ApvMask::theCalculationFlag_
private

Definition at line 27 of file TT6ApvMask.h.

◆ theDeadCut_

float TT6ApvMask::theDeadCut_
private

Definition at line 29 of file TT6ApvMask.h.

◆ theMask_

MaskType TT6ApvMask::theMask_
private

Definition at line 26 of file TT6ApvMask.h.

Referenced by mask(), and setMask().

◆ theNoiseCut_

float TT6ApvMask::theNoiseCut_
private

Definition at line 28 of file TT6ApvMask.h.

◆ theTruncationCut_

float TT6ApvMask::theTruncationCut_
private

Definition at line 30 of file TT6ApvMask.h.

TT6ApvMask::theTruncationCut_
float theTruncationCut_
Definition: TT6ApvMask.h:30
mps_fire.i
i
Definition: mps_fire.py:355
TT6ApvMask::defineNoisy
bool defineNoisy(float avrg, float rms, float noise)
Definition: TT6ApvMask.cc:60
gather_cfg.cout
cout
Definition: gather_cfg.py:144
TT6ApvMask::theCalculationFlag_
int theCalculationFlag_
Definition: TT6ApvMask.h:27
SiStripPI::rms
Definition: SiStripPayloadInspectorHelper.h:169
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
TT6ApvMask::theMask_
MaskType theMask_
Definition: TT6ApvMask.h:26
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
recoMuon::in
Definition: RecoMuonEnumerators.h:6
hgcalDigitizer_cfi.noise
noise
Definition: hgcalDigitizer_cfi.py:150
TkApvMask::ok
Definition: TkApvMask.h:13
createfilelist.int
int
Definition: createfilelist.py:10
TT6ApvMask::theNoiseCut_
float theNoiseCut_
Definition: TT6ApvMask.h:28
TkApvMask::dead
Definition: TkApvMask.h:13
TkApvMask::noisy
Definition: TkApvMask.h:13
TT6ApvMask::theDeadCut_
float theDeadCut_
Definition: TT6ApvMask.h:29
ApvAnalysis::PedestalType
std::vector< float > PedestalType
Definition: ApvAnalysis.h:44