ATLAS Offline Software
Loading...
Searching...
No Matches
D3PD::LArDigitFillerTool Class Reference

Block filler tool for EM samplings from a CaloCluster. More...

#include <LArDigitFillerTool.h>

Inheritance diagram for D3PD::LArDigitFillerTool:
Collaboration diagram for D3PD::LArDigitFillerTool:

Public Member Functions

 LArDigitFillerTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Gaudi tool constructor.
virtual StatusCode book ()
 Book variables for this block.
virtual StatusCode fill (const LArDigit &p)
 Fill one block — type-safe version.
 BlockFillerToolImpl (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Gaudi tool constructor.
virtual StatusCode configureD3PD (IAddVariable *tree, const std::type_info &ti)
 Configure during initialization: type-check.
StatusCode configureD3PD (IAddVariable *tree)
 Configure the parent tree.
virtual StatusCode fillUntyped (const void *p, bool again=false)
 Fill one block.
virtual StatusCode fillAgain (const LArDigit &p)
 Fill one block, after AGAIN has been returned (type-safe).
virtual StatusCode addVariable (const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
 Add a variable to the tuple.
StatusCode addVariable (const std::string &name, LArDigit *&ptr, const std::string &docstring="")
 Make the template implementation from IAddVariable visible.
StatusCode addVariable (const std::string &name, LArDigit *&ptr, const std::string &docstring, const U &defval)
 Make the template implementation from IAddVariable visible.
virtual StatusCode addDimensionedVariable (const std::string &name, const std::type_info &ti, void *&ptr, const std::string &dim, const std::string &docstring="", const void *defval=0)
 Add a variable to the tuple.
StatusCode addDimensionedVariable (const std::string &name, LArDigit *&ptr, const std::string &dim, const std::string &docstring="")
 Add a variable to the tuple.
StatusCode addDimensionedVariable (const std::string &name, LArDigit *&ptr, const std::string &dim, const std::string &docstring, const U &defval)
 Add a variable to the tuple.

Protected Member Functions

StatusCode configureImpl (IAddVariable *tree, const std::type_info &ti, const std::type_info &fill_ti)
 Configure during initialization: type-check.
StatusCode configureImpl (IAddVariable *tree, const std::type_info &ti, const std::vector< const std::type_info * > &tis, size_t &which)
 Configure during initialization: type-check.
StatusCode convert (void const *&p) const
 Do type conversion.

Protected Attributes

ObjectMetadata m_metadata
 Metadata about the variables created by this object.

Private Attributes

SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
bool m_savesca
bool m_savedigit
std::string m_CaloType
bool m_storeId
bool m_em
bool m_hec
bool m_fcal
std::string m_dump_gain
bool m_gains [CaloGain::LARNGAIN]
bool m_dumpIter
const LArOnlineIDm_onlineHelper
const LArEM_IDm_emId
const LArHEC_IDm_hecId
const LArFCAL_IDm_fcalId
long m_cellIndex
int * m_layer
int * m_eta
int * m_phi
int * m_gain
int * m_calo
int * m_barrel_ec
int * m_pos_neg
int * m_FT
int * m_slot
int * m_channel
std::vector< int > * m_samples
std::vector< unsigned int > * m_sca
unsigned int * m_offId
bool * m_Itervalid
bool * m_Iterconverged
short * m_IterNIter
float * m_IterAmpl
float * m_IterTau
short * m_IterPeakSample
float * m_IterDelay
float * m_IterQual
short * m_IterIdx
std::string m_prefix
 Property: the variable prefix for this block.
std::string m_suffix
 Property: the variable prefix for this block.
std::string m_blockName
 Property: the name of this block.
TypeConverter m_converter
 Helper to do type conversions.
IAddVariablem_tree
 Reference to the block name.

Static Private Attributes

static const std::string s_emptyString
 Used to provide a default value for blockName.

Detailed Description

Block filler tool for EM samplings from a CaloCluster.

Definition at line 31 of file LArDigitFillerTool.h.

Constructor & Destructor Documentation

◆ LArDigitFillerTool()

D3PD::LArDigitFillerTool::LArDigitFillerTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Standard Gaudi tool constructor.

Parameters
typeThe name of the tool type.
nameThe tool name.
parentThe tool's Gaudi parent.

Definition at line 49 of file LArDigitFillerTool.cxx.

53 : BlockFillerTool<LArDigit> (type, name, parent),
54 m_savesca(false),
55 //m_maxchannels(24000),
56 m_savedigit(true),
57 m_CaloType("EMHECFCAL"),
58 m_storeId(false),
59 m_em(false),
60 m_hec(false),
61 m_fcal(false),
62 //m_dump_cut(4096),
63 m_dump_gain("HIGHMEDIUMLOW"),
64 m_dumpIter(false),
65 //m_dumpDisc(false),
67 m_emId(0),
68 m_hecId(0),
69 m_fcalId(0),
71{
72 declareProperty("SaveDigit",m_savedigit);
73 declareProperty("SaveId",m_storeId);
74 declareProperty("SaveSCAAddress",m_savesca);
75 declareProperty("DumpIterResults",m_dumpIter);
76
77 //declareProperty("DumpDisconnected",m_dumpDisc);
78 //declareProperty("DumpGains",m_dump_gain);
79 //declareProperty("DumpCut",m_dump_cut);
80 //declareProperty("MaxChannels",m_maxChannels);
81 //declareProperty("Calo",m_CaloType);
82
83 for (int i = 0; i < CaloGain::LARNGAIN; i++)
84 m_gains[i] = false;
85
86 m_layer = 0;
87 m_eta = 0;
88 m_phi = 0;
89 m_gain = 0;
90 m_calo = 0;
91 m_barrel_ec = 0;
92 m_pos_neg = 0;
93 m_FT = 0;
94 m_slot = 0;
95 m_channel = 0;
96 m_samples = 0;
97 m_sca = 0;
98 m_offId = 0;
99 m_Itervalid = 0;
100 m_Iterconverged = 0;
101 m_IterNIter = 0;
102 m_IterAmpl = 0;
103 m_IterTau = 0;
105 m_IterDelay = 0;
106 m_IterQual = 0;
107 m_IterIdx = 0;
108}
std::vector< unsigned int > * m_sca
bool m_gains[CaloGain::LARNGAIN]
const LArOnlineID * m_onlineHelper
std::vector< int > * m_samples
const LArFCAL_ID * m_fcalId
@ LARNGAIN
Definition CaloGain.h:19

Member Function Documentation

◆ addDimensionedVariable() [1/3]

StatusCode D3PD::AddVariable::addDimensionedVariable ( const std::string & name,
const std::type_info & ti,
void *& ptr,
const std::string & dim,
const std::string & docstring = "",
const void * defval = 0 )
virtualinherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
typeThe type of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.
defvalPointer to the default value to use for this variable. Null for no default (generally means to fill with zeros). Of the type given by ti. Only works for basic types.

If called from the constructor, the only effect is to clear ptr.

Definition at line 119 of file AddVariable.cxx.

129{
130 if (!m_tree) {
131 // Called from constructor --- just initialize pointer.
132 ptr = 0;
133 return StatusCode::SUCCESS;
134 }
135
137 ti, ptr, dim,
138 docstring, defval ) );
140 ti, ptr, dim,
142}
#define CHECK(...)
Evaluate an expression and check for errors.
virtual StatusCode addDimensionedVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &dim, const std::string &docstring="", const void *defval=0)
Add a variable to the tuple.
Type-safe wrapper for block filler tools.

