Belle II Software  release-06-00-14
ECLChannelMapper.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #pragma once
9 #include <ecl/dbobjects/ECLChannelMap.h>
10 namespace Belle2 {
15  namespace ECL {
26 
29 
31  int convertArrayBarrel[ECL_BARREL_CRATES * ECL_BARREL_SHAPERS_IN_CRATE * ECL_CHANNELS_IN_SHAPER];
33  int convertArrayFWD[ECL_FWD_CRATES * ECL_FWD_SHAPERS_IN_CRATE * ECL_CHANNELS_IN_SHAPER];
35  int convertArrayBKW[ECL_BKW_CRATES * ECL_BKW_SHAPERS_IN_CRATE * ECL_CHANNELS_IN_SHAPER];
37  int convertArrayInv[ECL_TOTAL_CHANNELS][3]; // 0 -- icrate, 1 -- iboard, 2 -- ichannel
38 
39  public:
45  bool initFromFile();
47  bool initFromFile(const char* eclMapFile);
49  bool initFromDB();
52 
54  int getCrateID(int iCOPPERNode, int iFINESSE); // iFINNES = 0 (FINESSE A) or 1 (FINESSE B)
56  int getCellId(int iCrate, int iShaper, int iChannel);
58  int getCOPPERNode(int iCrate);
60  int getFINESSE(int iCrate);
62  int getSubSystem(int iCrate);
63 
65  int getCrateID(int cellID);
67  int getShaperPosition(int cellID);
69  int getShaperChannel(int cellID);
70 
72  inline int getNShapersInCrate(int iCrate)
73  {
74  if (iCrate <= ECL_BARREL_CRATES) return ECL_BARREL_SHAPERS_IN_CRATE;
75  if (ECL_BARREL_CRATES < iCrate && iCrate <= ECL_BARREL_CRATES + ECL_FWD_CRATES) return ECL_FWD_SHAPERS_IN_CRATE;
76  if (ECL_BARREL_CRATES + ECL_FWD_CRATES < iCrate && iCrate <= ECL_CRATES) return ECL_BKW_SHAPERS_IN_CRATE;
77  return 0;
78  }
79  };
80  }
82 }
DB object to store correspondence table of type (Crate id, ShaperDSP id, Channel id) <-> (ECL CellID)
Definition: ECLChannelMap.h:44
This class provides access to ECL channel map that is either a) Loaded from the database (see ecl/dbo...
int getSubSystem(int iCrate)
get ECL subsystem ID by given crate number: 0 – barrel, 1 – forward. 2 – backward endcap
bool initFromDB()
Initialize channel mapper from the conditions database.
bool isInitialized
initialization flag
ECLChannelMap getDBObject()
Convert internal data to ECLChannelMap database object.
int getCrateID(int iCOPPERNode, int iFINESSE)
get crate number by given COPPER node number and FINESSE number
bool initFromFile()
Initialize channel mapper using data stored in default location.
~ECLChannelMapper()
Default destructor.
int convertArrayFWD[ECL_FWD_CRATES *ECL_FWD_SHAPERS_IN_CRATE *ECL_CHANNELS_IN_SHAPER]
convert (iCrate, iShaper, iChannel) to CellId for Forward endcap
int getFINESSE(int iCrate)
get number of FINESSE (0/1) in COPPER by given crate number
ECLChannelMapper()
Default constructor.
int getNShapersInCrate(int iCrate)
get number of ShaperDSP modules in the given VME crate number
int getCellId(int iCrate, int iShaper, int iChannel)
get CellId by given crate number, shaper position in the crate and DSP channel number in the shaper
int convertArrayBKW[ECL_BKW_CRATES *ECL_BKW_SHAPERS_IN_CRATE *ECL_CHANNELS_IN_SHAPER]
convert (iCrate, iShaper, iChannel) to CellId Backward endcap
int getShaperChannel(int cellID)
get number of DSP channel in the shaper by given number of CellId
int getShaperPosition(int cellID)
get position of the shaper in the crate by given CellId
int getCOPPERNode(int iCrate)
get number of COPPER node by given crate number
int convertArrayInv[ECL_TOTAL_CHANNELS][3]
convert CellId to (iCrate, iShaper, iChannel)
int convertArrayBarrel[ECL_BARREL_CRATES *ECL_BARREL_SHAPERS_IN_CRATE *ECL_CHANNELS_IN_SHAPER]
convert (iCrate, iShaper, iChannel) to CellId for Barrel ECL
Abstract base class for different kinds of events.