diff --git a/NPAnalysis/Gaspard/Result/myResult.root b/NPAnalysis/Gaspard/Result/myResult.root index a365f49d0df5471e69c5967e89c2ee1d42372d56..bcb1fdc8205ae855312ab0620ac94bad8e67c3aa 100644 Binary files a/NPAnalysis/Gaspard/Result/myResult.root and b/NPAnalysis/Gaspard/Result/myResult.root differ diff --git a/NPAnalysis/Gaspard/src/Analysis.cc b/NPAnalysis/Gaspard/src/Analysis.cc index 202d13eef625e5c6c55eae5acc2a940436b5e699..a630f64eee8b20b78548630fe9872c9d445c5c57 100644 --- a/NPAnalysis/Gaspard/src/Analysis.cc +++ b/NPAnalysis/Gaspard/src/Analysis.cc @@ -122,6 +122,7 @@ int main(int argc,char** argv) Int_t detecXT = EventGPD->GetGPDTrkFirstStageFrontTDetectorNbr(0) / det_ref; Int_t detecYE = EventGPD->GetGPDTrkFirstStageBackEDetectorNbr(0) / det_ref; Int_t detecYT = EventGPD->GetGPDTrkFirstStageBackTDetectorNbr(0) / det_ref; + det_ref -= 1000; // for TGaspardTrackerDummyShape // case of same detector if (detecXE*detecXT*detecYE*detecYT == 1) { // calculate strip number @@ -149,7 +150,12 @@ int main(int argc,char** argv) Int_t mult2T = EventGPD->GetGPDTrkSecondStageTMult(); Int_t mult3E = EventGPD->GetGPDTrkThirdStageEMult(); Int_t mult3T = EventGPD->GetGPDTrkThirdStageTMult(); - // check if we have a 2nd or third stage event + // check if we have a 2nd stage event + if (mult2E==1 && mult2T==1) { + Double_t EnergySecond = EventGPD->GetGPDTrkSecondStageEEnergy(0); + TotalEnergy += EnergySecond; + } + // check if we have a third stage event if (mult3E==1 && mult3T==1) { Double_t EnergyThird = EventGPD->GetGPDTrkThirdStageEEnergy(0); TotalEnergy += EnergyThird; @@ -165,6 +171,7 @@ int main(int argc,char** argv) Double_t zstrip = myArray->GetStripPositionZ(det_ref, stripXE, stripYE); Hep3Vector posstrip(xstrip, ystrip, zstrip); Double_t ThetaStrip = posstrip.theta() * rad; + cout << Theta/deg << " " << ThetaStrip/deg << endl; // calculate excitation energy // Ex = myReaction->ReconstructRelativistic(TotalEnergy / MeV, Theta / rad); Ex = myReaction->ReconstructRelativistic(TotalEnergy / MeV, ThetaStrip / rad); diff --git a/NPAnalysis/Gaspard/src/GNUmakefile b/NPAnalysis/Gaspard/src/GNUmakefile index 80ba07bec3c63475686688a1f203fb47baeba8e1..51c5fef9d17ce76ec2688e1b0f19b11c285f5ab8 100644 --- a/NPAnalysis/Gaspard/src/GNUmakefile +++ b/NPAnalysis/Gaspard/src/GNUmakefile @@ -34,8 +34,6 @@ Analysis:$(OBJ) $(INC) mv Analysis ../Analysis %.o: %.cc - @echo "CXXFLAGS vaut $(CXXFLAGS)" - @echo "LDFLAGS vaut $(LDFLAGS)" @$(CPP) $(CXXFLAGS) -o $@ -c $< .PHONY: clean mrproper diff --git a/NPAnalysis/Gaspard/src/ObjectManager.hh b/NPAnalysis/Gaspard/src/ObjectManager.hh index 9f90b2a5dc4c538d683f5bf378a2ece2250c591a..3e2bd0b1deb511b91eec39ccf0d7b8102d370d5d 100644 --- a/NPAnalysis/Gaspard/src/ObjectManager.hh +++ b/NPAnalysis/Gaspard/src/ObjectManager.hh @@ -32,7 +32,7 @@ using namespace VARIABLE ; namespace GRAPH { // Declare your Spectra here: - const int NbElements = 18; + const int NbElements = 40; TH2F *hXY1 = new TH2F("hXY1","", 128 , 1 , 128 , 128 , 1 , 128 ) ; TH2F *hXY2 = new TH2F("hXY2","", 128 , 1 , 128 , 128 , 1 , 128 ) ; diff --git a/NPAnalysis/Gaspard/src/must.cc b/NPAnalysis/Gaspard/src/must.cc index dc095770c13509ca87b41ba746e4b7acb50f427a..4ccdeb7ed9e1b749e14dde0e1b5e50ca7126ca28 100644 --- a/NPAnalysis/Gaspard/src/must.cc +++ b/NPAnalysis/Gaspard/src/must.cc @@ -46,8 +46,13 @@ must::must(double theta, double phi, double distance, double beta_u , double bet distance * sin(theta) * sin(phi) , distance * cos(theta) ); + Hep3Vector Y = Hep3Vector( cos(theta) * cos(phi), + cos(theta) * sin(phi), + -sin(theta)); + W = C.unit() ; - U = W.cross( Hep3Vector (0,1,0) ) ; +// U = W.cross( Hep3Vector (0,1,0) ) ; + U = W.cross( Y ) ; V = W.cross(U); U = U.unit(); @@ -63,7 +68,8 @@ must::must(double theta, double phi, double distance, double beta_u , double bet V.rotate( W , beta_w * Pi/180. ) ; } - double Face = 98 ; //mm +// double Face = 98 ; //mm + double Face = 50 ; //mm double NumberOfStrip = 128 ; double StripPitch = Face/NumberOfStrip ; //mm diff --git a/NPSimulation/include/GaspardScorers.hh b/NPSimulation/include/GaspardScorers.hh index 2a4bc972b20b5e4960da250c4d4a0030b71274fc..28ddab1aca3d413237af5a58e331c06959496054 100644 --- a/NPSimulation/include/GaspardScorers.hh +++ b/NPSimulation/include/GaspardScorers.hh @@ -124,7 +124,7 @@ private: class GPDScorerFirstStageFrontStripDummyShape : public G4VPrimitiveScorer { public: // with description - GPDScorerFirstStageFrontStripDummyShape(G4String name, G4int depth = 0, G4double StripPlaneSize = 98, G4int NumberOfStrip = 128); + GPDScorerFirstStageFrontStripDummyShape(G4String name, G4int depth = 0, G4int NumberOfStrip = 128); virtual ~GPDScorerFirstStageFrontStripDummyShape(); protected: // with description @@ -138,7 +138,6 @@ public: virtual void PrintAll(); private: - G4double m_StripPlaneSize; G4int m_NumberOfStrip ; G4int HCID; G4THitsMap<G4double>* EvtMap; @@ -149,7 +148,7 @@ private: class GPDScorerFirstStageBackStripDummyShape : public G4VPrimitiveScorer { public: // with description - GPDScorerFirstStageBackStripDummyShape(G4String name, G4int depth = 0, G4double StripPlaneSize = 98, G4int NumberOfStrip = 128); + GPDScorerFirstStageBackStripDummyShape(G4String name, G4int depth = 0, G4int NumberOfStrip = 128); virtual ~GPDScorerFirstStageBackStripDummyShape(); protected: // with description @@ -163,7 +162,6 @@ public: virtual void PrintAll(); private: - G4double m_StripPlaneSize; G4int m_NumberOfStrip ; G4int HCID; G4THitsMap<G4double>* EvtMap; @@ -174,7 +172,7 @@ private: class GPDScorerFirstStageFrontStripSquare : public G4VPrimitiveScorer { public: // with description - GPDScorerFirstStageFrontStripSquare(G4String name, G4int depth = 0, G4double StripPlaneSize = 98, G4int NumberOfStrip = 128); + GPDScorerFirstStageFrontStripSquare(G4String name, G4int depth = 0, G4int NumberOfStrip = 128); virtual ~GPDScorerFirstStageFrontStripSquare(); protected: // with description @@ -188,7 +186,6 @@ public: virtual void PrintAll(); private: - G4double m_StripPlaneSize; G4int m_NumberOfStrip ; G4int HCID; G4THitsMap<G4double>* EvtMap; @@ -199,7 +196,7 @@ private: class GPDScorerFirstStageBackStripSquare : public G4VPrimitiveScorer { public: // with description - GPDScorerFirstStageBackStripSquare(G4String name, G4int depth = 0, G4double StripPlaneSize = 98, G4int NumberOfStrip = 128); + GPDScorerFirstStageBackStripSquare(G4String name, G4int depth = 0, G4int NumberOfStrip = 128); virtual ~GPDScorerFirstStageBackStripSquare(); protected: // with description @@ -213,7 +210,6 @@ public: virtual void PrintAll(); private: - G4double m_StripPlaneSize; G4int m_NumberOfStrip ; G4int HCID; G4THitsMap<G4double>* EvtMap; diff --git a/NPSimulation/src/GaspardScorers.cc b/NPSimulation/src/GaspardScorers.cc index 156ccf9fa27c6d72a89b16dafb42937283404e8d..8ece0f60b46b3bdf2bfcaacb0b145528e1fdce63 100644 --- a/NPSimulation/src/GaspardScorers.cc +++ b/NPSimulation/src/GaspardScorers.cc @@ -288,10 +288,9 @@ void GPDScorerDetectorNumber::PrintAll() //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... // FirstStage Front Strip position Scorer for DummyShape geometry -GPDScorerFirstStageFrontStripDummyShape::GPDScorerFirstStageFrontStripDummyShape(G4String name, G4int depth, G4double StripPlaneSize, G4int NumberOfStrip) +GPDScorerFirstStageFrontStripDummyShape::GPDScorerFirstStageFrontStripDummyShape(G4String name, G4int depth, G4int NumberOfStrip) : G4VPrimitiveScorer(name, depth), HCID(-1) { - m_StripPlaneSize = StripPlaneSize ; m_NumberOfStrip = NumberOfStrip ; } @@ -304,12 +303,13 @@ G4bool GPDScorerFirstStageFrontStripDummyShape::ProcessHits(G4Step* aStep, G4Tou G4ThreeVector POS = aStep->GetPreStepPoint()->GetPosition(); POS = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(POS); - G4double StripPitch = m_StripPlaneSize / m_NumberOfStrip; + G4double StripPitch = GPDDUMMYSHAPE::FirstStageFace / m_NumberOfStrip; - G4double temp = (POS(0) + m_StripPlaneSize / 2.) / StripPitch ; + G4double temp = (POS(0) + GPDDUMMYSHAPE::FirstStageFace / 2.) / StripPitch ; G4double X = int(temp) + 1 ; + //Rare case where particle is close to edge of silicon plan - if (X == 129) X = 128; + if (X == m_NumberOfStrip+1) X = m_NumberOfStrip; G4double edep = aStep->GetTotalEnergyDeposit(); if (edep < 100*keV) return FALSE; G4int index = aStep->GetTrack()->GetTrackID(); @@ -350,10 +350,9 @@ void GPDScorerFirstStageFrontStripDummyShape::PrintAll() //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... // FirstStage Back Strip position Scorer for DummyShape geometry -GPDScorerFirstStageBackStripDummyShape::GPDScorerFirstStageBackStripDummyShape(G4String name, G4int depth, G4double StripPlaneSize, G4int NumberOfStrip) +GPDScorerFirstStageBackStripDummyShape::GPDScorerFirstStageBackStripDummyShape(G4String name, G4int depth, G4int NumberOfStrip) : G4VPrimitiveScorer(name, depth), HCID(-1) { - m_StripPlaneSize = StripPlaneSize ; m_NumberOfStrip = NumberOfStrip ; } @@ -366,12 +365,12 @@ G4bool GPDScorerFirstStageBackStripDummyShape::ProcessHits(G4Step* aStep, G4Touc G4ThreeVector POS = aStep->GetPreStepPoint()->GetPosition(); POS = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(POS); - G4double StripPitch = m_StripPlaneSize / m_NumberOfStrip; + G4double StripPitch = GPDDUMMYSHAPE::FirstStageFace / m_NumberOfStrip; - G4double temp = (POS(0) + m_StripPlaneSize / 2.) / StripPitch ; + G4double temp = (POS(1) + GPDDUMMYSHAPE::FirstStageFace / 2.) / StripPitch ; G4double X = int(temp) + 1 ; //Rare case where particle is close to edge of silicon plan - if (X == 129) X = 128; + if (X == m_NumberOfStrip+1) X = m_NumberOfStrip; G4double edep = aStep->GetTotalEnergyDeposit(); if (edep < 100*keV) return FALSE; G4int index = aStep->GetTrack()->GetTrackID(); @@ -412,10 +411,9 @@ void GPDScorerFirstStageBackStripDummyShape::PrintAll() //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... // FirstStage Front Strip position Scorer for Square geometry -GPDScorerFirstStageFrontStripSquare::GPDScorerFirstStageFrontStripSquare(G4String name, G4int depth, G4double StripPlaneSize, G4int NumberOfStrip) +GPDScorerFirstStageFrontStripSquare::GPDScorerFirstStageFrontStripSquare(G4String name, G4int depth, G4int NumberOfStrip) : G4VPrimitiveScorer(name, depth), HCID(-1) { - m_StripPlaneSize = StripPlaneSize ; m_NumberOfStrip = NumberOfStrip ; } @@ -428,9 +426,9 @@ G4bool GPDScorerFirstStageFrontStripSquare::ProcessHits(G4Step* aStep, G4Touchab G4ThreeVector POS = aStep->GetPreStepPoint()->GetPosition(); POS = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(POS); - G4double StripPitch = m_StripPlaneSize / m_NumberOfStrip; + G4double StripPitch = GPDSQUARE::SiliconFace / m_NumberOfStrip; - G4double temp = (POS(0) + m_StripPlaneSize / 2.) / StripPitch ; + G4double temp = (POS(0) + GPDSQUARE::SiliconFace / 2.) / StripPitch ; G4double X = int(temp) + 1 ; //Rare case where particle is close to edge of silicon plan if (X == 129) X = 128; @@ -473,10 +471,9 @@ void GPDScorerFirstStageFrontStripSquare::PrintAll() //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... // FirstStage Back Strip position Scorer for Square geometry -GPDScorerFirstStageBackStripSquare::GPDScorerFirstStageBackStripSquare(G4String name, G4int depth, G4double StripPlaneSize, G4int NumberOfStrip) +GPDScorerFirstStageBackStripSquare::GPDScorerFirstStageBackStripSquare(G4String name, G4int depth, G4int NumberOfStrip) : G4VPrimitiveScorer(name, depth), HCID(-1) { - m_StripPlaneSize = StripPlaneSize ; m_NumberOfStrip = NumberOfStrip ; } @@ -489,9 +486,9 @@ G4bool GPDScorerFirstStageBackStripSquare::ProcessHits(G4Step* aStep, G4Touchabl G4ThreeVector POS = aStep->GetPreStepPoint()->GetPosition(); POS = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(POS); - G4double StripPitch = m_StripPlaneSize / m_NumberOfStrip; + G4double StripPitch = GPDSQUARE::SiliconFace / m_NumberOfStrip; - G4double temp = (POS(1) + m_StripPlaneSize / 2.) / StripPitch ; + G4double temp = (POS(1) + GPDSQUARE::SiliconFace / 2.) / StripPitch ; G4int temp2 = temp ; G4double Y = temp2 + 1 ; //Rare case where particle is close to edge of silicon plan diff --git a/NPSimulation/src/GaspardTrackerDummyShape.cc b/NPSimulation/src/GaspardTrackerDummyShape.cc index e493a4bea9b8fc81e3765d6f07693b95eb0b6a6d..952288afb5f54a597ed6667c431366fd0f34f1ef 100644 --- a/NPSimulation/src/GaspardTrackerDummyShape.cc +++ b/NPSimulation/src/GaspardTrackerDummyShape.cc @@ -939,8 +939,8 @@ void GaspardTrackerDummyShape::InitializeScorers() G4VPrimitiveScorer* DetNbr = new GPDScorerDetectorNumber("DetectorNumber", 0, "FirstStage"); G4VPrimitiveScorer* Energy = new GPDScorerFirstStageEnergy("StripEnergy", 0); G4VPrimitiveScorer* TOF = new PSTOF("StripTime", 0); - G4VPrimitiveScorer* StripPositionX = new GPDScorerFirstStageFrontStripDummyShape("StripIDFront", 0, FirstStageFace, 128); - G4VPrimitiveScorer* StripPositionY = new GPDScorerFirstStageBackStripDummyShape("StripIDBack", 0, FirstStageFace, 128); + G4VPrimitiveScorer* StripPositionX = new GPDScorerFirstStageFrontStripDummyShape("StripIDFront", 0, 128); + G4VPrimitiveScorer* StripPositionY = new GPDScorerFirstStageBackStripDummyShape("StripIDBack", 0, 128); G4VPrimitiveScorer* InteractionCoordinatesX = new PSInteractionCoordinatesX("InterCoordX", 0); G4VPrimitiveScorer* InteractionCoordinatesY = new PSInteractionCoordinatesY("InterCoordY", 0); G4VPrimitiveScorer* InteractionCoordinatesZ = new PSInteractionCoordinatesZ("InterCoordZ", 0); diff --git a/NPSimulation/src/GaspardTrackerSquare.cc b/NPSimulation/src/GaspardTrackerSquare.cc index bd1ca6b154de05b541a08d33884dd75c30346182..16ccb0afd78b67a9a95378d2f27896133a255727 100644 --- a/NPSimulation/src/GaspardTrackerSquare.cc +++ b/NPSimulation/src/GaspardTrackerSquare.cc @@ -1139,8 +1139,8 @@ void GaspardTrackerSquare::InitializeScorers() G4VPrimitiveScorer* DetNbr = new GPDScorerDetectorNumber("DetectorNumber", 0, "Silicon"); G4VPrimitiveScorer* Energy = new GPDScorerFirstStageEnergy("StripEnergy", 0); G4VPrimitiveScorer* TOF = new PSTOF("StripTime", 0); - G4VPrimitiveScorer* StripPositionX = new GPDScorerFirstStageFrontStripSquare("StripNumberX", 0, SiliconFace, 128); - G4VPrimitiveScorer* StripPositionY = new GPDScorerFirstStageBackStripSquare("StripNumberY", 0, SiliconFace, 128); + G4VPrimitiveScorer* StripPositionX = new GPDScorerFirstStageFrontStripSquare("StripNumberX", 0, 128); + G4VPrimitiveScorer* StripPositionY = new GPDScorerFirstStageBackStripSquare("StripNumberY", 0, 128); G4VPrimitiveScorer* InteractionCoordinatesX = new PSInteractionCoordinatesX("InterCoordX", 0); G4VPrimitiveScorer* InteractionCoordinatesY = new PSInteractionCoordinatesY("InterCoordY", 0); G4VPrimitiveScorer* InteractionCoordinatesZ = new PSInteractionCoordinatesZ("InterCoordZ", 0);