CMS 3D CMS Logo

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

#include <EcalTrigPrimFunctionalAlgo.h>

Public Member Functions

 EcalTrigPrimFunctionalAlgo (const EcalTrigTowerConstituentsMap *eTTmap, const CaloSubdetectorGeometry *endcapGeometry, const EcalElectronicsMapping *theMapping, int binofmax, bool tcpFormat, bool debug, bool famos, bool TPinfoPrintout)
 
 EcalTrigPrimFunctionalAlgo (const EcalElectronicsMapping *theMapping, int binofmax, bool tcpFormat, bool debug, bool famos, bool TPinfoPrintout)
 
void run (const EBDigiCollection *col, EcalTrigPrimDigiCollection &result, EcalTrigPrimDigiCollection &resultTcp)
 
void run (const EEDigiCollection *col, EcalTrigPrimDigiCollection &result, EcalTrigPrimDigiCollection &resultTcp)
 
void run_part1_EB (EBDigiCollection const *col)
 
void run_part1_EE (EEDigiCollection const *col)
 
template<class Coll >
void run_part2 (Coll const *col, std::vector< std::vector< std::pair< int, std::vector< typename Coll::Digi >>>> &towerMap, EcalTrigPrimDigiCollection &result, EcalTrigPrimDigiCollection &resultTcp)
 
void setPointers (const EcalTPGLinearizationConst *ecaltpLin, const EcalTPGPedestals *ecaltpPed, const EcalTPGSlidingWindow *ecaltpgSlidW, const EcalTPGWeightIdMap *ecaltpgWeightMap, const EcalTPGWeightGroup *ecaltpgWeightGroup, const EcalTPGOddWeightIdMap *ecaltpgOddWeightMap, const EcalTPGOddWeightGroup *ecaltpgOddWeightGroup, const EcalTPGFineGrainStripEE *ecaltpgFgStripEE, const EcalTPGCrystalStatus *ecaltpgBadX, const EcalTPGStripStatus *ecaltpgStripStatus, const EcalTPGTPMode *ecaltpgTPMode)
 
void setPointers2 (const EcalTPGFineGrainEBGroup *ecaltpgFgEBGroup, const EcalTPGLutGroup *ecaltpgLutGroup, const EcalTPGLutIdMap *ecaltpgLut, const EcalTPGFineGrainEBIdMap *ecaltpgFineGrainEB, const EcalTPGFineGrainTowerEE *ecaltpgFineGrainTowerEE, const EcalTPGTowerStatus *ecaltpgBadTT, const EcalTPGSpike *ecaltpgSpike, const EcalTPGTPMode *ecaltpgTPMode)
 
virtual ~EcalTrigPrimFunctionalAlgo ()
 

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)
 
int getIndex (const EBDigiCollection *, EcalTrigTowerDetId &id)
 
int getIndex (const EEDigiCollection *, EcalTrigTowerDetId &id)
 
void init ()
 
template<class T >
void initStructures (std::vector< std::vector< std::pair< int, std::vector< T >>>> &towMap)
 

Private Attributes

bool barrelOnly_
 
int binOfMaximum_
 
bool debug_
 
std::unique_ptr< EcalFenixStripestrip_
 
std::unique_ptr< EcalFenixTcpetcp_
 
const EcalTrigTowerConstituentsMapeTTmap_ = nullptr
 
bool famos_
 
std::vector< std::pair< int, EcalTrigTowerDetId > > hitTowers_
 
int maxNrSamples_
 
int nrTowers_
 
std::vector< std::vector< int > > striptp_
 
bool tcpFormat_
 
const CaloSubdetectorGeometrytheEndcapGeometry_ = 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< EcalTriggerPrimitiveSampletowtp2_
 
std::vector< EcalTriggerPrimitiveSampletowtp_
 
bool tpInfoPrintout_
 

Static Private Attributes

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

Detailed Description

EcalTrigPrimFunctionalAlgo is the main algorithm class for TPG It coordinates all the aother algorithms Structure is as close as possible to electronics

Author
Ursula Berthon, Stephanie Baffioni, LLR Palaiseau
Version
1st Version may 2006
2nd Version jul 2006
3rd Version sep 2007 introducing new Records closer to the db

