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 EcalTrigTowerConstituentsMap *eTTmap, const CaloGeometry *theGeometry, int nSamples, int binofmax, bool tcpFormat, bool debug, bool famos)
 
 EcalEBTrigPrimTestAlgo (int nSamples, int binofmax, bool tcpFormat, bool debug, bool famos)
 
void run (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)
 
EcalEBFenixAmplitudeFiltergetFilter () const
 
EcalEBFenixTcpFormatgetFormatter () const
 
EcalEBFenixStripFormatEBgetFormatterEB () const
 
int getIndex (const EBDigiCollection *, EcalTrigTowerDetId &id)
 
int getIndex (const EEDigiCollection *, EcalTrigTowerDetId &id)
 
EcalEBFenixLinearizergetLinearizer (int i) const
 
EcalEBFenixPeakFindergetPeakFinder () const
 
void init ()
 
template<class T >
void initStructures (std::vector< std::vector< std::pair< int, std::vector< T > > > > &towMap)
 

Private Attributes

EcalEBFenixAmplitudeFilteramplitude_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_
 
const EcalTrigTowerConstituentsMapeTTmap_ = nullptr
 
bool famos_
 
EcalEBFenixStripFormatEBfenixFormatterEB_
 
EcalEBFenixTcpFormatfenixTcpFormat_
 
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< EcalEBFenixLinearizer * > linearizer_
 
int maxNrSamples_
 
int nrTowers_
 
int nSamples_
 
EcalEBFenixPeakFinderpeak_finder_
 
std::vector< int > peak_out_
 
std::vector< std::vector< int > > striptp_
 
bool tcpFormat_
 
std::vector< int > tcpformat_out_
 
const CaloGeometrytheGeometry_ = nullptr
 
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 37 of file EcalEBTrigPrimTestAlgo.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
nbMaxStrips_ 

Definition at line 124 of file EcalEBTrigPrimTestAlgo.h.

◆ anonymous enum

anonymous enum
private
Enumerator
nbMaxXtals_ 

Definition at line 125 of file EcalEBTrigPrimTestAlgo.h.

Constructor & Destructor Documentation

◆ EcalEBTrigPrimTestAlgo() [1/2]

EcalEBTrigPrimTestAlgo::EcalEBTrigPrimTestAlgo ( const EcalTrigTowerConstituentsMap eTTmap,
const CaloGeometry theGeometry,
int  nSamples,
int  binofmax,
bool  tcpFormat,
bool  debug,
bool  famos 
)
explicit

Definition at line 43 of file EcalEBTrigPrimTestAlgo.cc.

References init(), and maxNrSamples_.

50  : eTTmap_(eTTmap),
51  theGeometry_(theGeometry),
52  nSamples_(nSam),
53  binOfMaximum_(binofmax),
54  tcpFormat_(tcpFormat),
55  barrelOnly_(false),
56  debug_(debug),
57  famos_(famos) {
58  maxNrSamples_ = 10;
59  this->init();
60 }
const CaloGeometry * theGeometry_
const EcalTrigTowerConstituentsMap * eTTmap_
#define debug
Definition: HDRShower.cc:19

◆ EcalEBTrigPrimTestAlgo() [2/2]

EcalEBTrigPrimTestAlgo::EcalEBTrigPrimTestAlgo ( int  nSamples,
int  binofmax,
bool  tcpFormat,
bool  debug,
bool  famos 
)
explicit

◆ ~EcalEBTrigPrimTestAlgo()

EcalEBTrigPrimTestAlgo::~EcalEBTrigPrimTestAlgo ( )
virtual

Definition at line 110 of file EcalEBTrigPrimTestAlgo.cc.

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

