FairRoot/PandaRoot
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
PndBurstContainer Class Reference

#include <PndBurstContainer.h>

Public Member Functions

 PndBurstContainer ()
 
std::vector< std::vector
< FairTimeStamp * > > 
ProcessData (std::vector< FairTimeStamp * > data)
 
std::vector< std::vector
< FairTimeStamp * > > 
GetLastData ()
 
virtual void SetThreshold (double val)
 
virtual void SetOffset (double val)
 
virtual double GetThreshold ()
 
virtual double GetOffset ()
 

Protected Member Functions

bool IsAboveOffset (FairTimeStamp *val)
 
int CalcContainerPos (FairTimeStamp *val)
 

Private Attributes

std::vector< std::vector
< FairTimeStamp * > > 
fContainer
 
double fThreshold
 
double fCurrentThreshold
 
double fOffset
 
double fCurrentOffset
 

Detailed Description

Definition at line 9 of file PndBurstContainer.h.

Constructor & Destructor Documentation

PndBurstContainer::PndBurstContainer ( )
inline

Definition at line 12 of file PndBurstContainer.h.

References fContainer.

13  {
14  fContainer.resize(3);
15  }
std::vector< std::vector< FairTimeStamp * > > fContainer

Member Function Documentation

int PndBurstContainer::CalcContainerPos ( FairTimeStamp *  val)
inlineprotected

Definition at line 29 of file PndBurstContainer.h.

References fCurrentThreshold, and fThreshold.

Referenced by ProcessData().

29  {
30  int result;
31  double resultD = ((val->GetTimeStamp() - fCurrentThreshold) / fThreshold);
32  result = resultD;
33  if (resultD > 0)
34  result++;
35  return result;
36  }
Double_t val[nBoxes][nFEBox]
Definition: createCalib.C:11
std::vector<std::vector<FairTimeStamp*> > PndBurstContainer::GetLastData ( )
inline

Definition at line 18 of file PndBurstContainer.h.

References fContainer.

18 {return fContainer;}
std::vector< std::vector< FairTimeStamp * > > fContainer
virtual double PndBurstContainer::GetOffset ( )
inlinevirtual

Definition at line 24 of file PndBurstContainer.h.

References fOffset.

24 {return fOffset;}
virtual double PndBurstContainer::GetThreshold ( )
inlinevirtual

Definition at line 23 of file PndBurstContainer.h.

References fThreshold.

23 {return fThreshold;}
bool PndBurstContainer::IsAboveOffset ( FairTimeStamp *  val)
inlineprotected

Definition at line 28 of file PndBurstContainer.h.

References fCurrentOffset.

Referenced by ProcessData().

28 { return val->GetTimeStamp() > fCurrentOffset;}
Double_t val[nBoxes][nFEBox]
Definition: createCalib.C:11
std::vector< std::vector< FairTimeStamp * > > PndBurstContainer::ProcessData ( std::vector< FairTimeStamp * >  data)

Definition at line 10 of file PndBurstContainer.cxx.

References CalcContainerPos(), fContainer, fCurrentOffset, fCurrentThreshold, fThreshold, IsAboveOffset(), and pos.

11 {
12  std::vector<std::vector<FairTimeStamp*> > result;
13  for (auto dataItr : data){
14 // LOG(INFO) << dataItr->GetTimeStamp();
15  if ((dataItr->GetTimeStamp() - fCurrentThreshold)/fThreshold > 2.0)
16  continue;
17  if(IsAboveOffset(dataItr)){
18  result.push_back(*fContainer.begin());
19  fContainer.erase(fContainer.begin());
22  }
23  int pos = CalcContainerPos(dataItr);
24 // LOG(INFO) << "Pos: " << pos << " Thresh: " << fCurrentThreshold << " Offset: " << fCurrentOffset << " container.size " << fContainer.size();
25  if (pos < 0) {
26 // LOG(INFO) << "PndBurstContainer: negative Pos: TimeStamp " << dataItr->GetTimeStamp()
27 // << " fCurrenThreshold " << fCurrentThreshold << " fThreshold " << fThreshold
28 // << " fCurrentOffset " << fCurrentOffset << " fOffset " << fOffset;
29  continue;
30  }
31  if (pos > fContainer.size() - 1){
32 // LOG(INFO) << "Resize container: " << pos + 1;
33  fContainer.resize(pos + 1);
34  }
35  fContainer[pos].push_back(dataItr);
36  }
37  return result;
38 }
TVector3 pos
bool IsAboveOffset(FairTimeStamp *val)
int CalcContainerPos(FairTimeStamp *val)
std::vector< std::vector< FairTimeStamp * > > fContainer
virtual void PndBurstContainer::SetOffset ( double  val)
inlinevirtual

Definition at line 21 of file PndBurstContainer.h.

References fOffset, and val.

21 { fOffset = val;}
Double_t val[nBoxes][nFEBox]
Definition: createCalib.C:11
virtual void PndBurstContainer::SetThreshold ( double  val)
inlinevirtual

Definition at line 20 of file PndBurstContainer.h.

References fThreshold, and val.

20 { fThreshold = val;}
Double_t val[nBoxes][nFEBox]
Definition: createCalib.C:11

Member Data Documentation

std::vector<std::vector<FairTimeStamp*> > PndBurstContainer::fContainer
private

Definition at line 39 of file PndBurstContainer.h.

Referenced by GetLastData(), PndBurstContainer(), and ProcessData().

double PndBurstContainer::fCurrentOffset
private

Definition at line 43 of file PndBurstContainer.h.

Referenced by IsAboveOffset(), and ProcessData().

double PndBurstContainer::fCurrentThreshold
private

Definition at line 41 of file PndBurstContainer.h.

Referenced by CalcContainerPos(), and ProcessData().

double PndBurstContainer::fOffset
private

Definition at line 42 of file PndBurstContainer.h.

Referenced by GetOffset(), and SetOffset().

double PndBurstContainer::fThreshold
private

Definition at line 40 of file PndBurstContainer.h.

Referenced by CalcContainerPos(), GetThreshold(), ProcessData(), and SetThreshold().


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