From 2f76de18e8bc326817e0f5138bb2c713b0b997f5 Mon Sep 17 00:00:00 2001 From: bnandi Date: Tue, 10 Jul 2007 13:57:34 +0000 Subject: [PATCH] macro to generate gain and ped files --- PMD/CreateGainCDB.C | 54 +++++++++++++++++++++++++++++++++++++++++++++ PMD/CreatePedCDB.C | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 PMD/CreateGainCDB.C create mode 100644 PMD/CreatePedCDB.C diff --git a/PMD/CreateGainCDB.C b/PMD/CreateGainCDB.C new file mode 100644 index 00000000000..edf86a59026 --- /dev/null +++ b/PMD/CreateGainCDB.C @@ -0,0 +1,54 @@ +void CreateGainCDB(TString type){ + + AliCDBManager* man = AliCDBManager::Instance(); + + if(type == "IDEAL"){ + man->SetDefaultStorage("local://CDB_IDEAL"); + }else if (type == "DECALIB"){ + man->SetDefaultStorage("local://CDB_DECALIB"); + }else{ + cout << "Not a valid type!" << endl; + break; + + } + + AliPMDCalibData *calibda = new AliPMDCalibData(); + + TRandom random; + AliCDBId id("PMD/Calib/Gain",0,0); + + const Int_t kDet = 2; + const Int_t kMod = 24; + const Int_t kRow = 48; + const Int_t kCol = 96; + + if(type == "IDEAL"){ + // SET 1 (IDEAL) + for(int a=0;aSetGainFact(a, b, c, d, random.Gaus(15,2)); + id.SetRunRange(0,50); + + + + } else if (type == "DECALIB"){ + // SET 2 (DECALIB) + for(int a=0;aSetGainFact(a, b, c, d, TMath::Abs(random.Gaus(5,0.2))); + id.SetRunRange(0,25); + } + + + + + AliCDBMetaData md; + + man->Put(calibda, id, &md); + + +} diff --git a/PMD/CreatePedCDB.C b/PMD/CreatePedCDB.C new file mode 100644 index 00000000000..475aaf4bac1 --- /dev/null +++ b/PMD/CreatePedCDB.C @@ -0,0 +1,39 @@ +void CreatePedCDB(){ + + AliCDBManager* man = AliCDBManager::Instance(); + + man->SetDefaultStorage("local://CDB_PED"); + + AliPMDPedestal *pedestal = new AliPMDPedestal(); + + TRandom random; + AliCDBId id("PMD/Calib/Ped",0,0); + + const Int_t kDet = 2; + const Int_t kMod = 24; + const Int_t kRow = 48; + const Int_t kCol = 96; + + Float_t mean = 100.0; + + for(int idet = 0; idet < kDet; idet++) + { + for(int imod = 0; imod < kMod; imod++) + { + for(int irow = 0; irow < kRow; irow++) + { + for(int icol = 0; icol < kCol; icol++) + { + Float_t rms = random.Gaus(15,2); + pedestal->SetPedMeanRms(idet, imod, irow, icol, + mean, rms); + id.SetRunRange(0,50); + } + } + } + } + + AliCDBMetaData md; + + man->Put(pedestal, id, &md); +} -- 2.39.3