#include "AliGenHijingEventHeader.h"
#include "AliRunDigitizer.h"
#include "AliRunLoader.h"
+#include "AliLoader.h"
#include "AliGRPObject.h"
#include "AliCDBManager.h"
#include "AliCDBEntry.h"
fBeamEnergy(0.)
{
// Default constructor
-
+ for(Int_t i=0; i<2; i++) fADCRes[i]=0.;
}
//____________________________________________________________________________
{
// Get calibration data
if(fIsCalibration!=0) printf("\n\t AliZDCDigitizer -> Creating calibration data (pedestals)\n");
- for(Int_t i=0; i<6; i++){
+ for(Int_t i=0; i<5; i++){
for(Int_t j=0; j<5; j++)
fPMGain[i][j] = 0.;
}
{
// Copy constructor
- for(Int_t i=0; i<6; i++){
+ for(Int_t i=0; i<5; i++){
for(Int_t j=0; j<5; j++){
fPMGain[i][j] = digitizer.fPMGain[i][j];
}
// Initialize the digitizer
AliCDBEntry* entry = AliCDBManager::Instance()->Get("GRP/GRP/Data");
+ if(!entry) AliFatal("No calibration data loaded!");
AliGRPObject* grpData = 0x0;
if(entry){
TMap* m = dynamic_cast<TMap*>(entry->GetObject()); // old GRP entry
entry->SetOwner(0);
AliCDBManager::Instance()->UnloadFromCache("GRP/GRP/Data");
}
- if(!grpData) AliError("No GRP entry found in OCDB!");
+ if(!grpData){
+ AliError("No GRP entry found in OCDB! \n ");
+ return kFALSE;
+ }
TString beamType = grpData->GetBeamType();
if(beamType==AliGRPObject::GetInvalidString()){
if((beamType.CompareTo("P-P")) == 0 || (beamType.CompareTo("p-p")) == 0){
//PTM gains rescaled to beam energy for p-p
+ // New correction coefficients for PMT gains needed
+ // to reproduce experimental spectra (from Grazia Jul 2010)
if(fBeamEnergy != 0){
- for(Int_t j = 0; j < 5; j++){
- fPMGain[0][j] = 1.515831*(661.444/fBeamEnergy+0.000740671)*10000000;
- fPMGain[1][j] = 0.674234*(864.350/fBeamEnergy+0.00234375)*10000000;
- fPMGain[3][j] = 1.350938*(661.444/fBeamEnergy+0.000740671)*10000000;
- fPMGain[4][j] = 0.678597*(864.350/fBeamEnergy+0.00234375)*10000000;
+ for(Int_t j = 0; j < 5; j++){
+ fPMGain[0][j] = 1.515831*(661.444/fBeamEnergy+0.000740671)*10000000;
+ fPMGain[1][j] = 0.674234*(864.350/fBeamEnergy+0.00234375)*10000000;
+ fPMGain[3][j] = 1.350938*(661.444/fBeamEnergy+0.000740671)*10000000;
+ fPMGain[4][j] = 0.678597*(864.350/fBeamEnergy+0.00234375)*10000000;
+ }
+ fPMGain[2][1] = 0.869654*(1.32312-0.000101515*fBeamEnergy)*10000000;
+ fPMGain[2][2] = 1.030883*(1.32312-0.000101515*fBeamEnergy)*10000000;
+ //
+ AliInfo(Form(" PMT gains for p-p @ %1.0f+%1.0f GeV: ZN(%1.0f), ZP(%1.0f), ZEM(%1.0f)\n",
+ fBeamEnergy, fBeamEnergy, fPMGain[0][0], fPMGain[1][0], fPMGain[2][1]));
}
- fPMGain[2][1] = 0.869654*(1.32312-0.000101515*fBeamEnergy)*10000000;
- fPMGain[2][2] = 1.030883*(1.32312-0.000101515*fBeamEnergy)*10000000;
- AliInfo(Form(" PMT gains for p-p @ %1.0f+%1.0f GeV: ZN(%1.0f), ZP(%1.0f), ZEM(%1.0f)\n",
- fBeamEnergy, fBeamEnergy, fPMGain[0][0], fPMGain[1][0], fPMGain[2][0]));
+ else{ // for RELDIS simulation
+ Float_t scalGainFactor = 0.5;
+ for(Int_t j = 0; j < 5; j++){
+ fPMGain[0][j] = 50000./scalGainFactor; // ZNC
+ fPMGain[1][j] = 100000./scalGainFactor; // ZPC
+ fPMGain[2][j] = 100000./scalGainFactor; // ZEM
+ fPMGain[3][j] = 50000./scalGainFactor; // ZNA
+ fPMGain[4][j] = 100000./scalGainFactor; // ZPA
+ }
+ //
+ AliInfo(Form(" PMT gains for RELDIS simulation: ZN(%1.0f), ZP(%1.0f), ZEM(%1.0f)\n",
+ fPMGain[0][0], fPMGain[1][0], fPMGain[2][1]));
}
}
else if((beamType.CompareTo("A-A")) == 0){
// PTM gains for Pb-Pb @ 2.7+2.7 A TeV ***************
// rescaled for Pb-Pb @ 1.38+1.38 A TeV ***************
- // New correction coefficients for PMT gains needed
- // to reproduce experimental spectra (from Grazia Jul 2010)
+ // Values corrected after 2010 Pb-Pb data taking (7/2/2011 - Ch.)
+ // Experimental data compared to EMD simulation for single nucleon peaks:
+ // ZN gains must be divided by 4, ZP gains by 10!
Float_t scalGainFactor = fBeamEnergy/2760.;
for(Int_t j = 0; j < 5; j++){
- fPMGain[0][j] = 50000./scalGainFactor;
- fPMGain[1][j] = 100000./scalGainFactor;
- fPMGain[3][j] = 50000./scalGainFactor;
- fPMGain[4][j] = 100000./scalGainFactor;
- fPMGain[5][j] = 100000./scalGainFactor;
+ fPMGain[0][j] = 50000./(4*scalGainFactor); // ZNC
+ fPMGain[1][j] = 100000./(5*scalGainFactor); // ZPC
+ fPMGain[2][j] = 100000./scalGainFactor; // ZEM
+ fPMGain[3][j] = 50000./(4*scalGainFactor); // ZNA
+ fPMGain[4][j] = 100000./(5*scalGainFactor); // ZPA
}
AliInfo(Form(" PMT gains for Pb-Pb @ %1.0f+%1.0f A GeV: ZN(%1.0f), ZP(%1.0f), ZEM(%1.0f)\n",
- fBeamEnergy, fBeamEnergy, fPMGain[0][0], fPMGain[1][0], fPMGain[2][0]));
+ fBeamEnergy, fBeamEnergy, fPMGain[0][0], fPMGain[1][0], fPMGain[2][1]));
}
// ADC Caen V965
}
// impact parameter and number of spectators
- Float_t impPar = -1;
+ Float_t impPar = 0;
Int_t specNTarg = 0, specPTarg = 0;
Int_t specNProj = 0, specPProj = 0;
Float_t signalTime0 = 0.;
specPProj = ((AliGenHijingEventHeader*) genHeader)->ProjSpectatorsp();
specNTarg = ((AliGenHijingEventHeader*) genHeader)->TargSpectatorsn();
specPTarg = ((AliGenHijingEventHeader*) genHeader)->TargSpectatorsp();
- printf("\n\t AliZDCDigitizer: b = %1.2f fm\n"
+ /*printf("\n\t AliZDCDigitizer: b = %1.2f fm\n"
" \t PROJ.: #spectator n %d, #spectator p %d\n"
" \t TARG.: #spectator n %d, #spectator p %d\n",
- impPar, specNProj, specPProj, specNTarg, specPTarg);
+ impPar, specNProj, specPProj, specNTarg, specPTarg);*/
}
}
Int_t freeSpecNTarg, freeSpecPTarg;
Fragmentation(impPar, specNTarg, specPTarg, freeSpecNTarg, freeSpecPTarg);
SpectatorSignal(1, freeSpecNProj, pm);
- printf("\t AliZDCDigitizer -> Adding signal for %d PROJ free spectator n",freeSpecNProj);
+// printf("\t AliZDCDigitizer -> Adding signal for %d PROJ free spectator n",freeSpecNProj);
SpectatorSignal(2, freeSpecPProj, pm);
- printf(" and %d free spectator p\n",freeSpecPProj);
+// printf(" and %d free spectator p\n",freeSpecPProj);
SpectatorSignal(3, freeSpecNTarg, pm);
- printf("\t AliZDCDigitizer -> Adding signal for %d TARG free spectator n",freeSpecNTarg);
+// printf("\t AliZDCDigitizer -> Adding signal for %d TARG free spectator n",freeSpecNTarg);
SpectatorSignal(4, freeSpecPTarg, pm);
- printf(" and %d free spectator p\n\n",freeSpecPTarg);
+// printf(" and %d free spectator p\n\n",freeSpecPTarg);
}
Int_t nAlpha = frag.GetNalpha();
// Attach neutrons
+ frag.AttachNeutrons();
Int_t ztot = frag.GetZtot();
Int_t ntot = frag.GetNtot();
- frag.AttachNeutrons();
+
+ // Removing fragments and alpha pcs
freeSpecN = specN-ntot-2*nAlpha;
freeSpecP = specP-ztot-2*nAlpha;
+
// Removing deuterons
Int_t ndeu = (Int_t) (freeSpecN*frag.DeuteronNumber());
freeSpecN -= ndeu;
+ freeSpecP -= ndeu;
//
if(freeSpecN<0) freeSpecN=0;
if(freeSpecP<0) freeSpecP=0;
return;
}
- TNtuple* zdcSignal;
+ TNtuple* zdcSignal=0x0;
Float_t sqrtS = 2*fBeamEnergy;
//
}
}
+ if(!zdcSignal){
+ printf("\n No spectator signal available for ZDC digitization\n");
+ return;
+ }
+
Int_t nentries = (Int_t) zdcSignal->GetEntries();
Float_t *entry;