Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Data Fields
FCALTestbeamSetupSD Class Reference

#include <FCALTestbeamSetupSD.hh>

Inheritance diagram for FCALTestbeamSetupSD:
G4VSensitiveDetector

Public Member Functions

 FCALTestbeamSetupSD (G4String)
 
 ~FCALTestbeamSetupSD ()
 
void Initialize (G4HCofThisEvent *)
 
G4bool ProcessHits (G4Step *, G4TouchableHistory *)
 
void EndOfEvent (G4HCofThisEvent *)
 
void clear ()
 
void DrawAll ()
 
void PrintAll ()
 
- Public Member Functions inherited from G4VSensitiveDetector
 G4VSensitiveDetector (G4String name)
 
 G4VSensitiveDetector (const G4VSensitiveDetector &right)
 
virtual ~G4VSensitiveDetector ()
 
const G4VSensitiveDetectoroperator= (const G4VSensitiveDetector &right)
 
G4int operator== (const G4VSensitiveDetector &right) const
 
G4int operator!= (const G4VSensitiveDetector &right) const
 
G4bool Hit (G4Step *aStep)
 
void SetROgeometry (G4VReadOutGeometry *value)
 
void SetFilter (G4VSDFilter *value)
 
G4int GetNumberOfCollections () const
 
G4String GetCollectionName (G4int id) const
 
void SetVerboseLevel (G4int vl)
 
void Activate (G4bool activeFlag)
 
G4bool isActive () const
 
G4String GetName () const
 
G4String GetPathName () const
 
G4String GetFullPathName () const
 
G4VReadOutGeometryGetROgeometry () const
 
G4VSDFilterGetFilter () const
 
virtual G4VSensitiveDetectorClone () const
 

Data Fields

G4double EBeamS1
 
G4double EBeamS2
 
G4double EBeamS3
 
G4double EHoleScint
 
G4double EBeamHole
 
G4double EBeamDead
 
G4int TailCatcherID
 
G4double ETailVis [8]
 
G4double ETailDep [7]
 

Additional Inherited Members

- Protected Member Functions inherited from G4VSensitiveDetector
virtual G4int GetCollectionID (G4int i)
 
- Protected Attributes inherited from G4VSensitiveDetector
G4CollectionNameVector collectionName
 
G4String SensitiveDetectorName
 
G4String thePathName
 
G4String fullPathName
 
G4int verboseLevel
 
G4bool active
 
G4VReadOutGeometryROgeometry
 
G4VSDFilterfilter
 

Detailed Description

Definition at line 46 of file FCALTestbeamSetupSD.hh.

Constructor & Destructor Documentation

FCALTestbeamSetupSD::FCALTestbeamSetupSD ( G4String  name)

Definition at line 54 of file FCALTestbeamSetupSD.cc.

54  : G4VSensitiveDetector(name)
55 {;}
G4VSensitiveDetector(G4String name)
FCALTestbeamSetupSD::~FCALTestbeamSetupSD ( )

Definition at line 59 of file FCALTestbeamSetupSD.cc.

60 {;}

Member Function Documentation

void FCALTestbeamSetupSD::clear ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 175 of file FCALTestbeamSetupSD.cc.

176 {}
void FCALTestbeamSetupSD::DrawAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 180 of file FCALTestbeamSetupSD.cc.

181 {}
void FCALTestbeamSetupSD::EndOfEvent ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 130 of file FCALTestbeamSetupSD.cc.

References testem0::app, EBeamDead, EBeamHole, EBeamS1, EBeamS2, EBeamS3, EHoleScint, ETailDep, ETailVis, G4cout, G4endl, and python.hepunit::MeV.

