CMS 3D CMS Logo

DTSectCollPhCand.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: DTSectCollPhCand.cpp
4 //
5 // Description: A Sector Collector Phi Candidate
6 //
7 //
8 // Author List:
9 // S.Marcellini D.Bonacorsi
10 // Modifications:
11 // 11/06 C. Battilana: Class moved from Cand to PhCand
12 //
13 //
14 //--------------------------------------------------
15 
16 //-----------------------
17 // This Class's Header --
18 //-----------------------
20 
21 //---------------
22 // C++ Headers --
23 //---------------
24 #include <iostream>
25 
26 //----------------
27 // Constructors --
28 //---------------- // SM double TSM
29 DTSectCollPhCand::DTSectCollPhCand(DTSC* tsc, const DTChambPhSegm* tsmsegm, int ifs) : _tsc(tsc), _tsmsegm(tsmsegm) {
30  _dataword.one(); // reset dataword to 0x1ff
31  if (ifs == 1)
32  _dataword.unset(14); // set bit 14 (0=first, 1=second tracks)
33 }
34 
36 
37 //--------------
38 // Destructor --
39 //--------------
41 
42 //--------------
43 // Operations --
44 //--------------
45 
47  if (this != &tsccand) {
48  _tsc = tsccand._tsc;
49  _tsmsegm = tsccand._tsmsegm;
50  }
51  return *this;
52 }
53 
55  _tsmsegm = nullptr;
56  _dataword.one();
57  // std::cout << " clear dataword : " << _dataword.print() << std::endl;
58 }
59 
61  int sect = _tsmsegm->ChamberId().sector();
62  if (sect < 13)
63  return config()->CoarseSync(_tsmsegm->ChamberId().station());
64  else
65  return config()->CoarseSync(5);
66 }
67 
68 // SM double TSM: remove datawordbk and replace it with dataword
71 
72  if (abs(_tsmsegm->DeltaPsiR()) > 1024) { // Check phiB within 10 bits range
73  std::cout << "DTSectCollPhCand::setBitsSectColl phiB outside valid range: " << _tsmsegm->DeltaPsiR();
74  std::cout << " deltaPsiR set to 512" << std::endl;
75  } else {
76  // SM double TSM
77  // assign preview in dataword (common to any other assignment)
79  //
80  int a2 = 12;
81  int a1 = 11;
82  int a0 = 10;
83 
84  if (_tsmsegm->code() == 6) {
86  _dataword.unset(a1);
88  } // 1-000
89  if (_tsmsegm->code() == 5) {
91  _dataword.unset(a1);
92  } // 1-001
93  if (_tsmsegm->code() == 4) {
96  } // 1-010
97  if (_tsmsegm->code() == 3) {
98  _dataword.unset(a1);
99  } // 1-101
100  if (_tsmsegm->code() == 2) {
101  _dataword.unset(a1);
102  _dataword.unset(a0);
103  } // 1-100
104  // if( _tsmsegm->code()==1 ) no unset needed => 111
105  if (_tsmsegm->code() == 0) {
106  _dataword.unset(a0);
107  } // 1-110
108  }
109 }
110 
112  std::cout << "Sector Collector Phi Candidate: " << std::endl;
113  if (_dataword.element(14) == 0) {
114  std::cout << "First track type" << std::endl;
115  } else {
116  std::cout << "Second track type" << std::endl;
117  }
118  std::cout << " code=" << _tsmsegm->pvCode();
119  std::cout << " dataword=";
120  _dataword.print();
121  // SM double TSM remove datawordbk section
122  std::cout << " SC step=" << CoarseSync() + _tsmsegm->step();
123  std::cout << std::endl;
124 }
DTChambPhSegm::pvCode
int pvCode() const
Return the preview code (10*inner_code or outer_code; X_code=1,2,3,4,8)
Definition: DTChambPhSegm.h:118
DTSectCollPhCand::operator=
DTSectCollPhCand & operator=(const DTSectCollPhCand &tsccand)
Assignment operator.
Definition: DTSectCollPhCand.cc:46
DTConfigSectColl::CoarseSync
int CoarseSync(int istat) const
Return coarsesync parameter in Sector Collector for station istat (5 is second MB4 station)
Definition: DTConfigSectColl.h:67
DTChambPhSegm::code
int code() const
Return trigger code (MTTF input format [0,7])
Definition: DTChambPhSegm.h:88
DTSectCollPhCand::clear
void clear()
Set the SC Candidate step.
Definition: DTSectCollPhCand.cc:54
DTSectCollPhCand::_tsmsegm
const DTChambPhSegm * _tsmsegm
Definition: DTSectCollPhCand.h:105
DTSectCollPhCand::setBitsSectColl
void setBitsSectColl()
Set the bits for DTTSM analysis.
Definition: DTSectCollPhCand.cc:69
DTSectCollPhCand
Definition: DTSectCollPhCand.h:32
BitArray::assign
void assign(const int p, const int n, const int val)
Definition: BitArray.h:233
DTSectCollPhCand::CoarseSync
int CoarseSync() const
Return the Coarse Sync Parameter.
Definition: DTSectCollPhCand.cc:60
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DTSectCollPhCand::~DTSectCollPhCand
~DTSectCollPhCand()
Destructor.
Definition: DTSectCollPhCand.cc:40
DTSectCollPhCand::clearBitsSectColl
void clearBitsSectColl()
Clear (set to 1) the quality bits for Sector Collector.
Definition: DTSectCollPhCand.h:58
BitArray::print
std::ostream & print(std::ostream &o=std::cout) const
Definition: BitArray.h:340
testProducerWithPsetDescEmpty_cfi.a2
a2
Definition: testProducerWithPsetDescEmpty_cfi.py:35
BitArray::element
int element(const int pos) const
Definition: BitArray.h:206
BitArray::one
void one()
Definition: BitArray.h:217
DTChambPhSegm::DeltaPsiR
int DeltaPsiR() const
Return bending angle (bit pattern)
Definition: DTChambPhSegm.h:109
DTSectCollPhCand::_tsc
DTSC * _tsc
Definition: DTSectCollPhCand.h:104
DTSectCollPhCand::DTSectCollPhCand
DTSectCollPhCand()
Constructor.
Definition: DTSectCollPhCand.cc:35
DTChambPhSegm::ChamberId
DTChamberId ChamberId() const override
Return chamber identifier.
Definition: DTChambPhSegm.h:76
DTSC
Definition: DTSC.h:41
DTSectCollPhCand::config
const DTConfigSectColl * config() const
Configuration set.
Definition: DTSectCollPhCand.h:77
DTSectCollPhCand::print
void print() const
Print the trigger.
Definition: DTSectCollPhCand.cc:111
DTChamberId::sector
int sector() const
Definition: DTChamberId.h:49
BitArray::unset
void unset(const int i)
Definition: BitArray.h:225
DTChambPhSegm::step
int step() const
Return step number.
Definition: DTChambPhSegm.h:73
DTChambPhSegm
Definition: DTChambPhSegm.h:41
DTSectCollPhCand.h
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DTSectCollPhCand::_dataword
BitArray< 15 > _dataword
Definition: DTSectCollPhCand.h:108
a0
static constexpr float a0
Definition: L1EGammaCrystalsEmulatorProducer.cc:82
DTChamberId::station
int station() const
Return the station number.
Definition: DTChamberId.h:42