CMap.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \brief Definition of connection map class
3 /// \author jpaley@fnal.gov
4 /// \date Sept. 2016
5 ////////////////////////////////////////////////////////////////////////
6 #ifndef CMAPDATAPROVIDER_H
7 #define CMAPDATAPROVIDER_H
8 
9 #include "DAQChannelMap/DAQChannelMap.h"
10 
13 #include "fhiclcpp/ParameterSet.h"
14 
15 //#include "Geometry/Geometry.h"
17 #include "RecoBase/CellHit.h"
18 
19 namespace rawdata {
20  class RawDigit;
21 }
22 
23 
24 namespace cmap {
25 
26  /// Channel masks are defined in DAQChannelMap package
27  namespace dataprov {
28 
29  class CMap {
30  public:
31 
32  CMap();
34  ~CMap();
35 
37  fStdMap = m;
38  }
39 
40  daqchannelmap::lchan encodeLChan(int detId, int plane, int cell);
42  int computeBlock(daqchannelmap::lchan);
43  int getDetector(daqchannelmap::dchan);
44  int getDiBlock(daqchannelmap::dchan);
45  int getDCM(daqchannelmap::dchan);
46  int getFEB(daqchannelmap::dchan);
47  int getPixel(daqchannelmap::dchan);
48  int getView(daqchannelmap::dchan);
49  int getPlane(daqchannelmap::lchan);
50  int getCell(daqchannelmap::lchan);
51 
52  unsigned short GetPlane(const rawdata::RawDigit* dig);
53  unsigned short GetPlane(const rb::CellHit* dig);
54  unsigned short GetCell(const rawdata::RawDigit* dig);
55  unsigned short GetCell(const rb::CellHit* dig);
56 
57  const daqchannelmap::DAQChannelMap* Map() const { return fStdMap; }
58 
59  void AddException(int idet, geo::OfflineChan chan1, geo::OfflineChan chan2);
60  void AddException(int idet, std::string chan1, std::string chan2);
62  fExceptionsMap[chan1] = chan2;
63  }
64 
65  int NExceptions() { return fExceptionsMap.size(); }
66  std::unordered_map<daqchannelmap::dchan,daqchannelmap::dchan> ExceptionsMap()
67  { return fExceptionsMap; }
68 
69  void ClearExceptions() { fExceptionsMap.clear(); }
70 
71  void SetCurrentRun(int run) { fCurrentRun = run; }
72  int CurrentRun() { return fCurrentRun; }
73 
74  void SetUseExceptions(bool v) { fUseExceptions = v; }
75  bool UseExceptions() { return fUseExceptions; }
76 
77  void SetVerbosity(int v) { fVerbosity = v;}
78  int Verbosity() { return fVerbosity; }
79 
80  private:
81 
85  std::unordered_map<daqchannelmap::dchan,daqchannelmap::dchan> fExceptionsMap;
87 
88  }; // end class cmap
89  } // end namespace dataprov
90 } // end namespace cmap
91 
92 #endif // CMAPDATAPROVIDER_H
93 ////////////////////////////////////////////////////////////////////////
void SetVerbosity(int v)
Definition: CMap.h:77
void AddException(daqchannelmap::dchan chan1, daqchannelmap::dchan chan2)
Definition: CMap.h:61
void SetUseExceptions(bool v)
Definition: CMap.h:74
int Verbosity()
Definition: CMap.h:78
void ClearExceptions()
Definition: CMap.h:69
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > fExceptionsMap
Definition: CMap.h:85
Definition of connection map class.
Definition: CMap.h:19
void SetCurrentRun(int run)
Definition: CMap.h:71
bool fUseExceptions
Definition: CMap.h:84
int NExceptions()
Definition: CMap.h:65
Definition: run.py:1
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
A rawdata::RawDigit with channel information decoded.
Definition: CellHit.h:27
std::unordered_map< daqchannelmap::dchan, daqchannelmap::dchan > ExceptionsMap()
Definition: CMap.h:66
bool UseExceptions()
Definition: CMap.h:75
A (plane, cell) pair.
Definition: OfflineChan.h:17
cmap::CMap class source code
Definition: CMap.cxx:17
uint32_t dchan
< DAQ Channel Map Package
int CurrentRun()
Definition: CMap.h:72
Simple object representing a (plane, cell) pair.
const daqchannelmap::DAQChannelMap * fStdMap
Definition: CMap.h:86
void SetStdMap(const daqchannelmap::DAQChannelMap *m)
Definition: CMap.h:36