Skip to content
Snippets Groups Projects
Commit 2150a8eb authored by adrien-matta's avatar adrien-matta
Browse files

Merge branch 'NPTool.dev.prerelease' of https://github.com/adrien-matta/nptool...

Merge branch 'NPTool.dev.prerelease' of https://github.com/adrien-matta/nptool into NPTool.dev.prerelease
parents 1b2b37ce a0bdc34c
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@ Target
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GaspardTracker
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%1 Annular Back
%GPDAnnular
GPDAnnular
Z= -156.5
RMIN= 16
RMAX= 52
......@@ -37,7 +37,7 @@ GaspardTracker
THIRDSTAGE= 1
VIS= all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%1 Annular Front
%GPDAnnular
GPDAnnular
Z= 156.5
RMIN= 16
RMAX= 52
......@@ -206,7 +206,7 @@ GaspardTracker
THIRDSTAGE= 1
VIS= all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%1 Barrel
GPDSquare
%GPDSquare
X1_Y1= 142.516 49.00 -49.00
X128_Y1= 142.516 49.00 49.00
X1_Y128= 142.516 -49.00 -49.00
......@@ -216,7 +216,7 @@ GPDSquare
THIRDSTAGE= 1
VIS= all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%2
GPDSquare
%GPDSquare
X1_Y1= 66.125 135.422 -49.00
X128_Y1= 66.125 135.422 49.00
X1_Y128= 135.422 66.126 -49.00
......@@ -226,7 +226,7 @@ GPDSquare
THIRDSTAGE= 1
VIS= all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%3
GPDSquare
%GPDSquare
X1_Y1= -49.00 142.516 -49.00
X128_Y1= -49.00 142.516 49.00
X1_Y128= 49.00 142.516 -49.00
......@@ -236,7 +236,7 @@ GPDSquare
THIRDSTAGE= 1
VIS= all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%4
GPDSquare
%GPDSquare
X1_Y1= -135.422 66.125 -49.00
X128_Y1= -135.422 66.125 49.00
X1_Y128= -66.126 135.422 -49.00
......@@ -246,7 +246,7 @@ GPDSquare
THIRDSTAGE= 1
VIS= all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
GPDSquare
%GPDSquare
X1_Y1= -142.516 -49.00 -49.00
X128_Y1= -142.516 -49.00 49.00
X1_Y128= -142.516 49.00 -49.00
......@@ -256,7 +256,7 @@ GPDSquare
THIRDSTAGE= 1
VIS= all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%6
GPDSquare
%GPDSquare
X1_Y1= -66.125 -135.422 -49.00
X128_Y1= -66.125 -135.422 49.00
X1_Y128= -135.422 -66.126 -49.00
......@@ -266,7 +266,7 @@ GPDSquare
THIRDSTAGE= 1
VIS= all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%7
GPDSquare
%GPDSquare
X1_Y1= 49.00 -142.516 -49.00
X128_Y1= 49.00 -142.516 49.00
X1_Y128= -49.00 -142.516 -49.00
......@@ -276,7 +276,7 @@ GPDSquare
THIRDSTAGE= 1
VIS= all
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%8
GPDSquare
%GPDSquare
X1_Y1= 135.422 -66.125 -49.00
X128_Y1= 135.422 -66.125 49.00
X1_Y128= 66.126 -135.422 -49.00
......
......@@ -32,6 +32,7 @@
#include <fstream>
#include <cstdlib>
#include <limits>
#include <cmath>
// Root
#include "TChain.h"
......
......@@ -31,7 +31,7 @@
#include "../DetectorList.inc"
#include "GaspardTracker.h"
#include "Hyde2Tracker.h"
#include "Paris.h"
#include "TParisPhysics.h"
#include "Shield.h"
#include "Fatima.h"
#include "TAnnularS1Physics.h"
......@@ -398,7 +398,7 @@ void DetectorManager::ReadConfigurationFile(string Path) {
cout << "//////// Paris ////////" << endl << endl;
// Instantiate the new array as a VDetector Object
VDetector* myDetector = new Paris();
VDetector* myDetector = new TParisPhysics();
// Read Position of Telescope
ConfigFile.close();
myDetector->ReadConfiguration(Path);
......
......@@ -50,6 +50,7 @@
#include "GaspardTrackerAnnular.hh"
#include "ObsoleteGeneralScorers.hh"
#include "GaspardScorers.hh"
#include "SiliconScorers.hh"
#include "TGaspardTrackerData.h"
#include "RootOutput.h"
#include "VDetector.hh"
......@@ -423,6 +424,137 @@ void GaspardTrackerAnnular::SetInterCoordPointer(TInteractionCoordinates* interC
// Called at in the EventAction::EndOfEventAvtion
void GaspardTrackerAnnular::ReadSensitive(const G4Event* event)
{
//////////////
// First stage
G4THitsMap<G4double*>* GPD1HitMap;
std::map<G4int, G4double**>::iterator GPD1_itr;
G4int GPD1CollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDAnnular/GPDAnnularFirstStage");
GPD1HitMap = (G4THitsMap<G4double*>*)(event->GetHCofThisEvent()->GetHC(GPD1CollectionID));
// Loop on the GPD map
for (GPD1_itr = GPD1HitMap->GetMap()->begin(); GPD1_itr != GPD1HitMap->GetMap()->end(); GPD1_itr++) {
G4double* Info = *(GPD1_itr->second);
double Energy = Info[0];
if (Energy > EnergyThreshold) {
double Time = Info[1];
int DetNbr = (int) Info[7];
int StripFront = (int) Info[8];
int StripBack = (int) Info[9];
// detector number
ms_Event->SetGPDTrkFirstStageFrontEDetectorNbr(m_index["Annular"] + DetNbr);
ms_Event->SetGPDTrkFirstStageFrontTDetectorNbr(m_index["Annular"] + DetNbr);
ms_Event->SetGPDTrkFirstStageBackEDetectorNbr(m_index["Annular"] + DetNbr);
ms_Event->SetGPDTrkFirstStageBackTDetectorNbr(m_index["Annular"] + DetNbr);
// energy
ms_Event->SetGPDTrkFirstStageFrontEEnergy(RandGauss::shoot(Energy, ResoFirstStage));
ms_Event->SetGPDTrkFirstStageBackEEnergy(RandGauss::shoot(Energy, ResoFirstStage));
// time
Time = RandGauss::shoot(Time, ResoTimePPAC);
ms_Event->SetGPDTrkFirstStageFrontTTime(RandGauss::shoot(Time, ResoTimeGpd));
ms_Event->SetGPDTrkFirstStageBackTTime(RandGauss::shoot(Time, ResoTimeGpd));
// strips X and Y
ms_Event->SetGPDTrkFirstStageFrontEStripNbr(StripFront);
ms_Event->SetGPDTrkFirstStageFrontTStripNbr(StripFront);
ms_Event->SetGPDTrkFirstStageBackEStripNbr(StripBack);
ms_Event->SetGPDTrkFirstStageBackTStripNbr(StripBack);
// Interaction Coordinates
ms_InterCoord->SetDetectedPositionX(Info[2]);
ms_InterCoord->SetDetectedPositionY(Info[3]);
ms_InterCoord->SetDetectedPositionZ(Info[4]);
ms_InterCoord->SetDetectedAngleTheta(Info[5]/deg);
ms_InterCoord->SetDetectedAnglePhi(Info[6]/deg);
}
}
// clear map for next event
GPD1HitMap->clear();
//////////////
// Second stage
G4THitsMap<G4double*>* GPD2HitMap;
std::map<G4int, G4double**>::iterator GPD2_itr;
G4int GPD2CollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("SecondStageScorerGPDAnnular/GPDAnnularSecondStage");
GPD2HitMap = (G4THitsMap<G4double*>*)(event->GetHCofThisEvent()->GetHC(GPD2CollectionID));
// Loop on the GPD map
for (GPD2_itr = GPD2HitMap->GetMap()->begin(); GPD2_itr != GPD2HitMap->GetMap()->end(); GPD2_itr++) {
G4double* Info = *(GPD2_itr->second);
double Energy = Info[0];
if (Energy > EnergyThreshold) {
double Time = Info[1];
int DetNbr = (int) Info[7];
int StripFront = (int) Info[8];
// detector number
ms_Event->SetGPDTrkSecondStageEDetectorNbr(m_index["Annular"] + DetNbr);
ms_Event->SetGPDTrkSecondStageTDetectorNbr(m_index["Annular"] + DetNbr);
// energy
ms_Event->SetGPDTrkSecondStageEEnergy(RandGauss::shoot(Energy, ResoSecondStage));
// time
Time = RandGauss::shoot(Time, ResoTimePPAC);
ms_Event->SetGPDTrkSecondStageTTime(RandGauss::shoot(Time, ResoTimeGpd));
// strips X and Y
ms_Event->SetGPDTrkSecondStageEPadNbr(StripFront);
ms_Event->SetGPDTrkSecondStageTPadNbr(StripFront);
}
}
// clear map for next event
GPD2HitMap->clear();
//////////////
// Third stage
G4THitsMap<G4double*>* GPD3HitMap;
std::map<G4int, G4double**>::iterator GPD3_itr;
G4int GPD3CollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("ThirdStageScorerGPDAnnular/GPDAnnularThirdStage");
GPD3HitMap = (G4THitsMap<G4double*>*)(event->GetHCofThisEvent()->GetHC(GPD3CollectionID));
// Loop on the GPD map
for (GPD3_itr = GPD3HitMap->GetMap()->begin(); GPD3_itr != GPD3HitMap->GetMap()->end(); GPD3_itr++) {
G4double* Info = *(GPD3_itr->second);
double Energy = Info[0];
if (Energy > EnergyThreshold) {
double Time = Info[1];
int DetNbr = (int) Info[7];
int StripFront = (int) Info[8];
// detector number
ms_Event->SetGPDTrkThirdStageEDetectorNbr(m_index["Annular"] + DetNbr);
ms_Event->SetGPDTrkThirdStageTDetectorNbr(m_index["Annular"] + DetNbr);
// energy
ms_Event->SetGPDTrkThirdStageEEnergy(RandGauss::shoot(Energy, ResoThirdStage));
// time
Time = RandGauss::shoot(Time, ResoTimePPAC);
ms_Event->SetGPDTrkThirdStageTTime(RandGauss::shoot(Time, ResoTimeGpd));
// strips X and Y
ms_Event->SetGPDTrkThirdStageEPadNbr(StripFront);
ms_Event->SetGPDTrkThirdStageTPadNbr(StripFront);
}
}
// clear map for next event
GPD3HitMap->clear();
/*
//////////////////////////////////////////////////////////////////////////////////////
//////////////////////// Used to Read Event Map of detector //////////////////////////
//////////////////////////////////////////////////////////////////////////////////////
......@@ -704,20 +836,62 @@ void GaspardTrackerAnnular::ReadSensitive(const G4Event* event)
AngPhiHitMap -> clear();
SecondStageEnergyHitMap -> clear();
ThirdStageEnergyHitMap -> clear();
*/
}
void GaspardTrackerAnnular::InitializeScorers()
{
bool already_exist = false;
m_FirstStageScorer = VDetector::CheckScorer("FirstStageScorerGPDAnnular", already_exist);
m_SecondStageScorer = VDetector::CheckScorer("SecondStageScorerGPDAnnular",already_exist);
m_ThirdStageScorer = VDetector::CheckScorer("ThirdStageScorerGPDAnnular",already_exist);
if(already_exist) return;
// check whether scorers are already defined
bool already_exist = false;
m_FirstStageScorer = VDetector::CheckScorer("FirstStageScorerGPDAnnular", already_exist);
m_SecondStageScorer = VDetector::CheckScorer("SecondStageScorerGPDAnnular", already_exist);
m_ThirdStageScorer = VDetector::CheckScorer("ThirdStageScorerGPDAnnular", already_exist);
if (already_exist) return;
// First stage scorer
G4VPrimitiveScorer* GPDScorerFirstStage =
new SILICONSCORERS::PS_Silicon_Annular("GPDAnnularFirstStage",
FirstStageRmin,
FirstStageRmax,
0*deg,
360*deg,
NbThetaStrips,
NbPhiStrips,
NbThetaQuadrant);
// Second stage scorer
G4VPrimitiveScorer* GPDScorerSecondStage =
new SILICONSCORERS::PS_Silicon_Annular("GPDAnnularSecondStage",
FirstStageRmin,
FirstStageRmax,
0*deg,
360*deg,
1,
1,
1);
// Third stage scorer
G4VPrimitiveScorer* GPDScorerThirdStage =
new SILICONSCORERS::PS_Silicon_Annular("GPDAnnularThirdStage",
FirstStageRmin,
FirstStageRmax,
0*deg,
360*deg,
1,
1,
1);
// register scorers to the multifunctionnal detector
m_FirstStageScorer ->RegisterPrimitive(GPDScorerFirstStage);
m_SecondStageScorer ->RegisterPrimitive(GPDScorerSecondStage);
m_ThirdStageScorer ->RegisterPrimitive(GPDScorerThirdStage);
/*
// First stage Associate Scorer
G4VPrimitiveScorer* DetNbr = new OBSOLETEGENERALSCORERS::PSDetectorNumber("DetectorNumber", "GPDAnnular", 0);
G4VPrimitiveScorer* TOF = new OBSOLETEGENERALSCORERS::PSTOF("StripTime","GPDAnnular", 0);
......@@ -749,7 +923,7 @@ void GaspardTrackerAnnular::InitializeScorers()
// Third stage Associate Scorer
G4VPrimitiveScorer* ThirdStageEnergy = new GPDScorerThirdStageEnergy("ThirdStageEnergy", "GPDAnnular", 0);
m_ThirdStageScorer->RegisterPrimitive(ThirdStageEnergy);
*/
// Add All Scorer to the Global Scorer Manager
G4SDManager::GetSDMpointer()->AddNewDetector(m_FirstStageScorer);
G4SDManager::GetSDMpointer()->AddNewDetector(m_SecondStageScorer);
......
......@@ -128,6 +128,9 @@ namespace GPDANNULAR
const G4double ResoTimeGpd = 0.212765957 ;// = 500ps // Unit is ns/2.35
const G4double ResoTimePPAC = 0.106382979 ;// = 250ps // Unit is ns/2.35
// Threshold
const G4double EnergyThreshold = 0.2*MeV;
// Geometry
const G4double Rmin = 15*mm;
const G4double Rmax = 55*mm;
......
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