Strasse.hh 6.05 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
#ifndef Strasse_h
#define Strasse_h 1
/*****************************************************************************
 * Copyright (C) 2009-2020   this file is part of the NPTool Project         *
 *                                                                           *
 * For the licensing terms see $NPTOOL/Licence/NPTool_Licence                *
 * For the list of contributors see $NPTOOL/Licence/Contributors             *
 *****************************************************************************/

/*****************************************************************************
11
 * Original Author: A. Matta  contact address: matta@lpccaen.in2p3.fr        *
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
 *                                                                           *
 * Creation Date  : July 2020                                                *
 * Last update    :                                                          *
 *---------------------------------------------------------------------------*
 * Decription:                                                               *
 *  This class describe  Strasse simulation                                  *
 *                                                                           *
 *---------------------------------------------------------------------------*
 * Comment:                                                                  *
 *                                                                           *
 *****************************************************************************/

// C++ header
#include <string>
#include <vector>
using namespace std;

// G4 headers
#include "G4ThreeVector.hh"
#include "G4RotationMatrix.hh"
#include "G4LogicalVolume.hh"
#include "G4MultiFunctionalDetector.hh"

// NPTool header
#include "NPSVDetector.hh"
#include "TStrasseData.h"
#include "NPInputParser.h"

class Strasse : public NPS::VDetector{
  ////////////////////////////////////////////////////
  /////// Default Constructor and Destructor /////////
  ////////////////////////////////////////////////////
  public:
    Strasse() ;
    virtual ~Strasse() ;

    ////////////////////////////////////////////////////
    /////// Specific Function of this Class ///////////
    ////////////////////////////////////////////////////
  public:
Adrien Matta's avatar
Adrien Matta committed
52
    // Cylindrical coordinate
53 54
    void AddInnerDetector(double R,double Z,double Phi, double Shift, G4ThreeVector Ref);  
    void AddOuterDetector(double R,double Z,double Phi, double Shift, G4ThreeVector Ref);  
Adrien Matta's avatar
Adrien Matta committed
55
    void AddChamber(double Z);
56

Adrien Matta's avatar
Adrien Matta committed
57
    G4LogicalVolume* BuildInnerDetector();
Adrien Matta's avatar
Adrien Matta committed
58
    G4LogicalVolume* BuildOuterDetector();
Adrien Matta's avatar
Adrien Matta committed
59 60
    G4LogicalVolume* BuildElectronic();
    G4LogicalVolume* BuildChamber();
61 62 63 64
    G4LogicalVolume* BuildChamberFromCAD(string path);
    G4LogicalVolume* BuildStars(string path);
    G4LogicalVolume* BuildBlades(string path);
    G4LogicalVolume* BuildBase(string path);
65 66

  private:
Adrien Matta's avatar
Adrien Matta committed
67
    G4LogicalVolume* m_InnerDetector;
Adrien Matta's avatar
Adrien Matta committed
68
    G4LogicalVolume* m_OuterDetector;
Adrien Matta's avatar
Adrien Matta committed
69
    G4LogicalVolume* m_Electronic;
70
    G4LogicalVolume* m_Stars;
Adrien Matta's avatar
Adrien Matta committed
71
    G4LogicalVolume* m_Chamber;
72 73 74 75 76 77 78 79 80 81 82
    G4LogicalVolume* m_Blades;
    G4LogicalVolume* m_Base;

    string ChamberPath;
    string BasePath;
    string StarsPath;
    string BladesPath;
    bool found_chamber;
    bool found_blades;
    bool found_stars;
    bool found_base;
Adrien Matta's avatar
Adrien Matta committed
83 84 85 86 87 88 89 90 91 92 93

  private:
    //    Initialize material used in detector definition
    void InitializeMaterial();


