Commit c765912e authored by Simon Spannagel's avatar Simon Spannagel
Browse files

DepositionGeant4: remove hit_transform matrix, not necessary anymore

parent 31725d79
Loading
Loading
Loading
Loading
+1 −15
Original line number Diff line number Diff line
@@ -396,12 +396,9 @@ void DepositionGeant4Module::construct_sensitive_detectors_and_fields(double fan
        }
        useful_deposition = true;

        // Get the hit transformation matrix
        auto* hit_transform = calculate_hit_transform(detector->getModel());

        // Get model of the sensitive device
        auto* sensitive_detector_action = new SensitiveDetectorActionG4(
            detector, track_info_manager_.get(), hit_transform, charge_creation_energy, fano_factor, cutoff_time);
            detector, track_info_manager_.get(), charge_creation_energy, fano_factor, cutoff_time);
        auto logical_volume = geo_manager_->getExternalObject<G4LogicalVolume>(detector->getName(), "sensor_log");
        if(logical_volume == nullptr) {
            throw ModuleError("Detector " + detector->getName() + " has no sensitive device (broken Geant4 geometry)");
@@ -452,14 +449,3 @@ void DepositionGeant4Module::record_module_statistics() {
        total_charges_ += sensor->getTotalDepositedCharge();
    }
}

G4RotationMatrix* DepositionGeant4Module::calculate_hit_transform(const std::shared_ptr<DetectorModel>& model) {
    // For radial_strip models a rotation around X-axis is necessary to align G4 and APSQ coordinate systems
    if(std::dynamic_pointer_cast<RadialStripDetectorModel>(model) != nullptr) {
        auto* radialRot = new G4RotationMatrix();
        radialRot->rotateX(-90.0 * CLHEP::degree);
        return radialRot;
    }

    return new G4RotationMatrix();
}
+0 −10
Original line number Diff line number Diff line
@@ -105,16 +105,6 @@ namespace allpix {
         */
        void record_module_statistics();

        /**
         * @brief Calculate hit transformation matrix for a given detector model
         * @param model Detector model
         * @returns Hit transformation matrix pointer
         *
         * @note This matrix transforms the Geant4 local coordinate system of the sensor
         * volume to the APSQ local coordinate system based on the detector model type.
         */
        G4RotationMatrix* calculate_hit_transform(const std::shared_ptr<DetectorModel>& model);

        // Configuration parameters:
        bool output_plots_{};
        unsigned int number_of_particles_{};
+0 −3
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ using namespace allpix;

SensitiveDetectorActionG4::SensitiveDetectorActionG4(const std::shared_ptr<Detector>& detector,
                                                     TrackInfoManager* track_info_manager,
                                                     const G4RotationMatrix* hit_transform,
                                                     double charge_creation_energy,
                                                     double fano_factor,
                                                     double cutoff_time)
@@ -49,8 +48,6 @@ SensitiveDetectorActionG4::SensitiveDetectorActionG4(const std::shared_ptr<Detec
    // Add the sensor to the internal sensitive detector manager
    G4SDManager* sd_man_g4 = G4SDManager::GetSDMpointer();
    sd_man_g4->AddNewDetector(this);

    hit_transform_ = hit_transform;
}

G4bool SensitiveDetectorActionG4::ProcessHits(G4Step* step, G4TouchableHistory*) {
+0 −3
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@ namespace allpix {
         */
        SensitiveDetectorActionG4(const std::shared_ptr<Detector>& detector,
                                  TrackInfoManager* track_info_manager,
                                  const G4RotationMatrix* hit_transform,
                                  double charge_creation_energy,
                                  double fano_factor,
                                  double cutoff_time);
@@ -127,8 +126,6 @@ namespace allpix {
        std::vector<int> deposit_to_id_;
        // Map from track id to mc particle index
        std::map<int, size_t> id_to_particle_;

        const G4RotationMatrix* hit_transform_;
    };
} // namespace allpix