#ifndef StripTrackerConstruction_h #define StripTrackerConstruction_h 1 #include "globals.hh" #include "G4VUserDetectorConstruction.hh" #include "G4ThreeVector.hh" #include "G4SystemOfUnits.hh" #include class G4LogicalVolume; class G4VPhysicalVolume; class G4Material; class StripTrackerMessenger; #include "G4RotationMatrix.hh" #include "G4SubtractionSolid.hh" //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... class StripTrackerConstruction { public: //Constructor StripTrackerConstruction(); //Destructor ~StripTrackerConstruction(); public: //Construct geometry of the setup //G4VPhysicalVolume* Construct(); void CalculateSensorPositions(G4ThreeVector zeroPoint = G4ThreeVector(0,0,0*mm)); void WriteSensorPositions(std::string tree_name="TrackerGeometry"); void ConstructStripTracker(G4bool b){ constructST = b;}; bool ConstructStripTracker(){ return constructST;}; void ConstructVolumes(G4LogicalVolume* lv); void ConstructStiffener(G4String PVname, G4RotationMatrix* rm, G4ThreeVector pos, G4int CopyNum); void ConstructCase(G4String PVname, G4ThreeVector pos); void ConstructSDandField(); //Update geometry void UpdateGeometry(); //some simple set & get functions G4ThreeVector Get_x1_SensorPosition() const { return pos_x1_Sensor; } G4ThreeVector Get_u1_SensorPosition() const { return pos_u1_Sensor; } G4ThreeVector Get_v1_SensorPosition() const { return pos_v1_Sensor; } G4ThreeVector Get_x2_SensorPosition() const { return pos_x2_Sensor; } G4ThreeVector Get_u2_SensorPosition() const { return pos_u2_Sensor; } G4ThreeVector Get_v2_SensorPosition() const { return pos_v2_Sensor; } // G4ThreeVector Get_TruthPlane_I_Position() const { return pos_TruthPlane_I; } // G4ThreeVector Get_TruthPlane_O_Position() const { return pos_TruthPlane_O; } G4ThreeVector Get_x3_SensorPosition() const { return pos_x3_Sensor; } G4ThreeVector Get_u3_SensorPosition() const { return pos_u3_Sensor; } G4ThreeVector Get_v3_SensorPosition() const { return pos_v3_Sensor; } G4ThreeVector Get_x4_SensorPosition() const { return pos_x4_Sensor; } G4ThreeVector Get_u4_SensorPosition() const { return pos_u4_Sensor; } G4ThreeVector Get_v4_SensorPosition() const { return pos_v4_Sensor; } G4ThreeVector Set_x1_SensorPosition(const G4ThreeVector & pos) { return pos_x1_Sensor=pos; } G4ThreeVector Set_u1_SensorPosition(const G4ThreeVector & pos) { return pos_u1_Sensor=pos; } G4ThreeVector Set_v1_SensorPosition(const G4ThreeVector & pos) { return pos_v1_Sensor=pos; } G4ThreeVector Set_x2_SensorPosition(const G4ThreeVector & pos) { return pos_x2_Sensor=pos; } G4ThreeVector Set_u2_SensorPosition(const G4ThreeVector & pos) { return pos_u2_Sensor=pos; } G4ThreeVector Set_v2_SensorPosition(const G4ThreeVector & pos) { return pos_v2_Sensor=pos; } // G4ThreeVector Set_TruthPlane_I_Position(const G4ThreeVector & pos) { return pos_TruthPlane_I=pos; } // G4ThreeVector Set_TruthPlane_O_Position(const G4ThreeVector & pos) { return pos_TruthPlane_O=pos; } G4ThreeVector Set_x3_SensorPosition(const G4ThreeVector & pos) { return pos_x3_Sensor=pos; } G4ThreeVector Set_u3_SensorPosition(const G4ThreeVector & pos) { return pos_u3_Sensor=pos; } G4ThreeVector Set_v3_SensorPosition(const G4ThreeVector & pos) { return pos_v3_Sensor=pos; } G4ThreeVector Set_x4_SensorPosition(const G4ThreeVector & pos) { return pos_x4_Sensor=pos; } G4ThreeVector Set_u4_SensorPosition(const G4ThreeVector & pos) { return pos_u4_Sensor=pos; } G4ThreeVector Set_v4_SensorPosition(const G4ThreeVector & pos) { return pos_v4_Sensor=pos; } G4bool Set_x1_SensorDUTSetup( const G4bool& flag ) { return is_x1_PlaneDUT=flag; } G4bool Set_u1_SensorDUTSetup( const G4bool& flag ) { return is_u1_PlaneDUT=flag; } G4bool Set_v1_SensorDUTSetup( const G4bool& flag ) { return is_v1_PlaneDUT=flag; } G4bool Set_x2_SensorDUTSetup( const G4bool& flag ) { return is_x2_PlaneDUT=flag; } G4bool Set_u2_SensorDUTSetup( const G4bool& flag ) { return is_u2_PlaneDUT=flag; } G4bool Set_v2_SensorDUTSetup( const G4bool& flag ) { return is_v2_PlaneDUT=flag; } // G4bool Set_TruthPlane_I_DUTSetup( const G4bool& flag ) { return is_TruthPlane_I_DUT=flag; } // G4bool Set_TruthPlane_O_DUTSetup( const G4bool& flag ) { return is_TruthPlane_O_DUT=flag; } G4bool Set_x3_SensorDUTSetup( const G4bool& flag ) { return is_x3_PlaneDUT=flag; } G4bool Set_u3_SensorDUTSetup( const G4bool& flag ) { return is_u3_PlaneDUT=flag; } G4bool Set_v3_SensorDUTSetup( const G4bool& flag ) { return is_v3_PlaneDUT=flag; } G4bool Set_x4_SensorDUTSetup( const G4bool& flag ) { return is_x4_PlaneDUT=flag; } G4bool Set_u4_SensorDUTSetup( const G4bool& flag ) { return is_u4_PlaneDUT=flag; } G4bool Set_v4_SensorDUTSetup( const G4bool& flag ) { return is_v4_PlaneDUT=flag; } G4double Get_x1_SensorAngle() const { return x1_SensorTheta; } G4double Get_u1_SensorAngle() const { return u1_SensorTheta; } G4double Get_v1_SensorAngle() const { return v1_SensorTheta; } G4double Get_x2_SensorAngle() const { return x2_SensorTheta; } G4double Get_u2_SensorAngle() const { return u2_SensorTheta; } G4double Get_v2_SensorAngle() const { return v2_SensorTheta; } // G4double Get_TruthPlane_I_Angle() const { return TruthPlane_I_Theta; } // G4double Get_TruthPlane_O_Angle() const { return TruthPlane_O_Theta; } G4double Get_x3_SensorAngle() const { return x3_SensorTheta; } G4double Get_u3_SensorAngle() const { return u3_SensorTheta; } G4double Get_v3_SensorAngle() const { return v3_SensorTheta; } G4double Get_x4_SensorAngle() const { return x4_SensorTheta; } G4double Get_u4_SensorAngle() const { return u4_SensorTheta; } G4double Get_v4_SensorAngle() const { return v4_SensorTheta; } G4ThreeVector Get_PhantomPosition() const { return pos_phantom; } G4ThreeVector Set_PhantomPosition(const G4ThreeVector & pos) { return pos_phantom=pos; } G4double Get_PhantomAngle() const { return phantomTheta; } G4double Set_PhantomAngle(const G4double theta) { return phantomTheta=theta; } G4double Set_inter_plane_dist(const G4double dist) {return inter_plane_dist=dist;} G4double Set_inter_module_dist(const G4double dist) {return inter_module_dist=dist;} G4double Set_phantom_gap(const G4double dist) {return phantom_gap=dist;} G4double Set_strip_length(const G4double length){return sensorStripLength=length;} G4double Set_strip_pitch(const G4double pitch){return teleStripPitch=pitch;} G4int Set_nb_of_strips(const G4int strips){return noOfSensorStrips=strips;} //G4int Set_nb_of_planes(const G4int){return noOfSensorPlanes=;} //Not used yet G4double Set_x1_SensorAngle(const G4double theta) { return x1_SensorTheta=theta; } G4double Set_u1_SensorAngle(const G4double theta) { return u1_SensorTheta=theta; } G4double Set_v1_SensorAngle(const G4double theta) { return v1_SensorTheta=theta; } G4double Set_x2_SensorAngle(const G4double theta) { return x2_SensorTheta=theta; } G4double Set_u2_SensorAngle(const G4double theta) { return u2_SensorTheta=theta; } G4double Set_v2_SensorAngle(const G4double theta) { return v2_SensorTheta=theta; } // G4double Set_TruthPlane_I_Angle(const G4double theta) { return TruthPlane_I_Theta=theta; } // G4double Set_TruthPlane_O_Angle(const G4double theta) { return TruthPlane_O_Theta=theta; } G4double Set_x3_SensorAngle(const G4double theta) { return x3_SensorTheta=theta; } G4double Set_u3_SensorAngle(const G4double theta) { return u3_SensorTheta=theta; } G4double Set_v3_SensorAngle(const G4double theta) { return v3_SensorTheta=theta; } G4double Set_x4_SensorAngle(const G4double theta) { return x4_SensorTheta=theta; } G4double Set_u4_SensorAngle(const G4double theta) { return u4_SensorTheta=theta; } G4double Set_v4_SensorAngle(const G4double theta) { return v4_SensorTheta=theta; } float Get_strip_length(){return sensorStripLength;} int Get_nb_of_strips(){return noOfSensorStrips;} int Get_nb_of_planes(){return noOfSensorPlanes;} /* G4Material Set_world_material(G4Material mat) { return world_material=mat; } G4Material Set_det_material(G4Material mat) { return det_material=mat; } G4Material Set_phantom_material(G4Material mat) { return phantom_material=mat; } G4Material Set_calorimeter_material(G4Material mat) { return calorimeter_material=mat; } G4Material Get_world_material() { return world_material; } G4Material Get_det_material() { return det_material; } G4Material Get_phantom_material() { return phantom_material; } G4Material Get_calorimeter_material() { return calorimeter_material; } */ private: //define needed materials void DefineMaterials(); //initialize geometry parameters void ComputeParameters(); private: G4bool constructST; //Materials G4Material* air; G4Material* silicon; G4Material* vacuum; G4Material* perspex; G4Material* water; G4Material* al; G4Material* brass; /*G4Material* world_material; G4Material* det_material; G4Material* phantom_material; G4Material* calorimeter_material;*/ //Geometry //global mother volume G4LogicalVolume * logicWorld; //1st x plane G4VPhysicalVolume* physi_x1_Sensor; //1st u plane G4VPhysicalVolume* physi_u1_Sensor; //1st v plane G4VPhysicalVolume* physi_v1_Sensor; //2nd x plane G4VPhysicalVolume* physi_x2_Sensor; //2nd u plane G4VPhysicalVolume* physi_u2_Sensor; //2nd v plane G4VPhysicalVolume* physi_v2_Sensor; //Truth planes G4VPhysicalVolume* physi_TP1; G4VPhysicalVolume* physi_TP2; G4VPhysicalVolume* physi_TP3; G4VPhysicalVolume* physi_TP4; //3rd x plane G4VPhysicalVolume* physi_x3_Sensor; //3rd u plane G4VPhysicalVolume* physi_u3_Sensor; //3rd v plane G4VPhysicalVolume* physi_v3_Sensor; //4th x plane G4VPhysicalVolume* physi_x4_Sensor; //4th u plane G4VPhysicalVolume* physi_u4_Sensor; //4th v plane G4VPhysicalVolume* physi_v4_Sensor; G4VPhysicalVolume * physi_x1_SensorStrip; G4VPhysicalVolume * physi_u1_SensorStrip; G4VPhysicalVolume * physi_v1_SensorStrip; G4VPhysicalVolume * physi_x2_SensorStrip; G4VPhysicalVolume * physi_u2_SensorStrip; G4VPhysicalVolume * physi_v2_SensorStrip; G4VPhysicalVolume * physi_TP1_Strip; G4VPhysicalVolume * physi_TP2_Strip; G4VPhysicalVolume * physi_TP3_Strip; G4VPhysicalVolume * physi_TP4_Strip; G4VPhysicalVolume * physi_x3_SensorStrip; G4VPhysicalVolume * physi_u3_SensorStrip; G4VPhysicalVolume * physi_v3_SensorStrip; G4VPhysicalVolume * physi_x4_SensorStrip; G4VPhysicalVolume * physi_u4_SensorStrip; G4VPhysicalVolume * physi_v4_SensorStrip; G4VPhysicalVolume* physi_calorimeter; G4VPhysicalVolume* physi_phantom; G4SubtractionSolid* stiff;//new G4SubtractionSolid(); //Parameters G4double halfWorldLengthXY; G4double halfWorldLengthZ; G4int noOfSensorStrips; G4int noOfSensorPlanes; G4double sensorStripLength; G4double sensorThickness; G4double teleStripPitch; G4ThreeVector pos_x1_Sensor; G4ThreeVector pos_u1_Sensor; G4ThreeVector pos_v1_Sensor; G4ThreeVector pos_x2_Sensor; G4ThreeVector pos_u2_Sensor; G4ThreeVector pos_v2_Sensor; G4ThreeVector pos_TP1; G4ThreeVector pos_TP2; G4ThreeVector pos_TP3; G4ThreeVector pos_TP4; G4ThreeVector pos_x3_Sensor; G4ThreeVector pos_u3_Sensor; G4ThreeVector pos_v3_Sensor; G4ThreeVector pos_x4_Sensor; G4ThreeVector pos_u4_Sensor; G4ThreeVector pos_v4_Sensor; G4ThreeVector pos_calorimeter; G4ThreeVector pos_phantom; G4double phantomTheta; G4double x1_SensorTheta; G4double u1_SensorTheta; G4double v1_SensorTheta; G4double x2_SensorTheta; G4double u2_SensorTheta; G4double v2_SensorTheta; G4double TP1_Theta; G4double TP2_Theta; G4double TP3_Theta; G4double TP4_Theta; G4double x3_SensorTheta; G4double u3_SensorTheta; G4double v3_SensorTheta; G4double x4_SensorTheta; G4double u4_SensorTheta; G4double v4_SensorTheta; G4bool is_x1_PlaneDUT; G4bool is_u1_PlaneDUT; G4bool is_v1_PlaneDUT; G4bool is_x2_PlaneDUT; G4bool is_u2_PlaneDUT; G4bool is_v2_PlaneDUT; G4bool is_TP1_DUT; G4bool is_TP2_DUT; G4bool is_TP3_DUT; G4bool is_TP4_DUT; G4bool is_x3_PlaneDUT; G4bool is_u3_PlaneDUT; G4bool is_v3_PlaneDUT; G4bool is_x4_PlaneDUT; G4bool is_u4_PlaneDUT; G4bool is_v4_PlaneDUT; G4double inter_plane_dist; G4double inter_module_dist; G4double phantom_gap; G4double halfPhantomSizeZ; G4ThreeVector phantom_pos; //UI Messenger StripTrackerMessenger * messenger; }; //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... #endif