EcalTrigPrimFunctionalAlgo is the main algorithm class for TPG It coordinates all the other algorithms Structure is very close to electronics

Author
Ursula Berthon, Stephanie Baffioni, LLR Palaiseau
Version
1st Version may 2006
2nd Version jul 2006

Definition at line 46 of file EcalTrigPrimFunctionalAlgo.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
nbMaxStrips_ 

Definition at line 175 of file EcalTrigPrimFunctionalAlgo.h.

◆ anonymous enum

anonymous enum
private
Enumerator
nbMaxXtals_ 

Definition at line 176 of file EcalTrigPrimFunctionalAlgo.h.

Constructor & Destructor Documentation

◆ EcalTrigPrimFunctionalAlgo() [1/2]

EcalTrigPrimFunctionalAlgo::EcalTrigPrimFunctionalAlgo ( const EcalTrigTowerConstituentsMap eTTmap,
const CaloSubdetectorGeometry endcapGeometry,
const EcalElectronicsMapping theMapping,
int  binofmax,
bool  tcpFormat,
bool  debug,
bool  famos,
bool  TPinfoPrintout 
)

Definition at line 50 of file EcalTrigPrimFunctionalAlgo.cc.

References famos_, init(), and maxNrSamples_.

58  : eTTmap_(eTTmap),
59  theEndcapGeometry_(endcapGeometry),
60  theMapping_(theMapping),
61  binOfMaximum_(binofmax),
62  tcpFormat_(tcpFormat),
63  barrelOnly_(true),
64  debug_(debug),
65  famos_(famos),
66  tpInfoPrintout_(tpInfoPrintout)
67 
68 {
69  if (famos_)
70  maxNrSamples_ = 1; // get from input??
71  else
72  maxNrSamples_ = 10;
73  this->init();
74 }
const EcalElectronicsMapping * theMapping_
const CaloSubdetectorGeometry * theEndcapGeometry_
#define debug
Definition: HDRShower.cc:19
const EcalTrigTowerConstituentsMap * eTTmap_

◆ EcalTrigPrimFunctionalAlgo() [2/2]

EcalTrigPrimFunctionalAlgo::EcalTrigPrimFunctionalAlgo ( const EcalElectronicsMapping theMapping,
int  binofmax,
bool  tcpFormat,
bool  debug,
bool  famos,
bool  TPinfoPrintout 
)
explicit

Definition at line 76 of file EcalTrigPrimFunctionalAlgo.cc.

References famos_, init(), and maxNrSamples_.

78  : theMapping_(theMapping),
79  binOfMaximum_(binofmax),
80  tcpFormat_(tcpFormat),
81  barrelOnly_(true),
82  debug_(debug),
83  famos_(famos),
84  tpInfoPrintout_(tpInfoPrintout)
85 
86 {
87  if (famos_)
88  maxNrSamples_ = 1; // get from input??
89  else
90  maxNrSamples_ = 10;
91  this->init();
92 }
const EcalElectronicsMapping * theMapping_
#define debug
Definition: HDRShower.cc:19

◆ ~EcalTrigPrimFunctionalAlgo()

EcalTrigPrimFunctionalAlgo::~EcalTrigPrimFunctionalAlgo ( )
virtual

Definition at line 111 of file EcalTrigPrimFunctionalAlgo.cc.

111 {}

Member Function Documentation

◆ clean()

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

Definition at line 340 of file EcalTrigPrimFunctionalAlgo.h.

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

Referenced by run_part1_EB(), and run_part1_EE().

340  {
341  // clean internal data structures
342  for (unsigned int i = 0; i < maxNrTowers_; ++i)
343  for (int j = 0; j < nbMaxStrips_; ++j)
344  (towMap[i])[j].first = 0;
345  return;
346 }
static const unsigned int maxNrTowers_

◆ fillMap()

template<class Coll >
void EcalTrigPrimFunctionalAlgo::fillMap ( Coll const *  col,
std::vector< std::vector< std::pair< int, std::vector< typename Coll::Digi >>>> &  towerMap 
)
private

Definition at line 297 of file EcalTrigPrimFunctionalAlgo.h.

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

Referenced by run_part1_EB(), and run_part1_EE().

