CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // $Id: FWViewType.cc,v 1.23 2012/02/22 03:46:00 amraktad Exp $
12 //
13 
14 // system include files
15 
16 // user include files
19 
20 //
21 // constants, enums and typedefs
22 //
23 
24 //
25 // static data member definitions
26 //
27 
28 const int FWViewType::kAllRPZBits = kRhoPhiBit | kRhoZBit | kRhoPhiPFBit;
29 const int FWViewType::kAll3DBits = kISpyBit | k3DBit;
30 const int FWViewType::kAllLegoBits = kLegoBit | kLegoHFBit | kLegoPFECALBit;
31 
33 
35 {
36  sName[kRhoPhi ] = "Rho Phi";
37  sName[kRhoZ ] = "Rho Z";
38  sName[k3D ] = "3D Tower";
39  sName[kISpy ] = "3D RecHit";
40  sName[kGlimpse ] = "Glimpse";
41  sName[kLego ] = "Lego";
42  sName[kLegoHF ] = "HF";
43  sName[kTable ] = "Table";
44  sName[kTableHLT ] = "HLT Table";
45  sName[kTableL1 ] = "L1 Table";
46  sName[kLegoPFECAL ] = "PF ECAL Lego";
47  sName[kRhoPhiPF ] = "PF Rho Phi";
48  sName[kGeometryTable] = "Geometry Table";
49  sName[kOverlapTable ] = "Overlap Table";
50 }
51 
53 
54 
55 //
56 // constructors and destructor
57 //
59  m_id(t)
60 {
61 }
62 
64 {
65 }
66 
67 //
68 // member functions
69 //
70 
71 //
72 // const member functions
73 //
74 const std::string&
76 {
77  return sName[m_id];
78 }
79 
80 
83 {
84  return m_id;
85 }
86 //
87 // static member functions
88 //
89 const std::string&
91 {
92 
93  return sName[id];
94 }
95 
96 const std::string& switchName (const std::string& old, FWViewType::EType id)
97 {
98  fwLog(fwlog::kDebug) << old << " view has been renamed to "<< FWViewType::idToName(id) << ".\n";
99  return (const std::string&)FWViewType::idToName(id);
100 }
101 
102 const std::string&
103 FWViewType::checkNameWithViewVersion(const std::string& refName, unsigned int version)
104 {
105  // printf("version %d %s \n", version, refName.c_str());fflush(stdout);
106  if (version < 2)
107  {
108  if (refName == "TriggerTable")
109  return switchName(refName, FWViewType::kTableHLT);
110  else if (refName == "L1TriggerTable")
111  return switchName(refName, FWViewType::kTableL1);
112  }
113  if (version < 3)
114  {
115  if (refName == "3D Lego")
116  return switchName(refName, FWViewType::kLego);
117  }
118  if (version < 7)
119  {
120  if (refName == "iSpy")
121  return switchName(refName, FWViewType::kISpy);
122  if (refName == "3D")
123  return switchName(refName, FWViewType::k3D);
124  }
125  return refName;
126 }
127 
128 bool
130 {
131  return (id == kRhoPhi || id == kRhoZ || id == kRhoPhiPF);
132 }
133 
134 
135 bool
137 {
138  return (id == kLego || id == kLegoHF || id == kLegoPFECAL);
139 }
static static_initializer init_statics
Definition: FWViewType.h:32
static const int kAllRPZBits
Definition: FWViewType.h:59
FWViewType(EType)
Definition: FWViewType.cc:58
static const int kAll3DBits
Definition: FWViewType.h:60
const EType m_id
Definition: FWViewType.h:79
virtual ~FWViewType()
Definition: FWViewType.cc:63
const std::string & name() const
Definition: FWViewType.cc:75
static bool isProjected(int)
Definition: FWViewType.cc:129
static std::string sName[kTypeSize]
Definition: FWViewType.h:63
EType id() const
Definition: FWViewType.cc:82
static const std::string & checkNameWithViewVersion(const std::string &name, unsigned int viewVersion)
Definition: FWViewType.cc:103
#define fwLog(_level_)
Definition: fwLog.h:51
static const int kAllLegoBits
Definition: FWViewType.h:61
const std::string & switchName(const std::string &old, FWViewType::EType id)
Definition: FWViewType.cc:96
static bool isLego(int)
Definition: FWViewType.cc:136
static const std::string & idToName(int)
Definition: FWViewType.cc:90