CMS 3D CMS Logo

FWViewType.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Core
4 // Class : FWViewType
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: Alja Mrak-Tadel
10 // Created: Fri Mar 26 12:25:02 CET 2010
11 //
12 
13 // system include files
14 
15 // user include files
18 
19 //
20 // constants, enums and typedefs
21 //
22 
23 //
24 // static data member definitions
25 //
26 
27 const int FWViewType::kAllRPZBits = kRhoPhiBit | kRhoZBit | kRhoPhiPFBit;
28 const int FWViewType::kAll3DBits = kISpyBit | k3DBit;
29 const int FWViewType::kAllLegoBits = kLegoBit | kLegoHFBit | kLegoPFECALBit;
30 
32 
34 {
35  sName[kRhoPhi ] = "Rho Phi";
36  sName[kRhoZ ] = "Rho Z";
37  sName[k3D ] = "3D Tower";
38  sName[kISpy ] = "3D RecHit";
39  sName[kGlimpse ] = "Glimpse";
40  sName[kLego ] = "Lego";
41  sName[kLegoHF ] = "HF";
42  sName[kTable ] = "Table";
43  sName[kTableHLT ] = "HLT Table";
44  sName[kTableL1 ] = "L1 Table";
45  sName[kLegoPFECAL ] = "PF ECAL Lego";
46  sName[kRhoPhiPF ] = "PF Rho Phi";
47  sName[kGeometryTable] = "Geometry Table";
48  sName[kOverlapTable ] = "Overlap Table";
49 }
50 
52 
53 
54 //
55 // constructors and destructor
56 //
58  m_id(t)
59 {
60 }
61 
63 {
64 }
65 
66 //
67 // member functions
68 //
69 
70 //
71 // const member functions
72 //
73 const std::string&
75 {
76  return sName[m_id];
77 }
78 
79 
82 {
83  return m_id;
84 }
85 //
86 // static member functions
87 //
88 const std::string&
90 {
91 
92  return sName[id];
93 }
94 
96 {
97  fwLog(fwlog::kDebug) << old << " view has been renamed to "<< FWViewType::idToName(id) << ".\n";
98  return (const std::string&)FWViewType::idToName(id);
99 }
100 
101 const std::string&
103 {
104  // printf("version %d %s \n", version, refName.c_str());fflush(stdout);
105  if (version < 2)
106  {
107  if (refName == "TriggerTable")
108  return switchName(refName, FWViewType::kTableHLT);
109  else if (refName == "L1TriggerTable")
110  return switchName(refName, FWViewType::kTableL1);
111  }
112  if (version < 3)
113  {
114  if (refName == "3D Lego")
115  return switchName(refName, FWViewType::kLego);
116  }
117  if (version < 7)
118  {
119  if (refName == "iSpy")
120  return switchName(refName, FWViewType::kISpy);
121  if (refName == "3D")
122  return switchName(refName, FWViewType::k3D);
123  }
124  return refName;
125 }
126 
127 bool
129 {
130  return (id == kRhoPhi || id == kRhoZ || id == kRhoPhiPF);
131 }
132 
133 
134 bool
136 {
137  return (id == kLego || id == kLegoHF || id == kLegoPFECAL);
138 }
static static_initializer init_statics
Definition: FWViewType.h:31
static const int kAllRPZBits
Definition: FWViewType.h:58
FWViewType(EType)
Definition: FWViewType.cc:57
static const int kAll3DBits
Definition: FWViewType.h:59
const EType m_id
Definition: FWViewType.h:78
virtual ~FWViewType()
Definition: FWViewType.cc:62
const std::string & name() const
Definition: FWViewType.cc:74
static bool isProjected(int)
Definition: FWViewType.cc:128
static std::string sName[kTypeSize]
Definition: FWViewType.h:62
EType id() const
Definition: FWViewType.cc:81
static const std::string & checkNameWithViewVersion(const std::string &name, unsigned int viewVersion)
Definition: FWViewType.cc:102
#define fwLog(_level_)
Definition: fwLog.h:50
static const int kAllLegoBits
Definition: FWViewType.h:60
const std::string & switchName(const std::string &old, FWViewType::EType id)
Definition: FWViewType.cc:95
static bool isLego(int)
Definition: FWViewType.cc:135
static const std::string & idToName(int)
Definition: FWViewType.cc:89