From 124343813e34e1e6cee44298c99f8a86d502e7e6 Mon Sep 17 00:00:00 2001 From: coppedis Date: Fri, 10 Jul 2009 18:44:02 +0000 Subject: [PATCH] Updated PMT gains to calculate response in p-p --- ZDC/AliZDCDigitizer.cxx | 66 ++++++++++++++++++++++++++++++++----- ZDC/AliZDCReconstructor.cxx | 34 +++++++------------ 2 files changed, 68 insertions(+), 32 deletions(-) diff --git a/ZDC/AliZDCDigitizer.cxx b/ZDC/AliZDCDigitizer.cxx index 8c6c62cb372..3079c56d808 100644 --- a/ZDC/AliZDCDigitizer.cxx +++ b/ZDC/AliZDCDigitizer.cxx @@ -36,6 +36,7 @@ #include "AliGenHijingEventHeader.h" #include "AliRunDigitizer.h" #include "AliRunLoader.h" +#include "AliGRPObject.h" #include "AliCDBManager.h" #include "AliCDBEntry.h" #include "AliZDCSDigit.h" @@ -110,21 +111,68 @@ AliZDCDigitizer::AliZDCDigitizer(const AliZDCDigitizer &digitizer): } for(Int_t i=0; i<2; i++) fADCRes[i] = digitizer.fADCRes[i]; + } //____________________________________________________________________________ Bool_t AliZDCDigitizer::Init() { // Initialize the digitizer - // NB -> PM gain vs. HV & ADC resolutions will move to DCDB *************** - for(Int_t j = 0; j < 5; j++){ - fPMGain[0][j] = 50000.; - fPMGain[1][j] = 100000.; - fPMGain[2][j] = 100000.; - fPMGain[3][j] = 50000.; - fPMGain[4][j] = 100000.; - fPMGain[5][j] = 100000.; - } + + AliCDBEntry* entry = AliCDBManager::Instance()->Get("GRP/GRP/Data"); + AliGRPObject* grpData = 0x0; + if(entry){ + TMap* m = dynamic_cast(entry->GetObject()); // old GRP entry + if(m){ + //m->Print(); + grpData = new AliGRPObject(); + grpData->ReadValuesFromMap(m); + } + else{ + grpData = dynamic_cast(entry->GetObject()); // new GRP entry + } + entry->SetOwner(0); + AliCDBManager::Instance()->UnloadFromCache("GRP/GRP/Data"); + } + if(!grpData) AliError("No GRP entry found in OCDB!"); + + TString beamType = grpData->GetBeamType(); + if(beamType==AliGRPObject::GetInvalidString()){ + AliError("\t UNKNOWN beam type from GRP obj -> PMT gains not set in ZDC digitizer!!!\n"); + } + + Float_t beamEnergy = grpData->GetBeamEnergy(); + if(beamEnergy==AliGRPObject::GetInvalidFloat()){ + AliWarning("GRP/GRP/Data entry: missing value for the beam energy ! Using 0."); + AliError("\t UNKNOWN beam type from GRP obj -> PMT gains not set in ZDC digitizer!!!\n"); + beamEnergy = 0.; + } + + if((beamType.CompareTo("P-P")) == 0){ + //PTM gains rescaled to beam energy for p-p + if(beamEnergy != 0){ + for(Int_t j = 0; j < 5; j++){ + fPMGain[0][j] = 661.444/beamEnergy+0.000740671; + fPMGain[1][j] = 864.350/beamEnergy+0.002344; + fPMGain[3][j] = 1.32312-0.000101515*beamEnergy; + fPMGain[4][j] = fPMGain[0][j]; + fPMGain[5][j] = fPMGain[1][j] ; + } + } + } + else if((beamType.CompareTo("A-A")) == 0){ + // PTM gains for Pb-Pb @ 2.7_2.7 A TeV *************** + for(Int_t j = 0; j < 5; j++){ + fPMGain[0][j] = 50000.; + fPMGain[1][j] = 100000.; + fPMGain[2][j] = 100000.; + fPMGain[3][j] = 50000.; + fPMGain[4][j] = 100000.; + fPMGain[5][j] = 100000.; + } + } + + // ADC Caen V965 fADCRes[0] = 0.0000008; // ADC Resolution high gain: 200 fC/adcCh fADCRes[1] = 0.0000064; // ADC Resolution low gain: 25 fC/adcCh diff --git a/ZDC/AliZDCReconstructor.cxx b/ZDC/AliZDCReconstructor.cxx index 747ab4aa97d..59a2b004ae8 100644 --- a/ZDC/AliZDCReconstructor.cxx +++ b/ZDC/AliZDCReconstructor.cxx @@ -61,7 +61,7 @@ AliZDCReconstructor:: AliZDCReconstructor() : fNRun(0), fIsCalibrationMB(kFALSE), fPedSubMode(0), - fSignalThreshold(0) + fSignalThreshold(7) { // **** Default constructor @@ -615,19 +615,13 @@ void AliZDCReconstructor::ReconstructEventpp(TTree *clustersTree, Float_t* corrA UInt_t recoFlag=0; UInt_t rFlags[32]; for(Int_t ifl=0; ifl<32; ifl++) rFlags[ifl]=0; - Float_t sumZNAhg=0, sumZPAhg=0, sumZNChg=0, sumZPChg=0; - for(Int_t jj=0; jj<5; jj++){ - sumZNAhg += corrADCZN2[jj]; - sumZPAhg += corrADCZP2[jj]; - sumZNChg += corrADCZN1[jj]; - sumZPChg += corrADCZP1[jj]; - } - if(sumZNAhg>fSignalThreshold) rFlags[0] = 0x1; - if(sumZPAhg>fSignalThreshold) rFlags[1] = 0x1; + + if(corrADCZN2[0]>fSignalThreshold) rFlags[0] = 0x1; + if(corrADCZP2[0]>fSignalThreshold) rFlags[1] = 0x1; if(corrADCZEM1[0]>fSignalThreshold) rFlags[2] = 0x1; if(corrADCZEM2[0]>fSignalThreshold) rFlags[3] = 0x1; - if(sumZNChg>fSignalThreshold) rFlags[4] = 0x1; - if(sumZPChg>fSignalThreshold) rFlags[5] = 0x1; + if(corrADCZN1[0]>fSignalThreshold) rFlags[4] = 0x1; + if(corrADCZP1[0]>fSignalThreshold) rFlags[5] = 0x1; // if(channelsOff==kTRUE) rFlags[8] = 0x1; if(chUnderflow == kTRUE) rFlags[9] = 0x1; @@ -745,19 +739,13 @@ void AliZDCReconstructor::ReconstructEventPbPb(TTree *clustersTree, UInt_t recoFlag=0; UInt_t rFlags[32]; for(Int_t ifl=0; ifl<32; ifl++) rFlags[ifl]=0; - Float_t sumZNAhg=0, sumZPAhg=0, sumZNChg=0, sumZPChg=0; - for(Int_t jj=0; jj<5; jj++){ - sumZNAhg += corrADCZN2[jj]; - sumZPAhg += corrADCZP2[jj]; - sumZNChg += corrADCZN1[jj]; - sumZPChg += corrADCZP1[jj]; - } - if(sumZNAhg>fSignalThreshold) rFlags[0] = 0x1; - if(sumZPAhg>fSignalThreshold) rFlags[1] = 0x1; + + if(corrADCZN2[0]>fSignalThreshold) rFlags[0] = 0x1; + if(corrADCZP2[0]>fSignalThreshold) rFlags[1] = 0x1; if(corrADCZEM1[0]>fSignalThreshold) rFlags[2] = 0x1; if(corrADCZEM2[0]>fSignalThreshold) rFlags[3] = 0x1; - if(sumZNChg>fSignalThreshold) rFlags[4] = 0x1; - if(sumZPChg>fSignalThreshold) rFlags[5] = 0x1; + if(corrADCZN1[0]>fSignalThreshold) rFlags[4] = 0x1; + if(corrADCZP1[0]>fSignalThreshold) rFlags[5] = 0x1; // if(channelsOff==kTRUE) rFlags[8] = 0x1; if(chUnderflow == kTRUE) rFlags[9] = 0x1; -- 2.43.0