1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 **************************************************************************/
16 // This class handles the mapping of the Altro channels
17 // The mapping is read from an external mapping files
18 // The class is used as a base class by TPC,PHOS and FMD
21 #include "AliAltroMapping.h"
23 #include <Riostream.h>
27 ClassImp(AliAltroMapping)
29 //_____________________________________________________________________________
30 AliAltroMapping::AliAltroMapping():
35 // Default constructor
38 //_____________________________________________________________________________
39 AliAltroMapping::AliAltroMapping(const char *mappingFile):
45 // Reads the mapping from an external file
47 OpenMappingFile(mappingFile);
49 AliFatal("Mapping file not specified !");
52 //_____________________________________________________________________________
53 AliAltroMapping::~AliAltroMapping()
58 //_____________________________________________________________________________
59 AliAltroMapping::AliAltroMapping(const AliAltroMapping& mapping):
62 fNumberOfChannels(mapping.fNumberOfChannels),
63 fMaxHWAddress(mapping.fMaxHWAddress)
67 Fatal("AliAltroMapping", "copy constructor not implemented");
70 //_____________________________________________________________________________
71 AliAltroMapping& AliAltroMapping::operator = (const AliAltroMapping& /*mapping*/)
75 Fatal("operator =", "assignment operator not implemented");
79 //_____________________________________________________________________________
80 Bool_t AliAltroMapping::OpenMappingFile(const char *mappingFile)
82 // Initalizes the ALTRO mapping from a file
83 // Look at the TPC module for the format of
85 fIn = new ifstream(mappingFile);
87 AliFatal(Form("Missing mapping file (%s) !",mappingFile));
90 if (!(*fIn >> fNumberOfChannels)) {
91 AliFatal(Form("Syntax of the mapping file is wrong (%s) !",mappingFile));
94 if (!(*fIn >> fMaxHWAddress)) {
95 AliFatal(Form("Syntax of the mapping file is wrong (%s) !",mappingFile));
102 //_____________________________________________________________________________
103 Bool_t AliAltroMapping::CloseMappingFile()
105 // Closes the external mapping