CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
< EcalTrigTowerConstituentsMap
eTTmap_
 
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
< EcalTriggerPrimitiveSample
towtp2_
 
std::vector
< EcalTriggerPrimitiveSample
towtp_
 

Static Private Attributes

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

Detailed Description

forPhase II As of now we do not know yet how the electronics would look like so for now we build some machinery to produce TPs which are taken from the RecHits

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

Definition at line 47 of file EcalEBTrigPrimTestAlgo.h.

Member Enumeration Documentation

anonymous enum
private
Enumerator
nbMaxStrips_ 

Definition at line 134 of file EcalEBTrigPrimTestAlgo.h.

anonymous enum
private
Enumerator
nbMaxXtals_ 

Definition at line 135 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_, 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 }
int i
Definition: DBlmapReader.cc:9
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 183 of file EcalEBTrigPrimTestAlgo.h.

References i, j, maxNrTowers_, and nbMaxStrips_.

Referenced by run().

183  {
184  // clean internal data structures
185  for (unsigned int i=0;i<maxNrTowers_;++i)
186  for (int j=0;j<nbMaxStrips_ ;++j) (towMap[i])[j].first=0;
187  return;
188 }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
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 192 of file EcalEBTrigPrimTestAlgo.h.

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

Referenced by run().

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

Definition at line 399 of file EcalEBTrigPrimTestAlgo.cc.

References gen::n, and nbMaxStrips_.

Referenced by fillMap().

399  {
400  int stripnr;
401  int n=((id.ic()-1)%100)/20; //20 corresponds to 4 * ecal_barrel_crystals_per_strip FIXME!!
402  if (id.ieta()<0) stripnr = n+1;
403  else stripnr =nbMaxStrips_ - n;
404  return stripnr;
405 }
int EcalEBTrigPrimTestAlgo::findStripNr ( const EEDetId id)
private
EcalFenixAmplitudeFilter* EcalEBTrigPrimTestAlgo::getFilter ( ) const
inlineprivate

Definition at line 162 of file EcalEBTrigPrimTestAlgo.h.

References amplitude_filter_.

Referenced by run().

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

Definition at line 174 of file EcalEBTrigPrimTestAlgo.h.

References fenixTcpFormat_.

Referenced by run().

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

Definition at line 172 of file EcalEBTrigPrimTestAlgo.h.

References fenixFormatterEB_.

Referenced by run().

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

Definition at line 96 of file EcalEBTrigPrimTestAlgo.h.

Referenced by fillMap().

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

Definition at line 98 of file EcalEBTrigPrimTestAlgo.h.

References ecaldqm::zside().

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

Definition at line 159 of file EcalEBTrigPrimTestAlgo.h.

References i, and linearizer_.

Referenced by run().

159 { return linearizer_[i];}
int i
Definition: DBlmapReader.cc:9
std::vector< EcalFenixLinearizer * > linearizer_
EcalFenixPeakFinder* EcalEBTrigPrimTestAlgo::getPeakFinder ( ) const
inlineprivate

Definition at line 171 of file EcalEBTrigPrimTestAlgo.h.

References peak_finder_.

Referenced by run().

171 { 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_, i, initStructures(), lin_out_, linearizer_, maxNrSamples_, maxNrTowers_, nbMaxXtals_, peak_finder_, peak_out_, tcpFormat_, tcpformat_out_, theGeometry, towerMapEB_, and findQualityFiles::v.

Referenced by EcalEBTrigPrimTestAlgo().

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 }
int i
Definition: DBlmapReader.cc:9
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
const T & get() const
Definition: EventSetup.h:56
static const unsigned int maxNrTowers_
std::vector< int > fgvb_out_temp_
edm::ESHandle< EcalTrigTowerConstituentsMap > eTTmap_
std::vector< int > tcpformat_out_
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 232 of file EcalEBTrigPrimTestAlgo.h.

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

Referenced by init().

