Strasse.hh 5.15 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 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
#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             *
 *****************************************************************************/

/*****************************************************************************
 * Original Author: F. Flavigny  contact address: flavigny@lpccaen.in2p3.fr  *
 *                                                                           *
 * 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 53
    // Cylindrical coordinate
    void AddInnerDetector(double R,double Z,double Phi);  
Adrien Matta's avatar
Adrien Matta committed
54
    void AddOuterDetector(double R,double Z,double Phi);  
55

Adrien Matta's avatar
Adrien Matta committed
56
    G4LogicalVolume* BuildInnerDetector();
Adrien Matta's avatar
Adrien Matta committed
57
    G4LogicalVolume* BuildOuterDetector();
Adrien Matta's avatar
Adrien Matta committed
58 59 60
    G4LogicalVolume* BuildElectronic();
    G4LogicalVolume* BuildFrame();
    G4LogicalVolume* BuildChamber();
61 62

  private:
Adrien Matta's avatar
Adrien Matta committed
63
    G4LogicalVolume* m_InnerDetector;
Adrien Matta's avatar
Adrien Matta committed
64
    G4LogicalVolume* m_OuterDetector;
Adrien Matta's avatar
Adrien Matta committed
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
    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     ;



83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
    ////////////////////////////////////////////////////
    //////  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
    G4MultiFunctionalDetector* m_InnerScorer ;
Adrien Matta's avatar
Adrien Matta committed
109
    G4MultiFunctionalDetector* m_OuterScorer ;
110 111 112 113 114 115 116 117 118 119 120
    ////////////////////////////////////////////////////
    ///////////Event class to store Data////////////////
    ////////////////////////////////////////////////////
  private:
    TStrasseData* m_Event ;

    ////////////////////////////////////////////////////
    ///////////////Private intern Data//////////////////
    ////////////////////////////////////////////////////
  private: // Geometry
    // Detector Coordinate 
Adrien Matta's avatar
Adrien Matta committed
121 122 123
    vector<double>  m_Inner_R; 
    vector<double>  m_Inner_Z;
    vector<double>  m_Inner_Phi; 
Adrien Matta's avatar
Adrien Matta committed
124 125 126 127
    vector<double>  m_Outer_R; 
    vector<double>  m_Outer_Z;
    vector<double>  m_Outer_Phi; 

Adrien Matta's avatar
Adrien Matta committed
128

129 130 131
    // Visualisation Attribute
    //G4VisAttributes* m_VisTrap;

Adrien Matta's avatar
Adrien Matta committed
132
    // Needed for dynamic loading of the library
133 134
  public:
    static NPS::VDetector* Construct();
Adrien Matta's avatar
Adrien Matta committed
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149


  private: // Visualisation
    // Dark Grey
    G4VisAttributes* SiliconVisAtt  ;
    // Green
    G4VisAttributes* PCBVisAtt;
    // Gold Yellow
    G4VisAttributes* PADVisAtt  ;
    // Light Grey
    G4VisAttributes* FrameVisAtt ;
    // Light Blue
    G4VisAttributes* GuardRingVisAtt ;


150 151
};
#endif