◆ addDimensionedVariable() [2/3]

StatusCode D3PD::IAddVariable::addDimensionedVariable ( const std::string & name,
LArDigit *& ptr,
const std::string & dim,
const std::string & docstring,
const U & defval )
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.
defvalPointer to the default value to use for this variable. Only works for basic types.

If called from the constructor, the only effect is to clear ptr.

◆ addDimensionedVariable() [3/3]

StatusCode D3PD::IAddVariable::addDimensionedVariable ( const std::string & name,
LArDigit *& ptr,
const std::string & dim,
const std::string & docstring = "" )
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.

If called from the constructor, the only effect is to clear ptr.

◆ addVariable() [1/3]

StatusCode D3PD::AddVariable::addVariable ( const std::string & name,
const std::type_info & ti,
void *& ptr,
const std::string & docstring = "",
const void * defval = 0 )
virtualinherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
typeThe type of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
docstringDocumentation string for this variable.
defvalPointer to the default value to use for this variable. Null for no default (generally means to fill with zeros). Of the type given by ti. Only works for basic types.

If called from the constructor, the only effect is to clear ptr.

Definition at line 93 of file AddVariable.cxx.

90{
91 if (!m_tree) {
92 // Called from constructor --- just initialize pointer.
93 ptr = 0;
95 }
96
98 ti, ptr, docstring, defval ) );
101}
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Add a variable to the tuple.

◆ addVariable() [2/3]

StatusCode D3PD::IAddVariable::addVariable ( const std::string & name,
LArDigit *& ptr,
const std::string & docstring,
const U & defval )
inherited