232  {
233  //initialise internal data structures
234 
235  std::vector <T> vec0(nbMaxXtals_ );
236  std::vector<std::pair<int,std::vector<T> > > vec1(nbMaxStrips_);
237  for (int i=0;i<nbMaxStrips_ ;++i) vec1[i]=std::pair<int,std::vector<T> >(0,vec0);
238  towMap.resize(maxNrTowers_);
239  for (unsigned int i=0;i<maxNrTowers_;++i) towMap[i]=vec1;
240 
241  std::vector<int> vecint(maxNrSamples_);
242  striptp_.resize(nbMaxStrips_);
243  for (int i=0;i<nbMaxStrips_;++i) striptp_[i]=vecint;
244 
245 }
int i
Definition: DBlmapReader.cc:9
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 setup,
const EBDigiCollection col,
EcalEBTrigPrimDigiCollection result,
EcalEBTrigPrimDigiCollection resultTcp 
)

Definition at line 180 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, castor_dqm_sourceclient_file_cfg::firstSample, format_out_, getFilter(), getFormatter(), getFormatterEB(), getLinearizer(), getPeakFinder(), EcalElectronicsMapping::getTriggerElectronicsId(), hitTowers_, i, cmsHarvester::index, castor_dqm_sourceclient_file_cfg::lastSample, lin_out_, nrSamples_, nrTowers_, peak_out_, EcalFenixPeakFinder::process(), EcalFenixAmplitudeFilter::process(), EcalFenixTcpFormat::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_.

