Cat
Classes | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
StorageFifo Class Reference

#include <inc/StorageFifo.h>

Inheritance diagram for StorageFifo:
Processus Object Attrib

Classes

class  StorageFifo
 

Public Member Functions

 StorageFifo ()
 Standard constructor. More...
 
virtual ~StorageFifo ()
 Destructor. More...
 
virtual StatusCode initialize ()
 
virtual StatusCode execute ()
 
virtual StatusCode finalize ()
 
- Public Member Functions inherited from Processus
 Processus ()
 Standard constructor. More...
 
virtual ~Processus ()
 Destructor. More...
 
StatusCode startProcessing ()
 
StatusCode endProcessing ()
 
void clean ()
 
void setStorage (std::string storage)
 
Datadata ()
 
std::vector< double > data (unsigned int row)
 
std::vector< double > data (std::string name)
 
Histo1Dhist1d (unsigned int row)
 
Histo2Dhist2d (unsigned int row)
 
void addDataStream (std::string name, std::string title)
 
void addHisto1d (TH1D *h)
 
void addHisto2d (TH2D *h)
 
StatusCode dataFill (int i, double val)
 
StatusCode dataFill (std::string name, double val)
 
std::string storage ()
 
void setElement (Element *element)
 
Elementelement ()
 
void incNErrors ()
 
void setNErrors (unsigned int)
 
unsigned int nErrors ()
 
TFile * rootFile ()
 
void openRootFile ()
 
void closeRootFile ()
 
void startChrono ()
 
void setLogMsg (std::string logMsg)
 
std::string logMsg ()
 
void setState (int state)
 
double elapsedTime ()
 
double elapsedTime (time_t start)
 
- Public Member Functions inherited from Object
 Object ()
 Standard constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
std::string name () const
 
std::string type ()
 
unsigned char id ()
 
std::string title ()
 
void msgSvc (int level, std::string msg, std::string name)
 
void msg (std::string mymsg)
 
void verbose (std::string mymsg)
 
void debug (std::string mymsg)
 
void info (std::string mymsg)
 
void warning (std::string mymsg)
 
void error (std::string mymsg)
 
void fatal (std::string mymsg)
 
void msg (std::string mymsg, std::string name)
 
void verbose (std::string mymsg, std::string name)
 
void debug (std::string mymsg, std::string name)
 
void info (std::string mymsg, std::string name)
 
void warning (std::string mymsg, std::string name)
 
void error (std::string mymsg, std::string name)
 
void fatal (std::string mymsg, std::string name)
 
void setName (std::string name)
 
void setType (std::string type)
 
void setId (unsigned char id)
 
void setTitle (std::string title)
 
void setDllName (std::string dllName)
 
std::string dllName ()
 
- Public Member Functions inherited from Attrib
 Attrib ()
 Standard constructor. More...
 
virtual ~Attrib ()
 Destructor. More...
 
bool is (int attribut)
 
void add (int attribut)
 
void remove (int attribut)
 
std::string attributs ()
 

Protected Member Functions

StorageFifoclone ()
 

Private Attributes

Proto40MHz_v1m_board
 
A3PEm_pga
 
RAMm_fifo
 
TH1D * m_h1
 
TH1D * m_h2
 
TH1D * m_h3
 
TH1D * m_h4
 
TH1D * m_h5
 
TH1D * m_h6
 
TH1D * m_h7
 
TH1D * m_h8
 
int m_depth
 

Additional Inherited Members

- Public Types inherited from Processus
enum  states { ERR =-1, NOT_OK, OK }
 
- Public Types inherited from Attrib
enum  Attribut {
  UNDEFINED, PASSIVE, ACTIVE, INTERFACE,
  IO, IODATA, ELEMENT, HARDWARE,
  PROCESSUS, SOFTWARE
}
 
- Protected Attributes inherited from Processus
Elementm_element
 
- Protected Attributes inherited from Attrib
std::string m_attribString [10]
 