Make the template implementation from IAddVariable visible.

◆ addVariable() [3/3]

StatusCode D3PD::IAddVariable::addVariable ( const std::string & name,
LArDigit *& ptr,
const std::string & docstring = "" )
inherited

Make the template implementation from IAddVariable visible.

◆ BlockFillerToolImpl()

( const std::string & type,
const std::string & name,
const IInterface * parent )
inherited

Standard Gaudi tool constructor.

Parameters
typeThe name of the tool type.
nameThe tool name.
parentThe tool's Gaudi parent.

◆ book()

StatusCode D3PD::LArDigitFillerTool::book ( )
virtual

Book variables for this block.

Implements D3PD::BlockFillerTool< LArDigit >.

Definition at line 114 of file LArDigitFillerTool.cxx.

115{
116 ATH_MSG_DEBUG( "in book()" );
117
118 const CaloCell_ID* idHelper = nullptr;
119 ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
120 m_emId=idHelper->em_idHelper();
121 m_hecId=idHelper->hec_idHelper();
122 m_fcalId=idHelper->fcal_idHelper();
123
124
125 CHECK( m_cablingKey.initialize() );
126
127 CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") );
128
129
130 // CHECK(addVariable ("icell",m_cellIndex));
131 if (m_savedigit){
132 CHECK(addVariable ("layer", m_layer));
133 CHECK(addVariable ("ieta",m_eta));
134 CHECK(addVariable ("calo", m_calo));
135 CHECK(addVariable ("iphi", m_phi));
136 CHECK(addVariable ("barrel_ec",m_barrel_ec));
137 CHECK(addVariable ("pos_neg", m_pos_neg));
138 CHECK(addVariable ("FT", m_FT));
139 CHECK(addVariable ("slot", m_slot));
140 CHECK(addVariable ("channel", m_channel));
141 CHECK(addVariable ("gain",m_gain));
142 CHECK(addVariable ("Samples", m_samples));
143 }
144
145 if ( m_savesca == true ){
146 CHECK(addVariable ("sca_add", m_sca));
147 }
148 if ( m_storeId ) {
149 CHECK(addVariable ("offlineId", m_offId));
150 }
151
152 if (m_dumpIter) {
153 CHECK(addVariable("iter_valid" , m_Itervalid));
154 CHECK(addVariable("iter_converged" , m_Iterconverged));
155 CHECK(addVariable("iter_nIter" , m_IterNIter));
156 CHECK(addVariable("iter_ampl" , m_IterAmpl));
157 CHECK(addVariable("iter_tau" , m_IterTau));
158 CHECK(addVariable("iter_peakSample" , m_IterPeakSample));
159 CHECK(addVariable("iter_delay" , m_IterDelay));
160 CHECK(addVariable("iter_qual" , m_IterQual));
161 CHECK(addVariable("iter_index",m_IterIdx));
162 }
163
164 std::transform(m_CaloType.begin(), m_CaloType.end(), m_CaloType.begin(), toupper);
165 if(m_CaloType.find("EM") < m_CaloType.size()) m_em = true;
166 if(m_CaloType.find("HEC") < m_CaloType.size()) m_hec = true;
167 if(m_CaloType.find("FCAL") < m_CaloType.size()) m_fcal = true;
168
169 std::transform(m_dump_gain.begin(), m_dump_gain.end(), m_dump_gain.begin(), toupper);
170
171 if(m_dump_gain.find("HIGH")!=std::string::npos)
173 else
175
176 if(m_dump_gain.find("MEDIUM")!=std::string::npos)
178 else
180
181 if(m_dump_gain.find("LOW")!=std::string::npos)
183 else
185
186 return StatusCode::SUCCESS;
187
188}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
const LArFCAL_ID * fcal_idHelper() const
access to FCAL idHelper
Definition CaloCell_ID.h:75
const LArEM_ID * em_idHelper() const
access to EM idHelper
Definition CaloCell_ID.h:63
const LArHEC_ID * hec_idHelper() const
access to HEC idHelper
Definition CaloCell_ID.h:69
StatusCode addVariable(const std::string &name, T *&ptr, const std::string &docstring="")
Add a variable to the tuple.
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
@ LARMEDIUMGAIN
Definition CaloGain.h:18
@ LARLOWGAIN
Definition CaloGain.h:18
@ LARHIGHGAIN
Definition CaloGain.h:18
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ configureD3PD() [1/2]

StatusCode D3PD::AddVariable::configureD3PD ( IAddVariable * tree)
inherited

