1 #ifndef SIMCALORIMETRY_ECALTRIGPRIMALGOS_ECALTRIGPRIMFUNCTIONALALGO_h
2 #define SIMCALORIMETRY_ECALTRIGPRIMALGOS_ECALTRIGPRIMFUNCTIONALALGO_h
39 class ETPCoherenceTest;
94 ecaltpgOddWeightGroup,
109 etcp_->setPointers(ecaltpgFgEBGroup,
113 ecaltpgFineGrainTowerEE,
125 template <
class Coll>
134 int ind = (
id.ietaAbs() - 18) * 72 +
id.iphi();
141 std::unique_ptr<EcalFenixTcp>
etcp_;
169 std::vector<std::vector<std::pair<int, std::vector<EBDataFrame>>>>
towerMapEB_;
170 std::vector<std::vector<std::pair<int, std::vector<EEDataFrame>>>>
towerMapEE_;
172 std::vector<EcalTriggerPrimitiveSample>
towtp_;
173 std::vector<EcalTriggerPrimitiveSample>
towtp2_;
182 template <
class Coll>
188 typedef typename Coll::Digi Digi;
195 std::vector<typename Coll::Digi> dummy;
199 estrip_->getFGVB()->setbadStripMissing(
false);
201 for (
int itow = 0; itow <
nrTowers_; ++itow) {
206 edm::LogVerbatim(
"EcalTPG") <<
"+++++++++++++++++++++++++++++++++++++++++++++++++";
213 for (
unsigned int i = 0;
i < towerMap[itow].size(); ++
i) {
217 if ((towerMap[index])[
i].first > 0) {
219 edm::LogVerbatim(
"EcalTPG") <<
"-------------------------------------------------";
226 bool isInInnerRings =
false;
228 isInInnerRings =
true;
234 if (isInInnerRings) {
236 int phi = 2 * ((thisTower.
iphi() - 1) / 2);
256 for (
int nrt = 0; nrt < nrTowers; nrt++) {
267 LogDebug(
"EcalTPG") <<
" For tower " << itow <<
" created TP nr " << nrTP <<
" with Et "
273 for (
int nrt = 0; nrt < nrTowers; nrt++) {
284 int et =
towtp2_[
i].compressedEt() / 2;
296 template <
class Coll>
299 typedef typename Coll::Digi Digi;
305 LogDebug(
"EcalTPG") <<
"Fill mapping, Collection size = " << col->size();
306 for (
unsigned int i = 0;
i < col->size(); ++
i) {
307 Digi samples((*col)[
i]);
313 for (
unsigned int ij = 0; ij < towerMap[
index].size(); ++ij)
314 filled += towerMap[index][ij].
first;
320 int ncryst = towerMap[
index][stripnr - 1].first;
323 <<
"! Too many xtals for TT " << coarser <<
" stripnr " << stripnr <<
" xtalid " << samples.id();
326 ((towerMap[
index])[stripnr - 1].
second)[ncryst] = samples;
331 <<
"[EcalTrigPrimFunctionalAlgo] (found " << col->size() <<
" frames in " << towerMap.size()
334 LogDebug(
"EcalTPG") <<
"FillMap - FillMap Collection size=0 !!!!";
343 (towMap[
i])[
j].first = 0;
354 vec1[
i] = std::pair<
int, std::vector<T>>(0, vec0);
Log< level::Info, true > LogVerbatim
const EcalElectronicsMapping * theMapping_
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)
EcalTrigPrimFunctionalAlgo(const EcalTrigTowerConstituentsMap *eTTmap, const CaloSubdetectorGeometry *endcapGeometry, const EcalElectronicsMapping *theMapping, int binofmax, bool tcpFormat, bool debug, bool famos, bool TPinfoPrintout)
std::vector< std::vector< int > > striptp_
void fillMap(Coll const *col, std::vector< std::vector< std::pair< int, std::vector< typename Coll::Digi >>>> &towerMap)
std::unique_ptr< EcalFenixTcp > etcp_
const CaloSubdetectorGeometry * theEndcapGeometry_
void push_back(T const &t)
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::pair< int, EcalTrigTowerDetId > > hitTowers_
static const unsigned int maxNrSamplesOut_
Log< level::Error, false > LogError
int ieta() const
get the tower ieta
int zside() const
get the z-side of the tower (1/-1)
std::vector< EcalTriggerPrimitiveSample > towtp_
virtual ~EcalTrigPrimFunctionalAlgo()
U second(std::pair< T, U > const &p)
int compressedEt() const
get the encoded/compressed Et of interesting sample
static const unsigned int maxNrTowers_
void initStructures(std::vector< std::vector< std::pair< int, std::vector< T >>>> &towMap)
void setSample(int i, const EcalTriggerPrimitiveSample &sam)
int ietaAbs() const
get the absolute value of the tower ieta
std::vector< double > vec1
std::vector< std::vector< std::pair< int, std::vector< EBDataFrame > > > > towerMapEB_
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 clean(std::vector< std::vector< std::pair< int, std::vector< T >>>> &towerMap)
int getIndex(const EBDigiCollection *, EcalTrigTowerDetId &id)
int getIndex(const EEDigiCollection *, EcalTrigTowerDetId &id)
int iphi() const
get the tower iphi
static const unsigned int maxNrTPs_
std::vector< std::vector< std::pair< int, std::vector< EEDataFrame > > > > towerMapEE_
EcalSubdetector subDet() const
get the subDetector associated to the Trigger Tower
std::unique_ptr< EcalFenixStrip > estrip_
std::vector< EcalTriggerPrimitiveSample > towtp2_
void run_part1_EB(EBDigiCollection const *col)
const EcalTrigTowerConstituentsMap * eTTmap_
Log< level::Warning, false > LogWarning
static const unsigned int nrSamples_
void run_part1_EE(EEDigiCollection const *col)
void run(const EBDigiCollection *col, EcalTrigPrimDigiCollection &result, EcalTrigPrimDigiCollection &resultTcp)
int findStripNr(const EBDetId &id)