Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes

TPedestalExtractor Class Reference

#include <TPedestalExtractor.h>

Collaboration diagram for TPedestalExtractor:
Collaboration graph
[legend]

Public Member Functions

 TPedestalExtractor (Int_t nRocs=8, Int_t nNxs=4, Int_t nChannels=128, Int_t nAdcBins=4096, Double_t adcMin=0.0, Double_t adcMax=4096.0)
virtual ~TPedestalExtractor ()
void AddHit (Int_t iRoc, Int_t iNx, Int_t iChannel, Int_t adc)
void Extract ()
 *
void Reset ()
Double_t GetPedestal (Int_t iRoc, Int_t iNx, Int_t iChannel)
TH1 * GetHistogram (Int_t iRoc, Int_t iNx, Int_t iChannel)
void Print ()
Int_t GetNxNum ()
 TPedestalExtractor (Int_t nRocs, Int_t nNxs, roc::SysMessageUserTypes initialState=roc::SYSMSG_USER_RECONFIGURE, Int_t nChannels=128, Int_t nAdcBins=4096, Double_t adcMin=0.0, Double_t adcMax=4096.0)
virtual ~TPedestalExtractor ()
void ResetCalibrData ()
void ResetCalibrData (Int_t rocId)
void ResetCalibrResults ()
void ResetCalibrResults (Int_t rocId)
void ResetLastCalibrTime ()
void ResetLastCalibrTime (Int_t rocId)
void Extract ()
void Extract (Int_t idRoc)
Int_t ExtractAutocalibrStream (roc::Message const &msg, uint64_t fullTime)
Int_t ExtractAutocalibrLmd (std::string lmdFileName, roc::SysMessageUserTypes initialState=roc::SYSMSG_USER_RECONFIGURE, Int_t skipCalibrIterations=0)
Int_t ExtractExttrigStream (roc::Message const &msg, uint64_t fullTime)
Float_t GetPedestal (Int_t roc, Int_t nx, Int_t channel) const
uint64_t GetLastCalibrTime (Int_t rocId) const
Float_t GetWidth (Int_t iRoc, Int_t iNx, Int_t iChannel) const
TH1F * GetHistogram (Int_t roc, Int_t nx, Int_t channel)
TH2F * GetHist2DCopy (Int_t roc, Int_t nx)
uint64_t GetSelftrigCalibrPeriod () const
Int_t GetNxArrSize () const
Int_t GetNChannels () const
Int_t GetRocArrSize () const
roc::SysMessageUserTypes GetState (Int_t roc) const
Bool_t IsExtracted (Int_t roc) const
Bool_t IsOneExtracted () const
Bool_t IsAllExtracted () const
void LoadFromFile (Char_t const *fileName)
void Print () const
void Print (Int_t roc) const
void SaveToFile (Char_t const *fileName) const
void SetVerbose (Int_t verbose)
void SetExttrigCalibrPeriod (uint64_t period)
Int_t WatchState (roc::Message const &msg)
void WatchPedestalMessages (roc::Message const &msg, Long64_t const fullTime=0)

Static Public Member Functions

static void Extract (TH1 *hist, Double_t &pedestal, Double_t &width)
static void Extract (TH1 *hist, Float_t &pedestal, Float_t &width)

Private Types

typedef TH1F THistogramType

Private Member Functions

Int_t IndexEnc (Int_t iRoc, Int_t iNx, Int_t iChannel)
void IndexDec (Int_t index, Int_t &iRoc, Int_t &iNx, Int_t &iChannel)
Int_t IndexMax ()
bool TestValid (Int_t iRoc, Int_t iNx, Int_t iChannel)
void AddHit (Int_t iRoc, Int_t iNx, Int_t iChannel, Int_t adc)
void ChangeState (roc::SysMessageUserTypes const &newState)
void ChangeState (Int_t rocId, roc::SysMessageUserTypes const &newState)
Int_t GetVerbose () const
Bool_t IsChannelValid (Int_t channel) const
Bool_t IsRocValid (uint16_t roc) const
Bool_t IsNxValid (Int_t nx) const
Bool_t IsLooksLikeNewPedestalFileFormat (const char *pedFileName) const
Bool_t IsValid (Int_t roc, Int_t nx, Int_t channel) const
void PrintLog (const char *message, Int_t minVerbose=0) const

Private Attributes

