From 58129de6518d960be9d4985b9e71905e8a2fddc1 Mon Sep 17 00:00:00 2001
From: deserevi <deserevi@nptool>
Date: Mon, 12 Oct 2009 17:11:42 +0000
Subject: [PATCH] * All Gaspard detectors now use the new scorer scheme   + the
 index of maps now include the detector number

---
 .../132SndpTestMarcIsotropic.reaction         |  21 ++
 NPSimulation/src/GaspardScorers.cc            | 163 +++++++++-
 NPSimulation/src/GaspardTrackerAnnular.cc     |  97 +++---
 NPSimulation/src/GaspardTrackerDummyShape.cc  | 111 ++++---
 NPSimulation/src/GaspardTrackerSquare.cc      | 281 +++++++++---------
 NPSimulation/src/GaspardTrackerTrapezoid.cc   |  96 +++---
 6 files changed, 442 insertions(+), 327 deletions(-)
 create mode 100644 Inputs/EventGenerator/132SndpTestMarcIsotropic.reaction

diff --git a/Inputs/EventGenerator/132SndpTestMarcIsotropic.reaction b/Inputs/EventGenerator/132SndpTestMarcIsotropic.reaction
new file mode 100644
index 000000000..ccc4df426
--- /dev/null
+++ b/Inputs/EventGenerator/132SndpTestMarcIsotropic.reaction
@@ -0,0 +1,21 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%  Reaction file for 60Fe(d,p)61Fe reaction  %%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%Beam energy given in MeV ; Excitation in MeV ; emmitance in rad
+Transfert
+	Beam= 132Sn
+	Target= 2H
+	Light= 1H
+	Heavy= 133Sn
+	ExcitationEnergy= 0.0
+	BeamEnergy= 1320
+	BeamEnergySpread= 0
+	SigmaX= 0.851
+	SigmaY= 0.851
+	SigmaThetaX= 0 
+	SigmaPhiY= 0
+	CrossSectionPath= flat.txt
+	ShootLight= 1
+	ShootHeavy= 0
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
diff --git a/NPSimulation/src/GaspardScorers.cc b/NPSimulation/src/GaspardScorers.cc
index 8ece0f60b..48389994e 100644
--- a/NPSimulation/src/GaspardScorers.cc
+++ b/NPSimulation/src/GaspardScorers.cc
@@ -53,13 +53,25 @@ GPDScorerFirstStageEnergy::~GPDScorerFirstStageEnergy()
 
 G4bool GPDScorerFirstStageEnergy::ProcessHits(G4Step* aStep, G4TouchableHistory*)
 {
+   // get detector number
+   std::string name = aStep->GetTrack()->GetVolume()->GetName();
+   std::string nbr;
+   size_t found = name.find("G");
+   found += 1;
+
+   int numberOfCharacterInTelescopeNumber = name.length() - (int)found;
+
+   for (int i = 0; i < numberOfCharacterInTelescopeNumber; i++) nbr += name[i+1];
+   G4int DetNbr = atof(nbr.c_str());
+
+   // get energy
    G4ThreeVector POS  = aStep->GetPreStepPoint()->GetPosition();
    POS = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(POS);
 
    G4double edep = aStep->GetTotalEnergyDeposit();
    if (edep < 100*keV) return FALSE;
    G4int  index = aStep->GetTrack()->GetTrackID();
-   EvtMap->add(index, edep);
+   EvtMap->add(DetNbr + index, edep);
    return TRUE;
 }
 
@@ -113,13 +125,25 @@ GPDScorerSecondStageEnergy::~GPDScorerSecondStageEnergy()
 
 G4bool GPDScorerSecondStageEnergy::ProcessHits(G4Step* aStep, G4TouchableHistory*)
 {
+   // get detector number
+   std::string name = aStep->GetTrack()->GetVolume()->GetName();
+   std::string nbr;
+   size_t found = name.find("G");
+   found += 1;
+
+   int numberOfCharacterInTelescopeNumber = name.length() - (int)found;
+
+   for (int i = 0; i < numberOfCharacterInTelescopeNumber; i++) nbr += name[i+1];
+   G4int DetNbr = atof(nbr.c_str());
+
+   // get energy
    G4ThreeVector POS  = aStep->GetPreStepPoint()->GetPosition();
    POS = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(POS);
 
    G4double edep = aStep->GetTotalEnergyDeposit();
    if (edep < 100*keV) return FALSE;
    G4int  index = aStep->GetTrack()->GetTrackID();
-   EvtMap->add(index, edep);
+   EvtMap->add(DetNbr + index, edep);
    return TRUE;
 }
 
@@ -173,13 +197,25 @@ GPDScorerThirdStageEnergy::~GPDScorerThirdStageEnergy()
 
 G4bool GPDScorerThirdStageEnergy::ProcessHits(G4Step* aStep, G4TouchableHistory*)
 {
+   // get detector number
+   std::string name = aStep->GetTrack()->GetVolume()->GetName();
+   std::string nbr;
+   size_t found = name.find("G");
+   found += 1;
+
+   int numberOfCharacterInTelescopeNumber = name.length() - (int)found;
+
+   for (int i = 0; i < numberOfCharacterInTelescopeNumber; i++) nbr += name[i+1];
+   G4int DetNbr = atof(nbr.c_str());
+
+   // get energy
    G4ThreeVector POS  = aStep->GetPreStepPoint()->GetPosition();
    POS = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(POS);
 
    G4double edep = aStep->GetTotalEnergyDeposit();
    if (edep < 100*keV) return FALSE;
    G4int  index = aStep->GetTrack()->GetTrackID();
-   EvtMap->add(index, edep);
+   EvtMap->add(DetNbr + index, edep);
    return TRUE;
 }
 
@@ -232,20 +268,21 @@ GPDScorerDetectorNumber::~GPDScorerDetectorNumber()
 
 G4bool GPDScorerDetectorNumber::ProcessHits(G4Step* aStep, G4TouchableHistory*)
 {
+   // get detector number
    std::string name = aStep->GetTrack()->GetVolume()->GetName();
    std::string nbr;
    size_t found = name.find(m_VolumeName);
+   found += 1;
 
-   int numberOfCharacterInTelescopeNumberSquare = (int)found - 1;
-
-   for (int i = 0; i < numberOfCharacterInTelescopeNumberSquare; i++) nbr += name[i+1];
+   int numberOfCharacterInTelescopeNumber = name.length() - (int)found;
 
+   for (int i = 0; i < numberOfCharacterInTelescopeNumber; i++) nbr += name[i+1];
    G4int DetNbr = atof(nbr.c_str());
 
    G4double edep = aStep->GetTotalEnergyDeposit();
    if (edep < 100*keV) return FALSE;
    G4int  index = aStep->GetTrack()->GetTrackID();
-   EvtMap->set(index, DetNbr);
+   EvtMap->set(DetNbr + index, DetNbr);
    return TRUE;
 }
 
