Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements general rotation order #610

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,276 changes: 1,138 additions & 1,138 deletions geometry/detector/ThinQuartz/DetectorArray/DetectorArray.gdml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion include/remollDetectorConstruction.hh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "G4GenericMessenger.hh"
#include "G4Types.hh"
#include "G4Version.hh"
#include "remollGDMLReadStructure.hh"

#include <vector>
#include <set>
Expand All @@ -25,7 +26,7 @@ class remollDetectorConstruction : public G4VUserDetectorConstruction
{
public:

remollDetectorConstruction(const G4String& name, const G4String& gdmlfile);
remollDetectorConstruction(const G4String& name, const G4String& gdmlfile, remollGDMLReadStructure* rs=nullptr);
virtual ~remollDetectorConstruction();

private:
Expand Down
25 changes: 25 additions & 0 deletions include/remollGDMLReadStructure.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// -*- coding: utf-8 -*-
// vim: ai ts=2 sts=2 et sw=2 ft=cpp
// author : Prakash
// date : 2024-02-18

#pragma once

#include <map>
#include <string>

#include "G4GDMLReadStructure.hh"

class remollGDMLReadStructure : public G4GDMLReadStructure {
public:
remollGDMLReadStructure();

void RotationRead(const xercesc::DOMElement* const vectorElement, G4RotationMatrix& rot);
G4LogicalVolume* FileRead(const xercesc::DOMElement* const fileElement);
void PhysvolRead( const xercesc::DOMElement* const physvolElement, G4AssemblyVolume* pAssembly=0);
void ParametersRead(const xercesc::DOMElement* const element);
void Volume_contentRead( const xercesc::DOMElement* const volumeElement) override;

private:
std::map<std::string,std::vector<std::function<void(G4RotationMatrix&,G4ThreeVector)>>> rotations;
};
4 changes: 3 additions & 1 deletion remoll.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ typedef G4RunManager RunManager;
#include "remollActionInitialization.hh"
#include "remollDetectorConstruction.hh"
#include "remollParallelConstruction.hh"
#include "remollGDMLReadStructure.hh"

#include "remollSearchPath.hh"

Expand Down Expand Up @@ -155,8 +156,9 @@ int main(int argc, char** argv) {
remollIO::GetInstance();

// Detector geometry
remollGDMLReadStructure* rs = new remollGDMLReadStructure();
G4String material_name = "material";
remollDetectorConstruction* detector = new remollDetectorConstruction(material_name, geometry_gdmlfile);
remollDetectorConstruction* detector = new remollDetectorConstruction(material_name, geometry_gdmlfile,rs);
// Parallel world geometry
G4String parallel_name = "parallel"; // Note: name must correspond with name of G4ParallelWorldPhysics
remollParallelConstruction* parallel = new remollParallelConstruction(parallel_name, parallel_gdmlfile);
Expand Down
4 changes: 3 additions & 1 deletion src/remollDetectorConstruction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

// GDML export
#include "G4GDMLParser.hh"
#include "remollGDMLReadStructure.hh"

//CADMesh
#ifdef __USE_CADMESH
Expand All @@ -53,8 +54,9 @@ G4ThreadLocal remollGlobalField* remollDetectorConstruction::fGlobalField = 0;

G4UserLimits* remollDetectorConstruction::fKryptoniteUserLimits = new G4UserLimits(0,0,0,DBL_MAX,DBL_MAX);

remollDetectorConstruction::remollDetectorConstruction(const G4String& name, const G4String& gdmlfile)
remollDetectorConstruction::remollDetectorConstruction(const G4String& name, const G4String& gdmlfile, remollGDMLReadStructure* read)
: fVerboseLevel(0),
fGDMLParser(read),
fGDMLValidate(false),
fGDMLOverlapCheck(true),
fGDMLPath(""),
Expand Down
Loading
Loading