Detailed Description

Author
Date
2006-10-23

Definition at line 18 of file StorageFifo.h.

Constructor & Destructor Documentation

◆ StorageFifo()

Standard constructor.

Definition at line 20 of file StorageFifo.cpp.

References Object::setName(), Object::setTitle(), and Object::setType().

Referenced by clone().

20  :
21  m_h1(0),
22  m_h2(0),
23  m_h3(0),
24  m_h4(0),
25  m_h5(0),
26  m_h6(0),
27  m_h7(0),
28  m_h8(0)
29 {
30  setName ( "StorageFifo" );
31  setType ( "Proto40MHz_v1" );
32  setTitle( "Proto40MHz_v1 Storage Fifo" );
33 }
TH1D * m_h1
Definition: StorageFifo.h:37
TH1D * m_h2
Definition: StorageFifo.h:37
TH1D * m_h5
Definition: StorageFifo.h:37
void setName(std::string name)
Definition: Object.h:51
TH1D * m_h4
Definition: StorageFifo.h:37
void setType(std::string type)
Definition: Object.h:52
TH1D * m_h7
Definition: StorageFifo.h:37
void setTitle(std::string title)
Definition: Object.h:54
TH1D * m_h3
Definition: StorageFifo.h:37
TH1D * m_h8
Definition: StorageFifo.h:37
TH1D * m_h6
Definition: StorageFifo.h:37

◆ ~StorageFifo()

StorageFifo::~StorageFifo ( )
virtual

Destructor.

Definition at line 37 of file StorageFifo.cpp.

37 {}

Member Function Documentation

◆ clone()

StorageFifo* StorageFifo::clone ( )
inlineprotectedvirtual

processus termination virtual function

Implements Processus.

Definition at line 29 of file StorageFifo.h.

References StorageFifo().

29  {
30  return new StorageFifo (*this);
31  }
StorageFifo()
Standard constructor.
Definition: StorageFifo.cpp:20

◆ execute()

StatusCode StorageFifo::execute ( )
virtual

processus execution virtual function

Implements Processus.

Definition at line 94 of file StorageFifo.cpp.

References A3PE::acquisition(), IOdata::dataU8(), Object::debug(), IOobject::io(), m_depth, m_fifo, m_h1, m_h2, m_h3, m_h4, m_h5, m_h6, m_h7, m_h8, m_pga, IOobject::read(), and StatusCode::SUCCESS.

94  {
95  debug("StorageFifo" , "execute");
96 
97  m_pga->acquisition();
98  m_fifo->read();
99 
100  int val[12];
101 
102  for (int d=0; d<m_depth; ++d){
103  val[0] =m_fifo->io()->dataU8( 0+12*d);
104  val[1] =m_fifo->io()->dataU8( 1+12*d);
105  val[2] =m_fifo->io()->dataU8( 2+12*d);
106  val[3] =m_fifo->io()->dataU8( 3+12*d);
107  val[4] =m_fifo->io()->dataU8( 4+12*d);
108  val[5] =m_fifo->io()->dataU8( 5+12*d);
109  val[6] =m_fifo->io()->dataU8( 6+12*d);
110  val[7] =m_fifo->io()->dataU8( 7+12*d);
111  val[8] =m_fifo->io()->dataU8( 8+12*d);
112  val[9] =m_fifo->io()->dataU8( 9+12*d);
113  val[10]=m_fifo->io()->dataU8(10+12*d);
114  val[11]=m_fifo->io()->dataU8(11+12*d);
115 
116  m_h1->Fill(d+0.5,val[0]+((val[1]&0xf)<<8));
117  m_h2->Fill(d+0.5,(val[1]>>4)+(val[2]<<4));
118  m_h3->Fill(d+0.5,val[3]+((val[4]&0xf)<<8));
119  m_h4->Fill(d+0.5,(val[4]>>4)+(val[5]<<4));
120  m_h5->Fill(d+0.5,val[6]+((val[7]&0xf)<<8));
121  m_h6->Fill(d+0.5,(val[7]>>4)+(val[8]<<4));
122  m_h7->Fill(d+0.5,val[9]+((val[10]&0xf)<<8));
123  m_h8->Fill(d+0.5,(val[10]>>4)+(val[11]<<4));
124  }
125 
126  return StatusCode::SUCCESS;
127 }
TH1D * m_h1
Definition: StorageFifo.h:37
TH1D * m_h2
Definition: StorageFifo.h:37
TH1D * m_h5
Definition: StorageFifo.h:37
TH1D * m_h4
Definition: StorageFifo.h:37
A3PE * m_pga
Definition: StorageFifo.h:35
virtual StatusCode read()
Definition: IOobject.h:73
void debug(std::string mymsg)
Definition: Object.h:37
TH1D * m_h7
Definition: StorageFifo.h:37
TH1D * m_h3
Definition: StorageFifo.h:37
U8 * dataU8()
Definition: IOdata.h:214
TH1D * m_h8
Definition: StorageFifo.h:37
RAM * m_fifo
Definition: StorageFifo.h:36
StatusCode acquisition()
Definition: A3PE.cpp:417
TH1D * m_h6
Definition: StorageFifo.h:37
IOdata * io()
Definition: IOobject.h:66