184 {
185 
186  //typedef typename Coll::Digi Digi;
187  if (debug_) {
188  std::cout << " EcalEBTrigPrimTestAlgo: Testing that the algorythm with digis is well plugged " << std::endl;
189  std::cout << " EcalEBTrigPrimTestAlgo: digi size " << digi->size() << std::endl;
190  }
191 
192  uint16_t etInADC;
196 
197  if (debug_) {
198  std::cout << " binOfMaximum_ " << binOfMaximum_ << " nrSamples_" << nrSamples_ << std::endl;
199  std::cout << " first sample " << firstSample << " last " << lastSample <<std::endl;
200  }
201 
203  fillMap(digi,towerMapEB_);
204 
205  for(int itow=0;itow<nrTowers_;++itow) {
206 
207  int index=hitTowers_[itow].first;
208  const EcalTrigTowerDetId &thisTower=hitTowers_[itow].second;
209  if (debug_) std::cout << " Data for TOWER num " << itow << " index " << index << " TowerId " << thisTower << " size " << towerMapEB_[itow].size() << std::endl;
210  // loop over all strips assigned to this trigger tower
211  int nxstals=0;
212  for(unsigned int iStrip = 0; iStrip < towerMapEB_[itow].size();++iStrip)
213  {
214  if (debug_) std::cout << " Data for STRIP num " << iStrip << std::endl;
215  std::vector<EBDataFrame> &dataFrames = (towerMapEB_[index])[iStrip].second;//vector of dataframes for this strip, size; nr of crystals/strip
216 
217  nxstals = (towerMapEB_[index])[iStrip].first;
218  if (nxstals <= 0) continue;
219  if (debug_) std::cout << " Number of xTals " << nxstals << std::endl;
220 
221  const EcalTriggerElectronicsId elId = theMapping_->getTriggerElectronicsId(dataFrames[0].id());
222  uint32_t stripid=elId.rawId() & 0xfffffff8;
223 
224 
225  // loop over the xstals in a strip
226  for (int iXstal=0;iXstal<nxstals;iXstal++) {
227  const EBDetId & myid = dataFrames[iXstal].id();
228  tp= EcalEBTriggerPrimitiveDigi( myid );
229  tp.setSize( nrSamples_);
230 
231 
232  if(debug_){
233  std::cout<<std::endl;
234  std::cout <<"iXstal= "<<iXstal<< " id " << dataFrames[iXstal].id() << " EBDataFrame is: "<<std::endl;
235  for ( int i = 0; i<dataFrames[iXstal].size();i++){
236  std::cout <<" "<<std::dec<<dataFrames[iXstal][i].adc();
237  }
238  std::cout<<std::endl;
239  }
240  // Call the linearizer
241  this->getLinearizer(iXstal)->setParameters( dataFrames[iXstal].id().rawId(),ecaltpPed_,ecaltpLin_,ecaltpgBadX_) ;
242  this->getLinearizer(iXstal)->process( dataFrames[iXstal],lin_out_[iXstal]);
243 
244  for (unsigned int i =0; i<lin_out_[iXstal].size();i++){
245  if( (lin_out_[iXstal])[i]>0X3FFFF) (lin_out_[iXstal])[i]=0X3FFFF;
246  }
247 
248 
249  if ( debug_ ) {
250  std::cout<< "output of linearizer for channel " << iXstal << std::endl;
251  std::cout<<" lin_out[iXstal].size()= "<<std::dec<<lin_out_[iXstal].size()<<std::endl;
252  for (unsigned int i =0; i<lin_out_[iXstal].size();i++){
253  std::cout <<" "<<std::dec<<(lin_out_[iXstal])[i];
254  }
255  std::cout<<std::endl;
256  }
257 
258 
259 
260  // Call the amplitude filter
263 
264  if(debug_){
265  std::cout<< "output of filter is a vector of size: "<<std::dec<<filt_out_.size()<<std::endl;
266  for (unsigned int ix=0;ix<filt_out_.size();ix++){
267  std::cout<<std::dec<<filt_out_[ix] << " " ;
268  }
269  std::cout<<std::endl;
270  }
271 
272  // call peakfinder
274 
275  if(debug_){
276  std::cout<< "output of peakfinder is a vector of size: "<<std::dec<<peak_out_.size()<<std::endl;
277  for (unsigned int ix=0;ix<peak_out_.size();ix++){
278  std::cout<<std::dec<<peak_out_[ix] << " " ;
279  }
280  std::cout<<std::endl;
281  }
282 
283  // call formatter
284  this->getFormatterEB()->setParameters(stripid,ecaltpgSlidW_) ;
286 
287  if (debug_) {
288  std::cout<< "output of formatter is a vector of size: "<<format_out_.size()<<std::endl;
289  for (unsigned int i =0; i<format_out_.size();i++){
290  std::cout <<" "<<std::dec<<format_out_[i] << " " ;
291  }
292  std::cout<<std::endl;
293  }
294 
295 
296  // call final tcp formatter
299 
300  // loop over the time samples and fill the TP
301  int nSam=0;
302  for (int iSample=firstSample;iSample<=lastSample;++iSample) {
303  etInADC= tcpformat_out_[iSample];
304  if (debug_) std::cout << " format_out " << tcpformat_out_[iSample] << " etInADC " << etInADC << std::endl;
305  // EcalTriggerPrimitiveSample mysam(etInADC);
306  //tp.setSample(nSam, mysam );
307 
308  tp.setSample(nSam, EcalTriggerPrimitiveSample(etInADC, false, 0) );
309 
310  nSam++;
311  if (debug_) std::cout << "in TestAlgo" <<" tp size "<<tp.size() << std::endl;
312  }
313 
314 
315 
316  if (!tcpFormat_)
317  result.push_back(tp);
318  else
319  resultTcp.push_back(tp);
320 
321 
322 
323  } // Loop over the xStals
324 
325 
326 
327 
328  }//loop over strips in one tower
329 
330 
331 
332 
333  }
334 
335 
336 
337 
338  /*
339  for (unsigned int i=0;i<digi->size();i++) {
340  EBDataFrame myFrame((*digi)[i]);
341  const EBDetId & myid1 = myFrame.id();
342  tp= EcalTriggerPrimitiveDigi( myid1);
343  tp.setSize( myFrame.size());
344  int nSam=0;
345 
346  if (debug_) {
347  std::cout << " data frame size " << myFrame.size() << " Id " << myFrame.id() << std::endl;
348  std::cout << " Sample data ADC: " << std::endl;
349  for (int iSample=0; iSample<myFrame.size(); iSample++) {
350  std::cout << " " << std::dec<< myFrame.sample(iSample).adc() ;
351  }
352  std::cout<<std::endl;
353  }
354 
355 
356  this->getLinearizer(i)->setParameters( myFrame.id().rawId(),ecaltpPed_,ecaltpLin_,ecaltpgBadX_) ;
357  //this->getLinearizer(i)->process( myFrame,lin_out_[i]);
358 
359  if (debug_) {
360  std::cout<< "cryst: "<< i <<" value : "<<std::dec<<std::endl;
361  std::cout<<" lin_out[i].size()= "<<std::dec<<lin_out_[i].size()<<std::endl;
362  for (unsigned int j =0; j<lin_out_[i].size();j++){
363  std::cout <<" "<<std::dec<<(lin_out_[i])[j];
364  }
365  std::cout<<std::endl;
366  }
367 
368 
369  for (int iSample=0; iSample<myFrame.size(); iSample++) {
370  etInADC= myFrame.sample(iSample).adc();
371  EcalTriggerPrimitiveSample mysam(etInADC);
372  tp.setSample(nSam, mysam );
373  nSam++;
374  if (debug_) std::cout << "in TestAlgo" <<" tp size "<<tp.size() << std::endl;
375  }
376 
377  if (!tcpFormat_)
378  result.push_back(tp);
379  else
380  resultTcp.push_back(tp);
381 
382 
383  if (debug_) std::cout << " result size " << result.size() << std::endl;
384 
385 
386 
387  }
388  */
389 
390 }
int i
Definition: DBlmapReader.cc:9
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_
void push_back(T const &t)
const EcalTPGSlidingWindow * ecaltpgSlidW_
EcalFenixTcpFormat * getFormatter() const
EcalFenixLinearizer * getLinearizer(int i) const
const EcalTPGSpike * ecaltpgSpike_
const EcalTPGCrystalStatus * ecaltpgBadX_
EcalFenixStripFormatEB * getFormatterEB() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
U second(std::pair< T, U > const &p)
const EcalTPGLinearizationConst * ecaltpLin_
void setSample(int i, const EcalTriggerPrimitiveSample &sam)
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)
tuple cout
Definition: gather_cfg.py:145
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 59 of file EcalEBTrigPrimTestAlgo.h.