110  {
111  for (int i = 0; i < nbMaxXtals_; i++)
112  delete linearizer_[i];
113  delete amplitude_filter_;
114  delete peak_finder_;
115  delete fenixFormatterEB_;
116  delete fenixTcpFormat_;
117  delete theMapping_;
118 }
EcalEBFenixAmplitudeFilter * amplitude_filter_
EcalEBFenixPeakFinder * peak_finder_
EcalEBFenixStripFormatEB * fenixFormatterEB_
const EcalElectronicsMapping * theMapping_
EcalEBFenixTcpFormat * fenixTcpFormat_
std::vector< EcalEBFenixLinearizer * > linearizer_

Member Function Documentation

◆ clean()

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

Definition at line 167 of file EcalEBTrigPrimTestAlgo.h.

References mps_fire::i, dqmiolumiharvest::j, maxNrTowers_, and nbMaxStrips_.

Referenced by run().

167  {
168  // clean internal data structures
169  for (unsigned int i = 0; i < maxNrTowers_; ++i)
170  for (int j = 0; j < nbMaxStrips_; ++j)
171  (towMap[i])[j].first = 0;
172  return;
173 }
static const unsigned int maxNrTowers_

◆ fillMap()

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 176 of file EcalEBTrigPrimTestAlgo.h.

References EcalTrigTowerConstituentsMap::barrelTowerOf(), cuy::col, gather_cfg::cout, debug_, TrendClient_cfi::Digi, eTTmap_, findStripNr(), dqmdumpme::first, getIndex(), hitTowers_, mps_fire::i, nbMaxXtals_, nrTowers_, EgammaValidation_cff::samples, edm::second(), and EcalTrigTowerConstituentsMap::towerOf().

Referenced by run().

177  {
178  typedef typename Coll::Digi Digi;
179 
180  // implementation for Barrel
181  if (col) {
182  nrTowers_ = 0;
183  if (debug_)
184  std::cout << "Fill mapping, Collection size = " << col->size() << std::endl;
185  ;
186  for (unsigned int i = 0; i < col->size(); ++i) {
187  Digi samples((*col)[i]);
188  EcalTrigTowerDetId coarser =
190  int index = getIndex(col, coarser);
191  int stripnr = findStripNr(samples.id());
192 
193  int filled = 0;
194  for (unsigned int ij = 0; ij < towerMap[index].size(); ++ij)
195  filled += towerMap[index][ij].first;
196  if (!filled) {
197  hitTowers_[nrTowers_++] = std::pair<int, EcalTrigTowerDetId>(index, coarser);
198  }
199 
200  //FIXME: temporary protection
201  int ncryst = towerMap[index][stripnr - 1].first;
202  if (ncryst >= nbMaxXtals_) {
203  edm::LogError("EcalTrigPrimFunctionAlgo")
204  << "! Too many xtals for TT " << coarser << " stripnr " << stripnr << " xtalid " << samples.id();
205  continue;
206  }
207  ((towerMap[index])[stripnr - 1].second)[ncryst] = samples;
208  (towerMap[index])[stripnr - 1].first++;
209  }
210 
211  if (debug_)
212  std::cout << "fillMap"
213  << "[EcalTrigPrimFunctionalAlgo] (found " << col->size() << " frames in " << towerMap.size()
214  << " towers) " << std::endl;
215  } else {
216  if (debug_)
217  std::cout << "FillMap - FillMap Collection size=0 !!!!" << std::endl;
218  ;
219  }
220 }
Log< level::Error, false > LogError
EcalTrigTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
U second(std::pair< T, U > const &p)
std::vector< std::pair< int, EcalTrigTowerDetId > > hitTowers_
const EcalTrigTowerConstituentsMap * eTTmap_
int getIndex(const EBDigiCollection *, EcalTrigTowerDetId &id)
int findStripNr(const EBDetId &id)
col
Definition: cuy.py:1009
static EcalTrigTowerDetId barrelTowerOf(const DetId &id)

◆ findStripNr() [1/2]

int EcalEBTrigPrimTestAlgo::findStripNr ( const EBDetId id)
private

Definition at line 319 of file EcalEBTrigPrimTestAlgo.cc.

References hcalRecHitTable_cff::ieta, dqmiodumpmetadata::n, and nbMaxStrips_.