@@ -300,6 +337,18 @@ GPDScorerFirstStageFrontStripDummyShape::~GPDScorerFirstStageFrontStripDummyShap
 
 G4bool GPDScorerFirstStageFrontStripDummyShape::ProcessHits(G4Step* aStep, G4TouchableHistory*)
 {
+   // get detector number
+   std::string name = aStep->GetTrack()->GetVolume()->GetName();
+   std::string nbr;
+   size_t found = name.find("G");
+   found += 1;
+
+   int numberOfCharacterInTelescopeNumber = name.length() - (int)found;
+
+   for (int i = 0; i < numberOfCharacterInTelescopeNumber; i++) nbr += name[i+1];
+   G4int DetNbr = atof(nbr.c_str());
+
+   // get front strip number
    G4ThreeVector POS  = aStep->GetPreStepPoint()->GetPosition();
    POS = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(POS);
 
@@ -313,7 +362,7 @@ G4bool GPDScorerFirstStageFrontStripDummyShape::ProcessHits(G4Step* aStep, G4Tou
    G4double edep = aStep->GetTotalEnergyDeposit();
    if (edep < 100*keV) return FALSE;
    G4int  index =  aStep->GetTrack()->GetTrackID();
-   EvtMap->set(index, X);
+   EvtMap->set(DetNbr + index, X);
    return TRUE;
 }
 
@@ -362,6 +411,18 @@ GPDScorerFirstStageBackStripDummyShape::~GPDScorerFirstStageBackStripDummyShape(
 
 G4bool GPDScorerFirstStageBackStripDummyShape::ProcessHits(G4Step* aStep, G4TouchableHistory*)
 {
+   // get detector number
+   std::string name = aStep->GetTrack()->GetVolume()->GetName();
+   std::string nbr;
+   size_t found = name.find("G");
+   found += 1;
+
+   int numberOfCharacterInTelescopeNumber = name.length() - (int)found;
+
+   for (int i = 0; i < numberOfCharacterInTelescopeNumber; i++) nbr += name[i+1];
+   G4int DetNbr = atof(nbr.c_str());
+
+   // get back strip number
    G4ThreeVector POS  = aStep->GetPreStepPoint()->GetPosition();
    POS = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(POS);
 
@@ -374,7 +435,7 @@ G4bool GPDScorerFirstStageBackStripDummyShape::ProcessHits(G4Step* aStep, G4Touc
    G4double edep = aStep->GetTotalEnergyDeposit();
    if (edep < 100*keV) return FALSE;
    G4int  index =  aStep->GetTrack()->GetTrackID();
-   EvtMap->set(index, X);
+   EvtMap->set(DetNbr + index, X);
    return TRUE;
 }
 
@@ -423,6 +484,18 @@ GPDScorerFirstStageFrontStripSquare::~GPDScorerFirstStageFrontStripSquare()
 
 G4bool GPDScorerFirstStageFrontStripSquare::ProcessHits(G4Step* aStep, G4TouchableHistory*)
 {
+   // get detector number
+   std::string name = aStep->GetTrack()->GetVolume()->GetName();
+   std::string nbr;
+   size_t found = name.find("G");
+   found += 1;
+
+   int numberOfCharacterInTelescopeNumber = name.length() - (int)found;
+
+   for (int i = 0; i < numberOfCharacterInTelescopeNumber; i++) nbr += name[i+1];
+   G4int DetNbr = atof(nbr.c_str());
+
+   // get front strip
    G4ThreeVector POS  = aStep->GetPreStepPoint()->GetPosition();
    POS = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(POS);
 
@@ -435,7 +508,7 @@ G4bool GPDScorerFirstStageFrontStripSquare::ProcessHits(G4Step* aStep, G4Touchab
    G4double edep = aStep->GetTotalEnergyDeposit();
    if (edep < 100*keV) return FALSE;
    G4int  index =  aStep->GetTrack()->GetTrackID();
-   EvtMap->set(index, X);
+   EvtMap->set(DetNbr + index, X);
    return TRUE;
 }
 
@@ -483,6 +556,18 @@ GPDScorerFirstStageBackStripSquare::~GPDScorerFirstStageBackStripSquare()
 
 G4bool GPDScorerFirstStageBackStripSquare::ProcessHits(G4Step* aStep, G4TouchableHistory*)
 {
+   // get detector number
+   std::string name = aStep->GetTrack()->GetVolume()->GetName();
+   std::string nbr;
+   size_t found = name.find("G");
+   found += 1;
+
+   int numberOfCharacterInTelescopeNumber = name.length() - (int)found;
+
+   for (int i = 0; i < numberOfCharacterInTelescopeNumber; i++) nbr += name[i+1];
+   G4int DetNbr = atof(nbr.c_str());
+
+   // get back strip
    G4ThreeVector POS  = aStep->GetPreStepPoint()->GetPosition();
    POS = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(POS);
 
@@ -497,7 +582,7 @@ G4bool GPDScorerFirstStageBackStripSquare::ProcessHits(G4Step* aStep, G4Touchabl
    G4double edep = aStep->GetTotalEnergyDeposit();
    if (edep < 100*keV) return FALSE;
    G4int  index =  aStep->GetTrack()->GetTrackID();
-   EvtMap->set(index, Y);
+   EvtMap->set(DetNbr + index, Y);
    return TRUE;
 }
 
@@ -545,6 +630,18 @@ GPDScorerFirstStageFrontStripTrapezoid::~GPDScorerFirstStageFrontStripTrapezoid(
 
 G4bool GPDScorerFirstStageFrontStripTrapezoid::ProcessHits(G4Step* aStep, G4TouchableHistory*)
 {
+   // get detector number
+   std::string name = aStep->GetTrack()->GetVolume()->GetName();
+   std::string nbr;
+   size_t found = name.find("G");
+   found += 1;
+
+   int numberOfCharacterInTelescopeNumber = name.length() - (int)found;
+
+   for (int i = 0; i < numberOfCharacterInTelescopeNumber; i++) nbr += name[i+1];
+   G4int DetNbr = atof(nbr.c_str());
+
+   // get front strip
    G4ThreeVector POS  = aStep->GetPreStepPoint()->GetPosition();
    POS = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(POS);
 
@@ -557,7 +654,7 @@ G4bool GPDScorerFirstStageFrontStripTrapezoid::ProcessHits(G4Step* aStep, G4Touc
    G4double edep = aStep->GetTotalEnergyDeposit();
    if (edep < 100*keV) return FALSE;
    G4int  index =  aStep->GetTrack()->GetTrackID();
-   EvtMap->set(index, X);
+   EvtMap->set(DetNbr + index, X);
    return TRUE;
 }
 
@@ -605,6 +702,18 @@ GPDScorerFirstStageBackStripTrapezoid::~GPDScorerFirstStageBackStripTrapezoid()
 
 G4bool GPDScorerFirstStageBackStripTrapezoid::ProcessHits(G4Step* aStep, G4TouchableHistory*)
 {
+   // get detector number
+   std::string name = aStep->GetTrack()->GetVolume()->GetName();
+   std::string nbr;
+   size_t found = name.find("G");
+   found += 1;
+
+   int numberOfCharacterInTelescopeNumber = name.length() - (int)found;
+
+   for (int i = 0; i < numberOfCharacterInTelescopeNumber; i++) nbr += name[i+1];
+   G4int DetNbr = atof(nbr.c_str());
+
+   // get back strip
    G4ThreeVector POS  = aStep->GetPreStepPoint()->GetPosition();
    POS = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(POS);
 
@@ -619,7 +728,7 @@ G4bool GPDScorerFirstStageBackStripTrapezoid::ProcessHits(G4Step* aStep, G4Touch
    G4double edep = aStep->GetTotalEnergyDeposit();
    if (edep < 100*keV) return FALSE;
    G4int  index =  aStep->GetTrack()->GetTrackID();
-   EvtMap->set(index, Y);
+   EvtMap->set(DetNbr + index, Y);
    return TRUE;
 }
 
@@ -668,6 +777,18 @@ GPDScorerFirstStageFrontStripAnnular::~GPDScorerFirstStageFrontStripAnnular()
 
 G4bool GPDScorerFirstStageFrontStripAnnular::ProcessHits(G4Step* aStep, G4TouchableHistory*)
 {
+   // get detector number
+   std::string name = aStep->GetTrack()->GetVolume()->GetName();
+   std::string nbr;
+   size_t found = name.find("G");
+   found += 1;
+
+   int numberOfCharacterInTelescopeNumber = name.length() - (int)found;
+
+   for (int i = 0; i < numberOfCharacterInTelescopeNumber; i++) nbr += name[i+1];
+   G4int DetNbr = atof(nbr.c_str());
+
+   // get front strip
    G4ThreeVector POS  = aStep->GetPreStepPoint()->GetPosition();
    POS = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(POS);
 
@@ -680,7 +801,7 @@ G4bool GPDScorerFirstStageFrontStripAnnular::ProcessHits(G4Step* aStep, G4Toucha
    G4double edep = aStep->GetTotalEnergyDeposit();
    if (edep < 100*keV) return FALSE;
    G4int  index =  aStep->GetTrack()->GetTrackID();
-   EvtMap->set(index, X);
+   EvtMap->set(DetNbr + index, X);
    return TRUE;
 }
 
@@ -729,6 +850,18 @@ GPDScorerFirstStageBackStripAnnular::~GPDScorerFirstStageBackStripAnnular()
 
 G4bool GPDScorerFirstStageBackStripAnnular::ProcessHits(G4Step* aStep, G4TouchableHistory*)
 {
+   // get detector number
+   std::string name = aStep->GetTrack()->GetVolume()->GetName();
+   std::string nbr;
+   size_t found = name.find("G");
+   found += 1;
+
+   int numberOfCharacterInTelescopeNumber = name.length() - (int)found;
+
+   for (int i = 0; i < numberOfCharacterInTelescopeNumber; i++) nbr += name[i+1];
+   G4int DetNbr = atof(nbr.c_str());
+
+   // get back strip
    G4ThreeVector POS  = aStep->GetPreStepPoint()->GetPosition();
    POS = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(POS);
 
@@ -743,7 +876,7 @@ G4bool GPDScorerFirstStageBackStripAnnular::ProcessHits(G4Step* aStep, G4Touchab
    G4double edep = aStep->GetTotalEnergyDeposit();
    if (edep < 100*keV) return FALSE;
    G4int  index =  aStep->GetTrack()->GetTrackID();
-   EvtMap->set(index, Y);
+   EvtMap->set(DetNbr + index, Y);
    return TRUE;
 }
 
diff --git a/NPSimulation/src/GaspardTrackerAnnular.cc b/NPSimulation/src/GaspardTrackerAnnular.cc
index d317818cc..d00337e57 100644
--- a/NPSimulation/src/GaspardTrackerAnnular.cc
+++ b/NPSimulation/src/GaspardTrackerAnnular.cc
@@ -9,12 +9,13 @@
  * Original Author: N. de Sereville  contact address: deserevi@ipno.in2p3.fr *
  *                                                                           *
  * Creation Date  : 15/07/09                                                 *
- * Last update    :                                                          *
+ * Last update    : 12/10/09                                                 *
  *---------------------------------------------------------------------------*
  * Decription: Define a module of annular shape for the Gaspard tracker      *
  *                                                                           *
  *---------------------------------------------------------------------------*
  * Comment:                                                                  *
+ *    + 12/10/09: Change scorer scheme (N. de Sereville)                     *
  *                                                                           *
  *                                                                           *
  *****************************************************************************/
@@ -502,13 +503,9 @@ void GaspardTrackerAnnular::SetInterCoordPointer(TInteractionCoordinates* interC
 // Called at in the EventAction::EndOfEventAvtion
 void GaspardTrackerAnnular::ReadSensitive(const G4Event* event)
 {
-   bool checkSi = false      ;
-   G4String DetectorNumber ;
-
 //////////////////////////////////////////////////////////////////////////////////////
 //////////////////////// Used to Read Event Map of detector //////////////////////////
 //////////////////////////////////////////////////////////////////////////////////////
-
    // First Stage
    std::map<G4int, G4int*>::iterator    DetectorNumber_itr;
    std::map<G4int, G4double*>::iterator Energy_itr;
@@ -537,10 +534,6 @@ void GaspardTrackerAnnular::ReadSensitive(const G4Event* event)
    std::map<G4int, G4double*>::iterator ThirdStageEnergy_itr;
    G4THitsMap<G4double>* ThirdStageEnergyHitMap = NULL;
 
-//////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////
-   G4int HitNumber = 0;
-   checkSi = false;
 
    // Read the Scorer associated to the first Stage
    //Detector Number
@@ -612,40 +605,35 @@ void GaspardTrackerAnnular::ReadSensitive(const G4Event* event)
       return;
    }
 
-      // Loop on Strip energy
-      for (G4int l = 0 ; l < sizeE ; l++) {
-         G4int ETrackID  =   Energy_itr->first     ;
-         G4double E     = *(Energy_itr->second)    ;
-         G4int N = 0;
-
-         if (E > 0) {
-            checkSi = true   ;
-            ms_Event->SetGPDTrkFirstStageFrontEEnergy(RandGauss::shoot(E, ResoFirstStage))    ;
-            ms_Event->SetGPDTrkFirstStageBackEEnergy(RandGauss::shoot(E, ResoFirstStage))    ;
-
-            //  Detector Number
-            DetectorNumber_itr = DetectorNumberHitMap->GetMap()->begin();
-            for (G4int h = 0 ; h < sizeN ; h++) {
-                G4int NTrackID  =   DetectorNumber_itr->first       ;
-                G4double Nl     = *(DetectorNumber_itr->second)      ;
-
-                if (NTrackID == ETrackID) {
-                   N = Nl ;
-                   ms_Event->SetGPDTrkFirstStageFrontEDetectorNbr(m_index["Annular"] + N);
-                   ms_Event->SetGPDTrkFirstStageFrontTDetectorNbr(m_index["Annular"] + N);
-                   ms_Event->SetGPDTrkFirstStageBackEDetectorNbr(m_index["Annular"] + N);
-                   ms_Event->SetGPDTrkFirstStageBackTDetectorNbr(m_index["Annular"] + N);
-                }
-                DetectorNumber_itr++;
+   // Loop on FirstStage number
+   for (G4int l = 0; l < sizeN; l++) {
+      G4double N     = *(DetectorNumber_itr->second);
+      G4int NTrackID =   DetectorNumber_itr->first - N;
+
+      if (N > 0) {
+         // Fill detector number
+         ms_Event->SetGPDTrkFirstStageFrontEDetectorNbr(m_index["Annular"] + N);
+         ms_Event->SetGPDTrkFirstStageFrontTDetectorNbr(m_index["Annular"] + N);
+         ms_Event->SetGPDTrkFirstStageBackEDetectorNbr(m_index["Annular"] + N);
+         ms_Event->SetGPDTrkFirstStageBackTDetectorNbr(m_index["Annular"] + N);
+
+         // Energy
+         for (G4int l = 0 ; l < sizeE ; l++) {
+            G4int ETrackID  =   Energy_itr->first - N;
+            G4double E     = *(Energy_itr->second);
+            if (ETrackID == NTrackID) {
+               ms_Event->SetGPDTrkFirstStageFrontEEnergy(RandGauss::shoot(E, ResoFirstStage));
+               ms_Event->SetGPDTrkFirstStageBackEEnergy(RandGauss::shoot(E, ResoFirstStage));
             }
+            Energy_itr++;
+         }
 
             //  Time
             Time_itr = TimeHitMap->GetMap()->begin();
             for (G4int h = 0 ; h < sizeT ; h++) {
-               G4int TTrackID  =   Time_itr->first       ;
+               G4int TTrackID  =   Time_itr->first - N;
                G4double T     = *(Time_itr->second)      ;
-
-               if (TTrackID == ETrackID) {
+               if (TTrackID == NTrackID) {
                   T = RandGauss::shoot(T, ResoTimePPAC)   ;
                   ms_Event->SetGPDTrkFirstStageFrontTTime(RandGauss::shoot(T, ResoTimeGpd)) ;
                   ms_Event->SetGPDTrkFirstStageBackTTime(RandGauss::shoot(T, ResoTimeGpd)) ;
@@ -656,9 +644,9 @@ void GaspardTrackerAnnular::ReadSensitive(const G4Event* event)
             // X
             X_itr = XHitMap->GetMap()->begin();
             for (G4int h = 0 ; h < sizeX ; h++) {
-               G4int XTrackID  =   X_itr->first     ;
-               G4double X     = *(X_itr->second)      ;
-               if (XTrackID == ETrackID) {
+               G4int XTrackID  =   X_itr->first - N;
+               G4double X     = *(X_itr->second);
+               if (XTrackID == NTrackID) {
                   ms_Event->SetGPDTrkFirstStageFrontEStripNbr(X)   ;
                   ms_Event->SetGPDTrkFirstStageFrontTStripNbr(X)   ;
                }
@@ -671,7 +659,7 @@ void GaspardTrackerAnnular::ReadSensitive(const G4Event* event)
             for (G4int h = 0 ; h < sizeY ; h++) {
                G4int YTrackID  =   Y_itr->first    ;
                G4double Y     = *(Y_itr->second)      ;
-               if (YTrackID == ETrackID) {
+               if (YTrackID == NTrackID) {
                   ms_Event->SetGPDTrkFirstStageBackEStripNbr(Y)   ;
                   ms_Event->SetGPDTrkFirstStageBackTStripNbr(Y)   ;
                }
@@ -684,7 +672,7 @@ void GaspardTrackerAnnular::ReadSensitive(const G4Event* event)
             for (G4int h = 0 ; h < sizeX ; h++) {
                G4int PosXTrackID =   Pos_X_itr->first     ;
                G4double PosX     = *(Pos_X_itr->second)      ;
-               if (PosXTrackID == ETrackID) {
+               if (PosXTrackID == NTrackID) {
                   ms_InterCoord->SetDetectedPositionX(PosX) ;
                }
                Pos_X_itr++;
@@ -695,7 +683,7 @@ void GaspardTrackerAnnular::ReadSensitive(const G4Event* event)
             for (G4int h = 0 ; h < sizeX ; h++) {
                G4int PosYTrackID =   Pos_Y_itr->first     ;
                G4double PosY     = *(Pos_Y_itr->second)      ;
-               if (PosYTrackID == ETrackID) {
+               if (PosYTrackID == NTrackID) {
                   ms_InterCoord->SetDetectedPositionY(PosY) ;
                }
                Pos_Y_itr++;
@@ -706,7 +694,7 @@ void GaspardTrackerAnnular::ReadSensitive(const G4Event* event)
             for (G4int h = 0 ; h < sizeX ; h++) {
                G4int PosZTrackID =   Pos_Z_itr->first     ;
                G4double PosZ     = *(Pos_Z_itr->second)      ;
-               if (PosZTrackID == ETrackID) {
+               if (PosZTrackID == NTrackID) {
                   ms_InterCoord->SetDetectedPositionZ(PosZ) ;
                }
                Pos_Z_itr++;
@@ -717,7 +705,7 @@ void GaspardTrackerAnnular::ReadSensitive(const G4Event* event)
             for (G4int h = 0 ; h < sizeX ; h++) {
                G4int AngThetaTrackID =   Ang_Theta_itr->first     ;
                G4double AngTheta     = *(Ang_Theta_itr->second)      ;
-               if (AngThetaTrackID == ETrackID) {
+               if (AngThetaTrackID == NTrackID) {
                   ms_InterCoord->SetDetectedAngleTheta(AngTheta) ;
                }
                Ang_Theta_itr++;
@@ -726,10 +714,10 @@ void GaspardTrackerAnnular::ReadSensitive(const G4Event* event)
             // Angle Phi
             Ang_Phi_itr = AngPhiHitMap->GetMap()->begin();
             for (G4int h = 0 ; h < sizeX ; h++) {
-               G4int AngPhiTrackID =   Ang_Phi_itr->first     ;
-               G4double AngPhi     = *(Ang_Phi_itr->second)      ;
-               if (AngPhiTrackID == ETrackID) {
-                  ms_InterCoord->SetDetectedAnglePhi(AngPhi) ;
+               G4int AngPhiTrackID =   Ang_Phi_itr->first;
+               G4double AngPhi     = *(Ang_Phi_itr->second);
+               if (AngPhiTrackID == NTrackID) {
+                  ms_InterCoord->SetDetectedAnglePhi(AngPhi);
                }
                Ang_Phi_itr++;
             }
@@ -739,10 +727,10 @@ void GaspardTrackerAnnular::ReadSensitive(const G4Event* event)
             // Third Stage
                ThirdStageEnergy_itr = ThirdStageEnergyHitMap->GetMap()->begin()  ;
                for (G4int h = 0 ; h < ThirdStageEnergyHitMap->entries() ; h++) {
-                  G4int ThirdStageEnergyTrackID  =   ThirdStageEnergy_itr->first      ;
-                  G4double ThirdStageEnergy      = *(ThirdStageEnergy_itr->second)    ;
+                  G4int ThirdStageEnergyTrackID  =   ThirdStageEnergy_itr->first - N;
+                  G4double ThirdStageEnergy      = *(ThirdStageEnergy_itr->second);
 
-                  if (ThirdStageEnergyTrackID == ETrackID) {
+                  if (ThirdStageEnergyTrackID == NTrackID) {
                      ms_Event->SetGPDTrkThirdStageEEnergy(RandGauss::shoot(ThirdStageEnergy, ResoThirdStage));
                      ms_Event->SetGPDTrkThirdStageEPadNbr(1);
                      ms_Event->SetGPDTrkThirdStageTPadNbr(1);
@@ -754,8 +742,7 @@ void GaspardTrackerAnnular::ReadSensitive(const G4Event* event)
                   ThirdStageEnergy_itr++;
                }
 
-         Energy_itr++;
-         if (checkSi) HitNumber++ ;
+         DetectorNumber_itr++;
       }
 
       // clear map for next event
@@ -779,7 +766,7 @@ void GaspardTrackerAnnular::InitializeScorers()
 {
    // First stage Associate Scorer
    m_FirstStageScorer = new G4MultiFunctionalDetector("FirstStageScorerGPDAnnular");
-   G4VPrimitiveScorer* DetNbr                           = new GPDScorerDetectorNumber("DetectorNumber", 0, "Silicon");
+   G4VPrimitiveScorer* DetNbr                           = new GPDScorerDetectorNumber("DetectorNumber", 0, "G");
    G4VPrimitiveScorer* Energy                           = new GPDScorerFirstStageEnergy("StripEnergy", 0);
    G4VPrimitiveScorer* TOF                              = new PSTOF("StripTime", 0);
    G4VPrimitiveScorer* StripPositionX                   = new GPDScorerFirstStageFrontStripAnnular("StripNumberX", 0, FirstStageRmax, 128);
diff --git a/NPSimulation/src/GaspardTrackerDummyShape.cc b/NPSimulation/src/GaspardTrackerDummyShape.cc
index 4fdfd5ae9..a92f21696 100644
--- a/NPSimulation/src/GaspardTrackerDummyShape.cc
+++ b/NPSimulation/src/GaspardTrackerDummyShape.cc
@@ -9,7 +9,7 @@
  * Original Author: N. de Sereville  contact address: deserevi@ipno.in2p3.fr *
  *                                                                           *
  * Creation Date  : 03/09/09                                                 *
- * Last update    : 07/09/09                                                 *
+ * Last update    : 12/10/09                                                 *
  *---------------------------------------------------------------------------*
  * Decription: Define a dummy module for the Gaspard tracker                 *
  *             The goal of this class is to be a starting point to create a  *
@@ -19,6 +19,7 @@
  * Comment:                                                                  *
  *    + 07/09/09: Fix bug for placing module with (r,theta,phi) method.      *
  *                (N. de Sereville)                                          *
+ *    + 12/10/09: Change scorer scheme (N. de Sereville)                     *
  *                                                                           *
  *                                                                           *
  *****************************************************************************/
@@ -757,66 +758,62 @@ void GaspardTrackerDummyShape::ReadSensitive(const G4Event* event)
       return;
    }
 
-   // Loop on FirstStage energy
-   for (G4int l = 0 ; l < sizeE ; l++) {
-      G4int ETrackID  =   Energy_itr->first     ;
-      G4double E     = *(Energy_itr->second)    ;
-      G4int N = 0;
-
-      if (E > 0) {
-         ms_Event->SetGPDTrkFirstStageFrontEEnergy(RandGauss::shoot(E, ResoFirstStage))    ;
-         ms_Event->SetGPDTrkFirstStageBackEEnergy(RandGauss::shoot(E, ResoFirstStage))    ;
-
-         //  Detector Number
-         DetectorNumber_itr = DetectorNumberHitMap->GetMap()->begin();
-         for (G4int h = 0 ; h < sizeN ; h++) {
-             G4int NTrackID  =   DetectorNumber_itr->first       ;
-             G4double Nl     = *(DetectorNumber_itr->second)      ;
-
-             if (NTrackID == ETrackID) {
-                N = Nl ;
-                ms_Event->SetGPDTrkFirstStageFrontEDetectorNbr(m_index["DummyShape"] + N);
-                ms_Event->SetGPDTrkFirstStageFrontTDetectorNbr(m_index["DummyShape"] + N);
-                ms_Event->SetGPDTrkFirstStageBackEDetectorNbr(m_index["DummyShape"] + N);
-                ms_Event->SetGPDTrkFirstStageBackTDetectorNbr(m_index["DummyShape"] + N);
-             }
-             DetectorNumber_itr++;
+   // Loop on FirstStage number
+   for (G4int l = 0; l < sizeN; l++) {
+      G4double N     = *(DetectorNumber_itr->second);
+      G4int NTrackID =   DetectorNumber_itr->first - N;
+
+      if (N > 0) {
+         // Fill detector number
+         ms_Event->SetGPDTrkFirstStageFrontEDetectorNbr(m_index["DummyShape"] + N);
+         ms_Event->SetGPDTrkFirstStageFrontTDetectorNbr(m_index["DummyShape"] + N);
+         ms_Event->SetGPDTrkFirstStageBackEDetectorNbr(m_index["DummyShape"] + N);
+         ms_Event->SetGPDTrkFirstStageBackTDetectorNbr(m_index["DummyShape"] + N);
+
+         // Energy
+         for (G4int l = 0 ; l < sizeE ; l++) {
+            G4int ETrackID  =   Energy_itr->first - N;
+            G4double E     = *(Energy_itr->second);
+            if (ETrackID == NTrackID) {
+               ms_Event->SetGPDTrkFirstStageFrontEEnergy(RandGauss::shoot(E, ResoFirstStage));
+               ms_Event->SetGPDTrkFirstStageBackEEnergy(RandGauss::shoot(E, ResoFirstStage));
+            }
+            Energy_itr++;
          }
 
          //  Time
          Time_itr = TimeHitMap->GetMap()->begin();
          for (G4int h = 0 ; h < sizeT ; h++) {
-            G4int TTrackID  =   Time_itr->first       ;
-            G4double T     = *(Time_itr->second)      ;
-
-            if (TTrackID == ETrackID) {
-               T = RandGauss::shoot(T, ResoTimeGpd)   ;
-               ms_Event->SetGPDTrkFirstStageFrontTTime(RandGauss::shoot(T, ResoTimeGpd)) ;
-               ms_Event->SetGPDTrkFirstStageBackTTime(RandGauss::shoot(T, ResoTimeGpd)) ;
+            G4int TTrackID  =   Time_itr->first - N;
+            G4double T     = *(Time_itr->second);
+            if (TTrackID == NTrackID) {
+               T = RandGauss::shoot(T, ResoTimeGpd);
+               ms_Event->SetGPDTrkFirstStageFrontTTime(RandGauss::shoot(T, ResoTimeGpd));
+               ms_Event->SetGPDTrkFirstStageBackTTime(RandGauss::shoot(T, ResoTimeGpd));
             }
             Time_itr++;
          }
 
-         // X
+         // Strip X
          X_itr = XHitMap->GetMap()->begin();
          for (G4int h = 0 ; h < sizeX ; h++) {
-            G4int XTrackID  =   X_itr->first     ;
-            G4double X     = *(X_itr->second)      ;
-            if (XTrackID == ETrackID) {
-               ms_Event->SetGPDTrkFirstStageFrontEStripNbr(X)   ;
-               ms_Event->SetGPDTrkFirstStageFrontTStripNbr(X)   ;
+            G4int XTrackID  =   X_itr->first - N;
+            G4double X     = *(X_itr->second);
+            if (XTrackID == NTrackID) {
+               ms_Event->SetGPDTrkFirstStageFrontEStripNbr(X);
+               ms_Event->SetGPDTrkFirstStageFrontTStripNbr(X);
             }
             X_itr++;
          }
 
-         // Y
+         // Strip Y
          Y_itr = YHitMap->GetMap()->begin()  ;
          for (G4int h = 0 ; h < sizeY ; h++) {
-            G4int YTrackID  =   Y_itr->first    ;
-            G4double Y     = *(Y_itr->second)      ;
-            if (YTrackID == ETrackID) {
-               ms_Event->SetGPDTrkFirstStageBackEStripNbr(Y)   ;
-               ms_Event->SetGPDTrkFirstStageBackTStripNbr(Y)   ;
+            G4int YTrackID  =   Y_itr->first - N;
+            G4double Y     = *(Y_itr->second);
+            if (YTrackID == NTrackID) {
+               ms_Event->SetGPDTrkFirstStageBackEStripNbr(Y);
+               ms_Event->SetGPDTrkFirstStageBackTStripNbr(Y);
             }
             Y_itr++;
          }
@@ -826,7 +823,7 @@ void GaspardTrackerDummyShape::ReadSensitive(const G4Event* event)
          for (G4int h = 0 ; h < sizeX ; h++) {
             G4int PosXTrackID =   Pos_X_itr->first     ;
             G4double PosX     = *(Pos_X_itr->second)      ;
-            if (PosXTrackID == ETrackID) {
+            if (PosXTrackID == NTrackID) {
                ms_InterCoord->SetDetectedPositionX(PosX) ;
             }
             Pos_X_itr++;
@@ -837,7 +834,7 @@ void GaspardTrackerDummyShape::ReadSensitive(const G4Event* event)
          for (G4int h = 0 ; h < sizeX ; h++) {
             G4int PosYTrackID =   Pos_Y_itr->first     ;
             G4double PosY     = *(Pos_Y_itr->second)      ;
-            if (PosYTrackID == ETrackID) {
+            if (PosYTrackID == NTrackID) {
                ms_InterCoord->SetDetectedPositionY(PosY) ;
             }
             Pos_Y_itr++;
@@ -848,7 +845,7 @@ void GaspardTrackerDummyShape::ReadSensitive(const G4Event* event)
          for (G4int h = 0 ; h < sizeX ; h++) {
             G4int PosZTrackID =   Pos_Z_itr->first     ;
             G4double PosZ     = *(Pos_Z_itr->second)      ;
-            if (PosZTrackID == ETrackID) {
+            if (PosZTrackID == NTrackID) {
                ms_InterCoord->SetDetectedPositionZ(PosZ) ;
             }
             Pos_Z_itr++;
@@ -859,7 +856,7 @@ void GaspardTrackerDummyShape::ReadSensitive(const G4Event* event)
          for (G4int h = 0 ; h < sizeX ; h++) {
             G4int AngThetaTrackID =   Ang_Theta_itr->first     ;
             G4double AngTheta     = *(Ang_Theta_itr->second)      ;
-            if (AngThetaTrackID == ETrackID) {
+            if (AngThetaTrackID == NTrackID) {
                ms_InterCoord->SetDetectedAngleTheta(AngTheta) ;
             }
             Ang_Theta_itr++;
@@ -870,7 +867,7 @@ void GaspardTrackerDummyShape::ReadSensitive(const G4Event* event)
          for (G4int h = 0 ; h < sizeX ; h++) {
             G4int AngPhiTrackID =   Ang_Phi_itr->first     ;
             G4double AngPhi     = *(Ang_Phi_itr->second)      ;
-            if (AngPhiTrackID == ETrackID) {
+            if (AngPhiTrackID == NTrackID) {
                ms_InterCoord->SetDetectedAnglePhi(AngPhi) ;
             }
             Ang_Phi_itr++;
@@ -879,10 +876,10 @@ void GaspardTrackerDummyShape::ReadSensitive(const G4Event* event)
          // Second Stage
          SecondStageEnergy_itr = SecondStageEnergyHitMap->GetMap()->begin() ;
          for (G4int h = 0 ; h < SecondStageEnergyHitMap->entries() ; h++) {
-            G4int SecondStageEnergyTrackID =   SecondStageEnergy_itr->first  ;
-            G4double SecondStageEnergy     = *(SecondStageEnergy_itr->second)   ;
+            G4int SecondStageEnergyTrackID =   SecondStageEnergy_itr->first - N;
+            G4double SecondStageEnergy     = *(SecondStageEnergy_itr->second);
 
-            if (SecondStageEnergyTrackID == ETrackID) {
+            if (SecondStageEnergyTrackID == NTrackID) {
                ms_Event->SetGPDTrkSecondStageEEnergy(RandGauss::shoot(SecondStageEnergy, ResoSecondStage)) ;
                ms_Event->SetGPDTrkSecondStageEPadNbr(1);
                ms_Event->SetGPDTrkSecondStageTPadNbr(1);
@@ -896,10 +893,10 @@ void GaspardTrackerDummyShape::ReadSensitive(const G4Event* event)
          // Third Stage
          ThirdStageEnergy_itr = ThirdStageEnergyHitMap->GetMap()->begin()  ;
          for (G4int h = 0 ; h < ThirdStageEnergyHitMap->entries() ; h++) {
-            G4int ThirdStageEnergyTrackID  =   ThirdStageEnergy_itr->first      ;
-            G4double ThirdStageEnergy      = *(ThirdStageEnergy_itr->second)    ;
+            G4int ThirdStageEnergyTrackID  =   ThirdStageEnergy_itr->first - N;
+            G4double ThirdStageEnergy      = *(ThirdStageEnergy_itr->second);
 
-            if (ThirdStageEnergyTrackID == ETrackID) {
+            if (ThirdStageEnergyTrackID == NTrackID) {
                ms_Event->SetGPDTrkThirdStageEEnergy(RandGauss::shoot(ThirdStageEnergy, ResoThirdStage));
                ms_Event->SetGPDTrkThirdStageEPadNbr(1);
                ms_Event->SetGPDTrkThirdStageTPadNbr(1);
@@ -910,7 +907,7 @@ void GaspardTrackerDummyShape::ReadSensitive(const G4Event* event)
             ThirdStageEnergy_itr++;
          }
 
-         Energy_itr++;
+         DetectorNumber_itr++;
       }
 
       // clear map for next event
@@ -935,7 +932,7 @@ void GaspardTrackerDummyShape::InitializeScorers()
 {
    // First stage Associate Scorer
    m_FirstStageScorer                                   = new G4MultiFunctionalDetector("FirstStageScorerGPDDummyShape");
-   G4VPrimitiveScorer* DetNbr                           = new GPDScorerDetectorNumber("DetectorNumber", 0, "FirstStage");
+   G4VPrimitiveScorer* DetNbr                           = new GPDScorerDetectorNumber("DetectorNumber", 0, "G");
    G4VPrimitiveScorer* Energy                           = new GPDScorerFirstStageEnergy("StripEnergy", 0);
    G4VPrimitiveScorer* TOF                              = new PSTOF("StripTime", 0);
    G4VPrimitiveScorer* StripPositionX                   = new GPDScorerFirstStageFrontStripDummyShape("StripIDFront", 0, NumberOfStrips);
diff --git a/NPSimulation/src/GaspardTrackerSquare.cc b/NPSimulation/src/GaspardTrackerSquare.cc
index a38205a98..a907495f0 100644
--- a/NPSimulation/src/GaspardTrackerSquare.cc
+++ b/NPSimulation/src/GaspardTrackerSquare.cc
@@ -9,7 +9,7 @@
  * Original Author: N. de Sereville  contact address: deserevi@ipno.in2p3.fr *
  *                                                                           *
  * Creation Date  : 10/06/09                                                 *
- * Last update    : 07/09/09                                                 *
+ * Last update    : 12/10/09                                                 *
  *---------------------------------------------------------------------------*
  * Decription: Define a module of square shape for the Gaspard tracker       *
  *                                                                           *
@@ -17,6 +17,7 @@
  * Comment:                                                                  *
  *    + 07/09/09: Fix bug for placing module with (r,theta,phi) method.      *
  *                (N. de Sereville)                                          *
+ *    + 12/10/09: Change scorer scheme (N. de Sereville)                     *
  *                                                                           *
  *                                                                           *
  *****************************************************************************/
@@ -829,13 +830,9 @@ void GaspardTrackerSquare::SetInterCoordPointer(TInteractionCoordinates* interCo
 // Called at in the EventAction::EndOfEventAvtion
 void GaspardTrackerSquare::ReadSensitive(const G4Event* event)
 {
-   bool checkSi = false;
-   G4String DetectorNumber;
-
 //////////////////////////////////////////////////////////////////////////////////////
 //////////////////////// Used to Read Event Map of detector //////////////////////////
 //////////////////////////////////////////////////////////////////////////////////////
-
    // First Stage
    std::map<G4int, G4int*>::iterator    DetectorNumber_itr;
    std::map<G4int, G4double*>::iterator Energy_itr;
@@ -867,137 +864,129 @@ void GaspardTrackerSquare::ReadSensitive(const G4Event* event)
    std::map<G4int, G4double*>::iterator ThirdStageEnergy_itr  ;
    G4THitsMap<G4double>* ThirdStageEnergyHitMap = NULL    ;
 
-//////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////
-   G4int HitNumber = 0;
-   checkSi = false;
-
-      // Read the Scorer associate to the Silicon Strip
-      //Detector Number
-      G4int StripDetCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/DetectorNumber")    ;
-      DetectorNumberHitMap = (G4THitsMap<G4int>*)(event->GetHCofThisEvent()->GetHC(StripDetCollectionID))         ;
-      DetectorNumber_itr =  DetectorNumberHitMap->GetMap()->begin()                                               ;
-
-      //Energy
-      G4int StripEnergyCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/StripEnergy")   ;
-      EnergyHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(StripEnergyCollectionID))                    ;
-      Energy_itr = EnergyHitMap->GetMap()->begin()                                                          ;
-
-      //Time of Flight
-      G4int StripTimeCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/StripTime")    ;
-      TimeHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(StripTimeCollectionID))                        ;
-      Time_itr = TimeHitMap->GetMap()->begin()                                                              ;
-
-      //Strip Number X
-      G4int StripXCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/StripNumberX")    ;
-      XHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(StripXCollectionID))                              ;
-      X_itr = XHitMap->GetMap()->begin()                                                                    ;
-
-      //Strip Number Y
-      G4int StripYCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/StripNumberY")    ;
-      YHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(StripYCollectionID))                              ;
-      Y_itr = YHitMap->GetMap()->begin()                                                                    ;
-
-      //Interaction Coordinate X
-      G4int InterCoordXCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/InterCoordX")    ;
-      PosXHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(InterCoordXCollectionID))                              ;
-      Pos_X_itr = PosXHitMap->GetMap()->begin()                                                                    ;
-
-      //Interaction Coordinate Y
-      G4int InterCoordYCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/InterCoordY")    ;
-      PosYHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(InterCoordYCollectionID))                              ;
-      Pos_Y_itr = PosYHitMap->GetMap()->begin()                                                                    ;
-
-      //Interaction Coordinate Z
-      G4int InterCoordZCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/InterCoordZ")    ;
-      PosZHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(InterCoordZCollectionID))                              ;
-      Pos_Z_itr = PosXHitMap->GetMap()->begin()                                                                    ;
-
-      //Interaction Coordinate Angle Theta
-      G4int InterCoordAngThetaCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/InterCoordAngTheta")    ;
-      AngThetaHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(InterCoordAngThetaCollectionID))                              ;
-      Ang_Theta_itr = AngThetaHitMap->GetMap()->begin()                                                                    ;
-
-      //Interaction Coordinate Angle Phi
-      G4int InterCoordAngPhiCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/InterCoordAngPhi")    ;
-      AngPhiHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(InterCoordAngPhiCollectionID))                              ;
-      Ang_Phi_itr = AngPhiHitMap->GetMap()->begin()                                                                    ;
-
-      // Read the Scorer associate to the SiLi
-         //Energy
-         G4int SiLiEnergyCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("SecondStageScorerGPDSquare/SecondStageEnergy")   ;
-         SiLiEnergyHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(SiLiEnergyCollectionID))                 ;
-         SiLiEnergy_itr = SiLiEnergyHitMap->GetMap()->begin()                                                     ;
-
-
-      // Read the Scorer associate to the CsI crystal
-         //Energy
-         G4int ThirdStageEnergyCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("ThirdStageScorerGPDSquare/ThirdStageEnergy");
-         ThirdStageEnergyHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(ThirdStageEnergyCollectionID));
-         ThirdStageEnergy_itr = ThirdStageEnergyHitMap->GetMap()->begin();
-
-      // Check the size of different map
-      G4int sizeN = DetectorNumberHitMap->entries();
-      G4int sizeE = EnergyHitMap->entries();
-      G4int sizeT = TimeHitMap->entries();
-      G4int sizeX = XHitMap->entries();
-      G4int sizeY = YHitMap->entries();
-
-      if (sizeE != sizeT || sizeT != sizeX || sizeX != sizeY) {
-         G4cout << "No match size Si Event Map: sE:"
-         << sizeE << " sT:" << sizeT << " sX:" << sizeX << " sY:" << sizeY << endl ;
-         return;
-      }
 
-      // Loop on Strip energy
-      for (G4int l = 0 ; l < sizeE ; l++) {
-         G4int ETrackID  =   Energy_itr->first     ;
-         G4double E     = *(Energy_itr->second)    ;
-         G4int N = 0;
-
-         if (E > 0) {
-            checkSi = true   ;
-            ms_Event->SetGPDTrkFirstStageFrontEEnergy(RandGauss::shoot(E, ResoFirstStage))    ;
-            ms_Event->SetGPDTrkFirstStageBackEEnergy(RandGauss::shoot(E, ResoFirstStage))    ;
-
-            //  Detector Number
-            DetectorNumber_itr = DetectorNumberHitMap->GetMap()->begin();
-            for (G4int h = 0 ; h < sizeN ; h++) {
-                G4int NTrackID  =   DetectorNumber_itr->first       ;
-                G4double Nl     = *(DetectorNumber_itr->second)      ;
-
-                if (NTrackID == ETrackID) {
-                   N = Nl ;
-                   ms_Event->SetGPDTrkFirstStageFrontEDetectorNbr(m_index["Square"] + N);
-                   ms_Event->SetGPDTrkFirstStageFrontTDetectorNbr(m_index["Square"] + N);
-                   ms_Event->SetGPDTrkFirstStageBackEDetectorNbr(m_index["Square"] + N);
-                   ms_Event->SetGPDTrkFirstStageBackTDetectorNbr(m_index["Square"] + N);
-                }
-                DetectorNumber_itr++;
-            }
+   // Read the Scorer associate to the Silicon Strip
+   //Detector Number
+   G4int StripDetCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/DetectorNumber")    ;
+   DetectorNumberHitMap = (G4THitsMap<G4int>*)(event->GetHCofThisEvent()->GetHC(StripDetCollectionID))         ;
+   DetectorNumber_itr =  DetectorNumberHitMap->GetMap()->begin()                                               ;
+
+   //Energy
+   G4int StripEnergyCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/StripEnergy")   ;
+   EnergyHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(StripEnergyCollectionID))                    ;
+   Energy_itr = EnergyHitMap->GetMap()->begin()                                                          ;
+
+   //Time of Flight
+   G4int StripTimeCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/StripTime")    ;
+   TimeHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(StripTimeCollectionID))                        ;
+   Time_itr = TimeHitMap->GetMap()->begin()                                                              ;
+
+   //Strip Number X
+   G4int StripXCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/StripNumberX")    ;
+   XHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(StripXCollectionID))                              ;
+   X_itr = XHitMap->GetMap()->begin()                                                                    ;
+
+   //Strip Number Y
+   G4int StripYCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/StripNumberY")    ;
+   YHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(StripYCollectionID))                              ;
+   Y_itr = YHitMap->GetMap()->begin()                                                                    ;
+
+   //Interaction Coordinate X
+   G4int InterCoordXCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/InterCoordX")    ;
+   PosXHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(InterCoordXCollectionID))                              ;
+   Pos_X_itr = PosXHitMap->GetMap()->begin()                                                                    ;
+
+   //Interaction Coordinate Y
+   G4int InterCoordYCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/InterCoordY")    ;
+   PosYHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(InterCoordYCollectionID))                              ;
+   Pos_Y_itr = PosYHitMap->GetMap()->begin()                                                                    ;
+
+   //Interaction Coordinate Z
+   G4int InterCoordZCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/InterCoordZ")    ;
+   PosZHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(InterCoordZCollectionID))                              ;
+   Pos_Z_itr = PosXHitMap->GetMap()->begin()                                                                    ;
+
+   //Interaction Coordinate Angle Theta
+   G4int InterCoordAngThetaCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/InterCoordAngTheta")    ;
+   AngThetaHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(InterCoordAngThetaCollectionID))                              ;
+   Ang_Theta_itr = AngThetaHitMap->GetMap()->begin()                                                                    ;
+
+   //Interaction Coordinate Angle Phi
+   G4int InterCoordAngPhiCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("FirstStageScorerGPDSquare/InterCoordAngPhi")    ;
+   AngPhiHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(InterCoordAngPhiCollectionID))                              ;
+   Ang_Phi_itr = AngPhiHitMap->GetMap()->begin()                                                                    ;
+
+
+   // Read the Scorer associate to the SiLi
+   //Energy
+   G4int SiLiEnergyCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("SecondStageScorerGPDSquare/SecondStageEnergy")   ;
+   SiLiEnergyHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(SiLiEnergyCollectionID))                 ;
+   SiLiEnergy_itr = SiLiEnergyHitMap->GetMap()->begin()                                                     ;
+
+
+   // Read the Scorer associate to the CsI crystal
+   //Energy
+   G4int ThirdStageEnergyCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("ThirdStageScorerGPDSquare/ThirdStageEnergy");
+   ThirdStageEnergyHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(ThirdStageEnergyCollectionID));
+   ThirdStageEnergy_itr = ThirdStageEnergyHitMap->GetMap()->begin();
+
+   // Check the size of different map
+   G4int sizeN = DetectorNumberHitMap->entries();
+   G4int sizeE = EnergyHitMap->entries();
+   G4int sizeT = TimeHitMap->entries();
+   G4int sizeX = XHitMap->entries();
+   G4int sizeY = YHitMap->entries();
+
+   if (sizeE != sizeT || sizeT != sizeX || sizeX != sizeY) {
+      G4cout << "No match size Si Event Map: sE:"
+      << sizeE << " sT:" << sizeT << " sX:" << sizeX << " sY:" << sizeY << endl ;
+      return;
+   }
 
-            //  Time
-            Time_itr = TimeHitMap->GetMap()->begin();
-            for (G4int h = 0 ; h < sizeT ; h++) {
-               G4int TTrackID  =   Time_itr->first       ;
-               G4double T     = *(Time_itr->second)      ;
+   // Loop on FirstStage number
+   for (G4int l = 0; l < sizeN; l++) {
+      G4double N     = *(DetectorNumber_itr->second);
+      G4int NTrackID =   DetectorNumber_itr->first - N;
+
+      if (N > 0) {
+         // Fill detector number
+         ms_Event->SetGPDTrkFirstStageFrontEDetectorNbr(m_index["Square"] + N);
+         ms_Event->SetGPDTrkFirstStageFrontTDetectorNbr(m_index["Square"] + N);
+         ms_Event->SetGPDTrkFirstStageBackEDetectorNbr(m_index["Square"] + N);
+         ms_Event->SetGPDTrkFirstStageBackTDetectorNbr(m_index["Square"] + N);
+
+         // Energy
+         for (G4int l = 0 ; l < sizeE ; l++) {
+            G4int ETrackID  =   Energy_itr->first - N;
+            G4double E     = *(Energy_itr->second);
+            if (ETrackID == NTrackID) {
+               ms_Event->SetGPDTrkFirstStageFrontEEnergy(RandGauss::shoot(E, ResoFirstStage));
+               ms_Event->SetGPDTrkFirstStageBackEEnergy(RandGauss::shoot(E, ResoFirstStage));
+            }
+            Energy_itr++;
+         }
 
-               if (TTrackID == ETrackID) {
-                  T = RandGauss::shoot(T, ResoTimePPAC)   ;
-                  ms_Event->SetGPDTrkFirstStageFrontTTime(RandGauss::shoot(T, ResoTimeGpd)) ;
-                  ms_Event->SetGPDTrkFirstStageBackTTime(RandGauss::shoot(T, ResoTimeGpd)) ;
-               }
-               Time_itr++;
+         //  Time
+         Time_itr = TimeHitMap->GetMap()->begin();
+         for (G4int h = 0 ; h < sizeT ; h++) {
+            G4int TTrackID  =   Time_itr->first - N;
+            G4double T     = *(Time_itr->second);
+            if (TTrackID == NTrackID) {
+               T = RandGauss::shoot(T, ResoTimePPAC)   ;
+               ms_Event->SetGPDTrkFirstStageFrontTTime(RandGauss::shoot(T, ResoTimeGpd)) ;
+               ms_Event->SetGPDTrkFirstStageBackTTime(RandGauss::shoot(T, ResoTimeGpd)) ;
             }
+            Time_itr++;
+         }
 
             // X
             X_itr = XHitMap->GetMap()->begin();
             for (G4int h = 0 ; h < sizeX ; h++) {
-               G4int XTrackID  =   X_itr->first     ;
-               G4double X     = *(X_itr->second)      ;
-               if (XTrackID == ETrackID) {
-                  ms_Event->SetGPDTrkFirstStageFrontEStripNbr(X)   ;
-                  ms_Event->SetGPDTrkFirstStageFrontTStripNbr(X)   ;
+               G4int XTrackID  =   X_itr->first - N;
+               G4double X     = *(X_itr->second);
+               if (XTrackID == NTrackID) {
+                  ms_Event->SetGPDTrkFirstStageFrontEStripNbr(X);
+                  ms_Event->SetGPDTrkFirstStageFrontTStripNbr(X);
                }
 
                X_itr++;
@@ -1006,11 +995,11 @@ void GaspardTrackerSquare::ReadSensitive(const G4Event* event)
             // Y
             Y_itr = YHitMap->GetMap()->begin()  ;
             for (G4int h = 0 ; h < sizeY ; h++) {
-               G4int YTrackID  =   Y_itr->first    ;
-               G4double Y     = *(Y_itr->second)      ;
-               if (YTrackID == ETrackID) {
-                  ms_Event->SetGPDTrkFirstStageBackEStripNbr(Y)   ;
-                  ms_Event->SetGPDTrkFirstStageBackTStripNbr(Y)   ;
+               G4int YTrackID  =   Y_itr->first - N;
+               G4double Y     = *(Y_itr->second);
+               if (YTrackID == NTrackID) {
+                  ms_Event->SetGPDTrkFirstStageBackEStripNbr(Y);
+                  ms_Event->SetGPDTrkFirstStageBackTStripNbr(Y);
                }
 
                Y_itr++;
@@ -1021,7 +1010,7 @@ void GaspardTrackerSquare::ReadSensitive(const G4Event* event)
             for (G4int h = 0 ; h < sizeX ; h++) {
                G4int PosXTrackID =   Pos_X_itr->first     ;
                G4double PosX     = *(Pos_X_itr->second)      ;
-               if (PosXTrackID == ETrackID) {
+               if (PosXTrackID == NTrackID) {
                   ms_InterCoord->SetDetectedPositionX(PosX) ;
                }
                Pos_X_itr++;
@@ -1032,7 +1021,7 @@ void GaspardTrackerSquare::ReadSensitive(const G4Event* event)
             for (G4int h = 0 ; h < sizeX ; h++) {
                G4int PosYTrackID =   Pos_Y_itr->first     ;
                G4double PosY     = *(Pos_Y_itr->second)      ;
-               if (PosYTrackID == ETrackID) {
+               if (PosYTrackID == NTrackID) {
                   ms_InterCoord->SetDetectedPositionY(PosY) ;
                }
                Pos_Y_itr++;
@@ -1043,7 +1032,7 @@ void GaspardTrackerSquare::ReadSensitive(const G4Event* event)
             for (G4int h = 0 ; h < sizeX ; h++) {
                G4int PosZTrackID =   Pos_Z_itr->first     ;
                G4double PosZ     = *(Pos_Z_itr->second)      ;
-               if (PosZTrackID == ETrackID) {
+               if (PosZTrackID == NTrackID) {
                   ms_InterCoord->SetDetectedPositionZ(PosZ) ;
                }
                Pos_Z_itr++;
@@ -1054,7 +1043,7 @@ void GaspardTrackerSquare::ReadSensitive(const G4Event* event)
             for (G4int h = 0 ; h < sizeX ; h++) {
                G4int AngThetaTrackID =   Ang_Theta_itr->first     ;
                G4double AngTheta     = *(Ang_Theta_itr->second)      ;
-               if (AngThetaTrackID == ETrackID) {
+               if (AngThetaTrackID == NTrackID) {
                   ms_InterCoord->SetDetectedAngleTheta(AngTheta) ;
                }
                Ang_Theta_itr++;
@@ -1065,7 +1054,7 @@ void GaspardTrackerSquare::ReadSensitive(const G4Event* event)
             for (G4int h = 0 ; h < sizeX ; h++) {
                G4int AngPhiTrackID =   Ang_Phi_itr->first     ;
                G4double AngPhi     = *(Ang_Phi_itr->second)      ;
-               if (AngPhiTrackID == ETrackID) {
+               if (AngPhiTrackID == NTrackID) {
                   ms_InterCoord->SetDetectedAnglePhi(AngPhi) ;
                }
                Ang_Phi_itr++;
@@ -1074,10 +1063,10 @@ void GaspardTrackerSquare::ReadSensitive(const G4Event* event)
             // Second Stage
                SiLiEnergy_itr = SiLiEnergyHitMap->GetMap()->begin() ;
                for (G4int h = 0 ; h < SiLiEnergyHitMap->entries() ; h++) {
-                  G4int SiLiEnergyTrackID =   SiLiEnergy_itr->first  ;
-                  G4double SiLiEnergy     = *(SiLiEnergy_itr->second)   ;
+                  G4int SiLiEnergyTrackID =   SiLiEnergy_itr->first - N;
+                  G4double SiLiEnergy     = *(SiLiEnergy_itr->second);
 
-                  if (SiLiEnergyTrackID == ETrackID) {
+                  if (SiLiEnergyTrackID == NTrackID) {
                      ms_Event->SetGPDTrkSecondStageEEnergy(RandGauss::shoot(SiLiEnergy, ResoSecondStage)) ;
                      ms_Event->SetGPDTrkSecondStageEPadNbr(1);
                      ms_Event->SetGPDTrkSecondStageTPadNbr(1);
@@ -1092,10 +1081,10 @@ void GaspardTrackerSquare::ReadSensitive(const G4Event* event)
             // Third Stage
                ThirdStageEnergy_itr = ThirdStageEnergyHitMap->GetMap()->begin()  ;
                for (G4int h = 0 ; h < ThirdStageEnergyHitMap->entries() ; h++) {
-                  G4int ThirdStageEnergyTrackID  =   ThirdStageEnergy_itr->first      ;
+                  G4int ThirdStageEnergyTrackID  =   ThirdStageEnergy_itr->first - N;
                   G4double ThirdStageEnergy      = *(ThirdStageEnergy_itr->second)    ;
 
-                  if (ThirdStageEnergyTrackID == ETrackID) {
+                  if (ThirdStageEnergyTrackID == NTrackID) {
                      ms_Event->SetGPDTrkThirdStageEEnergy(RandGauss::shoot(ThirdStageEnergy, ResoThirdStage));
                      ms_Event->SetGPDTrkThirdStageEPadNbr(1);
                      ms_Event->SetGPDTrkThirdStageTPadNbr(1);
@@ -1107,9 +1096,9 @@ void GaspardTrackerSquare::ReadSensitive(const G4Event* event)
                   ThirdStageEnergy_itr++;
                }
 
-         Energy_itr++;
-         if (checkSi) HitNumber++ ;
+         DetectorNumber_itr++;
       }
+
       // clear map for next event
       DetectorNumberHitMap ->clear();
       EnergyHitMap   ->clear()   ;
@@ -1132,7 +1121,7 @@ void GaspardTrackerSquare::InitializeScorers()
 {
    // First stage Associate Scorer
    m_FirstStageScorer = new G4MultiFunctionalDetector("FirstStageScorerGPDSquare");
-   G4VPrimitiveScorer* DetNbr                           = new GPDScorerDetectorNumber("DetectorNumber", 0, "Silicon");
+   G4VPrimitiveScorer* DetNbr                           = new GPDScorerDetectorNumber("DetectorNumber", 0, "G");
    G4VPrimitiveScorer* Energy                           = new GPDScorerFirstStageEnergy("StripEnergy", 0);
    G4VPrimitiveScorer* TOF                              = new PSTOF("StripTime", 0);
    G4VPrimitiveScorer* StripPositionX                   = new GPDScorerFirstStageFrontStripSquare("StripNumberX", 0, NumberOfStrips);
diff --git a/NPSimulation/src/GaspardTrackerTrapezoid.cc b/NPSimulation/src/GaspardTrackerTrapezoid.cc
index f3911bff1..6529b6286 100644
--- a/NPSimulation/src/GaspardTrackerTrapezoid.cc
+++ b/NPSimulation/src/GaspardTrackerTrapezoid.cc
@@ -9,12 +9,13 @@
  * Original Author: N. de Sereville  contact address: deserevi@ipno.in2p3.fr *
  *                                                                           *
  * Creation Date  : 15/07/09                                                 *
- * Last update    :                                                          *
+ * Last update    : 12/10/09                                                 *
  *---------------------------------------------------------------------------*
  * Decription: Define a module of trapezoidal shape for the Gaspard tracker  *
  *                                                                           *
  *---------------------------------------------------------------------------*
  * Comment:                                                                  *
+ *    + 12/10/09: Change scorer scheme (N. de Sereville)                     *
  *                                                                           *
  *                                                                           *
  *****************************************************************************/
@@ -722,13 +723,9 @@ void GaspardTrackerTrapezoid::SetInterCoordPointer(TInteractionCoordinates* inte
 // Called at in the EventAction::EndOfEventAvtion
 void GaspardTrackerTrapezoid::ReadSensitive(const G4Event* event)
 {
-   bool checkSi = false      ;
-   G4String DetectorNumber ;
-
 //////////////////////////////////////////////////////////////////////////////////////
 //////////////////////// Used to Read Event Map of detector //////////////////////////
 //////////////////////////////////////////////////////////////////////////////////////
-
    // First Stage
    std::map<G4int, G4int*>::iterator    DetectorNumber_itr;
    std::map<G4int, G4double*>::iterator Energy_itr;
@@ -758,10 +755,6 @@ void GaspardTrackerTrapezoid::ReadSensitive(const G4Event* event)
    std::map<G4int, G4double*>::iterator ThirdStageEnergy_itr;
    G4THitsMap<G4double>* ThirdStageEnergyHitMap = NULL;
 
-//////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////
-   G4int HitNumber = 0;
-   checkSi = false;
 
    // Read the Scorer associated to the first Stage
    //Detector Number
@@ -833,40 +826,36 @@ void GaspardTrackerTrapezoid::ReadSensitive(const G4Event* event)
          return;
       }
 
-      // Loop on Strip energy
-      for (G4int l = 0 ; l < sizeE ; l++) {
-         G4int ETrackID  =   Energy_itr->first     ;
-         G4double E     = *(Energy_itr->second)    ;
-         G4int N = 0;
-
-         if (E > 0) {
-            checkSi = true   ;
-            ms_Event->SetGPDTrkFirstStageFrontEEnergy(RandGauss::shoot(E, ResoFirstStage))    ;
-            ms_Event->SetGPDTrkFirstStageBackEEnergy(RandGauss::shoot(E, ResoFirstStage))    ;
-
-            //  Detector Number
-            DetectorNumber_itr = DetectorNumberHitMap->GetMap()->begin();
-            for (G4int h = 0 ; h < sizeN ; h++) {
-                G4int NTrackID  =   DetectorNumber_itr->first       ;
-                G4double Nl     = *(DetectorNumber_itr->second)      ;
-
-                if (NTrackID == ETrackID) {
-                   N = Nl ;
-                   ms_Event->SetGPDTrkFirstStageFrontEDetectorNbr(m_index["Trapezoid"] + N);
-                   ms_Event->SetGPDTrkFirstStageFrontTDetectorNbr(m_index["Trapezoid"] + N);
-                   ms_Event->SetGPDTrkFirstStageBackEDetectorNbr(m_index["Trapezoid"] + N);
-                   ms_Event->SetGPDTrkFirstStageBackTDetectorNbr(m_index["Trapezoid"] + N);
-                }
-                DetectorNumber_itr++;
+   // Loop on FirstStage number
+   for (G4int l = 0; l < sizeN; l++) {
+      G4double N     = *(DetectorNumber_itr->second);
+      G4int NTrackID =   DetectorNumber_itr->first - N;
+
+      if (N > 0) {
+         // Fill detector number
+         ms_Event->SetGPDTrkFirstStageFrontEDetectorNbr(m_index["Trapezoid"] + N);
+         ms_Event->SetGPDTrkFirstStageFrontTDetectorNbr(m_index["Trapezoid"] + N);
+         ms_Event->SetGPDTrkFirstStageBackEDetectorNbr(m_index["Trapezoid"] + N);
+         ms_Event->SetGPDTrkFirstStageBackTDetectorNbr(m_index["Trapezoid"] + N);
+
+         // Energy
+         for (G4int l = 0 ; l < sizeE ; l++) {
+            G4int ETrackID  =   Energy_itr->first - N;
+            G4double E     = *(Energy_itr->second);
+            if (ETrackID == NTrackID) {
+               ms_Event->SetGPDTrkFirstStageFrontEEnergy(RandGauss::shoot(E, ResoFirstStage));
+               ms_Event->SetGPDTrkFirstStageBackEEnergy(RandGauss::shoot(E, ResoFirstStage));
             }
+            Energy_itr++;
+         }
 
             //  Time
             Time_itr = TimeHitMap->GetMap()->begin();
             for (G4int h = 0 ; h < sizeT ; h++) {
-               G4int TTrackID  =   Time_itr->first       ;
-               G4double T     = *(Time_itr->second)      ;
+               G4int TTrackID  =   Time_itr->first - N;
+               G4double T     = *(Time_itr->second);
 
-               if (TTrackID == ETrackID) {
+               if (TTrackID == NTrackID) {
                   T = RandGauss::shoot(T, ResoTimePPAC)   ;
                   ms_Event->SetGPDTrkFirstStageFrontTTime(RandGauss::shoot(T, ResoTimeGpd)) ;
                   ms_Event->SetGPDTrkFirstStageBackTTime(RandGauss::shoot(T, ResoTimeGpd)) ;
@@ -877,9 +866,9 @@ void GaspardTrackerTrapezoid::ReadSensitive(const G4Event* event)
             // X
             X_itr = XHitMap->GetMap()->begin();
             for (G4int h = 0 ; h < sizeX ; h++) {
-               G4int XTrackID  =   X_itr->first     ;
-               G4double X     = *(X_itr->second)      ;
-               if (XTrackID == ETrackID) {
+               G4int XTrackID  =   X_itr->first - N;
+               G4double X     = *(X_itr->second);
+               if (XTrackID == NTrackID) {
                   ms_Event->SetGPDTrkFirstStageFrontEStripNbr(X);
                   ms_Event->SetGPDTrkFirstStageFrontTStripNbr(X);
                }
@@ -890,9 +879,9 @@ void GaspardTrackerTrapezoid::ReadSensitive(const G4Event* event)
             // Y
             Y_itr = YHitMap->GetMap()->begin()  ;
             for (G4int h = 0 ; h < sizeY ; h++) {
-               G4int YTrackID  =   Y_itr->first    ;
-               G4double Y     = *(Y_itr->second)      ;
-               if (YTrackID == ETrackID) {
+               G4int YTrackID  =   Y_itr->first - N;
+               G4double Y     = *(Y_itr->second);
+               if (YTrackID == NTrackID) {
                   ms_Event->SetGPDTrkFirstStageBackEStripNbr(Y);
                   ms_Event->SetGPDTrkFirstStageBackTStripNbr(Y);
                }
@@ -905,7 +894,7 @@ void GaspardTrackerTrapezoid::ReadSensitive(const G4Event* event)
             for (G4int h = 0 ; h < sizeX ; h++) {
                G4int PosXTrackID =   Pos_X_itr->first     ;
                G4double PosX     = *(Pos_X_itr->second)      ;
-               if (PosXTrackID == ETrackID) {
+               if (PosXTrackID == NTrackID) {
                   ms_InterCoord->SetDetectedPositionX(PosX) ;
                }
                Pos_X_itr++;
@@ -916,7 +905,7 @@ void GaspardTrackerTrapezoid::ReadSensitive(const G4Event* event)
             for (G4int h = 0 ; h < sizeX ; h++) {
                G4int PosYTrackID =   Pos_Y_itr->first     ;
                G4double PosY     = *(Pos_Y_itr->second)      ;
-               if (PosYTrackID == ETrackID) {
+               if (PosYTrackID == NTrackID) {
                   ms_InterCoord->SetDetectedPositionY(PosY) ;
                }
                Pos_Y_itr++;
@@ -927,7 +916,7 @@ void GaspardTrackerTrapezoid::ReadSensitive(const G4Event* event)
             for (G4int h = 0 ; h < sizeX ; h++) {
                G4int PosZTrackID =   Pos_Z_itr->first     ;
                G4double PosZ     = *(Pos_Z_itr->second)      ;
-               if (PosZTrackID == ETrackID) {
+               if (PosZTrackID == NTrackID) {
                   ms_InterCoord->SetDetectedPositionZ(PosZ) ;
                }
                Pos_Z_itr++;
@@ -938,7 +927,7 @@ void GaspardTrackerTrapezoid::ReadSensitive(const G4Event* event)
             for (G4int h = 0 ; h < sizeX ; h++) {
                G4int AngThetaTrackID =   Ang_Theta_itr->first     ;
                G4double AngTheta     = *(Ang_Theta_itr->second)      ;
-               if (AngThetaTrackID == ETrackID) {
+               if (AngThetaTrackID == NTrackID) {
                   ms_InterCoord->SetDetectedAngleTheta(AngTheta) ;
                }
                Ang_Theta_itr++;
@@ -949,7 +938,7 @@ void GaspardTrackerTrapezoid::ReadSensitive(const G4Event* event)
             for (G4int h = 0 ; h < sizeX ; h++) {
                G4int AngPhiTrackID =   Ang_Phi_itr->first     ;
                G4double AngPhi     = *(Ang_Phi_itr->second)      ;
-               if (AngPhiTrackID == ETrackID) {
+               if (AngPhiTrackID == NTrackID) {
                   ms_InterCoord->SetDetectedAnglePhi(AngPhi) ;
                }
                Ang_Phi_itr++;
@@ -960,10 +949,10 @@ void GaspardTrackerTrapezoid::ReadSensitive(const G4Event* event)
             // Third Stage
                ThirdStageEnergy_itr = ThirdStageEnergyHitMap->GetMap()->begin()  ;
                for (G4int h = 0 ; h < ThirdStageEnergyHitMap->entries() ; h++) {
-                  G4int ThirdStageEnergyTrackID  =   ThirdStageEnergy_itr->first      ;
-                  G4double ThirdStageEnergy      = *(ThirdStageEnergy_itr->second)    ;
+                  G4int ThirdStageEnergyTrackID  =   ThirdStageEnergy_itr->first - N;
+                  G4double ThirdStageEnergy      = *(ThirdStageEnergy_itr->second);
 
-                  if (ThirdStageEnergyTrackID == ETrackID) {
+                  if (ThirdStageEnergyTrackID == NTrackID) {
                      ms_Event->SetGPDTrkThirdStageEEnergy(RandGauss::shoot(ThirdStageEnergy, ResoThirdStage));
                      ms_Event->SetGPDTrkThirdStageEPadNbr(1);
                      ms_Event->SetGPDTrkThirdStageTPadNbr(1);
@@ -975,8 +964,7 @@ void GaspardTrackerTrapezoid::ReadSensitive(const G4Event* event)
                   ThirdStageEnergy_itr++;
                }
 
-         Energy_itr++;
-         if (checkSi) HitNumber++ ;
+         DetectorNumber_itr++;
       }
 
       // clear map for next event
@@ -1000,7 +988,7 @@ void GaspardTrackerTrapezoid::InitializeScorers()
 {
    // First stage Associate Scorer
    m_FirstStageScorer = new G4MultiFunctionalDetector("FirstStageScorerGPDTrapezoid");
-   G4VPrimitiveScorer* DetNbr                           = new GPDScorerDetectorNumber("DetectorNumber", 0, "Silicon");
+   G4VPrimitiveScorer* DetNbr                           = new GPDScorerDetectorNumber("DetectorNumber", 0, "G");
    G4VPrimitiveScorer* Energy                           = new GPDScorerFirstStageEnergy("StripEnergy", 0);
    G4VPrimitiveScorer* TOF                              = new PSTOF("StripTime", 0);
    G4VPrimitiveScorer* StripPositionX                   = new GPDScorerFirstStageFrontStripTrapezoid("StripNumberX", 0, NumberOfStripsX);
-- 
GitLab