{
// 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");
}
treeD->Branch("ZDC", "AliZDCDigit", &pdigit, kBufferSize);
// Create digits
- Int_t sector[2], sectorL[2];
- Int_t digi[2], digiL[2], digioot[2];
- for(sector[0]=1; sector[0]<=3; sector[0]++){
+ Int_t sector[2];
+ Int_t digi[2], digioot[2];
+ for(sector[0]=1; sector[0]<6; sector[0]++){
for(sector[1]=0; sector[1]<5; sector[1]++){
if((sector[0]==3) && ((sector[1]<1) || (sector[1]>2))) continue;
for(Int_t res=0; res<2; res++){
//
new(pdigit) AliZDCDigit(sector, digi);
treeD->Fill();
- //
- // --- Adding digits for 2nd ZDC set (left side w.r.t. IP) ---
- // --- they are copied from right ZDC digits
- if(sector[0]==1 || sector[0]==2){
- sectorL[0] = sector[0]+3;
- sectorL[1] = sector[1];
- for(Int_t res=0; res<2; res++){
- digiL[res] = Phe2ADCch(sectorL[0], sectorL[1], pm[sector[0]-1][sector[1]], res)
- + Pedestal(sectorL[0], sectorL[1], res);
- }
- /*printf("\t DIGIT added -> det %d quad %d - digi[0,1] = [%d, %d]\n",
- sectorL[0], sectorL[1], digiL[0], digiL[1]); // Chiara debugging!
- */
- //
- new(pdigit) AliZDCDigit(sectorL, digiL);
- treeD->Fill();
- }
}
} // Loop over detector
// Adding in-time digits for 2 reference PTM signals (after signal ch.)
Int_t sectorRef[2];
sectorRef[1] = 5;
Int_t sigRef[2];
+ // Reference signal are set to 100 (high gain chain) and 800 (low gain chain)
if(fIsCalibration==0) {sigRef[0]=100; sigRef[1]=800;}
- else {sigRef[0]=0; sigRef[1]=0;}
+ else {sigRef[0]=0; sigRef[1]=0;} // calibration -> simulation of pedestal values
//
for(Int_t iref=0; iref<2; iref++){
sectorRef[0] = 3*iref+1;
}
//
// --- Adding digits for out-of-time channels after signal digits
- for(sector[0]=1; sector[0]<=3; sector[0]++){
+ for(sector[0]=1; sector[0]<6; sector[0]++){
for(sector[1]=0; sector[1]<5; sector[1]++){
if((sector[0]==3) && ((sector[1]<1) || (sector[1]>2))) continue;
for(Int_t res=0; res<2; res++){
//
new(pdigit) AliZDCDigit(sector, digioot);
treeD->Fill();
- //
- if(sector[0]==1 || sector[0]==2){
- sectorL[0] = sector[0]+3;
- sectorL[1] = sector[1];
- for(Int_t res=0; res<2; res++){
- digioot[res] = Pedestal(sectorL[0], sectorL[1], res); // out-of-time ADCs
- }
- /*printf("\t DIGIToot added -> det = %d, quad = %d - digi[0,1] = [%d, %d]\n",
- sectorL[0], sectorL[1], digioot[0], digioot[1]); // Chiara debugging!
- */
- //
- new(pdigit) AliZDCDigit(sectorL, digioot);
- treeD->Fill();
- }
- //
}
}
// Adding out-of-time digits for 2 reference PTM signals (after out-of-time ch.)
*/
new(pdigit) AliZDCDigit(sectorRef, sigRefoot);
treeD->Fill();
-
}
//printf("\t AliZDCDigitizer -> TreeD has %d entries\n",(Int_t) treeD->GetEntries());