Referenced by fillMap().

319  {
320  int stripnr;
321  int n = ((id.ic() - 1) % 100) / 20; //20 corresponds to 4 * ecal_barrel_crystals_per_strip FIXME!!
322  if (id.ieta() < 0)
323  stripnr = n + 1;
324  else
325  stripnr = nbMaxStrips_ - n;
326  return stripnr;
327 }

◆ findStripNr() [2/2]

int EcalEBTrigPrimTestAlgo::findStripNr ( const EEDetId id)
private

◆ getFilter()

EcalEBFenixAmplitudeFilter* EcalEBTrigPrimTestAlgo::getFilter ( ) const
inlineprivate

Definition at line 150 of file EcalEBTrigPrimTestAlgo.h.

References amplitude_filter_.

Referenced by run().

150 { return amplitude_filter_; }
EcalEBFenixAmplitudeFilter * amplitude_filter_

◆ getFormatter()

EcalEBFenixTcpFormat* EcalEBTrigPrimTestAlgo::getFormatter ( ) const
inlineprivate

Definition at line 162 of file EcalEBTrigPrimTestAlgo.h.

References fenixTcpFormat_.

Referenced by run().

162 { return fenixTcpFormat_; }
EcalEBFenixTcpFormat * fenixTcpFormat_

◆ getFormatterEB()

EcalEBFenixStripFormatEB* EcalEBTrigPrimTestAlgo::getFormatterEB ( ) const
inlineprivate

Definition at line 160 of file EcalEBTrigPrimTestAlgo.h.

References fenixFormatterEB_.

Referenced by run().

160 { return fenixFormatterEB_; }
EcalEBFenixStripFormatEB * fenixFormatterEB_

◆ getIndex() [1/2]

int EcalEBTrigPrimTestAlgo::getIndex ( const EBDigiCollection ,
EcalTrigTowerDetId id 
)
inlineprivate

Definition at line 89 of file EcalEBTrigPrimTestAlgo.h.

Referenced by fillMap().

89 { return id.hashedIndex(); }

◆ getIndex() [2/2]

int EcalEBTrigPrimTestAlgo::getIndex ( const EEDigiCollection ,
EcalTrigTowerDetId id 
)
inlineprivate

Definition at line 91 of file EcalEBTrigPrimTestAlgo.h.

References hcalRecHitTable_cff::iphi, and ecaldqm::zside().

91  {
92  int ind = (id.ietaAbs() - 18) * 72 + id.iphi();
93  if (id.zside() < 0)
94  ind += 792;
95  return ind;
96  }
int zside(DetId const &)

◆ getLinearizer()

EcalEBFenixLinearizer* EcalEBTrigPrimTestAlgo::getLinearizer ( int  i) const
inlineprivate

Definition at line 147 of file EcalEBTrigPrimTestAlgo.h.

References mps_fire::i, and linearizer_.

Referenced by run().

147 { return linearizer_[i]; }
std::vector< EcalEBFenixLinearizer * > linearizer_

◆ getPeakFinder()

EcalEBFenixPeakFinder* EcalEBTrigPrimTestAlgo::getPeakFinder ( ) const
inlineprivate

Definition at line 159 of file EcalEBTrigPrimTestAlgo.h.

References peak_finder_.

Referenced by run().

159 { return peak_finder_; }
EcalEBFenixPeakFinder * peak_finder_

◆ init()

void EcalEBTrigPrimTestAlgo::init ( void  )
private

Definition at line 77 of file EcalEBTrigPrimTestAlgo.cc.

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

Referenced by EcalEBTrigPrimTestAlgo().