298  {
299  typedef typename Coll::Digi Digi;
300 
301  // implementation for Barrel and Endcap
302 
303  if (col) {
304  nrTowers_ = 0;
305  LogDebug("EcalTPG") << "Fill mapping, Collection size = " << col->size();
306  for (unsigned int i = 0; i < col->size(); ++i) {
307  Digi samples((*col)[i]);
308  EcalTrigTowerDetId coarser =
310  int index = getIndex(col, coarser);
311  int stripnr = findStripNr(samples.id());
312 
313  int filled = 0;
314  for (unsigned int ij = 0; ij < towerMap[index].size(); ++ij)
315  filled += towerMap[index][ij].first;
316  if (!filled) {
317  hitTowers_[nrTowers_++] = std::pair<int, EcalTrigTowerDetId>(index, coarser);
318  }
319 
320  // FIXME: temporary protection
321  int ncryst = towerMap[index][stripnr - 1].first;
322  if (ncryst >= nbMaxXtals_) {
323  edm::LogError("EcalTrigPrimFunctionAlgo")
324  << "! Too many xtals for TT " << coarser << " stripnr " << stripnr << " xtalid " << samples.id();
325  continue;
326  }
327  ((towerMap[index])[stripnr - 1].second)[ncryst] = samples;
328  (towerMap[index])[stripnr - 1].first++;
329  }
330 
331  LogDebug("EcalTPG") << "fillMap"
332  << "[EcalTrigPrimFunctionalAlgo] (found " << col->size() << " frames in " << towerMap.size()
333  << " towers) ";
334  } else {
335  LogDebug("EcalTPG") << "FillMap - FillMap Collection size=0 !!!!";
336  }
337 }
std::vector< std::pair< int, EcalTrigTowerDetId > > hitTowers_
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)
int getIndex(const EBDigiCollection *, EcalTrigTowerDetId &id)
col
Definition: cuy.py:1009
const EcalTrigTowerConstituentsMap * eTTmap_
static EcalTrigTowerDetId barrelTowerOf(const DetId &id)
#define LogDebug(id)

◆ findStripNr() [1/2]

int EcalTrigPrimFunctionalAlgo::findStripNr ( const EBDetId id)
private

Definition at line 128 of file EcalTrigPrimFunctionalAlgo.cc.

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

Referenced by fillMap().

128  {
129  int stripnr;
130  int n = ((id.ic() - 1) % 100) / 20; // 20 corresponds to 4 * ecal_barrel_crystals_per_strip FIXME!!
131  if (id.ieta() < 0)
132  stripnr = n + 1;
133  else
134  stripnr = nbMaxStrips_ - n;
135  return stripnr;
136 }

◆ findStripNr() [2/2]

int EcalTrigPrimFunctionalAlgo::findStripNr ( const EEDetId id)
private

Definition at line 138 of file EcalTrigPrimFunctionalAlgo.cc.

References EcalElectronicsMapping::getTriggerElectronicsId(), EcalTriggerElectronicsId::pseudoStripId(), and theMapping_.

138  {
139  int stripnr;
141  stripnr = elId.pseudoStripId();
142  return stripnr;
143 }
int pseudoStripId() const
get the tower id
const EcalElectronicsMapping * theMapping_
EcalTriggerElectronicsId getTriggerElectronicsId(const DetId &id) const
Get the trigger electronics id for this det id.
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...

◆ getIndex() [1/2]

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

Definition at line 131 of file EcalTrigPrimFunctionalAlgo.h.

Referenced by fillMap().

131 { return id.hashedIndex(); }

◆ getIndex() [2/2]

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

Definition at line 133 of file EcalTrigPrimFunctionalAlgo.h.

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

133  {
134  int ind = (id.ietaAbs() - 18) * 72 + id.iphi();
135  if (id.zside() < 0)
136  ind += 792;
137  return ind;
138  }
int zside(DetId const &)

◆ init()

void EcalTrigPrimFunctionalAlgo::init ( void  )
private

Definition at line 95 of file EcalTrigPrimFunctionalAlgo.cc.

References binOfMaximum_, debug_, estrip_, etcp_, famos_, hitTowers_, initStructures(), maxNrSamples_, maxNrSamplesOut_, maxNrTowers_, nbMaxStrips_, nbMaxXtals_, tcpFormat_, theMapping_, towerMapEB_, towerMapEE_, towtp2_, towtp_, and tpInfoPrintout_.

