CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
DTTracoChip Class Reference

#include <DTTracoChip.h>

Public Member Functions

void add_btiT (int step, int pos, const DTBtiTrigData *btitrig)
 Add a BTI trigger to the TRACO. More...
 
void addTrig (int step, DTTracoTrig *)
 Add a TRACO trigger. More...
 
int BTIC () const
 BTIC parameter. More...
 
void calculateAngles (DTTracoTrig *)
 Calculate trigger angles. More...
 
void clear ()
 Clear. More...
 
GlobalPoint CMSPosition () const
 Position in CMS frame. More...
 
DTConfigTracoconfig () const
 Configuration set. More...
 
int DD () const
 DD parameter. More...
 
 DTTracoChip (DTTracoCard *card, int n, DTConfigTraco *config)
 Constructor. More...
 
 DTTracoChip (const DTTracoChip &traco)
 Copy constructor. More...
 
int edgeBTI (int step, int io, int lr) const
 flags for HTRIG in edge BTI More...
 
DTTrigGeomgeom () const
 Return trigger geometry. More...
 
int IBTIOFF () const
 IBTIOFF parameter. More...
 
DTTracoId id () const
 Return TRACO id. More...
 
int KRad () const
 K par of the radial angle of corr center referred to plane sl. More...
 
LocalPoint localPosition () const
 Position in chamber frame. More...
 
int nTrig (int step) const
 Return the number of trigger candidates. More...
 
int number () const
 Return TRACO number. More...
 
DTTracoChipoperator= (const DTTracoChip &traco)
 Assignment operator. More...
 
int ovlFlag (int step)
 return overlap flag More...
 
float psiRad (int sl=0) const
 Radial angle of correlator center in mrad referred to plane sl. More...
 
void raiseOverlap (int step)
 raise overlap flag More...
 
void run ()
 Run TRACO algorithm. More...
 
int sector () const
 Return sector number. More...
 
void setFlag (int step, int ext=0)
 Set flags for multiple trigger detection between cons. TRACO's. More...
 
void setPV (int step, int ntrk, int code, int K)
 Set the preview values for a TRACO trigger. More...
 
int station () const
 Return station number. More...
 
DTTracoTrigtrigger (int step, unsigned n) const
 Return the requested trigger. More...
 
DTTracoTrigData triggerData (int step, unsigned n) const
 Return the data part of the requested trigger. More...
 
int useSecondTrack (int step) const
 a flag for a usable second track More...
 
int wheel () const
 Return wheel number. More...
 
 ~DTTracoChip ()
 Destructor. More...
 

Private Member Functions

int AdjBtiLTSuppressed (DTTracoCand *candidate)
 Do suppression of LTRIG on adjacent TRACO. More...
 
DTTracoCandbestCand (int itk, std::vector< DTTracoCand > &tclist)
 Get the best inner/outer candidate. More...
 
void DoAdjBtiLts (DTTracoCand *candidate, std::vector< DTTracoCand > &tclist)
 Do suppression of LTRIG on BTI close to selected HTRIG. More...
 
int insideAngWindow (DTTracoTrig *) const
 Check if a trigger is inside the angular acceptance window. More...
 
DTTracoTrigsetPV (int itk, DTTracoCand *inner, DTTracoCand *outer)
 Set the preview for a trigger. More...
 
void setTracoAcceptances ()
 Compute traco chip acceptances. More...
 
int storeCorr (DTTracoTrig *tctrig, DTTracoCand *inner, DTTracoCand *outer, int tkn)
 Check correlation and store correlated trigger. More...
 
int storeUncorr (DTTracoTrig *tctrig, DTTracoCand *inner, DTTracoCand *outer, int tkn)
 Store uncorrelated trigger. More...
 

Private Attributes

int _btic
 
BitArray< DTConfigTraco::NSTEPL+2 > _bxlts
 
DTTracoCard_card
 
DTConfigTraco_config
 
int _dd
 