77  {
78  // initialise data structures
81  hitTowers_.resize(maxNrTowers_);
82 
83  linearizer_.resize(nbMaxXtals_);
84  for (int i = 0; i < nbMaxXtals_; i++)
86 
87  //
88  std::vector<int> v;
89  v.resize(maxNrSamples_);
90  lin_out_.resize(nbMaxXtals_);
91  for (int i = 0; i < 5; i++)
92  lin_out_[i] = v;
93  //
95  filt_out_.resize(maxNrSamples_);
96  peak_out_.resize(maxNrSamples_);
97  // these two are dummy
98  fgvb_out_.resize(maxNrSamples_);
100  //
103  format_out_.resize(maxNrSamples_);
104  //
107 }
calculates .... for Fenix strip, barrel input: 18 bits output: 18 bits
std::vector< int > format_out_
Linearisation for Fenix strip input: 16 bits corresponding to input EBDataFrame output: 18 bits...
Formatting for Fenix strip input: 18 bits + 3x 1bit (fgvb, gapflagbit, output from peakfinder) output...
EcalEBFenixAmplitudeFilter * amplitude_filter_
EcalEBFenixPeakFinder * peak_finder_
std::vector< std::pair< int, EcalTrigTowerDetId > > hitTowers_
Formatting for Fenix Tcp input 10 bits from Ettot 1 bit from fgvb 3 bits TriggerTowerFlag output: 16 ...
std::vector< std::vector< std::pair< int, std::vector< EBDataFrame > > > > towerMapEB_
void initStructures(std::vector< std::vector< std::pair< int, std::vector< T > > > > &towMap)
EcalEBFenixStripFormatEB * fenixFormatterEB_
calculates the peak for Fenix strip, barrel input : 18 bits output: boolean
static const unsigned int maxNrTowers_
std::vector< int > fgvb_out_temp_
std::vector< int > tcpformat_out_
const EcalElectronicsMapping * theMapping_
EcalEBFenixTcpFormat * fenixTcpFormat_
std::vector< EcalEBFenixLinearizer * > linearizer_
std::vector< std::vector< int > > lin_out_

◆ initStructures()

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

Definition at line 223 of file EcalEBTrigPrimTestAlgo.h.

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

Referenced by init().

223  {
224  //initialise internal data structures
225 
226  std::vector<T> vec0(nbMaxXtals_);
227  std::vector<std::pair<int, std::vector<T> > > vec1(nbMaxStrips_);
228  for (int i = 0; i < nbMaxStrips_; ++i)
229  vec1[i] = std::pair<int, std::vector<T> >(0, vec0);
230  towMap.resize(maxNrTowers_);
231  for (unsigned int i = 0; i < maxNrTowers_; ++i)
232  towMap[i] = vec1;
233 
234  std::vector<int> vecint(maxNrSamples_);
235  striptp_.resize(nbMaxStrips_);
236  for (int i = 0; i < nbMaxStrips_; ++i)
237  striptp_[i] = vecint;
238 }
std::vector< std::vector< int > > striptp_
std::vector< double > vec1
Definition: HCALResponse.h:15
static const unsigned int maxNrTowers_

◆ run()

void EcalEBTrigPrimTestAlgo::run ( const EBDigiCollection col,
EcalEBTrigPrimDigiCollection result,
EcalEBTrigPrimDigiCollection resultTcp 
)

Definition at line 120 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_, dqmdumpme::first, castor_dqm_sourceclient-live_cfg::firstSample, format_out_, getFilter(), getFormatter(), getFormatterEB(), getLinearizer(), getPeakFinder(), EcalElectronicsMapping::getTriggerElectronicsId(), hitTowers_, mps_fire::i, ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::ix(), CastorRawToDigi_cfi::lastSample, lin_out_, nrSamples_, nrTowers_, peak_out_, EcalEBFenixPeakFinder::process(), EcalEBFenixAmplitudeFilter::process(), EcalEBFenixTcpFormat::process(), EcalEBFenixStripFormatEB::process(), EcalEBFenixLinearizer::process(), edm::SortedCollection< T, SORT >::push_back(), EcalTriggerElectronicsId::rawId(), DetId::rawId(), nano_mu_digi_cff::rawId, mps_fire::result, edm::second(), EcalEBFenixStripFormatEB::setParameters(), EcalEBFenixTcpFormat::setParameters(), EcalEBFenixAmplitudeFilter::setParameters(), EcalEBFenixLinearizer::setParameters(), edm::DataFrameContainer::size(), tcpFormat_, tcpformat_out_, theMapping_, ecalMatacq_cfi::timing, towerMapEB_, and cmsswSequenceInfo::tp.

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