131 {
132  G4cout << " Visisble Energy in S1 , S2 , S3 in (MeV)" << G4endl;
133  G4cout << EBeamS1/MeV << " " << EBeamS2/MeV << " " << EBeamS3/MeV << " " << G4endl;
134 
135  G4cout << " Visible Energy in Hole Counter (MeV) " << G4endl;
136  G4cout << EHoleScint/MeV << " " << EBeamHole/MeV << G4endl;
137 
138  G4cout << " Visible Energy in Upstream Dead Materials " << G4endl;
139  G4cout << EBeamDead/MeV << G4endl;
140 
141  G4cout << " Visible Energy in Tail Catcher Scintillator" << G4endl;
142  G4int j;
143  for (j=1; j<8 ; j++) {G4cout << ETailVis[j]/MeV << " " ;}; G4cout << G4endl;
144 
145  G4cout << " Visible Energy in Tail Catcher Absorber" << G4endl;
146  for (j=1; j<7 ; j++) {G4cout << ETailDep[j]/MeV << " " ;}; G4cout << G4endl;
147 
148 // Write data in File
149  //-------------------
150  G4String FileName = "Beam_802_1mm.dat";
151  std::ios::openmode iostemp;
152  if(InitBeam == 0) {
153  iostemp = std::ios::out;
154  InitBeam++;
155  } else {
156  iostemp = std::ios::out|std::ios::app;
157  };
158 
159  std::ofstream BeamDatafile(FileName, iostemp);
160  // BeamDatafile.precision(5);
161 
162  BeamDatafile << EBeamS1/MeV << " " << EBeamS2/MeV << " " << EBeamS3/MeV << std::endl;
163  BeamDatafile << EBeamHole/MeV << std::endl;
164  BeamDatafile << EBeamDead/MeV << std::endl;
165  for (j=1; j<8 ; j++) { BeamDatafile << ETailVis[j]/MeV << " " ;} ; BeamDatafile << std::endl;
166  for (j=1; j<7 ; j++) { BeamDatafile << ETailDep[j]/MeV << " " ;} ; BeamDatafile << std::endl;
167 
168  BeamDatafile.close();
169 
170 
171 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void FCALTestbeamSetupSD::Initialize ( G4HCofThisEvent )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 64 of file FCALTestbeamSetupSD.cc.

References EBeamDead, EBeamHole, EBeamS1, EBeamS2, EBeamS3, EHoleScint, ETailDep, ETailVis, and TailCatcherID.

65 {
66  EBeamS1 = EBeamS2 = EBeamS3 = 0.;
67  EHoleScint = EBeamHole = 0.;
68  EBeamDead = 0;
69  G4int j;
70  for (j =0 ; j<8 ; j++) { ETailVis[j] = 0.;};
71  for (j =0 ; j<7 ; j++) { ETailDep[j] = 0.;};
72  TailCatcherID = 0;
73 }
int G4int
Definition: G4Types.hh:78
void FCALTestbeamSetupSD::PrintAll ( void  )
virtual

Reimplemented from G4VSensitiveDetector.

Definition at line 185 of file FCALTestbeamSetupSD.cc.

186 {}
G4bool FCALTestbeamSetupSD::ProcessHits ( G4Step aStep,
G4TouchableHistory  
)
virtual

Implements G4VSensitiveDetector.

Definition at line 77 of file FCALTestbeamSetupSD.cc.

References EBeamDead, EBeamHole, EBeamS1, EBeamS2, EBeamS3, EHoleScint, ETailDep, ETailVis, G4VPhysicalVolume::GetCopyNo(), G4VPhysicalVolume::GetName(), G4Step::GetPreStepPoint(), G4Step::GetTotalEnergyDeposit(), G4StepPoint::GetTouchable(), G4TouchableHistory::GetVolume(), and TailCatcherID.

78 {
79 
80  G4double edep = aStep->GetTotalEnergyDeposit();
81  if (edep==0.) return false;
82 
83  G4TouchableHistory* theTouchable
85  G4VPhysicalVolume* physVol = theTouchable->GetVolume();
86 
87 
88  if(strcmp(physVol->GetName(),"ScintS1Physical")==0) {
89  EBeamS1 = EBeamS1 + edep;}
90 
91  if(strcmp(physVol->GetName(),"ScintS2Physical")==0) {
92  EBeamS2 = EBeamS2 + edep;}
93 
94  if(strcmp(physVol->GetName(),"ScintS3Physical")==0) {
95  EBeamS3 = EBeamS3 + edep;}
96 
97  if(strcmp(physVol->GetName(),"HoleScintPhysical")==0){ EHoleScint += edep;}
98  if(strcmp(physVol->GetName(),"HoleCntrScintPhysical")==0){
99  EBeamHole = EBeamHole + edep;}
100 
101  if(strcmp(physVol->GetName(),"MWPCPhysical")==0) { EBeamDead += edep;};
102  if(strcmp(physVol->GetName(),"HoleCntrPbPhysical")==0) { EBeamDead += edep;};
103  if(strcmp(physVol->GetName(),"HoleCntrAlPhysical")==0) { EBeamDead += edep;};
104  if(strcmp(physVol->GetName(),"LeadWallPhysical")==0) { EBeamDead += edep;};
105  if(strcmp(physVol->GetName(),"IronWallPhysical")==0) { EBeamDead += edep;};
106 
107  if(strcmp(physVol->GetName(),"BigScintPhysical")==0) {
108  TailCatcherID = physVol->GetCopyNo();
109  if(TailCatcherID > 0) ETailVis[TailCatcherID] += edep;
110  }
111  if(strcmp(physVol->GetName(),"SmallScintPhysical")==0) {
112  TailCatcherID = physVol->GetCopyNo();
113  if(TailCatcherID > 0) ETailVis[TailCatcherID + 3] += edep;
114  }
115 
116  if(strcmp(physVol->GetName(),"BigIronPhysical")==0) {
117  TailCatcherID = physVol->GetCopyNo();
118  if(TailCatcherID > 0) ETailDep[TailCatcherID] += edep;
119  }
120  if(strcmp(physVol->GetName(),"SmallIronPhysical")==0) {
121  TailCatcherID = physVol->GetCopyNo();
122  if(TailCatcherID > 0) ETailDep[TailCatcherID+2] += edep;
123  }
124 
125  return true;
126 }
G4VPhysicalVolume * GetVolume(G4int depth=0) const
const G4VTouchable * GetTouchable() const
G4StepPoint * GetPreStepPoint() const
const G4String & GetName() const
G4double GetTotalEnergyDeposit() const
virtual G4int GetCopyNo() const =0
double G4double
Definition: G4Types.hh:76

Field Documentation

G4double FCALTestbeamSetupSD::EBeamDead

Definition at line 73 of file FCALTestbeamSetupSD.hh.

Referenced by EndOfEvent(), Initialize(), and ProcessHits().

G4double FCALTestbeamSetupSD::EBeamHole

Definition at line 72 of file FCALTestbeamSetupSD.hh.

Referenced by EndOfEvent(), Initialize(), and ProcessHits().

G4double FCALTestbeamSetupSD::EBeamS1

Definition at line 71 of file FCALTestbeamSetupSD.hh.

Referenced by EndOfEvent(), Initialize(), and ProcessHits().

G4double FCALTestbeamSetupSD::EBeamS2

Definition at line 71 of file FCALTestbeamSetupSD.hh.

Referenced by EndOfEvent(), Initialize(), and ProcessHits().

G4double FCALTestbeamSetupSD::EBeamS3

Definition at line 71 of file FCALTestbeamSetupSD.hh.

Referenced by EndOfEvent(), Initialize(), and ProcessHits().

G4double FCALTestbeamSetupSD::EHoleScint

Definition at line 72 of file FCALTestbeamSetupSD.hh.

Referenced by EndOfEvent(), Initialize(), and ProcessHits().

G4double FCALTestbeamSetupSD::ETailDep[7]

Definition at line 75 of file FCALTestbeamSetupSD.hh.

Referenced by EndOfEvent(), Initialize(), and ProcessHits().

G4double FCALTestbeamSetupSD::ETailVis[8]

Definition at line 75 of file FCALTestbeamSetupSD.hh.

Referenced by EndOfEvent(), Initialize(), and ProcessHits().

G4int FCALTestbeamSetupSD::TailCatcherID

Definition at line 74 of file FCALTestbeamSetupSD.hh.

Referenced by Initialize(), and ProcessHits().


The documentation for this class was generated from the following files: