From: policheh Date: Fri, 23 Mar 2007 10:55:51 +0000 (+0000) Subject: EMC bad channels map introduced. X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=52ee9a4cc91b5b666329eb7b4ee5eaa00fe6c3af EMC bad channels map introduced. --- diff --git a/PHOS/AliPHOSEmcBadChannelsMap.cxx b/PHOS/AliPHOSEmcBadChannelsMap.cxx new file mode 100644 index 00000000000..bf3a60860ad --- /dev/null +++ b/PHOS/AliPHOSEmcBadChannelsMap.cxx @@ -0,0 +1,79 @@ +/************************************************************************** + * Copyright(c) 2007, 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$ */ + +/////////////////////////////////////////////////////////////////////////////// +// // +// PHOS EmCal bad channels map. // +// // +/////////////////////////////////////////////////////////////////////////////// + +#include "AliPHOSEmcBadChannelsMap.h" + +ClassImp(AliPHOSEmcBadChannelsMap) + +//________________________________________________________________ + + AliPHOSEmcBadChannelsMap::AliPHOSEmcBadChannelsMap() : fBads(-1) +{ + Reset(); +} + +//________________________________________________________________ + +void AliPHOSEmcBadChannelsMap::Reset() +{ + //Set all channels as good. + + for(Int_t module=0; module<5; module++) + for(Int_t column=0; column<56; column++) + for(Int_t row=0; row<64; row++) + fBadChannelEmc[module][column][row] = kFALSE; + + fBads=0; + +} + +//________________________________________________________________ + +AliPHOSEmcBadChannelsMap::AliPHOSEmcBadChannelsMap(const AliPHOSEmcBadChannelsMap &map): + TObject(map),fBads(map.fBads) +{ + //Copy constructor. + + for(Int_t module=0; module<5; module++) + for(Int_t column=0; column<56; column++) + for(Int_t row=0; row<64; row++) + fBadChannelEmc[module][column][row] = map.fBadChannelEmc[module][column][row]; + +} + +//________________________________________________________________ + +AliPHOSEmcBadChannelsMap& AliPHOSEmcBadChannelsMap::operator= (const AliPHOSEmcBadChannelsMap &map) +{ + //Assignment operator. + + if(this != &map) { + fBads = map.fBads; + for(Int_t module=0; module<5; module++) + for(Int_t column=0; column<56; column++) + for(Int_t row=0; row<64; row++) + fBadChannelEmc[module][column][row] = map.fBadChannelEmc[module][column][row]; + } + + return *this; +} diff --git a/PHOS/AliPHOSEmcBadChannelsMap.h b/PHOS/AliPHOSEmcBadChannelsMap.h new file mode 100644 index 00000000000..ce96a825f5b --- /dev/null +++ b/PHOS/AliPHOSEmcBadChannelsMap.h @@ -0,0 +1,36 @@ +#ifndef ALIPHOSEMCBADCHANNELSMAP +#define ALIPHOSEMCBADCHANNELSMAP +/* Copyright(c) 2007, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + +// This class keeps the EMC bad channels map +// (bad means dead or noisy). + +#include "TObject.h" + +class AliPHOSEmcBadChannelsMap : public TObject { + +public: + + AliPHOSEmcBadChannelsMap(); + AliPHOSEmcBadChannelsMap(const AliPHOSEmcBadChannelsMap &map); + AliPHOSEmcBadChannelsMap& operator= (const AliPHOSEmcBadChannelsMap &map); + ~AliPHOSEmcBadChannelsMap() {} + + void SetBadChannel(Int_t module, Int_t col, Int_t row) { fBadChannelEmc[module-1][col-1][row-1] = kTRUE; ++fBads; } + Bool_t IsBadChannel(Int_t module, Int_t col, Int_t row) const { return fBadChannelEmc[module-1][col-1][row-1]; } + Int_t GetNumOfBadChannels() const { return fBads; } + void Reset(); + +private: + + Bool_t fBadChannelEmc[5][56][64]; //[mod][col][row] + Int_t fBads; + + ClassDef(AliPHOSEmcBadChannelsMap,1) + +}; + +#endif