//_____________________________________________________________________________
AliZDC::AliZDC() :
AliDetector(),
- fNoShower (0),
+ fNoShower(0),
fPedCalib(0),
fCalibData(0),
- fRecParam(0)
+ fRecParam(0),
+ fZDCCalibFName("")
{
//
// Default constructor for the Zero Degree Calorimeter base class
fNoShower (0),
fPedCalib(0),
fCalibData(0),
- fRecParam(0)
+ fRecParam(0),
+ fZDCCalibFName("")
{
//
// Standard constructor for the Zero Degree Calorimeter base class
//_____________________________________________________________________________
AliZDC::AliZDC(const AliZDC& ZDC) :
- AliDetector("ZDC","ZDC")
+AliDetector("ZDC","ZDC"),
+fNoShower(ZDC.fNoShower),
+fPedCalib(ZDC.fPedCalib),
+fCalibData(ZDC.fCalibData),
+fRecParam(ZDC.fRecParam),
+fZDCCalibFName(ZDC.fZDCCalibFName)
{
// copy constructor
- fNoShower = ZDC.fNoShower;
- fPedCalib = ZDC.fPedCalib;
- fCalibData = ZDC.fCalibData;
- fRecParam = ZDC.fRecParam;
- fZDCCalibFName = ZDC.fZDCCalibFName;
}
//_____________________________________________________________________________
{
// Create summable digits from hits
- AliDebug(1,"\n Entering AliZDC::Hits2Digits() ");
+ AliDebug(1,"\n Entering AliZDC::Hits2SDigits() ");
fLoader->LoadHits("read");
fLoader->LoadSDigits("recreate");
// Event loop
for(Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++) {
- Float_t pmCZN = 0, pmCZP = 0, pmQZN[4], pmQZP[4], pmZEM1 = 0, pmZEM2 = 0;
- for(Int_t i = 0; i < 4; i++) pmQZN[i] = pmQZP[i] = 0;
+ Float_t pmCZNC=0, pmCZPC=0, pmCZNA=0, pmCZPA=0, pmZEM1 = 0, pmZEM2 = 0;
+ Float_t pmQZNC[4], pmQZPC[4], pmQZNA[4], pmQZPA[4];
+ for(Int_t i = 0; i < 4; i++) pmQZNC[i] = pmQZPC[i] = pmQZNA[i] = pmQZPA[i] = 0;
runLoader->GetEvent(iEvent);
TTree* treeH = fLoader->TreeH();
sector[0] = zdcHit->GetVolume(0);
sector[1] = zdcHit->GetVolume(1);
- if((sector[1] < 1) || (sector[1] > 4)) {
+ if((sector[1] < 1) || (sector[1] > 5)) {
Error("Hits2SDigits", "sector[0] = %d, sector[1] = %d",
sector[0], sector[1]);
continue;
Float_t lightQ = zdcHit->GetLightPMQ();
Float_t lightC = zdcHit->GetLightPMC();
- if(sector[0] == 1) { //ZN
- pmCZN += lightC;
- pmQZN[sector[1]-1] += lightQ;
- } else if(sector[0] == 2) { //ZP
- pmCZP += lightC;
- pmQZP[sector[1]-1] += lightQ;
- } else if(sector[0] == 3) { //ZEM
+ if(sector[0] == 1) { //ZNC
+ pmCZNC += lightC;
+ pmQZNC[sector[1]-1] += lightQ;
+ }
+ else if(sector[0] == 2) { //ZPC
+ pmCZPC += lightC;
+ pmQZPC[sector[1]-1] += lightQ;
+ }
+ else if(sector[0] == 3) { //ZEM
if(sector[1] == 1) pmZEM1 += lightC;
- else pmZEM2 += lightQ;
+ else pmZEM2 += lightQ;
}
+ if(sector[0] == 4) { //ZNA
+ pmCZNA += lightC;
+ pmQZNA[sector[1]-1] += lightQ;
+ }
+ else if(sector[0] == 5) { //ZPA
+ pmCZPA += lightC;
+ pmQZPA[sector[1]-1] += lightQ;
+ }
}//Hits loop
}
const Int_t kBufferSize = 4000;
treeS->Branch(GetName(), "AliZDCSDigit", &psdigit, kBufferSize);
- // Create sdigits for ZN1
- sector[0] = 1; // Detector = ZN1
+ // Create sdigits for ZNC
+ sector[0] = 1; // Detector = ZNC
sector[1] = 0; // Common PM ADC
- new(psdigit) AliZDCSDigit(sector, pmCZN);
- if(pmCZN > 0) treeS->Fill();
+ new(psdigit) AliZDCSDigit(sector, pmCZNC);
+ if(pmCZNC > 0) treeS->Fill();
for(Int_t j = 0; j < 4; j++) {
sector[1] = j+1; // Towers PM ADCs
- new(psdigit) AliZDCSDigit(sector, pmQZN[j]);
- if(pmQZN[j] > 0) treeS->Fill();
+ new(psdigit) AliZDCSDigit(sector, pmQZNC[j]);
+ if(pmQZNC[j] > 0) treeS->Fill();
}
- // Create sdigits for ZP1
- sector[0] = 2; // Detector = ZP1
+ // Create sdigits for ZPC
+ sector[0] = 2; // Detector = ZPC
sector[1] = 0; // Common PM ADC
- new(psdigit) AliZDCSDigit(sector, pmCZP);
- if(pmCZP > 0) treeS->Fill();
+ new(psdigit) AliZDCSDigit(sector, pmCZPC);
+ if(pmCZPC > 0) treeS->Fill();
for(Int_t j = 0; j < 4; j++) {
sector[1] = j+1; // Towers PM ADCs
- new(psdigit) AliZDCSDigit(sector, pmQZP[j]);
- if(pmQZP[j] > 0) treeS->Fill();
+ new(psdigit) AliZDCSDigit(sector, pmQZPC[j]);
+ if(pmQZPC[j] > 0) treeS->Fill();
}
// Create sdigits for ZEM
new(psdigit) AliZDCSDigit(sector, pmZEM2);
if(pmZEM2 > 0) treeS->Fill();
+ // Create sdigits for ZNA
+ sector[0] = 4; // Detector = ZNA
+ sector[1] = 0; // Common PM ADC
+ new(psdigit) AliZDCSDigit(sector, pmCZNA);
+ if(pmCZNA > 0) treeS->Fill();
+ for(Int_t j = 0; j < 4; j++) {
+ sector[1] = j+1; // Towers PM ADCs
+ new(psdigit) AliZDCSDigit(sector, pmQZNA[j]);
+ if(pmQZNA[j] > 0) treeS->Fill();
+ }
+
+ // Create sdigits for ZPA
+ sector[0] = 5; // Detector = ZPA
+ sector[1] = 0; // Common PM ADC
+ new(psdigit) AliZDCSDigit(sector, pmCZPA);
+ if(pmCZPA > 0) treeS->Fill();
+ for(Int_t j = 0; j < 4; j++) {
+ sector[1] = j+1; // Towers PM ADCs
+ new(psdigit) AliZDCSDigit(sector, pmQZPA[j]);
+ if(pmQZPA[j] > 0) treeS->Fill();
+ }
+
// write the output tree
fLoader->WriteSDigits("OVERWRITE");
}
}
// *** ADC2 (Reference PTMs) or ADC4 (Reference PTMs o.o.t.)
else if(digit.GetSector(1)==5){
- index = 20 + (digit.GetSector(0)-1)*1/3;
- lADCDataChannel = 5 + (digit.GetSector(0)-1)*8/3;
+ index = 20 + (digit.GetSector(0)-1)/3;
+ lADCDataChannel = 5 + 8*(digit.GetSector(0)-1)/3;
//
/*printf("\t AliZDC::Digits2Raw -> idig%d det %d quad %d index %d, ADCch %d ADCVal[%d, %d]\n",
iDigit,digit.GetSector(0),digit.GetSector(1),index,lADCDataChannel,
return -1;
}
//
- Float_t pedValue;
- Float_t meanPed, pedWidth;
- Int_t index=0;
- if(Quad!=5){
- if(Det==1) index = Quad+24*Res; // ZN1
- else if(Det==2) index = (Quad+5)+24*Res; // ZP1
- else if(Det==3) index = (Quad+9)+24*Res; // ZEM
- else if(Det==4) index = (Quad+12)+24*Res; // ZN2
- else if(Det==5) index = (Quad+17)+24*Res; // ZP2
- }
- else index = (Det-1)/3+22+24*Res; // Reference PMs
+ Int_t index=0, kNch=24;
+ if(Quad!=5){
+ if(Det==1) index = Quad+kNch*Res; // ZN1
+ else if(Det==2) index = Quad+5+kNch*Res; // ZP1
+ else if(Det==3) index = Quad+9+kNch*Res; // ZEM
+ else if(Det==4) index = Quad+12+kNch*Res; // ZN2
+ else if(Det==5) index = Quad+17+kNch*Res; // ZP2
+ }
+ else index = (Det-1)/3+22+kNch*Res; // Reference PMs
//
//
- meanPed = calibPed->GetMeanPed(index);
- pedWidth = calibPed->GetMeanPedWidth(index);
- pedValue = gRandom->Gaus(meanPed,pedWidth);
+ Float_t meanPed = calibPed->GetMeanPed(index);
+ Float_t pedWidth = calibPed->GetMeanPedWidth(index);
+ Float_t pedValue = gRandom->Gaus(meanPed,pedWidth);
//
//printf("\t AliZDC::Pedestal - det(%d, %d) - Ped[%d] = %d\n",Det, Quad, index,(Int_t) pedValue); // Chiara debugging!