43 throw cms::Exception(
"DTTPG") <<
"DTConfigTSPhi::DTConfigTSPhi : ntss=" << ntss << std::endl
44 <<
"configuration from CCB strings not possible " << std::endl
45 <<
"if error occurs configuring from DB this is " << std::endl
46 <<
"likely to be a DTCCBConfigRcd issue" << std::endl;
52 bool tsscgs2, tsscgs1, tsscce1, tsshte1, tssnoe1, carrytss;
53 bool tsscce2, tsshte2, tssnoe2, tssccec, tsshtec, tssnoec;
54 unsigned short tssgs1, tssgs2, tssmsk1, tssmsk2;
56 tsscgs2 = tsscgs1 = tsscce1 = tsshte1 = tssnoe1 = carrytss = 0;
57 tsscce2 = tsshte2 = tssnoe2 = tssccec = tsshtec = tssnoec = 0;
58 tssgs1 = tssgs2 = tssmsk1 = tssmsk2 = 0;
60 memset(tstren,
true,24*
sizeof(
bool));
63 for (
int itss=0; itss<ntss; itss++) {
64 unsigned short int memory_tss[27];
66 for(
int ts=0;ts<27;ts++){
67 memory_tss[ts] = tss_buffer[itss][ts+4];
71 tstren[itss*4] = !(memory_tss[1]&0x08);
72 tstren[itss*4+1] = !(memory_tss[1]&0x80);
73 tstren[itss*4+2] = !(memory_tss[2]&0x08);
74 tstren[itss*4+3] = !(memory_tss[2]&0x80);
77 tsscgs2 = !(memory_tss[0]&0x08);
78 tssgs2 = memory_tss[0]&0x04 ? 0 : 1;
79 tsscgs1 = !(memory_tss[0]&0x02);
80 tssgs1 = memory_tss[0]&0x01 ? 0 : 1;
81 tsscce1 = !(memory_tss[4]&0x04);
82 tsshte1 = !(memory_tss[4]&0x02);
83 tssnoe1 = !(memory_tss[4]&0x01);
84 tsscce2 = !(memory_tss[3]&0x40);
85 tsshte2 = !(memory_tss[3]&0x20);
86 tssnoe2 = !(memory_tss[3]&0x10);
87 tssccec = !(memory_tss[3]&0x04);
88 tsshtec = !(memory_tss[3]&0x02);
89 tssnoec = !(memory_tss[3]&0x01);
90 carrytss= !(memory_tss[4]&0x40);
91 tssmsk1 = memory_tss[4]&0x10 ? 132 : 312;
92 tssmsk2 = memory_tss[4]&0x20 ? 132 : 312;
97 unsigned short int memory_tsms[2], memory_tsmdu[2], memory_tsmdd[2];
99 for(
int ts=0;ts<2;ts++){
100 memory_tsms[ts] = tsm_buffer[ts+3];
101 memory_tsmdu[ts] = tsm_buffer[ts+5];
102 memory_tsmdd[ts] = tsm_buffer[ts+7];
108 unsigned short tsmgs1 = memory_tsms[1]&0x02 ? 0 : 1;
110 unsigned short tsmgs2 = 1;
120 bool carrytsms = !(memory_tsms[1]&0x01);
121 unsigned short tsmmsk1 = memory_tsms[1]&0x08 ? 321 : 312;
122 unsigned short tsmmsk2 = tsmmsk1;
124 tsmword[0] = !((memory_tsmdu[0]&0x80)&&(memory_tsmdd[0]&0x80));
125 tsmword[1] = !(memory_tsms[0]&0x01);
126 tsmword[2] = !(memory_tsms[0]&0x02);
127 tsmword[3] = !(memory_tsms[0]&0x04);
128 tsmword[4] = !(memory_tsms[0]&0x08);
129 tsmword[5] = !(memory_tsms[0]&0x10);
130 tsmword[6] = !(memory_tsms[0]&0x20);
131 tsmword[7] = !(memory_tsms[0]&0x40);
132 bool carrytsmd = !((memory_tsmdu[0]&0x10)&&(memory_tsmdd[0]&0x10));
134 unsigned short tsmhsp = carrytss && carrytsms && carrytsmd;
137 std::cout <<
"TSS :" << std::dec << std::endl <<
"tstren= " ;
140 <<
" tssgs1=" << tssgs1
141 <<
" tsscgs2=" << tsscgs2
142 <<
" tssgs2=" << tssgs2
143 <<
" tsscce1=" << tsscce1
144 <<
" tsshte1=" << tsshte1
145 <<
" tssnoe1=" << tssnoe1
146 <<
" tsscce2=" << tsscce2
147 <<
" tsshte2=" << tsshte2
148 <<
" tssnoe2=" << tssnoe2
149 <<
" tssccec=" << tssccec
150 <<
" tsshtec=" << tsshtec
151 <<
" tssnoec=" << tssnoec
152 <<
" carrytss=" << carrytss
153 <<
" tssmsk1=" << tssmsk1
154 <<
" tssmsk2=" << tssmsk2 << std::endl;
157 <<
"tsmcgs1=" << tsmcgs1
158 <<
" tsmgs1=" << tsmgs1
159 <<
" tsmcgs2=" << tsmcgs2
160 <<
" tsmgs2=" << tsmgs2
161 <<
" tsmcce1=" << tsmcce1
162 <<
" tsmhte1=" << tsmhte1
163 <<
" tsmnoe1=" << tsmnoe1
164 <<
" tsmcce2=" << tsmcce2
165 <<
" tsmhte2=" << tsmhte2
166 <<
" tsmnoe2=" << tsmnoe2
167 <<
" tsmccec=" << tsmccec
168 <<
" tsmhtec=" << tsmhtec
169 <<
" tsmnoec=" << tsmnoec
170 <<
" tsmhsp=" << tsmhsp
171 <<
" carrytsms=" << carrytsms
172 <<
" carrytsmd=" << carrytsmd
176 <<
" tsmmsk2=" << tsmmsk2 << std::endl;
238 throw cms::Exception(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSSMSK1 not in correct form: " << mymsk << std::endl;
246 throw cms::Exception(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSSMSK2 not in correct form: " << mymsk << std::endl;
278 if (mygs>=0 && mygs<3)
281 throw cms::Exception(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSSGS1 value is not correct: " << mygs << std::endl;
286 if (mygs>=0 && mygs<5)
289 throw cms::Exception(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSSGS2 value is not correct: " << mygs << std::endl;
303 throw cms::Exception(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSMMSK1 not in correct form: " << mymsk << std::endl;
311 throw cms::Exception(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSMMSK2 not in correct form: " << mymsk << std::endl;
343 if (mygs>=0 && mygs<3)
346 throw cms::Exception(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSMGS1 value is not correct: " << mygs << std::endl;
351 if (mygs>=0 && mygs<5)
354 throw cms::Exception(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSMGS2 value is not correct: " << mygs << std::endl;
365 if (myhsp>=0 && myhsp<3)
368 throw cms::Exception(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSMHSP value is not correct: " << myhsp << std::endl;
374 if (word<0 || word>255){
375 throw cms::Exception(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSMWORD value is not correct: " << word << std::endl;
377 for (
int i=0;
i<7;
i++){
378 short int bit = word%2;
385 for (
int i=0;
i<24;
i++){
386 std::stringstream os;
414 ( stat==4 && (sect==9 || sect==11 ||
428 std::cout <<
"******************************************************************************" << std::endl;
429 std::cout <<
"* DTTrigger configuration : TSPhi chips *" << std::endl;
430 std::cout <<
"******************************************************************************" << std::endl << std::endl;
432 std::cout <<
" TSS Parameters:" << std::endl;
439 std::cout <<
" TSM Parameters:" << std::endl;
455 std::cout <<
"******************************************************************************" << std::endl;
464 throw cms::Exception(
"DTTPG") <<
"DTConfigTSPhi::setTssMasking : TSSMSK" << i <<
" not in correct form: " << tssmsk << std::endl;
473 throw cms::Exception(
"DTTPG") <<
"DTConfigTSPhi::setTsmMasking : TSMMSK" << i <<
" not in correct form: " << tsmmsk << std::endl;
482 bool hasthree =
false;
483 for(
int i=0;
i<3;
i++){
498 if (hasone==
true && hastwo==
true && hasthree==
true)
return true;
void setTssGhost2Corr(bool tsscgs2)
Correlated ghost 2 suppression option in TSS.
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool TsmInOutEna(int i) const
Enable Inner SL checking in TSM for sort1/2.
bool TssInOutEnaCarry() const
Enable Inner SL checking in TSS for carry.
void setTsmCorrEna(bool tsmcce, int i)
Enable Correlation checking in TSM for sort1/2.
bool TsmHtrigEna(int i) const
Enable Htrig checking in TSM for sort1/2.
bool TsmGhost2Corr() const
Correlated ghost 2 suppression option in TSM.
void setTsmInOutEnaCarry(bool tsmnoe)
Enable Inner SL checking in TSM for carry.
void setTssHtrigEna(bool tsshte, int i)
Enable Htrig checking in TSS for sort1/2.
unsigned short int m_tssgs1
unsigned short int m_tsmgs2
int TsmMasking(int i) const
Order of quality bits in TSM for sort1/2.
void setTssGhost1Corr(bool tsscgs1)
Correlated ghost 1 suppression option in TSS.
void setTssMasking(unsigned short int tssmsk, int i)
Order of quality bits in TSS for sort1/2.
unsigned short int m_tsmhsp
void setTssGhost1Flag(unsigned short tssgs1)
Ghost 1 suppression option in TSS.
int TssMasking(int i) const
Order of quality bits in TSS for sort1/2.
unsigned short int m_tsmmsk[2]
void setTsmCorrEnaCarry(bool tsmcce)
Enable Correlation checking in TSM for carry.
void setUsedTraco(int i, int val)
Enabled TRACOs in TS.
void setTsmInOutEna(bool tsmnoe, int i)
Enable Inner SL checking in TSM for sort1/2.
DTConfigTSPhi()
Constructor.
void setTssGhost2Flag(unsigned short tssgs2)
Ghost 2 suppression option in TSS.
~DTConfigTSPhi()
Destructor.
void setTsmGhost1Corr(bool tsmcgs1)
Correlated ghost 1 suppression option in TSM.
bool debug() const
Return the debug flag.
bool TssCorrEnaCarry() const
Enable Correlation checking in TSS for carry.
void setDefaults(const edm::ParameterSet &ps)
Load pset values into class variables.
void setTsmCarryFlag(unsigned short tsmhsp)
Handling of second track (carry) in case of pile-up, in TSM.
bool TsmHtrigEnaCarry() const
Enable Htrig checking in TSM for carry.
int TsmGetCarryFlag() const
Handling of second track (carry) in case of pile-up, in TSM.
unsigned short int m_tsmgs1
void setTssHtrigEnaCarry(bool tsshte)
Enable Htrig checking in TSS for carry.
void setTsmGhost2Corr(bool tsmcgs2)
Correlated ghost 2 suppression option in TSM.
int TsmGhost1Flag() const
Ghost 1 suppression option in TSM.
bool TssHtrigEnaCarry() const
Enable Htrig checking in TSS for carry.
bool TssGhost1Corr() const
Correlated ghost 1 suppression option in TSS.
void print() const
Print the setup.
void setTssCorrEna(bool tsscce, int i)
Enable Correlation checking in TSS for sort1/2.
int TSSinTSMD(int stat, int sect)
Return the max nb. of TSSs in input to a single TSMD (called ONLY in back-up mode) ...
int TssGhost2Flag() const
Ghost 2 suppression option in TSS.
void setTsmGhost2Flag(unsigned short tsmgs2)
Ghost 2 suppression option in TSM.
void setTsmGhost1Flag(unsigned short tsmgs1)
Ghost 1 suppression option in TSM.
int TssGhost1Flag() const
Ghost 1 suppression option in TSS.
int TsmGhost2Flag() const
Ghost 2 suppression option in TSM.
bool TsmCorrEnaCarry() const
Enable Correlation checking in TSM for carry.
void setTsmHtrigEna(bool tsmhte, int i)
Enable Htrig checking in TSM for sort1/2.
bool TsmCorrEna(int i) const
Enable Correlation checking in TSM for sort1/2.
void setTsmStatus(int i, int val)
TSM status.
bool TssInOutEna(int i) const
Enable Inner SL checking in TSS for sort1/2.
bool TsmInOutEnaCarry() const
Enable Inner SL checking in TSM for carry.
bool checkMask(unsigned short)
Check mask correctness.
BitArray< 8 > TsmStatus() const
TSM status.
bool TssGhost2Corr() const
Correlated ghost 2 suppression option in TSS.
void setTssCorrEnaCarry(bool tsscce)
Enable Correlation checking in TSS for.
std::ostream & print(std::ostream &o=std::cout) const
void setTsmMasking(unsigned short int tsmmsk, int i)
Order of quality bits in TSM for sort1/2.
bool TsmGhost1Corr() const
Correlated ghost 1 suppression option in TSM.
void setTsmHtrigEnaCarry(bool tsmhte)
Enable Htrig checking in TSM for carry.
bool TssCorrEna(int i) const
Enable Correlation checking in TSS for sort1/2.
unsigned short int m_tssmsk[2]
void setTssInOutEnaCarry(bool tssnoe)
Enable Inner SL checking in TSS for carry.
unsigned short int m_ntsstsmd
void setTssInOutEna(bool tssnoe, int i)
Enable Inner SL checking in TSS for sort1/2.
bool usedTraco(int i) const
Enabled TRACOs in TS.
bool TssHtrigEna(int i) const
Enable Htrig checking in TSS for sort1/2.
unsigned short int m_tssgs2