CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
EcalEBTrigPrimTestAlgo Class Reference

#include <EcalEBTrigPrimTestAlgo.h>

Public Member Functions

 EcalEBTrigPrimTestAlgo (const edm::EventSetup &setup, int nSamples, int binofmax, bool tcpFormat, bool barrelOnly, bool debug, bool famos)
 
void run (const edm::EventSetup &, const EBDigiCollection *col, EcalEBTrigPrimDigiCollection &result, EcalEBTrigPrimDigiCollection &resultTcp)
 
void setPointers (const EcalTPGLinearizationConst *ecaltpLin, const EcalTPGPedestals *ecaltpPed, const EcalTPGCrystalStatus *ecaltpgBadX, const EcalTPGWeightIdMap *ecaltpgWeightMap, const EcalTPGWeightGroup *ecaltpgWeightGroup, const EcalTPGSlidingWindow *ecaltpgSlidW, const EcalTPGLutGroup *ecaltpgLutGroup, const EcalTPGLutIdMap *ecaltpgLut, const EcalTPGTowerStatus *ecaltpgBadTT, const EcalTPGSpike *ecaltpgSpike)
 
virtual ~EcalEBTrigPrimTestAlgo ()
 

Private Types

enum  { nbMaxStrips_ =5 }
 
enum  { nbMaxXtals_ =5 }
 

Private Member Functions

template<class T >
void clean (std::vector< std::vector< std::pair< int, std::vector< T > > > > &towerMap)
 
template<class Coll >
void fillMap (Coll const *col, std::vector< std::vector< std::pair< int, std::vector< typename Coll::Digi > > > > &towerMap)
 
int findStripNr (const EBDetId &id)
 
int findStripNr (const EEDetId &id)
 
EcalFenixAmplitudeFiltergetFilter () const
 
EcalFenixTcpFormatgetFormatter () const
 
EcalFenixStripFormatEBgetFormatterEB () const
 
int getIndex (const EBDigiCollection *, EcalTrigTowerDetId &id)
 
int getIndex (const EEDigiCollection *, EcalTrigTowerDetId &id)
 
EcalFenixLinearizergetLinearizer (int i) const
 
EcalFenixPeakFindergetPeakFinder () const
 
void init (const edm::EventSetup &)
 
template<class T >
void initStructures (std::vector< std::vector< std::pair< int, std::vector< T > > > > &towMap)
 

Private Attributes

EcalFenixAmplitudeFilteramplitude_filter_
 
bool barrelOnly_
 
int binOfMaximum_
 
bool debug_
 
const EcalTPGTowerStatusecaltpgBadTT_
 
const EcalTPGCrystalStatusecaltpgBadX_
 
const EcalTPGLutIdMapecaltpgLut_
 
const EcalTPGLutGroupecaltpgLutGroup_
 
const EcalTPGSlidingWindowecaltpgSlidW_
 
const EcalTPGSpikeecaltpgSpike_
 
const EcalTPGWeightGroupecaltpgWeightGroup_
 
const EcalTPGWeightIdMapecaltpgWeightMap_
 
const EcalTPGLinearizationConstecaltpLin_
 
const EcalTPGPedestalsecaltpPed_
 
edm::ESHandle< EcalTrigTowerConstituentsMapeTTmap_
 
bool famos_
 
EcalFenixStripFormatEBfenixFormatterEB_
 
EcalFenixTcpFormatfenixTcpFormat_
 
std::vector< int > fgvb_out_
 
std::vector< int > fgvb_out_temp_
 
std::vector< int > filt_out_
 
std::vector< int > format_out_
 
std::vector< std::pair< int, EcalTrigTowerDetId > > hitTowers_
 
std::vector< std::vector< int > > lin_out_
 
std::vector< EcalFenixLinearizer * > linearizer_
 
int maxNrSamples_
 
int nrTowers_
 
int nSamples_
 
EcalFenixPeakFinderpeak_finder_
 
std::vector< int > peak_out_
 
std::vector< std::vector< int > > striptp_
 
bool tcpFormat_
 
std::vector< int > tcpformat_out_
 
edm::ESHandle< CaloGeometrytheGeometry
 
const EcalElectronicsMappingtheMapping_
 
float threshold
 
std::vector< std::vector< std::pair< int, std::vector< EBDataFrame > > > > towerMapEB_
 
std::vector< std::vector< std::pair< int, std::vector< EEDataFrame > > > > towerMapEE_
 
std::vector< EcalEBTriggerPrimitiveSampletowtp2_
 
std::vector< EcalEBTriggerPrimitiveSampletowtp_
 

Static Private Attributes

static const unsigned int maxNrSamplesOut_ =10
 
static const unsigned int maxNrTowers_ =2448
 
static const unsigned int nrSamples_ =5
 

Detailed Description

Author
N. Marinelli - Univ. of Notre Dame forPhase II While the new digitization is not yet implemented, we use the old Digis to make TP per crystal

EcalEBTrigPrimTestAlgo starting point for Phase II: build TPs out of Phase I digis to start building the infrastructures