◆ setPointers()

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 54 of file EcalEBTrigPrimTestAlgo.h.

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

63  {
64  ecaltpPed_ = ecaltpPed;
65  ecaltpLin_ = ecaltpLin;
66  ecaltpgBadX_ = ecaltpgBadX;
67  ecaltpgWeightMap_ = ecaltpgWeightMap;
68  ecaltpgWeightGroup_ = ecaltpgWeightGroup;
69  ecaltpgSlidW_ = ecaltpgSlidW;
70  ecaltpgLutGroup_ = ecaltpgLutGroup;
71  ecaltpgLut_ = ecaltpgLut;
72  ecaltpgBadTT_ = ecaltpgBadTT;
73  ecaltpgSpike_ = ecaltpgSpike;
74  }
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

◆ amplitude_filter_

EcalEBFenixAmplitudeFilter* EcalEBTrigPrimTestAlgo::amplitude_filter_
private

Definition at line 130 of file EcalEBTrigPrimTestAlgo.h.

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

◆ barrelOnly_

bool EcalEBTrigPrimTestAlgo::barrelOnly_
private

Definition at line 107 of file EcalEBTrigPrimTestAlgo.h.

◆ binOfMaximum_

int EcalEBTrigPrimTestAlgo::binOfMaximum_
private

Definition at line 103 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

◆ debug_

bool EcalEBTrigPrimTestAlgo::debug_
private

Definition at line 108 of file EcalEBTrigPrimTestAlgo.h.

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

◆ ecaltpgBadTT_

const EcalTPGTowerStatus* EcalEBTrigPrimTestAlgo::ecaltpgBadTT_
private

Definition at line 144 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

◆ ecaltpgBadX_

const EcalTPGCrystalStatus* EcalEBTrigPrimTestAlgo::ecaltpgBadX_
private

Definition at line 138 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

◆ ecaltpgLut_

const EcalTPGLutIdMap* EcalEBTrigPrimTestAlgo::ecaltpgLut_
private

Definition at line 143 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

◆ ecaltpgLutGroup_

const EcalTPGLutGroup* EcalEBTrigPrimTestAlgo::ecaltpgLutGroup_
private

Definition at line 142 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

◆ ecaltpgSlidW_

const EcalTPGSlidingWindow* EcalEBTrigPrimTestAlgo::ecaltpgSlidW_
private

Definition at line 141 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

◆ ecaltpgSpike_

const EcalTPGSpike* EcalEBTrigPrimTestAlgo::ecaltpgSpike_
private

Definition at line 145 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

◆ ecaltpgWeightGroup_

const EcalTPGWeightGroup* EcalEBTrigPrimTestAlgo::ecaltpgWeightGroup_
private

Definition at line 140 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

◆ ecaltpgWeightMap_

const EcalTPGWeightIdMap* EcalEBTrigPrimTestAlgo::ecaltpgWeightMap_
private

Definition at line 139 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

◆ ecaltpLin_

const EcalTPGLinearizationConst* EcalEBTrigPrimTestAlgo::ecaltpLin_
private

Definition at line 137 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

◆ ecaltpPed_

const EcalTPGPedestals* EcalEBTrigPrimTestAlgo::ecaltpPed_
private

Definition at line 136 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run(), and setPointers().

◆ eTTmap_

const EcalTrigTowerConstituentsMap* EcalEBTrigPrimTestAlgo::eTTmap_ = nullptr
private

Definition at line 98 of file EcalEBTrigPrimTestAlgo.h.

Referenced by fillMap().

◆ famos_

bool EcalEBTrigPrimTestAlgo::famos_
private

