ATLAS Offline Software
Loading...
Searching...
No Matches
TileRawChannelFillerTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5/*
6 * File: TileRawChannelFillerTool.cxx
7 * Author: Stephen Cole <scole@niu.edu>
8 *
9 * Created on March 1, 2011, 9:27 AM
10 */
11
14#include "GaudiKernel/ISvcLocator.h"
15#include "GaudiKernel/StatusCode.h"
16#include "GaudiKernel/MsgStream.h"
19
20namespace D3PD {
21
23 const std::string& name,
24 const IInterface* parent):
25 Base(type, name,parent),
26 m_tilehwid(0)
27 {
28 m_SaveHWid = true;
29 m_SaveRawCh = false;
30 TileRawChannelFillerTool::book().ignore(); // Avoid coverity warnings
31
32 declareProperty("SaveHardwareInfo", m_SaveHWid=true);
33 declareProperty("SaveRawChannel", m_SaveRawCh=false);
34 }
35
37 {
38 CHECK( detStore()->retrieve(m_tilehwid) );
39 return StatusCode::SUCCESS;
40 }
41
43 if(m_SaveHWid){
44 CHECK(addVariable("ros",m_ros));
45 CHECK(addVariable("drawer",m_drawer));
46 CHECK(addVariable("channel",m_channel));
47 CHECK(addVariable("gain",m_gain));
48 }
49
50 if(m_SaveRawCh){
51 CHECK(addVariable("amplitude",m_amplitude));
52 CHECK(addVariable("time",m_time));
53 CHECK(addVariable("quality",m_quality));
54 CHECK(addVariable("pedestal",m_ped));
55 }
56
57 return StatusCode::SUCCESS;
58 }
59
61 const TileRawChannel* tileR=&p;
62 if(m_SaveHWid){
63 HWIdentifier hwid=tileR->adc_HWID();
64 *m_ros=(char)m_tilehwid->ros(hwid);
65 *m_drawer=(char)m_tilehwid->drawer(hwid);
66 *m_channel=(char)m_tilehwid->channel(hwid);
67 *m_gain=(char)m_tilehwid->adc(hwid);
68 }
69 if(m_SaveRawCh){
70 *m_ped=tileR->pedestal();
71 size_t nentry=tileR->size();
72 m_amplitude->reserve(nentry);
73 for(unsigned int n=0;n<nentry;++n){
74 m_amplitude->push_back(tileR->amplitude(n));
75 }
76 m_quality->reserve(nentry);
77 for(unsigned int n=0;n<nentry;++n){
78 m_quality->push_back(tileR->quality(n));
79 }
80 nentry=tileR->sizeTime();
81 m_time->reserve(nentry);
82 for(unsigned int n=0;n<nentry;++n){
83 m_time->push_back(tileR->time(n));
84 }
85 }
86 return StatusCode::SUCCESS;
87 }
88
89}
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
virtual StatusCode initialize()
Standard Gaudi initialize method.
TileRawChannelFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
D3PD::BlockFillerTool< TileRawChannel > Base
virtual StatusCode book()
Declare tuple variables.
virtual StatusCode fill(const TileRawChannel &p)
Fill one block — type-safe version.
float pedestal(void) const
float time(int ind=0) const
float quality(int ind=0) const
int size() const
int sizeTime() const
float amplitude(int ind=0) const
HWIdentifier adc_HWID(void) const
Definition TileRawData.h:53
Block filler tool for noisy FEB information.