10 numbXtalTSamples_(numbXtalTSamples),
11 numbTriggerTSamples_(numbTriggerTSamples),
12 mappingBuilder_(nullptr) {
19 for (
unsigned int sm = 0; sm <
NUMB_SM; sm++) {
20 for (
unsigned int fe = 0; fe <
NUMB_FE; fe++) {
22 for (
unsigned int xtal = 0; xtal <
NUMB_XTAL; xtal++) {
36 for (
unsigned int tccid = 0; tccid <
NUMB_TCC; tccid++) {
37 for (
unsigned int tpg = 0; tpg <
NUMB_FE; tpg++) {
45 for (
int tccid = 0; tccid <
NUMB_TCC; tccid++) {
56 for (
int u = 0; u < 2; u++) {
63 std::vector<unsigned int>* ids;
64 ids =
new std::vector<unsigned int>;
71 ids =
new std::vector<unsigned int>;
78 ids =
new std::vector<unsigned int>;
85 ids =
new std::vector<unsigned int>;
92 ids =
new std::vector<unsigned int>;
99 ids =
new std::vector<unsigned int>;
106 ids =
new std::vector<unsigned int>;
113 ids =
new std::vector<unsigned int>;
120 ids =
new std::vector<unsigned int>;
127 ids =
new std::vector<unsigned int>;
134 ids =
new std::vector<unsigned int>;
141 ids =
new std::vector<unsigned int>;
148 ids =
new std::vector<unsigned int>;
155 ids =
new std::vector<unsigned int>;
162 ids =
new std::vector<unsigned int>;
169 ids =
new std::vector<unsigned int>;
176 ids =
new std::vector<unsigned int>;
183 ids =
new std::vector<unsigned int>;
200 for (
unsigned int sm = 0; sm <
NUMB_SM; sm++) {
201 for (
unsigned int fe = 0; fe <
NUMB_FE; fe++) {
203 for (
unsigned int xtal = 0; xtal <
NUMB_XTAL; xtal++)
210 for (
size_t i = 0;
i <
srFlags_[sm][fe].size(); ++
i)
219 for (
int tccid = 0; tccid <
NUMB_TCC; tccid++) {
227 for (
unsigned int tccid = 0; tccid <
NUMB_TCC; tccid++) {
228 for (
unsigned int tpg = 0; tpg <
NUMB_FE; tpg++) {
239 std::map<unsigned int, std::vector<unsigned int>*>::iterator it;
268 std::ifstream dccMapFile_(aPath_.c_str());
271 if (!dccMapFile_.is_open())
317 if (orderedFedUnpackList.size() == orderedDCCIdList.size() && !orderedFedUnpackList.empty()) {
318 edm::LogInfo(
"EcalElectronicsMapper") <<
"DCCIdList/FedUnpackList lists given. Being loaded.";
320 std::string correspondence(
"list of pairs DCCId:FedId : ");
322 for (
int v = 0;
v < ((int)orderedFedUnpackList.size());
v++) {
323 myDCCMap_[orderedDCCIdList[
v]] = orderedFedUnpackList[
v];
325 sprintf(onePair,
" %d:%d", orderedDCCIdList[
v], orderedFedUnpackList[v]);
327 correspondence +=
tmp;
329 edm::LogInfo(
"EcalElectronicsMapper") << correspondence;
333 edm::LogInfo(
"EcalElectronicsMapper") <<
"No input DCCIdList/FedUnpackList lists given for ECAL unpacker"
334 <<
"(or given with different number of elements). "
335 <<
" Loading default association DCCIdList:FedUnpackList,"
336 <<
"i.e. 1:601 ... 53:653, 54:654.";
338 for (
unsigned int v = 1;
v <= 54;
v++) {
348 o <<
"---------------------------------------------------------";
351 o <<
"No correct input for DCC map has been given yet...";
354 <<
"SM id\t\tDCCid ";
357 std::map<unsigned int, unsigned int> aMap;
359 std::map<unsigned int, unsigned int>::iterator iter;
362 for (iter = aMap.begin(); iter != aMap.end(); iter++)
363 o << iter->first <<
"\t\t" << iter->second;
366 o <<
"---------------------------------------------------------";
375 unsigned int nTT = 68;
402 std::map<unsigned int, unsigned int>::const_iterator it =
myDCCMap_.find(aSMId_);
410 edm::LogError(
"IncorrectMapping") <<
"DCC requested for SM id: " << aSMId_ <<
" not found";
417 std::map<unsigned int, unsigned int>::const_iterator it;
421 if (it->second == aDCCId_)
426 edm::LogError(
"IncorrectMapping") <<
"SM requested DCC id: " << aDCCId_ <<
" not found";
432 for (
int smId = 1; smId <= 54; smId++) {
434 if (smId > 9 && smId < 46) {
435 for (
int feChannel = 1; feChannel <= 68; feChannel++) {
442 ttDetIds_[tccId - 1][feChannel - 1] = ttDetId;
444 ttEleIds_[tccId - 1][feChannel - 1] = ttEleId;
453 for (
int ps = 1; ps <= 5; ps++) {
454 psInput_[tccId - 1][feChannel - 1][ps - 1] =
467 for (
unsigned int stripId = 1; stripId <= 5; stripId++) {
468 for (
unsigned int xtalId = 1; xtalId <= 5; xtalId++) {
471 xtalDetIds_[smId - 1][feChannel - 1][stripId - 1][xtalId - 1] = detId;
483 std::vector<unsigned int>::iterator it;
485 for (it = pTCCIds->begin(); it != pTCCIds->end(); it++) {
486 unsigned int tccId = *it;
489 for (
unsigned int towerInTCC = 1; towerInTCC <=
numChannelsInDcc_[smId - 1]; towerInTCC++) {
503 for (
int ps = 1; ps <= 5; ps++) {
504 psInput_[tccId - 1][towerInTCC - 1][ps - 1] =
513 for (
unsigned int feChannel = 1; feChannel <=
numChannelsInDcc_[smId - 1]; feChannel++) {
523 for (
size_t i = 0;
i < scDetIds.size(); ++
i) {
535 std::vector<DetId>::iterator it;
538 for (it = ecalDetIds.begin(); it != ecalDetIds.end(); it++) {
542 int xtalId = ids.
xtalId();
545 xtalDetIds_[smId - 1][feChannel - 1][stripId - 1][xtalId - 1] = detId;
564 std::vector<DetId>::iterator theTCCConstituent;
570 for (theTCCConstituent = tccConstituents.begin(); theTCCConstituent != tccConstituents.end(); theTCCConstituent++) {
573 if (ps > numStripInTT[
tccId][towerId - 1])
574 numStripInTT[
tccId][towerId - 1] = ps;
589 for (
int ps = 0; ps < numStripInTT[
tccId][
towerId]; ps++) {
613 short tTandPs_tmp[18][2];
616 for (
int psCounter = 30; psCounter < 48; psCounter++) {
617 tTandPs_tmp[psCounter - 30][0] =
tTandPs_[
tccId][psCounter][0];
618 tTandPs_tmp[psCounter - 30][1] =
tTandPs_[
tccId][psCounter][1];
622 for (
int psCounter = 18; psCounter < 30; psCounter++) {
628 for (
int psCounter = 42; psCounter < 60; psCounter++) {
629 tTandPs_[
tccId][psCounter][0] = tTandPs_tmp[psCounter - 42][0];
630 tTandPs_[
tccId][psCounter][1] = tTandPs_tmp[psCounter - 42][1];
637 short tTandPs_tmp[18][2];
640 for (
int psCounter = 30; psCounter < 48; psCounter++) {
641 tTandPs_tmp[psCounter - 30][0] =
tTandPs_[
tccId][psCounter][0];
642 tTandPs_tmp[psCounter - 30][1] =
tTandPs_[
tccId][psCounter][1];
646 for (
int psCounter = 18; psCounter < 30; psCounter++) {
652 for (
int psCounter = 42; psCounter < 60; psCounter++) {
653 tTandPs_[
tccId][psCounter][0] = tTandPs_tmp[psCounter - 42][0];
654 tTandPs_[
tccId][psCounter][1] = tTandPs_tmp[psCounter - 42][1];
676 }
v[
n] = {{601, 10, 5}, {601, 34, 3}, {601, 34, 4}, {601, 34, 5}, {602, 32, 5}, {603, 12, 5}, {603, 30, 5},
677 {604, 12, 5}, {604, 30, 5}, {605, 32, 5}, {606, 10, 5}, {606, 34, 3}, {606, 34, 4}, {606, 34, 5},
678 {608, 27, 3}, {608, 27, 4}, {608, 27, 5}, {608, 3, 3}, {608, 3, 4}, {608, 3, 5}, {608, 30, 5},
679 {608, 6, 5}, {646, 10, 5}, {646, 34, 3}, {646, 34, 4}, {646, 34, 5}, {647, 32, 5}, {648, 12, 5},
680 {648, 30, 5}, {649, 12, 5}, {649, 30, 5}, {650, 32, 5}, {651, 10, 5}, {651, 34, 3}, {651, 34, 4},
681 {651, 34, 5}, {653, 27, 3}, {653, 27, 4}, {653, 27, 5}, {653, 3, 3}, {653, 3, 4}, {653, 3, 5},
682 {653, 30, 5}, {653, 6, 5}};
684 for (
int i = 0;
i <
n; ++
i)
703 34, 32, 33, 33, 32, 34, 33, 41, 33,
704 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
705 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
706 68, 68, 68, 68, 68, 68, 68, 68, 34, 32, 33, 33, 32, 34, 33, 41, 33};
std::string pathToMapFile_
tuple ret
prodAgent to be discontinued
unsigned int getSMId(unsigned int aDCCId) const
int xtalId() const
get the channel id
std::map< unsigned int, std::vector< unsigned int > * > mapSmIdToTccIds_
const EcalElectronicsMapping * mappingBuilder_
int stripId() const
get the tower id
std::vector< DetId > tccConstituents(int tccId) const
Get the constituent detids for this dccId.
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
EcalTriggerPrimitiveDigi * ttTPIds_[NUMB_TCC][NUMB_FE]
static const int MIN_TCCID_EEP
EcalElectronicsId * ttEleIds_[NUMB_TCC][NUMB_FE]
static const int MAX_TCCID
constexpr uint32_t rawId() const
get the raw id
unsigned int ebTccBlockLength_
static const int MIN_TCCID_EEM
EcalTrigTowerDetId getTrigTowerDetId(int TCCid, int iTT) const
Builds a EcalTrigTowerDetID from the TCCid & TriggerTower index in TCC.
Log< level::Error, false > LogError
std::ostream & operator<<(std::ostream &out, const ALILine &li)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void setEcalElectronicsMapping(const EcalElectronicsMapping *)
static const int MAX_TCCID_EEM
unsigned ttId(DetId const &, EcalElectronicsMapping const *)
std::map< unsigned int, unsigned int > myDCCMap_
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
EcalPseudoStripInputDigi * psInput_[NUMB_TCC][TCC_EB_NUMBTTS][NUMB_STRIP]
unsigned int eeTccBlockLength_
unsigned int getDCCId(unsigned int aSMId) const
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
void setSample(int i, const EcalTriggerPrimitiveSample &sam)
static const unsigned int numChannelsInDcc_[NUMB_SM]
static std::atomic< bool > silentMode_
bool setActiveDCC(unsigned int dccId)
if(conf_.getParameter< bool >("UseStripCablingDB"))
bool makeMapFromVectors(std::vector< int > &, std::vector< int > &)
EcalTriggerElectronicsId getTriggerElectronicsId(const DetId &id) const
Get the trigger electronics id for this det id.
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
unsigned int unfilteredFEBlockLength_
tuple numbTriggerTSamples
unsigned int computeEETCCBlockLength()
std::vector< EcalScDetId > getEcalScDetId(int DCCid, int DCC_Channel, bool ignoreSingleCrystal=true) const
bool isGhost(const int FED, const int CCU, const int VFE)
EcalTrigTowerDetId * ttDetIds_[NUMB_TCC][NUMB_FE]
Log< level::Info, false > LogInfo
unsigned int numbXtalTSamples_
std::vector< EcalSrFlag * > srFlags_[NUMB_SM][NUMB_FE]
EcalElectronicsMapper(unsigned int numbOfXtalTSamples, unsigned int numbOfTriggerTSamples)
bool setDCCMapFilePath(std::string)
unsigned tccId(DetId const &, EcalElectronicsMapping const *)
short tTandPs_[NUMB_TCC][5 *EcalTrigTowerDetId::kEBTowersPerSM][2]
DetId getDetId(const EcalElectronicsId &id) const
Get the detid given an electronicsId.
static const int MAX_TCCID_EEP
unsigned int computeUnfilteredFEBlockLength()
std::map< int, std::map< int, std::map< int, bool > > > ghost_
bool isTCCExternal(unsigned int TCCId)
unsigned int computeEBTCCBlockLength()
static const int kEBTowersPerSM
DetId * xtalDetIds_[NUMB_SM][NUMB_FE][NUMB_STRIP][NUMB_XTAL]
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
tuple size
Write out results.
unsigned int numbTriggerTSamples_
std::vector< DetId > dccTowerConstituents(int dccId, int tower) const
Get the constituent detids for this dccId.
EcalElectronicsId * scEleIds_[NUMB_SM][NUMB_FE]