-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: inject the barrel imaging calorimeter hits into track reconstru…
…ction
- Loading branch information
Showing
6 changed files
with
198 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// SPDX-License-Identifier: LGPL-3.0-or-later | ||
// Copyright (C) 2024 Wouter Deconinck | ||
|
||
#include "algorithms/calorimetry/CalorimeterHitToTrackerHit.h" | ||
|
||
#include <DD4hep/Alignments.h> | ||
#include <DD4hep/IDDescriptor.h> | ||
#include <DD4hep/Objects.h> | ||
#include <DD4hep/Readout.h> | ||
#include <DD4hep/Segmentations.h> | ||
#include <DD4hep/Shapes.h> | ||
#include <DD4hep/VolumeManager.h> | ||
#include <DD4hep/Volumes.h> | ||
#include <DD4hep/config.h> | ||
#include <DDSegmentation/BitFieldCoder.h> | ||
#include <Evaluator/DD4hepUnits.h> | ||
#include <Math/GenVector/Cartesian3D.h> | ||
#include <Math/GenVector/DisplacementVector3D.h> | ||
#include <algorithms/service.h> | ||
#include <edm4eic/EDM4eicVersion.h> | ||
#include <fmt/core.h> | ||
#include <fmt/format.h> | ||
#include <algorithm> | ||
#include <cctype> | ||
#include <gsl/pointers> | ||
#include <map> | ||
#include <ostream> | ||
#include <string> | ||
#include <unordered_map> | ||
#include <utility> | ||
#include <vector> | ||
|
||
#include "services/evaluator/EvaluatorSvc.h" | ||
|
||
using namespace dd4hep; | ||
|
||
namespace eicrecon { | ||
|
||
void CalorimeterHitToTrackerHit::init() { } | ||
|
||
void CalorimeterHitToTrackerHit::process( | ||
const CalorimeterHitToTrackerHit::Input& input, | ||
const CalorimeterHitToTrackerHit::Output& output) const { | ||
|
||
const auto [calorimeter_hits] = input; | ||
auto [tracker_hits] = output; | ||
|
||
for (const auto &calorimeter_hit: *calorimeter_hits) { | ||
|
||
edm4eic::CovDiag3f position_error; | ||
|
||
[[maybe_unused]] | ||
auto tracker_hit = tracker_hits->create( | ||
calorimeter_hit.getCellID(), | ||
calorimeter_hit.getPosition(), | ||
position_error, | ||
calorimeter_hit.getTime(), | ||
calorimeter_hit.getTimeError(), | ||
calorimeter_hit.getEnergy(), | ||
calorimeter_hit.getEnergyError() | ||
); | ||
|
||
} | ||
} | ||
|
||
} // namespace eicrecon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
|
||
// SPDX-License-Identifier: LGPL-3.0-or-later | ||
// Copyright (C) 2022 Chao Peng, Sylvester Joosten, Wouter Deconinck, Chao, Whitney Armstrong | ||
|
||
// Reconstruct digitized outputs, paired with Jug::Digi::CalorimeterHitDigi | ||
// Author: Chao Peng | ||
// Date: 06/14/2021 | ||
|
||
#pragma once | ||
|
||
#include <DD4hep/DetElement.h> | ||
#include <DD4hep/Detector.h> | ||
#include <DD4hep/IDDescriptor.h> | ||
#include <DDRec/CellIDPositionConverter.h> | ||
#include <Parsers/Primitives.h> | ||
#include <algorithms/algorithm.h> | ||
#include <algorithms/geo.h> | ||
#include <edm4eic/CalorimeterHitCollection.h> | ||
#include <edm4eic/TrackerHitCollection.h> | ||
#include <stddef.h> | ||
#include <stdint.h> | ||
#include <gsl/pointers> | ||
#include <string> | ||
#include <string_view> | ||
|
||
namespace eicrecon { | ||
|
||
using CalorimeterHitToTrackerHitAlgorithm = algorithms::Algorithm< | ||
algorithms::Input< | ||
edm4eic::CalorimeterHitCollection | ||
>, | ||
algorithms::Output< | ||
edm4eic::TrackerHitCollection | ||
> | ||
>; | ||
|
||
class CalorimeterHitToTrackerHit | ||
: public CalorimeterHitToTrackerHitAlgorithm { | ||
|
||
public: | ||
CalorimeterHitToTrackerHit(std::string_view name) | ||
: CalorimeterHitToTrackerHitAlgorithm{name, | ||
{"inputCalorimeterHitCollection"}, | ||
{"outputTrackerHitCollection"}, | ||
"Convert calorimeter hits into tracker hits."} {} | ||
|
||
void init() final; | ||
void process(const Input&, const Output&) const final; | ||
|
||
private: | ||
const dd4hep::Detector* m_detector{algorithms::GeoSvc::instance().detector()}; | ||
const dd4hep::VolumeManager m_volume_manager{m_detector->volumeManager()}; | ||
|
||
}; | ||
|
||
} // namespace eicrecon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/factories/calorimetry/CalorimeterHitToTrackerHit_factory.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// SPDX-License-Identifier: LGPL-3.0-or-later | ||
// Copyright (C) 2023 Wouter Deconinck | ||
|
||
#pragma once | ||
|
||
#include "algorithms/calorimetry/CalorimeterHitToTrackerHit.h" | ||
#include "services/algorithms_init/AlgorithmsInit_service.h" | ||
#include "extensions/jana/JOmniFactory.h" | ||
|
||
|
||
namespace eicrecon { | ||
|
||
class CalorimeterHitToTrackerHit_factory : public JOmniFactory<CalorimeterHitToTrackerHit_factory> { | ||
|
||
private: | ||
public: | ||
using AlgoT = eicrecon::CalorimeterHitToTrackerHit; | ||
private: | ||
std::unique_ptr<AlgoT> m_algo; | ||
|
||
PodioInput<edm4eic::CalorimeterHit> m_calorimeter_hits_input {this}; | ||
PodioOutput<edm4eic::TrackerHit> m_tracker_hits_output {this}; | ||
|
||
Service<AlgorithmsInit_service> m_algorithmsInit {this}; | ||
|
||
public: | ||
void Configure() { | ||
m_algo = std::make_unique<AlgoT>(GetPrefix()); | ||
m_algo->level(static_cast<algorithms::LogLevel>(logger()->level())); | ||
m_algo->init(); | ||
} | ||
|
||
void ChangeRun(int64_t run_number) { | ||
} | ||
|
||
void Process(int64_t run_number, uint64_t event_number) { | ||
m_algo->process({m_calorimeter_hits_input()}, {m_tracker_hits_output().get()}); | ||
} | ||
}; | ||
|
||
} // eicrecon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters