CMS 3D CMS Logo

TT6ApvMask Class Reference

Concrete implementation of TkApvMask for TT6. More...

#include <CalibTracker/SiStripAPVAnalysis/interface/TT6ApvMask.h>

Inheritance diagram for TT6ApvMask:

TkApvMask

List of all members.

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_


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.

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().

00019                        {
00020   if (0) cout << "Destructing TT6ApvMask " << endl;
00021 }


Member Function Documentation

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_;}

void TT6ApvMask::setMask ( MaskType  in  )  [inline]

Definition at line 18 of file TT6ApvMask.h.

References theMask_.

00018 {theMask_ = in;}


Member Data Documentation

int TT6ApvMask::theCalculationFlag_ [private]

Definition at line 28 of file TT6ApvMask.h.

Referenced by defineNoisy(), and TT6ApvMask().

float TT6ApvMask::theDeadCut_ [private]

Definition at line 30 of file TT6ApvMask.h.

Referenced by calculateMask(), and TT6ApvMask().

MaskType TT6ApvMask::theMask_ [private]

Definition at line 27 of file TT6ApvMask.h.

Referenced by calculateMask(), mask(), and setMask().

float TT6ApvMask::theNoiseCut_ [private]

Definition at line 29 of file TT6ApvMask.h.

Referenced by defineNoisy(), and TT6ApvMask().

float TT6ApvMask::theTruncationCut_ [private]

Definition at line 31 of file TT6ApvMask.h.

Referenced by calculateMask(), and TT6ApvMask().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:34:39 2009 for CMSSW by  doxygen 1.5.4