Strasse.hh 5.54 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
Adrien Matta's avatar
Adrien Matta committed
53 54
    void AddInnerDetector(double R,double Z,double Phi, double Shift);  
    void AddOuterDetector(double R,double Z,double Phi, double Shift);  
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 61
    G4LogicalVolume* BuildElectronic();
    G4LogicalVolume* BuildFrame();
    G4LogicalVolume* BuildChamber();
62 63

  private:
Adrien Matta's avatar
Adrien Matta committed
64
    G4LogicalVolume* m_InnerDetector;
Adrien Matta's avatar
Adrien Matta committed
65
    G4LogicalVolume* m_OuterDetector;
Adrien Matta's avatar
Adrien Matta committed
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
    G4LogicalVolume* m_Electronic;
    G4LogicalVolume* m_Frame;
    G4LogicalVolume* m_Chamber;


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


    //   List of material
    G4Material* m_MaterialSilicon ;
    G4Material* m_MaterialAl      ;
    G4Material* m_MaterialVacuum  ;
    G4Material* m_MaterialPCB     ;

82 83 84 85 86
    // 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
87 88


89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
    ////////////////////////////////////////////////////
    //////  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
114 115 116 117 118
    G4MultiFunctionalDetector* m_InnerScorer1 ;
    G4MultiFunctionalDetector* m_OuterScorer1 ;
    G4MultiFunctionalDetector* m_InnerScorer2 ;
    G4MultiFunctionalDetector* m_OuterScorer2 ;

119 120 121 122 123 124 125 126 127 128 129
    ////////////////////////////////////////////////////
    ///////////Event class to store Data////////////////
    ////////////////////////////////////////////////////
  private:
    TStrasseData* m_Event ;

    ////////////////////////////////////////////////////
    ///////////////Private intern Data//////////////////
    ////////////////////////////////////////////////////
  private: // Geometry
    // Detector Coordinate 
Adrien Matta's avatar
Adrien Matta committed
130 131 132
    vector<double>  m_Inner_R; 
    vector<double>  m_Inner_Z;
    vector<double>  m_Inner_Phi; 
Adrien Matta's avatar
Adrien Matta committed
133 134
    vector<double>  m_Inner_Shift; 

Adrien Matta's avatar
Adrien Matta committed
135 136 137
    vector<double>  m_Outer_R; 
    vector<double>  m_Outer_Z;
    vector<double>  m_Outer_Phi; 
Adrien Matta's avatar
Adrien Matta committed
138
    vector<double>  m_Outer_Shift; 
Adrien Matta's avatar
Adrien Matta committed
139

Adrien Matta's avatar
Adrien Matta committed
140
    vector<double>  m_Chamber_Z;
Adrien Matta's avatar
Adrien Matta committed
141

142 143 144
    // Visualisation Attribute
    //G4VisAttributes* m_VisTrap;

Adrien Matta's avatar
Adrien Matta committed
145
    // Needed for dynamic loading of the library
146 147
  public:
    static NPS::VDetector* Construct();
Adrien Matta's avatar
Adrien Matta committed
148 149 150 151 152 153 154


  private: // Visualisation
    G4VisAttributes* SiliconVisAtt  ;
    G4VisAttributes* PCBVisAtt;
    G4VisAttributes* PADVisAtt  ;
    G4VisAttributes* FrameVisAtt ;
Adrien Matta's avatar
Adrien Matta committed
155
    G4VisAttributes* ChamberVisAtt ;
Adrien Matta's avatar
Adrien Matta committed
156 157 158
    G4VisAttributes* GuardRingVisAtt ;


159 160
};
#endif