Definition at line 109 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init().

◆ fenixFormatterEB_

EcalEBFenixStripFormatEB* EcalEBTrigPrimTestAlgo::fenixFormatterEB_
private

Definition at line 132 of file EcalEBTrigPrimTestAlgo.h.

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

◆ fenixTcpFormat_

EcalEBFenixTcpFormat* EcalEBTrigPrimTestAlgo::fenixTcpFormat_
private

Definition at line 133 of file EcalEBTrigPrimTestAlgo.h.

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

◆ fgvb_out_

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

Definition at line 155 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

◆ fgvb_out_temp_

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

Definition at line 156 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

◆ filt_out_

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

Definition at line 151 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

◆ format_out_

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

Definition at line 153 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

◆ hitTowers_

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

Definition at line 120 of file EcalEBTrigPrimTestAlgo.h.

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

◆ lin_out_

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

Definition at line 148 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

◆ linearizer_

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

Definition at line 129 of file EcalEBTrigPrimTestAlgo.h.

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

◆ maxNrSamples_

int EcalEBTrigPrimTestAlgo::maxNrSamples_
private

Definition at line 104 of file EcalEBTrigPrimTestAlgo.h.

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

◆ maxNrSamplesOut_

const unsigned int EcalEBTrigPrimTestAlgo::maxNrSamplesOut_ = 10
staticprivate

Definition at line 113 of file EcalEBTrigPrimTestAlgo.h.

◆ maxNrTowers_

const unsigned int EcalEBTrigPrimTestAlgo::maxNrTowers_ = 2448
staticprivate

Definition at line 112 of file EcalEBTrigPrimTestAlgo.h.

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

◆ nrSamples_

const unsigned int EcalEBTrigPrimTestAlgo::nrSamples_ = 5
staticprivate

Definition at line 114 of file EcalEBTrigPrimTestAlgo.h.

Referenced by run().

◆ nrTowers_

int EcalEBTrigPrimTestAlgo::nrTowers_
private

Definition at line 111 of file EcalEBTrigPrimTestAlgo.h.

Referenced by fillMap(), and run().

◆ nSamples_

int EcalEBTrigPrimTestAlgo::nSamples_
private

Definition at line 102 of file EcalEBTrigPrimTestAlgo.h.

◆ peak_finder_

EcalEBFenixPeakFinder* EcalEBTrigPrimTestAlgo::peak_finder_
private

Definition at line 131 of file EcalEBTrigPrimTestAlgo.h.

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

◆ peak_out_

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

Definition at line 152 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

◆ striptp_

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

Definition at line 117 of file EcalEBTrigPrimTestAlgo.h.

Referenced by initStructures().

◆ tcpFormat_

bool EcalEBTrigPrimTestAlgo::tcpFormat_
private

Definition at line 106 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

◆ tcpformat_out_

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

Definition at line 163 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

◆ theGeometry_

const CaloGeometry* EcalEBTrigPrimTestAlgo::theGeometry_ = nullptr
private

Definition at line 99 of file EcalEBTrigPrimTestAlgo.h.

◆ theMapping_

const EcalElectronicsMapping* EcalEBTrigPrimTestAlgo::theMapping_
private

Definition at line 127 of file EcalEBTrigPrimTestAlgo.h.

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

◆ threshold

float EcalEBTrigPrimTestAlgo::threshold
private

Definition at line 101 of file EcalEBTrigPrimTestAlgo.h.

Referenced by utils.StatisticalTest::get_status().

◆ towerMapEB_

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

Definition at line 118 of file EcalEBTrigPrimTestAlgo.h.

Referenced by init(), and run().

◆ towerMapEE_

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

Definition at line 119 of file EcalEBTrigPrimTestAlgo.h.

◆ towtp2_

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

Definition at line 122 of file EcalEBTrigPrimTestAlgo.h.

◆ towtp_

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

Definition at line 121 of file EcalEBTrigPrimTestAlgo.h.