Import Geant4 10.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-12-09 12:35:28 +01:00
parent 4ec577e5c4
commit a3452e42ac
3514 changed files with 210500 additions and 89628 deletions
@@ -20,17 +20,17 @@ example FORTRAN code of PYTHIA for generating this event sample.
\section RE05_s2 Readout geometry
RE05DetectorConstruction defines a simplified collider detecor
geometry, tracker made of cylindrical tubes, calorimeter made of
geometry, a tracker made of cylindrical tubes, a calorimeter made of
cylindrical tubes, and muon trackers made of planes.
Cylindrical calorimeter is made of tubes of lead and scintirator
without cut in phi nor z direction. Energy deposition in scintirator
is accumurated by RE05CalorimeterSD sensitive detector, which has
a readout geometry to find the phi-z cell.
The cylindrical calorimeter is made of tubes of lead and a scintillator.
Energy deposition in the scintillator is accumulated by RE05CalorimeterSD
sensitive detector, which is assigned to a dedicated parallel world,
RE05CalorimeterParallelWorld, which defines the phi-z cell.
\section RE05_s3 Physics processes
The example uses the QGSP physics list, which includes electromagnetic
The example uses the QBBC physics list, which includes electromagnetic
and hadronic interactions.
\section RE05_s4 Event filtering by the stacking mechanism
+9 -1
View File
@@ -1,4 +1,4 @@
$Id: History 83391 2014-08-21 14:35:11Z gcosmo $
$Id: History 101676 2016-11-21 09:25:51Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,14 @@ track of all tags.
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
19-11-16 A. Dotti (exampleRE05-V10-02-01)
- Explicit setting of SD to manager
19-07-16 I. Hrivnacova (exampleRE05-V10-02-00)
- Coding guidelines and code clean-up
- Renamed RE05CalorimeterROGeometry in E05CalorimeterParallelWorld
- Updated README
18-08-14 M.Asai (exampleRE05-V10-00-00)
- Reduce the amount of print-out.
+7 -6
View File
@@ -1,4 +1,4 @@
$Id: README 66516 2012-12-19 10:47:25Z ihrivnac $
$Id: README 98775 2016-08-09 14:30:39Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -25,14 +25,15 @@ example FORTRAN code of PYTHIA for generating this event sample.
RE05DetectorConstruction defines a simplified collider detecor
geometry, tracker made of cylindrical tubes, calorimeter made of
cylindrical tubes, and muon trackers made of planes.
Cylindrical calorimeter is made of tubes of lead and scintirator
without cut in phi nor z direction. Energy deposition in scintirator
is accumurated by RE05CalorimeterSD sensitive detector, which has
a readout geometry to find the phi-z cell.
The cylindrical calorimeter is made of tubes of lead and a scintillator.
Energy deposition in the scintillator is accumulated by RE05CalorimeterSD
sensitive detector, which is assigned to a dedicated parallel world,
RE05CalorimeterParallelWorld, which defines the phi-z cell.
3. Physics processes
The example uses the QGSP physics list, which includes electromagnetic
The example uses the QBBC physics list, which includes electromagnetic
and hadronic interactions.
4. Event filtering by the stacking mechanism.
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: exampleRE05.cc 69920 2013-05-17 13:36:37Z gcosmo $
// $Id: exampleRE05.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/exampleRE05.cc
/// \brief Main program of the RE05 example
@@ -43,7 +43,7 @@
#include "G4UImanager.hh"
#include "RE05DetectorConstruction.hh"
#include "RE05CalorimeterROGeometry.hh"
#include "RE05CalorimeterParallelWorld.hh"
#include "QBBC.hh"
#include "G4ParallelWorldPhysics.hh"
#include "RE05ActionInitialization.hh"
@@ -74,7 +74,7 @@ int main(int argc,char** argv)
//
G4VUserDetectorConstruction* detector = new RE05DetectorConstruction();
detector->RegisterParallelWorld
(new RE05CalorimeterROGeometry(parallelWorldName));
(new RE05CalorimeterParallelWorld(parallelWorldName));
runManager->SetUserInitialization(detector);
//
G4VModularPhysicsList* physicsList = new QBBC;
File diff suppressed because it is too large Load Diff
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05CalorimeterHit.hh 69764 2013-05-14 09:59:36Z gcosmo $
// $Id: RE05CalorimeterHit.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05CalorimeterHit.hh
/// \brief Definition of the RE05CalorimeterHit class
@@ -63,38 +63,38 @@ class RE05CalorimeterHit : public G4VHit
virtual void Print();
private:
G4int ZCellID;
G4int PhiCellID;
G4double edep;
G4ThreeVector pos;
G4RotationMatrix rot;
const G4LogicalVolume* pLogV;
G4int fZCellID;
G4int fPhiCellID;
G4double fEdep;
G4ThreeVector fPos;
G4RotationMatrix fRot;
const G4LogicalVolume* fLogV;
static std::map<G4String,G4AttDef> fAttDefs;
public:
inline void SetCellID(G4int z,G4int phi)
{
ZCellID = z;
PhiCellID = phi;
fZCellID = z;
fPhiCellID = phi;
}
inline G4int GetZ() { return ZCellID; }
inline G4int GetPhi() { return PhiCellID; }
inline G4int GetZ() { return fZCellID; }
inline G4int GetPhi() { return fPhiCellID; }
inline void SetEdep(G4double de)
{ edep = de; }
{ fEdep = de; }
inline void AddEdep(G4double de)
{ edep += de; }
{ fEdep += de; }
inline G4double GetEdep()
{ return edep; }
{ return fEdep; }
inline void SetPos(G4ThreeVector xyz)
{ pos = xyz; }
{ fPos = xyz; }
inline G4ThreeVector GetPos()
{ return pos; }
{ return fPos; }
inline void SetRot(G4RotationMatrix rmat)
{ rot = rmat; }
{ fRot = rmat; }
inline G4RotationMatrix GetRot()
{ return rot; }
{ return fRot; }
inline const G4LogicalVolume * GetLogV()
{ return pLogV; }
{ return fLogV; }
};
@@ -115,5 +115,3 @@ inline void RE05CalorimeterHit::operator delete(void *aHit)
}
#endif
@@ -0,0 +1,52 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05CalorimeterParallelWorld.hh 68698 2013-04-05 08:41:22Z gcosmo $
//
/// \file RE05/include/RE05CalorimeterParallelWorld.hh
/// \brief Definition of the RE05CalorimeterParallelWorld class
//
#ifndef RE05CalorimeterParallelWorld_h
#define RE05CalorimeterParallelWorld_h 1
#include "G4VUserParallelWorld.hh"
class RE05CalorimeterParallelWorld : public G4VUserParallelWorld
{
public:
RE05CalorimeterParallelWorld(G4String& parallelWorldName);
virtual ~RE05CalorimeterParallelWorld();
public:
virtual void Construct();
virtual void ConstructSD();
private:
#include "RE05DetectorParameterDef.hh"
};
#endif
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05CalorimeterParametrisation.hh 73444 2013-08-27 11:28:21Z gcosmo $
// $Id: RE05CalorimeterParametrisation.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05CalorimeterParametrisation.hh
/// \brief Definition of the RE05CalorimeterParametrisation class
@@ -59,37 +59,37 @@ class RE05CalorimeterParametrisation : public G4VPVParameterisation
RE05CalorimeterParametrisation();
~RE05CalorimeterParametrisation();
void ComputeTransformation(const G4int copyNo,
G4VPhysicalVolume *physVol) const;
void ComputeDimensions(G4Tubs & calorimeterLayer,
virtual void ComputeTransformation(const G4int copyNo,
G4VPhysicalVolume *physVol) const;
virtual void ComputeDimensions(G4Tubs & calorimeterLayer,
const G4int copyNo,
const G4VPhysicalVolume * physVol) const;
private: // Dummy declarations to get rid of warnings ...
void ComputeDimensions (G4Trd&,const G4int,
virtual void ComputeDimensions (G4Trd&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Trap&,const G4int,
virtual void ComputeDimensions (G4Trap&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Cons&,const G4int,
virtual void ComputeDimensions (G4Cons&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Orb&,const G4int,
virtual void ComputeDimensions (G4Orb&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Sphere&,const G4int,
virtual void ComputeDimensions (G4Sphere&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Ellipsoid&,const G4int,
virtual void ComputeDimensions (G4Ellipsoid&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Torus&,const G4int,
virtual void ComputeDimensions (G4Torus&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Para&,const G4int,
virtual void ComputeDimensions (G4Para&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Hype&,const G4int,
virtual void ComputeDimensions (G4Hype&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Box&,const G4int,
virtual void ComputeDimensions (G4Box&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Polycone&,const G4int,
virtual void ComputeDimensions (G4Polycone&,const G4int,
const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Polyhedra&,const G4int,
virtual void ComputeDimensions (G4Polyhedra&,const G4int,
const G4VPhysicalVolume*) const {}
private:
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05CalorimeterSD.hh 68698 2013-04-05 08:41:22Z gcosmo $
// $Id: RE05CalorimeterSD.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05CalorimeterSD.hh
/// \brief Definition of the RE05CalorimeterSD class
@@ -40,7 +40,6 @@ class G4TouchableHistory;
class RE05CalorimeterSD : public G4VSensitiveDetector
{
public:
RE05CalorimeterSD(G4String name);
virtual ~RE05CalorimeterSD();
@@ -53,14 +52,10 @@ class RE05CalorimeterSD : public G4VSensitiveDetector
virtual void PrintAll();
private:
RE05CalorimeterHitsCollection *CalCollection;
int CellID[20][48];
const int numberOfCellsInZ;
const int numberOfCellsInPhi;
RE05CalorimeterHitsCollection *fCalCollection;
G4int fCellID[20][48];
const G4int fNumberOfCellsInZ;
const G4int fNumberOfCellsInPhi;
};
#endif
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05DetectorConstruction.hh 69764 2013-05-14 09:59:36Z gcosmo $
// $Id: RE05DetectorConstruction.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05DetectorConstruction.hh
/// \brief Definition of the RE05DetectorConstruction class
@@ -54,18 +54,11 @@ class RE05DetectorConstruction : public G4VUserDetectorConstruction
#include "RE05DetectorParameterDef.hh"
G4Material* Air;
G4Material* Ar;
G4Material* Silicon;
G4Material* Scinti;
G4Material* Lead;
G4Element* H;
G4Element* C;
G4Element* N;
G4Element* O;
G4Material* fAir;
G4Material* fAr;
G4Material* fSilicon;
G4Material* fScinti;
G4Material* fLead;
};
#endif
@@ -23,55 +23,53 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05DetectorParameterDef.hh 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05DetectorParameterDef.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05DetectorParameterDef.hh
/// \brief Definition of the RE05DetectorParameterDef class
//
G4double expHall_x;
G4double expHall_y;
G4double expHall_z;
G4double fExpHall_x;
G4double fExpHall_y;
G4double fExpHall_z;
G4double trkTubs_rmax;
G4double trkTubs_rmin;
G4double trkTubs_dz;
G4double trkTubs_sphi;
G4double trkTubs_dphi;
G4double fTrkTubs_rmax;
G4double fTrkTubs_rmin;
G4double fTrkTubs_dz;
G4double fTrkTubs_sphi;
G4double fTrkTubs_dphi;
G4int notrkLayers;
G4double tracker_radius[5];
G4double tracker_thick;
G4double tracker_length[5];
G4int fNotrkLayers;
G4double fTracker_radius[5];
G4double fTracker_thick;
G4double fTracker_length[5];
G4double caloTubs_rmax;
G4double caloTubs_rmin;
G4double caloTubs_dz;
G4double caloTubs_sphi;
G4double caloTubs_dphi;
G4double fCaloTubs_rmax;
G4double fCaloTubs_rmin;
G4double fCaloTubs_dz;
G4double fCaloTubs_sphi;
G4double fCaloTubs_dphi;
G4int nocaloLayers;
G4double absorber_thick;
G4double scinti_thick;
G4int fNocaloLayers;
G4double fAbsorber_thick;
G4double fScinti_thick;
G4int segmentsinZ;
G4double caloRing_rmax;
G4double caloRing_rmin;
G4double caloRing_dz;
G4double caloRing_sphi;
G4double caloRing_dphi;
G4int segmentsinPhi;
G4double caloCell_rmax;
G4double caloCell_rmin;
G4double caloCell_dz;
G4double caloCell_sphi;
G4double caloCell_dphi;
G4int nomucounter;
G4double muBox_radius;
G4double muBox_width;
G4double muBox_thick;
G4double muBox_length;
G4int fSegmentsinZ;
G4double fCaloRing_rmax;
G4double fCaloRing_rmin;
G4double fCaloRing_dz;
G4double fCaloRing_sphi;
G4double fCaloRing_dphi;
G4int fSegmentsinPhi;
G4double fCaloCell_rmax;
G4double fCaloCell_rmin;
G4double fCaloCell_dz;
G4double fCaloCell_sphi;
G4double fCaloCell_dphi;
G4int fNomucounter;
G4double fMuBox_radius;
G4double fMuBox_width;
G4double fMuBox_thick;
G4double fMuBox_length;
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05EventAction.hh 68698 2013-04-05 08:41:22Z gcosmo $
// $Id: RE05EventAction.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05EventAction.hh
/// \brief Definition of the RE05EventAction class
@@ -46,9 +46,9 @@ class RE05EventAction : public G4UserEventAction
virtual void EndOfEventAction(const G4Event*);
private:
G4int trackerCollID;
G4int calorimeterCollID;
G4int muonCollID;
G4int fTrackerCollID;
G4int fCalorimeterCollID;
G4int fMuonCollID;
};
#endif
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05Field.hh 68698 2013-04-05 08:41:22Z gcosmo $
// $Id: RE05Field.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05Field.hh
/// \brief Definition of the RE05Field class
@@ -45,9 +45,9 @@ class RE05Field : public G4MagneticField
double *Bfield ) const;
private:
G4double Bz;
G4double rmax_sq;
G4double zmax;
G4double fBz;
G4double fRmax_sq;
G4double fZmax;
};
#endif
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05MuonHit.hh 69764 2013-05-14 09:59:36Z gcosmo $
// $Id: RE05MuonHit.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05MuonHit.hh
/// \brief Definition of the RE05MuonHit class
@@ -50,7 +50,6 @@ class RE05MuonHit : public G4VHit
const RE05MuonHit& operator=(const RE05MuonHit &right);
G4int operator==(const RE05MuonHit &right) const;
inline void *operator new(size_t);
inline void operator delete(void *aHit);
@@ -60,22 +59,21 @@ class RE05MuonHit : public G4VHit
virtual void Print();
private:
G4double edep;
G4ThreeVector pos;
G4double fEdep;
G4ThreeVector fPos;
static std::map<G4String,G4AttDef> fAttDefs;
public:
inline void SetEdep(G4double de)
{ edep = de; }
{ fEdep = de; }
inline void AddEdep(G4double de)
{ edep += de; }
{ fEdep += de; }
inline G4double GetEdep()
{ return edep; }
{ return fEdep; }
inline void SetPos(G4ThreeVector xyz)
{ pos = xyz; }
{ fPos = xyz; }
inline G4ThreeVector GetPos()
{ return pos; }
{ return fPos; }
};
typedef G4THitsCollection<RE05MuonHit> RE05MuonHitsCollection;
@@ -94,5 +92,3 @@ inline void RE05MuonHit::operator delete(void *aHit)
}
#endif
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05MuonSD.hh 68698 2013-04-05 08:41:22Z gcosmo $
// $Id: RE05MuonSD.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05MuonSD.hh
/// \brief Definition of the RE05MuonSD class
@@ -53,13 +53,8 @@ class RE05MuonSD : public G4VSensitiveDetector
virtual void PrintAll();
private:
RE05MuonHitsCollection * muonCollection;
G4double positionResolution;
RE05MuonHitsCollection* fMuonCollection;
G4double fPositionResolution;
};
#endif
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05PrimaryGeneratorAction.hh 69764 2013-05-14 09:59:36Z gcosmo $
// $Id: RE05PrimaryGeneratorAction.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05PrimaryGeneratorAction.hh
/// \brief Definition of the RE05PrimaryGeneratorAction class
@@ -49,18 +49,16 @@ class RE05PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
virtual void GeneratePrimaries(G4Event* anEvent);
private:
static G4VPrimaryGenerator* HEPEvt;
G4VPrimaryGenerator* particleGun;
RE05PrimaryGeneratorMessenger* messenger;
G4bool useHEPEvt;
static G4VPrimaryGenerator* fHEPEvt;
G4VPrimaryGenerator* fParticleGun;
RE05PrimaryGeneratorMessenger* fMessenger;
G4bool fUseHEPEvt;
public:
inline void SetHEPEvtGenerator(G4bool f)
{ useHEPEvt = f; }
inline void SetHEPEvtGenerator(G4bool option)
{ fUseHEPEvt = option; }
inline G4bool GetHEPEvtGenerator()
{ return useHEPEvt; }
{ return fUseHEPEvt; }
};
#endif
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05PrimaryGeneratorMessenger.hh 68698 2013-04-05 08:41:22Z gcosmo $
// $Id: RE05PrimaryGeneratorMessenger.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05PrimaryGeneratorMessenger.hh
/// \brief Definition of the RE05PrimaryGeneratorMessenger class
@@ -50,14 +50,11 @@ class RE05PrimaryGeneratorMessenger: public G4UImessenger
virtual G4String GetCurrentValue(G4UIcommand * command);
private:
RE05PrimaryGeneratorAction * myAction;
private: //commands
G4UIdirectory * mydetDirectory;
G4UIcmdWithAString * genCmd;
RE05PrimaryGeneratorAction * fMyAction;
//commands
G4UIdirectory * fMydetDirectory;
G4UIcmdWithAString * fGenCmd;
};
#endif
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05RunAction.hh 68698 2013-04-05 08:41:22Z gcosmo $
// $Id: RE05RunAction.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05RunAction.hh
/// \brief Definition of the RE05RunAction class
@@ -36,7 +36,6 @@
#define RE05RunAction_h 1
#include "G4UserRunAction.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -55,8 +54,3 @@ class RE05RunAction : public G4UserRunAction
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05StackingAction.hh 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05StackingAction.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05StackingAction.hh
/// \brief Definition of the RE05StackingAction class
@@ -57,26 +57,25 @@ class RE05StackingAction : public G4UserStackingAction
G4bool InsideRoI(const G4Track * aTrack,G4double ang);
G4VHitsCollection* GetCollection(G4String colName);
RE05TrackerHitsCollection* trkHits;
RE05MuonHitsCollection* muonHits;
RE05StackingActionMessenger* theMessenger;
RE05TrackerHitsCollection* fTrkHits;
RE05MuonHitsCollection* fMuonHits;
RE05StackingActionMessenger* fMessenger;
G4int stage;
G4int reqMuon;
G4int reqIsoMuon;
G4int reqIso;
G4double angRoI;
G4int fStage;
G4int fReqMuon;
G4int fReqIsoMuon;
G4int fReqIso;
G4double fAngRoI;
public:
inline void SetNRequestMuon(G4int val) { reqMuon = val; }
inline G4int GetNRequestMuon() const { return reqMuon; }
inline void SetNRequestIsoMuon(G4int val) { reqIsoMuon = val; }
inline G4int GetNRequestIsoMuon() const { return reqIsoMuon; }
inline void SetNIsolation(G4int val) { reqIso = val; }
inline G4int GetNIsolation() const { return reqIso; }
inline void SetRoIAngle(G4double val) { angRoI = val; }
inline G4double GetRoIAngle() const { return angRoI; }
inline void SetNRequestMuon(G4int val) { fReqMuon = val; }
inline G4int GetNRequestMuon() const { return fReqMuon; }
inline void SetNRequestIsoMuon(G4int val) { fReqIsoMuon = val; }
inline G4int GetNRequestIsoMuon() const { return fReqIsoMuon; }
inline void SetNIsolation(G4int val) { fReqIso = val; }
inline G4int GetNIsolation() const { return fReqIso; }
inline void SetRoIAngle(G4double val) { fAngRoI = val; }
inline G4double GetRoIAngle() const { return fAngRoI; }
};
#endif
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05StackingActionMessenger.hh 68698 2013-04-05 08:41:22Z gcosmo $
// $Id: RE05StackingActionMessenger.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05StackingActionMessenger.hh
/// \brief Definition of the RE05StackingActionMessenger class
@@ -50,16 +50,13 @@ class RE05StackingActionMessenger: public G4UImessenger
virtual G4String GetCurrentValue(G4UIcommand * command);
private:
RE05StackingAction * myAction;
private: //commands
G4UIcmdWithAnInteger * muonCmd;
G4UIcmdWithAnInteger * isomuonCmd;
G4UIcmdWithAnInteger * isoCmd;
G4UIcmdWithADoubleAndUnit * roiCmd;
RE05StackingAction * fMyAction;
//commands
G4UIcmdWithAnInteger* fMuonCmd;
G4UIcmdWithAnInteger* fIsoMuonCmd;
G4UIcmdWithAnInteger* fIsoCmd;
G4UIcmdWithADoubleAndUnit* fRoiCmd;
};
#endif
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05SteppingAction.hh 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05SteppingAction.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05SteppingAction.hh
/// \brief Definition of the RE05SteppingAction class
@@ -45,4 +45,3 @@ class RE05SteppingAction : public G4UserSteppingAction
};
#endif
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05SteppingVerbose.hh 66521 2012-12-19 12:22:01Z ihrivnac $
// $Id: RE05SteppingVerbose.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05SteppingVerbose.hh
/// \brief Definition of the RE05SteppingVerbose class
@@ -54,7 +54,6 @@ class RE05SteppingVerbose : public G4SteppingVerbose
void StepInfo();
void TrackingStarted();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05TrackerHit.hh 69764 2013-05-14 09:59:36Z gcosmo $
// $Id: RE05TrackerHit.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05TrackerHit.hh
/// \brief Definition of the RE05TrackerHit class
@@ -59,20 +59,19 @@ class RE05TrackerHit : public G4VHit
virtual void Print();
private:
G4double edep;
G4ThreeVector pos;
G4double fEdep;
G4ThreeVector fPos;
static std::map<G4String,G4AttDef> fAttDefs;
public:
inline void SetEdep(G4double de)
{ edep = de; }
{ fEdep = de; }
inline G4double GetEdep()
{ return edep; }
{ return fEdep; }
inline void SetPos(G4ThreeVector xyz)
{ pos = xyz; }
{ fPos = xyz; }
inline G4ThreeVector GetPos()
{ return pos; }
{ return fPos; }
};
typedef G4THitsCollection<RE05TrackerHit> RE05TrackerHitsCollection;
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05TrackerParametrisation.hh 73444 2013-08-27 11:28:21Z gcosmo $
// $Id: RE05TrackerParametrisation.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05TrackerParametrisation.hh
/// \brief Definition of the RE05TrackerParametrisation class
@@ -59,26 +59,26 @@ class RE05TrackerParametrisation : public G4VPVParameterisation
RE05TrackerParametrisation();
~RE05TrackerParametrisation();
void ComputeTransformation(const G4int copyNo,
virtual void ComputeTransformation(const G4int copyNo,
G4VPhysicalVolume *physVol) const;
void ComputeDimensions(G4Tubs & trackerLayer,
virtual void ComputeDimensions(G4Tubs & trackerLayer,
const G4int copyNo,
const G4VPhysicalVolume * physVol) const;
private: // Dummy declarations to get rid of warnings ...
void ComputeDimensions (G4Trd&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Trap&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Cons&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Orb&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Sphere&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Ellipsoid&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Torus&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Para&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Hype&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Box&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Polycone&,const G4int,const G4VPhysicalVolume*) const {}
void ComputeDimensions (G4Polyhedra&,const G4int,const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions (G4Trd&,const G4int,const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions (G4Trap&,const G4int,const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions (G4Cons&,const G4int,const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions (G4Orb&,const G4int,const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions (G4Sphere&,const G4int,const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions (G4Ellipsoid&,const G4int,const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions (G4Torus&,const G4int,const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions (G4Para&,const G4int,const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions (G4Hype&,const G4int,const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions (G4Box&,const G4int,const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions (G4Polycone&,const G4int,const G4VPhysicalVolume*) const {}
virtual void ComputeDimensions (G4Polyhedra&,const G4int,const G4VPhysicalVolume*) const {}
private:
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05TrackerSD.hh 68698 2013-04-05 08:41:22Z gcosmo $
// $Id: RE05TrackerSD.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05TrackerSD.hh
/// \brief Definition of the RE05TrackerSD class
@@ -40,7 +40,6 @@ class G4TouchableHistory;
class RE05TrackerSD : public G4VSensitiveDetector
{
public:
RE05TrackerSD(G4String name);
virtual ~RE05TrackerSD();
@@ -53,13 +52,7 @@ class RE05TrackerSD : public G4VSensitiveDetector
virtual void PrintAll();
private:
RE05TrackerHitsCollection *trackerCollection;
public:
RE05TrackerHitsCollection* fTrackerCollection;
};
#endif
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05TrackingAction.hh 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05TrackingAction.hh 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/include/RE05TrackingAction.hh
/// \brief Definition of the RE05TrackingAction class
@@ -34,15 +34,13 @@
#include "G4UserTrackingAction.hh"
class RE05TrackingAction : public G4UserTrackingAction {
public:
RE05TrackingAction(){};
virtual ~RE05TrackingAction(){};
RE05TrackingAction() : G4UserTrackingAction() {}
virtual ~RE05TrackingAction() {}
virtual void PreUserTrackingAction(const G4Track*);
};
#endif
@@ -46,4 +46,3 @@ class RE05WorkerInitialization : public G4UserWorkerInitialization
};
#endif
@@ -37,11 +37,18 @@
#include "RE05TrackingAction.hh"
#include "RE05SteppingAction.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05ActionInitialization::RE05ActionInitialization()
{;}
: G4VUserActionInitialization()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05ActionInitialization::~RE05ActionInitialization()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05ActionInitialization::Build() const
{
@@ -64,6 +71,8 @@ void RE05ActionInitialization::Build() const
SetUserAction(stepping_action);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05ActionInitialization::BuildForMaster() const
{
//
@@ -71,3 +80,4 @@ void RE05ActionInitialization::BuildForMaster() const
SetUserAction(run_action);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05CalorimeterHit.cc 69764 2013-05-14 09:59:36Z gcosmo $
// $Id: RE05CalorimeterHit.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05CalorimeterHit.cc
/// \brief Implementation of the RE05CalorimeterHit class
@@ -43,61 +43,80 @@
G4ThreadLocal G4Allocator<RE05CalorimeterHit>* RE05CalorimeterHitAllocator=0;
std::map<G4String,G4AttDef> RE05CalorimeterHit::fAttDefs;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05CalorimeterHit::RE05CalorimeterHit()
{pLogV=0;}
: G4VHit(),
fZCellID(-1),fPhiCellID(-1),fEdep(0.),fPos(),fRot(),fLogV(0)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05CalorimeterHit::RE05CalorimeterHit(G4LogicalVolume* logVol,G4int z,G4int phi)
: ZCellID(z), PhiCellID(phi), pLogV(logVol)
{;}
: G4VHit(),
fZCellID(z), fPhiCellID(phi),fEdep(0.),fPos(),fRot(),fLogV(logVol)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05CalorimeterHit::~RE05CalorimeterHit()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05CalorimeterHit::RE05CalorimeterHit(const RE05CalorimeterHit &right)
: G4VHit()
{
ZCellID = right.ZCellID;
PhiCellID = right.PhiCellID;
edep = right.edep;
pos = right.pos;
rot = right.rot;
pLogV = right.pLogV;
fZCellID = right.fZCellID;
fPhiCellID = right.fPhiCellID;
fEdep = right.fEdep;
fPos = right.fPos;
fRot = right.fRot;
fLogV = right.fLogV;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const RE05CalorimeterHit& RE05CalorimeterHit::operator=(const RE05CalorimeterHit &right)
{
ZCellID = right.ZCellID;
PhiCellID = right.PhiCellID;
edep = right.edep;
pos = right.pos;
rot = right.rot;
pLogV = right.pLogV;
fZCellID = right.fZCellID;
fPhiCellID = right.fPhiCellID;
fEdep = right.fEdep;
fPos = right.fPos;
fRot = right.fRot;
fLogV = right.fLogV;
return *this;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4int RE05CalorimeterHit::operator==(const RE05CalorimeterHit &right) const
{
return ((ZCellID==right.ZCellID)&&(PhiCellID==right.PhiCellID));
return ((fZCellID==right.fZCellID)&&(fPhiCellID==right.fPhiCellID));
}
std::map<G4String,G4AttDef> RE05CalorimeterHit::fAttDefs;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterHit::Draw()
{
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
if(pVVisManager)
{
G4Transform3D trans(rot,pos);
G4Transform3D trans(fRot,fPos);
G4VisAttributes attribs;
const G4VisAttributes* pVA = pLogV->GetVisAttributes();
const G4VisAttributes* pVA = fLogV->GetVisAttributes();
if(pVA) attribs = *pVA;
G4Colour colour(1.,0.,0.);
attribs.SetColour(colour);
attribs.SetForceSolid(true);
pVVisManager->Draw(*pLogV,attribs,trans);
pVVisManager->Draw(*fLogV,attribs,trans);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const std::map<G4String,G4AttDef>* RE05CalorimeterHit::GetAttDefs() const
{
// G4AttDefs have to have long life. Use static member...
@@ -107,11 +126,13 @@ const std::map<G4String,G4AttDef>* RE05CalorimeterHit::GetAttDefs() const
fAttDefs["ZID"] = G4AttDef("ZID","Z Cell ID","Physics","","G4int");
fAttDefs["PhiID"] = G4AttDef("PhiID","Phi Cell ID","Physics","","G4int");
fAttDefs["EDep"] =
G4AttDef("EDep","Energy deposited","Physics","G4BestUnit","G4double");
G4AttDef("EDep","Energy defPosited","Physics","G4BestUnit","G4double");
}
return &fAttDefs;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
std::vector<G4AttValue>* RE05CalorimeterHit::CreateAttValues() const
{
// Create expendable G4AttsValues for picking...
@@ -119,16 +140,19 @@ std::vector<G4AttValue>* RE05CalorimeterHit::CreateAttValues() const
attValues->push_back
(G4AttValue("HitType","RE05CalorimeterHit",""));
attValues->push_back
(G4AttValue("ZID",G4UIcommand::ConvertToString(ZCellID),""));
(G4AttValue("ZID",G4UIcommand::ConvertToString(fZCellID),""));
attValues->push_back
(G4AttValue("PhiID",G4UIcommand::ConvertToString(PhiCellID),""));
(G4AttValue("PhiID",G4UIcommand::ConvertToString(fPhiCellID),""));
attValues->push_back
(G4AttValue("EDep",G4BestUnit(edep,"Energy"),""));
(G4AttValue("EDep",G4BestUnit(fEdep,"Energy"),""));
//G4cout << "Checking...\n" << G4AttCheck(attValues, GetAttDefs());
return attValues;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterHit::Print()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,114 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: $
//
/// \file RE05/src/RE05CalorimeterParallelWorld.cc
/// \brief Implementation of the RE05CalorimeterParallelWorld class
//
#include "RE05CalorimeterParallelWorld.hh"
#include "RE05CalorimeterSD.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4PVReplica.hh"
#include "G4SDManager.hh"
#include "G4Box.hh"
#include "G4Tubs.hh"
#include "G4ThreeVector.hh"
#include "G4Material.hh"
#include "G4VisAttributes.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05CalorimeterParallelWorld::
RE05CalorimeterParallelWorld(G4String& parallelWorldName)
: G4VUserParallelWorld(parallelWorldName)
{
#include "RE05DetectorParameterDef.icc"
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05CalorimeterParallelWorld::~RE05CalorimeterParallelWorld()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterParallelWorld::Construct()
{
G4Material* dummyMat = 0;
// the ReadOut World:
G4VPhysicalVolume* ROWorldPhys = GetWorld();
G4LogicalVolume* ROWorldLog = ROWorldPhys->GetLogicalVolume();
// Calorimeter volume:
G4VSolid* caloROtub
= new G4Tubs("caloROtub",fCaloTubs_rmin,fCaloTubs_rmax,
fCaloTubs_dz,fCaloTubs_sphi,fCaloTubs_dphi);
G4LogicalVolume* caloROlog
= new G4LogicalVolume(caloROtub,dummyMat,"caloROlogical",0,0,0);
// G4VPhysicalVolume* caloROphys =
new G4PVPlacement(0,G4ThreeVector(),caloROlog,"calROphysical",
ROWorldLog,false,0);
// -------------------------------
// Calorimeter readout division:
// -------------------------------
// Phi division first: 48 sectors
G4VSolid* caloROphiDivisionTub
= new G4Tubs("caloROphiDivision", fCaloCell_rmin, fCaloCell_rmax,
fCaloCell_dz, fCaloCell_sphi, fCaloCell_dphi);
G4LogicalVolume* caloROphiDivisionLog
= new G4LogicalVolume(caloROphiDivisionTub, dummyMat,
"caloROphiDivisionLogical",0,0,0);
// G4VPhysicalVolume* caloROphiDivisionPhys =
new G4PVReplica("caloROphiDivisionPhysical", caloROphiDivisionLog,
caloROlog, kPhi, fSegmentsinPhi, fCaloCell_dphi);
// then z division: 20 slices:
G4VSolid* caloROcellTub
= new G4Tubs("caloROcellTub", fCaloRing_rmin, fCaloRing_rmax,
fCaloRing_dz, fCaloRing_sphi, fCaloRing_dphi);
G4LogicalVolume * caloROcellLog
= new G4LogicalVolume(caloROcellTub, dummyMat, "caloROcellLogical",0,0,0);
// G4VPhysicalVolume * caloROcellPhys =
new G4PVReplica("caloROcellPhysical", caloROcellLog, caloROphiDivisionLog,
kZAxis, fSegmentsinZ,2.*fCaloRing_dz);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterParallelWorld::ConstructSD()
{
G4String calorimeterSDname = "/mydet/calorimeter";
RE05CalorimeterSD * calorimeterSD = new RE05CalorimeterSD(calorimeterSDname);
G4SDManager::GetSDMpointer()->AddNewDetector(calorimeterSD);
SetSensitiveDetector("caloROcellLogical",calorimeterSD);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05CalorimeterParametrisation.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05CalorimeterParametrisation.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05CalorimeterParametrisation.cc
/// \brief Implementation of the RE05CalorimeterParametrisation class
@@ -36,13 +36,20 @@
#include "G4Tubs.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05CalorimeterParametrisation::RE05CalorimeterParametrisation()
: G4VPVParameterisation()
{
#include "RE05DetectorParameterDef.icc"
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05CalorimeterParametrisation::~RE05CalorimeterParametrisation()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterParametrisation::ComputeTransformation
(const G4int,G4VPhysicalVolume *physVol) const
@@ -51,14 +58,18 @@ void RE05CalorimeterParametrisation::ComputeTransformation
physVol->SetTranslation(origin);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterParametrisation::ComputeDimensions
(G4Tubs & calorimeterLayer, const G4int copyNo, const G4VPhysicalVolume*) const
{
G4double innerRad = caloTubs_rmin
+ copyNo*(absorber_thick+scinti_thick);
G4double innerRad = fCaloTubs_rmin
+ copyNo*(fAbsorber_thick+fScinti_thick);
calorimeterLayer.SetInnerRadius(innerRad);
calorimeterLayer.SetOuterRadius(innerRad+absorber_thick);
calorimeterLayer.SetZHalfLength(caloTubs_dz);
calorimeterLayer.SetStartPhiAngle(caloTubs_sphi,false);
calorimeterLayer.SetDeltaPhiAngle(caloTubs_dphi);
calorimeterLayer.SetOuterRadius(innerRad+fAbsorber_thick);
calorimeterLayer.SetZHalfLength(fCaloTubs_dz);
calorimeterLayer.SetStartPhiAngle(fCaloTubs_sphi,false);
calorimeterLayer.SetDeltaPhiAngle(fCaloTubs_dphi);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05CalorimeterSD.cc 69920 2013-05-17 13:36:37Z gcosmo $
// $Id: RE05CalorimeterSD.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05CalorimeterSD.cc
/// \brief Implementation of the RE05CalorimeterSD class
@@ -45,7 +45,7 @@
RE05CalorimeterSD::RE05CalorimeterSD(G4String name)
:G4VSensitiveDetector(name),
numberOfCellsInZ(20),numberOfCellsInPhi(48)
fNumberOfCellsInZ(20),fNumberOfCellsInPhi(48)
{
G4String HCname;
collectionName.insert(HCname="calCollection");
@@ -54,16 +54,18 @@ RE05CalorimeterSD::RE05CalorimeterSD(G4String name)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05CalorimeterSD::~RE05CalorimeterSD()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterSD::Initialize(G4HCofThisEvent*)
{
CalCollection = new RE05CalorimeterHitsCollection
fCalCollection = new RE05CalorimeterHitsCollection
(SensitiveDetectorName,collectionName[0]);
for(G4int j=0;j<numberOfCellsInZ;j++)
for(G4int k=0;k<numberOfCellsInPhi;k++)
for(G4int j=0;j<fNumberOfCellsInZ;j++)
for(G4int k=0;k<fNumberOfCellsInPhi;k++)
{
CellID[j][k] = -1;
fCellID[j][k] = -1;
}
verboseLevel = 0;
}
@@ -74,7 +76,7 @@ G4bool RE05CalorimeterSD::ProcessHits(G4Step*aStep,G4TouchableHistory*)
{
//***** RE05CalorimeterSD has been migrated to Geant4 version 10 that does not
//***** support Readout Geometry in multi-threaded mode. Now RE05CalorimeterSD
//***** is assigned to a dedicaed parallel world. The pointer "aStep" points to
//***** is assigned to a dedicated parallel world. The pointer "aStep" points to
//***** a G4Step object for the parallel world.
G4double edep = aStep->GetTotalEnergyDeposit();
@@ -85,7 +87,7 @@ G4bool RE05CalorimeterSD::ProcessHits(G4Step*aStep,G4TouchableHistory*)
G4int copyIDinZ = touchable->GetReplicaNumber(0);
G4int copyIDinPhi = touchable->GetReplicaNumber(1);
if(CellID[copyIDinZ][copyIDinPhi]==-1)
if(fCellID[copyIDinZ][copyIDinPhi]==-1)
{
RE05CalorimeterHit* calHit
= new RE05CalorimeterHit
@@ -95,17 +97,17 @@ G4bool RE05CalorimeterSD::ProcessHits(G4Step*aStep,G4TouchableHistory*)
aTrans.Invert();
calHit->SetPos(aTrans.NetTranslation());
calHit->SetRot(aTrans.NetRotation());
G4int icell = CalCollection->insert( calHit );
CellID[copyIDinZ][copyIDinPhi] = icell - 1;
G4int icell = fCalCollection->insert( calHit );
fCellID[copyIDinZ][copyIDinPhi] = icell - 1;
if(verboseLevel>0)
{ G4cout << " New Calorimeter Hit on CellID "
{ G4cout << " New Calorimeter Hit on fCellID "
<< copyIDinZ << " " << copyIDinPhi << G4endl; }
}
else
{
(*CalCollection)[CellID[copyIDinZ][copyIDinPhi]]->AddEdep(edep);
(*fCalCollection)[fCellID[copyIDinZ][copyIDinPhi]]->AddEdep(edep);
if(verboseLevel>0)
{ G4cout << " Energy added to CellID "
{ G4cout << " Energy added to fCellID "
<< copyIDinZ << " " << copyIDinPhi << G4endl; }
}
@@ -119,18 +121,22 @@ void RE05CalorimeterSD::EndOfEvent(G4HCofThisEvent*HCE)
static G4int HCID = -1;
if(HCID<0)
{ HCID = GetCollectionID(0); }
HCE->AddHitsCollection( HCID, CalCollection );
HCE->AddHitsCollection( HCID, fCalCollection );
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterSD::clear()
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterSD::DrawAll()
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05CalorimeterSD::PrintAll()
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05DetectorConstruction.cc 69920 2013-05-17 13:36:37Z gcosmo $
// $Id: RE05DetectorConstruction.cc 101676 2016-11-21 09:25:51Z gcosmo $
//
/// \file RE05/src/RE05DetectorConstruction.cc
/// \brief Implementation of the RE05DetectorConstruction class
@@ -59,6 +59,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05DetectorConstruction::RE05DetectorConstruction()
: G4VUserDetectorConstruction()
{
#include "RE05DetectorParameterDef.icc"
@@ -68,18 +69,7 @@ RE05DetectorConstruction::RE05DetectorConstruction()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05DetectorConstruction::~RE05DetectorConstruction()
{
delete Scinti;
delete Silicon;
delete Ar;
delete Lead;
delete Air;
delete O;
delete N;
delete C;
delete H;
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -92,27 +82,27 @@ void RE05DetectorConstruction::DefineMaterials()
G4double a, z, density;
G4int nel;
H = new G4Element("Hydrogen", "H", z=1., a= 1.01*g/mole);
C = new G4Element("Carbon", "C", z=6., a= 12.01*g/mole);
N = new G4Element("Nitrogen", "N", z=7., a= 14.01*g/mole);
O = new G4Element("Oxygen", "O", z=8., a= 16.00*g/mole);
G4Element* H = new G4Element("Hydrogen", "H", z=1., a= 1.01*g/mole);
G4Element* C = new G4Element("Carbon", "C", z=6., a= 12.01*g/mole);
G4Element* N = new G4Element("Nitrogen", "N", z=7., a= 14.01*g/mole);
G4Element* O = new G4Element("Oxygen", "O", z=8., a= 16.00*g/mole);
Air = new G4Material("Air", density= 1.29*mg/cm3, nel=2);
Air->AddElement(N, 70.*perCent);
Air->AddElement(O, 30.*perCent);
fAir = new G4Material("Air", density= 1.29*mg/cm3, nel=2);
fAir->AddElement(N, 70.*perCent);
fAir->AddElement(O, 30.*perCent);
Lead =
fLead =
new G4Material("Lead", z=82., a= 207.19*g/mole, density= 11.35*g/cm3);
Ar =
fAr =
new G4Material("ArgonGas",z=18., a= 39.95*g/mole, density=1.782*mg/cm3);
Silicon =
fSilicon =
new G4Material("Silicon", z=14., a= 28.09*g/mole, density= 2.33*g/cm3);
Scinti = new G4Material("Scintillator", density= 1.032*g/cm3, nel=2);
Scinti->AddElement(C, 9);
Scinti->AddElement(H, 10);
fScinti = new G4Material("Scintillator", density= 1.032*g/cm3, nel=2);
fScinti->AddElement(C, 9);
fScinti->AddElement(H, 10);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -127,41 +117,41 @@ G4VPhysicalVolume* RE05DetectorConstruction::Construct()
//------------------------------ experimental hall
G4Box * experimentalHall_box
= new G4Box("expHall_b",expHall_x,expHall_y,expHall_z);
= new G4Box("expHall_b",fExpHall_x,fExpHall_y,fExpHall_z);
G4LogicalVolume * experimentalHall_log
= new G4LogicalVolume(experimentalHall_box,Air,"expHall_L",0,0,0);
= new G4LogicalVolume(experimentalHall_box,fAir,"expHall_L",0,0,0);
G4VPhysicalVolume * experimentalHall_phys
= new G4PVPlacement(0,G4ThreeVector(),experimentalHall_log,"expHall_P",
0,false,0);
experimentalHall_log->SetVisAttributes(G4VisAttributes::GetInvisible());
//------------------------------ tracker
G4VSolid * tracker_tubs
= new G4Tubs("trkTubs_tubs",trkTubs_rmin,trkTubs_rmax,trkTubs_dz,
trkTubs_sphi,trkTubs_dphi);
G4LogicalVolume * tracker_log
= new G4LogicalVolume(tracker_tubs,Ar,"trackerT_L",0,0,0);
// G4VPhysicalVolume * tracker_phys =
new G4PVPlacement(0,G4ThreeVector(),tracker_log,"tracker_phys",
G4VSolid * fTracker_tubs
= new G4Tubs("trkTubs_tubs",fTrkTubs_rmin,fTrkTubs_rmax,fTrkTubs_dz,
fTrkTubs_sphi,fTrkTubs_dphi);
G4LogicalVolume * fTracker_log
= new G4LogicalVolume(fTracker_tubs,fAr,"trackerT_L",0,0,0);
// G4VPhysicalVolume * fTracker_phys =
new G4PVPlacement(0,G4ThreeVector(),fTracker_log,"tracker_phys",
experimentalHall_log,false,0);
G4VisAttributes* tracker_logVisAtt
G4VisAttributes* fTracker_logVisAtt
= new G4VisAttributes(G4Colour(1.0,0.0,1.0));
tracker_log->SetVisAttributes(tracker_logVisAtt);
fTracker_log->SetVisAttributes(fTracker_logVisAtt);
//------------------------------ tracker layers
// As an example for Parameterised volume
// dummy values for G4Tubs -- modified by parameterised volume
G4VSolid * trackerLayer_tubs
= new G4Tubs("trackerLayer_tubs",trkTubs_rmin,trkTubs_rmax,trkTubs_dz,
trkTubs_sphi,trkTubs_dphi);
= new G4Tubs("trackerLayer_tubs",fTrkTubs_rmin,fTrkTubs_rmax,fTrkTubs_dz,
fTrkTubs_sphi,fTrkTubs_dphi);
G4LogicalVolume * trackerLayer_log
= new G4LogicalVolume(trackerLayer_tubs,Silicon,"trackerB_L",0,0,0);
= new G4LogicalVolume(trackerLayer_tubs,fSilicon,"trackerB_L",0,0,0);
G4VPVParameterisation * trackerParam
= new RE05TrackerParametrisation;
// dummy value : kXAxis -- modified by parameterised volume
// G4VPhysicalVolume *trackerLayer_phys =
new G4PVParameterised("trackerLayer_phys",trackerLayer_log,tracker_log,
kXAxis, notrkLayers, trackerParam);
new G4PVParameterised("trackerLayer_phys",trackerLayer_log,fTracker_log,
kXAxis, fNotrkLayers, trackerParam);
G4VisAttributes* trackerLayer_logVisAtt
= new G4VisAttributes(G4Colour(0.5,0.0,1.0));
trackerLayer_logVisAtt->SetForceWireframe(true);
@@ -169,10 +159,10 @@ G4VPhysicalVolume* RE05DetectorConstruction::Construct()
//------------------------------ calorimeter
G4VSolid * calorimeter_tubs
= new G4Tubs("calorimeter_tubs",caloTubs_rmin,caloTubs_rmax,
caloTubs_dz,caloTubs_sphi,caloTubs_dphi);
= new G4Tubs("calorimeter_tubs",fCaloTubs_rmin,fCaloTubs_rmax,
fCaloTubs_dz,fCaloTubs_sphi,fCaloTubs_dphi);
G4LogicalVolume * calorimeter_log
= new G4LogicalVolume(calorimeter_tubs,Scinti,"caloT_L",0,0,0);
= new G4LogicalVolume(calorimeter_tubs,fScinti,"caloT_L",0,0,0);
// G4VPhysicalVolume * calorimeter_phys =
new G4PVPlacement(0,G4ThreeVector(),calorimeter_log,"caloM_P",
experimentalHall_log,false,0);
@@ -185,16 +175,16 @@ G4VPhysicalVolume* RE05DetectorConstruction::Construct()
// As an example for Parameterised volume
// dummy values for G4Tubs -- modified by parameterised volume
G4VSolid * caloLayer_tubs
= new G4Tubs("caloLayer_tubs",caloRing_rmin,caloRing_rmax,
caloRing_dz,caloRing_sphi,caloRing_dphi);
= new G4Tubs("caloLayer_tubs",fCaloRing_rmin,fCaloRing_rmax,
fCaloRing_dz,fCaloRing_sphi,fCaloRing_dphi);
G4LogicalVolume * caloLayer_log
= new G4LogicalVolume(caloLayer_tubs,Lead,"caloR_L",0,0,0);
= new G4LogicalVolume(caloLayer_tubs,fLead,"caloR_L",0,0,0);
G4VPVParameterisation * calorimeterParam
= new RE05CalorimeterParametrisation;
// dummy value : kXAxis -- modified by parameterised volume
// G4VPhysicalVolume * caloLayer_phys =
new G4PVParameterised("caloLayer_phys",caloLayer_log,calorimeter_log,
kXAxis, nocaloLayers, calorimeterParam);
kXAxis, fNocaloLayers, calorimeterParam);
G4VisAttributes* caloLayer_logVisAtt
= new G4VisAttributes(G4Colour(0.7,1.0,0.0));
caloLayer_log->SetVisAttributes(caloLayer_logVisAtt);
@@ -202,16 +192,16 @@ G4VPhysicalVolume* RE05DetectorConstruction::Construct()
//------------------------------ muon counters
// As an example of CSG volumes with rotation
G4VSolid * muoncounter_box
= new G4Box("muoncounter_box",muBox_width,muBox_thick,
muBox_length);
= new G4Box("muoncounter_box",fMuBox_width,fMuBox_thick,
fMuBox_length);
G4LogicalVolume * muoncounter_log
= new G4LogicalVolume(muoncounter_box,Scinti,"mucounter_L",0,0,0);
for(int i=0; i<nomucounter ; i++)
= new G4LogicalVolume(muoncounter_box,fScinti,"mucounter_L",0,0,0);
for(int i=0; i<fNomucounter ; i++)
{
G4double phi, x, y, z;
phi = 360.*deg/nomucounter*i;
x = muBox_radius*std::sin(phi);
y = muBox_radius*std::cos(phi);
phi = 360.*deg/fNomucounter*i;
x = fMuBox_radius*std::sin(phi);
y = fMuBox_radius*std::cos(phi);
z = 0.*cm;
G4RotationMatrix rm;
rm.rotateZ(phi);
@@ -245,10 +235,13 @@ void RE05DetectorConstruction::ConstructSDandField()
//------------------------------------------------------------------
G4String trackerSDname = "/mydet/tracker";
RE05TrackerSD * trackerSD = new RE05TrackerSD(trackerSDname);
G4SDManager::GetSDMpointer()->AddNewDetector(trackerSD);
SetSensitiveDetector("trackerB_L",trackerSD);
G4String muonSDname = "/mydet/muon";
RE05MuonSD * muonSD = new RE05MuonSD(muonSDname);
G4SDManager::GetSDMpointer()->AddNewDetector(muonSD);
SetSensitiveDetector("mucounter_L",muonSD);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -24,56 +24,56 @@
// ********************************************************************
//
expHall_x = 600.*cm;
expHall_y = 600.*cm;
expHall_z = 600.*cm;
fExpHall_x = 600.*cm;
fExpHall_y = 600.*cm;
fExpHall_z = 600.*cm;
trkTubs_rmax = 50.*cm;
trkTubs_rmin = 20.*cm;
trkTubs_dz = 100.*cm;
trkTubs_sphi = 0.*deg;
trkTubs_dphi = 360.*deg;
fTrkTubs_rmax = 50.*cm;
fTrkTubs_rmin = 20.*cm;
fTrkTubs_dz = 100.*cm;
fTrkTubs_sphi = 0.*deg;
fTrkTubs_dphi = 360.*deg;
notrkLayers = 5;
tracker_radius[0] = 25.*cm;
tracker_radius[1] = 30.*cm;
tracker_radius[2] = 35.*cm;
tracker_radius[3] = 40.*cm;
tracker_radius[4] = 45.*cm;
fNotrkLayers = 5;
fTracker_radius[0] = 25.*cm;
fTracker_radius[1] = 30.*cm;
fTracker_radius[2] = 35.*cm;
fTracker_radius[3] = 40.*cm;
fTracker_radius[4] = 45.*cm;
tracker_thick = 0.5*cm;
fTracker_thick = 0.5*cm;
for(int il=0;il<5;il++)
{
tracker_length[il] = tracker_radius[il];
fTracker_length[il] = fTracker_radius[il];
}
caloTubs_rmax = 300.*cm;
caloTubs_rmin = 50.*cm;
caloTubs_dz = 200.*cm;
caloTubs_sphi = 0.*deg;
caloTubs_dphi = 360.*deg;
fCaloTubs_rmax = 300.*cm;
fCaloTubs_rmin = 50.*cm;
fCaloTubs_dz = 200.*cm;
fCaloTubs_sphi = 0.*deg;
fCaloTubs_dphi = 360.*deg;
absorber_thick = 3.*cm;
scinti_thick = 2.*cm;
nocaloLayers = int((caloTubs_rmax-caloTubs_rmin)/(absorber_thick+scinti_thick));
fAbsorber_thick = 3.*cm;
fScinti_thick = 2.*cm;
fNocaloLayers = int((fCaloTubs_rmax-fCaloTubs_rmin)/(fAbsorber_thick+fScinti_thick));
segmentsinPhi = 48;
caloCell_rmax = caloTubs_rmax;
caloCell_rmin = caloTubs_rmin;
caloCell_dz = caloTubs_dz;
caloCell_sphi = caloTubs_sphi;
caloCell_dphi = caloTubs_dphi/segmentsinPhi;
fSegmentsinPhi = 48;
fCaloCell_rmax = fCaloTubs_rmax;
fCaloCell_rmin = fCaloTubs_rmin;
fCaloCell_dz = fCaloTubs_dz;
fCaloCell_sphi = fCaloTubs_sphi;
fCaloCell_dphi = fCaloTubs_dphi/fSegmentsinPhi;
segmentsinZ = 20;
caloRing_rmax = caloCell_rmax;
caloRing_rmin = caloCell_rmin;
caloRing_dz = caloCell_dz/segmentsinZ ;
caloRing_sphi = caloCell_sphi;
caloRing_dphi = caloCell_dphi;
fSegmentsinZ = 20;
fCaloRing_rmax = fCaloCell_rmax;
fCaloRing_rmin = fCaloCell_rmin;
fCaloRing_dz = fCaloCell_dz/fSegmentsinZ ;
fCaloRing_sphi = fCaloCell_sphi;
fCaloRing_dphi = fCaloCell_dphi;
nomucounter = 4;
muBox_radius = 350.*cm;
muBox_width = muBox_radius - 5.*cm;
muBox_thick = 1.*cm;
muBox_length = expHall_z - 10.*cm;
fNomucounter = 4;
fMuBox_radius = 350.*cm;
fMuBox_width = fMuBox_radius - 5.*cm;
fMuBox_thick = 1.*cm;
fMuBox_length = fExpHall_z - 10.*cm;
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05EventAction.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05EventAction.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05EventAction.cc
/// \brief Implementation of the RE05EventAction class
@@ -47,33 +47,41 @@
#include "G4SystemOfUnits.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05EventAction::RE05EventAction()
{
trackerCollID = -1;
calorimeterCollID = -1;
muonCollID = -1;
}
: G4UserEventAction(),
fTrackerCollID(-1),
fCalorimeterCollID(-1),
fMuonCollID(-1)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05EventAction::~RE05EventAction()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05EventAction::BeginOfEventAction(const G4Event*)
{
G4SDManager * SDman = G4SDManager::GetSDMpointer();
if(trackerCollID<0||calorimeterCollID<0||muonCollID<0)
if(fTrackerCollID<0||fCalorimeterCollID<0||fMuonCollID<0)
{
G4String colNam;
trackerCollID = SDman->GetCollectionID(colNam="trackerCollection");
calorimeterCollID = SDman->GetCollectionID(colNam="calCollection");
muonCollID = SDman->GetCollectionID(colNam="muonCollection");
fTrackerCollID = SDman->GetCollectionID(colNam="trackerCollection");
fCalorimeterCollID = SDman->GetCollectionID(colNam="calCollection");
fMuonCollID = SDman->GetCollectionID(colNam="muonCollection");
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05EventAction::EndOfEventAction(const G4Event* evt)
{
G4cout << ">>> Event " << evt->GetEventID() << G4endl;
if(trackerCollID<0||calorimeterCollID<0||muonCollID<0) return;
if(fTrackerCollID<0||fCalorimeterCollID<0||fMuonCollID<0) return;
G4HCofThisEvent * HCE = evt->GetHCofThisEvent();
RE05TrackerHitsCollection* THC = 0;
@@ -81,9 +89,9 @@ void RE05EventAction::EndOfEventAction(const G4Event* evt)
RE05MuonHitsCollection* MHC = 0;
if(HCE)
{
THC = (RE05TrackerHitsCollection*)(HCE->GetHC(trackerCollID));
CHC = (RE05CalorimeterHitsCollection*)(HCE->GetHC(calorimeterCollID));
MHC = (RE05MuonHitsCollection*)(HCE->GetHC(muonCollID));
THC = (RE05TrackerHitsCollection*)(HCE->GetHC(fTrackerCollID));
CHC = (RE05CalorimeterHitsCollection*)(HCE->GetHC(fCalorimeterCollID));
MHC = (RE05MuonHitsCollection*)(HCE->GetHC(fMuonCollID));
}
if(THC)
@@ -111,3 +119,4 @@ void RE05EventAction::EndOfEventAction(const G4Event* evt)
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05Field.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05Field.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05Field.cc
/// \brief Implementation of the RE05Field class
@@ -32,23 +32,32 @@
#include "RE05Field.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05Field::RE05Field()
: G4MagneticField()
{
Bz = 3.0*tesla;
rmax_sq = sqr(50.*cm);
zmax = 100.*cm;
fBz = 3.0*tesla;
fRmax_sq = sqr(50.*cm);
fZmax = 100.*cm;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05Field::~RE05Field()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05Field::GetFieldValue(const double Point[3],double *Bfield) const
{
Bfield[0] = 0.;
Bfield[1] = 0.;
if(std::abs(Point[2])<zmax && (sqr(Point[0])+sqr(Point[1]))<rmax_sq)
{ Bfield[2] = Bz; }
if(std::abs(Point[2])<fZmax && (sqr(Point[0])+sqr(Point[1]))<fRmax_sq)
{ Bfield[2] = fBz; }
else
{ Bfield[2] = 0.; }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05MuonHit.cc 69764 2013-05-14 09:59:36Z gcosmo $
// $Id: RE05MuonHit.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05MuonHit.cc
/// \brief Implementation of the RE05MuonHit class
@@ -41,26 +41,37 @@
G4ThreadLocal G4Allocator<RE05MuonHit>* RE05MuonHitAllocator=0;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05MuonHit::RE05MuonHit()
{;}
: G4VHit(),fEdep(0.),fPos()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05MuonHit::~RE05MuonHit()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05MuonHit::RE05MuonHit(const RE05MuonHit &right)
: G4VHit()
{
edep = right.edep;
pos = right.pos;
fEdep = right.fEdep;
fPos = right.fPos;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const RE05MuonHit& RE05MuonHit::operator=(const RE05MuonHit &right)
{
edep = right.edep;
pos = right.pos;
fEdep = right.fEdep;
fPos = right.fPos;
return *this;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4int RE05MuonHit::operator==(const RE05MuonHit &right) const
{
return (this==&right) ? 1 : 0;
@@ -68,12 +79,14 @@ G4int RE05MuonHit::operator==(const RE05MuonHit &right) const
std::map<G4String,G4AttDef> RE05MuonHit::fAttDefs;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05MuonHit::Draw()
{
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
if(pVVisManager)
{
G4Circle circle(pos);
G4Circle circle(fPos);
circle.SetScreenSize(0.04);
circle.SetFillStyle(G4Circle::filled);
G4Colour colour(1.,0.,0.);
@@ -83,6 +96,8 @@ void RE05MuonHit::Draw()
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const std::map<G4String,G4AttDef>* RE05MuonHit::GetAttDefs() const
{
// G4AttDefs have to have long life. Use static member...
@@ -93,6 +108,8 @@ const std::map<G4String,G4AttDef>* RE05MuonHit::GetAttDefs() const
return &fAttDefs;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
std::vector<G4AttValue>* RE05MuonHit::CreateAttValues() const
{
// Create expendable G4AttsValues for picking...
@@ -103,7 +120,9 @@ std::vector<G4AttValue>* RE05MuonHit::CreateAttValues() const
return attValues;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05MuonHit::Print()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05MuonSD.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05MuonSD.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05MuonSD.cc
/// \brief Implementation of the RE05MuonSD class
@@ -38,26 +38,36 @@
#include "G4SystemOfUnits.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05MuonSD::RE05MuonSD(G4String name)
:G4VSensitiveDetector(name)
:G4VSensitiveDetector(name),
fMuonCollection(0), fPositionResolution(0.)
{
G4String HCname;
collectionName.insert(HCname="muonCollection");
positionResolution = 5*cm;
fPositionResolution = 5*cm;
}
RE05MuonSD::~RE05MuonSD(){;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05MuonSD::~RE05MuonSD()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05MuonSD::Initialize(G4HCofThisEvent*HCE)
{
static int HCID = -1;
muonCollection = new RE05MuonHitsCollection
fMuonCollection = new RE05MuonHitsCollection
(SensitiveDetectorName,collectionName[0]);
if(HCID<0)
{ HCID = GetCollectionID(0); }
HCE->AddHitsCollection(HCID,muonCollection);
HCE->AddHitsCollection(HCID,fMuonCollection);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool RE05MuonSD::ProcessHits(G4Step*aStep,G4TouchableHistory*)
{
G4double edep = aStep->GetTotalEnergyDeposit();
@@ -65,15 +75,15 @@ G4bool RE05MuonSD::ProcessHits(G4Step*aStep,G4TouchableHistory*)
if(edep==0.) return true;
RE05MuonHit* aHit;
int nHit = muonCollection->entries();
int nHit = fMuonCollection->entries();
G4ThreeVector hitpos = aStep->GetPreStepPoint()->GetPosition();
for(int i=0;i<nHit;i++)
{
aHit = (*muonCollection)[i];
aHit = (*fMuonCollection)[i];
G4ThreeVector pos = aHit->GetPos();
G4double dist2 = sqr(pos.x()-hitpos.x())
+sqr(pos.y()-hitpos.y())+sqr(pos.z()-hitpos.z());
if(dist2<=sqr(positionResolution))
if(dist2<=sqr(fPositionResolution))
aHit->AddEdep(edep);
return true;
}
@@ -81,23 +91,29 @@ G4bool RE05MuonSD::ProcessHits(G4Step*aStep,G4TouchableHistory*)
aHit = new RE05MuonHit();
aHit->SetEdep( edep );
aHit->SetPos( aStep->GetPreStepPoint()->GetPosition() );
muonCollection->insert( aHit );
fMuonCollection->insert( aHit );
return true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05MuonSD::EndOfEvent(G4HCofThisEvent*)
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05MuonSD::clear()
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05MuonSD::DrawAll()
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05MuonSD::PrintAll()
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05PrimaryGeneratorAction.cc 83391 2014-08-21 14:35:11Z gcosmo $
// $Id: RE05PrimaryGeneratorAction.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05PrimaryGeneratorAction.cc
/// \brief Implementation of the RE05PrimaryGeneratorAction class
@@ -38,61 +38,66 @@
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "G4SystemOfUnits.hh"
G4VPrimaryGenerator* RE05PrimaryGeneratorAction::HEPEvt = 0;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05PrimaryGeneratorAction::RE05PrimaryGeneratorAction()
{
if(!HEPEvt)
{
const char* filename = "pythia_event.data";
HEPEvt = new G4HEPEvtInterface(filename,1);
}
G4int n_particle = 1;
G4ParticleGun* fParticleGun = new G4ParticleGun(n_particle);
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
G4String particleName;
G4ParticleDefinition* particle
= particleTable->FindParticle(particleName="mu+");
fParticleGun->SetParticleDefinition(particle);
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0.,1.,0.));
fParticleGun->SetParticleEnergy(100.*GeV);
fParticleGun->SetParticlePosition(G4ThreeVector(0.*cm,0.*cm,0.*cm));
particleGun = fParticleGun;
messenger = new RE05PrimaryGeneratorMessenger(this);
useHEPEvt = true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4AutoLock.hh"
namespace {
G4Mutex RE05PrimGenDestrMutex = G4MUTEX_INITIALIZER;
G4Mutex RE05PrimGenMutex = G4MUTEX_INITIALIZER;
}
G4VPrimaryGenerator* RE05PrimaryGeneratorAction::fHEPEvt = 0;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05PrimaryGeneratorAction::RE05PrimaryGeneratorAction()
: G4VUserPrimaryGeneratorAction(),
fParticleGun(0),
fMessenger(0),
fUseHEPEvt(false)
{
if(!fHEPEvt)
{
const char* filename = "pythia_event.data";
fHEPEvt = new G4HEPEvtInterface(filename,1);
}
G4int n_particle = 1;
G4ParticleGun* particleGun = new G4ParticleGun(n_particle);
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
G4String particleName;
G4ParticleDefinition* particle
= particleTable->FindParticle(particleName="mu+");
particleGun->SetParticleDefinition(particle);
particleGun->SetParticleMomentumDirection(G4ThreeVector(0.,1.,0.));
particleGun->SetParticleEnergy(100.*GeV);
particleGun->SetParticlePosition(G4ThreeVector(0.*cm,0.*cm,0.*cm));
fParticleGun = particleGun;
fMessenger = new RE05PrimaryGeneratorMessenger(this);
fUseHEPEvt = true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05PrimaryGeneratorAction::~RE05PrimaryGeneratorAction()
{
G4AutoLock lock(&RE05PrimGenDestrMutex);
if(HEPEvt) { delete HEPEvt; HEPEvt=0; }
delete particleGun;
delete messenger;
if(fHEPEvt) { delete fHEPEvt; fHEPEvt=0; }
delete fParticleGun;
delete fMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
if(useHEPEvt)
if(fUseHEPEvt)
{
G4AutoLock lock(&RE05PrimGenMutex);
HEPEvt->GeneratePrimaryVertex(anEvent);
fHEPEvt->GeneratePrimaryVertex(anEvent);
}
else
{ particleGun->GeneratePrimaryVertex(anEvent); }
{ fParticleGun->GeneratePrimaryVertex(anEvent); }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05PrimaryGeneratorMessenger.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05PrimaryGeneratorMessenger.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05PrimaryGeneratorMessenger.cc
/// \brief Implementation of the RE05PrimaryGeneratorMessenger class
@@ -35,39 +35,48 @@
#include "G4UIcmdWithAString.hh"
#include "G4ios.hh"
RE05PrimaryGeneratorMessenger::RE05PrimaryGeneratorMessenger(RE05PrimaryGeneratorAction * mpga)
:myAction(mpga)
{
mydetDirectory = new G4UIdirectory("/mydet/");
mydetDirectory->SetGuidance("RE05 detector control commands.");
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
genCmd = new G4UIcmdWithAString("/mydet/generator",this);
genCmd->SetGuidance("Select primary generator.");
genCmd->SetGuidance(" Available generators : PYTHIA, particleGun");
genCmd->SetParameterName("generator",true);
genCmd->SetDefaultValue("PYTHIA");
genCmd->SetCandidates("PYTHIA particleGun");
RE05PrimaryGeneratorMessenger::RE05PrimaryGeneratorMessenger(RE05PrimaryGeneratorAction * mpga)
: G4UImessenger(),
fMyAction(mpga), fMydetDirectory(0), fGenCmd(0)
{
fMydetDirectory = new G4UIdirectory("/mydet/");
fMydetDirectory->SetGuidance("RE05 detector control commands.");
fGenCmd = new G4UIcmdWithAString("/mydet/generator",this);
fGenCmd->SetGuidance("Select primary generator.");
fGenCmd->SetGuidance(" Available generators : PYTHIA, particleGun");
fGenCmd->SetParameterName("generator",true);
fGenCmd->SetDefaultValue("PYTHIA");
fGenCmd->SetCandidates("PYTHIA particleGun");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05PrimaryGeneratorMessenger::~RE05PrimaryGeneratorMessenger()
{
delete genCmd;
delete mydetDirectory;
delete fGenCmd;
delete fMydetDirectory;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05PrimaryGeneratorMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
{
if( command==genCmd )
{ myAction->SetHEPEvtGenerator(newValue=="PYTHIA"); }
if( command==fGenCmd )
{ fMyAction->SetHEPEvtGenerator(newValue=="PYTHIA"); }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4String RE05PrimaryGeneratorMessenger::GetCurrentValue(G4UIcommand * command)
{
G4String cv;
if( command==genCmd )
if( command==fGenCmd )
{
if(myAction->GetHEPEvtGenerator())
if(fMyAction->GetHEPEvtGenerator())
{ cv = "PYTHIA"; }
else
{ cv = "particleGun"; }
@@ -76,3 +85,4 @@ G4String RE05PrimaryGeneratorMessenger::GetCurrentValue(G4UIcommand * command)
return cv;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05RunAction.cc 69764 2013-05-14 09:59:36Z gcosmo $
// $Id: RE05RunAction.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05RunAction.cc
/// \brief Implementation of the RE05RunAction class
@@ -35,14 +35,12 @@
#include "RE05RunAction.hh"
#include "G4Run.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4VVisManager.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05RunAction::RE05RunAction()
: G4UserRunAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05StackingAction.cc 77724 2013-11-27 17:11:16Z gcosmo $
// $Id: RE05StackingAction.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05StackingAction.cc
/// \brief Implementation of the RE05StackingAction class
@@ -42,23 +42,31 @@
#include "G4SystemOfUnits.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05StackingAction::RE05StackingAction()
: trkHits(0), muonHits(0), stage(0)
: G4UserStackingAction(),
fTrkHits(0), fMuonHits(0), fMessenger(0),
fStage(0),
fReqMuon(2),
fReqIso(10),
fAngRoI(30.0*deg)
{
angRoI = 30.0*deg;
reqMuon = 2;
reqIso = 10;
theMessenger = new RE05StackingActionMessenger(this);
fMessenger = new RE05StackingActionMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05StackingAction::~RE05StackingAction()
{ delete theMessenger; }
{ delete fMessenger; }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4ClassificationOfNewTrack
RE05StackingAction::ClassifyNewTrack(const G4Track * aTrack)
{
G4ClassificationOfNewTrack classification = fWaiting;
switch(stage)
switch(fStage)
{
case 0: // Stage 0 : Primary muons only
if(aTrack->GetParentID()==0)
@@ -86,7 +94,7 @@ RE05StackingAction::ClassifyNewTrack(const G4Track * aTrack)
classification = fUrgent;
break;
}
if((angRoI<0.)||InsideRoI(aTrack,angRoI))
if((fAngRoI<0.)||InsideRoI(aTrack,fAngRoI))
{
classification = fUrgent;
break;
@@ -96,20 +104,22 @@ RE05StackingAction::ClassifyNewTrack(const G4Track * aTrack)
return classification;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool RE05StackingAction::InsideRoI(const G4Track * aTrack,G4double ang)
{
if(!muonHits)
{ muonHits = (RE05MuonHitsCollection*)GetCollection("muonCollection"); }
if(!muonHits)
if(!fMuonHits)
{ fMuonHits = (RE05MuonHitsCollection*)GetCollection("muonCollection"); }
if(!fMuonHits)
{ G4cerr << "muonCollection NOT FOUND" << G4endl;
return true; }
G4int nhits = muonHits->entries();
G4int nhits = fMuonHits->entries();
const G4ThreeVector trPos = aTrack->GetPosition();
for(G4int i=0;i<nhits;i++)
{
G4ThreeVector muHitPos = (*muonHits)[i]->GetPos();
G4ThreeVector muHitPos = (*fMuonHits)[i]->GetPos();
G4double angl = muHitPos.angle(trPos);
if(angl<ang) { return true; }
}
@@ -117,6 +127,8 @@ G4bool RE05StackingAction::InsideRoI(const G4Track * aTrack,G4double ang)
return false;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VHitsCollection* RE05StackingAction::GetCollection(G4String colName)
{
G4SDManager* SDMan = G4SDManager::GetSDMpointer();
@@ -131,23 +143,25 @@ G4VHitsCollection* RE05StackingAction::GetCollection(G4String colName)
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05StackingAction::NewStage()
{
stage++;
fStage++;
G4int nhits;
if(stage==1)
if(fStage==1)
{
// Stage 0->1 : check if at least "reqMuon" hits on muon chamber
// Stage 0->1 : check if at least "fReqMuon" hits on muon chamber
// otherwise abort current event
if(!muonHits)
{ muonHits = (RE05MuonHitsCollection*)GetCollection("muonCollection"); }
if(!muonHits)
if(!fMuonHits)
{ fMuonHits = (RE05MuonHitsCollection*)GetCollection("muonCollection"); }
if(!fMuonHits)
{ G4cerr << "muonCollection NOT FOUND" << G4endl;
return; }
nhits = muonHits->entries();
nhits = fMuonHits->entries();
//// G4cout << "Stage 0->1 : " << nhits << " hits found in the muon chamber."
//// << G4endl;
if(nhits<reqMuon)
if(nhits<fReqMuon)
{
stackManager->clear();
//// G4cout << "++++++++ event aborted" << G4endl;
@@ -157,35 +171,35 @@ void RE05StackingAction::NewStage()
return;
}
else if(stage==2)
else if(fStage==2)
{
// Stage 1->2 : check the isolation of muon tracks
// at least "reqIsoMuon" isolated muons
// at least "fReqIsoMuon" isolated muons
// otherwise abort current event.
// Isolation requires "reqIso" or less hits
// Isolation requires "fReqIso" or less hits
// (including own hits) in the RoI region
// in the tracker layers.
nhits = muonHits->entries();
if(!trkHits)
{ trkHits = (RE05TrackerHitsCollection*)GetCollection("trackerCollection"); }
if(!trkHits)
nhits = fMuonHits->entries();
if(!fTrkHits)
{ fTrkHits = (RE05TrackerHitsCollection*)GetCollection("trackerCollection"); }
if(!fTrkHits)
{ G4cerr << "trackerCollection NOT FOUND" << G4endl;
return; }
G4int nTrkhits = trkHits->entries();
G4int nTrkhits = fTrkHits->entries();
G4int isoMuon = 0;
for(G4int j=0;j<nhits;j++)
{
G4ThreeVector hitPos = (*muonHits)[j]->GetPos();
G4ThreeVector hitPos = (*fMuonHits)[j]->GetPos();
G4int nhitIn = 0;
for(G4int jj=0;(jj<nTrkhits)&&(nhitIn<=reqIso);jj++)
for(G4int jj=0;(jj<nTrkhits)&&(nhitIn<=fReqIso);jj++)
{
G4ThreeVector trkhitPos = (*trkHits)[jj]->GetPos();
if(trkhitPos.angle(hitPos)<angRoI) nhitIn++;
G4ThreeVector trkhitPos = (*fTrkHits)[jj]->GetPos();
if(trkhitPos.angle(hitPos)<fAngRoI) nhitIn++;
}
if(nhitIn<=reqIso) isoMuon++;
if(nhitIn<=fReqIso) isoMuon++;
}
//// G4cout << "Stage 1->2 : " << isoMuon << " isolated muon found." << G4endl;
if(isoMuon<reqIsoMuon)
if(isoMuon<fReqIsoMuon)
{
stackManager->clear();
//// G4cout << "++++++++ event aborted" << G4endl;
@@ -197,16 +211,18 @@ void RE05StackingAction::NewStage()
else
{
// Other stage change : just re-classify
// Other fStage change : just re-classify
stackManager->ReClassify();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05StackingAction::PrepareNewEvent()
{
stage = 0;
trkHits = 0;
muonHits = 0;
fStage = 0;
fTrkHits = 0;
fMuonHits = 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05StackingActionMessenger.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05StackingActionMessenger.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05StackingActionMessenger.cc
/// \brief Implementation of the RE05StackingActionMessenger class
@@ -35,67 +35,78 @@
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05StackingActionMessenger::RE05StackingActionMessenger(RE05StackingAction * msa)
:myAction(msa)
: G4UImessenger(),
fMyAction(msa),
fMuonCmd(0), fIsoMuonCmd(0), fIsoCmd(0), fRoiCmd(0)
{
muonCmd = new G4UIcmdWithAnInteger("/mydet/reqmuon",this);
muonCmd->SetGuidance("Number of muon for the trigger.");
muonCmd->SetParameterName("N",true);
muonCmd->SetDefaultValue(2);
muonCmd->SetRange("N>=0");
fMuonCmd = new G4UIcmdWithAnInteger("/mydet/reqmuon",this);
fMuonCmd->SetGuidance("Number of muon for the trigger.");
fMuonCmd->SetParameterName("N",true);
fMuonCmd->SetDefaultValue(2);
fMuonCmd->SetRange("N>=0");
isomuonCmd = new G4UIcmdWithAnInteger("/mydet/isomuon",this);
isomuonCmd->SetGuidance("Number of isolated muon for the trigger.");
isomuonCmd->SetParameterName("N",true);
isomuonCmd->SetDefaultValue(2);
isomuonCmd->SetRange("N>=0");
fIsoMuonCmd = new G4UIcmdWithAnInteger("/mydet/isomuon",this);
fIsoMuonCmd->SetGuidance("Number of isolated muon for the trigger.");
fIsoMuonCmd->SetParameterName("N",true);
fIsoMuonCmd->SetDefaultValue(2);
fIsoMuonCmd->SetRange("N>=0");
isoCmd = new G4UIcmdWithAnInteger("/mydet/isolation",this);
isoCmd->SetGuidance("Maximum allowed number of hits in tracker");
isoCmd->SetGuidance(" for an isolated muon track (includes hits by muon)");
isoCmd->SetParameterName("N",true);
isoCmd->SetDefaultValue(10);
isoCmd->SetRange("N>=0");
fIsoCmd = new G4UIcmdWithAnInteger("/mydet/isolation",this);
fIsoCmd->SetGuidance("Maximum allowed number of hits in tracker");
fIsoCmd->SetGuidance(" for an isolated muon track (includes hits by muon)");
fIsoCmd->SetParameterName("N",true);
fIsoCmd->SetDefaultValue(10);
fIsoCmd->SetRange("N>=0");
roiCmd = new G4UIcmdWithADoubleAndUnit("/mydet/RoIangle",this);
roiCmd->SetGuidance("Define RoI angle");
roiCmd->SetParameterName("theta",true,true);
roiCmd->SetDefaultUnit("deg");
fRoiCmd = new G4UIcmdWithADoubleAndUnit("/mydet/RoIangle",this);
fRoiCmd->SetGuidance("Define RoI angle");
fRoiCmd->SetParameterName("theta",true,true);
fRoiCmd->SetDefaultUnit("deg");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05StackingActionMessenger::~RE05StackingActionMessenger()
{
delete muonCmd;
delete isomuonCmd;
delete isoCmd;
delete roiCmd;
delete fMuonCmd;
delete fIsoMuonCmd;
delete fIsoCmd;
delete fRoiCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05StackingActionMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
{
if( command==muonCmd )
{ myAction->SetNRequestMuon(muonCmd->GetNewIntValue(newValue)); }
else if( command==isomuonCmd )
{ myAction->SetNRequestIsoMuon(isomuonCmd->GetNewIntValue(newValue)); }
else if( command==isoCmd )
{ myAction->SetNIsolation(isoCmd->GetNewIntValue(newValue)); }
else if( command==roiCmd )
{ myAction->SetRoIAngle(roiCmd->GetNewDoubleValue(newValue)); }
if( command==fMuonCmd )
{ fMyAction->SetNRequestMuon(fMuonCmd->GetNewIntValue(newValue)); }
else if( command==fIsoMuonCmd )
{ fMyAction->SetNRequestIsoMuon(fIsoMuonCmd->GetNewIntValue(newValue)); }
else if( command==fIsoCmd )
{ fMyAction->SetNIsolation(fIsoCmd->GetNewIntValue(newValue)); }
else if( command==fRoiCmd )
{ fMyAction->SetRoIAngle(fRoiCmd->GetNewDoubleValue(newValue)); }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4String RE05StackingActionMessenger::GetCurrentValue(G4UIcommand * command)
{
G4String cv;
if( command==muonCmd )
{ cv = muonCmd->ConvertToString(myAction->GetNRequestMuon()); }
else if( command==isomuonCmd )
{ cv = isomuonCmd->ConvertToString(myAction->GetNRequestIsoMuon()); }
else if( command==isoCmd )
{ cv = isoCmd->ConvertToString(myAction->GetNIsolation()); }
else if( command==roiCmd )
{ cv = roiCmd->ConvertToString(myAction->GetRoIAngle(),"deg"); }
if( command==fMuonCmd )
{ cv = fMuonCmd->ConvertToString(fMyAction->GetNRequestMuon()); }
else if( command==fIsoMuonCmd )
{ cv = fIsoMuonCmd->ConvertToString(fMyAction->GetNRequestIsoMuon()); }
else if( command==fIsoCmd )
{ cv = fIsoCmd->ConvertToString(fMyAction->GetNIsolation()); }
else if( command==fRoiCmd )
{ cv = fRoiCmd->ConvertToString(fMyAction->GetRoIAngle(),"deg"); }
return cv;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05SteppingAction.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05SteppingAction.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05SteppingAction.cc
/// \brief Implementation of the RE05SteppingAction class
@@ -39,11 +39,18 @@
#include "G4ParticleDefinition.hh"
#include "G4ParticleTypes.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05SteppingAction::RE05SteppingAction()
{;}
: G4UserSteppingAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05SteppingAction::~RE05SteppingAction()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05SteppingAction::UserSteppingAction(const G4Step * theStep)
{
@@ -75,4 +82,4 @@ void RE05SteppingAction::UserSteppingAction(const G4Step * theStep)
theTrack->SetTrackStatus(fSuspend);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05SteppingVerbose.cc 66521 2012-12-19 12:22:01Z ihrivnac $
// $Id: RE05SteppingVerbose.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05SteppingVerbose.cc
/// \brief Implementation of the RE05SteppingVerbose class
@@ -40,6 +40,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05SteppingVerbose::RE05SteppingVerbose()
: G4SteppingVerbose()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05TrackerHit.cc 69764 2013-05-14 09:59:36Z gcosmo $
// $Id: RE05TrackerHit.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05TrackerHit.cc
/// \brief Implementation of the RE05TrackerHit class
@@ -40,40 +40,53 @@
#include "G4AttCheck.hh"
G4ThreadLocal G4Allocator<RE05TrackerHit>* RE05TrackerHitAllocator=0;
std::map<G4String,G4AttDef> RE05TrackerHit::fAttDefs;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05TrackerHit::RE05TrackerHit()
{;}
: G4VHit(),
fEdep(0.),fPos()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05TrackerHit::~RE05TrackerHit()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05TrackerHit::RE05TrackerHit(const RE05TrackerHit &right)
: G4VHit()
{
edep = right.edep;
pos = right.pos;
fEdep = right.fEdep;
fPos = right.fPos;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const RE05TrackerHit& RE05TrackerHit::operator=(const RE05TrackerHit &right)
{
edep = right.edep;
pos = right.pos;
fEdep = right.fEdep;
fPos = right.fPos;
return *this;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4int RE05TrackerHit::operator==(const RE05TrackerHit &right) const
{
return (this==&right) ? 1 : 0;
}
std::map<G4String,G4AttDef> RE05TrackerHit::fAttDefs;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackerHit::Draw()
{
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
if(pVVisManager)
{
G4Circle circle(pos);
G4Circle circle(fPos);
circle.SetScreenSize(0.04);
circle.SetFillStyle(G4Circle::filled);
G4Colour colour(1.,0.,0.);
@@ -83,6 +96,8 @@ void RE05TrackerHit::Draw()
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const std::map<G4String,G4AttDef>* RE05TrackerHit::GetAttDefs() const
{
// G4AttDefs have to have long life. Use static member...
@@ -93,6 +108,8 @@ const std::map<G4String,G4AttDef>* RE05TrackerHit::GetAttDefs() const
return &fAttDefs;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
std::vector<G4AttValue>* RE05TrackerHit::CreateAttValues() const
{
// Create expendable G4AttsValues for picking...
@@ -103,7 +120,10 @@ std::vector<G4AttValue>* RE05TrackerHit::CreateAttValues() const
return attValues;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackerHit::Print()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05TrackerParametrisation.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05TrackerParametrisation.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05TrackerParametrisation.cc
/// \brief Implementation of the RE05TrackerParametrisation class
@@ -36,15 +36,22 @@
#include "G4Tubs.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05TrackerParametrisation::RE05TrackerParametrisation()
: G4VPVParameterisation()
{
#include "RE05DetectorParameterDef.icc"
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05TrackerParametrisation::~RE05TrackerParametrisation()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackerParametrisation::ComputeTransformation
(const G4int, G4VPhysicalVolume* physVol) const
@@ -53,12 +60,16 @@ void RE05TrackerParametrisation::ComputeTransformation
physVol->SetTranslation(origin);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackerParametrisation::ComputeDimensions
(G4Tubs& trackerLayer, const G4int copyNo, const G4VPhysicalVolume*) const
{
trackerLayer.SetInnerRadius(tracker_radius[copyNo]);
trackerLayer.SetOuterRadius(tracker_radius[copyNo]+tracker_thick);
trackerLayer.SetZHalfLength(tracker_length[copyNo]);
trackerLayer.SetStartPhiAngle(trkTubs_sphi,false);
trackerLayer.SetDeltaPhiAngle(trkTubs_dphi);
trackerLayer.SetInnerRadius(fTracker_radius[copyNo]);
trackerLayer.SetOuterRadius(fTracker_radius[copyNo]+fTracker_thick);
trackerLayer.SetZHalfLength(fTracker_length[copyNo]);
trackerLayer.SetStartPhiAngle(fTrkTubs_sphi,false);
trackerLayer.SetDeltaPhiAngle(fTrkTubs_dphi);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05TrackerSD.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05TrackerSD.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05TrackerSD.cc
/// \brief Implementation of the RE05TrackerSD class
@@ -36,25 +36,35 @@
#include "G4TouchableHistory.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05TrackerSD::RE05TrackerSD(G4String name)
:G4VSensitiveDetector(name)
: G4VSensitiveDetector(name),
fTrackerCollection(0)
{
G4String HCname;
collectionName.insert(HCname="trackerCollection");
}
RE05TrackerSD::~RE05TrackerSD(){;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05TrackerSD::~RE05TrackerSD()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackerSD::Initialize(G4HCofThisEvent* HCE)
{
static int HCID = -1;
trackerCollection = new RE05TrackerHitsCollection
fTrackerCollection = new RE05TrackerHitsCollection
(SensitiveDetectorName,collectionName[0]);
if(HCID<0)
{ HCID = GetCollectionID(0); }
HCE->AddHitsCollection(HCID,trackerCollection);
HCE->AddHitsCollection(HCID,fTrackerCollection);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool RE05TrackerSD::ProcessHits(G4Step* aStep, G4TouchableHistory*)
{
G4double edep = aStep->GetTotalEnergyDeposit();
@@ -63,23 +73,29 @@ G4bool RE05TrackerSD::ProcessHits(G4Step* aStep, G4TouchableHistory*)
RE05TrackerHit* newHit = new RE05TrackerHit();
newHit->SetEdep( edep );
newHit->SetPos( aStep->GetPreStepPoint()->GetPosition() );
trackerCollection->insert( newHit );
fTrackerCollection->insert( newHit );
return true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackerSD::EndOfEvent(G4HCofThisEvent*)
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackerSD::clear()
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackerSD::DrawAll()
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackerSD::PrintAll()
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE05TrackingAction.cc 66526 2012-12-19 13:41:33Z ihrivnac $
// $Id: RE05TrackingAction.cc 98775 2016-08-09 14:30:39Z gcosmo $
//
/// \file RE05/src/RE05TrackingAction.cc
/// \brief Implementation of the RE05TrackingAction class
@@ -33,6 +33,8 @@
#include "G4TrackingManager.hh"
#include "G4Track.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05TrackingAction::PreUserTrackingAction(const G4Track* aTrack)
{
// Create trajectory only for primaries
@@ -42,4 +44,4 @@ void RE05TrackingAction::PreUserTrackingAction(const G4Track* aTrack)
{ fpTrackingManager->SetStoreTrajectory(false); }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -32,11 +32,18 @@
#include "RE05WorkerInitialization.hh"
#include "RE05SteppingVerbose.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05WorkerInitialization::RE05WorkerInitialization()
{;}
: G4UserWorkerInitialization()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE05WorkerInitialization::~RE05WorkerInitialization()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE05WorkerInitialization::WorkerInitialize() const
{
@@ -44,3 +51,4 @@ void RE05WorkerInitialization::WorkerInitialize() const
G4VSteppingVerbose::SetInstance(verbosity);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......