Int_t fNRocs
Int_t fNNxs
Int_t fNChannels
THistogramTypefHistograms
Double_t * fPedestals
Double_t * fWidths
Int_t fVerbose
Int_t fRocArrSize
Int_t fNxArrSize
Int_t fNAdcBins
Float_t fAdcMin
Float_t fAdcMax
TH1F **** fBaselines
Float_t *** fPedestals
Float_t *** fWidths
Bool_t * fIsExtracted
uint64_t fExttrigCalibrPeriod
Bool_t fPrintedDataNotTimeSorted
roc::SysMessageUserTypesfState
roc::SysMessageUserTypesfPrevState
std::vector< uint64_t > fLastCalibrTime
std::vector< uint64_t > fLastHitTime

Static Private Attributes

static const Int_t fkEntriesMin = 100
static const Double_t fkInvalidPedestalValue = -1000.0
static const Double_t fkInvalidWidthValue = -1000.0
static const Int_t kEntriesMin = 100
static const Float_t kInvalidPedestalValue = -1000.0
static const Float_t kInvalidWidthValue = -1000.0
static const Char_t * kPedFileFormat = "%d%d%d%f%f"

Detailed Description

Definition at line 7 of file TPedestalExtractor.h.


Member Typedef Documentation

typedef TH1F TPedestalExtractor::THistogramType [private]

Definition at line 9 of file TPedestalExtractor.h.


Constructor & Destructor Documentation

TPedestalExtractor::TPedestalExtractor ( Int_t  nRocs = 8,
Int_t  nNxs = 4,
Int_t  nChannels = 128,
Int_t  nAdcBins = 4096,
Double_t  adcMin = 0.0,
Double_t  adcMax = 4096.0 
)
TPedestalExtractor::~TPedestalExtractor (  )  [virtual]

Definition at line 34 of file TPedestalExtractor.cxx.

References fHistograms, fPedestals, and fWidths.

TPedestalExtractor::TPedestalExtractor ( Int_t  nRocs,
Int_t  nNxs,
roc::SysMessageUserTypes  initialState = roc::SYSMSG_USER_RECONFIGURE,
Int_t  nChannels = 128,
Int_t  nAdcBins = 4096,
Double_t  adcMin = 0.0,
Double_t  adcMax = 4096.0 
)
virtual TPedestalExtractor::~TPedestalExtractor (  )  [virtual]

Member Function Documentation

void TPedestalExtractor::AddHit ( Int_t  iRoc,
Int_t  iNx,
Int_t  iChannel,
Int_t  adc 
)

Definition at line 69 of file TPedestalExtractor.cxx.

References fHistograms, IndexEnc(), and TestValid().

Referenced by ExtractAutocalibrStream(), and ExtractExttrigStream().

void TPedestalExtractor::AddHit ( Int_t  iRoc,
Int_t  iNx,
Int_t  iChannel,
Int_t  adc 
) [private]
void TPedestalExtractor::ChangeState ( roc::SysMessageUserTypes const &  newState  )  [private]
void TPedestalExtractor::ChangeState ( Int_t  rocId,
roc::SysMessageUserTypes const &  newState 
) [private]

Definition at line 135 of file TPedestalExtractor.cxx.

References fPrevState, and fState.

void TPedestalExtractor::Extract (  ) 

*

Definition at line 75 of file TPedestalExtractor.cxx.

References fHistograms, fPedestals, fWidths, and IndexMax().

Referenced by Extract(), ExtractAutocalibrStream(), and ExtractExttrigStream().

void TPedestalExtractor::Extract ( TH1 *  hist,
Double_t &  pedestal,
Double_t &  width 
) [static]

Definition at line 86 of file TPedestalExtractor.cxx.

References fkEntriesMin, fkInvalidPedestalValue, and fkInvalidWidthValue.

void TPedestalExtractor::Extract (  ) 
void TPedestalExtractor::Extract ( Int_t  idRoc  ) 
void TPedestalExtractor::Extract ( TH1 *  hist,
Float_t &  pedestal,
Float_t &  width 
) [static]

Definition at line 509 of file TPedestalExtractor.cxx.

References kEntriesMin, kInvalidPedestalValue, and kInvalidWidthValue.