Definition at line 48 of file EcalEBTrigPrimTestAlgo.h.

Member Enumeration Documentation

anonymous enum
private
Enumerator
nbMaxStrips_ 

Definition at line 135 of file EcalEBTrigPrimTestAlgo.h.

anonymous enum
private
Enumerator
nbMaxXtals_ 

Definition at line 136 of file EcalEBTrigPrimTestAlgo.h.

Constructor & Destructor Documentation

EcalEBTrigPrimTestAlgo::EcalEBTrigPrimTestAlgo ( const edm::EventSetup setup,
int  nSamples,
int  binofmax,
bool  tcpFormat,
bool  barrelOnly,
bool  debug,
bool  famos 
)
explicit

Definition at line 46 of file EcalEBTrigPrimTestAlgo.cc.

References init(), and maxNrSamples_.

EcalEBTrigPrimTestAlgo::~EcalEBTrigPrimTestAlgo ( )
virtual

Definition at line 95 of file EcalEBTrigPrimTestAlgo.cc.

References amplitude_filter_, fenixFormatterEB_, fenixTcpFormat_, mps_fire::i, linearizer_, nbMaxXtals_, and peak_finder_.

96 {
97  for (int i=0;i<nbMaxXtals_;i++) delete linearizer_[i];
98  delete amplitude_filter_;
99  delete peak_finder_;
100  delete fenixFormatterEB_;
101  delete fenixTcpFormat_;
102 }
EcalFenixStripFormatEB * fenixFormatterEB_
std::vector< EcalFenixLinearizer * > linearizer_
EcalFenixAmplitudeFilter * amplitude_filter_
EcalFenixPeakFinder * peak_finder_
EcalFenixTcpFormat * fenixTcpFormat_

Member Function Documentation

template<class T >
void EcalEBTrigPrimTestAlgo::clean ( std::vector< std::vector< std::pair< int, std::vector< T > > > > &  towerMap)
private

Definition at line 184 of file EcalEBTrigPrimTestAlgo.h.

References mps_fire::i, maxNrTowers_, and nbMaxStrips_.

Referenced by run(), and setPointers().

184  {
185  // clean internal data structures
186  for (unsigned int i=0;i<maxNrTowers_;++i)
187  for (int j=0;j<nbMaxStrips_ ;++j) (towMap[i])[j].first=0;
188  return;
189 }
static const unsigned int maxNrTowers_
template<class Coll >
void EcalEBTrigPrimTestAlgo::fillMap ( Coll const *  col,
std::vector< std::vector< std::pair< int, std::vector< typename Coll::Digi > > > > &  towerMap 
)
private

Definition at line 193 of file EcalEBTrigPrimTestAlgo.h.

References gather_cfg::cout, debug_, findStripNr(), plotBeamSpotDB::first, getIndex(), hitTowers_, mps_fire::i, nbMaxXtals_, nrTowers_, hcalTTPDigis_cfi::samples, and edm::second().

Referenced by run(), and setPointers().

195 {
196  typedef typename Coll::Digi Digi;
197 
198  // implementation for Barrel
199  if (col) {
200  nrTowers_=0;
201  if ( debug_) std::cout <<"Fill mapping, Collection size = "<< col->size() << std::endl;;
202  for(unsigned int i = 0; i < col->size() ; ++i) {
203  Digi samples((*col)[i]);
204  EcalTrigTowerDetId coarser=(*eTTmap_).towerOf(samples.id());
205  int index=getIndex(col,coarser);
206  int stripnr=findStripNr(samples.id());
207 
208  int filled=0;
209  for (unsigned int ij=0;ij<towerMap[index].size();++ij) filled+=towerMap[index][ij].first;
210  if (!filled) {
211  hitTowers_[nrTowers_++]=std::pair <int,EcalTrigTowerDetId>(index,coarser);
212  }
213 
214  //FIXME: temporary protection
215  int ncryst=towerMap[index][stripnr-1].first;
216  if (ncryst>=nbMaxXtals_ ) {
217  edm::LogError("EcalTrigPrimFunctionAlgo")<<"! Too many xtals for TT "<<coarser<<" stripnr "<<stripnr<<" xtalid "<<samples.id() ;
218  continue;
219  }
220  ((towerMap[index])[stripnr-1].second)[ncryst]=samples;
221  (towerMap[index])[stripnr-1].first++;
222  }
223 
224  if (debug_) std::cout << "fillMap"<<"[EcalTrigPrimFunctionalAlgo] (found "
225  << col->size() << " frames in "<< towerMap.size() << " towers) " << std::endl;
226  }
227  else {
228  if (debug_) std::cout <<"FillMap - FillMap Collection size=0 !!!!" << std::endl;;
229  }
230 }
std::tuple< unsigned int, int, int, DigiType, int, int, int, float > Digi
Definition: GenericDigi.h:40
U second(std::pair< T, U > const &p)
std::vector< std::pair< int, EcalTrigTowerDetId > > hitTowers_
int getIndex(const EBDigiCollection *, EcalTrigTowerDetId &id)
int findStripNr(const EBDetId &id)
col
Definition: cuy.py:1010
int EcalEBTrigPrimTestAlgo::findStripNr ( const EBDetId id)
private

