1 /**************************************************************************
2 * Copyright(c) 2007, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // PHOS EmCal bad channels map. //
22 ///////////////////////////////////////////////////////////////////////////////
24 #include "AliPHOSEmcBadChannelsMap.h"
25 #include "AliPHOSGeometry.h"
27 ClassImp(AliPHOSEmcBadChannelsMap)
29 //________________________________________________________________
31 AliPHOSEmcBadChannelsMap::AliPHOSEmcBadChannelsMap() : fBads(-1)
36 //________________________________________________________________
38 void AliPHOSEmcBadChannelsMap::Reset()
40 //Set all channels as good.
42 for(Int_t module=0; module<5; module++)
43 for(Int_t column=0; column<56; column++)
44 for(Int_t row=0; row<64; row++)
45 fBadChannelEmc[module][column][row] = kFALSE;
51 //________________________________________________________________
53 AliPHOSEmcBadChannelsMap::AliPHOSEmcBadChannelsMap(const AliPHOSEmcBadChannelsMap &map):
54 TObject(map),fBads(map.fBads)
58 for(Int_t module=0; module<5; module++)
59 for(Int_t column=0; column<56; column++)
60 for(Int_t row=0; row<64; row++)
61 fBadChannelEmc[module][column][row] = map.fBadChannelEmc[module][column][row];
65 //________________________________________________________________
67 AliPHOSEmcBadChannelsMap& AliPHOSEmcBadChannelsMap::operator= (const AliPHOSEmcBadChannelsMap &map)
69 //Assignment operator.
73 for(Int_t module=0; module<5; module++)
74 for(Int_t column=0; column<56; column++)
75 for(Int_t row=0; row<64; row++)
76 fBadChannelEmc[module][column][row] = map.fBadChannelEmc[module][column][row];
82 //_________________________________________________________________
84 void AliPHOSEmcBadChannelsMap::BadChannelIds(Int_t *badIds)
86 //Fill array badIds by the Ids of bad channels.
87 //Array badIds of length GetNumOfBadChannels() should be prepared in advance.
92 AliPHOSGeometry* geom = AliPHOSGeometry::GetInstance();
95 geom = AliPHOSGeometry::GetInstance("IHEP");
101 relId[1] = 0; // EMC crystal
103 for(Int_t mod=1; mod<6; mod++) {
104 for(Int_t col=1; col<57; col++) {
105 for(Int_t row=1; row<65; row++) {
106 if(IsBadChannel(mod,col,row)) {
110 geom->RelToAbsNumbering(relId,absId);