References ecaltpgBadTT_, ecaltpgBadX_, ecaltpgLut_, ecaltpgLutGroup_, ecaltpgSlidW_, ecaltpgSpike_, ecaltpgWeightGroup_, ecaltpgWeightMap_, ecaltpLin_, and ecaltpPed_.

69 {
70  ecaltpPed_=ecaltpPed;
71  ecaltpLin_=ecaltpLin;
72  ecaltpgBadX_=ecaltpgBadX;
73  ecaltpgWeightMap_=ecaltpgWeightMap;
74  ecaltpgWeightGroup_=ecaltpgWeightGroup;
75  ecaltpgSlidW_=ecaltpgSlidW;
76  ecaltpgLutGroup_=ecaltpgLutGroup;
77  ecaltpgLut_=ecaltpgLut;
78  ecaltpgBadTT_=ecaltpgBadTT;
79  ecaltpgSpike_= ecaltpgSpike;
80  }
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 141 of file EcalEBTrigPrimTestAlgo.h.

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

bool EcalEBTrigPrimTestAlgo::barrelOnly_
private

Definition at line 116 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init().

int EcalEBTrigPrimTestAlgo::binOfMaximum_
private

Definition at line 111 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

bool EcalEBTrigPrimTestAlgo::debug_
private

Definition at line 117 of file EcalEBTrigPrimTestAlgo.h.

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

const EcalTPGTowerStatus* EcalEBTrigPrimTestAlgo::ecaltpgBadTT_
private

Definition at line 155 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

const EcalTPGCrystalStatus* EcalEBTrigPrimTestAlgo::ecaltpgBadX_
private

