51 bool tsscgs2, tsscgs1, tsscce1, tsshte1, tssnoe1, carrytss;
52 bool tsscce2, tsshte2, tssnoe2, tssccec, tsshtec, tssnoec;
53 unsigned short tssgs1, tssgs2, tssmsk1, tssmsk2;
55 tsscgs2 = tsscgs1 = tsscce1 = tsshte1 = tssnoe1 = carrytss =
false;
56 tsscce2 = tsshte2 = tssnoe2 = tssccec = tsshtec = tssnoec =
false;
57 tssgs1 = tssgs2 = tssmsk1 = tssmsk2 = 0;
59 memset(tstren,
true,24*
sizeof(
bool));
62 for (
int itss=0; itss<ntss; itss++) {
63 unsigned short int memory_tss[27];
65 for(
int ts=0;ts<27;ts++){
66 memory_tss[ts] = tss_buffer[itss][ts+4];
70 tstren[itss*4] = !(memory_tss[1]&0x08);
71 tstren[itss*4+1] = !(memory_tss[1]&0x80);
72 tstren[itss*4+2] = !(memory_tss[2]&0x08);
73 tstren[itss*4+3] = !(memory_tss[2]&0x80);
76 tsscgs2 = !(memory_tss[0]&0x08);
77 tssgs2 = memory_tss[0]&0x04 ? 0 : 1;
78 tsscgs1 = !(memory_tss[0]&0x02);
79 tssgs1 = memory_tss[0]&0x01 ? 0 : 1;
80 tsscce1 = !(memory_tss[4]&0x04);
81 tsshte1 = !(memory_tss[4]&0x02);
82 tssnoe1 = !(memory_tss[4]&0x01);
83 tsscce2 = !(memory_tss[3]&0x40);
84 tsshte2 = !(memory_tss[3]&0x20);
85 tssnoe2 = !(memory_tss[3]&0x10);
86 tssccec = !(memory_tss[3]&0x04);
87 tsshtec = !(memory_tss[3]&0x02);
88 tssnoec = !(memory_tss[3]&0x01);
89 carrytss= !(memory_tss[4]&0x40);
90 tssmsk1 = memory_tss[4]&0x10 ? 132 : 312;
91 tssmsk2 = memory_tss[4]&0x20 ? 132 : 312;
99 unsigned short int memory_tsms[2], memory_tsmdu[2], memory_tsmdd[2];
101 for(
int ts=0;ts<2;ts++){
102 memory_tsms[ts] = tsm_buffer[ts+3];
103 memory_tsmdu[ts] = tsm_buffer[ts+5];
104 memory_tsmdd[ts] = tsm_buffer[ts+7];
110 unsigned short tsmgs1 = memory_tsms[1]&0x02 ? 0 : 1;
112 unsigned short tsmgs2 = 1;
122 bool carrytsms = !(memory_tsms[1]&0x01);
123 unsigned short tsmmsk1 = memory_tsms[1]&0x08 ? 321 : 312;
124 unsigned short tsmmsk2 = tsmmsk1;
126 tsmword[0] = !((memory_tsmdu[0]&0x80)&&(memory_tsmdd[0]&0x80));
127 tsmword[1] = !(memory_tsms[0]&0x01);
128 tsmword[2] = !(memory_tsms[0]&0x02);
129 tsmword[3] = !(memory_tsms[0]&0x04);
130 tsmword[4] = !(memory_tsms[0]&0x08);
131 tsmword[5] = !(memory_tsms[0]&0x10);
132 tsmword[6] = !(memory_tsms[0]&0x20);
133 tsmword[7] = !(memory_tsms[0]&0x40);
134 bool carrytsmd = !((memory_tsmdu[0]&0x10)&&(memory_tsmdd[0]&0x10));
136 unsigned short tsmhsp = carrytss && carrytsms && carrytsmd;
144 <<
" tssgs1=" << tssgs1
145 <<
" tsscgs2=" << tsscgs2
146 <<
" tssgs2=" << tssgs2
147 <<
" tsscce1=" << tsscce1
148 <<
" tsshte1=" << tsshte1
149 <<
" tssnoe1=" << tssnoe1
150 <<
" tsscce2=" << tsscce2
151 <<
" tsshte2=" << tsshte2
152 <<
" tssnoe2=" << tssnoe2
153 <<
" tssccec=" << tssccec
154 <<
" tsshtec=" << tsshtec
155 <<
" tssnoec=" << tssnoec
156 <<
" carrytss=" << carrytss
157 <<
" tssmsk1=" << tssmsk1
158 <<
" tssmsk2=" << tssmsk2 << std::endl;
161 <<
"tsmcgs1=" << tsmcgs1
162 <<
" tsmgs1=" << tsmgs1
163 <<
" tsmcgs2=" << tsmcgs2
164 <<
" tsmgs2=" << tsmgs2
165 <<
" tsmcce1=" << tsmcce1
166 <<
" tsmhte1=" << tsmhte1
167 <<
" tsmnoe1=" << tsmnoe1
168 <<
" tsmcce2=" << tsmcce2
169 <<
" tsmhte2=" << tsmhte2
170 <<
" tsmnoe2=" << tsmnoe2
171 <<
" tsmccec=" << tsmccec
172 <<
" tsmhtec=" << tsmhtec
173 <<
" tsmnoec=" << tsmnoec
174 <<
" tsmhsp=" << tsmhsp
175 <<
" carrytsms=" << carrytsms
176 <<
" carrytsmd=" << carrytsmd
180 <<
" tsmmsk2=" << tsmmsk2 << std::endl;
245 edm::LogVerbatim(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSSMSK1 not in correct form: " << mymsk << std::endl;
253 edm::LogVerbatim(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSSMSK2 not in correct form: " << mymsk << std::endl;
285 if (mygs>=0 && mygs<3)
288 edm::LogVerbatim(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSSGS1 value is not correct: " << mygs << std::endl;
293 if (mygs>=0 && mygs<5)
296 edm::LogVerbatim(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSSGS2 value is not correct: " << mygs << std::endl;
310 edm::LogVerbatim(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSMMSK1 not in correct form: " << mymsk << std::endl;
318 edm::LogVerbatim(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSMMSK2 not in correct form: " << mymsk << std::endl;
350 if (mygs>=0 && mygs<3)
353 edm::LogVerbatim(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSMGS1 value is not correct: " << mygs << std::endl;
358 if (mygs>=0 && mygs<5)
361 edm::LogVerbatim(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSMGS2 value is not correct: " << mygs << std::endl;
372 if (myhsp>=0 && myhsp<3)
375 edm::LogVerbatim(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSMHSP value is not correct: " << myhsp << std::endl;
381 if (word<0 || word>255){
382 edm::LogVerbatim(
"DTTPG") <<
"DTConfigTSPhi::setDefaults : TSMWORD value is not correct: " << word << std::endl;
384 for (
int i=0;
i<7;
i++){
385 short int bit = word%2;
392 for (
int i=0;
i<24;
i++){
393 std::stringstream os;
421 ( stat==4 && (sect==9 || sect==11 ||
431 std::cout <<
"******************************************************************************" << std::endl;
432 std::cout <<
"* DTTrigger configuration : TSPhi chips *" << std::endl;
433 std::cout <<
"******************************************************************************" << std::endl << std::endl;
435 std::cout <<
" TSS Parameters:" << std::endl;
442 std::cout <<
" TSM Parameters:" << std::endl;
458 std::cout <<
"******************************************************************************" << std::endl;
468 int nValidTSS =
static_cast<int>(isMaskValid && isGsValid ?
m_ntss : 0);
479 int nValidTSM =
static_cast<int>(isMaskValid && isGsValid && isCarryValid ?
m_ntsm : 0);
490 bool hasthree =
false;
491 for(
int i=0;
i<3;
i++){
506 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.
int nValidTSM() const
Number of correctly configured TSS.
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() override
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.
int TSSinTSMD(int stat, int sect) const
Return the max nb. of TSSs in input to a single TSMD (called ONLY in back-up mode) ...
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 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.
int nValidTSS() const
Number of correctly configured TSS.
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.
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 checkMask(unsigned short) const
Check mask correctness.
bool TssHtrigEna(int i) const
Enable Htrig checking in TSS for sort1/2.
unsigned short int m_tssgs2