CMS 3D CMS Logo

ApvAnalysis Class Reference

ApvAnalysis is the base class for the simulation of APV/FED. More...

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

List of all members.

Public Types

typedef std::vector< float > PedestalType
typedef edm::DetSet
< SiStripRawDigi
RawSignalType

Public Member Functions

 ApvAnalysis (int nev)
TkCommonModeCalculatorcommonModeCalculator ()
TkApvMaskmask ()
void newEvent () const
TkNoiseCalculatornoiseCalculator ()
TkPedestalCalculatorpedestalCalculator ()
void setCommonModeCalculator (TkCommonModeCalculator &in)
void setMask (TkApvMask &in)
void setNoiseCalculator (TkNoiseCalculator &in)
void setPedestalCalculator (TkPedestalCalculator &in)
void updateCalibration (edm::DetSet< SiStripRawDigi > &in)
 Update pedestals & noise with current event.
 ~ApvAnalysis ()

Private Attributes

int eventsRequiredToUpdate_
int nEventsForNoiseCalibration_
TkApvMasktheTkApvMask
TkCommonModeCalculatortheTkCommonModeCalculator
TkNoiseCalculatortheTkNoiseCalculator
TkPedestalCalculatortheTkPedestalCalculator


Detailed Description

ApvAnalysis is the base class for the simulation of APV/FED.

Each instance has

Definition at line 41 of file ApvAnalysis.h.


Member Typedef Documentation

typedef std::vector<float> ApvAnalysis::PedestalType

Definition at line 48 of file ApvAnalysis.h.

typedef edm::DetSet<SiStripRawDigi> ApvAnalysis::RawSignalType

Definition at line 47 of file ApvAnalysis.h.


Constructor & Destructor Documentation

ApvAnalysis::ApvAnalysis ( int  nev  ) 

Definition at line 9 of file ApvAnalysis.cc.

References eventsRequiredToUpdate_, nEventsForNoiseCalibration_, theTkApvMask, theTkCommonModeCalculator, theTkNoiseCalculator, and theTkPedestalCalculator.

00010 {
00011 
00012   theTkCommonModeCalculator =0;
00013   theTkPedestalCalculator =0;
00014   theTkNoiseCalculator =0;
00015   theTkApvMask =0;
00016   nEventsForNoiseCalibration_ =0;
00017   eventsRequiredToUpdate_ = nEvForUpdate;
00018 
00019 
00020 
00021 }

ApvAnalysis::~ApvAnalysis (  )  [inline]

Definition at line 51 of file ApvAnalysis.h.

00051 {;}


Member Function Documentation

TkCommonModeCalculator& ApvAnalysis::commonModeCalculator (  )  [inline]

Definition at line 62 of file ApvAnalysis.h.

References theTkCommonModeCalculator.

Referenced by ApvAnalysisFactory::deleteApv().

00062 {return *theTkCommonModeCalculator;}

TkApvMask& ApvAnalysis::mask (  )  [inline]

Definition at line 65 of file ApvAnalysis.h.

References theTkApvMask.

Referenced by ApvAnalysisFactory::deleteApv().

00065 {return *theTkApvMask;}

void ApvAnalysis::newEvent (  )  const

Definition at line 22 of file ApvAnalysis.cc.

References TkPedestalCalculator::newEvent(), TkCommonModeCalculator::newEvent(), TkNoiseCalculator::newEvent(), theTkCommonModeCalculator, theTkNoiseCalculator, and theTkPedestalCalculator.

TkNoiseCalculator& ApvAnalysis::noiseCalculator (  )  [inline]

Definition at line 64 of file ApvAnalysis.h.

References theTkNoiseCalculator.

Referenced by ApvAnalysisFactory::deleteApv().

00064 {return *theTkNoiseCalculator;}

TkPedestalCalculator& ApvAnalysis::pedestalCalculator (  )  [inline]

Definition at line 63 of file ApvAnalysis.h.

References theTkPedestalCalculator.

Referenced by ApvAnalysisFactory::deleteApv().

00063 {return *theTkPedestalCalculator;}

void ApvAnalysis::setCommonModeCalculator ( TkCommonModeCalculator in  )  [inline]

Definition at line 57 of file ApvAnalysis.h.

References theTkCommonModeCalculator.

Referenced by ApvAnalysisFactory::constructAuxiliaryApvClasses().

void ApvAnalysis::setMask ( TkApvMask in  )  [inline]

Definition at line 60 of file ApvAnalysis.h.

References theTkApvMask.

Referenced by ApvAnalysisFactory::constructAuxiliaryApvClasses().

