ATLAS Offline Software
Loading...
Searching...
No Matches
CaloCellPacker_400_500.h
Go to the documentation of this file.
1// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
3/*
4 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5*/
6
7// $Id: CaloCellPacker_400_500.h,v 1.3 2009-03-19 01:42:14 ssnyder Exp $
8
17
18
19#ifndef CALOCELLPACKER_400_500_H
20#define CALOCELLPACKER_400_500_H
21
22
23#include "CaloCellPackerUtils.h"
25#include "LArRecEvent/LArCell.h"
26#include "TileEvent/TileCell.h"
30class CaloCell;
31class CaloCellPacker_400_500_test;
32namespace SG {
34}
35
145{
146public:
154 void pack (const CaloCellContainer& cells,
156 const SG::ThinningDecisionBase* dec,
157 int version) const;
158
159
172 void unpack (const CaloCompactCellContainer& packed,
173 const std::vector<CaloCompactCellContainer::value_type>&vheader,
174 CaloCellContainer& cells,
175 DataPool<LArCell>& larpool,
176 DataPool<TileCell>& tilepool) const;
177
178private:
179
180 //==========================================================================
183
196 struct header400 {
197 int m_length; // Header length, in units of int.
198
199 int m_version; // Version code (ICaloCompactCellTool).
200
206
209 unsigned int m_qualy_mask; // Quality.
210 unsigned int m_egain_mask; // LAr gain.
211 unsigned int m_esign_mask; // LAr energy sign bit.
212 unsigned int m_crtae_mask; // LAr cbrt(energy).
213 unsigned int m_egain_tile_mask; // Tile gain.
214 unsigned int m_esign_tile_mask; // Tile energy sign bit.
215 unsigned int m_crtae_tile_mask; // Tile cbrt(energy).
216 unsigned int m_tsign_mask; // Time sign bit.
217 unsigned int m_logat_mask; // log(time).
218
220 int m_qabad; // Bad quality flag.
221 int m_enlow; // LAr low gain.
222 int m_enmed; // LAr medium gain.
223 int m_enhig; // LAr high gain.
224 int m_ehhig; // LAr high gain with 50 GeV range.
225 int m_glow; // Tile low range.
226 int m_ghigh; // Tile high range.
227
235
237 float m_e1_norm_res; // Normal LAr energy range.
238 float m_e1_high_res; // High gain LAr energy range.
239 float m_high_tile; // High gain tile energy range.
240 float m_low_tile; // Low gain tile energy range.
241 float m_t0; // Lower time range.
242 float m_t1; // Upper time range.
243 };
244
245
252 : public header400
253 {
254 // The number of provenance entries (in 16-bit units).
255 // In order to know from where to start reading provenance.
256 unsigned int m_lengthProvenance;
257 };
258
259
268 : public header500
269 {
270 // A bitmask for additional status information.
271 // Added for version 501.
272 unsigned int m_status;
273
274 enum {
275 // Set if the cells are not in subcalo order.
277 // Set if the cells are SuperCell
279 };
280 };
281
282
285
286
296 struct pars500
297 : public header
298 {
301
303 unsigned int m_nseq_max;
304 unsigned int m_prov_max;
305 unsigned int m_prov_max_tile;
306
308 double m_cbrt_e1_norm_res; // cbrt(e1_norm_res)
309 double m_cbrt_e1_high_res; // cbrt(e1_high_res)
310 double m_cbrt_low_tile; // cbrt(low_tile)
311 double m_cbrt_high_tile; // cbrt(high_tile)
312 double m_log_t0; // log(t0)
313 double m_log_t1; // log(t1)
314
319
328
331
332 // Some errors are flagged by setting all bits on; the resulting packed
333 // values are stored in @c m_lar_dummy and @c m_tile_dummy.
334 // These are, however, still valid encodings. If we would legitimately
335 // pack a value that gives the dummy word, we replace it with @c subst,
336 // which has the low bit of the energy cleared. This effectively reduces
337 // the range on the low side slightly.
342 };
343
344
351 void init_header (header& header, int version) const;
352
353
358 void clear_header (header& header) const;
359
360
366 void init_derived (pars500& pars) const;
367
368
370 //==========================================================================
373
374
381 void pack_time (float time,
383 const pars500& pars) const;
384
385
393 void pack_lar (const CaloCell* cell,
394 CaloCell_ID::SUBCALO subcalo,
396 const pars500& pars) const;
397
398
405 void pack_tile (const TileCell* cell,
407 const pars500& pars) const;
408
409
418 void finish_seq (unsigned int hash,
419 unsigned int nseq,
421 CaloCell_ID::SUBCALO subcalo,
422 pars500& pars) const;
423
424
430 void write_header (const header& header,
431 CaloCompactCellContainer& packed) const;
432
433
435 //==========================================================================
438
439
447 const pars500& pars) const;
448
449
463 CaloCell_ID::SUBCALO subcalo,
464 LArCell* cell,
465 const pars500& pars,
466 uint16_t provenance) const;
467
468
478 const CaloDetDescrElement* dde,
479 const pars500& pars,
480 uint16_t provenance) const;
482
484};
485
486
487#endif // not CALOCELLPACKER_400_500_H
Utilities for compacting calorimeter cells.
Container class for CaloCell.
Helper for packing into/out of a bit field.
Helper for packing a float into/out of a bit field, with a minimum of 0.
Helper for packing a float into/out of a bit field.
Calo cell packer/unpacker v400/500.
CaloCell * unpack_lar(CaloCompactCellContainer::compact_input_iterator &it, CaloCell_ID::SUBCALO subcalo, LArCell *cell, const pars500 &pars, uint16_t provenance) const
Unpack a LAr cell.
void finish_seq(unsigned int hash, unsigned int nseq, CaloCompactCellContainer::compact_output_iterator &it, CaloCell_ID::SUBCALO subcalo, pars500 &pars) const
Finish up one cell sequence.
void write_header(const header &header, CaloCompactCellContainer &packed) const
Write the header to the output container.
void pack_tile(const TileCell *cell, CaloCompactCellContainer::compact_output_iterator &it, const pars500 &pars) const
Pack one tile cell.
header501 header
The most recent header version.
void unpack(const CaloCompactCellContainer &packed, const std::vector< CaloCompactCellContainer::value_type > &vheader, CaloCellContainer &cells, DataPool< LArCell > &larpool, DataPool< TileCell > &tilepool) const
Unpack cells.
double unpack_time(CaloCompactCellContainer::compact_input_iterator &it, const pars500 &pars) const
Unpack the time word.
void pack_time(float time, CaloCompactCellContainer::compact_output_iterator &it, const pars500 &pars) const
Pack a time value.
void pack_lar(const CaloCell *cell, CaloCell_ID::SUBCALO subcalo, CaloCompactCellContainer::compact_output_iterator &it, const pars500 &pars) const
Pack one LAr cell.
void init_derived(pars500 &pars) const
Initialize the derived packing parameters from the constants in the header.
TileCell unpack_tile(CaloCompactCellContainer::compact_input_iterator &it, const CaloDetDescrElement *dde, const pars500 &pars, uint16_t provenance) const
Unpack a tile cell.
void init_header(header &header, int version) const
Initialize header with the current version of the packing parameters.
void pack(const CaloCellContainer &cells, CaloCompactCellContainer &packed, const SG::ThinningDecisionBase *dec, int version) const
Pack cells.
void clear_header(header &header) const
Clear the counters in the event header.
CaloCell_Base_ID::SUBCALO SUBCALO
Definition CaloCell_ID.h:50
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
Simple iterator-like object for reading from the container.
Simple iterator-like object for writing to the container.
container class for CaloCompactCell objects
unsigned short value_type
value type for the compact CaloCell data
This class groups all DetDescr information related to a CaloCell.
a typed memory pool that saves time spent allocation small object.
Definition DataPool.h:63
Data object for LAr calorimeter readout cell.
Definition LArCell.h:53
Hold thinning decisions for one container.
Forward declaration.
Packing parameters header (v400).
int m_ncells_larem
Counters of number of cells in each subcalo.
float m_e1_norm_res
Packing ranges for floats.
int m_seq_larem
Counts of number of sequences in each subcalo.
int m_qabad
Various enumeration constants.
unsigned int m_qualy_mask
Masks defining the bit positions used for various quantities.
Packing parameters header (v500).
Packing parameters header (v501).
double m_cbrt_e1_norm_res
Transformed packing ranges for floats.
CaloCellPackerUtils::Floatfield2 m_crtae_norm_field
CaloCellPackerUtils::Floatfield2 m_crtae_high_field
CaloCompactCell::value_type m_tile_dummy
CaloCompactCell::value_type m_lar_dummy
CaloCompactCell::value_type m_lar_dummy_subst
CaloCellPackerUtils::Bitfield m_egain_tile_field
CaloCellPackerUtils::Bitfield m_egain_field
unsigned int m_nseq_max
Maximum number of cells in a sequence.
CaloCellPackerUtils::Bitfield m_prov_field
CaloCellPackerUtils::Floatfield2 m_crtae_tile_high_field
CaloCellPackerUtils::Floatfield2 m_crtae_tile_low_field
CaloCellPackerUtils::Bitfield m_qualy_field
CaloCellPackerUtils::Bitfield m_tile_qual1_field
CaloCompactCell::value_type m_tile_dummy_subst
CaloCellPackerUtils::Bitfield m_hash_field
Bitfields for various quantities.
CaloCellPackerUtils::Bitfield m_tile_qual2_field
CaloCellPackerUtils::Bitfield m_nseq_field
CaloCellPackerUtils::Floatfield m_logat_field