From a5edfa6fcc17f63afe6817e8d9096b675e90e18c Mon Sep 17 00:00:00 2001 From: masera Date: Thu, 13 Dec 2007 17:20:25 +0000 Subject: [PATCH] New DA for SSD pedestals and corresponding changes in the preprocessor (E. Fragiacomo) --- ITS/AliITSPedestalSSD.cxx | 58 +++++++++++++++++++++++++++++ ITS/AliITSPedestalSSD.h | 48 ++++++++++++++++++++++++ ITS/AliITSPreprocessorSSD.cxx | 70 +++++++++++++++++++++++++++-------- ITS/AliITSPreprocessorSSD.h | 2 + ITS/ITSrecLinkDef.h | 1 + ITS/libITSrec.pkg | 1 + 6 files changed, 165 insertions(+), 15 deletions(-) create mode 100644 ITS/AliITSPedestalSSD.cxx create mode 100644 ITS/AliITSPedestalSSD.h diff --git a/ITS/AliITSPedestalSSD.cxx b/ITS/AliITSPedestalSSD.cxx new file mode 100644 index 00000000000..1ba1ed6ae17 --- /dev/null +++ b/ITS/AliITSPedestalSSD.cxx @@ -0,0 +1,58 @@ +/************************************************************************** + * Copyright(c) 2007-9, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/* $Id$ */ + +#include "AliITSPedestalSSD.h" + +////////////////////////////////////////////////////// +// Author: Enrico Fragiacomo +// Date: 12/12/2007 +// // +////////////////////////////////////////////////////// + +ClassImp(AliITSPedestalSSD) + +//______________________________________________________________________ +AliITSPedestalSSD::AliITSPedestalSSD(): +fMod(0), +fPedP(0), +fPedN(0) { + // Default Constructor +} + +//______________________________________________________________________ +AliITSPedestalSSD::AliITSPedestalSSD(const AliITSPedestalSSD &source): TObject(source), +fMod(source.fMod), +fPedP(source.fPedP), +fPedN(source.fPedN) { + // copy Constructor +} +//______________________________________________________________________ +AliITSPedestalSSD::~AliITSPedestalSSD(){ + // destructor + +} + +//______________________________________________________________________ +AliITSPedestalSSD& AliITSPedestalSSD::operator=(const AliITSPedestalSSD &source) { + // ass. op. + if (this == &source) + return *this; + fMod = source.fMod; + fPedP = source.fMod; + fPedN = source.fMod; + return *this; +} diff --git a/ITS/AliITSPedestalSSD.h b/ITS/AliITSPedestalSSD.h new file mode 100644 index 00000000000..7afc2e7a7b1 --- /dev/null +++ b/ITS/AliITSPedestalSSD.h @@ -0,0 +1,48 @@ +#ifndef ALIITSPEDESTALSSD_H +#define ALIITSPEDESTALSSD_H + +#include "TObjArray.h" +#include "TArrayF.h" + +////////////////////////////////////////////// +// Author: Enrico Fragiacomo +// Date: 12/12/2007 +// // +////////////////////////////////////////////// + +/* $Id$ */ + +class AliITSPedestalSSD : public TObject { + + public: + + AliITSPedestalSSD(); + virtual ~AliITSPedestalSSD(); + AliITSPedestalSSD(const AliITSPedestalSSD &source); // copy constructor + AliITSPedestalSSD& operator=(const AliITSPedestalSSD &source); // ass. op. + + void SetNPedestalP(Int_t n) { fPedP.Set(n); } + void AddPedestalP(Int_t c, Float_t n) { fPedP.AddAt(n,c);} + TArrayF GetPedestalP() const {return fPedP; } + Float_t GetPedestalP(Int_t n) {return fPedP.At(n); } + void SetNPedestalN(Int_t n) { fPedN.Set(n); } + void AddPedestalN(Int_t c, Float_t n) { fPedN.AddAt(n,c);} + TArrayF GetPedestalN() const {return fPedN; } + Float_t GetPedestalN(Int_t n) {return fPedN.At(n); } + + void SetMod(UShort_t mod) {fMod = mod;} + UShort_t GetMod() { return fMod;} + +protected: + + UShort_t fMod; // module number (from 0 to 1535). Needed by the preprocessor to + // extract the information from the Detector Algorithm + + TArrayF fPedP; // Pedestal for P side channels + TArrayF fPedN; // Pedestal for N side channels + + private: + + ClassDef(AliITSPedestalSSD,1) // Pedestal class for SSD +}; +#endif diff --git a/ITS/AliITSPreprocessorSSD.cxx b/ITS/AliITSPreprocessorSSD.cxx index d32a035c614..591e4ff3d13 100644 --- a/ITS/AliITSPreprocessorSSD.cxx +++ b/ITS/AliITSPreprocessorSSD.cxx @@ -9,6 +9,8 @@ #include "AliITSRawStreamSSD.h" #include "AliITSNoiseSSD.h" +#include "AliITSPedestalSSD.h" +#include "AliITSBadChannelsSSD.h" #include @@ -20,6 +22,8 @@ /* $Id$ */ +const Int_t AliITSPreprocessorSSD::fgkNumberOfSSD = 1698; + ClassImp(AliITSPreprocessorSSD) //______________________________________________________________________________________________ @@ -42,11 +46,13 @@ UInt_t AliITSPreprocessorSSD::Process(TMap* /*dcsAliasMap*/) // Note. To be modified: dcsAliasMap is not needed but I can not get rid // of it unless the base class AliPreprocessor is modified accordingly. - TObjArray calib_array(1698); + TObjArray calib_array(fgkNumberOfSSD); + TObjArray badch_array(fgkNumberOfSSD); + TObjArray ped_array(fgkNumberOfSSD); //Float_t noise=0, gain=0; TString runType = GetRunType(); - if(runType == "ELECTRONICS_CALIBRATION_RUN") { + if(runType == "ELECTRONICS_CALIBRATION_RUN") { } else if(runType == "PEDESTAL_RUN") { @@ -79,21 +85,45 @@ UInt_t AliITSPreprocessorSSD::Process(TMap* /*dcsAliasMap*/) } TObjArray *cal; - f->GetObject("TObjArray;1", cal); - f->Close(); delete f; - + f->GetObject("Noise;1", cal); if(!cal) { - Log("File does not contain expected data!"); + Log("File does not contain expected data for the noise!"); delete list; - } - + } Int_t nmod = cal->GetEntries(); + for(Int_t mod=0; modAt(mod); + if((calib->GetMod()<500)||(calib->GetMod()>2198)) continue; + calib_array.AddAt(calib,calib->GetMod()-500); + } + TObjArray *bad; + f->GetObject("BadChannels;1", bad); + if(!bad) { + Log("File does not contain expected data for bad channels !"); + delete list; + } + nmod = bad->GetEntries(); for(Int_t mod=0; modAt(mod); + if((badch->GetMod()<500)||(badch->GetMod()>2198)) continue; + badch_array.AddAt(badch,badch->GetMod()-500); + } - AliITSNoiseSSD *calib = (AliITSNoiseSSD*) cal->At(mod); - calib_array.AddAt(calib,calib->GetMod()); + TObjArray *ped; + f->GetObject("Pedestal;1", ped); + if(!ped) { + Log("File does not contain expected data for the pedestals!"); + delete list; + } + nmod = ped->GetEntries(); + for(Int_t mod=0; modAt(mod); + if((pedel->GetMod()<500)||(pedel->GetMod()>2198)) continue; + ped_array.AddAt(pedel,pedel->GetMod()-500); } + + f->Close(); delete f; } else { Log("GetFile error!"); @@ -113,13 +143,23 @@ UInt_t AliITSPreprocessorSSD::Process(TMap* /*dcsAliasMap*/) AliCDBMetaData metaData; metaData.SetBeamPeriod(0); metaData.SetResponsible("Enrico Fragiacomo"); - metaData.SetComment("This preprocessor fills the TObjArray of AliITSNoiseSSD"); + metaData.SetComment("Fills noise, pedestal and bad channels TObjArray"); - if(!Store("Calib", "NoiseSSD", &calib_array, &metaData, 0, 1)) { - Log("no store"); + if(!Store("Calib", "NoiseSSD", &calib_array, &metaData, 0, 1)) { + Log("no store"); return 1; - } - + } + + if(!Store("Calib", "BadChannelsSSD", &badch_array, &metaData, 0, 1)) { + Log("no store"); + return 1; + } + + if(!StoreReferenceData("Calib","PedestalSSD", &ped_array, &metaData)) { + Log("no store"); + return 1; + } + } // end if noise_run else { Log("Nothing to do"); diff --git a/ITS/AliITSPreprocessorSSD.h b/ITS/AliITSPreprocessorSSD.h index 51a1d1958ba..e99867b0c60 100644 --- a/ITS/AliITSPreprocessorSSD.h +++ b/ITS/AliITSPreprocessorSSD.h @@ -20,6 +20,8 @@ class AliITSPreprocessorSSD : public AliPreprocessor enum {kDDLperLDC = 4}; // number of DDLs in LDC protected: + + static const Int_t fgkNumberOfSSD; // number of SSD modules virtual void Initialize(Int_t run, UInt_t startTime, UInt_t endTime); virtual UInt_t Process(TMap* dcsAliasMap); diff --git a/ITS/ITSrecLinkDef.h b/ITS/ITSrecLinkDef.h index dbe6b362d98..f2c19135eb7 100644 --- a/ITS/ITSrecLinkDef.h +++ b/ITS/ITSrecLinkDef.h @@ -90,6 +90,7 @@ #pragma link C++ class AliITSBadChannelsSPD+; #pragma link C++ class AliITSChannelSPD+; #pragma link C++ class AliITSPreprocessorSPD+; +#pragma link C++ class AliITSPedestalSSD+; #pragma link C++ class AliITSIntMap+; #pragma link C++ class AliITSIntMapNode+; #pragma link C++ class AliITSOnlineCalibrationSPD+; diff --git a/ITS/libITSrec.pkg b/ITS/libITSrec.pkg index 43555588fec..454d955f512 100644 --- a/ITS/libITSrec.pkg +++ b/ITS/libITSrec.pkg @@ -54,6 +54,7 @@ SRCS = AliITSDetTypeRec.cxx \ AliITSBeamTestDigitizer.cxx \ AliITSMultReconstructor.cxx \ AliITSPreprocessorSPD.cxx \ + AliITSPedestalSSD.cxx \ AliITSIntMap.cxx \ AliITSIntMapNode.cxx \ AliITSOnlineCalibrationSPD.cxx \ -- 2.43.0