Definition at line 323 of file EcalEBTrigPrimTestAlgo.cc.

References gen::n, and nbMaxStrips_.

Referenced by fillMap(), and setPointers().

323  {
324  int stripnr;
325  int n=((id.ic()-1)%100)/20; //20 corresponds to 4 * ecal_barrel_crystals_per_strip FIXME!!
326  if (id.ieta()<0) stripnr = n+1;
327  else stripnr =nbMaxStrips_ - n;
328  return stripnr;
329 }
int EcalEBTrigPrimTestAlgo::findStripNr ( const EEDetId id)
private
EcalFenixAmplitudeFilter* EcalEBTrigPrimTestAlgo::getFilter ( ) const
inlineprivate

Definition at line 163 of file EcalEBTrigPrimTestAlgo.h.

References amplitude_filter_.

Referenced by run().

163 { return amplitude_filter_;}
EcalFenixAmplitudeFilter * amplitude_filter_
EcalFenixTcpFormat* EcalEBTrigPrimTestAlgo::getFormatter ( ) const
inlineprivate

Definition at line 175 of file EcalEBTrigPrimTestAlgo.h.

References fenixTcpFormat_.

Referenced by run().

175 {return fenixTcpFormat_;}
EcalFenixTcpFormat * fenixTcpFormat_
EcalFenixStripFormatEB* EcalEBTrigPrimTestAlgo::getFormatterEB ( ) const
inlineprivate

Definition at line 173 of file EcalEBTrigPrimTestAlgo.h.

References fenixFormatterEB_.

Referenced by run().

173 { return fenixFormatterEB_;}
EcalFenixStripFormatEB * fenixFormatterEB_
int EcalEBTrigPrimTestAlgo::getIndex ( const EBDigiCollection ,
EcalTrigTowerDetId id 
)
inlineprivate

Definition at line 97 of file EcalEBTrigPrimTestAlgo.h.

Referenced by fillMap().

97 {return id.hashedIndex();}
int EcalEBTrigPrimTestAlgo::getIndex ( const EEDigiCollection ,
EcalTrigTowerDetId id 
)
inlineprivate

Definition at line 99 of file EcalEBTrigPrimTestAlgo.h.

References ecaldqm::zside().

99  {
100  int ind=(id.ietaAbs()-18)*72 + id.iphi();
101  if (id.zside()<0) ind+=792;
102  return ind;
103  }
int zside(DetId const &)
EcalFenixLinearizer* EcalEBTrigPrimTestAlgo::getLinearizer ( int  i) const
inlineprivate

Definition at line 160 of file EcalEBTrigPrimTestAlgo.h.

References mps_fire::i.

Referenced by run().

160 { return linearizer_[i];}
std::vector< EcalFenixLinearizer * > linearizer_
EcalFenixPeakFinder* EcalEBTrigPrimTestAlgo::getPeakFinder ( ) const
inlineprivate

Definition at line 172 of file EcalEBTrigPrimTestAlgo.h.

References peak_finder_.

Referenced by run().

172 { return peak_finder_;}
EcalFenixPeakFinder * peak_finder_
void EcalEBTrigPrimTestAlgo::init ( const edm::EventSetup setup)
private

Definition at line 56 of file EcalEBTrigPrimTestAlgo.cc.

References amplitude_filter_, barrelOnly_, binOfMaximum_, debug_, eTTmap_, famos_, fenixFormatterEB_, fenixTcpFormat_, fgvb_out_, fgvb_out_temp_, filt_out_, format_out_, edm::EventSetup::get(), hitTowers_, mps_fire::i, initStructures(), lin_out_, linearizer_, maxNrSamples_, maxNrTowers_, nbMaxXtals_, peak_finder_, peak_out_, tcpFormat_, tcpformat_out_, theGeometry, towerMapEB_, and findQualityFiles::v.

Referenced by EcalEBTrigPrimTestAlgo(), and setPointers().