◆ finalize()

StatusCode StorageFifo::finalize ( )
virtual

processus termination virtual function

Implements Processus.

Definition at line 132 of file StorageFifo.cpp.

References StatusCode::SUCCESS.

132  {
133  return StatusCode::SUCCESS;
134 }

◆ initialize()

StatusCode StorageFifo::initialize ( )
virtual

processus initialisation virtual function

Implements Processus.

Definition at line 44 of file StorageFifo.cpp.

References Proto40MHz_v1::a3pe(), Processus::addHisto1d(), Object::debug(), Processus::element(), A3PE::fifoDepth(), Object::info(), m_board, m_depth, m_fifo, m_h1, m_h2, m_h3, m_h4, m_h5, m_h6, m_h7, m_h8, m_pga, Object::name(), A3PE::setEnableADC(), A3PE::setSoftwareTrigger(), A3PE::setWriteStorageFifoUsb(), A3PE::storageRam(), StatusCode::SUCCESS, Object::type(), and Object::warning().

44  {
45  debug("StorageFifo" , "initialize");
46 
47  info("" );
48  info("____________________________");
49  info("Proto 40 MHZ - Fifo dump");
50  info(" =>" + element()->path() + " " +
51  element()->name() + " " + element()->type() );
52 
53  m_board=dynamic_cast<Proto40MHz_v1*>( element() );
54 
55  if (!m_board){
56  warning("StorageFifo","No Proto40MHz_v1 board found. Interrupt." );
57  return false;
58  }
59 
60  m_pga=m_board->a3pe();
63 
64  m_fifo = m_pga->storageRam();
65 
66  for (int i=0; i<8; ++i) m_pga->setEnableADC(i,true);
67 
69 
70  m_h1=new TH1D( "Channel1" , "Data values channel 1" , m_depth , 0. , float(m_depth) );
71  m_h2=new TH1D( "Channel2" , "Data values channel 2" , m_depth , 0. , float(m_depth) );
72  m_h3=new TH1D( "Channel3" , "Data values channel 3" , m_depth , 0. , float(m_depth) );
73  m_h4=new TH1D( "Channel4" , "Data values channel 4" , m_depth , 0. , float(m_depth) );
74  m_h5=new TH1D( "Channel5", "Data values channel 5" , m_depth , 0. , float(m_depth) );
75  m_h6=new TH1D( "Channel6" , "Data values channel 6" , m_depth , 0. , float(m_depth) );
76  m_h7=new TH1D( "Channel7" , "Data values channel 7" , m_depth , 0. , float(m_depth) );
77  m_h8=new TH1D( "Channel8" , "Data values channel 8" , m_depth , 0. , float(m_depth) );
78  addHisto1d( m_h1 );
79  addHisto1d( m_h2 );
80  addHisto1d( m_h3 );
81  addHisto1d( m_h4 );
82  addHisto1d( m_h5 );
83  addHisto1d( m_h6 );
84  addHisto1d( m_h7 );
85  addHisto1d( m_h8 );
86 
87  return StatusCode::SUCCESS;
88 }
void info(std::string mymsg)
Definition: Object.h:38
TH1D * m_h1
Definition: StorageFifo.h:37
TH1D * m_h2
Definition: StorageFifo.h:37
StatusCode setSoftwareTrigger(bool)
Definition: A3PE.cpp:368
TH1D * m_h5
Definition: StorageFifo.h:37
A3PE * a3pe()
Definition: Proto40MHz_v1.h:74
TH1D * m_h4
Definition: StorageFifo.h:37
RAM * storageRam()
Definition: A3PE.h:536
A3PE * m_pga
Definition: StorageFifo.h:35
void debug(std::string mymsg)
Definition: Object.h:37
TH1D * m_h7
Definition: StorageFifo.h:37
TH1D * m_h3
Definition: StorageFifo.h:37
TH1D * m_h8
Definition: StorageFifo.h:37
std::string name() const
Definition: Object.h:28
void addHisto1d(TH1D *h)
Definition: Processus.h:160
Proto40MHz_v1 * m_board
Definition: StorageFifo.h:34
RAM * m_fifo
Definition: StorageFifo.h:36
Element * element()
Definition: Processus.h:231
StatusCode setWriteStorageFifoUsb(bool)
Definition: A3PE.cpp:99
std::string type()
Definition: Object.h:29
unsigned int fifoDepth()
Definition: A3PE.cpp:631
void warning(std::string mymsg)
Definition: Object.h:39
StatusCode setEnableADC(unsigned int, bool)
Definition: A3PE.cpp:87
TH1D * m_h6
Definition: StorageFifo.h:37

