1 #ifndef EcalTrigPrimFunctionalAlgo_h 2 #define EcalTrigPrimFunctionalAlgo_h 40 class ETPCoherenceTest;
50 int binofmax,
bool tcpFormat,
51 bool barrelOnly,
bool debug,
bool famos);
66 std::vector<std::vector<std::pair<
int, std::vector<typename Coll::Digi>>>>
80 ecaltpgWeightGroup, ecaltpgSlidW, ecaltpgFgStripEE,
81 ecaltpgBadX, ecaltpgStripStatus);
92 ecaltpgFineGrainEB, ecaltpgFineGrainTowerEE,
93 ecaltpgBadTT, ecaltpgSpike);
100 std::vector<std::vector<std::pair<
int, std::vector<T>>>> &towMap);
103 clean(std::vector<std::vector<std::pair<
int, std::vector<T>>>> &towerMap);
104 template <
class Coll>
107 std::vector<std::vector<std::pair<
int, std::vector<typename Coll::Digi>>>>
114 return id.hashedIndex();
118 int ind = (
id.ietaAbs() - 18) * 72 +
id.iphi();
141 static const unsigned int 144 static const unsigned int 146 static const unsigned int 155 std::vector<std::vector<std::pair<int, std::vector<EBDataFrame>>>>
157 std::vector<std::vector<std::pair<int, std::vector<EEDataFrame>>>>
160 std::vector<EcalTriggerPrimitiveSample>
towtp_;
161 std::vector<EcalTriggerPrimitiveSample>
towtp2_;
170 template <
class Coll>
173 std::vector<std::vector<std::pair<
int, std::vector<typename Coll::Digi>>>>
183 std::vector<typename Coll::Digi>
dummy;
189 for (
int itow = 0; itow <
nrTowers_; ++itow) {
196 for (
unsigned int i = 0;
i < towerMap[itow].size(); ++
i) {
197 std::vector<Digi> &df =
201 if ((towerMap[index])[
i].first > 0) {
207 bool isInInnerRings =
false;
210 isInInnerRings =
true;
212 isInInnerRings, thisTower);
217 if (isInInnerRings) {
219 int phi = 2 * ((thisTower.
iphi() - 1) / 2);
228 thisTower.
ietaAbs(), phi + 1));
231 thisTower.
ietaAbs(), phi + 2));
241 for (
int nrt = 0; nrt < nrTowers; nrt++) {
245 <<
"Too few samples produced, nr is " <<
towtp_.size();
249 for (
int i = firstSample;
i <= lastSample; ++
i) {
253 LogDebug(
"EcalTPG") <<
" For tower " << itow <<
" created TP nr " << nrTP
260 for (
int nrt = 0; nrt < nrTowers; nrt++) {
264 <<
"Too few samples produced, nr is " <<
towtp2_.size();
268 for (
int i = firstSample;
i <= lastSample; ++
i) {
286 template <
class Coll>
289 std::vector<std::vector<std::pair<
int, std::vector<typename Coll::Digi>>>>
297 LogDebug(
"EcalTPG") <<
"Fill mapping, Collection size = " << col->size();
298 for (
unsigned int i = 0;
i < col->size(); ++
i) {
305 for (
unsigned int ij = 0; ij < towerMap[
index].size(); ++ij)
306 filled += towerMap[index][ij].
first;
309 std::pair<int, EcalTrigTowerDetId>(
index, coarser);
313 int ncryst = towerMap[
index][stripnr - 1].first;
316 <<
"! Too many xtals for TT " << coarser <<
" stripnr " << stripnr
317 <<
" xtalid " << samples.id();
325 <<
"[EcalTrigPrimFunctionalAlgo] (found " << col->size()
326 <<
" frames in " << towerMap.size() <<
" towers) ";
328 LogDebug(
"EcalTPG") <<
"FillMap - FillMap Collection size=0 !!!!";
334 std::vector<std::vector<std::pair<
int, std::vector<T>>>> &towMap) {
338 (towMap[
i])[j].first = 0;
344 std::vector<std::vector<std::pair<
int, std::vector<T>>>> &towMap) {
350 vec1[
i] = std::pair<
int, std::vector<T>>(0, vec0);
void setPointers2(const EcalTPGFineGrainEBGroup *ecaltpgFgEBGroup, const EcalTPGLutGroup *ecaltpgLutGroup, const EcalTPGLutIdMap *ecaltpgLut, const EcalTPGFineGrainEBIdMap *ecaltpgFineGrainEB, const EcalTPGFineGrainTowerEE *ecaltpgFineGrainTowerEE, const EcalTPGTowerStatus *ecaltpgBadTT, const EcalTPGSpike *ecaltpgSpike)
const EcalElectronicsMapping * theMapping_
void setbadStripMissing(bool flag)
const CaloSubdetectorGeometry * theEndcapGeometry
std::vector< std::vector< int > > striptp_
void setPointers(const EcalTPGPedestals *ecaltpPed, const EcalTPGLinearizationConst *ecaltpLin, const EcalTPGWeightIdMap *ecaltpgWeightMap, const EcalTPGWeightGroup *ecaltpgWeightGroup, const EcalTPGSlidingWindow *ecaltpgSlidW, const EcalTPGFineGrainStripEE *ecaltpgFgStripEE, const EcalTPGCrystalStatus *ecaltpgBadX, const EcalTPGStripStatus *ecaltpgStripStatus)
class representing the Fenix chip, format strip
void fillMap(Coll const *col, std::vector< std::vector< std::pair< int, std::vector< typename Coll::Digi >>>> &towerMap)
void process(const edm::EventSetup &setup, std::vector< EBDataFrame > &bid, std::vector< std::vector< int >> &tpframetow, int nStr, std::vector< EcalTriggerPrimitiveSample > &tptow, std::vector< EcalTriggerPrimitiveSample > &tptow2, bool isInInnerRings, EcalTrigTowerDetId thisTower)
void push_back(T const &t)
def setup(process, global_tag, zero_tesla=False)
std::vector< std::pair< int, EcalTrigTowerDetId > > hitTowers_
static const unsigned int maxNrSamplesOut_
std::tuple< unsigned int, int, int, DigiType, int, int, int, float > Digi
edm::ESHandle< EcalTrigTowerConstituentsMap > eTTmap_
void process(const edm::EventSetup &, std::vector< const T > &, int nrxtals, std::vector< int > &out)
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_
EcalTrigPrimFunctionalAlgo(const edm::EventSetup &setup, int binofmax, bool tcpFormat, bool barrelOnly, bool debug, bool famos)
void initStructures(std::vector< std::vector< std::pair< int, std::vector< T >>>> &towMap)
void setPointers(const EcalTPGFineGrainEBGroup *ecaltpgFgEBGroup, const EcalTPGLutGroup *ecaltpgLutGroup, const EcalTPGLutIdMap *ecaltpgLut, const EcalTPGFineGrainEBIdMap *ecaltpgFineGrainEB, const EcalTPGFineGrainTowerEE *ecaltpgFineGrainTowerEE, const EcalTPGTowerStatus *ecaltpgBadTT, const EcalTPGSpike *ecaltpgSpike)
void setSample(int i, const EcalTriggerPrimitiveSample &sam)
int ietaAbs() const
get the absolute value of the tower ieta
std::vector< double > vec1
void run(const edm::EventSetup &, const EBDigiCollection *col, EcalTrigPrimDigiCollection &result, EcalTrigPrimDigiCollection &resultTcp)
std::vector< std::vector< std::pair< int, std::vector< EBDataFrame > > > > towerMapEB_
EcalFenixStripFgvbEE * getFGVB() const
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)
void run_part2(const edm::EventSetup &, Coll const *col, std::vector< std::vector< std::pair< int, std::vector< typename Coll::Digi >>>> &towerMap, EcalTrigPrimDigiCollection &result, EcalTrigPrimDigiCollection &resultTcp)
int iphi() const
get the tower iphi
void init(const edm::EventSetup &)
static const unsigned int maxNrTPs_
void setPointers(const EcalTPGLinearizationConst *ecaltpLin, const EcalTPGPedestals *ecaltpPed, const EcalTPGSlidingWindow *ecaltpgSlidW, const EcalTPGWeightIdMap *ecaltpgWeightMap, const EcalTPGWeightGroup *ecaltpgWeightGroup, const EcalTPGFineGrainStripEE *ecaltpgFgStripEE, const EcalTPGCrystalStatus *ecaltpgBadX, const EcalTPGStripStatus *ecaltpgStripStatus)
et
define resolution functions of each parameter
std::vector< std::vector< std::pair< int, std::vector< EEDataFrame > > > > towerMapEE_
EcalSubdetector subDet() const
get the subDetector associated to the Trigger Tower
std::vector< EcalTriggerPrimitiveSample > towtp2_
void run_part1_EB(EBDigiCollection const *col)
class representing the Fenix chip, format strip
static const unsigned int nrSamples_
void run_part1_EE(EEDigiCollection const *col)
int findStripNr(const EBDetId &id)