ClassImp(AliTRDtransform)
+AliTRDgeometry* AliTRDtransform::fgGeo = NULL;
+
//_____________________________________________________________________________
AliTRDtransform::AliTRDtransform()
:TObject()
- ,fGeo(0x0)
,fDetector(0)
,fParam(0x0)
,fCalibration(0x0)
// AliTRDtransform default constructor
//
- fGeo = new AliTRDgeometry();
- if (!fGeo->CreateClusterMatrixArray()) {
- AliError("Could not get transformation matrices\n");
+ if(!fgGeo){
+ fgGeo = new AliTRDgeometry();
+ if (!fgGeo->CreateClusterMatrixArray()) {
+ AliError("Could not get transformation matrices\n");
+ }
}
fParam = AliTRDCommonParam::Instance();
//_____________________________________________________________________________
AliTRDtransform::AliTRDtransform(Int_t det)
:TObject()
- ,fGeo(0x0)
,fDetector(0)
,fParam(0x0)
,fCalibration(0x0)
// AliTRDtransform constructor for a given detector
//
- fGeo = new AliTRDgeometry();
- if (!fGeo->CreateClusterMatrixArray()) {
- AliError("Could not get transformation matrices\n");
+ if(!fgGeo){
+ fgGeo = new AliTRDgeometry();
+ if (!fgGeo->CreateClusterMatrixArray()) {
+ AliError("Could not get transformation matrices\n");
+ }
}
fParam = AliTRDCommonParam::Instance();
//_____________________________________________________________________________
AliTRDtransform::AliTRDtransform(const AliTRDtransform &t)
:TObject(t)
- ,fGeo(0x0)
,fDetector(t.fDetector)
,fParam(0x0)
,fCalibration(0x0)
// AliTRDtransform copy constructor
//
- if (fGeo) {
- delete fGeo;
- }
- fGeo = new AliTRDgeometry();
- fGeo->CreateClusterMatrixArray();
-
fParam = AliTRDCommonParam::Instance();
if (!fParam) {
AliError("Could not get common parameters\n");
// AliTRDtransform destructor
//
- if (fGeo) {
- delete fGeo;
+}
+
+//_____________________________________________________________________________
+AliTRDtransform &AliTRDtransform::operator=(const AliTRDtransform &t)
+{
+ //
+ // Assignment operator
+ //
+
+ if (this != &t) {
+ ((AliTRDtransform &) t).Copy(*this);
+ }
+
+ return *this;
+
+}
+
+//_____________________________________________________________________________
+void AliTRDtransform::Copy(TObject &t) const
+{
+ //
+ // Copy function
+ //
+
+ ((AliTRDtransform &) t).fDetector = fDetector;
+ ((AliTRDtransform &) t).fParam = AliTRDCommonParam::Instance();
+ ((AliTRDtransform &) t).fCalibration = AliTRDcalibDB::Instance();
+ if (fCalibration) {
+ ((AliTRDtransform &) t).fkCalVdriftDet = fCalibration->GetVdriftDet();
+ ((AliTRDtransform &) t).fkCalT0Det = fCalibration->GetT0Det();
+ }
+ else {
+ ((AliTRDtransform &) t).fkCalVdriftDet = 0;
+ ((AliTRDtransform &) t).fkCalT0Det = 0;
}
+ ((AliTRDtransform &) t).fCalVdriftROC = 0x0;
+ ((AliTRDtransform &) t).fCalT0ROC = 0x0;
+ ((AliTRDtransform &) t).fCalPRFROC = 0x0;
+ ((AliTRDtransform &) t).fCalVdriftDetValue = 0;
+ ((AliTRDtransform &) t).fCalT0DetValue = 0;
+ ((AliTRDtransform &) t).fSamplingFrequency = 0;
+ ((AliTRDtransform &) t).fPadPlane = 0x0;
+ ((AliTRDtransform &) t).fZShiftIdeal = 0;
+ ((AliTRDtransform &) t).fMatrix = 0x0;
}
fCalT0DetValue = fkCalT0Det->GetValue(det);
// Shift needed to define Z-position relative to middle of chamber
- Int_t layer = fGeo->GetLayer(det);
- Int_t stack = fGeo->GetStack(det);
- fPadPlane = fGeo->GetPadPlane(layer,stack);
+ Int_t layer = fgGeo->GetLayer(det);
+ Int_t stack = fgGeo->GetStack(det);
+ fPadPlane = fgGeo->GetPadPlane(layer,stack);
fZShiftIdeal = 0.5 * (fPadPlane->GetRow0() + fPadPlane->GetRowEnd());
// Get the current transformation matrix
- fMatrix = fGeo->GetClusterMatrix(det);
+ fMatrix = fgGeo->GetClusterMatrix(det);
}