Int_t TPedestalExtractor::ExtractAutocalibrLmd ( std::string  lmdFileName,
roc::SysMessageUserTypes  initialState = roc::SYSMSG_USER_RECONFIGURE,
Int_t  skipCalibrIterations = 0 
)
Int_t TPedestalExtractor::ExtractAutocalibrStream ( roc::Message const &  msg,
uint64_t  fullTime 
)
Int_t TPedestalExtractor::ExtractExttrigStream ( roc::Message const &  msg,
uint64_t  fullTime 
)
TH2F * TPedestalExtractor::GetHist2DCopy ( Int_t  roc,
Int_t  nx 
)

Definition at line 670 of file TPedestalExtractor.cxx.

References fAdcMax, fAdcMin, fNAdcBins, fNChannels, and GetHistogram().

TH1F * TPedestalExtractor::GetHistogram ( Int_t  iRoc,
Int_t  iNx,
Int_t  iChannel 
)

Definition at line 119 of file TPedestalExtractor.cxx.

References fHistograms, IndexEnc(), and TestValid().

Referenced by GetHist2DCopy().

TH1F* TPedestalExtractor::GetHistogram ( Int_t  roc,
Int_t  nx,
Int_t  channel 
)
uint64_t TPedestalExtractor::GetLastCalibrTime ( Int_t  rocId  )  const

Definition at line 149 of file TPedestalExtractor.cxx.

References fLastCalibrTime.

Int_t TPedestalExtractor::GetNChannels (  )  const [inline]

Definition at line 75 of file TPedestalExtractor.h.

References fNChannels.

Referenced by SaveToFile().

Int_t TPedestalExtractor::GetNxArrSize (  )  const [inline]

Definition at line 74 of file TPedestalExtractor.h.

References fNxArrSize.

Referenced by SaveToFile().

Int_t TPedestalExtractor::GetNxNum (  )  [inline]

Definition at line 35 of file TPedestalExtractor.h.

References fNNxs.

Float_t TPedestalExtractor::GetPedestal ( Int_t  roc,
Int_t  nx,
Int_t  channel 
) const

Definition at line 636 of file TPedestalExtractor.cxx.

References fPedestals, IsValid(), and kInvalidPedestalValue.

Double_t TPedestalExtractor::GetPedestal ( Int_t  iRoc,
Int_t  iNx,
Int_t  iChannel 
)

Definition at line 112 of file TPedestalExtractor.cxx.

References fPedestals, IndexEnc(), and TestValid().

Referenced by TCosyDec10Proc::ProcessNxHit(), and SaveToFile().

Int_t TPedestalExtractor::GetRocArrSize (  )  const [inline]

Definition at line 76 of file TPedestalExtractor.h.

References fRocArrSize.

Referenced by SaveToFile().

uint64_t TPedestalExtractor::GetSelftrigCalibrPeriod (  )  const

Definition at line 194 of file TPedestalExtractor.cxx.

References fExttrigCalibrPeriod.

roc::SysMessageUserTypes TPedestalExtractor::GetState ( Int_t  roc  )  const

Definition at line 836 of file TPedestalExtractor.cxx.

References fState, and IsRocValid().

Referenced by ExtractAutocalibrLmd().

Int_t TPedestalExtractor::GetVerbose (  )  const [private]

Definition at line 161 of file TPedestalExtractor.cxx.

References fVerbose.

Float_t TPedestalExtractor::GetWidth ( Int_t  iRoc,
Int_t  iNx,
Int_t  iChannel 
) const

Definition at line 647 of file TPedestalExtractor.cxx.

References fWidths, IsValid(), and kInvalidPedestalValue.

Referenced by SaveToFile().

void TPedestalExtractor::IndexDec ( Int_t  index,
Int_t &  iRoc,
Int_t &  iNx,
Int_t &  iChannel 
) [private]

Definition at line 40 of file TPedestalExtractor.cxx.

References fNChannels, fNNxs, and IndexMax().

Referenced by TPedestalExtractor().

Int_t TPedestalExtractor::IndexEnc ( Int_t  iRoc,
Int_t  iNx,
Int_t  iChannel 
) [inline, private]

Definition at line 19 of file TPedestalExtractor.h.

References fNChannels, and fNNxs.

Referenced by AddHit(), GetHistogram(), and GetPedestal().

Int_t TPedestalExtractor::IndexMax (  )  [inline, private]

Definition at line 21 of file TPedestalExtractor.h.

References fNChannels, fNNxs, and fNRocs.

Referenced by Extract(), IndexDec(), Print(), Reset(), and TPedestalExtractor().