56  {
57  if (!barrelOnly_) {
58  //edm::ESHandle<CaloGeometry> theGeometry;
59  // edm::ESHandle<CaloSubdetectorGeometry> theEndcapGeometry_handle;
60  setup.get<CaloGeometryRecord>().get( theGeometry );
61  setup.get<IdealGeometryRecord>().get(eTTmap_);
62  }
63 
64  // initialise data structures
66  hitTowers_.resize(maxNrTowers_);
67 
68 
69  linearizer_.resize(nbMaxXtals_);
70  for (int i=0;i<nbMaxXtals_;i++) linearizer_[i] = new EcalFenixLinearizer(famos_);
71 
72  //
73  std::vector <int> v;
74  v.resize(maxNrSamples_);
75  lin_out_.resize(nbMaxXtals_);
76  for (int i=0;i<5;i++) lin_out_[i]=v;
77  //
79  filt_out_.resize(maxNrSamples_);
80  peak_out_.resize(maxNrSamples_);
81  // these two are dummy
82  fgvb_out_.resize(maxNrSamples_);
84  //
87  format_out_.resize(maxNrSamples_);
88  //
91 
92 }
std::vector< std::vector< std::pair< int, std::vector< EBDataFrame > > > > towerMapEB_
EcalFenixStripFormatEB * fenixFormatterEB_
std::vector< int > format_out_
calculates the peak for Fenix strip, barrel input : 18 bits output: boolean
Linearisation for Fenix strip input: 16 bits corresponding to input EBDataFrame output: 18 bits...
std::vector< std::pair< int, EcalTrigTowerDetId > > hitTowers_
void initStructures(std::vector< std::vector< std::pair< int, std::vector< T > > > > &towMap)
calculates .... for Fenix strip, barrel input: 18 bits output: 18 bits
Formatting for Fenix strip input: 18 bits + 3x 1bit (fgvb, gapflagbit, output from peakfinder) output...
std::vector< EcalFenixLinearizer * > linearizer_
edm::ESHandle< CaloGeometry > theGeometry
static const unsigned int maxNrTowers_
std::vector< int > fgvb_out_temp_
edm::ESHandle< EcalTrigTowerConstituentsMap > eTTmap_
std::vector< int > tcpformat_out_
T get() const
Definition: EventSetup.h:71
EcalFenixAmplitudeFilter * amplitude_filter_
EcalFenixPeakFinder * peak_finder_
std::vector< std::vector< int > > lin_out_
EcalFenixTcpFormat * fenixTcpFormat_
template<class T >
void EcalEBTrigPrimTestAlgo::initStructures ( std::vector< std::vector< std::pair< int, std::vector< T > > > > &  towMap)
private

Definition at line 233 of file EcalEBTrigPrimTestAlgo.h.

References mps_fire::i, maxNrSamples_, maxNrTowers_, nbMaxStrips_, nbMaxXtals_, and striptp_.

Referenced by init(), and setPointers().

233  {
234  //initialise internal data structures
235 
236  std::vector <T> vec0(nbMaxXtals_ );
237  std::vector<std::pair<int,std::vector<T> > > vec1(nbMaxStrips_);
238  for (int i=0;i<nbMaxStrips_ ;++i) vec1[i]=std::pair<int,std::vector<T> >(0,vec0);
239  towMap.resize(maxNrTowers_);
240  for (unsigned int i=0;i<maxNrTowers_;++i) towMap[i]=vec1;
241 
242  std::vector<int> vecint(maxNrSamples_);
243  striptp_.resize(nbMaxStrips_);
244  for (int i=0;i<nbMaxStrips_;++i) striptp_[i]=vecint;
245 
246 }
std::vector< std::vector< int > > striptp_
std::vector< double > vec1
Definition: HCALResponse.h:15
static const unsigned int maxNrTowers_
void EcalEBTrigPrimTestAlgo::run ( const edm::EventSetup ,
const EBDigiCollection col,
EcalEBTrigPrimDigiCollection result,
EcalEBTrigPrimDigiCollection resultTcp 
)

Definition at line 105 of file EcalEBTrigPrimTestAlgo.cc.

References binOfMaximum_, clean(), gather_cfg::cout, debug_, TauDecayModes::dec, ecaltpgBadTT_, ecaltpgBadX_, ecaltpgLut_, ecaltpgLutGroup_, ecaltpgSlidW_, ecaltpgSpike_, ecaltpgWeightGroup_, ecaltpgWeightMap_, ecaltpLin_, ecaltpPed_, fgvb_out_, fgvb_out_temp_, fillMap(), filt_out_, plotBeamSpotDB::first, CastorSimpleReconstructor_cfi::firstSample, format_out_, getFilter(), getFormatter(), getFormatterEB(), getLinearizer(), getPeakFinder(), EcalElectronicsMapping::getTriggerElectronicsId(), hitTowers_, mps_fire::i, lin_out_, nrSamples_, nrTowers_, peak_out_, EcalFenixPeakFinder::process(), EcalFenixTcpFormat::process(), EcalFenixAmplitudeFilter::process(), EcalFenixStripFormatEB::process(), EcalFenixLinearizer::process(), edm::SortedCollection< T, SORT >::push_back(), EcalTriggerElectronicsId::rawId(), DetId::rawId(), edm::second(), EcalFenixTcpFormat::setParameters(), EcalFenixStripFormatEB::setParameters(), EcalFenixAmplitudeFilter::setParameters(), EcalFenixLinearizer::setParameters(), EcalEBTriggerPrimitiveDigi::setSample(), EcalEBTriggerPrimitiveDigi::setSize(), EcalEBTriggerPrimitiveDigi::size(), edm::DataFrameContainer::size(), tcpFormat_, tcpformat_out_, theMapping_, and towerMapEB_.