Member Data Documentation

◆ m_board

Proto40MHz_v1* StorageFifo::m_board
private

Definition at line 34 of file StorageFifo.h.

Referenced by initialize().

◆ m_depth

int StorageFifo::m_depth
private

Definition at line 38 of file StorageFifo.h.

Referenced by execute(), and initialize().

◆ m_fifo

RAM* StorageFifo::m_fifo
private

Definition at line 36 of file StorageFifo.h.

Referenced by execute(), and initialize().

◆ m_h1

TH1D* StorageFifo::m_h1
private

Definition at line 37 of file StorageFifo.h.

Referenced by execute(), and initialize().

◆ m_h2

TH1D * StorageFifo::m_h2
private

Definition at line 37 of file StorageFifo.h.

Referenced by execute(), and initialize().

◆ m_h3

TH1D * StorageFifo::m_h3
private

Definition at line 37 of file StorageFifo.h.

Referenced by execute(), and initialize().

◆ m_h4

TH1D * StorageFifo::m_h4
private

Definition at line 37 of file StorageFifo.h.

Referenced by execute(), and initialize().

◆ m_h5

TH1D * StorageFifo::m_h5
private

Definition at line 37 of file StorageFifo.h.

Referenced by execute(), and initialize().

◆ m_h6

TH1D * StorageFifo::m_h6
private

Definition at line 37 of file StorageFifo.h.

Referenced by execute(), and initialize().

◆ m_h7

TH1D * StorageFifo::m_h7
private

Definition at line 37 of file StorageFifo.h.

Referenced by execute(), and initialize().

◆ m_h8

TH1D * StorageFifo::m_h8
private

Definition at line 37 of file StorageFifo.h.

Referenced by execute(), and initialize().

◆ m_pga

A3PE* StorageFifo::m_pga
private

Definition at line 35 of file StorageFifo.h.

Referenced by execute(), and initialize().


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