Bool_t TPedestalExtractor::IsAllExtracted (  )  const

Definition at line 710 of file TPedestalExtractor.cxx.

References fIsExtracted.

Bool_t TPedestalExtractor::IsChannelValid ( Int_t  channel  )  const [inline, private]

Definition at line 42 of file TPedestalExtractor.h.

References fNChannels.

Referenced by IsValid().

Bool_t TPedestalExtractor::IsExtracted ( Int_t  roc  )  const

Definition at line 687 of file TPedestalExtractor.cxx.

References fIsExtracted, and IsRocValid().

Bool_t TPedestalExtractor::IsLooksLikeNewPedestalFileFormat ( const char *  pedFileName  )  const [private]

Definition at line 172 of file TPedestalExtractor.cxx.

References kPedFileFormat.

Referenced by LoadFromFile().

Bool_t TPedestalExtractor::IsNxValid ( Int_t  nx  )  const [inline, private]

Definition at line 44 of file TPedestalExtractor.h.

References fNxArrSize.

Referenced by IsValid().

Bool_t TPedestalExtractor::IsOneExtracted (  )  const

Definition at line 700 of file TPedestalExtractor.cxx.

References fIsExtracted.

Bool_t TPedestalExtractor::IsRocValid ( uint16_t  roc  )  const [inline, private]
Bool_t TPedestalExtractor::IsValid ( Int_t  roc,
Int_t  nx,
Int_t  channel 
) const [inline, private]

Definition at line 46 of file TPedestalExtractor.h.

References IsChannelValid(), IsNxValid(), and IsRocValid().

Referenced by GetPedestal(), GetWidth(), and LoadFromFile().

void TPedestalExtractor::LoadFromFile ( Char_t const *  fileName  ) 
void TPedestalExtractor::Print (  ) 

Definition at line 126 of file TPedestalExtractor.cxx.

References fPedestals, and IndexMax().

Referenced by Print().

void TPedestalExtractor::Print ( Int_t  roc  )  const

Definition at line 804 of file TPedestalExtractor.cxx.

References fBaselines, fNChannels, fNxArrSize, fPedestals, and IsRocValid().

void TPedestalExtractor::Print (  )  const

Definition at line 793 of file TPedestalExtractor.cxx.

References Print().

void TPedestalExtractor::PrintLog ( const char *  message,
Int_t  minVerbose = 0 
) const [private]
void TPedestalExtractor::Reset (  ) 

Definition at line 106 of file TPedestalExtractor.cxx.

References fHistograms, and IndexMax().

void TPedestalExtractor::ResetCalibrData ( Int_t  rocId  ) 

Definition at line 563 of file TPedestalExtractor.cxx.

References fBaselines, fNChannels, fNxArrSize, IsRocValid(), and PrintLog().

void TPedestalExtractor::ResetCalibrData (  ) 
void TPedestalExtractor::ResetCalibrResults ( Int_t  rocId  ) 
void TPedestalExtractor::ResetCalibrResults (  ) 

Definition at line 582 of file TPedestalExtractor.cxx.

Referenced by ExtractAutocalibrLmd().

void TPedestalExtractor::ResetLastCalibrTime ( Int_t  rocId  ) 

Definition at line 624 of file TPedestalExtractor.cxx.

References fLastCalibrTime, IsRocValid(), and PrintLog().

void TPedestalExtractor::ResetLastCalibrTime (  ) 

Definition at line 613 of file TPedestalExtractor.cxx.

void TPedestalExtractor::SaveToFile ( Char_t const *  fileName  )  const
void TPedestalExtractor::SetExttrigCalibrPeriod ( uint64_t  period  ) 

Definition at line 201 of file TPedestalExtractor.cxx.

References fExttrigCalibrPeriod.

void TPedestalExtractor::SetVerbose ( Int_t  verbose  ) 

Definition at line 155 of file TPedestalExtractor.cxx.

References fVerbose.

bool TPedestalExtractor::TestValid ( Int_t  iRoc,
Int_t  iNx,
Int_t  iChannel 
) [private]

Definition at line 50 of file TPedestalExtractor.cxx.

References fNChannels, fNNxs, and fNRocs.

Referenced by AddHit(), GetHistogram(), and GetPedestal().

void TPedestalExtractor::WatchPedestalMessages ( roc::Message const &  msg,
Long64_t const   fullTime = 0 
)