BitArray< 32 > _flag [DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
 
DTTrigGeom_geom
 
int _ibtioff
 
DTTracoId _id
 
std::vector< DTTracoCand_innerCand [DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
 
int _krad
 
DTTracoLUTs_luts
 
Lut_lutsCCB
 
std::vector< DTTracoCand_outerCand [DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
 
int _PSIMAX [4 *DTConfig::NBTITC]
 
int _PSIMIN [4 *DTConfig::NBTITC]
 
std::vector< DTTracoTrig * > _tracotrig [DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
 

Detailed Description

Implementation of TRACO trigger algorithm. Internally uses DTTracoCand to store BTI triggers

Author
S. Vanini

Definition at line 53 of file DTTracoChip.h.

Constructor & Destructor Documentation

◆ DTTracoChip() [1/2]

DTTracoChip::DTTracoChip ( DTTracoCard card,
int  n,
DTConfigTraco config 
)

Constructor.

Constructor for passing configuration

Definition at line 47 of file DTTracoChip.cc.

References _btic, _bxlts, _card, _flag, _geom, _ibtioff, _id, _innerCand, _krad, _luts, _lutsCCB, _outerCand, _tracotrig, DTConfigTraco::BTIC(), DTTrigGeom::cellPitch(), CMSPosition(), config(), DTTracoCard::config_luts(), gather_cfg::cout, debug, DTGeomSupplier::geom(), mps_fire::i, DTConfigTraco::KRAD(), KRad(), DTTrigGeom::localPosition(), DTTracoCard::lutFromDBFlag(), dqmiodumpmetadata::n, DTConfig::NBTITC, DTConfig::NSTEPF, DTConfig::NSTEPL, DTTrigGeom::phiSLOffset(), psiRad(), DTChamberId::sector(), setTracoAcceptances(), DTTrigGeom::statId(), DTChamberId::station(), DTChamberId::wheel(), x, and BitArray< N >::zero().

47  : _card(card), _config(conf) {
48  _geom = _card->geom();
49 
50  // n=traco number 1,2,...
51  if (config()->debug() == 4) {
52  std::cout << "DTTracoChip constructor called for TRACO number " << n << std::endl;
53  }
54 
55  // set acceptances from CMSSW geometry
57 
58  // reserve the appropriate amount of space for vectors
59  int i = 0;
60  for (i = 0; i < DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF; i++) {
62  _outerCand[i].reserve(3 * DTConfigTraco::NBTITC);
63  _tracotrig[i].reserve(2);
64  }
65 
66  // the identifier
67  DTChamberId sid = _geom->statId();
68  _id = DTTracoId(sid, n);
69 
70  // Flags for LTS
71  _bxlts.zero();
72  for (int is = 0; is < DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF + 1; is++) {
73  _flag[is].zero();
74  }
75 
76  // debugging
77  if (config()->debug() == 4) {
78  std::cout << "CMS position:" << CMSPosition() << std::endl;
79  std::cout << " psiRad=" << psiRad() << " KRad=" << KRad() << std::endl;
80  }
81 
82  // init traco parameters from traco config file
83  _krad = config()->KRAD();
84  _btic = config()->BTIC();
85 
86  // offset from geometry (x1-x3 FE view): converted from cm to ST units (0.9999
87  // for rounding)
88  _ibtioff = static_cast<int>(config()->BTIC() / (_geom->cellPitch()) * (_geom->phiSLOffset() / 0.9999));
89 
90  // 091030 SV lut parameters from DB
91  // SV 08/12/12 : added flag for computing luts from DB parameters
92  if (_card->lutFromDBFlag() == 1) {
93  // int board = int( (n-1)/4 );
94  // int traco = int(fmod( double(n-1),4.));
95  // 110208 SV for TRACO hardware bug included SL_shift
96  // SL shift
97  float xBTI1_3 = _geom->localPosition(DTBtiId(DTSuperLayerId(sid.wheel(), sid.station(), sid.sector(), 3), 1)).x();
98  float xBTI1_1 = _geom->localPosition(DTBtiId(DTSuperLayerId(sid.wheel(), sid.station(), sid.sector(), 1), 1)).x();
99  float SL_shift = xBTI1_3 - xBTI1_1;
100 
101  _lutsCCB = new Lut(_card->config_luts(), n, SL_shift);
102  _luts = nullptr;
103  } else
104  // this is always the case with new DTConfig SV 15/I/2007
105  // if( config()->trigSetupGeom()==0 ){
106  {
107  _luts = nullptr;
108  _lutsCCB = nullptr;
109  }
110  /*
111  //SV 21/V/03 for testbeam purpose: parameters from hardware setup
112  if(config()->trigSetupGeom()==1){
113  //init traco parameters
114  _dd=config()->DD();
115  _krad=config()->KRAD();
116  _btic=config()->BTIC();
117  _ibtioff=config()->IBTIOFF();
118 
119  //const char* testfile = "traco"; //FIXTB
120  std::string testfile = "traco_";
121  int it = number() - 4 - 1;
122  if(it<10)
123  testfile += it+'0';
124  if(it>9){
125  testfile += int(float(it)/10.0) + '0'; //add decimal char
126  testfile += int(fmod(float(it),float(10))) + '0'; //add unit char
127  }
128 
129  //const char* name = testfile;
130  if(config()->debug()==4)
131  std::cout << "Loading " << testfile << " luts for traco " << number() <<
132  std::endl; _luts = new DTTracoLUTs(testfile); _luts->reset(); _luts->load();
133  if(config()->debug()==4)
134  _luts->print();
135  }//end hardware setup
136 
137  //TB 2004 setup : luts from minicrate ccb equations
138  if(config()->trigSetupGeom()==2){
139  int board = int( (n-1)/4 );
140  int traco = fmod( double(n-1),4. );
141  _lutsCCB = new Lut(sid.station(),board,traco);
142  // 091030 SV this constructur is obsolete now, use setForTestBeam instead
143  }//end TB2004
144  */
145 }
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
Definition: DTTrigGeom.cc:508
int station() const
Return the station number.
Definition: DTChamberId.h:45
int KRad() const
K par of the radial angle of corr center referred to plane sl.
int BTIC() const
BTIC traco parameter: must be equal to Btis ST parameter.
Definition: DTConfigTraco.h:68
float cellPitch() const
Width of a cell (cm) i.e. distance between ywo wires.
Definition: DTTrigGeom.h:76
Lut * _lutsCCB
Definition: DTTracoChip.h:220
void setTracoAcceptances()
Compute traco chip acceptances.
DTTracoLUTs * _luts
Definition: DTTracoChip.h:218
DTTracoId _id
Definition: DTTracoChip.h:186
void zero()
Definition: BitArray.h:210
static const int NSTEPF
Definition: DTConfig.h:35
bool lutFromDBFlag()
Return lut computation option (DB/geometry)
Definition: DTTracoCard.h:114
float psiRad(int sl=0) const
Radial angle of correlator center in mrad referred to plane sl.
GlobalPoint CMSPosition() const
Position in CMS frame.
Definition: DTTracoChip.h:150
DTTrigGeom * geom() const
Associated geometry.
DTChamberId statId() const
Identifier of the associated chamber.
Definition: DTTrigGeom.h:53
std::vector< DTTracoCand > _outerCand[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:199
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
std::vector< DTTracoTrig * > _tracotrig[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:202
std::vector< DTTracoCand > _innerCand[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:198
#define debug
Definition: HDRShower.cc:19
float phiSLOffset()
Superlayer offset in chamber front-end frame, in cm.
Definition: DTTrigGeom.cc:64
DTConfigTraco * _config
Definition: DTTracoChip.h:190
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:42
const DTConfigLUTs * config_luts() const
Return LUTS config for this chamber (=minicrate)
Definition: DTTracoCard.h:108
int sector() const
Definition: DTChamberId.h:52
DTConfigTraco * config() const
Configuration set.
Definition: DTTracoChip.h:113
BitArray< 32 > _flag[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:211
DTTracoCard * _card
Definition: DTTracoChip.h:188
int KRAD() const
KRAD traco parameter.
Definition: DTConfigTraco.h:65
BitArray< DTConfigTraco::NSTEPL+2 > _bxlts
Definition: DTTracoChip.h:205
static const int NBTITC
Definition: DTConfig.h:37
DTTrigGeom * _geom
Definition: DTTracoChip.h:185
Definition: Lut.h:31

◆ DTTracoChip() [2/2]

DTTracoChip::DTTracoChip ( const DTTracoChip traco)

Copy constructor.

Definition at line 147 of file DTTracoChip.cc.

References _bxlts, _flag, _innerCand, _outerCand, _tracotrig, mps_fire::i, DTConfig::NBTITC, DTConfig::NSTEPF, DTConfig::NSTEPL, AlCaHLTBitMon_ParallelJobs::p, and LaserDQM_cfg::p1.

148  : _geom(traco._geom), _id(traco._id), _card(traco._card), _luts(traco._luts) {
149  int i = 0;
150  for (i = 0; i < DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF; i++) {
152  std::vector<DTTracoCand>::const_iterator p;
153  for (p = traco._innerCand[i].begin(); p < traco._innerCand[i].end(); p++) {
154  _innerCand[i].push_back(*p);
155  }
156  _outerCand[i].reserve(3 * DTConfigTraco::NBTITC);
157  for (p = traco._outerCand[i].begin(); p < traco._outerCand[i].end(); p++) {
158  _outerCand[i].push_back(*p);
159  }
160  _tracotrig[i].reserve(2);
161  std::vector<DTTracoTrig *>::const_iterator p1;
162  for (p1 = traco._tracotrig[i].begin(); p1 < traco._tracotrig[i].end(); p1++) {
163  _tracotrig[i].push_back(*p1);
164  }
165  }
166  _bxlts = traco._bxlts;
167  for (int is = 0; is < DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF + 1; is++) {
168  _flag[is] = traco._flag[is];
169  }
170 }
DTTracoLUTs * _luts
Definition: DTTracoChip.h:218
DTTracoId _id
Definition: DTTracoChip.h:186
static const int NSTEPF
Definition: DTConfig.h:35
std::vector< DTTracoCand > _outerCand[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:199
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
std::vector< DTTracoTrig * > _tracotrig[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:202
std::vector< DTTracoCand > _innerCand[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:198
BitArray< 32 > _flag[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:211
DTTracoCard * _card
Definition: DTTracoChip.h:188
BitArray< DTConfigTraco::NSTEPL+2 > _bxlts
Definition: DTTracoChip.h:205
static const int NBTITC
Definition: DTConfig.h:37
DTTrigGeom * _geom
Definition: DTTracoChip.h:185

◆ ~DTTracoChip()

DTTracoChip::~DTTracoChip ( )

Destructor.

Definition at line 175 of file DTTracoChip.cc.

References _card, _lutsCCB, clear(), and DTTracoCard::lutFromDBFlag().

175  {
176  clear();
177  /*
178  if(config()->trigSetupGeom()==1){
179  _luts->reset();
180  delete _luts;
181  }
182 
183  if(config()->trigSetupGeom()==2)
184  delete _lutsCCB;
185  */
186 
187  if (_card->lutFromDBFlag() == 1)
188  delete _lutsCCB;
189 }
Lut * _lutsCCB
Definition: DTTracoChip.h:220
bool lutFromDBFlag()
Return lut computation option (DB/geometry)
Definition: DTTracoCard.h:114
void clear()
Clear.
Definition: DTTracoChip.cc:225
DTTracoCard * _card
Definition: DTTracoChip.h:188

Member Function Documentation

◆ add_btiT()

void DTTracoChip::add_btiT ( int  step,
int  pos,
const DTBtiTrigData btitrig 
)

Add a BTI trigger to the TRACO.

Definition at line 962 of file DTTracoChip.cc.

References _bxlts, _card, _id, _innerCand, _outerCand, _PSIMAX, _PSIMIN, DTBtiTrigData::code(), config(), gather_cfg::cout, debug, DTConfigTraco::debug(), BitArray< N >::element(), DTBtiTrigData::K(), DTConfig::NBTITC, DTConfig::NSTEPF, DTConfig::NSTEPL, number(), DTBtiTrigData::print(), BitArray< N >::set(), DTTracoId::traco(), and DTTracoCard::useAcceptParamFlag().

Referenced by DTTracoCard::loadTRACO().

962  {
963  if (pos < 1 || pos > 4 * DTConfigTraco::NBTITC) {
964  std::cout << "DTTracoChip::add_btiT: wrong position: " << pos;
965  std::cout << "trigger not added!" << std::endl;
966  return;
967  }
969  std::cout << "DTTracoChip::add_btiT: step out of range: " << step;
970  std::cout << "trigger not added!" << std::endl;
971  return;
972  }
973 
974  if (!config()->usedBti(pos)) {
975  if (config()->debug() == 4) {
976  std::cout << "DTTracoChip::add_btiT: position: " << pos;
977  std::cout << "has disconnected bti" << std::endl;
978  }
979  return;
980  }
981 
982  // 091103 SV: acceptances are taken from geometry if useAcceptParam()=false
983  // otherwise cuts based on LL,LH,CL,CH,RL,RH taken from configuration are
984  // applied in TracoCard::loadTraco
985  if (_card->useAcceptParamFlag() == false) {
986  // check K inside acceptance
987  if (btitrig->K() < _PSIMIN[pos - 1] || btitrig->K() > _PSIMAX[pos - 1]) {
988  if (config()->debug() > 1) {
989  std::cout << "In TRACO num. " << number() << " BTI trig. in pos " << pos << " outside K acceptance (";
990  std::cout << _PSIMIN[pos - 1] << "-->";
991  std::cout << _PSIMAX[pos - 1] << ") - Not added" << std::endl;
992  }
993  return;
994  }
995  }
996 
997  // Store trigger candidate
998  if (pos <= DTConfigTraco::NBTITC) {
999  _innerCand[step - DTConfigTraco::NSTEPF].push_back(DTTracoCand(this, btitrig, pos, step));
1000  } else {
1001  _outerCand[step - DTConfigTraco::NSTEPF].push_back(DTTracoCand(this, btitrig, pos, step));
1002  }
1003 
1004  // Fill array for BX LTS
1005  if (btitrig->code() == 8) {
1006  for (int is = step - 4; is < step; is++) { // set flag for 4 previous BX
1007  if (is > 0 && is <= DTConfigTraco::NSTEPL)
1008  _bxlts.set(is);
1009  }
1010  // SV 1/IV/04 BUG FIX
1011  _bxlts.set(step + 1);
1012  // Debugging
1013  if (config()->debug() == 4)
1014  for (int is = 0; is < DTConfigTraco::NSTEPL; is++)
1015  std::cout << "_bxlts[" << is << "]=" << _bxlts.element(is) << std::endl;
1016  }
1017 
1018  // Debugging
1019  if (config()->debug() > 1) {
1020  std::cout << "BTI Trigger added at step " << step;
1021  std::cout << " to TRACO " << _id.traco() << " at position " << pos << std::endl;
1022  btitrig->print();
1023  } // End debugging
1024 }
int _PSIMAX[4 *DTConfig::NBTITC]
Definition: DTTracoChip.h:215
int K() const
Return trigger K parameter.
DTTracoId _id
Definition: DTTracoChip.h:186
static const int NSTEPF
Definition: DTConfig.h:35
int code() const
Return trigger code.
int traco() const
Returns the traco.
Definition: DTTracoId.h:62
std::vector< DTTracoCand > _outerCand[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:199
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
std::vector< DTTracoCand > _innerCand[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:198
#define debug
Definition: HDRShower.cc:19
int debug() const
Debug flag.
Definition: DTConfigTraco.h:62
bool useAcceptParamFlag()
Return acceptance flag.
Definition: DTTracoCard.h:111
DTConfigTraco * config() const
Configuration set.
Definition: DTTracoChip.h:113
int _PSIMIN[4 *DTConfig::NBTITC]
Definition: DTTracoChip.h:214
void print() const override
Print.
DTTracoCard * _card
Definition: DTTracoChip.h:188
BitArray< DTConfigTraco::NSTEPL+2 > _bxlts
Definition: DTTracoChip.h:205
step
Definition: StallMonitor.cc:83
static const int NBTITC
Definition: DTConfig.h:37
int number() const
Return TRACO number.
Definition: DTTracoChip.h:89
void set(const int i)
Definition: BitArray.h:224
int element(const int pos) const
Definition: BitArray.h:206

◆ addTrig()

void DTTracoChip::addTrig ( int  step,
DTTracoTrig tctrig 
)

Add a TRACO trigger.

Definition at line 1026 of file DTTracoChip.cc.

References _tracotrig, config(), gather_cfg::cout, debug, DTConfig::NSTEPF, DTConfig::NSTEPL, and DTTracoTrig::print().

Referenced by run(), and DTTracoCard::storeTrigger().

1026  {
1028  std::cout << "DTTracoChip::addTrig: step out of range: " << step;
1029  std::cout << " trigger not added!" << std::endl;
1030  return;
1031  }
1032  _tracotrig[step - DTConfigTraco::NSTEPF].push_back(tctrig);
1033 
1034  // Debugging...
1035 
1036  if (config()->debug() == 4) {
1037  std::cout << "DTTracoChip::addTrig: adding trigger:" << std::endl;
1038  tctrig->print();
1039  }
1040  // End debugging
1041 }
static const int NSTEPF
Definition: DTConfig.h:35
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
std::vector< DTTracoTrig * > _tracotrig[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:202
void print() const override
Print.
Definition: DTTracoTrig.h:109
#define debug
Definition: HDRShower.cc:19
DTConfigTraco * config() const
Configuration set.
Definition: DTTracoChip.h:113
step
Definition: StallMonitor.cc:83

◆ AdjBtiLTSuppressed()

int DTTracoChip::AdjBtiLTSuppressed ( DTTracoCand candidate)
private

Do suppression of LTRIG on adjacent TRACO.

Definition at line 528 of file DTTracoChip.cc.

References _flag, DTTracoCand::BtiTrig(), DTBtiTrigData::code(), BitArray< N >::element(), DTConfig::NBTITC, DTConfig::NSTEPF, DTTracoCand::position(), and DTTracoCand::step().

Referenced by bestCand().

528  {
529  // If requested, do suppression of LTRIG on adjacent BTI -> obsolete!
530  // if(!(config()->adjBtiLts()) && candidate->BtiTrig()->code()<8) {
531  // SV: Ltrig always suppressed in hardware if Htrig in adj traco!
532  if (candidate->BtiTrig()->code() < 8) {
533  if (_flag[candidate->step() - DTConfigTraco::NSTEPF].element(3) && candidate->position() == 1)
534  return 1;
535  if (_flag[candidate->step() - DTConfigTraco::NSTEPF].element(4) && candidate->position() == DTConfigTraco::NBTITC)
536  return 1;
537  if (_flag[candidate->step() - DTConfigTraco::NSTEPF].element(5) &&
538  candidate->position() == DTConfigTraco::NBTITC + 1)
539  return 1;
540  if (_flag[candidate->step() - DTConfigTraco::NSTEPF].element(6) &&
541  candidate->position() == DTConfigTraco::NBTITC * 4)
542  return 1;
543  }
544  //}
545  return 0;
546 }
const DTBtiTrigData * BtiTrig() const
Return associated BTI trigger.
Definition: DTTracoCand.h:68
static const int NSTEPF
Definition: DTConfig.h:35
int position() const
Return position inside TRACO.
Definition: DTTracoCand.h:74
int code() const
Return trigger code.
int step() const
Return Bunch crossing.
Definition: DTTracoCand.h:71
BitArray< 32 > _flag[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:211
static const int NBTITC
Definition: DTConfig.h:37
int element(const int pos) const
Definition: BitArray.h:206

◆ bestCand()

DTTracoCand * DTTracoChip::bestCand ( int  itk,
std::vector< DTTracoCand > &  tclist 
)
private

Get the best inner/outer candidate.

Definition at line 447 of file DTTracoChip.cc.

References AdjBtiLTSuppressed(), config(), gather_cfg::cout, DTConfigTraco::debug(), mps_fire::i, AlCaHLTBitMon_ParallelJobs::p, DTConfigTraco::prefHtrig(), groupFilesInBlocks::reverse, and DTConfigTraco::sortKascend().

Referenced by run().

447  {
448  // Return if no candidates
449  if (tclist.empty())
450  return nullptr;
451 
452  // stl function: sort in Ktc ascending or descending order according
453  // to user request comparing by default with user-defined <
454  // NB don't reverse if candidates are two with same K
455  stable_sort(tclist.begin(), tclist.end()); // 0=K ascending, 1=K descending
456  if (config()->sortKascend(itk) && !(tclist.size() == 2 && tclist[0].K() == tclist[1].K())) {
457  reverse(tclist.begin(), tclist.end());
458  if (config()->debug() == 4)
459  std::cout << "Reversing order of sorted candidate list..." << std::endl;
460  }
461 
462  /*
463  if(!config()->sortKascend(itk)){
464  stable_sort( tclist.begin(),tclist.end(),DTTracoCand::closer );
465  } else {
466  stable_sort( tclist.begin(),tclist.end(),DTTracoCand::wider );
467  }
468  */
469 
470  // debugging...
471  if (config()->debug() == 4) {
472  std::cout << "DTTracoChip::findBest - Looking for track number " << itk + 1 << std::endl;
473  std::cout << "Sorted std::vector of usable track candidates is:" << std::endl;
474  int i = 1;
475  for (std::vector<DTTracoCand>::iterator p = tclist.begin(); p < tclist.end(); p++) {
476  if ((*p).usable()) {
477  std::cout << " DTTracoChip Candidate # " << i++;
478  (*p).print();
479  }
480  }
481  std::cout << "--------------------------------------------------" << std::endl;
482  }
483  // end debugging
484 
485  // return the best candidate
486  int i = 0;
487  DTTracoCand *bestltrig = nullptr;
488  std::vector<DTTracoCand>::iterator p;
489  for (p = tclist.begin(); p < tclist.end(); ++p) {
490  i++;
491  // candidate must be usable and not suppressed by LTS
492  if (AdjBtiLTSuppressed(&(*p)))
493  if (config()->debug() == 4)
494  std::cout << "Candidate # " << i << " supp. because next to H in adiacent Tracos" << std::endl;
495  if ((*p).usable() && !AdjBtiLTSuppressed(&(*p))) {
496  // check if preference to HTRIG is set and return first trigger
497  if (!config()->prefHtrig(itk))
498  return &(*p);
499  if ((*p).BtiTrig()->code() == 8)
500  return &(*p);
501  if (bestltrig == nullptr)
502  bestltrig = &(*p);
503  }
504  }
505  return bestltrig;
506 }
int sortKascend(int i) const
Ascend. order for K sorting first/second tracks: F(S)HISM.
int AdjBtiLTSuppressed(DTTracoCand *candidate)
Do suppression of LTRIG on adjacent TRACO.
Definition: DTTracoChip.cc:528
int prefHtrig(int i) const
Preference to HTRIG on first/second tracks: F(S)HTPRF.
int debug() const
Debug flag.
Definition: DTConfigTraco.h:62
DTConfigTraco * config() const
Configuration set.
Definition: DTTracoChip.h:113

◆ BTIC()

int DTTracoChip::BTIC ( ) const
inline

BTIC parameter.

Definition at line 123 of file DTTracoChip.h.

References _btic.

Referenced by DTTracoCand::DTTracoCand(), storeCorr(), and storeUncorr().

123 { return _btic; }

◆ calculateAngles()

void DTTracoChip::calculateAngles ( DTTracoTrig tct)

Calculate trigger angles.

Definition at line 1166 of file DTTracoChip.cc.

References _card, _geom, _lutsCCB, DTTracoTrig::ChamberId(), DTGeomSupplier::CMSPosition(), config(), gather_cfg::cout, DTTracoTrig::data(), debug, TauDecayModes::dec, RemoveAddSevLevel::flag, Lut::get_k(), Lut::get_x(), createfilelist::int, DTTracoTrig::K(), DTTracoCard::localDirection(), DTTracoCard::lutFromDBFlag(), M_PI, PV3DBase< T, PVType, FrameType >::phi(), DTTrigGeom::phiCh(), DTTracoTrig::print(), DTTracoTrigData::qdec(), DTConfigTraco::RESOLPSI, DTConfigTraco::RESOLPSIR, DTChamberId::sector(), DTTracoTrig::setAngles(), DTChamberId::wheel(), PV3DBase< T, PVType, FrameType >::x(), DTTracoTrig::X(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by storeCorr(), and storeUncorr().

1166  {
1167  int ipsi = 0;
1168  int iphir = 0;
1169  int idpsir = 0;
1170  /* obsolete
1171  //TB 2004 luts formula from minicrate CCB
1172  if( config()->trigSetupGeom()==2 ){
1173  ipsi = _lutsCCB->get_k( (tct->K()+511) );
1174 
1175  int flag = 0;
1176  int qual=tct->data().qdec();
1177  if(qual==3 || qual==1) //case 0:outer
1178  flag=0;
1179  if(qual==2 || qual==0) //case 1:inner
1180  flag=1;
1181  if(qual==6 || qual==5 || qual==4) //case 2:correlated
1182  flag=2;
1183 
1184  iphir = _lutsCCB->get_x( (tct->X()+512*flag) );
1185 
1186  idpsir = ipsi - iphir/8;
1187  }
1188 
1189  //TB 2003 luts data format
1190  if( config()->trigSetupGeom()==1 ){
1191  //compute bending angles of traco output with lookup tables
1192  //SV TB2003: first trigger board isn't connected;
1193  ipsi = _luts->getPsi(tct->K());
1194  int flag = 0;
1195  int qual=tct->data().qdec();
1196  if(qual==3 || qual==1) //case 0:outer
1197  flag=0;
1198  if(qual==2 || qual==0) //case 1:inner
1199  flag=1;
1200  if(qual==6 || qual==5 || qual==4) //case 2:correlated
1201  flag=2;
1202  iphir = _luts->getPhiRad( tct->X(), flag);
1203  idpsir = _luts->getBendAng( tct->X(), tct->K(), flag);
1204  }
1205  */
1206 
1207  // 091030 SV angles computed from DB lut parameters
1208  if (_card->lutFromDBFlag() == 1) {
1209  ipsi = _lutsCCB->get_k((tct->K() + 512));
1210 
1211  int flag = 0;
1212  int qual = tct->data().qdec();
1213  if (qual == 3 || qual == 1) // case 0:outer
1214  flag = 0;
1215  if (qual == 2 || qual == 0) // case 1:inner
1216  flag = 1;
1217  if (qual == 6 || qual == 5 || qual == 4) // case 2:correlated
1218  flag = 2;
1219 
1220  iphir = _lutsCCB->get_x((tct->X() + 512 * flag));
1221 
1222  idpsir = ipsi - iphir / 8;
1223  } else
1224  // compute angles from CMSSW geometry
1225  // if( config()->trigSetupGeom()==0 )
1226  {
1227  DTTracoTrigData td = tct->data();
1228  // psi
1229  // float fpsi = atan( (float)(tct->K()) * _geom->cellPitch() /
1230  // (_geom->distSL() * config()->ST()) );
1231  float fpsi = atan(_card->localDirection(&td).x() / // e.g. x>0 and
1232  _card->localDirection(&td).z()); // z<0 => fpsi<0
1233 
1234  // Change sign in case of wheel<0 or wheel==0 and station == 1,4,5,8,9,12
1235  int mywh = tct->ChamberId().wheel();
1236  if (mywh < 0 || (mywh == 0 && (tct->ChamberId().sector() % 4) < 2))
1237  fpsi = -fpsi;
1238 
1239  fpsi *= DTConfigTraco::RESOLPSI;
1240  if (fpsi <= 0)
1241  fpsi -= 1.0;
1242  ipsi = (int)fpsi;
1243  // if outside range set to lower edge
1244  if (ipsi >= DTConfigTraco::RESOLPSI || ipsi < -DTConfigTraco::RESOLPSI)
1245  ipsi = -DTConfigTraco::RESOLPSI;
1246 
1247  // psi_r
1248  float fpsir = _card->CMSPosition(&td).phi() - _geom->phiCh();
1249 
1250  if (fpsir < -M_PI)
1251  fpsir += M_PI * 2;
1252  if (fpsir > M_PI)
1253  fpsir -= M_PI * 2;
1254  fpsir *= DTConfigTraco::RESOLPSIR;
1255  if (fpsir <= 0)
1256  fpsir -= 1.0;
1257  iphir = (int)fpsir;
1258  // if outside range set to lower edge
1259  if (iphir >= DTConfigTraco::RESOLPSIR / 2 || iphir < -DTConfigTraco::RESOLPSIR / 2)
1260  iphir = -DTConfigTraco::RESOLPSIR / 2;
1261 
1262  // Delta(psi_r)
1263  int dpsir = (iphir * DTConfigTraco::RESOLPSI) / DTConfigTraco::RESOLPSIR;
1264  idpsir = ipsi - dpsir;
1265  // if outside range set to lower edge
1266  if (idpsir >= DTConfigTraco::RESOLPSI || idpsir < -DTConfigTraco::RESOLPSI)
1267  idpsir = -DTConfigTraco::RESOLPSI;
1268  }
1269 
1270  tct->setAngles(ipsi, iphir, idpsir);
1271 
1272  // debugging
1273  if (config()->debug() == 4) {
1274  std::cout << "DTTracoChip::calculateAngles :" << std::endl;
1275  tct->print();
1276  std::cout << std::dec << "K = " << tct->K() << " X = " << tct->X();
1277  std::cout << " ipsi = " << ipsi << " iphir = " << iphir;
1278  std::cout << " idpsir = " << idpsir << std::endl;
1279  if (_card->lutFromDBFlag() == 1)
1280  std::cout << "Angles are calculated from LUT parameters from DB!" << std::endl;
1281  } // end debugging
1282 }
LocalVector localDirection(const DTTrigData *) const override
NEWGEO Local direction in chamber of a trigger-data object.
Definition: DTTracoCard.cc:403
Lut * _lutsCCB
Definition: DTTracoChip.h:220
T z() const
Definition: PV3DBase.h:61
DTTracoTrigData data() const
Return the data part.
Definition: DTTracoTrig.h:115
float phiCh() const
Rotation angle of chamber (deg)
Definition: DTTrigGeom.h:70
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
int qdec() const
Return the trigger code in new format.
bool lutFromDBFlag()
Return lut computation option (DB/geometry)
Definition: DTTracoCard.h:114
int K() const
Return trigger K parameter.
Definition: DTTracoTrig.h:154
T x() const
Definition: PV3DBase.h:59
DTChamberId ChamberId() const override
Return chamber identifier.
Definition: DTTracoTrig.h:106
int X() const
Return trigger X parameter.
Definition: DTTracoTrig.h:157
void setAngles(int psi, int psir, int dpsir)
Set trigger angles.
Definition: DTTracoTrig.h:91
#define M_PI
void print() const override
Print.
Definition: DTTracoTrig.h:109
#define debug
Definition: HDRShower.cc:19
static const int RESOLPSIR
Costant: resulution for psiR (phi)
Definition: DTConfigTraco.h:42
GlobalPoint CMSPosition(const DTTrigData *trig) const
CMS position in chamber of a trigger-data object.
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:42
int sector() const
Definition: DTChamberId.h:52
DTConfigTraco * config() const
Configuration set.
Definition: DTTracoChip.h:113
DTTracoCard * _card
Definition: DTTracoChip.h:188
int get_x(int addr) const
Definition: Lut.cc:121
static const int RESOLPSI
Costants: esolution for psi and DeltaPsiR (phi_B)
Definition: DTConfigTraco.h:40
DTTrigGeom * _geom
Definition: DTTracoChip.h:185
int get_k(int addr) const
Definition: Lut.cc:107

◆ clear()

void DTTracoChip::clear ( void  )

Clear.

Definition at line 225 of file DTTracoChip.cc.

References _bxlts, _flag, _innerCand, _outerCand, _tracotrig, DTConfig::NSTEPF, DTConfig::NSTEPL, LaserDQM_cfg::p1, and BitArray< N >::zero().

Referenced by ~DTTracoChip().

225  {
226  std::vector<DTTracoTrig *>::iterator p1;
227  for (int is = 0; is < DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF + 1; is++) {
228  for (p1 = _tracotrig[is].begin(); p1 < _tracotrig[is].end(); p1++) {
229  delete (*p1);
230  }
231  _tracotrig[is].clear();
232  _innerCand[is].clear();
233  _outerCand[is].clear();
234  _flag[is].zero();
235  }
236  _bxlts.zero();
237 }
void zero()
Definition: BitArray.h:210
static const int NSTEPF
Definition: DTConfig.h:35
std::vector< DTTracoCand > _outerCand[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:199
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
std::vector< DTTracoTrig * > _tracotrig[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:202
std::vector< DTTracoCand > _innerCand[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:198
BitArray< 32 > _flag[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:211
BitArray< DTConfigTraco::NSTEPL+2 > _bxlts
Definition: DTTracoChip.h:205

◆ CMSPosition()

GlobalPoint DTTracoChip::CMSPosition ( ) const
inline

Position in CMS frame.

Definition at line 150 of file DTTracoChip.h.

References _geom, _id, and DTTrigGeom::CMSPosition().

Referenced by DTTracoChip().

150 { return _geom->CMSPosition(_id); }
DTTracoId _id
Definition: DTTracoChip.h:186
GlobalPoint CMSPosition(const DTBtiId obj) const
CMS position of a BTI.
Definition: DTTrigGeom.h:177
DTTrigGeom * _geom
Definition: DTTracoChip.h:185

◆ config()

DTConfigTraco* DTTracoChip::config ( void  ) const
inline

Configuration set.

New Configuration set

Definition at line 113 of file DTTracoChip.h.

References _config.

Referenced by add_btiT(), addTrig(), bestCand(), calculateAngles(), DoAdjBtiLts(), DTTracoChip(), insideAngWindow(), run(), setFlag(), setPV(), setTracoAcceptances(), storeCorr(), and storeUncorr().

113 { return _config; }
DTConfigTraco * _config
Definition: DTTracoChip.h:190

◆ DD()

int DTTracoChip::DD ( ) const
inline

DD parameter.

Definition at line 129 of file DTTracoChip.h.

References _dd.

129 { return _dd; }

◆ DoAdjBtiLts()

void DTTracoChip::DoAdjBtiLts ( DTTracoCand candidate,
std::vector< DTTracoCand > &  tclist 
)
private

Do suppression of LTRIG on BTI close to selected HTRIG.

Definition at line 508 of file DTTracoChip.cc.

References funct::abs(), DTBtiTrigData::btiNumber(), DTTracoCand::BtiTrig(), DTBtiTrigData::code(), config(), gather_cfg::cout, debug, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by run().

508  {
509  // If requested, do suppression of LTRIG on BTI close to selected HTRIG in
510  // same traco
511  // if(!(config()->adjBtiLts()) && candidate->BtiTrig()->code()==8) {
512  // SV this is done always, not parametrized !!
513  if (candidate->BtiTrig()->code() == 8) {
514  std::vector<DTTracoCand>::iterator p;
515  for (p = tclist.begin(); p < tclist.end(); p++) {
516  if ((*p).BtiTrig()->code() < 8 && abs((*p).BtiTrig()->btiNumber() - candidate->BtiTrig()->btiNumber()) < 2) {
517  (*p).setUsed();
518  if (config()->debug() == 4) {
519  std::cout << "Candidate :";
520  (*p).print();
521  std::cout << "Suppressed because adiacent to H trig" << std::endl;
522  } // end debug
523  } // end if
524  } // end candidate loop
525  } // end if H
526 }
int btiNumber() const
Return parent BTI number.
Definition: DTBtiTrigData.h:96
const DTBtiTrigData * BtiTrig() const
Return associated BTI trigger.
Definition: DTTracoCand.h:68
int code() const
Return trigger code.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define debug
Definition: HDRShower.cc:19
DTConfigTraco * config() const
Configuration set.
Definition: DTTracoChip.h:113

◆ edgeBTI()

int DTTracoChip::edgeBTI ( int  step,
int  io,
int  lr 
) const

flags for HTRIG in edge BTI

Definition at line 1125 of file DTTracoChip.cc.

References _innerCand, _outerCand, gather_cfg::cout, relativeConstraints::empty, DTConfig::NBTITC, DTConfig::NSTEPF, DTConfig::NSTEPL, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by setFlag().

1125  {
1127  std::cout << "DTTracoChip::edgeBTI: step out of range: " << step;
1128  std::cout << " 0 returned!" << std::endl;
1129  return 0;
1130  }
1131  //
1132  // inner supl ==> io=1; outer supl ==> io=2 |21 | | 22|
1133  // right edge ==> rl=1; left edge ==> rl=2 |11 12|
1134  //
1135  std::vector<DTTracoCand>::const_iterator p;
1136  if (io == 1) {
1138  // SV 24/IX/03 fix: only HTRIG accepted
1140  p++) {
1141  if (lr == 1 && (*p).position() == 1 && (*p).BtiTrig()->code() == 8)
1142  return 1;
1143  if (lr == 2 && (*p).position() == DTConfigTraco::NBTITC && (*p).BtiTrig()->code() == 8)
1144  return 1;
1145  }
1146  }
1147  } else {
1150  p++) {
1151  // SV: is the following correct???FIX if using _card to set _flag
1152  // if(lr==1 && (*p).position()==DTConfigTraco::NBTITC+1)return 1; //or
1153  // pos=8?? if(lr==2 && (*p).position()==DTConfigTraco::NBTITC*4)return
1154  // 1;
1155  // //or pos=13?? SV 24/IX/03 fix
1156  if (lr == 1 && (*p).position() == DTConfigTraco::NBTITC * 3 + 1 && (*p).BtiTrig()->code() == 8)
1157  return 1;
1158  if (lr == 2 && (*p).position() == DTConfigTraco::NBTITC * 2 && (*p).BtiTrig()->code() == 8)
1159  return 1;
1160  }
1161  }
1162  }
1163  return 0;
1164 }
static const int NSTEPF
Definition: DTConfig.h:35
std::vector< DTTracoCand > _outerCand[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:199
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
std::vector< DTTracoCand > _innerCand[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:198
step
Definition: StallMonitor.cc:83
static const int NBTITC
Definition: DTConfig.h:37

◆ geom()

DTTrigGeom* DTTracoChip::geom ( ) const
inline

Return trigger geometry.

Definition at line 95 of file DTTracoChip.h.

References _geom.

Referenced by run().

95 { return _geom; }
DTTrigGeom * _geom
Definition: DTTracoChip.h:185

◆ IBTIOFF()

int DTTracoChip::IBTIOFF ( ) const
inline

IBTIOFF parameter.

Definition at line 126 of file DTTracoChip.h.

References _ibtioff.

Referenced by DTTracoCand::DTTracoCand().

126 { return _ibtioff; }

◆ id()

DTTracoId DTTracoChip::id ( void  ) const
inline

Return TRACO id.

Definition at line 98 of file DTTracoChip.h.

References _id.

Referenced by DTTracoTrig::DTTracoTrig().

98 { return _id; }
DTTracoId _id
Definition: DTTracoChip.h:186

◆ insideAngWindow()

int DTTracoChip::insideAngWindow ( DTTracoTrig tctrig) const
private

Check if a trigger is inside the angular acceptance window.

Definition at line 1284 of file DTTracoChip.cc.

References BitArray< N >::assign(), DTConfigTraco::BendingAngleCut(), config(), gather_cfg::cout, debug, DTTracoTrig::DeltaPsiR(), BitArray< N >::element(), BitArray< N >::read(), and BitArray< N >::twoComplement().

Referenced by storeCorr(), and storeUncorr().

1284  {
1285  // check angular window for every station type
1286  // return 1 for accept, 0 for reject
1287  // abs value of bending angle is 9 bits
1288 
1289  BitArray<10> bendAng;
1290  bendAng.assign(0, 10, tctrig->DeltaPsiR());
1291  // bendAng.print();
1292  if (bendAng.element(9)) // negativo!
1293  bendAng.twoComplement();
1294  int bendAngINT = bendAng.read(0, 9);
1295  // std::cout<<"abs bend angle int ="<< bendAngINT <<std::endl;
1296 
1297  if (config()->BendingAngleCut() != -1 && bendAngINT > 2 * (config()->BendingAngleCut())) {
1298  int absBendAng = tctrig->DeltaPsiR() & 0x1FF;
1299  if (config()->debug() == 4)
1300  std::cout << "Attention: abs(bendAng)=" << absBendAng << " > " << 2 * config()->BendingAngleCut()
1301  << "!! reject trigger" << std::endl;
1302  return 0;
1303  }
1304  return 1;
1305 }
int DeltaPsiR() const
Return DeltaPsiR.
Definition: DTTracoTrig.h:166
int BendingAngleCut() const
Bending angle cut for all stations and triggers : KPRGCOM.
BitArray< N > twoComplement() const
Definition: BitArray.h:507
#define debug
Definition: HDRShower.cc:19
void assign(const int p, const int n, const int val)
Definition: BitArray.h:233
DTConfigTraco * config() const
Configuration set.
Definition: DTTracoChip.h:113
unsigned read(const int p, const int n) const
Definition: BitArray.h:269
int element(const int pos) const
Definition: BitArray.h:206

◆ KRad()

int DTTracoChip::KRad ( ) const

K par of the radial angle of corr center referred to plane sl.

Definition at line 1103 of file DTTracoChip.cc.

Referenced by DTTracoCand::DTTracoCand(), DTTracoChip(), and DTTracoCand::print().

1103  {
1104  // K parameter of the radial angle of correlator center
1105  // float distp2 = (int)(2*_geom->cellH()*config()->ST()/_geom->cellPitch());
1106  // return -(int)(tan(psiRad(sl)/1000)*distp2); // sign is reverted!!!
1107  // return _krad;
1108 
1109  // SV V/03: for harware bug in traco....
1110  int KRad = 0;
1111  return KRad;
1112 }
int KRad() const
K par of the radial angle of corr center referred to plane sl.

◆ localPosition()

LocalPoint DTTracoChip::localPosition ( ) const
inline

Position in chamber frame.

Definition at line 147 of file DTTracoChip.h.

References _geom, _id, and DTTrigGeom::localPosition().

147 { return _geom->localPosition(_id); }
LocalPoint localPosition(const DTBtiId) const
Local position in chamber of a BTI.
Definition: DTTrigGeom.cc:508
DTTracoId _id
Definition: DTTracoChip.h:186
DTTrigGeom * _geom
Definition: DTTracoChip.h:185

◆ nTrig()

int DTTracoChip::nTrig ( int  step) const

Return the number of trigger candidates.

Definition at line 1043 of file DTTracoChip.cc.

References _tracotrig, gather_cfg::cout, DTConfig::NSTEPF, and DTConfig::NSTEPL.

Referenced by run(), and DTTracoCard::runTRACO().

1043  {
1045  std::cout << "DTTracoChip::nTrig: step out of range: " << step;
1046  std::cout << " 0 returned!" << std::endl;
1047  return 0;
1048  }
1049  return _tracotrig[step - DTConfigTraco::NSTEPF].size();
1050 }
static const int NSTEPF
Definition: DTConfig.h:35
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
std::vector< DTTracoTrig * > _tracotrig[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:202
step
Definition: StallMonitor.cc:83

◆ number()

int DTTracoChip::number ( ) const
inline

Return TRACO number.

Definition at line 89 of file DTTracoChip.h.

References _id, and DTTracoId::traco().

Referenced by add_btiT().

89 { return _id.traco(); }
DTTracoId _id
Definition: DTTracoChip.h:186
int traco() const
Returns the traco.
Definition: DTTracoId.h:62

◆ operator=()

DTTracoChip & DTTracoChip::operator= ( const DTTracoChip traco)

Assignment operator.

Definition at line 195 of file DTTracoChip.cc.

References _bxlts, _card, _flag, _geom, _id, _innerCand, _outerCand, _tracotrig, mps_fire::i, DTConfig::NBTITC, DTConfig::NSTEPF, DTConfig::NSTEPL, AlCaHLTBitMon_ParallelJobs::p, and LaserDQM_cfg::p1.

195  {
196  if (this != &traco) {
197  _geom = traco._geom;
198  _id = traco._id;
199  _card = traco._card;
200  int i = 0;
201  for (i = 0; i < DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF; i++) {
203  std::vector<DTTracoCand>::const_iterator p;
204  for (p = traco._innerCand[i].begin(); p < traco._innerCand[i].end(); p++) {
205  _innerCand[i].push_back(*p);
206  }
207  _outerCand[i].reserve(3 * DTConfigTraco::NBTITC);
208  for (p = traco._outerCand[i].begin(); p < traco._outerCand[i].end(); p++) {
209  _outerCand[i].push_back(*p);
210  }
211  _tracotrig[i].reserve(2);
212  std::vector<DTTracoTrig *>::const_iterator p1;
213  for (p1 = traco._tracotrig[i].begin(); p1 < traco._tracotrig[i].end(); p1++) {
214  _tracotrig[i].push_back(*p1);
215  }
216  }
217  _bxlts = traco._bxlts;
218  for (int is = 0; is < DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF + 1; is++) {
219  _flag[is] = traco._flag[is];
220  }
221  }
222  return *this;
223 }
DTTracoId _id
Definition: DTTracoChip.h:186
static const int NSTEPF
Definition: DTConfig.h:35
std::vector< DTTracoCand > _outerCand[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:199
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
std::vector< DTTracoTrig * > _tracotrig[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:202
std::vector< DTTracoCand > _innerCand[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:198
BitArray< 32 > _flag[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:211
DTTracoCard * _card
Definition: DTTracoChip.h:188
BitArray< DTConfigTraco::NSTEPL+2 > _bxlts
Definition: DTTracoChip.h:205
static const int NBTITC
Definition: DTConfig.h:37
DTTrigGeom * _geom
Definition: DTTracoChip.h:185

◆ ovlFlag()

int DTTracoChip::ovlFlag ( int  step)
inline

return overlap flag

Definition at line 156 of file DTTracoChip.h.

References _flag, BitArray< N >::element(), and DTConfig::NSTEPF.

156 { return _flag[step - DTConfigTraco::NSTEPF].element(1); }
static const int NSTEPF
Definition: DTConfig.h:35
BitArray< 32 > _flag[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:211
step
Definition: StallMonitor.cc:83
int element(const int pos) const
Definition: BitArray.h:206

◆ psiRad()

float DTTracoChip::psiRad ( int  sl = 0) const

Radial angle of correlator center in mrad referred to plane sl.

Definition at line 1082 of file DTTracoChip.cc.

Referenced by DTTracoChip().

1082  {
1083  /*
1084  // Radial angle of correlator center in mrad in CMS frame
1085  LocalPoint p = localPosition();
1086  float x = p.x();
1087  float y = p.y();
1088  float z = p.z();
1089  if (sl==1) {
1090  z -= 0.5 * _geom->distSL();
1091  } else if (sl==3) {
1092  z += 0.5 * _geom->distSL();
1093  }
1094  float fpsir = _geom->stat()->toGlobal(LocalPoint(x,y,z)).phi()-
1095  _geom->phiCh();
1096  if(fpsir<-M_PI)fpsir+=M_PI*2;
1097  if(fpsir>M_PI)fpsir-=M_PI*2;
1098  return fpsir*1000;
1099  */
1100  return 0.0;
1101 }

◆ raiseOverlap()

void DTTracoChip::raiseOverlap ( int  step)

raise overlap flag

Definition at line 401 of file DTTracoChip.cc.

References _flag, DTConfig::NSTEPF, and BitArray< N >::set().

Referenced by run().

401  {
402  _flag[step - DTConfigTraco::NSTEPF].set(1); // overlap flag raised
403  _flag[step - DTConfigTraco::NSTEPF - 1].set(2); // mark II rej.
404 }
static const int NSTEPF
Definition: DTConfig.h:35
BitArray< 32 > _flag[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:211
step
Definition: StallMonitor.cc:83
void set(const int i)
Definition: BitArray.h:224

◆ run()

void DTTracoChip::run ( )

Run TRACO algorithm.

Definition at line 239 of file DTTracoChip.cc.

References _flag, _id, _innerCand, _outerCand, _tracotrig, addTrig(), bestCand(), gpuPixelDoublets::cc, reco::ceil(), config(), gather_cfg::cout, debug, DTConfigTraco::debug(), TauDecayModes::dec, DoAdjBtiLts(), MillePedeFileConverter_cfg::e, BitArray< N >::element(), relativeConstraints::empty, geom(), SurfaceOrientation::inner, cuy::isFirst, L1DTConfigTraco_cff::LVALIDIFH, DTConfig::NBTITC, DTConfig::NSTEPF, DTConfig::NSTEPL, nTrig(), SurfaceOrientation::outer, DTTracoTrig::print(), raiseOverlap(), BitArray< N >::set(), setFlag(), setPV(), storeCorr(), storeUncorr(), DTTracoId::traco(), and trigger().

Referenced by DTTracoCard::runTRACO().

239  {
240  // Debugging...
241  if (config()->debug() > 1) {
242  std::cout << "DTTracoChip::run: Processing TRACO " << _id.traco() << std::endl;
243  }
244  // End debugging
245 
246  int maxtc = static_cast<int>(ceil(float(geom()->nCell(1)) / float(DTConfigTraco::NBTITC)));
247 
248  if (_id.traco() < 1 || _id.traco() > maxtc) {
249  if (config()->debug() == 4)
250  std::cout << "DTTracoChip::run: wrong TRACO number " << _id.traco() << std::endl;
251  return;
252  }
253 
254  // Loop on step
255  for (int is = DTConfigTraco::NSTEPF; is <= DTConfigTraco::NSTEPL; is++) {
256  if (config()->debug() > 1) {
257  std::cout << "\n STEP: " << is << std::endl;
258  std::cout << " ================" << std::endl;
259  }
260 
261  // skip if no cand. at this step
263  continue;
264 
265  // Debugging...
266  if (config()->debug() == 4) {
267  std::cout << " --> "
268  << _innerCand[is - DTConfigTraco::NSTEPF].size() + _outerCand[is - DTConfigTraco::NSTEPF].size();
269  std::cout << " candidates " << std::endl;
270  }
271  // End debugging
272 
273  // Multiple trigger detection between consecutive TRACO's
274  setFlag(is);
275 
276  // check if there is a H in bx for LVALIDIFH flag
277  if (config()->LVALIDIFH()) {
278  for (unsigned int e = 0; e < _innerCand[is - DTConfigTraco::NSTEPF].size(); e++) {
279  if (_innerCand[is - DTConfigTraco::NSTEPF][e].BtiTrig()->code() == 8) {
281  break;
282  }
283  }
284  for (unsigned int e = 0; e < _outerCand[is - DTConfigTraco::NSTEPF].size(); e++) {
285  if (_outerCand[is - DTConfigTraco::NSTEPF][e].BtiTrig()->code() == 8) {
287  break;
288  }
289  }
290  }
291 
292  // Loop over first/second tracks
293  // for(int itk=0; itk < DTConfigTraco::NMAXCAND; itk++){
294  // FIX this hardcoded 2!!
295  for (int itk = 0; itk < 2; itk++) {
296  // Get the best inner and outer segments
297  if (config()->debug() == 4)
298  std::cout << "Inner:" << std::endl;
300  if (config()->debug() == 4)
301  std::cout << "Outer:" << std::endl;
303 
304  // debug
305  if (config()->debug() > 1) {
306  if (inner || outer)
307  std::cout << "Best candidates for track " << itk + 1 << " are:" << std::endl;
308  if (inner) {
309  std::cout << "inner->";
310  inner->print();
311  }
312  if (outer) {
313  std::cout << "outer->";
314  outer->print();
315  }
316  }
317 
318  // Skip to next step if no suitable candidates found
319  if (inner == nullptr && outer == nullptr)
320  break;
321 
322  // suppression of LTRIG on BTI close to selected HTRIG
323  // SV 24/IX/03 : AND suppression of LTRIG close to H in adiacent Traco
324  // SV 31/III/03 : test : only if htprf is off--> NO, it's worse
325  // if( config()->prefHtrig(0) && config()->prefHtrig(1) ){
326  if (inner) {
328  }
329  if (outer) {
331  }
332  //}
333 
334  // set candidates unusable by further steps
335  if (inner)
336  inner->setUsed();
337  if (outer)
338  outer->setUsed();
339  // Create a new TRACO trigger with preview for TS
340  DTTracoTrig *tct = setPV(itk, inner, outer);
341 
342  // skip if no TRACO trigger has been created with this trigger
343  if (!tct)
344  break; // something nasty happened. Go to next step
345 
346  // try a correlation between segments
347  int stored = 0;
348  if (inner && outer) {
349  stored = storeCorr(tct, inner, outer, itk);
350  }
351 
352  if (!stored) {
353  // No suitable candidate found or no correlation possible
354  // Fill single trigger
355  stored = storeUncorr(tct, inner, outer, itk);
356  }
357 
358  // if trigger has been filled store it in TRACO, otherway delete it
359  if (stored) {
360  addTrig(is, tct);
361  } else {
362  delete tct;
363  // break;-> II track is computed even if no I track found...
364  }
365 
366  } // end loop on first/second track
367 
368  // Inhibit second track at previous bunch crossing
369  if (config()->debug() == 4)
370  std::cout << "Checking overlap I-II track..." << std::endl;
372  (_tracotrig[is - DTConfigTraco::NSTEPF])[0]->isFirst()) { // I track at bx
373  if (nTrig(is - 1) > 0) { // there is a track at bx-1
374  if (!(trigger(is - 1, 1)->isFirst()) || // trig 1 is II track
375  (nTrig(is - 1) == 2 && !(trigger(is - 1, 2)->isFirst()))) { // trig 2 is II track
376  raiseOverlap(is);
377  if (config()->debug() == 4) {
378  std::cout << "II track at step " << std::hex << is - 1 << std::dec << "marked rej." << std::endl;
379  std::cout << "I track overlap flag at step " << std::hex << is << std::dec << " setted" << std::endl;
380  }
381  }
382  }
383  }
384  // debug...
385  for (int isd = 0; isd <= DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF + 1; isd++)
386  if (config()->debug() == 4) {
387  std::cout << "overlap flag step = " << isd + DTConfigTraco::NSTEPF << " " << _flag[isd].element(1)
388  << std::endl;
389  }
390  // debugging...
391  if (config()->debug() > 0) {
392  if (nTrig(is) > 0) {
393  for (int cc = 1; cc <= nTrig(is); cc++) {
394  trigger(is, cc)->print();
395  }
396  }
397  } // end debugging
398  } // end loop on step
399 }
constexpr int32_t ceil(float num)
void setFlag(int step, int ext=0)
Set flags for multiple trigger detection between cons. TRACO&#39;s.
Definition: DTTracoChip.cc:406
void addTrig(int step, DTTracoTrig *)
Add a TRACO trigger.
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
DTTracoId _id
Definition: DTTracoChip.h:186
static const int NSTEPF
Definition: DTConfig.h:35
DTTrigGeom * geom() const
Return trigger geometry.
Definition: DTTracoChip.h:95
int nTrig(int step) const
Return the number of trigger candidates.
DTTracoCand * bestCand(int itk, std::vector< DTTracoCand > &tclist)
Get the best inner/outer candidate.
Definition: DTTracoChip.cc:447
void raiseOverlap(int step)
raise overlap flag
Definition: DTTracoChip.cc:401
int traco() const
Returns the traco.
Definition: DTTracoId.h:62
std::vector< DTTracoCand > _outerCand[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:199
int storeUncorr(DTTracoTrig *tctrig, DTTracoCand *inner, DTTracoCand *outer, int tkn)
Store uncorrelated trigger.
Definition: DTTracoChip.cc:768
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
std::vector< DTTracoTrig * > _tracotrig[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:202
isFirst
Definition: cuy.py:418
std::vector< DTTracoCand > _innerCand[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:198
void print() const override
Print.
Definition: DTTracoTrig.h:109
#define debug
Definition: HDRShower.cc:19
int debug() const
Debug flag.
Definition: DTConfigTraco.h:62
void DoAdjBtiLts(DTTracoCand *candidate, std::vector< DTTracoCand > &tclist)
Do suppression of LTRIG on BTI close to selected HTRIG.
Definition: DTTracoChip.cc:508
DTTracoTrig * trigger(int step, unsigned n) const
Return the requested trigger.
int storeCorr(DTTracoTrig *tctrig, DTTracoCand *inner, DTTracoCand *outer, int tkn)
Check correlation and store correlated trigger.
Definition: DTTracoChip.cc:624
DTConfigTraco * config() const
Configuration set.
Definition: DTTracoChip.h:113
BitArray< 32 > _flag[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:211
static const int NBTITC
Definition: DTConfig.h:37
void set(const int i)
Definition: BitArray.h:224
void setPV(int step, int ntrk, int code, int K)
Set the preview values for a TRACO trigger.
int element(const int pos) const
Definition: BitArray.h:206

◆ sector()

int DTTracoChip::sector ( void  ) const
inline

Return sector number.

Definition at line 107 of file DTTracoChip.h.

References _geom, and DTTrigGeom::sector().

Referenced by geometryXMLparser.DTAlignable::index().

107 { return _geom->sector(); }
int sector() const
Return sector number.
Definition: DTTrigGeom.h:65
DTTrigGeom * _geom
Definition: DTTracoChip.h:185

◆ setFlag()

void DTTracoChip::setFlag ( int  step,
int  ext = 0 
)

Set flags for multiple trigger detection between cons. TRACO's.

Definition at line 406 of file DTTracoChip.cc.

References _card, _flag, _id, config(), gather_cfg::cout, debug, edgeBTI(), BitArray< N >::element(), DTTracoCard::getTRACO(), mps_fire::i, DTConfig::NSTEPF, BitArray< N >::set(), and DTTracoId::traco().

Referenced by run().

406  {
407  if (ext == 0) {
408  // this is the original: flags from card
409  DTTracoChip *prevTraco = _card->getTRACO(_id.traco() - 1);
410  if (prevTraco != nullptr) {
411  if (prevTraco->edgeBTI(step, 1, 2))
412  _flag[step - DTConfigTraco::NSTEPF].set(3);
413  if (prevTraco->edgeBTI(step, 2, 2))
414  _flag[step - DTConfigTraco::NSTEPF].set(5);
415  }
416  DTTracoChip *nextTraco = _card->getTRACO(_id.traco() + 1);
417  if (nextTraco != nullptr) {
418  if (nextTraco->edgeBTI(step, 1, 1))
419  _flag[step - DTConfigTraco::NSTEPF].set(4);
420  if (nextTraco->edgeBTI(step, 2, 1))
421  _flag[step - DTConfigTraco::NSTEPF].set(6);
422  }
423  } else {
424  // SV III/03: flags from input EXT: only for testing purpose
425  for (int i = 0; i < 6; i++) {
426  int ibit = ext >> i;
427  if (ibit & 0x01) // bit i+1 -> flag 3,4,5,6 : IL,IR,OL,OR
428  _flag[step - DTConfigTraco::NSTEPF].set(i + 1 + 2);
429  }
430  }
431 
432  // debug:
433  if (config()->debug() == 4) {
434  std::cout << "Flags set for bx=" << step << std::endl;
443  std::cout << _flag[step - DTConfigTraco::NSTEPF].element(9) << " " << std::endl;
444  } // end debugging
445 }
DTTracoChip * getTRACO(int n) const
Returns the required DTTracoChip. Return 0 if it doesn&#39;t exist.
Definition: DTTracoCard.cc:286
DTTracoId _id
Definition: DTTracoChip.h:186
static const int NSTEPF
Definition: DTConfig.h:35
int edgeBTI(int step, int io, int lr) const
flags for HTRIG in edge BTI
int traco() const
Returns the traco.
Definition: DTTracoId.h:62
#define debug
Definition: HDRShower.cc:19
DTConfigTraco * config() const
Configuration set.
Definition: DTTracoChip.h:113
BitArray< 32 > _flag[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:211
DTTracoCard * _card
Definition: DTTracoChip.h:188
step
Definition: StallMonitor.cc:83
Definition: memstream.h:15
void set(const int i)
Definition: BitArray.h:224
int element(const int pos) const
Definition: BitArray.h:206

◆ setPV() [1/2]

void DTTracoChip::setPV ( int  step,
int  ntrk,
int  code,
int  K 
)

Set the preview values for a TRACO trigger.

Referenced by run().

◆ setPV() [2/2]

DTTracoTrig * DTTracoChip::setPV ( int  itk,
DTTracoCand inner,
DTTracoCand outer 
)
private

Set the preview for a trigger.

Definition at line 548 of file DTTracoChip.cc.

References DTBtiTrigData::btiSL(), DTTracoCand::BtiTrig(), DTBtiTrigData::code(), config(), gather_cfg::cout, debug, dqmdumpme::first, SurfaceOrientation::inner, DTTracoCand::K(), SurfaceOrientation::outer, DTTracoCand::position(), DTConfigTraco::prefInner(), DTTracoCand::print(), DTTracoTrig::setPV(), and DTTracoCand::step().

548  {
549  // debugging...
550  if (config()->debug() == 4) {
551  std::cout << "DTTracoChip::setPV called for candidates : " << std::endl;
552  if (inner)
553  inner->print();
554  if (outer)
555  outer->print();
556  std::cout << "--------------------------------------------------" << std::endl;
557  }
558  // end debugging
559 
560  // first or second track. This is tricky:
561  // itk=0 menas first track ==> first= true=1
562  // itk=1 menas second track ==> first=false=0
563  int first = (itk == 0) ? 1 : 0;
564 
565  // preview selector: the same as priority selector I !!
566  // select which of the inner/outer segments should be used
567 
568  DTTracoCand *candidate = nullptr;
569  if (inner != nullptr && outer != nullptr) {
570  // if(config()->prefHtrig(itk)){
571  // ---> BUG! selection is ALWAYS for H trigs
572  // ---> fixed by Sara Vanini 25/III/03
573  if (inner->BtiTrig()->code() == 8 && outer->BtiTrig()->code() < 8) {
574  candidate = inner;
575  } else if (inner->BtiTrig()->code() < 8 && outer->BtiTrig()->code() == 8) {
576  candidate = outer;
577  } else { // for same quality tracks, pref. to in/out selection
578  if (!config()->prefInner(itk)) {
579  candidate = inner;
580  } else {
581  candidate = outer;
582  }
583  }
584  // } //end if(config()->prefHtrig...
585  /*
586  else {
587  if(!config()->prefInner(itk)) {
588  candidate=inner;
589  } else {
590  candidate=outer;
591  }
592  }
593  */
594  } else if (inner == nullptr && outer != nullptr) {
595  candidate = outer;
596  } else if (inner != nullptr && outer == nullptr) {
597  candidate = inner;
598  } else {
599  return nullptr; // no candidates
600  }
601 
602  // create new trigger with this candidate
603  DTTracoTrig *tct = new DTTracoTrig(this, candidate->step());
604  // store preview for TS
605  int cod = candidate->BtiTrig()->code();
606  if (candidate->BtiTrig()->btiSL() == 1)
607  cod *= 10;
608  // k output is 5 bits!!! SV
609  int K = candidate->K();
610  if (K > 31)
611  K -= 32;
612  int ioflag = 0;
613  if (candidate->position() > 4)
614  ioflag = 1;
615  tct->setPV(first, cod, K, ioflag); // this is already BTI_K-KRAD
616 
617  if (config()->debug() == 4) {
618  std::cout << "Selected candidate stored for preview is: ";
619  candidate->print();
620  }
621  return tct;
622 }
const DTBtiTrigData * BtiTrig() const
Return associated BTI trigger.
Definition: DTTracoCand.h:68
int btiSL() const
Return parent BTI superlayer.
Definition: DTBtiTrigData.h:99
int prefInner(int i) const
Preference to inner on first/second tracks: F(S)SLMSK.
Definition: DTConfigTraco.h:98
int K() const
Return K-KRAD.
Definition: DTTracoCand.h:77
int position() const
Return position inside TRACO.
Definition: DTTracoCand.h:74
void print() const
Print candidate.
Definition: DTTracoCand.cc:120
int code() const
Return trigger code.
int step() const
Return Bunch crossing.
Definition: DTTracoCand.h:71
#define debug
Definition: HDRShower.cc:19
DTConfigTraco * config() const
Configuration set.
Definition: DTTracoChip.h:113
void setPV(int first, int code, int K, int io)
Set trigger preview parameters.
Definition: DTTracoTrig.h:61

◆ setTracoAcceptances()

void DTTracoChip::setTracoAcceptances ( )
private

Compute traco chip acceptances.

Definition at line 1307 of file DTTracoChip.cc.

References _geom, _PSIMAX, _PSIMIN, DTConfigTraco::BTIC(), DTTrigGeom::cellH(), DTTrigGeom::cellPitch(), config(), gather_cfg::cout, debug, DTTrigGeom::distSL(), h, mps_fire::i, createfilelist::int, DTConfig::NBTITC, and DTTrigGeom::phiSLOffset().

Referenced by DTTracoChip().

1307  {
1308  // Set K acceptances of DTTracoChip MT ports: Ktraco = Xinner - Xouter
1309  float h = _geom->cellH();
1310  float pitch = _geom->cellPitch();
1311  float distsl = _geom->distSL();
1312  float K0 = config()->BTIC();
1313  float shiftSL = _geom->phiSLOffset() / pitch * K0;
1314 
1315  // mt ports from orca geometry: this is always the case with new DTConfig
1316  // if(config_traco(tracoid)->trigSetupGeom() != 1){
1317  {
1318  // Master Plane
1319  int i = 0;
1320  for (i = 0; i < DTConfig::NBTITC; i++) {
1321  float Xin_min = (i + DTConfig::NBTITC) * K0 + shiftSL;
1322  float Xin_max = Xin_min + K0;
1323  float Xout_min = 0;
1324  float Xout_max = 3 * DTConfig::NBTITC * K0;
1325  _PSIMAX[i] = int(2. * h / distsl * (Xin_max - Xout_min) + K0 + 1.01);
1326  _PSIMIN[i] = int(2. * h / distsl * (Xin_min - Xout_max) + K0);
1327  }
1328 
1329  // Slave Plane
1330  for (i = 0; i < 3 * DTConfig::NBTITC; i++) {
1331  float Xin_min = (DTConfig::NBTITC)*K0 + shiftSL;
1332  float Xin_max = 2. * DTConfig::NBTITC * K0 + shiftSL;
1333  float Xout_min = i * K0;
1334  float Xout_max = Xout_min + K0;
1335  _PSIMAX[DTConfig::NBTITC + i] = int(2. * h / distsl * (Xin_max - Xout_min) + K0 + 1.01);
1336  _PSIMIN[DTConfig::NBTITC + i] = int(2. * h / distsl * (Xin_min - Xout_max) + K0);
1337  }
1338  }
1339 
1340  // debugging
1341  if (config()->debug() == 4) {
1342  // if(wheel()==2&&station()==3&&sector()==1){ // only 1 chamber
1343  std::cout << "Acceptance of mt ports for offset (cell unit) " << _geom->phiSLOffset() / pitch << std::endl;
1344  for (int i = 0; i < 4 * DTConfig::NBTITC; i++) {
1345  std::cout << "Port " << i + 1 << " : ";
1346  std::cout << _PSIMIN[i] << " --> " << _PSIMAX[i] << std::endl;
1347  }
1348  //}
1349  } // end debugging
1350 }
int _PSIMAX[4 *DTConfig::NBTITC]
Definition: DTTracoChip.h:215
int BTIC() const
BTIC traco parameter: must be equal to Btis ST parameter.
Definition: DTConfigTraco.h:68
float cellPitch() const
Width of a cell (cm) i.e. distance between ywo wires.
Definition: DTTrigGeom.h:76
float distSL() const
Distance between the phi view superlayers (cms)
Definition: DTTrigGeom.h:79
float cellH() const
Height of a cell (cm)
Definition: DTTrigGeom.h:73
#define debug
Definition: HDRShower.cc:19
float phiSLOffset()
Superlayer offset in chamber front-end frame, in cm.
Definition: DTTrigGeom.cc:64
DTConfigTraco * config() const
Configuration set.
Definition: DTTracoChip.h:113
int _PSIMIN[4 *DTConfig::NBTITC]
Definition: DTTracoChip.h:214
static const int NBTITC
Definition: DTConfig.h:37
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
DTTrigGeom * _geom
Definition: DTTracoChip.h:185

◆ station()

int DTTracoChip::station ( ) const
inline

Return station number.

Definition at line 104 of file DTTracoChip.h.

References _geom, and DTTrigGeom::station().

Referenced by geometryXMLparser.DTAlignable::index(), and geometryXMLparser.CSCAlignable::index().

104 { return _geom->station(); }
int station() const
Return station number.
Definition: DTTrigGeom.h:62
DTTrigGeom * _geom
Definition: DTTracoChip.h:185

◆ storeCorr()

int DTTracoChip::storeCorr ( DTTracoTrig tctrig,
DTTracoCand inner,
DTTracoCand outer,
int  tkn 
)
private

Check correlation and store correlated trigger.

Definition at line 624 of file DTTracoChip.cc.

References _bxlts, _geom, funct::abs(), DTTracoTrig::addDTBtiTrig(), BTIC(), calculateAngles(), DTTrigGeom::cellH(), DTTracoTrig::code(), config(), gather_cfg::cout, debug, DTConfigTraco::debug(), DTTrigGeom::distSL(), BitArray< N >::element(), SurfaceOrientation::inner, insideAngWindow(), createfilelist::int, DTTracoTrig::K(), SurfaceOrientation::outer, DTTracoTrig::qdec(), DTTracoTrig::resetVar(), DTTracoTrig::setCodeIn(), DTTracoTrig::setCodeOut(), DTTracoTrig::setEqIn(), DTTracoTrig::setEqOut(), DTTracoTrig::setK(), DTTracoTrig::setPosIn(), DTTracoTrig::setPosOut(), DTTracoTrig::setPVCorr(), DTTracoTrig::setX(), edm::shift, DTTracoTrig::step(), DTConfigTraco::TcBxLts(), DTConfigTraco::TcKToll(), and DTTracoTrig::X().

Referenced by run().

624  {
625  // Bunch crossing
626  int is = tctrig->step();
627 
628  // Debugging...
629  if (config()->debug() == 4) {
630  std::cout << "DTTracoChip::storeCorr called with candidates: " << std::endl;
631  if (inner)
632  inner->print();
633  if (outer)
634  outer->print();
635  std::cout << "--------------------------------------------------" << std::endl;
636  }
637  // End debugging
638 
639  // old orca shift definition
640  float shift = 0.;
641  // if( config()->trigSetupGeom()!=1 )
642  shift = (int)(_geom->distSL() / _geom->cellH() + 0.5);
643  // else
644  // shift = DD();
645 
646  int kcor = 9999;
647  int xcor = 0;
648  int icor = 0;
649 
650  // Check correlation only if --> this cuts LL follow by H in next 4 bx
651  // SV 1/IV/04 BUG FIX: this cuts LL preview also, traco outputs preview when
652  // LTS cut!!!
653  // if( !config()->TcBxLts() || // BX LTS is not enabled or
654  // !_bxlts.element(is) || // no HTRIG in next 4 BX or
655  // inner->BtiTrig()->code()==8 || // inner track is HTRIG or
656  // outer->BtiTrig()->code()==8 ){ // outer track is HTRIG
657  // otherwise in and out trig are L, and necessary one is suppressed for LTS
658 
659  int xq1 = inner->X();
660  int xq2 = outer->X();
661  xcor = (xq2 + xq1) / 2;
662  kcor = (xq1 - xq2) + 512;
663  int kq1 = int(shift / 2.) * (inner->BtiTrig()->K() - BTIC()) + 512;
664  int kq2 = int(shift / 2.) * (outer->BtiTrig()->K() - BTIC()) + 512;
665  // int kd1 = abs(kcor/16-kq1/16);
666  // int kd2 = abs(kcor/16-kq2/16);
667  int kd1 = abs(kcor / 16 - kq1 / 16);
668  int kd2 = abs(kcor / 16 - kq2 / 16);
669 
670  icor = kd1 <= config()->TcKToll(tkn) && kd2 <= config()->TcKToll(tkn) && xcor > 0;
671 
672  // Debugging...
673  if (config()->debug() == 4) {
674  std::cout << "*************************************************************";
675  std::cout << std::endl;
676  std::cout << " shift = " << shift;
677  std::cout << " xq1 = " << xq1;
678  std::cout << " xq2 = " << xq2;
679  std::cout << " xcor = " << xcor;
680  std::cout << " kcor = " << kcor;
681  std::cout << " kq1 = " << kq1;
682  std::cout << " kq2 = " << kq2;
683  std::cout << " kd1 = " << kd1;
684  std::cout << " kd2 = " << kd2;
685  std::cout << " icor = " << icor;
686  std::cout << std::endl;
687  std::cout << "*************************************************************";
688  std::cout << std::endl;
689  } // End debugging
690 
691  //}//end if TcBxLts....
692 
693  if (icor) {
694  // correlation was successfull
695  // set the preview correlation bit. It isn't reset if outside ang. window
696  tctrig->setPVCorr(1);
697  // set K and X
698  tctrig->setK(kcor - 512);
699  // std::cout<<"Set K " << kcor << " instead of " << kcor-512 << std::endl;
700  // tctrig->setK(kcor);
701  tctrig->setX(xcor);
702  // set codes
703  tctrig->setCodeIn(inner->BtiTrig()->code());
704  tctrig->setCodeOut(outer->BtiTrig()->code());
705  // set position mask
706  // tctrig->setPosIn(inner->position());
707  // tctrig->setPosOut(outer->position());
708  // SV number of bti instead of position...
709  tctrig->setPosIn(inner->BtiTrig()->btiNumber());
710  tctrig->setPosOut(outer->BtiTrig()->btiNumber());
711  // SV store also equation: pattern numbers are 1-32
712  tctrig->setEqIn(inner->BtiTrig()->eq() + 1);
713  tctrig->setEqOut(outer->BtiTrig()->eq() + 1);
714 
715  // calculate psi, psi_r and Delta(psi_r)
716  calculateAngles(tctrig);
717  // check angular window for LL --> fixed by SV 27/III/03 --> NO, for all!
718  // if( (tctrig->qdec()==4) && !insideAngWindow(tctrig)) {
719  if (!insideAngWindow(tctrig)) {
720  // reset codes, K, X and angles
721  tctrig->resetVar();
722  }
723  // SV 1/IV/04 BUG FIX: check LTS after angle cut...
724  else if (tctrig->qdec() == 4 && // cut only LL
725  config()->TcBxLts()) { // BX LTS is enabled or
726  // reset codes, K, X and angles
727  if (tkn == 0 && _bxlts.element(is)) // I track : there is H -4,+1
728  tctrig->resetVar();
729  if (tkn == 1 && _bxlts.element(is + 1)) // II track : there is H -4,+1 1 bx later
730  tctrig->resetVar();
731  } else {
732  // set links to BTI triggers
733  tctrig->addDTBtiTrig(inner->BtiTrig());
734  tctrig->addDTBtiTrig(outer->BtiTrig());
735  }
736 
737  // Debugging...
738  if (config()->debug() > 1) {
739  std::cout << "*************************************************************";
740  std::cout << std::endl;
741  std::cout << " Correlation was successfull: ";
742  std::cout << std::endl;
743  std::cout << " Code = " << tctrig->code();
744  std::cout << " K = " << tctrig->K();
745  std::cout << " X = " << tctrig->X();
746  std::cout << std::endl;
747  std::cout << "*************************************************************";
748  std::cout << std::endl;
749  }
750  // End debugging
751 
752  } else {
753  // Debugging...
754  if (config()->debug() > 1) {
755  std::cout << "*************************************************************";
756  std::cout << std::endl;
757  std::cout << " No correlation possible ";
758  std::cout << std::endl;
759  std::cout << "*************************************************************";
760  std::cout << std::endl;
761  }
762  // End debugging
763  }
764 
765  return icor;
766 }
void setPosIn(int pos)
Set position of segments, inner.
Definition: DTTracoTrig.h:73
void setX(int x)
Set trigger X parameter.
Definition: DTTracoTrig.h:88
void setK(int k)
Set trigger K parameter.
Definition: DTTracoTrig.h:85
void calculateAngles(DTTracoTrig *)
Calculate trigger angles.
int BTIC() const
BTIC parameter.
Definition: DTTracoChip.h:123
void resetVar()
Reset all variables but preview.
Definition: DTTracoTrig.h:94
void setCodeIn(int code)
Set trigger code, inner segment.
Definition: DTTracoTrig.h:67
int step() const
Return step.
Definition: DTTracoTrig.h:121
int K() const
Return trigger K parameter.
Definition: DTTracoTrig.h:154
void setPosOut(int pos)
Set position of segments, outer.
Definition: DTTracoTrig.h:76
int insideAngWindow(DTTracoTrig *) const
Check if a trigger is inside the angular acceptance window.
float distSL() const
Distance between the phi view superlayers (cms)
Definition: DTTrigGeom.h:79
int X() const
Return trigger X parameter.
Definition: DTTracoTrig.h:157
void setCodeOut(int code)
Set trigger code, outer segment.
Definition: DTTracoTrig.h:70
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void setEqOut(int eq)
Set bti trigger equation of segments, outer.
Definition: DTTracoTrig.h:82
void addDTBtiTrig(const DTBtiTrigData *btitrig)
Add a BTI trigger to the list.
Definition: DTTracoTrig.h:58
int TcKToll(int i) const
K tollerance for correlation in TRACO: F(S)PRGCOMP.
float cellH() const
Height of a cell (cm)
Definition: DTTrigGeom.h:73
#define debug
Definition: HDRShower.cc:19
int debug() const
Debug flag.
Definition: DTConfigTraco.h:62
int qdec() const
Return the trigger code in new format.
Definition: DTTracoTrig.h:169
void setPVCorr(int ic)
Set trigger preview correlation bit.
Definition: DTTracoTrig.h:64
DTConfigTraco * config() const
Configuration set.
Definition: DTTracoChip.h:113
void setEqIn(int eq)
Set bti trigger equation of segments, inner.
Definition: DTTracoTrig.h:79
static unsigned int const shift
int code() const
Return trigger code.
Definition: DTTracoTrig.h:124
BitArray< DTConfigTraco::NSTEPL+2 > _bxlts
Definition: DTTracoChip.h:205
int TcBxLts() const
Suppr. of LTRIG in 4 BX before HTRIG: LTS.
DTTrigGeom * _geom
Definition: DTTracoChip.h:185
int element(const int pos) const
Definition: BitArray.h:206

◆ storeUncorr()

int DTTracoChip::storeUncorr ( DTTracoTrig tctrig,
DTTracoCand inner,
DTTracoCand outer,
int  tkn 
)
private

Store uncorrelated trigger.

Definition at line 768 of file DTTracoChip.cc.

References _bxlts, _card, _flag, _geom, DTTracoTrig::addDTBtiTrig(), BTIC(), DTBtiTrigData::btiNumber(), DTBtiTrigData::btiSL(), DTTracoCand::BtiTrig(), calculateAngles(), DTTrigGeom::cellH(), DTBtiTrigData::code(), DTTracoTrig::code(), config(), gather_cfg::cout, debug, DTConfigTraco::debug(), DTTrigGeom::distSL(), BitArray< N >::element(), DTBtiTrigData::eq(), SurfaceOrientation::inner, insideAngWindow(), createfilelist::int, DTBtiTrigData::K(), DTTracoTrig::K(), DTConfigTraco::LVALIDIFH(), DTTSTheta::nHTrig(), DTConfig::NSTEPF, DTTSTheta::nTrig(), SurfaceOrientation::outer, DTConfigTraco::prefInner(), DTTracoTrig::resetVar(), DTTracoTrig::setCodeIn(), DTTracoTrig::setCodeOut(), DTTracoTrig::setEqIn(), DTTracoTrig::setEqOut(), DTTracoTrig::setK(), DTTracoTrig::setPosIn(), DTTracoTrig::setPosOut(), DTTracoTrig::setPVCorr(), DTTracoTrig::setX(), edm::shift, DTConfigTraco::singleLenab(), DTConfigTraco::singleLflag(), DTTracoTrig::step(), DTConfigTraco::TcReuse(), DTTracoCard::TSTh(), DTTracoCand::X(), and DTTracoTrig::X().

Referenced by run().

768  {
769  // Bunch crossing
770  int is = tctrig->step();
771 
772  // Debugging...
773  if (config()->debug() == 4) {
774  std::cout << "DTTracoChip::storeUncorr called with candidates: " << std::endl;
775  if (inner)
776  inner->print();
777  if (outer)
778  outer->print();
779  std::cout << "--------------------------------------------------" << std::endl;
780  }
781 
782  // End debugging
783  // priority selector
784  // select which of the inner/outer segments should be used
785  // allow re-use of other segment according to configuration
786  DTTracoCand *candidate = nullptr;
787  if (inner != nullptr && outer != nullptr) {
788  // if(config()->prefHtrig(tkn)){
789  // --> BUG: selector I preference is ALWAYS for H trig
790  // fixed by Sara Vanini - 25/III/03
791  if (inner->BtiTrig()->code() == 8 && outer->BtiTrig()->code() < 8) {
792  candidate = inner;
793  // if(config()->TcReuse(1)) outer->setUnused(); // reusable
794  } else if (inner->BtiTrig()->code() < 8 && outer->BtiTrig()->code() == 8) {
795  candidate = outer;
796  // if(config()->TcReuse(0)) inner->setUnused(); // reusable
797  } else { // for the same quality triggers:
798  if (!config()->prefInner(tkn)) {
799  candidate = inner;
800  // if(config()->TcReuse(1)) outer->setUnused(); // reusable
801  } else {
802  candidate = outer;
803  // if(config()->TcReuse(0)) inner->setUnused(); // reusable
804  }
805  } // end else
806  /*
807  } else {//no Htrig preference
808  if(!config()->prefInner(tkn)) {
809  candidate=inner;
810  if(config()->TcReuse(1)) outer->setUnused(); // reusable
811  } else {
812  candidate=outer;
813  if(config()->TcReuse(0)) inner->setUnused(); // reusable
814  }
815  }
816  */
817  } else if (inner == nullptr && outer != nullptr) {
818  candidate = outer;
819  } else if (inner != nullptr && outer == nullptr) {
820  candidate = inner;
821  } else {
822  return 0; // no candidates
823  }
824 
825  // SV *** FOR TESTBEAM OR TEST BENCH PURPOSE ***
826  // theta trigger bin present(1) or absent(0)
827  // int thTr = (_flag[is-DTConfigTraco::NSTEPF].element(7)) ?
828  // _flag[is-DTConfigTraco::NSTEPF].element(7):
829  // _flag[is-DTConfigTraco::NSTEPF].element(8);
830 
831  // priority selector II: accept or discard candidate according to masks:
832  // ** LOW TRIGGERS
833  if (candidate->BtiTrig()->code() < 8) {
834  // first check with LVALIDIFH: if 1, accept low if there is a H in traco at
835  // bx
836  if (config()->LVALIDIFH() && _flag[is - DTConfigTraco::NSTEPF].element(9)) {
837  if (config()->debug() > 1)
838  std::cout << "Low accepted because LVALIDIFH on...." << std::endl;
839  } else { // LVALIDIFH==0 or there isn't H in traco in bx : check theta!
840  // theta check
841  if (!config()->singleLenab(tkn)) {
842  // LTF: single LTRIG not always en. Check cond.:
843  if (config()->singleLflag(tkn) == 1 || // always discarded
844  (config()->singleLflag(tkn) == 2 && !(_card->TSTh()->nHTrig(is))) ||
845  (config()->singleLflag(tkn) == 0 && !(_card->TSTh()->nTrig(is)))) {
846  // SV --> for TESTS version
847  // config()->singleLflag(tkn)==0 && thTr==0 || //only with
848  // theta trig. config()->singleLflag(tkn)==2 && thTr==0 ){
849  // //only with theta H trig (not hw)
850  if (config()->debug() > 1)
851  std::cout << "Single low trigger discarded by preview and "
852  << "priority selector for ltmsk!" << std::endl;
853  return 0;
854  }
855  // ^-------- trigger is suppressed and will not be stored
856  } // end theta
857 
858  } // end else
859  // REUSE : mark candidates reusable HERE! SV BUG FIX 6IV04
860  if (candidate == inner && config()->TcReuse(1) && outer)
861  outer->setUnused();
862  if (candidate == outer && config()->TcReuse(0) && inner)
863  inner->setUnused();
864 
865  // LTS suppression
866  if (config()->TcBxLts()) {
867  if ((tkn == 0 && _bxlts.element(is)) // I track : there is H -4,+1
868  || (tkn == 1 && _bxlts.element(is + 1))) { // II track : there is H -4,+1 1 bx later
869  tctrig->resetVar();
870  if (config()->debug() > 1)
871  std::cout << "Low trigger suppressed because H in next 4 bx "
872  << " and LTS flag on...." << std::endl;
873  return 1; // trigger is suppressed but preview will be stored
874  }
875  } // end lts
876 
877  // } //end else
878  } // Low trigs
879 
880  // Preview Htmsk not implemented: awaiting decision
881  // --> implemented in priority selector by SV
882  else { // HTRIG
883  // if(config()->singleHflag(tkn)==1 && thTr==0 ) //this is for testing
884  if (config()->singleHflag(tkn) == 1 && !(_card->TSTh()->nTrig(is)))
885  return 0;
886  // ^-----trigger is suppressed and will not be stored
887 
888  // mark candidates reusable HERE! SV BUG FIX 6IV04
889  if (candidate == inner && config()->TcReuse(1) && outer)
890  outer->setUnused();
891  if (candidate == outer && config()->TcReuse(0) && inner)
892  inner->setUnused();
893  }
894 
895  // set code, position, K and X
896  float shift;
897  // if(config()->trigSetupGeom()!=1 )
898  shift = (int)(_geom->distSL() / _geom->cellH() + 0.5);
899  // else
900  // shift = DD(); //SV 19/III/03
901  int kucor = (int)(0.5 * shift * (candidate->BtiTrig()->K() - BTIC()));
902  tctrig->setK(kucor);
903  tctrig->setX(candidate->X());
904  // correlation wasn't successfull
905  // set the preview correlation bit.
906  tctrig->setPVCorr(0);
907  if (candidate->BtiTrig()->btiSL() == 1) { // inner track
908  tctrig->setCodeIn(candidate->BtiTrig()->code());
909  tctrig->setCodeOut(0);
910  // tctrig->setPosIn(candidate->position());
911  // SV number of bti instead of position...
912  tctrig->setPosIn(candidate->BtiTrig()->btiNumber());
913  tctrig->setPosOut(0);
914  // SV store also equation
915  tctrig->setEqIn(candidate->BtiTrig()->eq() + 1);
916  tctrig->setEqOut(0);
917  } else { // outer track
918  tctrig->setCodeIn(0);
919  tctrig->setCodeOut(candidate->BtiTrig()->code());
920  tctrig->setPosIn(0);
921  // SV number of bti instead of position...
922  tctrig->setPosOut(candidate->BtiTrig()->btiNumber());
923  // tctrig->setPosOut(candidate->position());
924  // SV store also equation
925  tctrig->setEqIn(0);
926  tctrig->setEqOut(candidate->BtiTrig()->eq() + 1);
927  }
928 
929  // coordinate converter LUT
930  // calculate psi, psi_r and Delta(psi_r)
931  calculateAngles(tctrig);
932  // check angular window only for Low!! --> fixed SV 27/III/03--> NO, for all!
933  // if( candidate->BtiTrig()->code() < 8 && !insideAngWindow(tctrig) ){
934  if (!insideAngWindow(tctrig)) {
935  // reset codes, K, X and angles
936  tctrig->resetVar();
937  if (config()->debug() > 1)
938  std::cout << "L rejected because outside angular window!" << std::endl;
939  } else {
940  // set links to BTI trigger
941  tctrig->addDTBtiTrig(candidate->BtiTrig());
942  }
943 
944  // Debugging...
945  if (config()->debug() > 1) {
946  std::cout << "*************************************************************";
947  std::cout << std::endl;
948  std::cout << " Single trigger stored: ";
949  std::cout << std::endl;
950  std::cout << " Code = " << tctrig->code();
951  std::cout << " K = " << tctrig->K();
952  std::cout << " X = " << tctrig->X();
953  std::cout << std::endl;
954  std::cout << "*************************************************************";
955  std::cout << std::endl;
956  }
957  // End debugging
958 
959  return 1;
960 }
void setPosIn(int pos)
Set position of segments, inner.
Definition: DTTracoTrig.h:73
int btiNumber() const
Return parent BTI number.
Definition: DTBtiTrigData.h:96
const DTBtiTrigData * BtiTrig() const
Return associated BTI trigger.
Definition: DTTracoCand.h:68
int btiSL() const
Return parent BTI superlayer.
Definition: DTBtiTrigData.h:99
int singleLflag(int i) const
Single LTRIG enabling on first/second tracks: F(S)LTMSK.
Definition: DTConfigTraco.h:90
int nHTrig(int step)
Return number of DTBtiChip fired with a HTRIG (used by DTTracoChip)
Definition: DTTSTheta.cc:229
int K() const
Return trigger K parameter.
void setX(int x)
Set trigger X parameter.
Definition: DTTracoTrig.h:88
void setK(int k)
Set trigger K parameter.
Definition: DTTracoTrig.h:85
void calculateAngles(DTTracoTrig *)
Calculate trigger angles.
int BTIC() const
BTIC parameter.
Definition: DTTracoChip.h:123
void resetVar()
Reset all variables but preview.
Definition: DTTracoTrig.h:94
int prefInner(int i) const
Preference to inner on first/second tracks: F(S)SLMSK.
Definition: DTConfigTraco.h:98
static const int NSTEPF
Definition: DTConfig.h:35
void setCodeIn(int code)
Set trigger code, inner segment.
Definition: DTTracoTrig.h:67
int step() const
Return step.
Definition: DTTracoTrig.h:121
int K() const
Return trigger K parameter.
Definition: DTTracoTrig.h:154
int singleLenab(int i) const
Single LTRIG accept enabling on first/second tracks LTF.
void setPosOut(int pos)
Set position of segments, outer.
Definition: DTTracoTrig.h:76
int insideAngWindow(DTTracoTrig *) const
Check if a trigger is inside the angular acceptance window.
int code() const
Return trigger code.
float distSL() const
Distance between the phi view superlayers (cms)
Definition: DTTrigGeom.h:79
int X() const
Return trigger X parameter.
Definition: DTTracoTrig.h:157
void setCodeOut(int code)
Set trigger code, outer segment.
Definition: DTTracoTrig.h:70
void setEqOut(int eq)
Set bti trigger equation of segments, outer.
Definition: DTTracoTrig.h:82
void addDTBtiTrig(const DTBtiTrigData *btitrig)
Add a BTI trigger to the list.
Definition: DTTracoTrig.h:58
float cellH() const
Height of a cell (cm)
Definition: DTTrigGeom.h:73
#define debug
Definition: HDRShower.cc:19
int debug() const
Debug flag.
Definition: DTConfigTraco.h:62
int TcReuse(int i) const
Recycling of TRACO cand. in inner/outer SL : REUSEI/REUSEO.
Definition: DTConfigTraco.h:74
void setPVCorr(int ic)
Set trigger preview correlation bit.
Definition: DTTracoTrig.h:64
DTConfigTraco * config() const
Configuration set.
Definition: DTTracoChip.h:113
void setEqIn(int eq)
Set bti trigger equation of segments, inner.
Definition: DTTracoTrig.h:79
BitArray< 32 > _flag[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:211
static unsigned int const shift
int X() const
Return local X coordinate.
Definition: DTTracoCand.h:80
DTTracoCard * _card
Definition: DTTracoChip.h:188
int code() const
Return trigger code.
Definition: DTTracoTrig.h:124
DTTSTheta * TSTh() const
Return TSTheta.
Definition: DTTracoCard.h:77
BitArray< DTConfigTraco::NSTEPL+2 > _bxlts
Definition: DTTracoChip.h:205
int LVALIDIFH() const
Flag for Low validation parameter.
DTTrigGeom * _geom
Definition: DTTracoChip.h:185
int eq() const
Return triggering equation.
int element(const int pos) const
Definition: BitArray.h:206
int nTrig(int step)
Return number of DTBtiChip fired (used by DTTracoChip)
Definition: DTTSTheta.cc:218

◆ trigger()

DTTracoTrig * DTTracoChip::trigger ( int  step,
unsigned  n 
) const

Return the requested trigger.

Definition at line 1052 of file DTTracoChip.cc.

References _tracotrig, gather_cfg::cout, dqmiodumpmetadata::n, DTConfig::NSTEPF, DTConfig::NSTEPL, AlCaHLTBitMon_ParallelJobs::p, and findQualityFiles::size.

Referenced by run().

1052  {
1054  std::cout << "DTTracoChip::trigger: step out of range: " << step;
1055  std::cout << " empty pointer returned!" << std::endl;
1056  return nullptr;
1057  }
1058  if (n < 1 || n > _tracotrig[step - DTConfigTraco::NSTEPF].size()) {
1059  std::cout << "DTTracoChip::trigger: requested trigger doesn't exist: " << n;
1060  std::cout << " empty pointer returned!" << std::endl;
1061  return nullptr;
1062  }
1063  std::vector<DTTracoTrig *>::const_iterator p = _tracotrig[step - DTConfigTraco::NSTEPF].begin() + n - 1;
1064  return *p;
1065 }
size
Write out results.
static const int NSTEPF
Definition: DTConfig.h:35
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
std::vector< DTTracoTrig * > _tracotrig[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:202
step
Definition: StallMonitor.cc:83

◆ triggerData()

DTTracoTrigData DTTracoChip::triggerData ( int  step,
unsigned  n 
) const

Return the data part of the requested trigger.

Definition at line 1067 of file DTTracoChip.cc.

References _tracotrig, gather_cfg::cout, dqmiodumpmetadata::n, DTConfig::NSTEPF, DTConfig::NSTEPL, AlCaHLTBitMon_ParallelJobs::p, and findQualityFiles::size.

Referenced by DTTracoCard::runTRACO().

1067  {
1069  std::cout << "DTTracoChip::triggerData: step out of range: " << step;
1070  std::cout << " dummy trigger returned!" << std::endl;
1071  return DTTracoTrigData();
1072  }
1073  if (n < 1 || n > _tracotrig[step - DTConfigTraco::NSTEPF].size()) {
1074  std::cout << "DTTracoChip::trigger: requested trigger doesn't exist: " << n;
1075  std::cout << " dummy trigger returned!" << std::endl;
1076  return DTTracoTrigData();
1077  }
1078  std::vector<DTTracoTrig *>::const_iterator p = _tracotrig[step - DTConfigTraco::NSTEPF].begin() + n - 1;
1079  return (*p)->data();
1080 }
size
Write out results.
static const int NSTEPF
Definition: DTConfig.h:35
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
std::vector< DTTracoTrig * > _tracotrig[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:202
step
Definition: StallMonitor.cc:83

◆ useSecondTrack()

int DTTracoChip::useSecondTrack ( int  step) const

a flag for a usable second track

Definition at line 1114 of file DTTracoChip.cc.

References _flag, gather_cfg::cout, BitArray< N >::element(), DTConfig::NSTEPF, and DTConfig::NSTEPL.

Referenced by DTTracoCard::runTRACO().

1114  {
1115  // return 1 if II track use is allow
1116  // return 0 if II track has been rejected
1118  std::cout << "DTTracoChip::useSecondTrack: step out of range: " << step;
1119  std::cout << " 0 returned!" << std::endl;
1120  return 0;
1121  }
1122  return !(_flag[step - DTConfigTraco::NSTEPF].element(2));
1123 }
static const int NSTEPF
Definition: DTConfig.h:35
static const int NSTEPL
Constants: first and last step to start trigger finding.
Definition: DTConfig.h:35
BitArray< 32 > _flag[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
Definition: DTTracoChip.h:211
step
Definition: StallMonitor.cc:83
int element(const int pos) const
Definition: BitArray.h:206

◆ wheel()

int DTTracoChip::wheel ( ) const
inline

Return wheel number.

Definition at line 101 of file DTTracoChip.h.

References _geom, and DTTrigGeom::wheel().

Referenced by geometryXMLparser.DTAlignable::index().

101 { return _geom->wheel(); }
int wheel() const
Return wheel number.
Definition: DTTrigGeom.h:59
DTTrigGeom * _geom
Definition: DTTracoChip.h:185

Member Data Documentation

◆ _btic

int DTTracoChip::_btic
private

Definition at line 193 of file DTTracoChip.h.

Referenced by BTIC(), and DTTracoChip().

◆ _bxlts

BitArray<DTConfigTraco::NSTEPL + 2> DTTracoChip::_bxlts
private

Definition at line 205 of file DTTracoChip.h.

Referenced by add_btiT(), clear(), DTTracoChip(), operator=(), storeCorr(), and storeUncorr().

◆ _card

DTTracoCard* DTTracoChip::_card
private

◆ _config

DTConfigTraco* DTTracoChip::_config
private

Definition at line 190 of file DTTracoChip.h.

Referenced by config().

◆ _dd

int DTTracoChip::_dd
private

Definition at line 195 of file DTTracoChip.h.

Referenced by DD().

◆ _flag

BitArray<32> DTTracoChip::_flag[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
private

◆ _geom

DTTrigGeom* DTTracoChip::_geom
private

◆ _ibtioff

int DTTracoChip::_ibtioff
private

Definition at line 194 of file DTTracoChip.h.

Referenced by DTTracoChip(), and IBTIOFF().

◆ _id

DTTracoId DTTracoChip::_id
private

◆ _innerCand

std::vector<DTTracoCand> DTTracoChip::_innerCand[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
private

Definition at line 198 of file DTTracoChip.h.

Referenced by add_btiT(), clear(), DTTracoChip(), edgeBTI(), operator=(), and run().

◆ _krad

int DTTracoChip::_krad
private

Definition at line 192 of file DTTracoChip.h.

Referenced by DTTracoChip().

◆ _luts

DTTracoLUTs* DTTracoChip::_luts
private

Definition at line 218 of file DTTracoChip.h.

Referenced by DTTracoChip().

◆ _lutsCCB

Lut* DTTracoChip::_lutsCCB
private

Definition at line 220 of file DTTracoChip.h.

Referenced by calculateAngles(), DTTracoChip(), and ~DTTracoChip().

◆ _outerCand

std::vector<DTTracoCand> DTTracoChip::_outerCand[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
private

Definition at line 199 of file DTTracoChip.h.

Referenced by add_btiT(), clear(), DTTracoChip(), edgeBTI(), operator=(), and run().

◆ _PSIMAX

int DTTracoChip::_PSIMAX[4 *DTConfig::NBTITC]
private

Definition at line 215 of file DTTracoChip.h.

Referenced by add_btiT(), and setTracoAcceptances().

◆ _PSIMIN

int DTTracoChip::_PSIMIN[4 *DTConfig::NBTITC]
private

Definition at line 214 of file DTTracoChip.h.

Referenced by add_btiT(), and setTracoAcceptances().

◆ _tracotrig

std::vector<DTTracoTrig *> DTTracoChip::_tracotrig[DTConfigTraco::NSTEPL - DTConfigTraco::NSTEPF+1]
private

Definition at line 202 of file DTTracoChip.h.

Referenced by addTrig(), clear(), DTTracoChip(), nTrig(), operator=(), run(), trigger(), and triggerData().