File indexing completed on 2024-09-07 04:36:10
0001 #include <cassert>
0002 #include <FWCore/MessageLogger/interface/MessageLogger.h>
0003 #include <EventFilter/EcalRawToDigi/interface/EcalElectronicsMapper.h>
0004 #include <Geometry/EcalMapping/interface/EcalElectronicsMapping.h>
0005 #include <DataFormats/EcalDigi/interface/EBSrFlag.h>
0006 #include <DataFormats/EcalDigi/interface/EESrFlag.h>
0007 #include <EventFilter/EcalRawToDigi/interface/DCCDataUnpacker.h>
0008
0009 EcalElectronicsMapper::EcalElectronicsMapper(unsigned int numbXtalTSamples, unsigned int numbTriggerTSamples)
0010 : pathToMapFile_(""),
0011 numbXtalTSamples_(numbXtalTSamples),
0012 numbTriggerTSamples_(numbTriggerTSamples),
0013 mappingBuilder_(nullptr) {
0014 resetPointers();
0015 setupGhostMap();
0016 }
0017
0018 void EcalElectronicsMapper::resetPointers() {
0019
0020 for (unsigned int sm = 0; sm < NUMB_SM; sm++) {
0021 for (unsigned int fe = 0; fe < NUMB_FE; fe++) {
0022 for (unsigned int strip = 0; strip < NUMB_STRIP; strip++) {
0023 for (unsigned int xtal = 0; xtal < NUMB_XTAL; xtal++) {
0024
0025 xtalDetIds_[sm][fe][strip][xtal] = nullptr;
0026 }
0027 }
0028
0029
0030
0031 scEleIds_[sm][fe] = nullptr;
0032
0033 }
0034 }
0035
0036
0037 for (unsigned int tccid = 0; tccid < NUMB_TCC; tccid++) {
0038 for (unsigned int tpg = 0; tpg < NUMB_FE; tpg++) {
0039 ttDetIds_[tccid][tpg] = nullptr;
0040 ttTPIds_[tccid][tpg] = nullptr;
0041 ttEleIds_[tccid][tpg] = nullptr;
0042 }
0043 }
0044
0045
0046 for (int tccid = 0; tccid < NUMB_TCC; tccid++) {
0047 for (int ttid = 0; ttid < TCC_EB_NUMBTTS; ttid++) {
0048 for (int ps = 0; ps < NUMB_STRIP; ps++) {
0049 psInput_[tccid][ttid][ps] = nullptr;
0050 }
0051 }
0052 }
0053
0054
0055 for (int tccId = 0; tccId < EcalTriggerElectronicsId::MAX_TCCID; tccId++) {
0056 for (int psCounter = 0; psCounter < EcalTrigTowerDetId::kEBTowersPerSM * 5; psCounter++) {
0057 for (int u = 0; u < 2; u++) {
0058 tTandPs_[tccId][psCounter][u] = -1;
0059 }
0060 }
0061 }
0062
0063
0064 std::vector<unsigned int>* ids;
0065 ids = new std::vector<unsigned int>;
0066 ids->push_back(1);
0067 ids->push_back(18);
0068 ids->push_back(19);
0069 ids->push_back(36);
0070 mapSmIdToTccIds_[1] = ids;
0071
0072 ids = new std::vector<unsigned int>;
0073 ids->push_back(2);
0074 ids->push_back(3);
0075 ids->push_back(20);
0076 ids->push_back(21);
0077 mapSmIdToTccIds_[2] = ids;
0078
0079 ids = new std::vector<unsigned int>;
0080 ids->push_back(4);
0081 ids->push_back(5);
0082 ids->push_back(22);
0083 ids->push_back(23);
0084 mapSmIdToTccIds_[3] = ids;
0085
0086 ids = new std::vector<unsigned int>;
0087 ids->push_back(6);
0088 ids->push_back(7);
0089 ids->push_back(24);
0090 ids->push_back(25);
0091 mapSmIdToTccIds_[4] = ids;
0092
0093 ids = new std::vector<unsigned int>;
0094 ids->push_back(8);
0095 ids->push_back(9);
0096 ids->push_back(26);
0097 ids->push_back(27);
0098 mapSmIdToTccIds_[5] = ids;
0099
0100 ids = new std::vector<unsigned int>;
0101 ids->push_back(10);
0102 ids->push_back(11);
0103 ids->push_back(28);
0104 ids->push_back(29);
0105 mapSmIdToTccIds_[6] = ids;
0106
0107 ids = new std::vector<unsigned int>;
0108 ids->push_back(12);
0109 ids->push_back(13);
0110 ids->push_back(30);
0111 ids->push_back(31);
0112 mapSmIdToTccIds_[7] = ids;
0113
0114 ids = new std::vector<unsigned int>;
0115 ids->push_back(14);
0116 ids->push_back(15);
0117 ids->push_back(32);
0118 ids->push_back(33);
0119 mapSmIdToTccIds_[8] = ids;
0120
0121 ids = new std::vector<unsigned int>;
0122 ids->push_back(16);
0123 ids->push_back(17);
0124 ids->push_back(34);
0125 ids->push_back(35);
0126 mapSmIdToTccIds_[9] = ids;
0127
0128 ids = new std::vector<unsigned int>;
0129 ids->push_back(73);
0130 ids->push_back(90);
0131 ids->push_back(91);
0132 ids->push_back(108);
0133 mapSmIdToTccIds_[46] = ids;
0134
0135 ids = new std::vector<unsigned int>;
0136 ids->push_back(74);
0137 ids->push_back(75);
0138 ids->push_back(92);
0139 ids->push_back(93);
0140 mapSmIdToTccIds_[47] = ids;
0141
0142 ids = new std::vector<unsigned int>;
0143 ids->push_back(76);
0144 ids->push_back(77);
0145 ids->push_back(94);
0146 ids->push_back(95);
0147 mapSmIdToTccIds_[48] = ids;
0148
0149 ids = new std::vector<unsigned int>;
0150 ids->push_back(78);
0151 ids->push_back(79);
0152 ids->push_back(96);
0153 ids->push_back(97);
0154 mapSmIdToTccIds_[49] = ids;
0155
0156 ids = new std::vector<unsigned int>;
0157 ids->push_back(80);
0158 ids->push_back(81);
0159 ids->push_back(98);
0160 ids->push_back(99);
0161 mapSmIdToTccIds_[50] = ids;
0162
0163 ids = new std::vector<unsigned int>;
0164 ids->push_back(82);
0165 ids->push_back(83);
0166 ids->push_back(100);
0167 ids->push_back(101);
0168 mapSmIdToTccIds_[51] = ids;
0169
0170 ids = new std::vector<unsigned int>;
0171 ids->push_back(84);
0172 ids->push_back(85);
0173 ids->push_back(102);
0174 ids->push_back(103);
0175 mapSmIdToTccIds_[52] = ids;
0176
0177 ids = new std::vector<unsigned int>;
0178 ids->push_back(86);
0179 ids->push_back(87);
0180 ids->push_back(104);
0181 ids->push_back(105);
0182 mapSmIdToTccIds_[53] = ids;
0183
0184 ids = new std::vector<unsigned int>;
0185 ids->push_back(88);
0186 ids->push_back(89);
0187 ids->push_back(106);
0188 ids->push_back(107);
0189 mapSmIdToTccIds_[54] = ids;
0190
0191
0192 unfilteredFEBlockLength_ = computeUnfilteredFEBlockLength();
0193 ebTccBlockLength_ = computeEBTCCBlockLength();
0194 eeTccBlockLength_ = computeEETCCBlockLength();
0195 }
0196
0197 EcalElectronicsMapper::~EcalElectronicsMapper() { deletePointers(); }
0198
0199 void EcalElectronicsMapper::deletePointers() {
0200
0201 for (unsigned int sm = 0; sm < NUMB_SM; sm++) {
0202 for (unsigned int fe = 0; fe < NUMB_FE; fe++) {
0203 for (unsigned int strip = 0; strip < NUMB_STRIP; strip++) {
0204 for (unsigned int xtal = 0; xtal < NUMB_XTAL; xtal++)
0205 delete xtalDetIds_[sm][fe][strip][xtal];
0206 }
0207
0208
0209
0210
0211 for (size_t i = 0; i < srFlags_[sm][fe].size(); ++i)
0212 delete srFlags_[sm][fe][i];
0213 srFlags_[sm][fe].clear();
0214
0215 delete scEleIds_[sm][fe];
0216 }
0217 }
0218
0219
0220 for (int tccid = 0; tccid < NUMB_TCC; tccid++) {
0221 for (int ttid = 0; ttid < TCC_EB_NUMBTTS; ttid++) {
0222 for (int ps = 0; ps < NUMB_STRIP; ps++) {
0223 delete psInput_[tccid][ttid][ps];
0224 }
0225 }
0226 }
0227
0228 for (unsigned int tccid = 0; tccid < NUMB_TCC; tccid++) {
0229 for (unsigned int tpg = 0; tpg < NUMB_FE; tpg++) {
0230 if (ttDetIds_[tccid][tpg]) {
0231 delete ttDetIds_[tccid][tpg];
0232 delete ttTPIds_[tccid][tpg];
0233 delete ttEleIds_[tccid][tpg];
0234 }
0235 }
0236 }
0237
0238 pathToMapFile_.clear();
0239
0240 std::map<unsigned int, std::vector<unsigned int>*>::iterator it;
0241 for (it = mapSmIdToTccIds_.begin(); it != mapSmIdToTccIds_.end(); it++) {
0242 delete (*it).second;
0243 }
0244
0245 mapSmIdToTccIds_.clear();
0246 }
0247
0248 void EcalElectronicsMapper::setEcalElectronicsMapping(const EcalElectronicsMapping* m) {
0249 mappingBuilder_ = m;
0250 fillMaps();
0251 }
0252
0253 bool EcalElectronicsMapper::setActiveDCC(unsigned int dccId) {
0254 bool ret(true);
0255
0256
0257 dccId_ = dccId;
0258
0259 smId_ = getSMId(dccId_);
0260
0261 if (!smId_)
0262 ret = false;
0263
0264 return ret;
0265 }
0266
0267 bool EcalElectronicsMapper::setDCCMapFilePath(std::string aPath_) {
0268
0269 std::ifstream dccMapFile_(aPath_.c_str());
0270
0271
0272 if (!dccMapFile_.is_open())
0273 return false;
0274
0275
0276 dccMapFile_.close();
0277 pathToMapFile_ = aPath_;
0278
0279 return true;
0280 }
0281
0282
0283
0284
0285
0286
0287
0288
0289
0290
0291
0292
0293
0294
0295
0296
0297
0298
0299
0300
0301
0302
0303
0304
0305
0306
0307
0308
0309
0310
0311
0312
0313
0314
0315 bool EcalElectronicsMapper::makeMapFromVectors(std::vector<int>& orderedFedUnpackList,
0316 std::vector<int>& orderedDCCIdList) {
0317
0318 if (orderedFedUnpackList.size() == orderedDCCIdList.size() && !orderedFedUnpackList.empty()) {
0319 edm::LogInfo("EcalElectronicsMapper") << "DCCIdList/FedUnpackList lists given. Being loaded.";
0320
0321 std::string correspondence("list of pairs DCCId:FedId : ");
0322 char onePair[50];
0323 for (int v = 0; v < ((int)orderedFedUnpackList.size()); v++) {
0324 myDCCMap_[orderedDCCIdList[v]] = orderedFedUnpackList[v];
0325
0326 sprintf(onePair, " %d:%d", orderedDCCIdList[v], orderedFedUnpackList[v]);
0327 std::string tmp(onePair);
0328 correspondence += tmp;
0329 }
0330 edm::LogInfo("EcalElectronicsMapper") << correspondence;
0331
0332 } else {
0333
0334 edm::LogInfo("EcalElectronicsMapper") << "No input DCCIdList/FedUnpackList lists given for ECAL unpacker"
0335 << "(or given with different number of elements). "
0336 << " Loading default association DCCIdList:FedUnpackList,"
0337 << "i.e. 1:601 ... 53:653, 54:654.";
0338
0339 for (unsigned int v = 1; v <= 54; v++) {
0340 myDCCMap_[v] = (v + 600);
0341 }
0342 }
0343
0344 return true;
0345 }
0346
0347 std::ostream& operator<<(std::ostream& o, const EcalElectronicsMapper& aMapper_) {
0348
0349 o << "---------------------------------------------------------";
0350
0351 if (aMapper_.pathToMapFile_.empty()) {
0352 o << "No correct input for DCC map has been given yet...";
0353 } else {
0354 o << "DCC Map (Map file: " << aMapper_.pathToMapFile_ << " )"
0355 << "SM id\t\tDCCid ";
0356
0357
0358 std::map<unsigned int, unsigned int> aMap;
0359 aMap = aMapper_.myDCCMap_;
0360 std::map<unsigned int, unsigned int>::iterator iter;
0361
0362
0363 for (iter = aMap.begin(); iter != aMap.end(); iter++)
0364 o << iter->first << "\t\t" << iter->second;
0365 }
0366
0367 o << "---------------------------------------------------------";
0368 return o;
0369 }
0370
0371 unsigned int EcalElectronicsMapper::computeUnfilteredFEBlockLength() {
0372 return ((numbXtalTSamples_ - 2) / 4 + 1) * 25 + 1;
0373 }
0374
0375 unsigned int EcalElectronicsMapper::computeEBTCCBlockLength() {
0376 unsigned int nTT = 68;
0377 unsigned int tf;
0378
0379
0380 if ((nTT * numbTriggerTSamples_) < 4 || (nTT * numbTriggerTSamples_) % 4)
0381 tf = 1;
0382 else
0383 tf = 0;
0384
0385 return 1 + ((nTT * numbTriggerTSamples_) / 4) + tf;
0386 }
0387
0388 unsigned int EcalElectronicsMapper::computeEETCCBlockLength() {
0389
0390 return 9;
0391 }
0392
0393 bool EcalElectronicsMapper::isTCCExternal(unsigned int TCCId) {
0394 if ((NUMB_TCC_EE_MIN_EXT_MIN <= TCCId && TCCId <= NUMB_TCC_EE_MIN_EXT_MAX) ||
0395 (NUMB_TCC_EE_PLU_EXT_MIN <= TCCId && TCCId <= NUMB_TCC_EE_PLU_EXT_MAX))
0396 return true;
0397 else
0398 return false;
0399 }
0400
0401 unsigned int EcalElectronicsMapper::getDCCId(unsigned int aSMId_) const {
0402
0403 std::map<unsigned int, unsigned int>::const_iterator it = myDCCMap_.find(aSMId_);
0404
0405
0406 if (it != myDCCMap_.end())
0407 return it->second;
0408
0409
0410 if (!DCCDataUnpacker::silentMode_) {
0411 edm::LogError("IncorrectMapping") << "DCC requested for SM id: " << aSMId_ << " not found";
0412 }
0413 return 0;
0414 }
0415
0416 unsigned int EcalElectronicsMapper::getSMId(unsigned int aDCCId_) const {
0417
0418 std::map<unsigned int, unsigned int>::const_iterator it;
0419
0420
0421 for (it = myDCCMap_.begin(); it != myDCCMap_.end(); it++)
0422 if (it->second == aDCCId_)
0423 return it->first;
0424
0425
0426 if (!DCCDataUnpacker::silentMode_) {
0427 edm::LogError("IncorrectMapping") << "SM requested DCC id: " << aDCCId_ << " not found";
0428 }
0429 return 0;
0430 }
0431
0432 void EcalElectronicsMapper::fillMaps() {
0433 for (int smId = 1; smId <= 54; smId++) {
0434
0435 if (smId > 9 && smId < 46) {
0436 for (int feChannel = 1; feChannel <= 68; feChannel++) {
0437 unsigned int tccId = smId + TCCID_SMID_SHIFT_EB;
0438
0439
0440
0441 unsigned int rawid = (mappingBuilder_->getTrigTowerDetId(tccId, feChannel)).rawId();
0442 EcalTrigTowerDetId* ttDetId = new EcalTrigTowerDetId(rawid);
0443 ttDetIds_[tccId - 1][feChannel - 1] = ttDetId;
0444 EcalElectronicsId* ttEleId = new EcalElectronicsId(smId, feChannel, 1, 1);
0445 ttEleIds_[tccId - 1][feChannel - 1] = ttEleId;
0446 EcalTriggerPrimitiveDigi* tp = new EcalTriggerPrimitiveDigi(*ttDetId);
0447 tp->setSize(numbTriggerTSamples_);
0448 for (unsigned int i = 0; i < numbTriggerTSamples_; i++) {
0449 tp->setSample(i, EcalTriggerPrimitiveSample(0));
0450 }
0451 ttTPIds_[tccId - 1][feChannel - 1] = tp;
0452
0453
0454 for (int ps = 1; ps <= 5; ps++) {
0455 psInput_[tccId - 1][feChannel - 1][ps - 1] =
0456 new EcalPseudoStripInputDigi(EcalTriggerElectronicsId(tccId, feChannel, ps, 1));
0457 psInput_[tccId - 1][feChannel - 1][ps - 1]->setSize(1);
0458 psInput_[tccId - 1][feChannel - 1][ps - 1]->setSample(0, EcalPseudoStripInputSample(0));
0459 }
0460
0461
0462 srFlags_[smId - 1][feChannel - 1].push_back(new EBSrFlag(*ttDetId, 0));
0463
0464
0465
0466 assert(srFlags_[smId - 1][feChannel - 1].size() == 1);
0467
0468 for (unsigned int stripId = 1; stripId <= 5; stripId++) {
0469 for (unsigned int xtalId = 1; xtalId <= 5; xtalId++) {
0470 EcalElectronicsId eid(smId, feChannel, stripId, xtalId);
0471 EBDetId* detId = new EBDetId((mappingBuilder_->getDetId(eid)).rawId());
0472 xtalDetIds_[smId - 1][feChannel - 1][stripId - 1][xtalId - 1] = detId;
0473
0474 }
0475 }
0476
0477 }
0478
0479 }
0480
0481
0482 else {
0483 std::vector<unsigned int>* pTCCIds = mapSmIdToTccIds_[smId];
0484 std::vector<unsigned int>::iterator it;
0485
0486 for (it = pTCCIds->begin(); it != pTCCIds->end(); it++) {
0487 unsigned int tccId = *it;
0488
0489
0490 for (unsigned int towerInTCC = 1; towerInTCC <= numChannelsInDcc_[smId - 1]; towerInTCC++) {
0491
0492 EcalTrigTowerDetId ttDetId = mappingBuilder_->getTrigTowerDetId(tccId, towerInTCC);
0493
0494 ttDetIds_[tccId - 1][towerInTCC - 1] = new EcalTrigTowerDetId(ttDetId.rawId());
0495 EcalTriggerPrimitiveDigi* tp = new EcalTriggerPrimitiveDigi(ttDetId);
0496 tp->setSize(numbTriggerTSamples_);
0497 for (unsigned int i = 0; i < numbTriggerTSamples_; i++) {
0498 tp->setSample(i, EcalTriggerPrimitiveSample(0));
0499 }
0500
0501 ttTPIds_[tccId - 1][towerInTCC - 1] = tp;
0502
0503
0504 for (int ps = 1; ps <= 5; ps++) {
0505 psInput_[tccId - 1][towerInTCC - 1][ps - 1] =
0506 new EcalPseudoStripInputDigi(EcalTriggerElectronicsId(tccId, towerInTCC, ps, 1));
0507 psInput_[tccId - 1][towerInTCC - 1][ps - 1]->setSize(1);
0508 psInput_[tccId - 1][towerInTCC - 1][ps - 1]->setSample(0, EcalPseudoStripInputSample(0));
0509 }
0510 }
0511 }
0512
0513
0514 for (unsigned int feChannel = 1; feChannel <= numChannelsInDcc_[smId - 1]; feChannel++) {
0515
0516 if ((smId == SECTOR_EEM_CCU_JUMP || smId == SECTOR_EEP_CCU_JUMP) &&
0517 (MIN_CCUID_JUMP <= feChannel && feChannel <= MAX_CCUID_JUMP))
0518 continue;
0519
0520 std::vector<EcalScDetId> scDetIds = mappingBuilder_->getEcalScDetId(smId, feChannel);
0521
0522 scEleIds_[smId - 1][feChannel - 1] = new EcalElectronicsId(smId, feChannel, 1, 1);
0523
0524 for (size_t i = 0; i < scDetIds.size(); ++i) {
0525
0526
0527
0528
0529 srFlags_[smId - 1][feChannel - 1].push_back(new EESrFlag(EcalScDetId(scDetIds[i].rawId()), 0));
0530 }
0531
0532
0533 assert(srFlags_[smId - 1][feChannel - 1].size() <= 3);
0534
0535 std::vector<DetId> ecalDetIds = mappingBuilder_->dccTowerConstituents(smId, feChannel);
0536 std::vector<DetId>::iterator it;
0537
0538
0539 for (it = ecalDetIds.begin(); it != ecalDetIds.end(); it++) {
0540 EcalElectronicsId ids = mappingBuilder_->getElectronicsId((*it));
0541
0542 int stripId = ids.stripId();
0543 int xtalId = ids.xtalId();
0544
0545 EEDetId* detId = new EEDetId((*it).rawId());
0546 xtalDetIds_[smId - 1][feChannel - 1][stripId - 1][xtalId - 1] = detId;
0547 }
0548
0549 }
0550
0551 }
0552 }
0553
0554
0555
0556 short numStripInTT[EcalTriggerElectronicsId::MAX_TCCID][EcalTrigTowerDetId::kEBTowersPerSM];
0557 for (int tccId = 0; tccId < EcalTriggerElectronicsId::MAX_TCCID; tccId++) {
0558 for (int tt = 0; tt < EcalTrigTowerDetId::kEBTowersPerSM; tt++) {
0559 numStripInTT[tccId][tt] = -2;
0560 }
0561 }
0562
0563
0564
0565 std::vector<DetId>::iterator theTCCConstituent;
0566 for (int tccId = 0; tccId < EcalTriggerElectronicsId::MAX_TCCID; tccId++) {
0567
0568
0569 std::vector<DetId> tccConstituents = mappingBuilder_->tccConstituents(tccId + 1);
0570
0571 for (theTCCConstituent = tccConstituents.begin(); theTCCConstituent != tccConstituents.end(); theTCCConstituent++) {
0572 int towerId = (mappingBuilder_->getTriggerElectronicsId(*theTCCConstituent)).ttId();
0573 int ps = (mappingBuilder_->getTriggerElectronicsId(*theTCCConstituent)).pseudoStripId();
0574 if (ps > numStripInTT[tccId][towerId - 1])
0575 numStripInTT[tccId][towerId - 1] = ps;
0576
0577
0578
0579
0580 }
0581
0582 }
0583
0584 int psCounter;
0585 for (int tccId = 0; tccId < EcalTriggerElectronicsId::MAX_TCCID; tccId++) {
0586
0587 psCounter = 0;
0588 for (int towerId = 0; towerId < EcalTrigTowerDetId::kEBTowersPerSM; towerId++) {
0589
0590 for (int ps = 0; ps < numStripInTT[tccId][towerId]; ps++) {
0591 tTandPs_[tccId][psCounter][0] = towerId + 1;
0592 tTandPs_[tccId][psCounter][1] = ps + 1;
0593 psCounter++;
0594 }
0595 }
0596 }
0597
0598
0599
0600
0601
0602
0603
0604
0605
0606
0607
0608
0609
0610
0611
0612 for (int tcc = EcalTriggerElectronicsId::MIN_TCCID_EEM; tcc <= EcalTriggerElectronicsId::MAX_TCCID_EEM; tcc++) {
0613 int tccId = tcc - 1;
0614 short tTandPs_tmp[18][2];
0615
0616
0617 for (int psCounter = 30; psCounter < 48; psCounter++) {
0618 tTandPs_tmp[psCounter - 30][0] = tTandPs_[tccId][psCounter][0];
0619 tTandPs_tmp[psCounter - 30][1] = tTandPs_[tccId][psCounter][1];
0620 }
0621
0622
0623 for (int psCounter = 18; psCounter < 30; psCounter++) {
0624 tTandPs_[tccId][psCounter + 12][0] = tTandPs_[tccId][psCounter][0];
0625 tTandPs_[tccId][psCounter + 12][1] = tTandPs_[tccId][psCounter][1];
0626 }
0627
0628
0629 for (int psCounter = 42; psCounter < 60; psCounter++) {
0630 tTandPs_[tccId][psCounter][0] = tTandPs_tmp[psCounter - 42][0];
0631 tTandPs_[tccId][psCounter][1] = tTandPs_tmp[psCounter - 42][1];
0632 }
0633
0634 }
0635
0636 for (int tcc = EcalTriggerElectronicsId::MIN_TCCID_EEP; tcc <= EcalTriggerElectronicsId::MAX_TCCID_EEP; tcc++) {
0637 int tccId = tcc - 1;
0638 short tTandPs_tmp[18][2];
0639
0640
0641 for (int psCounter = 30; psCounter < 48; psCounter++) {
0642 tTandPs_tmp[psCounter - 30][0] = tTandPs_[tccId][psCounter][0];
0643 tTandPs_tmp[psCounter - 30][1] = tTandPs_[tccId][psCounter][1];
0644 }
0645
0646
0647 for (int psCounter = 18; psCounter < 30; psCounter++) {
0648 tTandPs_[tccId][psCounter + 12][0] = tTandPs_[tccId][psCounter][0];
0649 tTandPs_[tccId][psCounter + 12][1] = tTandPs_[tccId][psCounter][1];
0650 }
0651
0652
0653 for (int psCounter = 42; psCounter < 60; psCounter++) {
0654 tTandPs_[tccId][psCounter][0] = tTandPs_tmp[psCounter - 42][0];
0655 tTandPs_[tccId][psCounter][1] = tTandPs_tmp[psCounter - 42][1];
0656 }
0657
0658 }
0659
0660
0661
0662
0663
0664
0665
0666
0667 }
0668
0669 void EcalElectronicsMapper::setupGhostMap() {
0670
0671 const int n = 44;
0672
0673
0674
0675 const struct {
0676 int FED, CCU, VFE;
0677 } v[n] = {{601, 10, 5}, {601, 34, 3}, {601, 34, 4}, {601, 34, 5}, {602, 32, 5}, {603, 12, 5}, {603, 30, 5},
0678 {604, 12, 5}, {604, 30, 5}, {605, 32, 5}, {606, 10, 5}, {606, 34, 3}, {606, 34, 4}, {606, 34, 5},
0679 {608, 27, 3}, {608, 27, 4}, {608, 27, 5}, {608, 3, 3}, {608, 3, 4}, {608, 3, 5}, {608, 30, 5},
0680 {608, 6, 5}, {646, 10, 5}, {646, 34, 3}, {646, 34, 4}, {646, 34, 5}, {647, 32, 5}, {648, 12, 5},
0681 {648, 30, 5}, {649, 12, 5}, {649, 30, 5}, {650, 32, 5}, {651, 10, 5}, {651, 34, 3}, {651, 34, 4},
0682 {651, 34, 5}, {653, 27, 3}, {653, 27, 4}, {653, 27, 5}, {653, 3, 3}, {653, 3, 4}, {653, 3, 5},
0683 {653, 30, 5}, {653, 6, 5}};
0684
0685 for (int i = 0; i < n; ++i)
0686 ghost_[v[i].FED][v[i].CCU][v[i].VFE] = true;
0687 }
0688
0689 bool EcalElectronicsMapper::isGhost(const int FED, const int CCU, const int VFE) {
0690 if (ghost_.find(FED) == ghost_.end())
0691 return false;
0692
0693 if (ghost_[FED].find(CCU) == ghost_[FED].end())
0694 return false;
0695
0696 if (ghost_[FED][CCU].find(VFE) == ghost_[FED][CCU].end())
0697 return false;
0698
0699 return true;
0700 }
0701
0702
0703 const unsigned int EcalElectronicsMapper::numChannelsInDcc_[NUMB_SM] = {
0704 34, 32, 33, 33, 32, 34, 33, 41, 33,
0705 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
0706 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
0707 68, 68, 68, 68, 68, 68, 68, 68, 34, 32, 33, 33, 32, 34, 33, 41, 33};