X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=FMD%2FAliFMDCalibFaker.cxx;h=80226dfaa50861092d39f3e56712f695c32c02d7;hb=86f2216c9e28eee07c049f313105b2af9cf11bf6;hp=baf9369793d29d8486d643ff53b6c2c1c96b2f39;hpb=8ec606c2642d3da4ec714cf94002e246252ed8ce;p=u%2Fmrichter%2FAliRoot.git diff --git a/FMD/AliFMDCalibFaker.cxx b/FMD/AliFMDCalibFaker.cxx index baf9369793d..80226dfaa50 100644 --- a/FMD/AliFMDCalibFaker.cxx +++ b/FMD/AliFMDCalibFaker.cxx @@ -27,10 +27,11 @@ // the bit mask passed to the constructor, or added by `AddCalib'. // // The default is to write all calibration parameters to a local -// storage `local://cdb' which is a directory in the current -// directory. +// storage `local://$ALICE_ROOT/OCDB' which is were the sources live (sigh! +// - why oh why do we need to shit where we eat - it's just not +// healty). // -#include "AliLog.h" // ALILOG_H +#include "AliFMDDebug.h" // ALIFMDDEBUG_H ALILOG_H #include "AliFMDCalibFaker.h" // ALIFMDCALIBFAKER_H #include "AliFMDCalibGain.h" // ALIFMDCALIBGAIN_H #include "AliFMDCalibPedestal.h" // ALIFMDCALIBPEDESTAL_H @@ -39,11 +40,13 @@ #include "AliFMDCalibStripRange.h" // ALIFMDCALIBSTRIPRANGE_H #include // ALICDBMANAGER_H #include // ALICDBMANAGER_H +#include "AliFMDParameters.h" // ALIFMDPARAMETERS_H //#include #include // #include #include #include +#include //==================================================================== ClassImp(AliFMDCalibFaker) @@ -61,7 +64,7 @@ AliFMDCalibFaker::AliFMDCalibFaker(Int_t mask, const char* loc) fPedestalMin(20), fPedestalMax(30), fDeadChance(0), - fRate(1), + fRate(4), fZeroThreshold(0), fRunMin(0), fRunMax(10), @@ -206,22 +209,52 @@ AliFMDCalibFaker::MakePulseGain() const return gain; } +//__________________________________________________________________ +Float_t +AliFMDCalibFaker::MakeNoise(Char_t ring, UShort_t str) const +{ + const UShort_t innerN = 512; + const UShort_t outerN = 256; + const UShort_t innerCut = 350; + const UShort_t outerCut = 190; + const Float_t innerBase = 1.2; + const Float_t outerBase = 2.1; + const Float_t innerInc = 0.5; + const Float_t outerInc = 0.8; + Float_t cut, base, inc, n; + switch (ring) { + case 'I': + cut = innerCut; base = innerBase; inc = innerInc; n = innerN; break; + case 'O': + cut = outerCut; base = outerBase; inc = outerInc; n = outerN; break; + default: + return -1; + } + Float_t bare = base + (str < cut ? + str / cut * inc : + inc - (str - cut) / (n - cut) * inc); + return bare + gRandom->Uniform(-.07, .07); +} + //__________________________________________________________________ AliFMDCalibPedestal* AliFMDCalibFaker::MakePedestal() const { // Make the actual data AliFMDCalibPedestal* pedestal = new AliFMDCalibPedestal; + for (UShort_t det = 1; det <= 3; det++) { - Char_t rings[] = { 'I', (det == 1 ? '\0' : 'O'), '\0' }; + Char_t rings[] = { 'I', 'O', '\0' }; for (Char_t* ring = rings; *ring != '\0'; ring++) { + if (*ring == 'O' && det == 1) continue; UShort_t nSec = ( *ring == 'I' ? 20 : 40 ); UShort_t nStr = ( *ring == 'I' ? 512 : 256 ); for (UShort_t sec = 0; sec < nSec; sec++) { for (UShort_t str = 0; str < nStr; str++) { - pedestal->Set(det, *ring, sec, str, - gRandom->Uniform(fPedestalMin, fPedestalMax), 1.5); - } + Float_t noise = MakeNoise(*ring, str); + Float_t ped = gRandom->Uniform(fPedestalMin, fPedestalMax); + pedestal->Set(det, *ring, sec, str, ped, noise); + } } } } @@ -233,7 +266,8 @@ AliFMDCalibDeadMap* AliFMDCalibFaker::MakeDeadMap() const { // Make the actual data - AliFMDCalibDeadMap* deadmap = new AliFMDCalibDeadMap; + AliFMDCalibDeadMap* deadmap = new AliFMDCalibDeadMap(0); + TRandom* random = new TRandom(0); for (UShort_t det = 1; det <= 3; det++) { Char_t rings[] = { 'I', (det == 1 ? '\0' : 'O'), '\0' }; for (Char_t* ring = rings; *ring != '\0'; ring++) { @@ -242,11 +276,12 @@ AliFMDCalibFaker::MakeDeadMap() const for (UShort_t sec = 0; sec < nSec; sec++) { for (UShort_t str = 0; str < nStr; str++) { deadmap->operator()(det, *ring, sec, str) = - gRandom->Uniform(0, 1) < fDeadChance; + random->Uniform(0, 1) < fDeadChance; } } } } + if (AliDebugLevel() > 20) deadmap->Print(); return deadmap; } @@ -255,7 +290,7 @@ AliFMDCalibZeroSuppression* AliFMDCalibFaker::MakeZeroSuppression() const { // Make the actual data - AliFMDCalibZeroSuppression* zs = new AliFMDCalibZeroSuppression; + AliFMDCalibZeroSuppression* zs = new AliFMDCalibZeroSuppression(0); for (UShort_t det = 1; det <= 3; det++) { Char_t rings[] = { 'I', (det == 1 ? '\0' : 'O'), '\0' }; for (Char_t* ring = rings; *ring != '\0'; ring++) {