Definition at line 236 of file TPedestalExtractor.cxx.

References ExtractAutocalibrStream().

Int_t TPedestalExtractor::WatchState ( roc::Message const &  msg  ) 

Field Documentation

Float_t TPedestalExtractor::fAdcMax [private]

Definition at line 26 of file TPedestalExtractor.h.

Referenced by GetHist2DCopy(), and TPedestalExtractor().

Float_t TPedestalExtractor::fAdcMin [private]

Definition at line 25 of file TPedestalExtractor.h.

Referenced by GetHist2DCopy(), and TPedestalExtractor().

TH1F**** TPedestalExtractor::fBaselines [private]

Definition at line 27 of file TPedestalExtractor.h.

Referenced by Extract(), Print(), ResetCalibrData(), and TPedestalExtractor().

const Int_t TPedestalExtractor::fkEntriesMin = 100 [static, private]

Definition at line 10 of file TPedestalExtractor.h.

Referenced by Extract().

const Double_t TPedestalExtractor::fkInvalidPedestalValue = -1000.0 [static, private]

Definition at line 11 of file TPedestalExtractor.h.

Referenced by Extract(), and TPedestalExtractor().

const Double_t TPedestalExtractor::fkInvalidWidthValue = -1000.0 [static, private]

Definition at line 12 of file TPedestalExtractor.h.

Referenced by Extract(), and TPedestalExtractor().

std::vector< uint64_t > TPedestalExtractor::fLastCalibrTime [private]
std::vector< uint64_t > TPedestalExtractor::fLastHitTime [private]

Definition at line 36 of file TPedestalExtractor.h.

Referenced by ExtractAutocalibrStream(), and TPedestalExtractor().

Definition at line 24 of file TPedestalExtractor.h.

Referenced by GetHist2DCopy(), and TPedestalExtractor().

Int_t TPedestalExtractor::fNNxs [private]
Int_t TPedestalExtractor::fNRocs [private]

Definition at line 13 of file TPedestalExtractor.h.

Referenced by IndexMax(), TestValid(), and TPedestalExtractor().

Double_t* TPedestalExtractor::fPedestals [private]
Float_t*** TPedestalExtractor::fPedestals [private]

Definition at line 28 of file TPedestalExtractor.h.

Definition at line 34 of file TPedestalExtractor.h.

Referenced by ChangeState(), ExtractAutocalibrStream(), and TPedestalExtractor().

Definition at line 32 of file TPedestalExtractor.h.

Referenced by ExtractExttrigStream(), and TPedestalExtractor().

Definition at line 21 of file TPedestalExtractor.h.

Referenced by GetRocArrSize(), IsRocValid(), and TPedestalExtractor().

Float_t*** TPedestalExtractor::fWidths [private]

Definition at line 29 of file TPedestalExtractor.h.

Double_t* TPedestalExtractor::fWidths [private]
const Int_t TPedestalExtractor::kEntriesMin = 100 [static, private]

Definition at line 16 of file TPedestalExtractor.h.

Referenced by Extract().

const Float_t TPedestalExtractor::kInvalidPedestalValue = -1000.0 [static, private]
const Float_t TPedestalExtractor::kInvalidWidthValue = -1000.0 [static, private]

Definition at line 18 of file TPedestalExtractor.h.

Referenced by Extract(), ResetCalibrResults(), and TPedestalExtractor().

const Char_t * TPedestalExtractor::kPedFileFormat = "%d%d%d%f%f" [static, private]

Normal-use constructor. Arguments: rocArrSize -- maximal ROC id + 1 (size of the array of ROCs) nxArrSize -- maximal n-XYTER id + 1. (Two n-XYTERs, connected to different ROCs may have the same id. Size of the array of ROCs) initialState -- initial state of all ROCS. Valid values: roc::SYSMSG_USER_CALIBR_ON, roc::SYSMSG_USER_CALIBR_OFF, roc::SYSMSG_USER_RECONFIGURE nChannels -- number of channels per nXYTER (expected numbering from 0 to (nChannels - 1) ) nAdcBins -- number of bins on the baseline histogram. adcMin, adcMax -- define the baseline histogram range.

Definition at line 19 of file TPedestalExtractor.h.

Referenced by IsLooksLikeNewPedestalFileFormat(), and LoadFromFile().


The documentation for this class was generated from the following files: