CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalFenixStripFormatEE.cc
Go to the documentation of this file.
3 
5 #include <iostream>
6 
7 
8 //-----------------------------------------------------------------------------------------
10  : shift_(0)
11 {
12 }
13 //------------------------------------------------------------------------------------------
14 
16 }
17 
18 //-----------------------------------------------------------------------------------------
19 
20 
21 int EcalFenixStripFormatEE::setInput(int input, int inputPeak, int fgvb ) {
22  inputPeak_=inputPeak;
23  input_=input;
24  fgvb_=fgvb;
25  return 0;
26 }
27 //-----------------------------------------------------------------------------------------
28 
30  if(inputPeak_==0) return 0;
31  // buffer_=input_>>shift_;
32 
33  // int output=buffer_;
34  int output=input_>>shift_;
35 //barrel saturates at 12 bits, endcap at 10!
36 // Pascal: finally no,endcap has 12 bits as in EB (bug in FENIX!!!!)
37  if(output>0XFFF) output=0XFFF;
38  output=output|(fgvb_<<12); //Pascal (was 10)
39 
40  return output;
41 }
42 //------------------------------------------------------------------------------------------
43 
44 void EcalFenixStripFormatEE::process(std::vector<int> &fgvbout,std::vector<int> &peakout,
45  std::vector<int> &filtout, std::vector<int> &output){
46  if (peakout.size()!=filtout.size()){
47  edm::LogWarning("EcalTPG")<<" problem in EcalFenixStripFormatEE: peak_out and filt_out don't have the same size";
48  std::cout<<" Size peak_out"<< peakout.size()<<", size filt_out:"<<filtout.size()<<std::flush<<std::endl;
49  }
50  for (unsigned int i =0;i<filtout.size();i++){
51  setInput(filtout[i],peakout[i],fgvbout[i]);
52  output[i]=process();
53  }
54  return;
55 }
56 //-----------------------------------------------------------------------------------------
57 
59 
60  const EcalTPGSlidingWindowMap &slwinmap = slWin -> getMap();
61  EcalTPGSlidingWindowMapIterator it=slwinmap.find(id);
62  if (it!=slwinmap.end()) shift_=(*it).second;
63  else edm::LogWarning("EcalTPG")<<" could not find EcalTPGSlidingWindowMap entry for "<<id;
64 }
65 //-----------------------------------------------------------------------------------------
int i
Definition: DBlmapReader.cc:9
key_type id() const
Definition: EBDataFrame.h:32
std::map< uint32_t, uint32_t > EcalTPGSlidingWindowMap
int setInput(int input, int inputPeak, int fgvb)
tuple input
Definition: collect_tpl.py:10
tuple cout
Definition: gather_cfg.py:41
std::map< uint32_t, uint32_t >::const_iterator EcalTPGSlidingWindowMapIterator
void setParameters(uint32_t id, const EcalTPGSlidingWindow *&)