-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #225 from PADME-Experiment/develop
Develop
- Loading branch information
Showing
62 changed files
with
1,976 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// -------------------------------------------------------------- | ||
// History: | ||
// | ||
// Created by Mauro Raggi (mauro.raggi@roma1.infn.it) 2019-04-29 | ||
// | ||
// -------------------------------------------------------------- | ||
|
||
#ifndef BeamFlagDigi_h | ||
#define BeamFlagDigi_h 1 | ||
|
||
#include "G4VDigi.hh" | ||
#include "G4TDigiCollection.hh" | ||
#include "G4Allocator.hh" | ||
#include "G4ThreeVector.hh" | ||
|
||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... | ||
|
||
class BeamFlagDigi : public G4VDigi | ||
{ | ||
public: | ||
|
||
BeamFlagDigi(); | ||
~BeamFlagDigi(); | ||
BeamFlagDigi(const BeamFlagDigi&); | ||
const BeamFlagDigi& operator=(const BeamFlagDigi&); | ||
G4int operator==(const BeamFlagDigi&) const; | ||
|
||
inline void* operator new(size_t); | ||
inline void operator delete(void*); | ||
|
||
void Draw(); | ||
void Print(); | ||
|
||
public: | ||
|
||
void SetChannelId(G4int c) { fChannelId = c; } | ||
G4int GetChannelId() { return fChannelId; } | ||
|
||
void SetTime(G4double t) { fTime = t; }; | ||
G4double GetTime() { return fTime; }; | ||
|
||
void SetEnergy(G4double e) { fEnergy = e; } | ||
G4double GetEnergy() { return fEnergy; } | ||
|
||
private: | ||
|
||
G4int fChannelId; | ||
G4double fTime; | ||
G4double fEnergy; | ||
|
||
}; | ||
|
||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... | ||
|
||
typedef G4TDigiCollection<BeamFlagDigi> BeamFlagDigiCollection; | ||
|
||
extern G4Allocator<BeamFlagDigi> BeamFlagDigiAllocator; | ||
|
||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... | ||
|
||
inline void* BeamFlagDigi::operator new(size_t) | ||
{ | ||
void* aDigi; | ||
aDigi = (void*) BeamFlagDigiAllocator.MallocSingle(); | ||
return aDigi; | ||
} | ||
|
||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... | ||
|
||
inline void BeamFlagDigi::operator delete(void* aDigi) | ||
{ | ||
BeamFlagDigiAllocator.FreeSingle((BeamFlagDigi*) aDigi); | ||
} | ||
|
||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
#ifndef BeamFlagHit_h | ||
#define BeamFlagHit_h 1 | ||
|
||
#include "G4VHit.hh" | ||
#include "G4THitsCollection.hh" | ||
#include "G4Allocator.hh" | ||
#include "G4ThreeVector.hh" | ||
|
||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... | ||
|
||
class BeamFlagHit : public G4VHit | ||
{ | ||
|
||
public: | ||
|
||
BeamFlagHit(); | ||
~BeamFlagHit(); | ||
BeamFlagHit(const BeamFlagHit&); | ||
const BeamFlagHit& operator=(const BeamFlagHit&); | ||
G4int operator==(const BeamFlagHit&) const; | ||
|
||
inline void* operator new(size_t); | ||
inline void operator delete(void*); | ||
|
||
void Draw(); | ||
void Print(); | ||
|
||
public: | ||
|
||
void SetChannelId(G4int c) { fChannelId = c; } | ||
G4int GetChannelId() { return fChannelId; } | ||
|
||
void SetTime(G4double t) { fTime = t; }; | ||
G4double GetTime() { return fTime; }; | ||
|
||
void SetEnergy(G4double e) { fEnergy = e; } | ||
G4double GetEnergy() { return fEnergy; } | ||
|
||
void SetPosition(G4ThreeVector p) { fPosition = p; } | ||
G4ThreeVector GetPosition() { return fPosition; } | ||
G4double GetPosX() { return fPosition.x(); }; | ||
G4double GetPosY() { return fPosition.y(); }; | ||
G4double GetPosZ() { return fPosition.z(); }; | ||
|
||
//M. Raggi 2/04/2019 added track energy | ||
void SetTrackEnergy(G4double etr) { fTrackEnergy = etr; } | ||
G4double GetTrackEnergy() { return fTrackEnergy; } | ||
|
||
//M. Raggi 2/04/2019 added track energy | ||
G4double GetPX() { return fMomentumDirection.x(); }; | ||
G4double GetPY() { return fMomentumDirection.y(); }; | ||
G4double GetPZ() { return fMomentumDirection.z(); }; | ||
void SetPDir(G4ThreeVector pdir) {fMomentumDirection=pdir;} | ||
|
||
void SetLocalPosition(G4ThreeVector p) { fLocalPosition = p; } | ||
G4ThreeVector GetLocalPosition() { return fLocalPosition; } | ||
G4double GetLocalPosX() { return fLocalPosition.x(); }; | ||
G4double GetLocalPosY() { return fLocalPosition.y(); }; | ||
G4double GetLocalPosZ() { return fLocalPosition.z(); }; | ||
|
||
// Kept for backward compatibility: will be removed | ||
void SetEdep(G4double e) { fEnergy = e; } | ||
G4double GetEdep() { return fEnergy; } | ||
void SetPos(G4ThreeVector xyz) { fPosition = xyz; }; | ||
G4ThreeVector GetPos() { return fPosition; }; | ||
G4double GetX() { return fPosition.x(); }; | ||
G4double GetY() { return fPosition.y(); }; | ||
G4double GetZ() { return fPosition.z(); }; | ||
|
||
private: | ||
|
||
G4int fChannelId; | ||
G4double fTime; | ||
G4double fEnergy; | ||
G4double fTrackEnergy; //M. Raggi 2/04/2019 added track energy | ||
G4ThreeVector fPosition; | ||
G4ThreeVector fLocalPosition; | ||
G4ThreeVector fMomentumDirection; //M. Raggi 5/04/2019 added track energy | ||
|
||
}; | ||
|
||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... | ||
|
||
typedef G4THitsCollection<BeamFlagHit> BeamFlagHitsCollection; | ||
|
||
extern G4Allocator<BeamFlagHit> BeamFlagHitAllocator; | ||
|
||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... | ||
|
||
inline void* BeamFlagHit::operator new(size_t) | ||
{ | ||
void *aHit; | ||
aHit = (void *) BeamFlagHitAllocator.MallocSingle(); | ||
return aHit; | ||
} | ||
|
||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... | ||
|
||
inline void BeamFlagHit::operator delete(void *aHit) | ||
{ | ||
BeamFlagHitAllocator.FreeSingle((BeamFlagHit*) aHit); | ||
} | ||
|
||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef BeamFlagSD_h | ||
#define BeamFlagSD_h 1 | ||
|
||
#include "G4VSensitiveDetector.hh" | ||
|
||
#include "BeamFlagHit.hh" | ||
|
||
class G4Step; | ||
class G4HCofThisEvent; | ||
|
||
class BeamFlagSD : public G4VSensitiveDetector | ||
{ | ||
public: | ||
BeamFlagSD(G4String); | ||
~BeamFlagSD(); | ||
|
||
void Initialize(G4HCofThisEvent*); | ||
G4bool ProcessHits(G4Step*, G4TouchableHistory*); | ||
void EndOfEvent(G4HCofThisEvent*); | ||
|
||
private: | ||
BeamFlagHitsCollection* fBeamFlagCollection; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// -------------------------------------------------------------- | ||
// History: | ||
// | ||
// Created by Mauro Raggi (mauro.raggi@roma1.infn.it) 2019-08-29 | ||
// | ||
// -------------------------------------------------------------- | ||
|
||
#include "BeamFlagDigi.hh" | ||
|
||
#include "G4UnitsTable.hh" | ||
#include "G4VVisManager.hh" | ||
#include "G4Circle.hh" | ||
#include "G4Colour.hh" | ||
#include "G4VisAttributes.hh" | ||
|
||
G4Allocator<BeamFlagDigi> BeamFlagDigiAllocator; | ||
|
||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... | ||
|
||
BeamFlagDigi::BeamFlagDigi() {} | ||
|
||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... | ||
|
||
BeamFlagDigi::~BeamFlagDigi() {} | ||
|
||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... | ||
|
||
BeamFlagDigi::BeamFlagDigi(const BeamFlagDigi& right) | ||
: G4VDigi() | ||
{ | ||
fChannelId = right.fChannelId; | ||
fTime = right.fTime; | ||
fEnergy = right.fEnergy; | ||
} | ||
|
||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... | ||
|
||
const BeamFlagDigi& BeamFlagDigi::operator=(const BeamFlagDigi& right) | ||
{ | ||
fChannelId = right.fChannelId; | ||
fTime = right.fTime; | ||
fEnergy = right.fEnergy; | ||
return *this; | ||
} | ||
|
||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... | ||
|
||
G4int BeamFlagDigi::operator==(const BeamFlagDigi& right) const | ||
{ | ||
return (this==&right) ? 1 : 0; | ||
} | ||
|
||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... | ||
|
||
void BeamFlagDigi::Draw() | ||
{ | ||
G4VVisManager* visManager = G4VVisManager::GetConcreteInstance(); | ||
if(visManager) | ||
{ | ||
//G4Circle circle(fPosition); | ||
//circle.SetScreenSize(2.); | ||
//circle.SetFillStyle(G4Circle::filled); | ||
//G4Colour colour(0.,1.,0.); | ||
//G4VisAttributes attribs(colour); | ||
//circle.SetVisAttributes(attribs); | ||
//visManager->Draw(circle); | ||
} | ||
} | ||
|
||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... | ||
|
||
void BeamFlagDigi::Print() | ||
{ | ||
G4cout << "- channel: " << fChannelId | ||
<< " time: " << G4BestUnit(fTime,"Time") | ||
<< " energy: " << G4BestUnit(fEnergy,"Energy") | ||
<< G4endl; | ||
} | ||
|
||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
Oops, something went wrong.