AliColour::AliColour(const AliColour& right) {
//
- fName = right.fName;
- fRed = right.fRed;
- fBlue = right.fBlue;
- fGreen = right.fGreen;
+ // copy stuff
+ *this = right;
}
AliColour::~AliColour() {
AliDetSwitch::AliDetSwitch(const AliDetSwitch& right) {
//
- fDetName = right.fDetName;
- fNofVersions = right.fNofVersions;
- fDefaultVersion = right.fDefaultVersion;
- fPPRVersion = right.fPPRVersion;
- fIsStandalone = right.fIsStandalone;
- fType = right.fType;
- fSwitchedVersion = right.fSwitchedVersion;
+ // copy stuff
+ *this = right;
}
AliDetSwitch::~AliDetSwitch(){
AliGunParticle::AliGunParticle(const AliGunParticle& right) {
//
- fParticleDefinition = right.fParticleDefinition;
- fParticleMomentum = right.fParticleMomentum;
- fPosition = right.fPosition;
- fTime = right.fTime;
- fPolarization = right.fPolarization;
+ // copy stuff
+ *this = right;
}
AliGunParticle::~AliGunParticle() {
AliLVStructure::AliLVStructure(const AliLVStructure& right)
{
- // copy vector of structures
- fStructures.clearAndDestroy();
- G4int i;
- for (i=0; i<right.fStructures.entries(); i++) {
- // new full structure tree has to be created
- AliLVStructure* rhsStructure = right.fStructures[i];
- fStructures.insert(new AliLVStructure(*rhsStructure));
- }
-
- // copy vector of logical volumes
- fLogicalVolumes.clear();
- for (i=0; i<right.fLogicalVolumes.entries(); i++) {
- G4LogicalVolume* rhsLV = right.fLogicalVolumes[i];
- fLogicalVolumes.insert(rhsLV);
- }
-
- fPathName = right.fPathName;
- fDirName = right.fPathName;
- fVerboseLevel = right.fVerboseLevel;
+ // copy stuff
+ *this = right;
}
AliLVStructure::AliLVStructure() {
: TG4VSensitiveDetector(right)
{
//
- fLego = right.fLego;
- fStandardSD = right.fStandardSD;
+ // copy stuff
+ *this = right;
}
AliLegoSensitiveDetector::AliLegoSensitiveDetector() {
AliModuleConstruction::AliModuleConstruction(const AliModuleConstruction& right)
{
//
- fModuleName = right.fModuleName;
- fModuleFrameName = right.fModuleFrameName;
- fModuleFrameLV = right.fModuleFrameLV;
- fAliModule = right.fAliModule;
- fReadGeometry = right.fReadGeometry;
- fWriteGeometry = right.fWriteGeometry;
- fDataFilePath = right.fDataFilePath;
-
- // new messenger
- G4String moduleName = fModuleName;
- moduleName.toLower();
- fMessenger = new AliModuleConstructionMessenger(this, moduleName);
+ // allocation in assignement operator
+ fMessenger = 0;
+
+ // copy stuff
+ *this = right;
}
AliModuleConstruction::AliModuleConstruction()
fWriteGeometry = right.fWriteGeometry;
fDataFilePath = right.fDataFilePath;
+ // new messenger
+ if (fMessenger) delete fMessenger;
+ G4String moduleName = fModuleName;
+ moduleName.toLower();
+ fMessenger = new AliModuleConstructionMessenger(this, moduleName);
+
return *this;
}
AliMoreModulesConstruction::AliMoreModulesConstruction(
const AliMoreModulesConstruction& right)
{
- // delete current module constructions
- fModuleConstructionVector.erase(
- fModuleConstructionVector.begin(), fModuleConstructionVector.end());
-
- // create new module constructions
- G4int nofModules = right.fModuleConstructionVector.size();
- for (G4int i=0; i<nofModules; i++) {
- G4String name = right.fModuleConstructionVector[i]->GetDetName();
- G4int version = right.fModuleConstructionVector[i]->GetVersion();
- AliModuleType type = right.fModuleConstructionVector[i]->GetType();
- AddModule(name, version, type);
- }
-
- fSDManager = right.fSDManager;
+ // copy stuff
+ *this = right;
}
AliModuleType type = right.fModuleConstructionVector[i]->GetType();
AddModule(name, version, type);
}
-
+
fSDManager = right.fSDManager;
return *this;
}
AliParticleGun::AliParticleGun(const AliParticleGun& right)
+ : G4VPrimaryGenerator(right)
{
- // particles vector
- fGunParticlesVector.clearAndDestroy();
- for (G4int i=0; i<right.fGunParticlesVector.entries(); i++) {
- AliGunParticle* rhsParticle = right.fGunParticlesVector[i];
- AliGunParticle* newParticle = new AliGunParticle(*rhsParticle);
- fGunParticlesVector.insert(newParticle);
- }
-
+ // allocation
fMessenger = new AliParticleGunMessenger(this);
+
+ // copy stuff
+ *this = right;
}
AliParticleGun::~AliParticleGun() {
// check assignement to self
if (this == &right) return *this;
+ // base class assignment
+ this->G4VPrimaryGenerator::operator=(right);
+
// particles vector
fGunParticlesVector.clearAndDestroy();
for (G4int i=0; i<right.fGunParticlesVector.entries(); i++) {
AliGunParticle* newParticle = new AliGunParticle(*rhsParticle);
fGunParticlesVector.insert(newParticle);
}
-
+
return *this;
}
: TG4VSensitiveDetector(right)
{
//
- fModule = right.fModule;
+ // copy stuff
+ *this = right;
}
AliSensitiveDetector::AliSensitiveDetector(){
: AliModuleConstruction(right)
{
//
- fVersion = right.fVersion;
- fType = right.fType;
- fProcessConfig = right.fProcessConfig;
- fAllLVSensitive = right.fAllLVSensitive;
- fSDManager = right.fSDManager;
-
- G4String moduleName = right.fModuleName;
- moduleName.toLower();
- fMessenger = new AliSingleModuleConstructionMessenger(this, moduleName);
+ // allocation in assignement operator
+ fMessenger = 0;
+
+ // copy stuff
+ *this = right;
}
AliSingleModuleConstruction::AliSingleModuleConstruction() {
fProcessConfig = right.fProcessConfig;
fAllLVSensitive = right.fAllLVSensitive;
fSDManager = right.fSDManager;
-
+
+ // messenger is protected from copying
+ if (fMessenger) delete fMessenger;
+ G4String moduleName = right.fModuleName;
+ moduleName.toLower();
+ fMessenger = new AliSingleModuleConstructionMessenger(this, moduleName);
+
return *this;
}
if (fProcessConfig) {
gROOT->LoadMacro(rootFilePath);
G4String macroName = files.GetDefaultMacroName();
+ //macroName = macroName + "_" + fModuleName;
macroName = macroName + "(";
AliGlobals::AppendNumberToString(macroName, fVersion);
macroName = macroName + ")";
TG4G3ControlVector::TG4G3ControlVector(const TG4G3ControlVector& right)
{
- // copy fControlVector
+ // allocation
fControlVector = new TG4ControlValueVector;
- for (G4int i=0; i<kNoG3Controls; i++) {
- fControlVector->insert((*right.fControlVector)[i]);
- }
+
+ // copy stuff
+ *this = right;
}
TG4G3ControlVector::~TG4G3ControlVector() {
if (this == &right) return *this;
// initialize fControlVector
- fControlVector->clear();
+ fControlVector->clear();;
for (G4int i=0; i<kNoG3Controls; i++) {
fControlVector->insert((*right.fControlVector)[i]);
}
TG4G3CutVector::TG4G3CutVector()
{
// initialize fCutVector
- fCutVector = new TG4doubleVector;
+ fCutVector = new TG4doubleVector();
for (G4int i=0; i<kNoG3Cuts; i++) fCutVector->insert(0.);
}
TG4G3CutVector::TG4G3CutVector(const TG4G3CutVector& right)
{
- // copy fCutVector
- fCutVector = new TG4doubleVector;
- for (G4int i=0; i<kNoG3Cuts; i++) {
- fCutVector->insert((*right.fCutVector)[i]);
- }
+ // allocation
+ fCutVector = new TG4doubleVector();
+
+ // copy stuff
+ *this = right;
}
TG4G3CutVector::~TG4G3CutVector() {
: G4UserLimits(right)
{
//
- fCutVector = new TG4G3CutVector(*right.fCutVector);
- fControlVector = new TG4G3ControlVector(*right.fControlVector);
+ // allocation
+ fCutVector = new TG4G3CutVector();
+ fControlVector = new TG4G3ControlVector();
+
+ // copy stuff
+ *this = right;
}
TG4Limits::~TG4Limits() {