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  m_debug = false;
33  for (int i = 1; i < 4; i++)
34  setSCCarryFlag(false, i);
35  for (int i = 1; i < 5; i++)
36  setCoarseSync(0, i);
37 }
38 
40  setDefaults(ps);
41  if (debug())
42  print();
43 }
44 
45 //--------------
46 // Destructor --
47 //--------------
49 
50 //--------------
51 // Operations --
52 //--------------
53 
54 void DTConfigSectColl::setSCCarryFlag(bool scecf, int istat) {
55  if (istat < 1 || istat > 4) {
56  throw cms::Exception("DTTPG") << "DTConfigSectColl::setSCCarryFlag: station number out of range: istat=" << istat
57  << std::endl;
58  }
59  m_scecf[istat - 1] = scecf;
60 }
61 
62 void DTConfigSectColl::setCoarseSync(int sccsp, int istat) {
63  if (istat < 1 || istat > 5) {
64  throw cms::Exception("DTTPG") << "DTConfigSectColl::setCoarseSync: station number out of range: istat=" << istat
65  << std::endl;
66  }
67  if (sccsp < 0 || sccsp > 7) {
68  throw cms::Exception("DTTPG") << "DTConfigSectColl::setCoarseSync: wrong SCCSP" << istat << " value!" << std::endl;
69  }
70  m_sccsp[istat - 1] = sccsp;
71 }
72 
74  // Debug flag
75  m_debug = ps.getUntrackedParameter<bool>("Debug");
76 
77  // Enabling Carry in Sector Collector for MB1 (1 means enabled, 0 disabled)
78  m_scecf[0] = ps.getParameter<bool>("SCECF1");
79 
80  // Enabling Carry in Sector Collector for MB2 (1 means enabled, 0 disabled)
81  m_scecf[1] = ps.getParameter<bool>("SCECF2");
82 
83  // Enabling Carry in Sector Collector for MB3 (1 means enabled, 0 disabled)
84  m_scecf[2] = ps.getParameter<bool>("SCECF3");
85 
86  // Enabling Carry in Sector Collector for MB4 (1 means enabled, 0 disabled)
87  m_scecf[3] = ps.getParameter<bool>("SCECF4");
88 
89  // Progammable Coars Sync parameter in Sector Collector for MB1 (possible values [0-7])
90  int mycsp = ps.getParameter<int>("SCCSP1");
91  setCoarseSync(mycsp, 1);
92 
93  // Progammable Coars Sync parameter in Sector Collector for MB2 (possible values [0-7])
94  mycsp = ps.getParameter<int>("SCCSP2");
95  setCoarseSync(mycsp, 2);
96 
97  // Progammable Coars Sync parameter in Sector Collector for MB3 (possible values [0-7])
98  mycsp = ps.getParameter<int>("SCCSP3");
99  setCoarseSync(mycsp, 3);
100 
101  // Progammable Coars Sync parameter in Sector Collector for firts MB4 station (possible values [0-7])
102  mycsp = ps.getParameter<int>("SCCSP4");
103  setCoarseSync(mycsp, 4);
104 
105  // Progammable Coars Sync parameter in Sector Collector for second MB4 station (sectors 4 & 10) (possible values [0-7])
106  mycsp = ps.getParameter<int>("SCCSP5");
107  setCoarseSync(mycsp, 5);
108 }
109 
111  std::cout << "******************************************************************************" << std::endl;
112  std::cout << "* DTTrigger configuration : SectorCollector chips *" << std::endl;
113  std::cout << "******************************************************************************" << std::endl
114  << std::endl;
115  std::cout << "Debug flag : " << debug() << std::endl;
116  std::cout << "SCECF1 :" << SCGetCarryFlag(1) << std::endl;
117  std::cout << "SCECF2 :" << SCGetCarryFlag(2) << std::endl;
118  std::cout << "SCECF3 :" << SCGetCarryFlag(3) << std::endl;
119  std::cout << "SCECF4 :" << SCGetCarryFlag(4) << std::endl;
120  std::cout << "SCCSP1 :" << CoarseSync(1) << std::endl;
121  std::cout << "SCCSP2 :" << CoarseSync(2) << std::endl;
122  std::cout << "SCCSP3 :" << CoarseSync(3) << std::endl;
123  std::cout << "SCCSP4 :" << CoarseSync(4) << std::endl;
124  std::cout << "SCCSP5 :" << CoarseSync(5) << std::endl;
125  std::cout << "******************************************************************************" << std::endl;
126 }
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
Definition: ParameterSet.h:307
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() override
Destructor.
T getUntrackedParameter(std::string const &, T const &) const
void print() const
Print the setup.
DTConfigSectColl()
Constructor.
void setCoarseSync(int sccsp, int istat)
Return coarsesync parameter in Sector Collector for station istat (5 is second MB4 station) ...
bool debug() const
Return the debug flag.
void setDefaults(const edm::ParameterSet &ps)
Load pset values into class variables.