    //   List of material
    G4Material* m_MaterialSilicon ;
    G4Material* m_MaterialAl      ;
    G4Material* m_MaterialVacuum  ;
    G4Material* m_MaterialPCB     ;
94
    G4Material* m_MaterialCu     ;
Adrien Matta's avatar
Adrien Matta committed
95

96 97 98 99 100
    // calculated dimension
    double m_Active_InnerWafer_Width;
    double m_Active_InnerWafer_Length; 
    double m_Active_OuterWafer_Width;
    double m_Active_OuterWafer_Length; 
Adrien Matta's avatar
Adrien Matta committed
101 102


103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
    ////////////////////////////////////////////////////
    //////  Inherite from NPS::VDetector class /////////
    ////////////////////////////////////////////////////
  public:
    // Read stream at Configfile to pick-up parameters of detector (Position,...)
    // Called in DetecorConstruction::ReadDetextorConfiguration Method
    void ReadConfiguration(NPL::InputParser) ;

    // Construct detector and inialise sensitive part.
    // Called After DetecorConstruction::AddDetector Method
    void ConstructDetector(G4LogicalVolume* world) ;

    // Add Detector branch to the EventTree.
    // Called After DetecorConstruction::AddDetector Method
    void InitializeRootOutput() ;

    // Read sensitive part and fill the Root tree.
    // Called at in the EventAction::EndOfEventAvtion
    void ReadSensitive(const G4Event* event) ;

  public:   // Scorer
    //   Initialize all Scorer used by the MUST2Array
    void InitializeScorers() ;

    //   Associated Scorer
128 129 130 131 132
    G4MultiFunctionalDetector* m_InnerScorer1 ;
    G4MultiFunctionalDetector* m_OuterScorer1 ;
    G4MultiFunctionalDetector* m_InnerScorer2 ;
    G4MultiFunctionalDetector* m_OuterScorer2 ;

133 134 135 136 137 138 139 140 141 142 143
    ////////////////////////////////////////////////////
    ///////////Event class to store Data////////////////
    ////////////////////////////////////////////////////
  private:
    TStrasseData* m_Event ;

    ////////////////////////////////////////////////////
    ///////////////Private intern Data//////////////////
    ////////////////////////////////////////////////////
  private: // Geometry
    // Detector Coordinate 
Adrien Matta's avatar
Adrien Matta committed
144 145 146
    vector<double>  m_Inner_R; 
    vector<double>  m_Inner_Z;
    vector<double>  m_Inner_Phi; 
Adrien Matta's avatar
Adrien Matta committed
147
    vector<double>  m_Inner_Shift; 
148
    vector<G4ThreeVector> m_Inner_Ref;
Adrien Matta's avatar
Adrien Matta committed
149

Adrien Matta's avatar
Adrien Matta committed
150 151 152
    vector<double>  m_Outer_R; 
    vector<double>  m_Outer_Z;
    vector<double>  m_Outer_Phi; 
Adrien Matta's avatar
Adrien Matta committed
153
    vector<double>  m_Outer_Shift; 
154
    vector<G4ThreeVector> m_Outer_Ref;
Adrien Matta's avatar
Adrien Matta committed
155

Adrien Matta's avatar
Adrien Matta committed
156
    vector<double>  m_Chamber_Z;
Adrien Matta's avatar
Adrien Matta committed
157

158

Adrien Matta's avatar
Adrien Matta committed
159
    // Needed for dynamic loading of the library
160 161
  public:
    static NPS::VDetector* Construct();
Adrien Matta's avatar
Adrien Matta committed
162 163 164 165 166 167


  private: // Visualisation
    G4VisAttributes* SiliconVisAtt  ;
    G4VisAttributes* PCBVisAtt;
    G4VisAttributes* PADVisAtt  ;
168
    G4VisAttributes* StarsVisAtt ;
Adrien Matta's avatar
Adrien Matta committed
169
    G4VisAttributes* ChamberVisAtt ;
Adrien Matta's avatar
Adrien Matta committed
170
    G4VisAttributes* GuardRingVisAtt ;
171
    G4VisAttributes* BladeVisAtt ;
Adrien Matta's avatar
Adrien Matta committed
172 173


174 175
};
#endif