Definition at line 149 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

const EcalTPGLutIdMap* EcalEBTrigPrimTestAlgo::ecaltpgLut_
private

Definition at line 154 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

const EcalTPGLutGroup* EcalEBTrigPrimTestAlgo::ecaltpgLutGroup_
private

Definition at line 153 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

const EcalTPGSlidingWindow* EcalEBTrigPrimTestAlgo::ecaltpgSlidW_
private

Definition at line 152 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

const EcalTPGSpike* EcalEBTrigPrimTestAlgo::ecaltpgSpike_
private

Definition at line 156 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

const EcalTPGWeightGroup* EcalEBTrigPrimTestAlgo::ecaltpgWeightGroup_
private

Definition at line 151 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

const EcalTPGWeightIdMap* EcalEBTrigPrimTestAlgo::ecaltpgWeightMap_
private

Definition at line 150 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

const EcalTPGLinearizationConst* EcalEBTrigPrimTestAlgo::ecaltpLin_
private

Definition at line 148 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

const EcalTPGPedestals* EcalEBTrigPrimTestAlgo::ecaltpPed_
private

Definition at line 147 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

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

Definition at line 104 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init().

bool EcalEBTrigPrimTestAlgo::famos_
private

Definition at line 118 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init().

EcalFenixStripFormatEB* EcalEBTrigPrimTestAlgo::fenixFormatterEB_
private

Definition at line 143 of file EcalEBTrigPrimTestAlgo.h.

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

EcalFenixTcpFormat* EcalEBTrigPrimTestAlgo::fenixTcpFormat_
private

Definition at line 144 of file EcalEBTrigPrimTestAlgo.h.

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

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

Definition at line 167 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

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

Definition at line 168 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

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

Definition at line 163 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

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

Definition at line 165 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

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

Definition at line 130 of file EcalEBTrigPrimTestAlgo.h.

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

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

Definition at line 160 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

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

Definition at line 140 of file EcalEBTrigPrimTestAlgo.h.

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

int EcalEBTrigPrimTestAlgo::maxNrSamples_
private

Definition at line 112 of file EcalEBTrigPrimTestAlgo.h.

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

const unsigned int EcalEBTrigPrimTestAlgo::maxNrSamplesOut_ =10
staticprivate

Definition at line 123 of file EcalEBTrigPrimTestAlgo.h.

const unsigned int EcalEBTrigPrimTestAlgo::maxNrTowers_ =2448
staticprivate

Definition at line 122 of file EcalEBTrigPrimTestAlgo.h.

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

const unsigned int EcalEBTrigPrimTestAlgo::nrSamples_ =5
staticprivate

Definition at line 124 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run().

int EcalEBTrigPrimTestAlgo::nrTowers_
private

Definition at line 121 of file EcalEBTrigPrimTestAlgo.h.

Referenced by fillMap(), and run().

int EcalEBTrigPrimTestAlgo::nSamples_
private

Definition at line 110 of file EcalEBTrigPrimTestAlgo.h.

EcalFenixPeakFinder* EcalEBTrigPrimTestAlgo::peak_finder_
private

Definition at line 142 of file EcalEBTrigPrimTestAlgo.h.

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

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

Definition at line 164 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

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

Definition at line 127 of file EcalEBTrigPrimTestAlgo.h.

Referenced by initStructures().

bool EcalEBTrigPrimTestAlgo::tcpFormat_
private

Definition at line 115 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

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

Definition at line 175 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

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

Definition at line 106 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init().

const EcalElectronicsMapping* EcalEBTrigPrimTestAlgo::theMapping_
private

Definition at line 137 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run().

float EcalEBTrigPrimTestAlgo::threshold
private

Definition at line 109 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 128 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 129 of file EcalEBTrigPrimTestAlgo.h.

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

Definition at line 132 of file EcalEBTrigPrimTestAlgo.h.

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

Definition at line 131 of file EcalEBTrigPrimTestAlgo.h.