CMS 3D CMS Logo

DTConfigSectColl.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: DTConfigSectColl
4 //
5 // Description: Configurable parameters and constants
6 // for Level1 Mu DT Trigger - Sector Collector chip
7 //
8 //
9 // Author List:
10 // C. Battilana
11 //
12 //-----------------------------------------------------------------------
13 
14 //-----------------------
15 // This Class's Header --
16 //-----------------------
18 
19 //---------------
20 // C++ Headers --
21 //---------------
22 
23 //-------------------------------
24 // Collaborating Class Headers --
25 //-------------------------------
27 
28 //----------------
29 // Constructors --
30 //----------------
32 
33  m_debug = false;
34  for (int i=1; i<4; i++)
35  setSCCarryFlag(false,i);
36  for (int i=1; i<5; i++)
37  setCoarseSync(0,i);
38 
39 }
40 
42 
43  setDefaults(ps);
44  if(debug()) print();
45 
46 }
47 
48 //--------------
49 // Destructor --
50 //--------------
52 
53 //--------------
54 // Operations --
55 //--------------
56 
57 void
58 DTConfigSectColl::setSCCarryFlag(bool scecf,int istat) {
59 
60  if (istat<1 || istat>4){
61  throw cms::Exception("DTTPG") << "DTConfigSectColl::setSCCarryFlag: station number out of range: istat=" << istat << std::endl;
62  }
63  m_scecf[istat-1] = scecf;
64 
65 }
66 
67 void
68 DTConfigSectColl::setCoarseSync(int sccsp, int istat) {
69 
70  if (istat<1 || istat>5){
71  throw cms::Exception("DTTPG") << "DTConfigSectColl::setCoarseSync: station number out of range: istat=" << istat << std::endl;
72  }
73  if (sccsp<0 || sccsp>7){
74  throw cms::Exception("DTTPG") << "DTConfigSectColl::setCoarseSync: wrong SCCSP"<< istat << " value!" << std::endl;
75  }
76  m_sccsp[istat-1] = sccsp;
77 
78 }
79 
80 void
82 
83  // Debug flag
84  m_debug = ps.getUntrackedParameter<bool>("Debug");
85 
86  // Enabling Carry in Sector Collector for MB1 (1 means enabled, 0 disabled)
87  m_scecf[0] = ps.getParameter<bool>("SCECF1");
88 
89  // Enabling Carry in Sector Collector for MB2 (1 means enabled, 0 disabled)
90  m_scecf[1] = ps.getParameter<bool>("SCECF2");
91 
92  // Enabling Carry in Sector Collector for MB3 (1 means enabled, 0 disabled)
93  m_scecf[2] = ps.getParameter<bool>("SCECF3");
94 
95  // Enabling Carry in Sector Collector for MB4 (1 means enabled, 0 disabled)
96  m_scecf[3] = ps.getParameter<bool>("SCECF4");
97 
98  // Progammable Coars Sync parameter in Sector Collector for MB1 (possible values [0-7])
99  int mycsp = ps.getParameter<int>("SCCSP1");
100  setCoarseSync(mycsp,1);
101 
102  // Progammable Coars Sync parameter in Sector Collector for MB2 (possible values [0-7])
103  mycsp = ps.getParameter<int>("SCCSP2");
104  setCoarseSync(mycsp,2);
105 
106  // Progammable Coars Sync parameter in Sector Collector for MB3 (possible values [0-7])
107  mycsp = ps.getParameter<int>("SCCSP3");
108  setCoarseSync(mycsp,3);
109 
110  // Progammable Coars Sync parameter in Sector Collector for firts MB4 station (possible values [0-7])
111  mycsp = ps.getParameter<int>("SCCSP4");
112  setCoarseSync(mycsp,4);
113 
114  // Progammable Coars Sync parameter in Sector Collector for second MB4 station (sectors 4 & 10) (possible values [0-7])
115  mycsp = ps.getParameter<int>("SCCSP5");
116  setCoarseSync(mycsp,5);
117 
118 }
119 
120 void
122 
123  std::cout << "******************************************************************************" << std::endl;
124  std::cout << "* DTTrigger configuration : SectorCollector chips *" << std::endl;
125  std::cout << "******************************************************************************" << std::endl << std::endl;
126  std::cout << "Debug flag : " << debug() << std::endl;
127  std::cout << "SCECF1 :" << SCGetCarryFlag(1) << std::endl;
128  std::cout << "SCECF2 :" << SCGetCarryFlag(2) << std::endl;
129  std::cout << "SCECF3 :" << SCGetCarryFlag(3) << std::endl;
130  std::cout << "SCECF4 :" << SCGetCarryFlag(4) << std::endl;
131  std::cout << "SCCSP1 :" << CoarseSync(1) << std::endl;
132  std::cout << "SCCSP2 :" << CoarseSync(2) << std::endl;
133  std::cout << "SCCSP3 :" << CoarseSync(3) << std::endl;
134  std::cout << "SCCSP4 :" << CoarseSync(4) << std::endl;
135  std::cout << "SCCSP5 :" << CoarseSync(5) << std::endl;
136  std::cout << "******************************************************************************" << std::endl;
137 
138 }
139 
void setSCCarryFlag(bool scecf, int istat)
Set carry in Sector Collector for station istat (1 means enabled, 0 disabled)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void print() const
Print the setup.
~DTConfigSectColl() override
Destructor.
bool debug() const
Return the debug flag.
bool SCGetCarryFlag(int istat) const
Return carry in Sector Collector for station istat (1 means enabled, 0 disabled)
int CoarseSync(int istat) const
Return coarsesync parameter in Sector Collector for station istat (5 is second MB4 station) ...
DTConfigSectColl()
Constructor.
void setCoarseSync(int sccsp, int istat)
Return coarsesync parameter in Sector Collector for station istat (5 is second MB4 station) ...
void setDefaults(const edm::ParameterSet &ps)
Load pset values into class variables.