56 for (
int itk = 0; itk <= 1; itk++) {
66 std::cout <<
"DTTSM::run: Processing DTTSM: ";
78 std::cout <<
"Vector of first tracks in DTTSM: " << std::endl;
79 std::vector<DTTSCand *>::const_iterator
p;
87 if (
first !=
nullptr) {
99 std::vector<DTTSCand *>::const_iterator
p;
100 std::cout <<
"Vector of second tracks (including carry) in DTTSM: " << std::endl;
117 std::vector<DTTSCand *>::iterator
p;
124 }
else if (bkmod == 0) {
127 std::cout <<
"DTTSM::sortTSM1: bkmod not properly assigned!" << std::endl;
130 if (best ==
nullptr) {
132 }
else if ((*curr) < (*best)) {
135 }
else if (carry ==
nullptr) {
137 }
else if ((*curr) < (*carry)) {
143 if (carry !=
nullptr) {
147 if (
config()->TsmGhost1Corr()) {
150 inner_or_corr = carry->
isInner();
153 if (
config()->TsmGhost1Flag() < 2) {
155 int adj = (carry->
tssNumber() == best->tssNumber() + 1 &&
157 (carry->
tssNumber() == best->tssNumber() - 1 &&
159 (carry->
tssNumber() == best->tssNumber() &&
160 abs(carry->
TcPos() - best->TcPos()) == 1);
181 if (
config()->TsmGhost2Flag() == 3)
186 std::cout <<
"DTTSM::sortTSM2: called with no first track.";
187 std::cout <<
" empty pointer returned!" << std::endl;
194 std::vector<DTTSCand *>::iterator
p;
205 std::vector<DTTSCand *>::iterator
p;
215 inner_or_corr = curr->
isInner();
218 if (
config()->TsmGhost2Flag() != 0) {
222 (curr->
tssNumber() == best->tssNumber() && curr->
TcPos() == best->TcPos())) {
225 ((!best->isCorr()) && best->isInner() &&
238 }
else if (bkmod == 0) {
241 std::cout <<
" DTTSM::sortTSM2 bkmod not properly assigned!" << std::endl;
249 }
else if ((*curr) < (*
second)) {
264 if (ifs < 1 || ifs > 2) {
265 std::cout <<
"DTTSM::nCand: wrong track number: " << ifs;
266 std::cout <<
" 0 returned!" << std::endl;
270 return _incand[ifs - 1].size();
274 if (ifs < 1 || ifs > 2) {
275 std::cout <<
"DTTSM::getDTTSCand: wrong track number: " << ifs;
276 std::cout <<
" empty pointer returned!" << std::endl;
279 if (n < 1 || n >
nCand(ifs)) {
280 std::cout <<
"DTTSM::getDTTSCand: requested trigger not present: " <<
n;
281 std::cout <<
" empty pointer returned!" << std::endl;
284 std::vector<DTTSCand *>::const_iterator
p =
_incand[ifs - 1].begin() +
n - 1;
289 if (ifs < 1 || ifs > 2) {
290 std::cout <<
"DTTSM::getTracoT: wrong track number: " << ifs;
291 std::cout <<
" empty pointer returned!" << std::endl;
294 if (n < 1 || n >
nCand(ifs)) {
295 std::cout <<
"DTTSM::getTracoT: requested trigger not present: " <<
n;
296 std::cout <<
" empty pointer returned!" << std::endl;
304 std::cout <<
"DTTSM::getTrack: requested track not present: " <<
n;
305 std::cout <<
" empty pointer returned!" << std::endl;
308 std::vector<DTTSCand *>::const_iterator
p =
_outcand.begin() +
n - 1;
std::vector< DTTSCand * > _outcand
void setBitsTss()
Set the quality bits for DTTSS analysis.
DTTSCand * sortTSM2(int bkmod)
Sort 2.
int TsmGhost1Flag() const
Ghost 1 suppression option in TSM.
unsigned nCand(int ifs) const
Return the number of input tracks (first/second)
int nFirstT() const
Return the number of input first tracks.
static const int NTSSTSM
Constant: maximum number of TSS in input to the TSM.
void run(int bkmod)
Run the TSM algorithm.
U second(std::pair< T, U > const &p)
int isInner() const
Return Inner/Outer bit.
static const int NTCTSS
Constant: number of TRACOs in input to a TSS.
const DTConfigTSPhi * config() const
Configuration set.
const DTTracoTrigData * tracoTr() const
Return associated TRACO trigger.
Abs< T >::type abs(const T &t)
bool TsmGhost2Corr() const
Correlated ghost 2 suppression option in TSM.
int isCorr() const
Return correlation bit.
int nTracks() const
Return the number of sorted tracks.
int TsmGhost2Flag() const
Ghost 2 suppression option in TSM.
int nSecondT() const
Return the number of input second tracks.
std::vector< DTTSCand * > _incand[2]
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
void setSecondTrack()
Set the first track bit to second track (used for carry)
DTTSCand * getDTTSCand(int ifs, unsigned n) const
Return requested TS candidate.
DTTSCand * sortTSM1(int bkmod)
Sort 1.
DTTSCand * getTrack(int n) const
Return the requested track.
void addCand(DTTSCand *cand)
Add a TSS candidate to the TSM, ifs is first/second track flag.
int TcPos() const
Retrun the TRACO position inside the TSS.
const DTTracoTrigData * getTracoT(int ifs, unsigned n) const
Return requested TRACO trigger.
void setBitsBkmod()
Set the bits for TSM back-up mode.
int tssNumber() const
Return the DTTSS number.