Configure the parent tree.

Parameters
treeThe parent IAddVariable instance.

Definition at line 69 of file AddVariable.cxx.

62{
63 m_tree = tree;
64 m_metadata.clear();
66}

◆ configureD3PD() [2/2]

virtual StatusCode D3PD::BlockFillerTool< LArDigit >::configureD3PD ( IAddVariable * tree,
const std::type_info & ti )
virtualinherited

Configure during initialization: type-check.

Parameters
treeOur parent for tuple making.
tiGives the type of the object being passed to fillUntyped.

configureD3PD should check that the type of the object coming as input is compatible with what it expects, and raise an error otherwise.

◆ configureImpl() [1/2]

StatusCode D3PD::BlockFillerToolImpl::configureImpl ( IAddVariable * tree,
const std::type_info & ti,
const std::type_info & fill_ti )
protectedinherited

Configure during initialization: type-check.

Parameters
treeOur parent for tuple making.
tiGives the type of the object being passed to fillUntyped.
fill_tiis the type of object that the user code will expect.

This is the common implementation for the configureD3PD method of IBlockFillerTool. It checks that the type of the object coming as input is compatible with what the user code is expecting, and raises an error otherwise.

Definition at line 70 of file BlockFillerToolImpl.cxx.

58{
60 CHECK( m_converter.init (ti, fill_ti) );
61
63}

◆ configureImpl() [2/2]

StatusCode D3PD::BlockFillerToolImpl::configureImpl ( IAddVariable * tree,
const std::type_info & ti,
const std::vector< const std::type_info * > & tis,
size_t & which )
protectedinherited

Configure during initialization: type-check.

Parameters
treeOur parent for tuple making.
tiGives the type of the object being passed to fillUntyped.
tisList of possible input types that we can accept.
[out]whichIndex of the accepted type.

This is the common implementation for the configureD3PD method of IBlockFillerTool. It checks that the type of the object coming as input is compatible with what the user code is expecting, and raises an error otherwise.

This version allows for one of a set of types to match. If successful, WHICH is set to the index (0-based) of the matching type.

Definition at line 91 of file BlockFillerToolImpl.cxx.

87{
89 CHECK( m_converter.init (ti, tis, which) );
91}

◆ convert()

StatusCode D3PD::BlockFillerToolImpl::convert ( void const *& p) const
protectedinherited

Do type conversion.

Parameters
p[in,out]Pointer to convert.

On entry, p is a pointer to an object of the type that was passed into configureImpl as ti. Convert the pointer to point to an object of the type that was given as fill_ti. If the conversion fails, the pointer is set to 0 (and FAILURE is returned).

Definition at line 107 of file BlockFillerToolImpl.cxx.

106{
107 p = m_converter.convertUntyped (p);
108 if (!p) {
110 << "Pointer conversion from " << m_converter.srcName() << " to "
111 << m_converter.dstName() << "failed.";
112 return StatusCode::FAILURE;
113 }
114 return StatusCode::SUCCESS;
115}
#define REPORT_MESSAGE(LVL)
Report a message.

◆ fill()

StatusCode D3PD::LArDigitFillerTool::fill ( const LArDigit & p)
virtual

Fill one block — type-safe version.

Parameters
pThe input object.

This is called once per object. The caller is responsible for arranging that all the pointers for booked variables are set appropriately upon entry.

Don't do skipping yet. if (gain>=CaloGain::LARNGAIN || m_gains[gain]==false) continue;

Check detector part const HWIdentifier chid=digit.hardwareID(); if ((m_onlineHelper->isEMBchannel(chid) || m_onlineHelper->isEMECchannel(chid)) && !m_em) continue; if (m_onlineHelper->isHECchannel(chid) && !m_hec) continue; if (m_onlineHelper->isFCALchannel(chid) && !m_fcal) continue;

Check if connected const bool connected=cabling->isOnlineConnected(chid); if (!connected && !m_dumpDisc) continue;

Copy samples to vector<long>, verify the number of samples, find max-sample const std::vector<short>& vSamples=digit.samples(); size_t n=vSamples.size(); if ((long)n!=nsamples) { ATH_MSG_WARNING( "Inconsistent number of ADC samples found!" ); if (n==0) continue; }