109 {
110 
111  //typedef typename Coll::Digi Digi;
112  if (debug_) {
113  std::cout << " EcalEBTrigPrimTestAlgo: Testing that the algorythm with digis is well plugged " << std::endl;
114  std::cout << " EcalEBTrigPrimTestAlgo: digi size " << digi->size() << std::endl;
115  }
116 
117  uint16_t etInADC;
120  int lastSample = binOfMaximum_-1 +nrSamples_/2;
121 
122  if (debug_) {
123  std::cout << " binOfMaximum_ " << binOfMaximum_ << " nrSamples_" << nrSamples_ << std::endl;
124  std::cout << " first sample " << firstSample << " last " << lastSample <<std::endl;
125  }
126 
128  fillMap(digi,towerMapEB_);
129 
130  for(int itow=0;itow<nrTowers_;++itow) {
131 
132  int index=hitTowers_[itow].first;
133  const EcalTrigTowerDetId &thisTower=hitTowers_[itow].second;
134  if (debug_) std::cout << " Data for TOWER num " << itow << " index " << index << " TowerId " << thisTower << " size " << towerMapEB_[itow].size() << std::endl;
135  // loop over all strips assigned to this trigger tower
136  int nxstals=0;
137  for(unsigned int iStrip = 0; iStrip < towerMapEB_[itow].size();++iStrip)
138  {
139  if (debug_) std::cout << " Data for STRIP num " << iStrip << std::endl;
140  std::vector<EBDataFrame> &dataFrames = (towerMapEB_[index])[iStrip].second;//vector of dataframes for this strip, size; nr of crystals/strip
141 
142  nxstals = (towerMapEB_[index])[iStrip].first;
143  if (nxstals <= 0) continue;
144  if (debug_) std::cout << " Number of xTals " << nxstals << std::endl;
145 
146  const EcalTriggerElectronicsId elId = theMapping_->getTriggerElectronicsId(dataFrames[0].id());
147  uint32_t stripid=elId.rawId() & 0xfffffff8;
148 
149 
150  // loop over the xstals in a strip
151  for (int iXstal=0;iXstal<nxstals;iXstal++) {
152  const EBDetId & myid = dataFrames[iXstal].id();
153  tp= EcalEBTriggerPrimitiveDigi( myid );
154  tp.setSize( nrSamples_);
155 
156 
157  if(debug_){
158  std::cout<<std::endl;
159  std::cout <<"iXstal= "<<iXstal<< " id " << dataFrames[iXstal].id() << " EBDataFrame is: "<<std::endl;
160  for ( int i = 0; i<dataFrames[iXstal].size();i++){
161  std::cout <<" "<<std::dec<<dataFrames[iXstal][i].adc();
162  }
163  std::cout<<std::endl;
164  }
165  // Call the linearizer
166  this->getLinearizer(iXstal)->setParameters( dataFrames[iXstal].id().rawId(),ecaltpPed_,ecaltpLin_,ecaltpgBadX_) ;
167  this->getLinearizer(iXstal)->process( dataFrames[iXstal],lin_out_[iXstal]);
168 
169  for (unsigned int i =0; i<lin_out_[iXstal].size();i++){
170  if( (lin_out_[iXstal])[i]>0X3FFFF) (lin_out_[iXstal])[i]=0X3FFFF;
171  }
172 
173 
174  if ( debug_ ) {
175  std::cout<< "output of linearizer for channel " << iXstal << std::endl;
176  std::cout<<" lin_out[iXstal].size()= "<<std::dec<<lin_out_[iXstal].size()<<std::endl;
177  for (unsigned int i =0; i<lin_out_[iXstal].size();i++){
178  std::cout <<" "<<std::dec<<(lin_out_[iXstal])[i];
179  }
180  std::cout<<std::endl;
181  }
182 
183 
184 
185  // Call the amplitude filter
188 
189  if(debug_){
190  std::cout<< "output of filter is a vector of size: "<<std::dec<<filt_out_.size()<<std::endl;
191  for (unsigned int ix=0;ix<filt_out_.size();ix++){
192  std::cout<<std::dec<<filt_out_[ix] << " " ;
193  }
194  std::cout<<std::endl;
195  }
196 
197  // call peakfinder
199 
200  if(debug_){
201  std::cout<< "output of peakfinder is a vector of size: "<<std::dec<<peak_out_.size()<<std::endl;
202  for (unsigned int ix=0;ix<peak_out_.size();ix++){
203  std::cout<<std::dec<<peak_out_[ix] << " " ;
204  }
205  std::cout<<std::endl;
206  }
207 
208  // call formatter
209  this->getFormatterEB()->setParameters(stripid,ecaltpgSlidW_) ;
211 
212  if (debug_) {
213  std::cout<< "output of formatter is a vector of size: "<<format_out_.size()<<std::endl;
214  for (unsigned int i =0; i<format_out_.size();i++){
215  std::cout <<" "<<std::dec<<format_out_[i] << " " ;
216  }
217  std::cout<<std::endl;
218  }
219 
220 
221  // call final tcp formatter
224  // loop over the time samples and fill the TP
225  int nSam=0;
226  for (int iSample=firstSample;iSample<=lastSample;++iSample) {
227  etInADC= tcpformat_out_[iSample];
228  if (debug_) std::cout << " format_out " << tcpformat_out_[iSample] << " etInADC " << etInADC << std::endl;
229 
230  bool isASpike=false; // no spikes for now
231  int timing=0; // set to 0 value for now
232  tp.setSample(nSam, EcalEBTriggerPrimitiveSample(etInADC,isASpike,timing) );
233 
234  nSam++;
235  if (debug_) std::cout << "in TestAlgo" <<" tp size "<<tp.size() << std::endl;
236  }
237 
238 
239 
240  if (!tcpFormat_)
241  result.push_back(tp);
242  else
243  resultTcp.push_back(tp);
244 
245 
246 
247  } // Loop over the xStals
248 
249 
250 
251 
252  }//loop over strips in one tower
253 
254 
255 
256 
257  }
258 
259 
260 
261 
262  /*
263  for (unsigned int i=0;i<digi->size();i++) {
264  EBDataFrame myFrame((*digi)[i]);
265  const EBDetId & myid1 = myFrame.id();
266  tp= EcalTriggerPrimitiveDigi( myid1);
267  tp.setSize( myFrame.size());
268  int nSam=0;
269 
270  if (debug_) {
271  std::cout << " data frame size " << myFrame.size() << " Id " << myFrame.id() << std::endl;
272  std::cout << " Sample data ADC: " << std::endl;
273  for (int iSample=0; iSample<myFrame.size(); iSample++) {
274  std::cout << " " << std::dec<< myFrame.sample(iSample).adc() ;
275  }
276  std::cout<<std::endl;
277  }
278 
279 
280  this->getLinearizer(i)->setParameters( myFrame.id().rawId(),ecaltpPed_,ecaltpLin_,ecaltpgBadX_) ;
281  //this->getLinearizer(i)->process( myFrame,lin_out_[i]);
282 
283  if (debug_) {
284  std::cout<< "cryst: "<< i <<" value : "<<std::dec<<std::endl;
285  std::cout<<" lin_out[i].size()= "<<std::dec<<lin_out_[i].size()<<std::endl;
286  for (unsigned int j =0; j<lin_out_[i].size();j++){
287  std::cout <<" "<<std::dec<<(lin_out_[i])[j];
288  }
289  std::cout<<std::endl;
290  }
291 
292 
293  for (int iSample=0; iSample<myFrame.size(); iSample++) {
294  etInADC= myFrame.sample(iSample).adc();
295  EcalEBTriggerPrimitiveSample mysam(etInADC);
296  tp.setSample(nSam, mysam );
297  nSam++;
298  if (debug_) std::cout << "in TestAlgo" <<" tp size "<<tp.size() << std::endl;
299  }
300 
301  if (!tcpFormat_)
302  result.push_back(tp);
303  else
304  resultTcp.push_back(tp);
305 
306 
307  if (debug_) std::cout << " result size " << result.size() << std::endl;
308 
309 
310 
311  }
312  */
313 
314 }
void setParameters(uint32_t raw, const EcalTPGPedestals *ecaltpPed, const EcalTPGLinearizationConst *ecaltpLin, const EcalTPGCrystalStatus *ecaltpBadX)
void process(std::vector< int > &, std::vector< int > &)
std::vector< std::vector< std::pair< int, std::vector< EBDataFrame > > > > towerMapEB_
static const unsigned int nrSamples_
EcalFenixPeakFinder * getPeakFinder() const
void fillMap(Coll const *col, std::vector< std::vector< std::pair< int, std::vector< typename Coll::Digi > > > > &towerMap)
std::vector< int > format_out_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
void push_back(T const &t)
const EcalTPGSlidingWindow * ecaltpgSlidW_
EcalFenixTcpFormat * getFormatter() const
EcalFenixLinearizer * getLinearizer(int i) const
const EcalTPGSpike * ecaltpgSpike_
void setSample(int i, const EcalEBTriggerPrimitiveSample &sam)
const EcalTPGCrystalStatus * ecaltpgBadX_
EcalFenixStripFormatEB * getFormatterEB() const
U second(std::pair< T, U > const &p)
const EcalTPGLinearizationConst * ecaltpLin_
EcalTriggerElectronicsId getTriggerElectronicsId(const DetId &id) const
Get the trigger electronics id for this det id.
std::vector< std::pair< int, EcalTrigTowerDetId > > hitTowers_
EcalFenixAmplitudeFilter * getFilter() const
const EcalTPGWeightGroup * ecaltpgWeightGroup_
const EcalTPGTowerStatus * ecaltpgBadTT_
void setParameters(uint32_t towid, const EcalTPGLutGroup *ecaltpgLutGroup, const EcalTPGLutIdMap *ecaltpgLut, const EcalTPGTowerStatus *ecaltpgbadTT, const EcalTPGSpike *ecaltpgSpike)
std::vector< int > fgvb_out_temp_
std::vector< int > tcpformat_out_
void setParameters(uint32_t &, const EcalTPGSlidingWindow *&)
const EcalElectronicsMapping * theMapping_
void setParameters(uint32_t raw, const EcalTPGWeightIdMap *ecaltpgWeightMap, const EcalTPGWeightGroup *ecaltpgWeightGroup)
void clean(std::vector< std::vector< std::pair< int, std::vector< T > > > > &towerMap)
const EcalTPGPedestals * ecaltpPed_
const EcalTPGLutIdMap * ecaltpgLut_
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
const EcalTPGLutGroup * ecaltpgLutGroup_
std::vector< std::vector< int > > lin_out_
const EcalTPGWeightIdMap * ecaltpgWeightMap_
void EcalEBTrigPrimTestAlgo::setPointers ( const EcalTPGLinearizationConst ecaltpLin,
const EcalTPGPedestals ecaltpPed,
const EcalTPGCrystalStatus ecaltpgBadX,
const EcalTPGWeightIdMap ecaltpgWeightMap,
const EcalTPGWeightGroup ecaltpgWeightGroup,
const EcalTPGSlidingWindow ecaltpgSlidW,
const EcalTPGLutGroup ecaltpgLutGroup,
const EcalTPGLutIdMap ecaltpgLut,
const EcalTPGTowerStatus ecaltpgBadTT,
const EcalTPGSpike ecaltpgSpike 
)
inline

