EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
CalorimeterHitDigi.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright (C) 2022 Chao Peng, Wouter Deconinck, Sylvester Joosten, Barak Schmookler, David Lawrence
3
4// A general digitization for CalorimeterHit from simulation
5// 1. Smear energy deposit with a/sqrt(E/GeV) + b + c/E or a/sqrt(E/GeV) (relative value)
6// 2. Digitize the energy with dynamic ADC range and add pedestal (mean +- sigma)
7// 3. Time conversion with smearing resolution (absolute value)
8// 4. Signal is summed if the SumFields are provided
9//
10// Author: Chao Peng
11// Date: 06/02/2021
12
13#pragma once
14
15#include <DD4hep/IDDescriptor.h>
16#include <algorithms/algorithm.h>
17#include <algorithms/geo.h>
18#include <edm4eic/MCRecoCalorimeterHitAssociationCollection.h>
19#include <edm4eic/EDM4eicVersion.h>
20#include <edm4hep/EventHeaderCollection.h>
21#include <edm4hep/RawCalorimeterHitCollection.h>
22#include <edm4hep/SimCalorimeterHitCollection.h>
23#include <stdint.h>
24#include <functional>
25#include <string>
26#include <string_view>
27
31
32#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
33#include <edm4eic/MCRecoCalorimeterHitLinkCollection.h>
34#endif
35
36namespace eicrecon {
37
38using CalorimeterHitDigiAlgorithm = algorithms::Algorithm<
39 algorithms::Input<edm4hep::EventHeaderCollection, edm4hep::SimCalorimeterHitCollection>,
40 algorithms::Output<edm4hep::RawCalorimeterHitCollection,
41#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
42 edm4eic::MCRecoCalorimeterHitLinkCollection,
43#endif
44 edm4eic::MCRecoCalorimeterHitAssociationCollection>>;
45
47 public WithPodConfig<CalorimeterHitDigiConfig> {
48
49public:
50 CalorimeterHitDigi(std::string_view name)
52 name,
53 {"eventHeader", "inputHitCollection"},
54 {"outputRawHitCollection",
55#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
56 "outputHitLinks",
57#endif
58 "outputRawHitAssociationCollection"},
59 "Smear energy deposit, digitize within ADC range, add pedestal, "
60 "convert time with smearing resolution, and sum signals."} {
61 }
62
63 void init() final;
64 void process(const Input&, const Output&) const final;
65
66private:
67 // unitless counterparts of inputs
68 double stepTDC{0}, tRes{0};
69
70 uint64_t id_mask{0};
71
72 std::function<double(const edm4hep::SimCalorimeterHit& h)> corrMeanScale;
73
74 dd4hep::IDDescriptor id_spec;
75
76 enum readout_enum { kSimpleReadout, kPoissonPhotonReadout, kSipmReadout };
77 enum readout_enum readoutType { kSimpleReadout };
78
79private:
80 const algorithms::GeoSvc& m_geo = algorithms::GeoSvc::instance();
81 const algorithms::UniqueIDGenSvc& m_uid = algorithms::UniqueIDGenSvc::instance();
82};
83
84} // namespace eicrecon
Definition UniqueIDGenSvc.h:23
Definition CalorimeterHitDigi.h:47
CalorimeterHitDigi(std::string_view name)
Definition CalorimeterHitDigi.h:50
Definition WithPodConfig.h:22
-client
Definition CalorimeterClusterRecoCoG.cc:37
algorithms::Algorithm< algorithms::Input< edm4hep::EventHeaderCollection, edm4hep::SimCalorimeterHitCollection >, algorithms::Output< edm4hep::RawCalorimeterHitCollection, edm4eic::MCRecoCalorimeterHitLinkCollection, edm4eic::MCRecoCalorimeterHitAssociationCollection > > CalorimeterHitDigiAlgorithm
Definition CalorimeterHitDigi.h:44