Skip to content
Snippets Groups Projects
Commit d05f22f2 authored by deserevi's avatar deserevi
Browse files

* Add support for the W1 detector in NPS

   + NPSimulation is working
   + Scorers are working

* Add input files
parent 8d90a07f
No related branches found
No related tags found
No related merge requests found
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%1
GeneralTarget
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%1
Target
THICKNESS= 0.3231
RADIUS= 7.5
MATERIAL= Al
X= 0
Y= 0
Z= 0
%%%%%%% Telescope 1 %%%%%%%
W1
THETA= 0
PHI= 0
R= 150
BETA= 0 0 0
VIS= all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%% Reaction file for 11Li(d,3He)10He reaction %%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%Beam energy given in MeV ; Excitation in MeV
TransfertToResonance
Beam= 1H
Target= 27Al
Light= 1H
Heavy= 27Al
ExcitationEnergy= 13.0
BeamEnergy= 18
BeamEnergySpread= 0
SigmaThetaX= 0
SigmaPhiY= 0
SigmaX= 0
SigmaY= 0
ResonanceWidth= 0
ResonanceDecayZ= 12
ResonanceDecayA= 26
CrossSectionPath= flat.txt
ShootLight= 1
ShootHeavy= 0
ShootDecayProduct= 1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
......@@ -4,10 +4,10 @@
% Energy are given in MeV , Position in mm %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Isotropic
EnergyLow= 0
EnergyLow= 5
EnergyHigh= 5
HalfOpenAngleMin= 158
HalfOpenAngleMax= 180
HalfOpenAngleMin= 0
HalfOpenAngleMax= 20
x0= 0
y0= 0
z0= 0
......
/*****************************************************************************
* Copyright (C) 2009-2010 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: N. de Sereville contact address: deserevi@ipno.in2p3.fr *
* *
* Creation Date : 12/01/11 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: Define the W1 detector from Micron *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
#ifndef W1_h
#define W1_h 1
// C++ headers
#include <vector>
// NPTool header
#include "VDetector.hh"
// NPTool - ROOT headers
#include "TW1Data.h"
using namespace std;
class W1 : public VDetector
{
////////////////////////////////////////////////////
/////// Default Constructor and Destructor /////////
////////////////////////////////////////////////////
public:
W1();
virtual ~W1();
////////////////////////////////////////////////////
//////// Specific Function of this Class ///////////
////////////////////////////////////////////////////
public:
// Detector positionning
// By Position Method
void AddDetector(G4ThreeVector TL, G4ThreeVector BL,
G4ThreeVector BR, G4ThreeVector CT);
// By Angle Method
void AddDetector(G4double R, G4double Theta, G4double Phi,
G4double beta_u, G4double beta_v, G4double beta_w);
// Effectively construct Volume
// Avoid to have two time same code for Angle and Point definition
void VolumeMaker(G4int DetecNumber,
G4ThreeVector pos,
G4RotationMatrix* rot,
G4LogicalVolume* world);
/////////////////////////////////////////
//// Inherite from VDetector class /////
/////////////////////////////////////////
public:
// Read stream at Configfile to pick-up parameters of detector (Position,...)
// Called in DetecorConstruction::ReadDetextorConfiguration Method
void ReadConfiguration(string Path);
// 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();
// Initialize all scorers necessary for the detector
void InitializeScorers();
// Read sensitive part and fill the Root tree.
// Called at in the EventAction::EndOfEventAvtion
void ReadSensitive(const G4Event* event);
////////////////////////////////////////////////////
///////////Event class to store Data////////////////
////////////////////////////////////////////////////
private:
TW1Data* m_Event;
////////////////////////////////////////////////////
//////////////////// Scorers ///////////////////////
////////////////////////////////////////////////////
private:
G4MultiFunctionalDetector* m_Scorer;
////////////////////////////////////////////////////
//////////////////// Material //////////////////////
////////////////////////////////////////////////////
private:
// Declare all material used by theW1 detector
void InitializeMaterials();
// Vacuum
G4Material* m_MaterialVacuum;
// Si
G4Material* m_MaterialSilicon;
// Al
G4Material* m_MaterialAluminium;
// Iron
G4Material* m_MaterialIron;
////////////////////////////////////////////////////
///////////////Private intern Data//////////////////
////////////////////////////////////////////////////
private:
// True if Define by Position, False is Define by angle
vector<bool> m_DefinitionType;
// Used for "By Point Definition"
vector<G4ThreeVector> m_X1_Y1; // Top Left Corner Position Vector
vector<G4ThreeVector> m_X1_Y16; // Bottom Left Corner Position Vector
vector<G4ThreeVector> m_X16_Y1; // Bottom Right Corner Position Vector
vector<G4ThreeVector> m_X16_Y16; // Center Corner Position Vector
// Used for "By Angle Definition"
vector<G4double> m_R; // |
vector<G4double> m_Theta; // > Spherical coordinate of Strips Silicium Plate
vector<G4double> m_Phi; // |
vector<G4double> m_beta_u; // |
vector<G4double> m_beta_v; // > Tilt angle of the Telescope
vector<G4double> m_beta_w; // |
// Set to true if you want to see Telescope Frame in your visualisation
bool m_non_sensitive_part_visiualisation;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
namespace W1SQUARE
{
// Energy/Time resolutions for the different layers
const G4double EnergyResolution = 0; // = 52keV of Resolution // Unit is MeV/2.35
// const G4double ResoFirstStage = 0.0106 ;// = 52keV of Resolution // Unit is MeV/2.35
const G4double TimeResolution = 0.638; // 1.5 ns (FWHM)
// Geometry
const G4double FaceFront = 50*mm;
const G4double Length = 1*mm;
// First stage
// const G4double AluStripThickness = 0.00000001*micrometer;
const G4double AluStripThickness = 0.4*micrometer;
const G4double SiliconThickness = 500*micrometer;
const G4double SiliconFace = 49.6*mm;
// Characteristics
const G4int NbStrips = 16;
// Starting at the front and going in direction of third stage
const G4double AluStripFront_PosZ = Length* -0.5 + 0.5*AluStripThickness;
const G4double Silicon_PosZ = AluStripFront_PosZ + 0.5*AluStripThickness + 0.5*SiliconThickness;
const G4double AluStripBack_PosZ = Silicon_PosZ + 0.5*SiliconThickness + 0.5*AluStripThickness;
}
#endif
/*****************************************************************************
* Copyright (C) 2009-2010 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: N. de Sereville contact address: deserevi@ipno.in2p3.fr *
* *
* Creation Date : 12/01/11 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: This class holds all the scorers needed by the W1 object *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
#ifndef W1Scorer_h
#define W1Scorer_h 1
#include "G4VPrimitiveScorer.hh"
#include "G4THitsMap.hh"
namespace W1SCORERS
{
class W1ScorerFrontStripNumber : public G4VPrimitiveScorer
{
public: // with description
W1ScorerFrontStripNumber(G4String name, G4int depth = 0, G4int NumberOfStrip = 16);
virtual ~W1ScorerFrontStripNumber();
protected: // with description
virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*);
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void Clear();
virtual void DrawAll();
virtual void PrintAll();
private:
G4int m_NumberOfStrip;
G4int HCID;
G4THitsMap<G4double>* EvtMap;
};
class W1ScorerBackStripNumber : public G4VPrimitiveScorer
{
public: // with description
W1ScorerBackStripNumber(G4String name, G4int depth = 0, G4int NumberOfStrip = 16);
virtual ~W1ScorerBackStripNumber();
protected: // with description
virtual G4bool ProcessHits(G4Step*, G4TouchableHistory*);
public:
virtual void Initialize(G4HCofThisEvent*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void Clear();
virtual void DrawAll();
virtual void PrintAll();
private:
G4int m_NumberOfStrip;
G4int HCID;
G4THitsMap<G4double>* EvtMap;
};
}
using namespace W1SCORERS;
#endif
......@@ -50,6 +50,7 @@
#include "Plastic.hh"
#include "Paris.hh"
#include "Shield.hh"
#include "W1.hh"
//Not G4
#include <cstdlib>
......@@ -167,8 +168,8 @@ void DetectorConstruction::ReadConfigurationFile(string Path)
bool cDummy = false;
bool cParis = false; // Paris Calorimeter
bool cShield = false; // Paris Shield CsI
bool cW1 = false; // W1 Micron DSSD
//////////////////////////////////////////////////////////////////////////////////////////
// added by Nicolas [07/05/09]
string GlobalPath = getenv("NPTOOL");
string StandardPath = GlobalPath + "/Inputs/DetectorConfiguration/" + Path;
ifstream ConfigFile;
......@@ -293,6 +294,25 @@ void DetectorConstruction::ReadConfigurationFile(string Path)
AddDetector(myDetector) ;
}
////////////////////////////////////////////
///// Search for S1 Annular detector //////
////////////////////////////////////////////
else if (LineBuffer.compare(0, 2, "W1") == 0 && cW1 == false) {
cW1 = true ;
G4cout << "//////// W1 Square detector ////////" << G4endl << G4endl;
// Instantiate the new array as a VDetector Object
VDetector* myDetector = new W1();
// Read Position of Telescope
ConfigFile.close();
myDetector->ReadConfiguration(Path);
ConfigFile.open(Path.c_str());
// Add array to the VDetector Vector
AddDetector(myDetector);
}
////////////////////////////////////////////
//////// Search for MUST2 Array ////////
////////////////////////////////////////////
......
This diff is collapsed.
/*****************************************************************************
* Copyright (C) 2009-2010 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: N. de Sereville contact address: deserevi@ipno.in2p3.fr *
* *
* Creation Date : 12/01/11 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: This class holds all the scorers needed by the W1 object *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
// G4 headers
#include "G4UnitsTable.hh"
// NPTool headers
#include "GeneralScorers.hh"
#include "W1Scorers.hh"
#include "W1.hh"
using namespace W1SQUARE;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// Added by Adrien MATTA:
// Those Scorer use TrackID as map index. This way ones can rebuild energy deposit,
// time of flight or position,... particle by particle for each event. Because standard
// scorer provide by G4 don't work this way but using a global ID for each event you should
// not use those scorer with some G4 provided ones or being very carefull doing so.
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// Front Strip position Scorer
W1ScorerFrontStripNumber::W1ScorerFrontStripNumber(G4String name, G4int depth, G4int NumberOfStrip)
: G4VPrimitiveScorer(name, depth), HCID(-1)
{
m_NumberOfStrip = NumberOfStrip ;
}
W1ScorerFrontStripNumber::~W1ScorerFrontStripNumber()
{
}
G4bool W1ScorerFrontStripNumber::ProcessHits(G4Step* aStep, G4TouchableHistory*)
{
// get detector number
int DetNbr = GENERALSCORERS::PickUpDetectorNumber(aStep, "W1Square");
// get front strip number
G4ThreeVector POS = aStep->GetPreStepPoint()->GetPosition();
// G4cout << "POS world: " << POS << G4endl;
POS = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(POS);
// G4cout << "POS local: " << POS << G4endl;
G4double StripPitch = W1SQUARE::SiliconFace / m_NumberOfStrip;
G4double temp = (POS(0) + W1SQUARE::SiliconFace / 2.) / StripPitch;
G4double X = int(temp) + 1 ;
// G4cout << "strip X: " << X << G4endl;
//Rare case where particle is close to edge of silicon plan
if (X == m_NumberOfStrip+1) X = m_NumberOfStrip;
G4double edep = aStep->GetTotalEnergyDeposit();
if (edep < 100*keV) return FALSE;
G4int index = aStep->GetTrack()->GetTrackID();
EvtMap->set(DetNbr + index, X);
return TRUE;
}
void W1ScorerFrontStripNumber::Initialize(G4HCofThisEvent* HCE)
{
EvtMap = new G4THitsMap<G4double>(GetMultiFunctionalDetector()->GetName(), GetName());
if (HCID < 0) {
HCID = GetCollectionID(0);
}
HCE->AddHitsCollection(HCID, (G4VHitsCollection*)EvtMap);
}
void W1ScorerFrontStripNumber::EndOfEvent(G4HCofThisEvent*)
{
}
void W1ScorerFrontStripNumber::Clear()
{
EvtMap->clear();
}
void W1ScorerFrontStripNumber::DrawAll()
{
}
void W1ScorerFrontStripNumber::PrintAll()
{
G4cout << " MultiFunctionalDet " << detector->GetName() << G4endl ;
G4cout << " PrimitiveScorer " << GetName() << G4endl ;
G4cout << " Number of entries " << EvtMap->entries() << G4endl ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// Back Strip position Scorer
W1ScorerBackStripNumber::W1ScorerBackStripNumber(G4String name, G4int depth, G4int NumberOfStrip)
: G4VPrimitiveScorer(name, depth), HCID(-1)
{
m_NumberOfStrip = NumberOfStrip ;
}
W1ScorerBackStripNumber::~W1ScorerBackStripNumber()
{
}
G4bool W1ScorerBackStripNumber::ProcessHits(G4Step* aStep, G4TouchableHistory*)
{
// get detector number
int DetNbr = GENERALSCORERS::PickUpDetectorNumber(aStep, "W1Square");
// get back strip number
G4ThreeVector POS = aStep->GetPreStepPoint()->GetPosition();
POS = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(POS);
G4double StripPitch = W1SQUARE::SiliconFace / m_NumberOfStrip;
G4double temp = (POS(1) + W1SQUARE::SiliconFace / 2.) / StripPitch ;
G4double X = int(temp) + 1 ;
// G4cout << "strip Y: " << X << G4endl;
//Rare case where particle is close to edge of silicon plan
if (X == m_NumberOfStrip+1) X = m_NumberOfStrip;
G4double edep = aStep->GetTotalEnergyDeposit();
if (edep < 100*keV) return FALSE;
G4int index = aStep->GetTrack()->GetTrackID();
EvtMap->set(DetNbr + index, X);
return TRUE;
}
void W1ScorerBackStripNumber::Initialize(G4HCofThisEvent* HCE)
{
EvtMap = new G4THitsMap<G4double>(GetMultiFunctionalDetector()->GetName(), GetName());
if (HCID < 0) {
HCID = GetCollectionID(0);
}
HCE->AddHitsCollection(HCID, (G4VHitsCollection*)EvtMap);
}
void W1ScorerBackStripNumber::EndOfEvent(G4HCofThisEvent*)
{
}
void W1ScorerBackStripNumber::Clear()
{
EvtMap->clear();
}
void W1ScorerBackStripNumber::DrawAll()
{
}
void W1ScorerBackStripNumber::PrintAll()
{
G4cout << " MultiFunctionalDet " << detector->GetName() << G4endl ;
G4cout << " PrimitiveScorer " << GetName() << G4endl ;
G4cout << " Number of entries " << EvtMap->entries() << G4endl ;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment