src/modules/LCIOWriter/LCIOWriterModule.hpp

Definition of [LCIOWriter] module. More…

Namespaces

Name
allpix
Helper class to hold support layers for a detector model.

Classes

Name
class allpix::LCIOWriterModule
Module to write hit data to LCIO file.

Detailed Description

Definition of [LCIOWriter] module.

Copyright: Copyright (c) 2017-2024 CERN and the Allpix Squared authors. This software is distributed under the terms of the MIT License, copied verbatim in the file “LICENSE.md”. In applying this license, CERN does not waive the privileges and immunities granted to it by virtue of its status as an Intergovernmental Organization or submit itself to any jurisdiction. SPDX-License-Identifier: MIT

Source code


#include <string>
#include <vector>

#include "core/config/Configuration.hpp"
#include "core/geometry/GeometryManager.hpp"
#include "core/messenger/Messenger.hpp"
#include "core/module/Event.hpp"
#include "core/module/Module.hpp"

#include "objects/PixelHit.hpp"

#include <IO/LCWriter.h>

namespace allpix {

    class LCIOWriterModule : public SequentialModule {
    public:
        LCIOWriterModule(Configuration& config, Messenger* messenger, GeometryManager* geo_manager);

        void initialize() override;

        void run(Event* event) override;

        void finalize() override;

    private:
        Messenger* messenger_;
        GeometryManager* geo_mgr_{};
        std::shared_ptr<IO::LCWriter> lcWriter_{};

        std::vector<std::string> collection_names_vector_;
        std::map<unsigned, size_t> detector_ids_to_colllection_index_;
        std::map<std::string, unsigned> detector_names_to_id_;
        std::map<std::string, std::vector<std::string>> collections_to_detectors_map_;

        int pixel_type_;

        bool dump_mc_truth_;
        std::string detector_name_;
        std::string lcio_file_name_;
        std::string geometry_file_name_;
        std::atomic<int> write_cnt_{0};
    };
} // namespace allpix

Updated on 2024-12-13 at 08:31:37 +0000