addSamples.resize(n); short maxSample=0; for (size_t i=0;i<n;++i) { addSamples[i]=vSamples[i];//Convert short -> long if (vSamples[i]>maxSample) maxSample=vSamples[i]; }

Check max-sample: skip filtering now! FIXME if (maxSample<m_dump_cut) continue;

All checks passed, fill ntuple now

Implements D3PD::BlockFillerTool< LArDigit >.

Definition at line 192 of file LArDigitFillerTool.cxx.

193{
194 ATH_MSG_DEBUG( "in fill()" );
195
196 //if (m_NEvents!=-1 && ++m_count>m_NEvents ) return StatusCode::SUCCESS;
197
198 const LArFebHeaderContainer *larFebHeaderContainer=NULL;
199 if (m_savesca == true){
200 StatusCode sc = evtStore()->retrieve(larFebHeaderContainer);
201 if (sc.isFailure() || !larFebHeaderContainer) {
202 ATH_MSG_DEBUG( "Cannot read LArFebHeaderContainer from StoreGate! SCA address not saved." );
203 larFebHeaderContainer=NULL;
204 }
205 }
206
207 const LArOFIterResultsContainer *larOFIterCont=NULL;
208 if (m_dumpIter) {
209 StatusCode sc =evtStore()->retrieve(larOFIterCont);
210 if (sc.isFailure()) {
211 ATH_MSG_DEBUG( "Can't retrieve LArOFIterResultsContainer from StoreGate." );
212 larOFIterCont=NULL;
213 }
214 ATH_MSG_DEBUG( "Got LArOFIterResultsContainer from StoreGate." );
215 }
216
217
218 m_cellIndex=0;
219 //size_t digitContIdx=0;
220 size_t febHeaderContIdx=0;
221 size_t ofcIterContIdx=0;
222 size_t ofcIterContIdx_temp=0;
223
224 //There are various restrictions when to write channel to CBNT:
225
226 //Check gain
227 const long gain=digit.gain();
228
229 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey};
230 const LArOnOffIdMapping* cabling{*cablingHdl};
231 if(!cabling){
232 ATH_MSG_ERROR("Do not have mapping object " << m_cablingKey.key() );
233 return StatusCode::FAILURE;
234 }
270 const std::vector<short>& vSamples=digit.samples();
271 const HWIdentifier chid=digit.hardwareID();
272 size_t n=vSamples.size();
273 int nsamples=vSamples.size();
274 const bool connected=cabling->isOnlineConnected(chid);
275 ATH_MSG_DEBUG( " is connected " <<connected );
276
277
278 if (m_savedigit){
279
280 (*m_samples).resize(n);
281 for (size_t i=0;i<n;++i) {
282 (*m_samples)[i] = vSamples[i] ; //Convert short -> long
283 }
284
285 //Add samples to ntuple
286 // *m_samples = vSamples;
287
288 //Add offline ID
289 if (connected) {
290 const Identifier id=cabling->cnvToIdentifier(chid);
291 if(m_storeId) *m_offId = id.get_identifier32().get_compact() ;
292 if (m_emId->is_lar_em(id)) {
293 *m_calo = 0;
294 *m_eta = m_emId->eta(id);
295 *m_phi = m_emId->phi(id);
296 *m_layer = m_emId->sampling(id);
297 }
298 else if (m_hecId->is_lar_hec(id)) {
299 *m_calo= 1;
300 *m_eta = m_hecId->eta(id);
301 *m_phi = m_hecId->phi(id);
302 *m_layer = m_hecId->sampling(id);
303 }
304 else if (m_fcalId->is_lar_fcal(id)) {
305 *m_calo = 2;
306 *m_eta = m_fcalId->eta(id);
307 *m_phi = m_fcalId->phi(id);
308 *m_layer = m_fcalId->module(id);
309 }
310 else {
311 ATH_MSG_WARNING( "LArDigit Id "<< MSG::hex << id.get_compact() << MSG::dec
312 << " (FT: " << m_onlineHelper->feedthrough(chid) << " FEBSlot: " << m_onlineHelper->slot(chid) << " Chan: " << m_onlineHelper->channel(chid)
313 << ") appears to be neither EM nor HEC nor FCAL." );
314 *m_calo = -998;
315 }
316 }
317 else {
318 if(m_storeId) *m_offId= 0;
319 *m_calo= -998;
320 *m_eta= -998;
321 *m_phi= -998;
322 *m_layer= -998;
323 } // end else disconnected
324
325 //Add online ID
326 *m_barrel_ec = m_onlineHelper->barrel_ec(chid);
327 *m_pos_neg = m_onlineHelper->pos_neg(chid);
328 *m_FT = m_onlineHelper->feedthrough(chid);
329 *m_slot= m_onlineHelper->slot(chid);
330 *m_channel = m_onlineHelper->channel(chid);
331 *m_gain = gain;
332 m_cellIndex++;
333 }
334
335 ATH_MSG_DEBUG( " m_savesca and FebHead, OFIterCont " << m_savesca <<" " << larFebHeaderContainer << " " <<larOFIterCont );
336
337 //Add SCA info if needed
338 if (m_savesca)
339 {
340 if (larFebHeaderContainer ){
341 const HWIdentifier chanFebId=m_onlineHelper->feb_Id(chid); //FebId of current channel
342 const size_t febHead_s=larFebHeaderContainer->size();
343
344 //Search for the right element in the FEB header container
345 for(;febHeaderContIdx<febHead_s && chanFebId!=larFebHeaderContainer->at(febHeaderContIdx)->FEBId();
346 ++febHeaderContIdx)
347 ;
348
349 if (febHeaderContIdx<febHead_s) {
350 const std::vector<unsigned short>& sca=larFebHeaderContainer->at(febHeaderContIdx)->SCA();
351 n=sca.size();
352 if ((long)n!=nsamples){
353 ATH_MSG_WARNING( "Inconsistent number of SCA entries" );
354 }
355
356 /* addSamples.resize(n);
357 for (size_t i=0;i<n;++i)
358 addSamples[i]=sca[i];//Convert short -> long
359 */
360
361 (*m_sca).resize(n);
362 for (size_t i=0;i<n;++i) {
363 (*m_sca)[i]=sca[i];
364 }
365
366 // *m_sca= sca;
367
368 }
369 else {
370 ATH_MSG_ERROR( "LArDigitContainer and LArFebHeaderContainer out of sync!" );
371 ATH_MSG_WARNING( "Can't find FEB with id = "<< std::hex << chanFebId.get_compact() << std::dec );
372 }
373 }
374 else
375 {
376 (*m_sca).clear();
377 }
378 }
379
380 // Add OFC Iter results if needed
381 ATH_MSG_DEBUG( " m_dumpIter, OFIterCont " << m_dumpIter<< " " << larOFIterCont );
382 if (m_dumpIter) {
383 if (larOFIterCont) {
384
385 const size_t iterRes_s=larOFIterCont->size();
386
387 ofcIterContIdx_temp = ofcIterContIdx;
388 //Search the right element of the results container
389 for(;ofcIterContIdx<iterRes_s && chid!=larOFIterCont->at(ofcIterContIdx).getChannelID();++ofcIterContIdx)
390 ;
391
392 // Check No Missing Iteration Result
393 if( ofcIterContIdx>=iterRes_s) {// && (ofcIterContIdx - ofcIterContIdx_temp)!=1){
394
395 ATH_MSG_DEBUG( "Could not get iteration results for channel with id " << chid.get_compact() << std::dec
396 <<" in LArOFIterResultsContainer. CellIndex="<< m_cellIndex );
397
398 ofcIterContIdx = ofcIterContIdx_temp;
399 *m_Itervalid= 0 ;
400 *m_Iterconverged= 0 ;
401 *m_IterNIter= -999 ;
402 *m_IterAmpl= -999 ;
403 *m_IterTau= -999 ;
404 *m_IterPeakSample= -999 ;
405 *m_IterDelay= -999 ;
406 *m_IterQual= -999 ;
407 *m_IterIdx= -999;
408 }
409 else{
410 const LArOFIterResults& iterRes=larOFIterCont->at(ofcIterContIdx);
411 //std::cout << chid << "\t" << iterRes.getChannelID() << std::endl;
412 if (chid!=iterRes.getChannelID()) {
413 ATH_MSG_ERROR( "Channel IDs don't match" );
414 return StatusCode::FAILURE;
415 }
416 *m_Itervalid= iterRes.getValid();
417 *m_Iterconverged= iterRes.getConverged();
418 *m_IterNIter= iterRes.getNIterPerf();
419 *m_IterAmpl= iterRes.getAmplitude();
420 *m_IterTau= iterRes.getTau();
422 *m_IterDelay= iterRes.getDelay_final();
423 *m_IterQual= iterRes.getQuality();
424 *m_IterIdx= iterRes.getOFCIndex();
425 }
426
427 }
428 else
429 {
430 *m_Itervalid= 0 ;
431 *m_Iterconverged= 0 ;
432 *m_IterNIter= -999 ;
433 *m_IterAmpl= -999 ;
434 *m_IterTau= -999 ;
435 *m_IterPeakSample= -999 ;
436 *m_IterDelay= -999 ;
437 *m_IterQual= -999 ;
438 *m_IterIdx= -999;
439 }
440 }
441
442 return StatusCode::SUCCESS ;
443
444}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
static Double_t sc
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
value_type get_compact() const
Get the compact id.
const std::vector< uint16_t > & SCA() const
get the SCA's
int getNIterPerf() const
float getTau() const
bool getConverged() const
float getDelay_final() const
bool getValid() const
HWIdentifier getChannelID() const
float getAmplitude() const
unsigned getOFCIndex() const
unsigned getPeakSample_final() const
float getQuality() const
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ fillAgain()

virtual StatusCode D3PD::BlockFillerTool< LArDigit >::fillAgain ( const LArDigit & p)
virtualinherited

Fill one block, after AGAIN has been returned (type-safe).

Parameters
pThe input object.

Once fill returns AGAIN, the parent should call fillAgain with the same arguments. This continues until fillAgain returns something other than AGAIN.

By default, this just calls fill().

◆ fillUntyped()

virtual StatusCode D3PD::BlockFillerTool< LArDigit >::fillUntyped ( const void * p,
bool again = false )
virtualinherited

Fill one block.

Parameters
pThe input object.
againSet if this is a subsequent call requested by an AGAIN return

This is called once per object. The type of the object at which p points is given by the ti argument to configureD3PD. The caller is responsible for arranging that all the pointers for booked variables are set appropriately upon entry.

If the return status is the special code AGAIN (defined above), then this filler tool wants to make multiple entries. The parent should set up to capture a new ‘row’ and run through the list of block filler tools again, but for this tool call fillAgainUntyped instead of fillUntyped. This should be repeated as long as fillAgainUntyped returns AGAIN.

Once fillUntyped returns AGAIN, the parent should call fillUntyped with the same p argument and again set to true. This continues until fillUntyped returns something other than AGAIN.

Not all parents may support this. In that case, returning AGAIN will be treated as an error.