00060 {theTkApvMask=&in;}

void ApvAnalysis::setNoiseCalculator ( TkNoiseCalculator in  )  [inline]

Definition at line 59 of file ApvAnalysis.h.

References theTkNoiseCalculator.

Referenced by ApvAnalysisFactory::constructAuxiliaryApvClasses().

00059 {theTkNoiseCalculator = &in;} 

void ApvAnalysis::setPedestalCalculator ( TkPedestalCalculator in  )  [inline]

Definition at line 58 of file ApvAnalysis.h.

References theTkPedestalCalculator.

Referenced by ApvAnalysisFactory::constructAuxiliaryApvClasses().

00058 {theTkPedestalCalculator = &in;} 

void ApvAnalysis::updateCalibration ( edm::DetSet< SiStripRawDigi > &  in  ) 

Update pedestals & noise with current event.

Definition at line 28 of file ApvAnalysis.cc.

References TkApvMask::calculateMask(), edm::DetSet< T >::data, TkCommonModeCalculator::doIt(), eventsRequiredToUpdate_, i, TkStateMachine::isUpdating(), it, nEventsForNoiseCalibration_, TkNoiseCalculator::noise(), pedestal, TkPedestalCalculator::pedestal(), TkPedestalCalculator::rawNoise(), TkNoiseCalculator::setStripNoise(), TkPedestalCalculator::status(), theTkApvMask, theTkCommonModeCalculator, theTkNoiseCalculator, theTkPedestalCalculator, tmp, tmp2, TkNoiseCalculator::updateNoise(), and TkPedestalCalculator::updatePedestal().

00028                                                                  {
00029   theTkPedestalCalculator->updatePedestal(in);
00030   
00031   PedestalType noise;
00032   if(theTkPedestalCalculator->status()->isUpdating()){
00033     nEventsForNoiseCalibration_++; 
00034 
00035     if(theTkNoiseCalculator->noise().size() == 0) {
00036       noise = theTkPedestalCalculator->rawNoise();
00037       theTkNoiseCalculator->setStripNoise(noise);
00038       theTkApvMask->calculateMask(noise);
00039     }
00040 
00041     PedestalType pedestal= theTkPedestalCalculator->pedestal();
00042     PedestalType tmp;
00043     tmp.clear();
00044     edm::DetSet<SiStripRawDigi>::const_iterator it = in.data.begin();
00045     int i=0;
00046     for(;it!= in.data.end();it++){
00047       tmp.push_back((*it).adc() - pedestal[i]);
00048       i++;
00049     }
00050     PedestalType tmp2 = theTkCommonModeCalculator->doIt(tmp);
00051     if(tmp2.size() > 0) {
00052       theTkNoiseCalculator->updateNoise(tmp2);
00053     }   
00054     if(nEventsForNoiseCalibration_%eventsRequiredToUpdate_ == 1 && nEventsForNoiseCalibration_ >1)
00055       {
00056 
00057         noise=theTkNoiseCalculator->noise();
00058         theTkApvMask->calculateMask(noise);
00059         
00060       }
00061   }
00062 
00063 
00064 }


Member Data Documentation

int ApvAnalysis::eventsRequiredToUpdate_ [private]

Definition at line 83 of file ApvAnalysis.h.

Referenced by ApvAnalysis(), and updateCalibration().

int ApvAnalysis::nEventsForNoiseCalibration_ [private]

Definition at line 82 of file ApvAnalysis.h.

Referenced by ApvAnalysis(), and updateCalibration().

TkApvMask* ApvAnalysis::theTkApvMask [private]

Definition at line 81 of file ApvAnalysis.h.

Referenced by ApvAnalysis(), mask(), setMask(), and updateCalibration().

TkCommonModeCalculator* ApvAnalysis::theTkCommonModeCalculator [private]

Definition at line 78 of file ApvAnalysis.h.

Referenced by ApvAnalysis(), commonModeCalculator(), newEvent(), setCommonModeCalculator(), and updateCalibration().

TkNoiseCalculator* ApvAnalysis::theTkNoiseCalculator [private]

Definition at line 80 of file ApvAnalysis.h.

Referenced by ApvAnalysis(), newEvent(), noiseCalculator(), setNoiseCalculator(), and updateCalibration().

TkPedestalCalculator* ApvAnalysis::theTkPedestalCalculator [private]

Definition at line 79 of file ApvAnalysis.h.

Referenced by ApvAnalysis(), newEvent(), pedestalCalculator(), setPedestalCalculator(), and updateCalibration().


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