#include <TFile.h>
#include <TNtuple.h>
#include <TParticle.h>
+#include <TRandom.h>
#include "AliLog.h"
#include "AliRun.h"
fPMDHit(0),
fPMD(0),
fPMDLoader(0),
+ fCalibData(GetCalibData()),
fSDigits(0),
fDigits(0),
fCell(0),
fNsdigit(0),
fNdigit(0),
fDetNo(0),
- fZPos(361.5)// in units of cm, This is the default position of PMD
+ fZPos(361.5) // in units of cm, default position of PMD
{
// Default Constructor
//
}
}
}
- fCalibData = GetCalibData();
+
}
//____________________________________________________________________________
-AliPMDDigitizer::AliPMDDigitizer(AliRunDigitizer* manager)
- :AliDigitizer(manager),
+AliPMDDigitizer::AliPMDDigitizer(const AliPMDDigitizer& digitizer):
+ AliDigitizer(digitizer),
fRunLoader(0),
fPMDHit(0),
fPMD(0),
fPMDLoader(0),
+ fCalibData(GetCalibData()),
+ fSDigits(0),
+ fDigits(0),
+ fCell(0),
+ fNsdigit(0),
+ fNdigit(0),
+ fDetNo(0),
+ fZPos(361.5) // in units of cm, default position of PMD
+{
+ // copy constructor
+ AliError("Copy constructor not allowed ");
+
+}
+//____________________________________________________________________________
+
+AliPMDDigitizer & AliPMDDigitizer::operator=(const AliPMDDigitizer& /*digitizer*/)
+{
+ // Assignment operator
+ AliError("Assignement operator not allowed ");
+
+ return *this;
+}
+//____________________________________________________________________________
+AliPMDDigitizer::AliPMDDigitizer(AliRunDigitizer* manager):
+ AliDigitizer(manager),
+ fRunLoader(0),
+ fPMDHit(0),
+ fPMD(0),
+ fPMDLoader(0),
+ fCalibData(GetCalibData()),
fSDigits(new TClonesArray("AliPMDsdigit", 1000)),
fDigits(new TClonesArray("AliPMDdigit", 1000)),
fCell(0),
{
// ctor which should be used
- fCalibData = GetCalibData();
for (Int_t i = 0; i < fgkTotUM; i++)
{
}
}
}
+
//____________________________________________________________________________
AliPMDDigitizer::~AliPMDDigitizer()
{
{
AliError(Form("Can not open session for file %s.",file));
}
-
- if (!fRunLoader->GetAliRun()) fRunLoader->LoadgAlice();
- if (!fRunLoader->TreeE()) fRunLoader->LoadHeader();
- if (!fRunLoader->TreeK()) fRunLoader->LoadKinematics();
- gAlice = fRunLoader->GetAliRun();
+ const char *cHS = strstr(option,"HS");
+ const char *cHD = strstr(option,"HD");
+ const char *cSD = strstr(option,"SD");
- if (gAlice)
- {
- AliDebug(1,"Alirun object found");
- }
- else
+ if(cHS || cHD)
{
- AliError("Could not found Alirun object");
- }
+ if (!fRunLoader->GetAliRun()) fRunLoader->LoadgAlice();
+ if (!fRunLoader->TreeE()) fRunLoader->LoadHeader();
+ if (!fRunLoader->TreeK()) fRunLoader->LoadKinematics();
- fPMD = (AliPMD*)gAlice->GetDetector("PMD");
+ gAlice = fRunLoader->GetAliRun();
+
+ if (gAlice)
+ {
+ AliDebug(1,"Alirun object found");
+ }
+ else
+ {
+ AliError("Could not found Alirun object");
+ }
+
+ fPMD = (AliPMD*)gAlice->GetDetector("PMD");
+ }
+
fPMDLoader = fRunLoader->GetLoader("PMDLoader");
if (fPMDLoader == 0x0)
{
AliError("Can not find PMDLoader");
}
- const char *cHS = strstr(option,"HS");
- const char *cHD = strstr(option,"HD");
- const char *cSD = strstr(option,"SD");
if (cHS)
{
edep = fPMDHit->GetEnergy();
Int_t vol1 = fPMDHit->GetVolume(1); // Column
Int_t vol2 = fPMDHit->GetVolume(2); // Row
- Int_t vol3 = fPMDHit->GetVolume(3); // UnitModule
- Int_t vol6 = fPMDHit->GetVolume(6); // SuperModule
+ Int_t vol7 = fPMDHit->GetVolume(7); // UnitModule
+ Int_t vol8 = fPMDHit->GetVolume(8); // SuperModule
+
// -----------------------------------------//
+ // In new geometry after adding electronics //
// For Super Module 1 & 2 //
- // nrow = 96, ncol = 48 //
- // For Super Module 3 & 4 //
// nrow = 48, ncol = 96 //
+ // For Super Module 3 & 4 //
+ // nrow = 96, ncol = 48 //
// -----------------------------------------//
+
+
- smnumber = (vol6-1)*6 + vol3;
+ smnumber = (vol8-1)*6 + vol7;
- if (vol6 == 1 || vol6 == 2)
- {
- xpad = vol1;
- ypad = vol2;
- }
- else if (vol6 == 3 || vol6 == 4)
+ if (vol8 == 1 || vol8 == 2)
{
xpad = vol2;
ypad = vol1;
}
+ else if (vol8 == 3 || vol8 == 4)
+ {
+ xpad = vol1;
+ ypad = vol2;
+ }
AliDebug(2,Form("Zposition = %f Edeposition = %f",zPos,edep));
- Float_t zposition = TMath::Abs(zPos);
- if (zposition < fZPos)
+ //Float_t zposition = TMath::Abs(zPos);
+ if (zPos < fZPos)
{
// CPV
fDetNo = 1;
}
- else if (zposition > fZPos)
+ else if (zPos > fZPos)
{
// PMD
fDetNo = 0;
}
fPMDLoader->WriteSDigits("OVERWRITE");
ResetCellADC();
-
}
//____________________________________________________________________________
xPos = fPMDHit->X();
yPos = fPMDHit->Y();
zPos = fPMDHit->Z();
-
+ edep = fPMDHit->GetEnergy();
Int_t vol1 = fPMDHit->GetVolume(1); // Column
Int_t vol2 = fPMDHit->GetVolume(2); // Row
- Int_t vol3 = fPMDHit->GetVolume(3); // UnitModule
- Int_t vol6 = fPMDHit->GetVolume(6); // SuperModule
- edep = fPMDHit->GetEnergy();
+ Int_t vol7 = fPMDHit->GetVolume(7); // UnitModule
+ Int_t vol8 = fPMDHit->GetVolume(8); // SuperModule
+
// -----------------------------------------//
+ // In new geometry after adding electronics //
// For Super Module 1 & 2 //
- // nrow = 96, ncol = 48 //
- // For Super Module 3 & 4 //
// nrow = 48, ncol = 96 //
+ // For Super Module 3 & 4 //
+ // nrow = 96, ncol = 48 //
// -----------------------------------------//
- smnumber = (vol6-1)*6 + vol3;
+ smnumber = (vol8-1)*6 + vol7;
- if (vol6 == 1 || vol6 == 2)
- {
- xpad = vol1;
- ypad = vol2;
- }
- else if (vol6 == 3 || vol6 == 4)
+ if (vol8 == 1 || vol8 == 2)
{
xpad = vol2;
ypad = vol1;
}
+ else if (vol8 == 3 || vol8 == 4)
+ {
+ xpad = vol1;
+ ypad = vol2;
+ }
AliDebug(2,Form("ZPosition = %f Edeposition = %d",zPos,edep));
- Float_t zposition = TMath::Abs(zPos);
+ //Float_t zposition = TMath::Abs(zPos);
- if (zposition < fZPos)
+ if (zPos < fZPos)
{
// CPV
fDetNo = 1;
}
- else if (zposition > fZPos)
+ else if (zPos > fZPos)
{
// PMD
fDetNo = 0;