CMS 3D CMS Logo

EcalFenixTcp.cc
Go to the documentation of this file.
3 
9 
11 
12 #include <vector>
13 //----------------------------------------------------------------------------------------
15  bool tcpFormat,
16  bool debug,
17  bool famos,
18  int binOfMax,
19  int maxNrSamples,
20  int nbMaxStrips)
21  : debug_(debug), nbMaxStrips_(nbMaxStrips) {
22  bypasslin_.resize(nbMaxStrips_);
23  for (int i = 0; i < nbMaxStrips_; i++)
25  adder_ = new EcalFenixEtTot();
26  maxOf2_ = new EcalFenixMaxof2(maxNrSamples, nbMaxStrips_);
27  formatter_ = new EcalFenixTcpFormat(tcpFormat, debug_, famos, binOfMax);
28  fgvbEB_ = new EcalFenixFgvbEB(maxNrSamples);
29  fgvbEE_ = new EcalFenixTcpFgvbEE(maxNrSamples);
31 
32  // permanent data structures
34  std::vector<int> vec(maxNrSamples, 0);
35  for (int i = 0; i < nbMaxStrips_; i++)
36  bypasslin_out_[i] = vec;
37  adder_out_.resize(maxNrSamples);
38  maxOf2_out_.resize(maxNrSamples);
39  fgvb_out_.resize(maxNrSamples);
40  strip_fgvb_out_.resize(maxNrSamples);
41 }
42 //-----------------------------------------------------------------------------------------
44  for (int i = 0; i < nbMaxStrips_; i++)
45  delete bypasslin_[i];
46  delete adder_;
47  delete maxOf2_;
48  delete formatter_;
49  delete fgvbEB_;
50  delete fgvbEE_;
51 }
52 //-----------------------------------------------------------------------------------------
53 
55  std::vector<EBDataFrame> &bid, // dummy argument for template call
56  std::vector<std::vector<int>> &tpframetow,
57  int nStr,
58  std::vector<EcalTriggerPrimitiveSample> &tptow,
59  std::vector<EcalTriggerPrimitiveSample> &tptow2,
60  bool isInInnerRing,
61  EcalTrigTowerDetId towid) {
62  int bitMask = 12;
63  process_part1(tpframetow, nStr, bitMask);
64 
65  process_part2_barrel(tpframetow,
66  nStr,
67  bitMask,
74  tptow,
75  tptow2,
76  towid);
77 }
78 
79 //-----------------------------------------------------------------------------------------
81  std::vector<EEDataFrame> &bid, // dummy argument for template call
82  std::vector<std::vector<int>> &tpframetow,
83  int nStr,
84  std::vector<EcalTriggerPrimitiveSample> &tptow,
85  std::vector<EcalTriggerPrimitiveSample> &tptow2,
86  bool isInInnerRing,
87  EcalTrigTowerDetId towid) {
88  int bitMask = 12; // Pascal: endcap has 12 bits as in EB (bug in FENIX!!!!)
89  // {was 10 before]
90  process_part1(tpframetow, nStr, bitMask);
91 
92  process_part2_endcap(tpframetow,
93  nStr,
94  bitMask,
99  tptow,
100  tptow2,
101  isInInnerRing,
102  towid);
103 }
104 //-----------------------------------------------------------------------------------------
105 void EcalFenixTcp::process_part1(std::vector<std::vector<int>> &tpframetow, int nStr, int bitMask) {
106  // //call bypasslin
107  // for (int istrip=0;istrip<nStr;istrip ++){
108  // this->getBypasslin(istrip)->process(tpframetow[istrip],bypasslin_out_[istrip]);
109  // }
110  // //this is a test
111  // if (debug_) {
112  // std::cout<<"bypasslinout = "<<std::endl;
113  // for (int istrip=0;istrip<nStr;istrip ++){
114  // std::vector<int> stripin= bypasslin_out_[istrip];
115  // for (unsigned int is=0;is<stripin.size();is++){
116  // std::cout<<stripin[is]<<" ";
117  // }
118  // std::cout<<std::endl;
119  // }
120  // }
121 
122  // //call adder
123  // this->getAdder()->process(bypasslin_out_, nStr, bitMask,adder_out_);
124  this->getAdder()->process(tpframetow, nStr, bitMask, adder_out_);
125  // this is a test:
126  if (debug_) {
127  std::cout << "output of adder is a vector of size: " << adder_out_.size() << std::endl;
128  std::cout << "value : " << std::endl;
129  for (unsigned int i = 0; i < adder_out_.size(); i++) {
130  std::cout << " " << adder_out_[i];
131  }
132  std::cout << std::endl;
133  }
134  // return adder_out;
135  return;
136 }
137 //-----------------------------------------------------------------------------------------
138 void EcalFenixTcp::process_part2_barrel(std::vector<std::vector<int>> &bypasslinout,
139  int nStr,
140  int bitMask,
141  const EcalTPGFineGrainEBGroup *ecaltpgFgEBGroup,
142  const EcalTPGLutGroup *ecaltpgLutGroup,
143  const EcalTPGLutIdMap *ecaltpgLut,
144  const EcalTPGFineGrainEBIdMap *ecaltpgFineGrainEB,
145  const EcalTPGTowerStatus *ecaltpgBadTT,
146  const EcalTPGSpike *ecaltpgSpike,
147  std::vector<EcalTriggerPrimitiveSample> &tcp_out,
148  std::vector<EcalTriggerPrimitiveSample> &tcp_outTcc,
149  EcalTrigTowerDetId towid) {
150  // call maxof2
151  // this->getMaxOf2()->process(bypasslin_out_,nStr,maxOf2_out_);
152  this->getMaxOf2()->process(bypasslinout, nStr, bitMask, maxOf2_out_);
153  // this is a test:
154  if (debug_) {
155  std::cout << "output of maxof2 is a vector of size: " << maxOf2_out_.size() << std::endl;
156  std::cout << "value : " << std::endl;
157  for (unsigned int i = 0; i < maxOf2_out_.size(); i++) {
158  std::cout << " " << std::dec << maxOf2_out_[i];
159  }
160  std::cout << std::endl;
161  }
162 
163  // call fgvb
164 
165  this->getFGVBEB()->setParameters(towid.rawId(), ecaltpgFgEBGroup, ecaltpgFineGrainEB);
167 
168  // Call sFGVB
169  this->getsFGVBEB()->process(bypasslinout, nStr, bitMask, strip_fgvb_out_);
170 
171  // this is a test:
172  if (debug_) {
173  std::cout << "output of fgvb is a vector of size: " << fgvb_out_.size() << std::endl;
174  std::cout << "value : " << std::endl;
175  for (unsigned int i = 0; i < fgvb_out_.size(); i++) {
176  std::cout << " " << std::dec << fgvb_out_[i];
177  }
178  std::cout << std::endl;
179  }
180 
181  // call formatter
182  int eTTotShift = 2;
183 
184  this->getFormatter()->setParameters(towid.rawId(), ecaltpgLutGroup, ecaltpgLut, ecaltpgBadTT, ecaltpgSpike);
185  this->getFormatter()->process(adder_out_, fgvb_out_, strip_fgvb_out_, eTTotShift, tcp_out, tcp_outTcc, false);
186  // this is a test:
187  if (debug_) {
188  std::cout << "output of TCP formatter Barrel is a vector of size: " << std::dec << tcp_out.size() << std::endl;
189  std::cout << "value : " << std::endl;
190  for (unsigned int i = 0; i < tcp_out.size(); i++) {
191  std::cout << " " << i << " " << std::dec << tcp_out[i];
192  }
193  std::cout << std::endl;
194  }
195 
196  return;
197 }
198 //-----------------------------------------------------------------------------------------
199 void EcalFenixTcp::process_part2_endcap(std::vector<std::vector<int>> &bypasslinout,
200  int nStr,
201  int bitMask,
202  const EcalTPGLutGroup *ecaltpgLutGroup,
203  const EcalTPGLutIdMap *ecaltpgLut,
204  const EcalTPGFineGrainTowerEE *ecaltpgFineGrainTowerEE,
205  const EcalTPGTowerStatus *ecaltpgbadTT,
206  std::vector<EcalTriggerPrimitiveSample> &tcp_out,
207  std::vector<EcalTriggerPrimitiveSample> &tcp_outTcc,
208  bool isInInnerRings,
209  EcalTrigTowerDetId towid)
210 
211 {
212  // Zero EB strip records
213  for (unsigned int i = 0; i < strip_fgvb_out_.size(); ++i) {
214  strip_fgvb_out_[i] = 0;
215  }
216 
217  // call fgvb
218  this->getFGVBEE()->setParameters(towid.rawId(), ecaltpgFineGrainTowerEE);
219  // fgvbEE_->process(bypasslin_out_,nStr,bitMask,fgvb_out_);
220  fgvbEE_->process(bypasslinout, nStr, bitMask, fgvb_out_);
221 
222  // call formatter
223  int eTTotShift = 2; // Pascal: endcap has 12 bits as in EB (bug in FENIX!!!!)
224  // so shift must be applied to just keep [11:2]
225 
226  this->getFormatter()->setParameters(towid.rawId(), ecaltpgLutGroup, ecaltpgLut, ecaltpgbadTT, nullptr);
227 
228  this->getFormatter()->process(
229  adder_out_, fgvb_out_, strip_fgvb_out_, eTTotShift, tcp_out, tcp_outTcc, isInInnerRings);
230  // this is a test:
231  if (debug_) {
232  std::cout << "output of TCP formatter(endcap) is a vector of size: " << std::dec << tcp_out.size() << std::endl;
233  std::cout << "value : " << std::endl;
234  for (unsigned int i = 0; i < tcp_out.size(); i++) {
235  std::cout << " " << i << " " << std::dec << tcp_out[i] << std::endl;
236  }
237  std::cout << std::endl;
238  }
239  return;
240 }
EcalFenixBypassLin
Linearisation for Tcp input: 16 bits output: 12 bits +1 going to fgvb (???)
Definition: EcalFenixBypassLin.h:16
mps_fire.i
i
Definition: mps_fire.py:428
EcalFenixTcp::adder_out_
std::vector< int > adder_out_
Definition: EcalFenixTcp.h:50
EcalFenixEtTot::process
virtual std::vector< int > process(const std::vector< EBDataFrame * > &)
Definition: EcalFenixEtTot.cc:8
ESHandle.h
EcalFenixTcp::process_part2_barrel
void process_part2_barrel(std::vector< std::vector< int >> &, int nStr, int bitMask, const EcalTPGFineGrainEBGroup *ecaltpgFgEBGroup, const EcalTPGLutGroup *ecaltpgLutGroup, const EcalTPGLutIdMap *ecaltpgLut, const EcalTPGFineGrainEBIdMap *ecaltpgFineGrainEB, const EcalTPGTowerStatus *ecaltpgBadTT, const EcalTPGSpike *ecaltpgSpike, std::vector< EcalTriggerPrimitiveSample > &tptow, std::vector< EcalTriggerPrimitiveSample > &tptow2, EcalTrigTowerDetId towid)
Definition: EcalFenixTcp.cc:138
EcalFenixMaxof2
Definition: EcalFenixMaxof2.h:18
EcalTPGSpike
Definition: EcalTPGSpike.h:9
EcalFenixTcp::ecaltpgFgEBGroup_
const EcalTPGFineGrainEBGroup * ecaltpgFgEBGroup_
Definition: EcalFenixTcp.h:135
EcalFenixTcp::getsFGVBEB
EcalFenixTcpsFgvbEB * getsFGVBEB() const
Definition: EcalFenixTcp.h:133
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EcalTPGFineGrainEBIdMap.h
EcalTPGFineGrainEBIdMap
Definition: EcalTPGFineGrainEBIdMap.h:10
EcalFenixTcp::process_part2_endcap
void process_part2_endcap(std::vector< std::vector< int >> &, int nStr, int bitMask, const EcalTPGLutGroup *ecaltpgLutGroup, const EcalTPGLutIdMap *ecaltpgLut, const EcalTPGFineGrainTowerEE *ecaltpgFineGrainTowerEE, const EcalTPGTowerStatus *ecaltpgBadTT, std::vector< EcalTriggerPrimitiveSample > &tptow, std::vector< EcalTriggerPrimitiveSample > &tptow2, bool isInInnerRings, EcalTrigTowerDetId towid)
Definition: EcalFenixTcp.cc:199
EcalFenixTcp.h
EcalFenixTcp::nbMaxStrips_
int nbMaxStrips_
Definition: EcalFenixTcp.h:37
EcalFenixFgvbEB::process
void process(std::vector< int > &add_out, std::vector< int > &maxof2_out, std::vector< int > &output)
Definition: EcalFenixFgvbEB.cc:10
EcalFenixTcp::maxOf2_out_
std::vector< int > maxOf2_out_
Definition: EcalFenixTcp.h:51
EcalTrigTowerDetId
Definition: EcalTrigTowerDetId.h:14
EcalFenixFgvbEB
calculation of Fgvb for Fenix Tcp, format barrel calculates fgvb for the barrel
Definition: EcalFenixFgvbEB.h:23
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
EcalTPGLutGroup
Definition: EcalTPGLutGroup.h:13
EcalTPGFineGrainTowerEE.h
EcalFenixTcpsFgvbEB
calculation of strip Fgvb for Fenix Tcp, format barrel calculates fgvb for the barrel
Definition: EcalFenixTcpsFgvbEB.h:15
EcalTPGFineGrainTowerEE
Definition: EcalTPGFineGrainTowerEE.h:9
EcalTPGLutIdMap.h
debug
#define debug
Definition: HDRShower.cc:19
EcalFenixTcp::process
void process(const edm::EventSetup &setup, std::vector< EBDataFrame > &bid, std::vector< std::vector< int >> &tpframetow, int nStr, std::vector< EcalTriggerPrimitiveSample > &tptow, std::vector< EcalTriggerPrimitiveSample > &tptow2, bool isInInnerRings, EcalTrigTowerDetId thisTower)
Definition: EcalFenixTcp.cc:54
EcalFenixTcp::ecaltpgLutGroup_
const EcalTPGLutGroup * ecaltpgLutGroup_
Definition: EcalFenixTcp.h:136
EcalFenixTcp::getFGVBEB
EcalFenixFgvbEB * getFGVBEB() const
Definition: EcalFenixTcp.h:131
EcalFenixTcp::debug_
bool debug_
Definition: EcalFenixTcp.h:35
EcalFenixTcp::getAdder
EcalFenixEtTot * getAdder() const
Definition: EcalFenixTcp.h:128
EcalFenixTcpFormat::process
void process(std::vector< int > &, std::vector< int > &)
Definition: EcalFenixTcpFormat.cc:19
EcalTPGLutIdMap
Definition: EcalTPGLutIdMap.h:10
EcalFenixTcp::fgvb_out_
std::vector< int > fgvb_out_
Definition: EcalFenixTcp.h:52
EcalTPGLutGroup.h
EcalFenixTcp::bypasslin_out_
std::vector< std::vector< int > > bypasslin_out_
Definition: EcalFenixTcp.h:49
EcalFenixTcp::adder_
EcalFenixEtTot * adder_
Definition: EcalFenixTcp.h:41
EcalFenixTcp::~EcalFenixTcp
virtual ~EcalFenixTcp()
Definition: EcalFenixTcp.cc:43
EcalTPGFineGrainEBGroup
Definition: EcalTPGFineGrainEBGroup.h:13
EcalFenixTcp::formatter_
EcalFenixTcpFormat * formatter_
Definition: EcalFenixTcp.h:46
EcalFenixTcpFgvbEE::process
void process(std::vector< std::vector< int >> &bypasslin_out, int nStr, int bitMask, std::vector< int > &output)
Definition: EcalFenixTcpFgvbEE.cc:12
EcalFenixTcp::ecaltpgSpike_
const EcalTPGSpike * ecaltpgSpike_
Definition: EcalFenixTcp.h:141
EcalFenixTcp::getFGVBEE
EcalFenixTcpFgvbEE * getFGVBEE() const
Definition: EcalFenixTcp.h:132
EcalFenixTcp::ecaltpgFineGrainEB_
const EcalTPGFineGrainEBIdMap * ecaltpgFineGrainEB_
Definition: EcalFenixTcp.h:138
EcalTPGFineGrainEBGroup.h
EcalFenixTcpFgvbEE
calculation of Fgvb for Fenix Tcp, format endcap calculates fgvb for the endcap
Definition: EcalFenixTcpFgvbEE.h:24
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
edm::EventSetup
Definition: EventSetup.h:57
EcalFenixTcp::getFormatter
EcalFenixTcpFormat * getFormatter() const
Definition: EcalFenixTcp.h:130
EcalFenixTcp::sfgvbEB_
EcalFenixTcpsFgvbEB * sfgvbEB_
Definition: EcalFenixTcp.h:44
EcalFenixTcpFgvbEE::setParameters
void setParameters(uint32_t towid, const EcalTPGFineGrainTowerEE *ecaltpgFineGrainTowerEE)
Definition: EcalFenixTcpFgvbEE.cc:41
EcalFenixEtTot
class for calculation of Et for Fenix tcp calculates the sum
Definition: EcalFenixEtTot.h:25
EcalTPGTowerStatus
Definition: EcalTPGTowerStatus.h:9
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
EcalFenixTcp::ecaltpgFineGrainTowerEE_
const EcalTPGFineGrainTowerEE * ecaltpgFineGrainTowerEE_
Definition: EcalFenixTcp.h:139
EcalFenixTcp::EcalFenixTcp
EcalFenixTcp(const edm::EventSetup &setup, bool tcpFormat, bool debug, bool famos, int binOfMax, int maxNrSamples, int nbMaxStrips)
Definition: EcalFenixTcp.cc:14
EcalFenixTcpFormat
Definition: EcalFenixTcpFormat.h:22
EcalFenixTcp::ecaltpgLut_
const EcalTPGLutIdMap * ecaltpgLut_
Definition: EcalFenixTcp.h:137
EcalFenixTcp::fgvbEB_
EcalFenixFgvbEB * fgvbEB_
Definition: EcalFenixTcp.h:42
EcalFenixTcpFormat::setParameters
void setParameters(uint32_t towid, const EcalTPGLutGroup *ecaltpgLutGroup, const EcalTPGLutIdMap *ecaltpgLut, const EcalTPGTowerStatus *ecaltpgbadTT, const EcalTPGSpike *ecaltpgSpike)
Definition: EcalFenixTcpFormat.cc:131
EcalFenixFgvbEB::setParameters
void setParameters(uint32_t towid, const EcalTPGFineGrainEBGroup *ecaltpgFgEBGroup, const EcalTPGFineGrainEBIdMap *ecaltpgFineGrainEB)
Definition: EcalFenixFgvbEB.cc:71
EcalFenixTcpsFgvbEB::process
void process(std::vector< std::vector< int >> &bypasslin_out, int nStr, int bitMask, std::vector< int > &output)
Definition: EcalFenixTcpsFgvbEB.cc:7
EcalFenixTcp::process_part1
void process_part1(std::vector< std::vector< int >> &tpframetow, int nStr, int bitMask)
Definition: EcalFenixTcp.cc:105
EcalFenixTcp::ecaltpgBadTT_
const EcalTPGTowerStatus * ecaltpgBadTT_
Definition: EcalFenixTcp.h:140
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
EcalFenixTcpFormat.h
EcalFenixTcp::getMaxOf2
EcalFenixMaxof2 * getMaxOf2() const
Definition: EcalFenixTcp.h:129
EcalFenixTcp::bypasslin_
std::vector< EcalFenixBypassLin * > bypasslin_
Definition: EcalFenixTcp.h:40
EcalFenixTcp::strip_fgvb_out_
std::vector< int > strip_fgvb_out_
Definition: EcalFenixTcp.h:53
EcalFenixMaxof2::process
void process(std::vector< std::vector< int >> &, int nStr, int bitMask, std::vector< int > &out)
Definition: EcalFenixMaxof2.cc:13
EcalFenixTcp::maxOf2_
EcalFenixMaxof2 * maxOf2_
Definition: EcalFenixTcp.h:39
EcalFenixTcp::fgvbEE_
EcalFenixTcpFgvbEE * fgvbEE_
Definition: EcalFenixTcp.h:43