13 mappingBuilder_(nullptr) {
20 for (
unsigned int sm = 0; sm <
NUMB_SM; sm++) {
21 for (
unsigned int fe = 0; fe <
NUMB_FE; fe++) {
23 for (
unsigned int xtal = 0; xtal <
NUMB_XTAL; xtal++) {
37 for (
unsigned int tccid = 0; tccid <
NUMB_TCC; tccid++) {
38 for (
unsigned int tpg = 0; tpg <
NUMB_FE; tpg++) {
46 for (
int tccid = 0; tccid <
NUMB_TCC; tccid++) {
57 for (
int u = 0; u < 2; u++) {
64 std::vector<unsigned int>* ids;
65 ids =
new std::vector<unsigned int>;
72 ids =
new std::vector<unsigned int>;
79 ids =
new std::vector<unsigned int>;
86 ids =
new std::vector<unsigned int>;
93 ids =
new std::vector<unsigned int>;
100 ids =
new std::vector<unsigned int>;
107 ids =
new std::vector<unsigned int>;
114 ids =
new std::vector<unsigned int>;
121 ids =
new std::vector<unsigned int>;
128 ids =
new std::vector<unsigned int>;
135 ids =
new std::vector<unsigned int>;
142 ids =
new std::vector<unsigned int>;
149 ids =
new std::vector<unsigned int>;
156 ids =
new std::vector<unsigned int>;
163 ids =
new std::vector<unsigned int>;
170 ids =
new std::vector<unsigned int>;
177 ids =
new std::vector<unsigned int>;
184 ids =
new std::vector<unsigned int>;
201 for (
unsigned int sm = 0; sm <
NUMB_SM; sm++) {
202 for (
unsigned int fe = 0; fe <
NUMB_FE; fe++) {
204 for (
unsigned int xtal = 0; xtal <
NUMB_XTAL; xtal++)
211 for (
size_t i = 0;
i <
srFlags_[sm][fe].size(); ++
i)
220 for (
int tccid = 0; tccid <
NUMB_TCC; tccid++) {
228 for (
unsigned int tccid = 0; tccid <
NUMB_TCC; tccid++) {
229 for (
unsigned int tpg = 0; tpg <
NUMB_FE; tpg++) {
240 std::map<unsigned int, std::vector<unsigned int>*>::iterator it;
269 std::ifstream dccMapFile_(aPath_.c_str());
272 if (!dccMapFile_.is_open())
318 if (orderedFedUnpackList.size() ==
orderedDCCIdList.size() && !orderedFedUnpackList.empty()) {
319 edm::LogInfo(
"EcalElectronicsMapper") <<
"DCCIdList/FedUnpackList lists given. Being loaded.";
321 std::string correspondence(
"list of pairs DCCId:FedId : ");
323 for (
int v = 0;
v < ((
int)orderedFedUnpackList.size());
v++) {
328 correspondence +=
tmp;
330 edm::LogInfo(
"EcalElectronicsMapper") << correspondence;
334 edm::LogInfo(
"EcalElectronicsMapper") <<
"No input DCCIdList/FedUnpackList lists given for ECAL unpacker" 335 <<
"(or given with different number of elements). " 336 <<
" Loading default association DCCIdList:FedUnpackList," 337 <<
"i.e. 1:601 ... 53:653, 54:654.";
339 for (
unsigned int v = 1;
v <= 54;
v++) {
349 o <<
"---------------------------------------------------------";
352 o <<
"No correct input for DCC map has been given yet...";
355 <<
"SM id\t\tDCCid ";
358 std::map<unsigned int, unsigned int> aMap;
360 std::map<unsigned int, unsigned int>::iterator iter;
363 for (iter = aMap.begin(); iter != aMap.end(); iter++)
364 o << iter->first <<
"\t\t" << iter->second;
367 o <<
"---------------------------------------------------------";
376 unsigned int nTT = 68;
403 std::map<unsigned int, unsigned int>::const_iterator it =
myDCCMap_.find(aSMId_);
411 edm::LogError(
"IncorrectMapping") <<
"DCC requested for SM id: " << aSMId_ <<
" not found";
418 std::map<unsigned int, unsigned int>::const_iterator it;
422 if (it->second == aDCCId_)
427 edm::LogError(
"IncorrectMapping") <<
"SM requested DCC id: " << aDCCId_ <<
" not found";
433 for (
int smId = 1; smId <= 54; smId++) {
435 if (smId > 9 && smId < 46) {
436 for (
int feChannel = 1; feChannel <= 68; feChannel++) {
454 for (
int ps = 1; ps <= 5; ps++) {
468 for (
unsigned int stripId = 1; stripId <= 5; stripId++) {
469 for (
unsigned int xtalId = 1; xtalId <= 5; xtalId++) {
484 std::vector<unsigned int>::iterator it;
486 for (it = pTCCIds->begin(); it != pTCCIds->end(); it++) {
487 unsigned int tccId = *it;
490 for (
unsigned int towerInTCC = 1; towerInTCC <=
numChannelsInDcc_[smId - 1]; towerInTCC++) {
504 for (
int ps = 1; ps <= 5; ps++) {
514 for (
unsigned int feChannel = 1; feChannel <=
numChannelsInDcc_[smId - 1]; feChannel++) {
524 for (
size_t i = 0;
i < scDetIds.size(); ++
i) {
536 std::vector<DetId>::iterator it;
539 for (it = ecalDetIds.begin(); it != ecalDetIds.end(); it++) {
543 int xtalId = ids.
xtalId();
565 std::vector<DetId>::iterator theTCCConstituent;
571 for (theTCCConstituent = tccConstituents.begin(); theTCCConstituent != tccConstituents.end(); theTCCConstituent++) {
590 for (
int ps = 0; ps < numStripInTT[
tccId][
towerId]; ps++) {
614 short tTandPs_tmp[18][2];
617 for (
int psCounter = 30; psCounter < 48; psCounter++) {
618 tTandPs_tmp[psCounter - 30][0] =
tTandPs_[
tccId][psCounter][0];
619 tTandPs_tmp[psCounter - 30][1] =
tTandPs_[
tccId][psCounter][1];
623 for (
int psCounter = 18; psCounter < 30; psCounter++) {
629 for (
int psCounter = 42; psCounter < 60; psCounter++) {
630 tTandPs_[
tccId][psCounter][0] = tTandPs_tmp[psCounter - 42][0];
631 tTandPs_[
tccId][psCounter][1] = tTandPs_tmp[psCounter - 42][1];
638 short tTandPs_tmp[18][2];
641 for (
int psCounter = 30; psCounter < 48; psCounter++) {
642 tTandPs_tmp[psCounter - 30][0] =
tTandPs_[
tccId][psCounter][0];
643 tTandPs_tmp[psCounter - 30][1] =
tTandPs_[
tccId][psCounter][1];
647 for (
int psCounter = 18; psCounter < 30; psCounter++) {
653 for (
int psCounter = 42; psCounter < 60; psCounter++) {
654 tTandPs_[
tccId][psCounter][0] = tTandPs_tmp[psCounter - 42][0];
655 tTandPs_[
tccId][psCounter][1] = tTandPs_tmp[psCounter - 42][1];
677 }
v[
n] = {{601, 10, 5}, {601, 34, 3}, {601, 34, 4}, {601, 34, 5}, {602, 32, 5}, {603, 12, 5}, {603, 30, 5},
678 {604, 12, 5}, {604, 30, 5}, {605, 32, 5}, {606, 10, 5}, {606, 34, 3}, {606, 34, 4}, {606, 34, 5},
679 {608, 27, 3}, {608, 27, 4}, {608, 27, 5}, {608, 3, 3}, {608, 3, 4}, {608, 3, 5}, {608, 30, 5},
680 {608, 6, 5}, {646, 10, 5}, {646, 34, 3}, {646, 34, 4}, {646, 34, 5}, {647, 32, 5}, {648, 12, 5},
681 {648, 30, 5}, {649, 12, 5}, {649, 30, 5}, {650, 32, 5}, {651, 10, 5}, {651, 34, 3}, {651, 34, 4},
682 {651, 34, 5}, {653, 27, 3}, {653, 27, 4}, {653, 27, 5}, {653, 3, 3}, {653, 3, 4}, {653, 3, 5},
683 {653, 30, 5}, {653, 6, 5}};
685 for (
int i = 0;
i <
n; ++
i)
704 34, 32, 33, 33, 32, 34, 33, 41, 33,
705 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
706 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
707 68, 68, 68, 68, 68, 68, 68, 68, 34, 32, 33, 33, 32, 34, 33, 41, 33};
std::string pathToMapFile_
std::map< unsigned int, std::vector< unsigned int > * > mapSmIdToTccIds_
const EcalElectronicsMapping * mappingBuilder_
unsigned int getSMId(unsigned int aDCCId) const
ret
prodAgent to be discontinued
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
unsigned int ebTccBlockLength_
std::ostream & operator<<(std::ostream &o, const EcalElectronicsMapper &aMapper_)
static const int MIN_TCCID_EEM
EcalTriggerElectronicsId getTriggerElectronicsId(const DetId &id) const
Get the trigger electronics id for this det id.
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< DetId > tccConstituents(int tccId) const
Get the constituent detids for this dccId.
void setEcalElectronicsMapping(const EcalElectronicsMapping *)
static const int MAX_TCCID_EEM
unsigned ttId(DetId const &, EcalElectronicsMapping const *)
std::map< unsigned int, unsigned int > myDCCMap_
EcalPseudoStripInputDigi * psInput_[NUMB_TCC][TCC_EB_NUMBTTS][NUMB_STRIP]
unsigned int eeTccBlockLength_
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
static const unsigned int numChannelsInDcc_[NUMB_SM]
static std::atomic< bool > silentMode_
bool setActiveDCC(unsigned int dccId)
bool makeMapFromVectors(std::vector< int > &, std::vector< int > &)
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
unsigned int unfilteredFEBlockLength_
EcalTrigTowerDetId getTrigTowerDetId(int TCCid, int iTT) const
Builds a EcalTrigTowerDetID from the TCCid & TriggerTower index in TCC.
unsigned int computeEETCCBlockLength()
bool isGhost(const int FED, const int CCU, const int VFE)
EcalTrigTowerDetId * ttDetIds_[NUMB_TCC][NUMB_FE]
std::vector< DetId > dccTowerConstituents(int dccId, int tower) const
Get the constituent detids for this dccId.
Log< level::Info, false > LogInfo
unsigned int numbXtalTSamples_
std::vector< EcalSrFlag * > srFlags_[NUMB_SM][NUMB_FE]
EcalElectronicsMapper(unsigned int numbOfXtalTSamples, unsigned int numbOfTriggerTSamples)
constexpr uint32_t rawId() const
get the raw id
int stripId() const
get the tower id
bool setDCCMapFilePath(std::string)
unsigned tccId(DetId const &, EcalElectronicsMapping const *)
short tTandPs_[NUMB_TCC][5 *EcalTrigTowerDetId::kEBTowersPerSM][2]
static const int MAX_TCCID_EEP
unsigned int computeUnfilteredFEBlockLength()
int xtalId() const
get the channel id
std::vector< EcalScDetId > getEcalScDetId(int DCCid, int DCC_Channel, bool ignoreSingleCrystal=true) const
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
unsigned int getDCCId(unsigned int aSMId) const
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...
unsigned int numbTriggerTSamples_
DetId getDetId(const EcalElectronicsId &id) const
Get the detid given an electronicsId.
EcalElectronicsId * scEleIds_[NUMB_SM][NUMB_FE]