Member Data Documentation

◆ m_barrel_ec

int* D3PD::LArDigitFillerTool::m_barrel_ec
private

Definition at line 97 of file LArDigitFillerTool.h.

◆ m_blockName

std::string D3PD::BlockFillerToolImpl::m_blockName
privateinherited

Property: the name of this block.

Definition at line 118 of file BlockFillerToolImpl.h.

◆ m_cablingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> D3PD::LArDigitFillerTool::m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
private

Definition at line 62 of file LArDigitFillerTool.h.

62{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};

◆ m_calo

int* D3PD::LArDigitFillerTool::m_calo
private

Definition at line 96 of file LArDigitFillerTool.h.

◆ m_CaloType

std::string D3PD::LArDigitFillerTool::m_CaloType
private

Definition at line 68 of file LArDigitFillerTool.h.

◆ m_cellIndex

long D3PD::LArDigitFillerTool::m_cellIndex
private

Definition at line 89 of file LArDigitFillerTool.h.

◆ m_channel

int* D3PD::LArDigitFillerTool::m_channel
private

Definition at line 101 of file LArDigitFillerTool.h.

◆ m_converter

TypeConverter D3PD::BlockFillerToolImpl::m_converter
privateinherited

Helper to do type conversions.

Definition at line 121 of file BlockFillerToolImpl.h.

◆ m_dump_gain

std::string D3PD::LArDigitFillerTool::m_dump_gain
private

Definition at line 76 of file LArDigitFillerTool.h.

◆ m_dumpIter

bool D3PD::LArDigitFillerTool::m_dumpIter
private

Definition at line 78 of file LArDigitFillerTool.h.

◆ m_em

bool D3PD::LArDigitFillerTool::m_em
private

Definition at line 71 of file LArDigitFillerTool.h.

◆ m_emId

const LArEM_ID* D3PD::LArDigitFillerTool::m_emId
private

Definition at line 84 of file LArDigitFillerTool.h.

◆ m_eta

int* D3PD::LArDigitFillerTool::m_eta
private

Definition at line 93 of file LArDigitFillerTool.h.

◆ m_fcal

bool D3PD::LArDigitFillerTool::m_fcal
private

Definition at line 73 of file LArDigitFillerTool.h.

◆ m_fcalId

const LArFCAL_ID* D3PD::LArDigitFillerTool::m_fcalId
private

Definition at line 86 of file LArDigitFillerTool.h.

◆ m_FT

int* D3PD::LArDigitFillerTool::m_FT
private

Definition at line 99 of file LArDigitFillerTool.h.

◆ m_gain

int* D3PD::LArDigitFillerTool::m_gain
private

Definition at line 95 of file LArDigitFillerTool.h.

◆ m_gains