Referenced by EcalTrigPrimFunctionalAlgo().

95  {
96  // create main sub algos
97  estrip_ = std::make_unique<EcalFenixStrip>(theMapping_, debug_, famos_, maxNrSamples_, nbMaxXtals_, tpInfoPrintout_);
98  etcp_ = std::make_unique<EcalFenixTcp>(
100 
101  // initialise data structures
104 
105  hitTowers_.resize(maxNrTowers_);
106  towtp_.resize(maxNrSamplesOut_);
107  towtp2_.resize(maxNrSamplesOut_);
108 }
const EcalElectronicsMapping * theMapping_
std::unique_ptr< EcalFenixTcp > etcp_
std::vector< std::pair< int, EcalTrigTowerDetId > > hitTowers_
static const unsigned int maxNrSamplesOut_
std::vector< EcalTriggerPrimitiveSample > towtp_
static const unsigned int maxNrTowers_
void initStructures(std::vector< std::vector< std::pair< int, std::vector< T >>>> &towMap)
std::vector< std::vector< std::pair< int, std::vector< EBDataFrame > > > > towerMapEB_
std::vector< std::vector< std::pair< int, std::vector< EEDataFrame > > > > towerMapEE_
std::unique_ptr< EcalFenixStrip > estrip_
std::vector< EcalTriggerPrimitiveSample > towtp2_

◆ initStructures()

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

Definition at line 349 of file EcalTrigPrimFunctionalAlgo.h.

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

Referenced by init().

349  {
350  // initialise internal data structures
351 
352  std::vector<T> vec0(nbMaxXtals_);
353  std::vector<std::pair<int, std::vector<T>>> vec1(nbMaxStrips_);
354  for (int i = 0; i < nbMaxStrips_; ++i)
355  vec1[i] = std::pair<int, std::vector<T>>(0, vec0);
356  towMap.resize(maxNrTowers_);
357  for (unsigned int i = 0; i < maxNrTowers_; ++i)
358  towMap[i] = vec1;
359 
360  std::vector<int> vecint(maxNrSamples_);
361  striptp_.resize(nbMaxStrips_);
362  for (int i = 0; i < nbMaxStrips_; ++i)
363  striptp_[i] = vecint;
364 }
std::vector< std::vector< int > > striptp_
static const unsigned int maxNrTowers_
std::vector< double > vec1
Definition: HCALResponse.h:15

◆ run() [1/2]

void EcalTrigPrimFunctionalAlgo::run ( const EBDigiCollection col,
EcalTrigPrimDigiCollection result,
EcalTrigPrimDigiCollection resultTcp 
)

Definition at line 113 of file EcalTrigPrimFunctionalAlgo.cc.

References cuy::col, mps_fire::result, run_part1_EB(), run_part2(), and towerMapEB_.

115  {
116  run_part1_EB(col);
117  run_part2(col, towerMapEB_, result, resultTcp);
118 }
void run_part2(Coll const *col, std::vector< std::vector< std::pair< int, std::vector< typename Coll::Digi >>>> &towerMap, EcalTrigPrimDigiCollection &result, EcalTrigPrimDigiCollection &resultTcp)
std::vector< std::vector< std::pair< int, std::vector< EBDataFrame > > > > towerMapEB_
void run_part1_EB(EBDigiCollection const *col)
col
Definition: cuy.py:1009

◆ run() [2/2]

void EcalTrigPrimFunctionalAlgo::run ( const EEDigiCollection col,
EcalTrigPrimDigiCollection result,
EcalTrigPrimDigiCollection resultTcp 
)

Definition at line 121 of file EcalTrigPrimFunctionalAlgo.cc.

References cuy::col, mps_fire::result, run_part1_EE(), run_part2(), and towerMapEE_.

123  {
124  run_part1_EE(col);
125  run_part2(col, towerMapEE_, result, resultTcp);
126 }
void run_part2(Coll const *col, std::vector< std::vector< std::pair< int, std::vector< typename Coll::Digi >>>> &towerMap, EcalTrigPrimDigiCollection &result, EcalTrigPrimDigiCollection &resultTcp)
std::vector< std::vector< std::pair< int, std::vector< EEDataFrame > > > > towerMapEE_
col
Definition: cuy.py:1009
void run_part1_EE(EEDigiCollection const *col)

◆ run_part1_EB()

void EcalTrigPrimFunctionalAlgo::run_part1_EB ( EBDigiCollection const *  col)

Definition at line 146 of file EcalTrigPrimFunctionalAlgo.cc.

References clean(), cuy::col, fillMap(), and towerMapEB_.

Referenced by run().

146  {
148  // loop over dataframes and fill map
150 }
void fillMap(Coll const *col, std::vector< std::vector< std::pair< int, std::vector< typename Coll::Digi >>>> &towerMap)
std::vector< std::vector< std::pair< int, std::vector< EBDataFrame > > > > towerMapEB_
void clean(std::vector< std::vector< std::pair< int, std::vector< T >>>> &towerMap)
col
Definition: cuy.py:1009

◆ run_part1_EE()

void EcalTrigPrimFunctionalAlgo::run_part1_EE ( EEDigiCollection const *  col)

Definition at line 152 of file EcalTrigPrimFunctionalAlgo.cc.

References clean(), cuy::col, fillMap(), and towerMapEE_.

Referenced by run().

152  {
154  // loop over dataframes and fill map
156 }
void fillMap(Coll const *col, std::vector< std::vector< std::pair< int, std::vector< typename Coll::Digi >>>> &towerMap)
void clean(std::vector< std::vector< std::pair< int, std::vector< T >>>> &towerMap)
std::vector< std::vector< std::pair< int, std::vector< EEDataFrame > > > > towerMapEE_
col
Definition: cuy.py:1009

◆ run_part2()

template<class Coll >
void EcalTrigPrimFunctionalAlgo::run_part2 ( Coll const *  col,
std::vector< std::vector< std::pair< int, std::vector< typename Coll::Digi >>>> &  towerMap,
EcalTrigPrimDigiCollection result,
EcalTrigPrimDigiCollection resultTcp 
)

Definition at line 183 of file EcalTrigPrimFunctionalAlgo.h.

References binOfMaximum_, EcalTriggerPrimitiveDigi::compressedEt(), hgcalPerformanceValidation::df, TrendClient_cfi::Digi, EcalEndcap, estrip_, EgHLTOffHistBins_cfi::et, etcp_, dqmdumpme::first, castor_dqm_sourceclient-live_cfg::firstSample, hitTowers_, mps_fire::i, EcalTrigTowerDetId::ieta(), EcalTrigTowerDetId::ietaAbs(), EcalTrigTowerDetId::iphi(), CastorRawToDigi_cfi::lastSample, LogDebug, nrSamples_, nrTowers_, phi, edm::SortedCollection< T, SORT >::push_back(), mps_fire::result, edm::second(), EcalTriggerPrimitiveDigi::setSample(), EcalTriggerPrimitiveDigi::setSize(), striptp_, EcalTrigTowerDetId::subDet(), tcpFormat_, towtp2_, towtp_, tpInfoPrintout_, and EcalTrigTowerDetId::zside().

Referenced by run().

187  {
188  typedef typename Coll::Digi Digi;
189 
190  // prepare writing of TP-s
191 
192  int firstSample = binOfMaximum_ - 1 - nrSamples_ / 2;
193  int lastSample = binOfMaximum_ - 1 + nrSamples_ / 2;
194  int nrTP = 0;
195  std::vector<typename Coll::Digi> dummy;
196  EcalTriggerPrimitiveDigi tptow[2];
197  EcalTriggerPrimitiveDigi tptowTcp[2];
198 
199  estrip_->getFGVB()->setbadStripMissing(false);
200 
201  for (int itow = 0; itow < nrTowers_; ++itow) {
202  int index = hitTowers_[itow].first;
203  const EcalTrigTowerDetId &thisTower = hitTowers_[itow].second;
204 
205  if (tpInfoPrintout_) {
206  edm::LogVerbatim("EcalTPG") << "+++++++++++++++++++++++++++++++++++++++++++++++++";
207  edm::LogVerbatim("EcalTPG") << "on Tower " << itow << " of " << nrTowers_;
208  edm::LogVerbatim("EcalTPG") << "Tower ieta, iphi: " << thisTower.ieta() << ", " << thisTower.iphi();
209  }
210 
211  // loop over all strips assigned to this trigger tower
212  int nstr = 0;
213  for (unsigned int i = 0; i < towerMap[itow].size(); ++i) {
214  std::vector<Digi> &df = (towerMap[index])[i].second; // vector of dataframes for this strip,
215  // size; nr of crystals/strip
216 
217  if ((towerMap[index])[i].first > 0) {
218  if (tpInfoPrintout_) {
219  edm::LogVerbatim("EcalTPG") << "-------------------------------------------------";
220  edm::LogVerbatim("EcalTPG") << "on Strip index " << i;
221  }
222  estrip_->process(df, (towerMap[index])[i].first, striptp_[nstr++]);
223  }
224  } // loop over strips in one tower
225 
226  bool isInInnerRings = false;
227  if (thisTower.subDet() == EcalEndcap && (thisTower.ietaAbs() == 27 || thisTower.ietaAbs() == 28))
228  isInInnerRings = true;
229  etcp_->process(dummy, striptp_, nstr, towtp_, towtp2_, isInInnerRings, thisTower);
230 
231  // prepare TP-s
232  // special treatment for 2 inner endcap rings
233  int nrTowers;
234  if (isInInnerRings) {
235  nrTowers = 2;
236  int phi = 2 * ((thisTower.iphi() - 1) / 2);
237  tptow[0] = EcalTriggerPrimitiveDigi(
238  EcalTrigTowerDetId(thisTower.zside(), thisTower.subDet(), thisTower.ietaAbs(), phi + 1));
239  tptow[1] = EcalTriggerPrimitiveDigi(
240  EcalTrigTowerDetId(thisTower.zside(), thisTower.subDet(), thisTower.ietaAbs(), phi + 2));
241 
242  if (tcpFormat_) {
243  tptowTcp[0] = EcalTriggerPrimitiveDigi(
244  EcalTrigTowerDetId(thisTower.zside(), thisTower.subDet(), thisTower.ietaAbs(), phi + 1));
245  tptowTcp[1] = EcalTriggerPrimitiveDigi(
246  EcalTrigTowerDetId(thisTower.zside(), thisTower.subDet(), thisTower.ietaAbs(), phi + 2));
247  }
248  } else {
249  nrTowers = 1;
250  tptow[0] = EcalTriggerPrimitiveDigi(thisTower);
251  if (tcpFormat_)
252  tptowTcp[0] = EcalTriggerPrimitiveDigi(thisTower);
253  }
254 
255  // now fill in
256  for (int nrt = 0; nrt < nrTowers; nrt++) {
257  (tptow[nrt]).setSize(nrSamples_);
258  if (towtp_.size() < nrSamples_) { // FIXME: only once
259  edm::LogWarning("") << "Too few samples produced, nr is " << towtp_.size();
260  break;
261  }
262  int isam = 0;
263  for (int i = firstSample; i <= lastSample; ++i) {
264  tptow[nrt].setSample(isam++, EcalTriggerPrimitiveSample(towtp_[i]));
265  }
266  nrTP++;
267  LogDebug("EcalTPG") << " For tower " << itow << " created TP nr " << nrTP << " with Et "
268  << tptow[nrt].compressedEt();
269  result.push_back(tptow[nrt]);
270  }
271 
272  if (tcpFormat_) {
273  for (int nrt = 0; nrt < nrTowers; nrt++) {
274  tptowTcp[nrt].setSize(nrSamples_);
275  if (towtp2_.size() < nrSamples_) { // FIXME: only once
276  edm::LogWarning("") << "Too few samples produced, nr is " << towtp2_.size();
277  break;
278  }
279  int isam = 0;
280  for (int i = firstSample; i <= lastSample; ++i) {
281  if (nrTowers <= 1)
282  tptowTcp[nrt].setSample(isam++, EcalTriggerPrimitiveSample(towtp2_[i]));
283  else {
284  int et = towtp2_[i].compressedEt() / 2;
285  tptowTcp[nrt].setSample(isam++,
286  EcalTriggerPrimitiveSample(et, towtp2_[i].fineGrain(), towtp2_[i].ttFlag()));
287  }
288  }
289  resultTcp.push_back(tptowTcp[nrt]);
290  }
291  }
292  }
293  return;
294 }
Log< level::Info, true > LogVerbatim
int ieta() const
get the tower ieta
std::vector< std::vector< int > > striptp_
EcalSubdetector subDet() const
get the subDetector associated to the Trigger Tower
std::unique_ptr< EcalFenixTcp > etcp_
void push_back(T const &t)
std::vector< std::pair< int, EcalTrigTowerDetId > > hitTowers_
std::vector< EcalTriggerPrimitiveSample > towtp_
U second(std::pair< T, U > const &p)
int zside() const
get the z-side of the tower (1/-1)
void setSample(int i, const EcalTriggerPrimitiveSample &sam)
int compressedEt() const
get the encoded/compressed Et of interesting sample
int ietaAbs() const
get the absolute value of the tower ieta
std::unique_ptr< EcalFenixStrip > estrip_
std::vector< EcalTriggerPrimitiveSample > towtp2_
Log< level::Warning, false > LogWarning
static const unsigned int nrSamples_
int iphi() const
get the tower iphi
#define LogDebug(id)

◆ setPointers()

void EcalTrigPrimFunctionalAlgo::setPointers ( const EcalTPGLinearizationConst ecaltpLin,
const EcalTPGPedestals ecaltpPed,
const EcalTPGSlidingWindow ecaltpgSlidW,
const EcalTPGWeightIdMap ecaltpgWeightMap,
const EcalTPGWeightGroup ecaltpgWeightGroup,
const EcalTPGOddWeightIdMap ecaltpgOddWeightMap,
const EcalTPGOddWeightGroup ecaltpgOddWeightGroup,
const EcalTPGFineGrainStripEE ecaltpgFgStripEE,
const EcalTPGCrystalStatus ecaltpgBadX,
const EcalTPGStripStatus ecaltpgStripStatus,
const EcalTPGTPMode ecaltpgTPMode 
)
inline

Definition at line 78 of file EcalTrigPrimFunctionalAlgo.h.

References estrip_.

88  {
89  estrip_->setPointers(ecaltpPed,
90  ecaltpLin,
91  ecaltpgWeightMap,
92  ecaltpgWeightGroup,
93  ecaltpgOddWeightMap,
94  ecaltpgOddWeightGroup,
95  ecaltpgSlidW,
96  ecaltpgFgStripEE,
97  ecaltpgBadX,
98  ecaltpgStripStatus,
99  ecaltpgTPMode);
100  }
std::unique_ptr< EcalFenixStrip > estrip_

◆ setPointers2()

void EcalTrigPrimFunctionalAlgo::setPointers2 ( const EcalTPGFineGrainEBGroup ecaltpgFgEBGroup,
const EcalTPGLutGroup ecaltpgLutGroup,
const EcalTPGLutIdMap ecaltpgLut,
const EcalTPGFineGrainEBIdMap ecaltpgFineGrainEB,
const EcalTPGFineGrainTowerEE ecaltpgFineGrainTowerEE,
const EcalTPGTowerStatus ecaltpgBadTT,
const EcalTPGSpike ecaltpgSpike,
const EcalTPGTPMode ecaltpgTPMode 
)
inline

Definition at line 101 of file EcalTrigPrimFunctionalAlgo.h.

References etcp_.

108  {
109  etcp_->setPointers(ecaltpgFgEBGroup,
110  ecaltpgLutGroup,
111  ecaltpgLut,
112  ecaltpgFineGrainEB,
113  ecaltpgFineGrainTowerEE,
114  ecaltpgBadTT,
115  ecaltpgSpike,
116  ecaltpgTPMode);
117  }
std::unique_ptr< EcalFenixTcp > etcp_

Member Data Documentation

◆ barrelOnly_

bool EcalTrigPrimFunctionalAlgo::barrelOnly_
private

Definition at line 153 of file EcalTrigPrimFunctionalAlgo.h.

◆ binOfMaximum_

int EcalTrigPrimFunctionalAlgo::binOfMaximum_
private

Definition at line 149 of file EcalTrigPrimFunctionalAlgo.h.

Referenced by init(), and run_part2().

◆ debug_

bool EcalTrigPrimFunctionalAlgo::debug_
private

Definition at line 154 of file EcalTrigPrimFunctionalAlgo.h.

Referenced by init().

◆ estrip_

std::unique_ptr<EcalFenixStrip> EcalTrigPrimFunctionalAlgo::estrip_
private

Definition at line 140 of file EcalTrigPrimFunctionalAlgo.h.

Referenced by init(), run_part2(), and setPointers().

◆ etcp_

std::unique_ptr<EcalFenixTcp> EcalTrigPrimFunctionalAlgo::etcp_
private

Definition at line 141 of file EcalTrigPrimFunctionalAlgo.h.

Referenced by init(), run_part2(), and setPointers2().

◆ eTTmap_

const EcalTrigTowerConstituentsMap* EcalTrigPrimFunctionalAlgo::eTTmap_ = nullptr
private

Definition at line 143 of file EcalTrigPrimFunctionalAlgo.h.

Referenced by fillMap().

◆ famos_

bool EcalTrigPrimFunctionalAlgo::famos_
private

Definition at line 155 of file EcalTrigPrimFunctionalAlgo.h.

Referenced by EcalTrigPrimFunctionalAlgo(), and init().

◆ hitTowers_

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

Definition at line 171 of file EcalTrigPrimFunctionalAlgo.h.

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

◆ maxNrSamples_

int EcalTrigPrimFunctionalAlgo::maxNrSamples_
private

Definition at line 150 of file EcalTrigPrimFunctionalAlgo.h.

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

◆ maxNrSamplesOut_

const unsigned int EcalTrigPrimFunctionalAlgo::maxNrSamplesOut_ = 10
staticprivate

Definition at line 160 of file EcalTrigPrimFunctionalAlgo.h.

Referenced by init().

◆ maxNrTowers_

const unsigned int EcalTrigPrimFunctionalAlgo::maxNrTowers_ = 2448
staticprivate

Definition at line 161 of file EcalTrigPrimFunctionalAlgo.h.

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

◆ maxNrTPs_

const unsigned int EcalTrigPrimFunctionalAlgo::maxNrTPs_ = 2448
staticprivate

Definition at line 162 of file EcalTrigPrimFunctionalAlgo.h.

◆ nrSamples_

const unsigned int EcalTrigPrimFunctionalAlgo::nrSamples_ = 5
staticprivate

Definition at line 158 of file EcalTrigPrimFunctionalAlgo.h.

Referenced by run_part2().

◆ nrTowers_

int EcalTrigPrimFunctionalAlgo::nrTowers_
private

Definition at line 165 of file EcalTrigPrimFunctionalAlgo.h.

Referenced by fillMap(), and run_part2().

◆ striptp_

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

Definition at line 168 of file EcalTrigPrimFunctionalAlgo.h.

Referenced by initStructures(), and run_part2().

◆ tcpFormat_

bool EcalTrigPrimFunctionalAlgo::tcpFormat_
private

Definition at line 152 of file EcalTrigPrimFunctionalAlgo.h.

Referenced by init(), and run_part2().

◆ theEndcapGeometry_

const CaloSubdetectorGeometry* EcalTrigPrimFunctionalAlgo::theEndcapGeometry_ = nullptr
private

Definition at line 144 of file EcalTrigPrimFunctionalAlgo.h.

◆ theMapping_

const EcalElectronicsMapping* EcalTrigPrimFunctionalAlgo::theMapping_
private

Definition at line 145 of file EcalTrigPrimFunctionalAlgo.h.

Referenced by findStripNr(), and init().

◆ threshold

float EcalTrigPrimFunctionalAlgo::threshold
private

Definition at line 147 of file EcalTrigPrimFunctionalAlgo.h.

Referenced by utils.StatisticalTest::get_status().

◆ towerMapEB_

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

Definition at line 169 of file EcalTrigPrimFunctionalAlgo.h.

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

◆ towerMapEE_

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

Definition at line 170 of file EcalTrigPrimFunctionalAlgo.h.

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

◆ towtp2_

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

Definition at line 173 of file EcalTrigPrimFunctionalAlgo.h.

Referenced by init(), and run_part2().

◆ towtp_

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

Definition at line 172 of file EcalTrigPrimFunctionalAlgo.h.

Referenced by init(), and run_part2().

◆ tpInfoPrintout_

bool EcalTrigPrimFunctionalAlgo::tpInfoPrintout_
private

Definition at line 156 of file EcalTrigPrimFunctionalAlgo.h.

Referenced by init(), and run_part2().