Definition at line 60 of file EcalEBTrigPrimTestAlgo.h.

References clean(), ecaltpgBadTT_, ecaltpgBadX_, ecaltpgLut_, ecaltpgLutGroup_, ecaltpgSlidW_, ecaltpgSpike_, ecaltpgWeightGroup_, ecaltpgWeightMap_, ecaltpLin_, ecaltpPed_, fillMap(), findStripNr(), init(), and initStructures().

70 {
71  ecaltpPed_=ecaltpPed;
72  ecaltpLin_=ecaltpLin;
73  ecaltpgBadX_=ecaltpgBadX;
74  ecaltpgWeightMap_=ecaltpgWeightMap;
75  ecaltpgWeightGroup_=ecaltpgWeightGroup;
76  ecaltpgSlidW_=ecaltpgSlidW;
77  ecaltpgLutGroup_=ecaltpgLutGroup;
78  ecaltpgLut_=ecaltpgLut;
79  ecaltpgBadTT_=ecaltpgBadTT;
80  ecaltpgSpike_= ecaltpgSpike;
81  }
const EcalTPGSlidingWindow * ecaltpgSlidW_
const EcalTPGSpike * ecaltpgSpike_
const EcalTPGCrystalStatus * ecaltpgBadX_
const EcalTPGLinearizationConst * ecaltpLin_
const EcalTPGWeightGroup * ecaltpgWeightGroup_
const EcalTPGTowerStatus * ecaltpgBadTT_
const EcalTPGPedestals * ecaltpPed_
const EcalTPGLutIdMap * ecaltpgLut_
const EcalTPGLutGroup * ecaltpgLutGroup_
const EcalTPGWeightIdMap * ecaltpgWeightMap_

