CMS 3D CMS Logo

EcalFenixStripFormatEE.cc
Go to the documentation of this file.
4 
6 #include <iostream>
7 
8 
9 //-----------------------------------------------------------------------------------------
11  : shift_(0)
12 {
13 }
14 //------------------------------------------------------------------------------------------
15 
17 }
18 
19 //-----------------------------------------------------------------------------------------
20 
21 
22 int EcalFenixStripFormatEE::setInput(int input, int inputPeak, int fgvb ) {
23  inputPeak_=inputPeak;
24  input_=input;
25  fgvb_=fgvb;
26  return 0;
27 }
28 //-----------------------------------------------------------------------------------------
29 
31  // Bad strip - zero everything
32  if(stripStatus_ != 0) return 0;
33 
34  // Peak not found - only return fgvb
35  if(inputPeak_==0) return ((fgvb_ & 0x1) << 12);
36 
37  int output=input_>>shift_;
38 
39  //barrel saturates at 12 bits, endcap at 10!
40  // Pascal: finally no,endcap has 12 bits as in EB (bug in FENIX!!!!)
41  if(output>0XFFF) output=0XFFF;
42  output=output|((fgvb_ & 0x1) << 12); //Pascal (was 10)
43 
44  return output;
45 }
46 //------------------------------------------------------------------------------------------
47 
48 void EcalFenixStripFormatEE::process(std::vector<int> &fgvbout,std::vector<int> &peakout,
49  std::vector<int> &filtout, std::vector<int> &output){
50  if (peakout.size()!=filtout.size()){
51  edm::LogWarning("EcalTPG")<<" problem in EcalFenixStripFormatEE: peak_out and filt_out don't have the same size";
52  std::cout<<" Size peak_out"<< peakout.size()<<", size filt_out:"<<filtout.size()<<std::flush<<std::endl;
53  }
54  for (unsigned int i =0;i<filtout.size();i++){
55  setInput(filtout[i],peakout[i],fgvbout[i]);
56  output[i]=process();
57  }
58  return;
59 }
60 //-----------------------------------------------------------------------------------------
61 
62 void EcalFenixStripFormatEE::setParameters(uint32_t id,const EcalTPGSlidingWindow*& slWin,const EcalTPGStripStatus *stripStatus){
63 
64  const EcalTPGSlidingWindowMap &slwinmap = slWin -> getMap();
65  EcalTPGSlidingWindowMapIterator it=slwinmap.find(id);
66  if (it!=slwinmap.end()) shift_=(*it).second;
67  else edm::LogWarning("EcalTPG")<<" could not find EcalTPGSlidingWindowMap entry for "<<id;
68 
69  const EcalTPGStripStatusMap &statusMap = stripStatus->getMap();
70  EcalTPGStripStatusMapIterator sit = statusMap.find(id);
71  if(sit != statusMap.end())
72  {
73  stripStatus_ = (*sit).second;
74  }
75  else
76  {
77  stripStatus_ = 0; // Assume strip OK
78  }
79 }
80 //-----------------------------------------------------------------------------------------
void setParameters(uint32_t id, const EcalTPGSlidingWindow *&, const EcalTPGStripStatus *)
const std::map< uint32_t, uint16_t > & getMap() const
std::map< uint32_t, uint32_t > EcalTPGSlidingWindowMap
int setInput(int input, int inputPeak, int fgvb)
static std::string const input
Definition: EdmProvDump.cc:45
std::map< uint32_t, uint16_t > EcalTPGStripStatusMap
std::map< uint32_t, uint32_t >::const_iterator EcalTPGSlidingWindowMapIterator
std::map< uint32_t, uint16_t >::const_iterator EcalTPGStripStatusMapIterator