bool D3PD::LArDigitFillerTool::m_gains[CaloGain::LARNGAIN]
private

Definition at line 77 of file LArDigitFillerTool.h.

◆ m_hec

bool D3PD::LArDigitFillerTool::m_hec
private

Definition at line 72 of file LArDigitFillerTool.h.

◆ m_hecId

const LArHEC_ID* D3PD::LArDigitFillerTool::m_hecId
private

Definition at line 85 of file LArDigitFillerTool.h.

◆ m_IterAmpl

float* D3PD::LArDigitFillerTool::m_IterAmpl
private

Definition at line 113 of file LArDigitFillerTool.h.

◆ m_Iterconverged

bool* D3PD::LArDigitFillerTool::m_Iterconverged
private

Definition at line 111 of file LArDigitFillerTool.h.

◆ m_IterDelay

float* D3PD::LArDigitFillerTool::m_IterDelay
private

Definition at line 116 of file LArDigitFillerTool.h.

◆ m_IterIdx

short* D3PD::LArDigitFillerTool::m_IterIdx
private

Definition at line 118 of file LArDigitFillerTool.h.

◆ m_IterNIter

short* D3PD::LArDigitFillerTool::m_IterNIter
private

Definition at line 112 of file LArDigitFillerTool.h.

◆ m_IterPeakSample

short* D3PD::LArDigitFillerTool::m_IterPeakSample
private

Definition at line 115 of file LArDigitFillerTool.h.

◆ m_IterQual

float* D3PD::LArDigitFillerTool::m_IterQual
private

Definition at line 117 of file LArDigitFillerTool.h.

◆ m_IterTau

float* D3PD::LArDigitFillerTool::m_IterTau
private

Definition at line 114 of file LArDigitFillerTool.h.

◆ m_Itervalid

bool* D3PD::LArDigitFillerTool::m_Itervalid
private

Definition at line 110 of file LArDigitFillerTool.h.

◆ m_layer

int* D3PD::LArDigitFillerTool::m_layer
private

Definition at line 92 of file LArDigitFillerTool.h.

◆ m_metadata

ObjectMetadata D3PD::AddVariable::m_metadata
protectedinherited

Metadata about the variables created by this object.

Definition at line 129 of file AddVariable.h.

◆ m_offId

unsigned int* D3PD::LArDigitFillerTool::m_offId
private

Definition at line 108 of file LArDigitFillerTool.h.

◆ m_onlineHelper

const LArOnlineID* D3PD::LArDigitFillerTool::m_onlineHelper
private

Definition at line 83 of file LArDigitFillerTool.h.

◆ m_phi

int* D3PD::LArDigitFillerTool::m_phi
private

Definition at line 94 of file LArDigitFillerTool.h.

◆ m_pos_neg

int* D3PD::LArDigitFillerTool::m_pos_neg
private

Definition at line 98 of file LArDigitFillerTool.h.

◆ m_prefix

std::string D3PD::BlockFillerToolImpl::m_prefix
privateinherited

Property: the variable prefix for this block.

Definition at line 112 of file BlockFillerToolImpl.h.

◆ m_samples

std::vector< int >* D3PD::LArDigitFillerTool::m_samples
private

Definition at line 105 of file LArDigitFillerTool.h.

◆ m_savedigit

bool D3PD::LArDigitFillerTool::m_savedigit
private

Definition at line 66 of file LArDigitFillerTool.h.

◆ m_savesca

bool D3PD::LArDigitFillerTool::m_savesca
private

Definition at line 65 of file LArDigitFillerTool.h.

◆ m_sca

std::vector< unsigned int >* D3PD::LArDigitFillerTool::m_sca
private

Definition at line 106 of file LArDigitFillerTool.h.

◆ m_slot

int* D3PD::LArDigitFillerTool::m_slot
private

Definition at line 100 of file LArDigitFillerTool.h.

◆ m_storeId

bool D3PD::LArDigitFillerTool::m_storeId
private

Definition at line 69 of file LArDigitFillerTool.h.

◆ m_suffix

std::string D3PD::BlockFillerToolImpl::m_suffix
privateinherited

Property: the variable prefix for this block.

Definition at line 115 of file BlockFillerToolImpl.h.

◆ m_tree

IAddVariable* D3PD::AddVariable::m_tree
privateinherited

Reference to the block name.

The parent IAddVariable instance.

Definition at line 143 of file AddVariable.h.

◆ s_emptyString

const std::string D3PD::AddVariable::s_emptyString
staticprivateinherited

Used to provide a default value for blockName.

Definition at line 41 of file AddVariable.h.


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