Member Data Documentation

EcalFenixAmplitudeFilter* EcalEBTrigPrimTestAlgo::amplitude_filter_
private

Definition at line 142 of file EcalEBTrigPrimTestAlgo.h.

Referenced by getFilter(), init(), and ~EcalEBTrigPrimTestAlgo().

bool EcalEBTrigPrimTestAlgo::barrelOnly_
private

Definition at line 117 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init().

int EcalEBTrigPrimTestAlgo::binOfMaximum_
private

Definition at line 112 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

bool EcalEBTrigPrimTestAlgo::debug_
private

Definition at line 118 of file EcalEBTrigPrimTestAlgo.h.

Referenced by fillMap(), init(), and run().

const EcalTPGTowerStatus* EcalEBTrigPrimTestAlgo::ecaltpgBadTT_
private

Definition at line 156 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

const EcalTPGCrystalStatus* EcalEBTrigPrimTestAlgo::ecaltpgBadX_
private

Definition at line 150 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

const EcalTPGLutIdMap* EcalEBTrigPrimTestAlgo::ecaltpgLut_
private

Definition at line 155 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

const EcalTPGLutGroup* EcalEBTrigPrimTestAlgo::ecaltpgLutGroup_
private

Definition at line 154 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

const EcalTPGSlidingWindow* EcalEBTrigPrimTestAlgo::ecaltpgSlidW_
private

Definition at line 153 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

const EcalTPGSpike* EcalEBTrigPrimTestAlgo::ecaltpgSpike_
private

Definition at line 157 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

const EcalTPGWeightGroup* EcalEBTrigPrimTestAlgo::ecaltpgWeightGroup_
private

Definition at line 152 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

const EcalTPGWeightIdMap* EcalEBTrigPrimTestAlgo::ecaltpgWeightMap_
private

Definition at line 151 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

const EcalTPGLinearizationConst* EcalEBTrigPrimTestAlgo::ecaltpLin_
private

Definition at line 149 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

const EcalTPGPedestals* EcalEBTrigPrimTestAlgo::ecaltpPed_
private

Definition at line 148 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

