ATLAS Offline Software
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 
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"
27 #include "AthAllocators/DataPool.h"
29 class CaloCellContainer;
30 class CaloCell;
31 class CaloCellPacker_400_500_test;
32 namespace SG {
34 }
35 
145 {
146 public:
154  void pack (const CaloCellContainer& cells,
156  const SG::ThinningDecisionBase* dec,
157  int version) const;
158 
159 
173  const std::vector<CaloCompactCellContainer::value_type>&vheader,
175  DataPool<LArCell>& larpool,
176  DataPool<TileCell>& tilepool) const;
177 
178 private:
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 
251  struct header500
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 
267  struct header501
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.
276  STATUS_UNORDERED = (1 << 0),
277  // Set if the cells are SuperCell
278  STATUS_IS_SUPERCELL = (1 << 1)
279  };
280  };
281 
282 
284  typedef header501 header;
285 
286 
296  struct pars500
297  : public header
298  {
300  int m_qgood;
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,
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
CaloCellPacker_400_500::header500::m_lengthProvenance
unsigned int m_lengthProvenance
Definition: CaloCellPacker_400_500.h:256
TileCell
Definition: TileCell.h:57
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
RunTileCalibRec.cells
cells
Definition: RunTileCalibRec.py:271
CaloCellPackerUtils::Floatfield
Helper for packing a float into/out of a bit field.
Definition: CaloCellPackerUtils.h:81
CaloCellPacker_400_500::pars500::m_prov_max
unsigned int m_prov_max
Definition: CaloCellPacker_400_500.h:304
CaloCellPackerUtils::Floatfield2
Helper for packing a float into/out of a bit field, with a minimum of 0.
Definition: CaloCellPackerUtils.h:132
CaloCellPacker_400_500::header400::m_enmed
int m_enmed
Definition: CaloCellPacker_400_500.h:222
CaloCellPacker_400_500::pars500::m_prov_field
CaloCellPackerUtils::Bitfield m_prov_field
Definition: CaloCellPacker_400_500.h:318
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
CaloCellPacker_400_500::unpack_tile
TileCell unpack_tile(CaloCompactCellContainer::compact_input_iterator &it, const CaloDetDescrElement *dde, const pars500 &pars, uint16_t provenance) const
Unpack a tile cell.
Definition: CaloCellPacker_400_500.cxx:786
CaloCellPacker_400_500::init_header
void init_header(header &header, int version) const
Initialize header with the current version of the packing parameters.
Definition: CaloCellPacker_400_500.cxx:41
CaloCellPacker_400_500::pars500::m_crtae_tile_low_field
CaloCellPackerUtils::Floatfield2 m_crtae_tile_low_field
Definition: CaloCellPacker_400_500.h:325
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
CaloCompactCellContainer.h
CaloCellPacker_400_500::header400::m_esign_mask
unsigned int m_esign_mask
Definition: CaloCellPacker_400_500.h:211
CaloCellPacker_400_500::header400::m_e1_high_res
float m_e1_high_res
Definition: CaloCellPacker_400_500.h:238
CaloCellPacker_400_500::header400::m_ncells_larem
int m_ncells_larem
Counters of number of cells in each subcalo.
Definition: CaloCellPacker_400_500.h:202
SG::ThinningDecisionBase
Hold thinning decisions for one container.
Definition: ThinningDecisionBase.h:39
CaloCellPacker_400_500::pars500::m_lar_dummy
CaloCompactCell::value_type m_lar_dummy
Definition: CaloCellPacker_400_500.h:338
CaloCellPacker_400_500
Calo cell packer/unpacker v400/500.
Definition: CaloCellPacker_400_500.h:145
CaloCellPacker_400_500::pars500::m_egain_tile_field
CaloCellPackerUtils::Bitfield m_egain_tile_field
Definition: CaloCellPacker_400_500.h:327
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloCellPacker_400_500::header400::m_length
int m_length
Definition: CaloCellPacker_400_500.h:197
CaloCellPacker_400_500::pack_lar
void pack_lar(const CaloCell *cell, CaloCell_ID::SUBCALO subcalo, CaloCompactCellContainer::compact_output_iterator &it, const pars500 &pars) const
Pack one LAr cell.
Definition: CaloCellPacker_400_500.cxx:246
CaloCellPacker_400_500::header400::m_e1_norm_res
float m_e1_norm_res
Packing ranges for floats.
Definition: CaloCellPacker_400_500.h:237
CaloCellPacker_400_500::header400::m_glow
int m_glow
Definition: CaloCellPacker_400_500.h:225
CaloCellPacker_400_500::clear_header
void clear_header(header &header) const
Clear the counters in the event header.
Definition: CaloCellPacker_400_500.cxx:104
skel.it
it
Definition: skel.GENtoEVGEN.py:396
CaloCellPacker_400_500::header400::m_t1
float m_t1
Definition: CaloCellPacker_400_500.h:242
CaloCellPacker_400_500::pars500::m_qgood
int m_qgood
Good quality flag.
Definition: CaloCellPacker_400_500.h:300
CaloCellPacker_400_500::unpack_lar
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.
Definition: CaloCellPacker_400_500.cxx:709
CaloCellPacker_400_500::unpack_time
double unpack_time(CaloCompactCellContainer::compact_input_iterator &it, const pars500 &pars) const
Unpack the time word.
Definition: CaloCellPacker_400_500.cxx:672
CaloCellPacker_400_500::header400::m_seq_larem
int m_seq_larem
Counts of number of sequences in each subcalo.
Definition: CaloCellPacker_400_500.h:231
CaloCellPacker_400_500::header400::m_egain_mask
unsigned int m_egain_mask
Definition: CaloCellPacker_400_500.h:210
CaloCellPacker_400_500::header400::m_seq_larfcal
int m_seq_larfcal
Definition: CaloCellPacker_400_500.h:233
CaloCellPacker_400_500::header400::m_qabad
int m_qabad
Various enumeration constants.
Definition: CaloCellPacker_400_500.h:220
CaloCellPackerUtils::Bitfield
Helper for packing into/out of a bit field.
Definition: CaloCellPackerUtils.h:37
CaloCellPacker_400_500::pars500::m_log_t1
double m_log_t1
Definition: CaloCellPacker_400_500.h:313
CaloCellPacker_400_500::pars500::m_tile_dummy
CaloCompactCell::value_type m_tile_dummy
Definition: CaloCellPacker_400_500.h:340
CaloCell_ID.h
CaloCellPacker_400_500::header400::m_seq_tile
int m_seq_tile
Definition: CaloCellPacker_400_500.h:234
CaloCellPacker_400_500::header400::m_t0
float m_t0
Definition: CaloCellPacker_400_500.h:241
CaloCellPacker_400_500::header400::m_high_tile
float m_high_tile
Definition: CaloCellPacker_400_500.h:239
CaloCellPacker_400_500::pars500::m_qualy_field
CaloCellPackerUtils::Bitfield m_qualy_field
Definition: CaloCellPacker_400_500.h:321
H5Utils::internal::packed
H5::CompType packed(H5::CompType in)
Definition: common.cxx:16
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
CaloCellPacker_400_500::pars500::m_crtae_norm_field
CaloCellPackerUtils::Floatfield2 m_crtae_norm_field
Definition: CaloCellPacker_400_500.h:323
CaloCellPacker_400_500::pars500::m_cbrt_e1_norm_res
double m_cbrt_e1_norm_res
Transformed packing ranges for floats.
Definition: CaloCellPacker_400_500.h:308
CaloCompactCellContainer
container class for CaloCompactCell objects
Definition: CaloCompactCellContainer.h:31
CaloCellPacker_400_500::pars500::m_logat_field
CaloCellPackerUtils::Floatfield m_logat_field
Definition: CaloCellPacker_400_500.h:322
CaloCellPacker_400_500::header501
Packing parameters header (v501).
Definition: CaloCellPacker_400_500.h:269
CaloCellPacker_400_500::unpack
void unpack(const CaloCompactCellContainer &packed, const std::vector< CaloCompactCellContainer::value_type > &vheader, CaloCellContainer &cells, DataPool< LArCell > &larpool, DataPool< TileCell > &tilepool) const
Unpack cells.
Definition: CaloCellPacker_400_500.cxx:881
CaloCellPacker_400_500::pars500::m_cbrt_low_tile
double m_cbrt_low_tile
Definition: CaloCellPacker_400_500.h:310
CaloCellPacker_400_500::pack
void pack(const CaloCellContainer &cells, CaloCompactCellContainer &packed, const SG::ThinningDecisionBase *dec, int version) const
Pack cells.
Definition: CaloCellPacker_400_500.cxx:470
CaloCell_Base_ID::SUBCALO
SUBCALO
enumeration of sub calorimeters
Definition: CaloCell_Base_ID.h:46
CaloCellPacker_400_500::header400::m_crtae_mask
unsigned int m_crtae_mask
Definition: CaloCellPacker_400_500.h:212
CaloCellPackerUtils.h
Utilities for compacting calorimeter cells.
CaloCellPacker_400_500::pars500::m_crtae_high_field
CaloCellPackerUtils::Floatfield2 m_crtae_high_field
Definition: CaloCellPacker_400_500.h:324
TileCell.h
CaloCellPacker_400_500::write_header
void write_header(const header &header, CaloCompactCellContainer &packed) const
Write the header to the output container.
Definition: CaloCellPacker_400_500.cxx:647
CaloCellPacker_400_500::pack_time
void pack_time(float time, CaloCompactCellContainer::compact_output_iterator &it, const pars500 &pars) const
Pack a time value.
Definition: CaloCellPacker_400_500.cxx:213
CaloCellPacker_400_500::init_derived
void init_derived(pars500 &pars) const
Initialize the derived packing parameters from the constants in the header.
Definition: CaloCellPacker_400_500.cxx:124
CaloCellPacker_400_500::header400::m_low_tile
float m_low_tile
Definition: CaloCellPacker_400_500.h:240
CaloCellPacker_400_500::pars500::m_nseq_field
CaloCellPackerUtils::Bitfield m_nseq_field
Definition: CaloCellPacker_400_500.h:317
DataPool.h
CaloCellPacker_400_500::pars500::m_tile_dummy_subst
CaloCompactCell::value_type m_tile_dummy_subst
Definition: CaloCellPacker_400_500.h:341
CaloCellPacker_400_500::header400::m_ncells_tile
int m_ncells_tile
Definition: CaloCellPacker_400_500.h:205
CaloCellPacker_400_500::header
header501 header
The most recent header version.
Definition: CaloCellPacker_400_500.h:284
CaloCellPacker_400_500::header400::m_esign_tile_mask
unsigned int m_esign_tile_mask
Definition: CaloCellPacker_400_500.h:214
CaloCellPacker_400_500::header400::m_version
int m_version
Definition: CaloCellPacker_400_500.h:199
CaloCellPacker_400_500::header400::m_ghigh
int m_ghigh
Definition: CaloCellPacker_400_500.h:226
CaloCompactCell::value_type
unsigned short value_type
value type for the compact CaloCell data
Definition: CaloCompactCell.h:34
CaloCellPacker_400_500::finish_seq
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.
Definition: CaloCellPacker_400_500.cxx:425
CaloCellPacker_400_500::header400::m_tsign_mask
unsigned int m_tsign_mask
Definition: CaloCellPacker_400_500.h:216
CaloCellPacker_400_500::pars500::m_cbrt_e1_high_res
double m_cbrt_e1_high_res
Definition: CaloCellPacker_400_500.h:309
CaloCellPacker_400_500::header400
Packing parameters header (v400).
Definition: CaloCellPacker_400_500.h:196
LArCell.h
CaloCompactCellContainer::compact_input_iterator
Simple iterator-like object for reading from the container.
Definition: CaloCompactCellContainer.h:156
CaloCellPacker_400_500::header400::m_seq_larhec
int m_seq_larhec
Definition: CaloCellPacker_400_500.h:232
LArCell
Data object for LAr calorimeter readout cell.
Definition: LArCell.h:53
CaloCellPacker_400_500::header500
Packing parameters header (v500).
Definition: CaloCellPacker_400_500.h:253
CaloCellPacker_400_500::pars500::m_tile_qual1_field
CaloCellPackerUtils::Bitfield m_tile_qual1_field
Definition: CaloCellPacker_400_500.h:329
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
CaloCellPacker_400_500::pars500::m_nseq_max
unsigned int m_nseq_max
Maximum number of cells in a sequence.
Definition: CaloCellPacker_400_500.h:303
CaloCellPacker_400_500::header501::STATUS_UNORDERED
@ STATUS_UNORDERED
Definition: CaloCellPacker_400_500.h:276
CaloCellPacker_400_500::header400::m_enlow
int m_enlow
Definition: CaloCellPacker_400_500.h:221
CaloCellPacker_400_500::header400::m_enhig
int m_enhig
Definition: CaloCellPacker_400_500.h:223
get_generator_info.version
version
Definition: get_generator_info.py:33
CaloCellPacker_400_500::CaloCellPacker_400_500_test
friend class CaloCellPacker_400_500_test
Definition: CaloCellPacker_400_500.h:483
CaloCellPacker_400_500::pars500::m_log_t0
double m_log_t0
Definition: CaloCellPacker_400_500.h:312
CaloCellPacker_400_500::header501::STATUS_IS_SUPERCELL
@ STATUS_IS_SUPERCELL
Definition: CaloCellPacker_400_500.h:278
CaloCellPacker_400_500::header400::m_egain_tile_mask
unsigned int m_egain_tile_mask
Definition: CaloCellPacker_400_500.h:213
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloCellPacker_400_500::header501::m_status
unsigned int m_status
Definition: CaloCellPacker_400_500.h:272
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
CaloCellPacker_400_500::header400::m_crtae_tile_mask
unsigned int m_crtae_tile_mask
Definition: CaloCellPacker_400_500.h:215
DataPool
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
Definition: DataPool.h:47
CaloCellPacker_400_500::header400::m_qualy_mask
unsigned int m_qualy_mask
Masks defining the bit positions used for various quantities.
Definition: CaloCellPacker_400_500.h:209
CaloCellPacker_400_500::header400::m_ehhig
int m_ehhig
Definition: CaloCellPacker_400_500.h:224
CaloCellPacker_400_500::pars500
Derived packing parmeters.
Definition: CaloCellPacker_400_500.h:298
CaloCellPacker_400_500::pars500::m_lar_dummy_subst
CaloCompactCell::value_type m_lar_dummy_subst
Definition: CaloCellPacker_400_500.h:339
CaloCellPacker_400_500::pars500::m_hash_field
CaloCellPackerUtils::Bitfield m_hash_field
Bitfields for various quantities.
Definition: CaloCellPacker_400_500.h:316
CaloCellPacker_400_500::header400::m_ncells_larfcal
int m_ncells_larfcal
Definition: CaloCellPacker_400_500.h:204
CaloCellPacker_400_500::pars500::m_tile_qual2_field
CaloCellPackerUtils::Bitfield m_tile_qual2_field
Definition: CaloCellPacker_400_500.h:330
CaloCellPacker_400_500::header400::m_logat_mask
unsigned int m_logat_mask
Definition: CaloCellPacker_400_500.h:217
CaloCellPacker_400_500::pars500::m_prov_max_tile
unsigned int m_prov_max_tile
Definition: CaloCellPacker_400_500.h:305
CaloCellPacker_400_500::pars500::m_egain_field
CaloCellPackerUtils::Bitfield m_egain_field
Definition: CaloCellPacker_400_500.h:320
CaloCellPacker_400_500::pars500::m_crtae_tile_high_field
CaloCellPackerUtils::Floatfield2 m_crtae_tile_high_field
Definition: CaloCellPacker_400_500.h:326
CaloCellPacker_400_500::pars500::m_cbrt_high_tile
double m_cbrt_high_tile
Definition: CaloCellPacker_400_500.h:311
CaloCellPacker_400_500::pack_tile
void pack_tile(const TileCell *cell, CaloCompactCellContainer::compact_output_iterator &it, const pars500 &pars) const
Pack one tile cell.
Definition: CaloCellPacker_400_500.cxx:341
CaloCellPacker_400_500::header400::m_ncells_larhec
int m_ncells_larhec
Definition: CaloCellPacker_400_500.h:203
CaloCompactCellContainer::compact_output_iterator
Simple iterator-like object for writing to the container.
Definition: CaloCompactCellContainer.h:211