edm::ESHandle<EcalTrigTowerConstituentsMap> EcalEBTrigPrimTestAlgo::eTTmap_
private

Definition at line 105 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init().

bool EcalEBTrigPrimTestAlgo::famos_
private

Definition at line 119 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init().

EcalFenixStripFormatEB* EcalEBTrigPrimTestAlgo::fenixFormatterEB_
private

Definition at line 144 of file EcalEBTrigPrimTestAlgo.h.

Referenced by getFormatterEB(), init(), and ~EcalEBTrigPrimTestAlgo().

EcalFenixTcpFormat* EcalEBTrigPrimTestAlgo::fenixTcpFormat_
private

Definition at line 145 of file EcalEBTrigPrimTestAlgo.h.

Referenced by getFormatter(), init(), and ~EcalEBTrigPrimTestAlgo().

std::vector<int> EcalEBTrigPrimTestAlgo::fgvb_out_
private

Definition at line 168 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

std::vector<int> EcalEBTrigPrimTestAlgo::fgvb_out_temp_
private

Definition at line 169 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

std::vector<int> EcalEBTrigPrimTestAlgo::filt_out_
private

Definition at line 164 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

std::vector<int> EcalEBTrigPrimTestAlgo::format_out_
private

Definition at line 166 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

std::vector<std::pair<int,EcalTrigTowerDetId> > EcalEBTrigPrimTestAlgo::hitTowers_
private

Definition at line 131 of file EcalEBTrigPrimTestAlgo.h.

Referenced by fillMap(), init(), and run().

std::vector<std::vector<int> > EcalEBTrigPrimTestAlgo::lin_out_
private

Definition at line 161 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

std::vector<EcalFenixLinearizer *> EcalEBTrigPrimTestAlgo::linearizer_
private

Definition at line 141 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and ~EcalEBTrigPrimTestAlgo().

int EcalEBTrigPrimTestAlgo::maxNrSamples_
private

Definition at line 113 of file EcalEBTrigPrimTestAlgo.h.

Referenced by EcalEBTrigPrimTestAlgo(), init(), and initStructures().

const unsigned int EcalEBTrigPrimTestAlgo::maxNrSamplesOut_ =10
staticprivate

Definition at line 124 of file EcalEBTrigPrimTestAlgo.h.

const unsigned int EcalEBTrigPrimTestAlgo::maxNrTowers_ =2448
staticprivate

Definition at line 123 of file EcalEBTrigPrimTestAlgo.h.

Referenced by clean(), init(), and initStructures().

const unsigned int EcalEBTrigPrimTestAlgo::nrSamples_ =5
staticprivate

Definition at line 125 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run().

int EcalEBTrigPrimTestAlgo::nrTowers_
private

Definition at line 122 of file EcalEBTrigPrimTestAlgo.h.

Referenced by fillMap(), and run().

int EcalEBTrigPrimTestAlgo::nSamples_
private

Definition at line 111 of file EcalEBTrigPrimTestAlgo.h.

EcalFenixPeakFinder* EcalEBTrigPrimTestAlgo::peak_finder_
private

Definition at line 143 of file EcalEBTrigPrimTestAlgo.h.

Referenced by getPeakFinder(), init(), and ~EcalEBTrigPrimTestAlgo().

std::vector<int> EcalEBTrigPrimTestAlgo::peak_out_
private

Definition at line 165 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

std::vector<std::vector<int> > EcalEBTrigPrimTestAlgo::striptp_
private

Definition at line 128 of file EcalEBTrigPrimTestAlgo.h.

Referenced by initStructures().

bool EcalEBTrigPrimTestAlgo::tcpFormat_
private

Definition at line 116 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

std::vector<int> EcalEBTrigPrimTestAlgo::tcpformat_out_
private

Definition at line 176 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

edm::ESHandle<CaloGeometry> EcalEBTrigPrimTestAlgo::theGeometry
private

Definition at line 107 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init().

const EcalElectronicsMapping* EcalEBTrigPrimTestAlgo::theMapping_
private

Definition at line 138 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run().

float EcalEBTrigPrimTestAlgo::threshold
private

Definition at line 110 of file EcalEBTrigPrimTestAlgo.h.

Referenced by utils.StatisticalTest::get_status().

std::vector<std::vector<std::pair<int,std::vector<EBDataFrame> > > > EcalEBTrigPrimTestAlgo::towerMapEB_
private

Definition at line 129 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

std::vector<std::vector<std::pair<int,std::vector<EEDataFrame> > > > EcalEBTrigPrimTestAlgo::towerMapEE_
private

Definition at line 130 of file EcalEBTrigPrimTestAlgo.h.

std::vector<EcalEBTriggerPrimitiveSample> EcalEBTrigPrimTestAlgo::towtp2_
private

Definition at line 133 of file EcalEBTrigPrimTestAlgo.h.

std::vector<EcalEBTriggerPrimitiveSample> EcalEBTrigPrimTestAlgo::towtp_
private

Definition at line 132 of file EcalEBTrigPrimTestAlgo.h.