10 numbXtalTSamples_(numbXtalTSamples),
11 numbTriggerTSamples_(numbTriggerTSamples),
21 for(
unsigned int sm=0; sm <
NUMB_SM; sm++){
22 for(
unsigned int fe=0; fe<
NUMB_FE; fe++){
25 for(
unsigned int xtal=0; xtal<
NUMB_XTAL;xtal++){
41 for(
unsigned int tccid=0; tccid <
NUMB_TCC; tccid++){
42 for(
unsigned int tpg =0; tpg<
NUMB_FE;tpg++){
50 for (
int tccid=0; tccid<
NUMB_TCC; tccid++){
59 for (
int u=0; u<2; u++){
66 std::vector<unsigned int> * ids;
67 ids =
new std::vector<unsigned int>;
68 ids->push_back(1); ids->push_back(18);ids->push_back(19);ids->push_back(36);
71 ids =
new std::vector<unsigned int>;
72 ids->push_back(2); ids->push_back(3);ids->push_back(20);ids->push_back(21);
75 ids =
new std::vector<unsigned int>;
76 ids->push_back(4); ids->push_back(5);ids->push_back(22);ids->push_back(23);
79 ids =
new std::vector<unsigned int>;
80 ids->push_back(6); ids->push_back(7);ids->push_back(24);ids->push_back(25);
83 ids =
new std::vector<unsigned int>;
84 ids->push_back(8); ids->push_back(9);ids->push_back(26);ids->push_back(27);
87 ids =
new std::vector<unsigned int>;
88 ids->push_back(10); ids->push_back(11);ids->push_back(28);ids->push_back(29);
91 ids =
new std::vector<unsigned int>;
92 ids->push_back(12); ids->push_back(13);ids->push_back(30);ids->push_back(31);
95 ids =
new std::vector<unsigned int>;
96 ids->push_back(14); ids->push_back(15);ids->push_back(32);ids->push_back(33);
99 ids =
new std::vector<unsigned int>;
100 ids->push_back(16); ids->push_back(17);ids->push_back(34);ids->push_back(35);
103 ids =
new std::vector<unsigned int>;
104 ids->push_back(73); ids->push_back(90);ids->push_back(91);ids->push_back(108);
107 ids =
new std::vector<unsigned int>;
108 ids->push_back(74); ids->push_back(75);ids->push_back(92);ids->push_back(93);
111 ids =
new std::vector<unsigned int>;
112 ids->push_back(76); ids->push_back(77);ids->push_back(94);ids->push_back(95);
115 ids =
new std::vector<unsigned int>;
116 ids->push_back(78); ids->push_back(79);ids->push_back(96);ids->push_back(97);
119 ids =
new std::vector<unsigned int>;
120 ids->push_back(80); ids->push_back(81);ids->push_back(98);ids->push_back(99);
123 ids =
new std::vector<unsigned int>;
124 ids->push_back(82); ids->push_back(83);ids->push_back(100);ids->push_back(101);
127 ids =
new std::vector<unsigned int>;
128 ids->push_back(84); ids->push_back(85);ids->push_back(102);ids->push_back(103);
131 ids =
new std::vector<unsigned int>;
132 ids->push_back(86); ids->push_back(87);ids->push_back(104);ids->push_back(105);
135 ids =
new std::vector<unsigned int>;
136 ids->push_back(88); ids->push_back(89);ids->push_back(106);ids->push_back(107);
156 for(
unsigned int sm=0; sm <
NUMB_SM; sm++){
157 for(
unsigned int fe=0; fe<
NUMB_FE; fe++){
175 for (
int tccid=0; tccid<
NUMB_TCC; tccid++){
185 for(
unsigned int tccid=0; tccid <
NUMB_TCC; tccid++){
186 for(
unsigned int tpg =0; tpg<
NUMB_FE;tpg++){
199 std::map<unsigned int, std::vector<unsigned int> *>::iterator it;
220 if(!
smId_) ret =
false;
231 std::ifstream dccMapFile_(aPath_.c_str());
234 if(!dccMapFile_.is_open())
return false;
280 std::vector<int>& orderedDCCIdList )
284 if ( orderedFedUnpackList.size() == orderedDCCIdList.size() &&
285 orderedFedUnpackList.size() > 0)
287 edm::LogInfo(
"EcalElectronicsMapper") <<
"DCCIdList/FedUnpackList lists given. Being loaded.";
289 std::string correspondence(
"list of pairs DCCId:FedId : ");
291 for (
int v=0;
v< ((int)orderedFedUnpackList.size());
v++) {
292 myDCCMap_[ orderedDCCIdList[
v] ] = orderedFedUnpackList[
v] ;
294 sprintf( onePair,
" %d:%d", orderedDCCIdList[
v], orderedFedUnpackList[v]);
295 std::string
tmp(onePair);
296 correspondence +=
tmp;
298 edm::LogInfo(
"EcalElectronicsMapper") << correspondence;
304 edm::LogInfo(
"EcalElectronicsMapper") <<
"No input DCCIdList/FedUnpackList lists given for ECAL unpacker"
305 <<
"(or given with different number of elements). "
306 <<
" Loading default association DCCIdList:FedUnpackList,"
307 <<
"i.e. 1:601 ... 53:653, 54:654.";
309 for (
unsigned int v=1;
v<=54;
v++) {
319 o <<
"---------------------------------------------------------";
322 o <<
"No correct input for DCC map has been given yet...";
325 o <<
"DCC Map (Map file: " << aMapper_.
pathToMapFile_ <<
" )" <<
"SM id\t\tDCCid ";
328 std::map<unsigned int ,unsigned int > aMap;
330 std::map<unsigned int ,unsigned int >::iterator iter;
333 for(iter = aMap.begin(); iter != aMap.end(); iter++)
334 o << iter->first <<
"\t\t" << iter->second;
337 o <<
"---------------------------------------------------------";
379 std::map<unsigned int ,unsigned int>::const_iterator it =
myDCCMap_.find(aSMId_);
382 if(it!=
myDCCMap_.end())
return it->second;
386 edm::LogError(
"IncorrectMapping") <<
"DCC requested for SM id: " << aSMId_ <<
" not found";
394 std::map<unsigned int ,unsigned int>::const_iterator it;
398 if(it->second == aDCCId_)
403 edm::LogError(
"IncorrectMapping") <<
"SM requested DCC id: " << aDCCId_ <<
" not found";
413 for(
int smId=1 ; smId<= 54; smId++){
417 if( smId > 9 && smId < 46 ){
419 for(
int feChannel =1; feChannel<=68; feChannel++){
427 ttDetIds_[tccId-1][feChannel-1] = ttDetId;
429 ttEleIds_[tccId-1][feChannel-1] = ttEleId;
435 ttTPIds_[tccId-1][feChannel-1] = tp;
438 for(
int ps=1; ps<=5; ps++){
451 for(
unsigned int stripId =1; stripId<=5; stripId++){
453 for(
unsigned int xtalId =1;xtalId<=5;xtalId++){
457 xtalDetIds_[smId-1][feChannel-1][stripId-1][xtalId-1] = detId;
470 std::vector<unsigned int>::iterator it;
472 for(it= pTCCIds->begin(); it!= pTCCIds->end(); it++){
474 unsigned int tccId = *it;
477 for(
unsigned int towerInTCC =1; towerInTCC <=
numChannelsInDcc_[smId-1]; towerInTCC++){
489 ttTPIds_[tccId-1][towerInTCC-1] = tp;
492 for(
int ps=1; ps<=5; ps++){
502 for(
unsigned int feChannel = 1; feChannel <=
numChannelsInDcc_[smId-1]; feChannel++){
513 for(
size_t i = 0;
i < scDetIds.size(); ++
i){
525 std::vector<DetId>::iterator it;
528 for(it = ecalDetIds.begin(); it!= ecalDetIds.end(); it++){
533 int xtalId = ids.
xtalId();
536 xtalDetIds_[smId-1][feChannel-1][stripId-1][xtalId-1] = detId;
556 std::vector<DetId>::iterator theTCCConstituent;
564 for (theTCCConstituent = tccConstituents.begin();
565 theTCCConstituent != tccConstituents.end();
571 if( ps > numStripInTT[
tccId][towerId-1]) numStripInTT[
tccId][towerId-1] = ps;
618 short tTandPs_tmp[18][2];
621 for (
int psCounter=30; psCounter<48; psCounter++) {
622 tTandPs_tmp[psCounter-30][0] =
tTandPs_[
tccId][psCounter][0];
623 tTandPs_tmp[psCounter-30][1] =
tTandPs_[
tccId][psCounter][1]; }
626 for (
int psCounter=18; psCounter<30; psCounter++) {
631 for (
int psCounter=42; psCounter<60; psCounter++) {
632 tTandPs_[
tccId][psCounter][0] = tTandPs_tmp[psCounter-42][0];
633 tTandPs_[
tccId][psCounter][1] = tTandPs_tmp[psCounter-42][1]; }
641 short tTandPs_tmp[18][2];
644 for (
int psCounter=30; psCounter<48; psCounter++) {
645 tTandPs_tmp[psCounter-30][0] =
tTandPs_[
tccId][psCounter][0];
646 tTandPs_tmp[psCounter-30][1] =
tTandPs_[
tccId][psCounter][1]; }
649 for (
int psCounter=18; psCounter<30; psCounter++) {
654 for (
int psCounter=42; psCounter<60; psCounter++) {
655 tTandPs_[
tccId][psCounter][0] = tTandPs_tmp[psCounter-42][0];
656 tTandPs_[
tccId][psCounter][1] = tTandPs_tmp[psCounter-42][1]; }
679 const struct {
int FED, CCU, VFE;}
v[
n] = {
726 for (
int i = 0;
i <
n; ++
i)
746 68,68,68,68,68,68,68,68,68,68,
747 68,68,68,68,68,68,68,68,
748 68,68,68,68,68,68,68,68,68,68,
749 68,68,68,68,68,68,68,68,
750 34,32,33,33,32,34,33,41,33};
std::string pathToMapFile_
unsigned int getSMId(unsigned int aDCCId) const
int xtalId() const
get the channel id
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
unsigned int ebTccBlockLength_
static const int MIN_TCCID_EEM
unsigned dccId(const DetId &)
EcalTrigTowerDetId getTrigTowerDetId(int TCCid, int iTT) const
Builds a EcalTrigTowerDetID from the TCCid & TriggerTower index in TCC.
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
uint32_t rawId() const
get the raw id
unsigned towerId(const DetId &)
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
std::map< unsigned int, std::vector< unsigned int > * > mapSmIdToTccIds_
EcalPseudoStripInputDigi * psInput_[NUMB_TCC][TCC_EB_NUMBTTS][NUMB_STRIP]
unsigned int eeTccBlockLength_
unsigned int getDCCId(unsigned int aSMId) const
void setSample(int i, const EcalTriggerPrimitiveSample &sam)
static const unsigned int numChannelsInDcc_[NUMB_SM]
bool setActiveDCC(unsigned int dccId)
bool makeMapFromVectors(std::vector< int > &, std::vector< int > &)
EcalTriggerElectronicsId getTriggerElectronicsId(const DetId &id) const
Get the trigger electronics id for this det id.
unsigned int unfilteredFEBlockLength_
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]
unsigned int numbXtalTSamples_
std::vector< EcalSrFlag * > srFlags_[NUMB_SM][NUMB_FE]
EcalElectronicsMapper(unsigned int numbOfXtalTSamples, unsigned int numbOfTriggerTSamples)
bool setDCCMapFilePath(std::string)
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()
unsigned tccId(const DetId &)
unsigned ttId(const DetId &)
std::vector< std::vector< double > > tmp
std::map< int, std::map< int, std::map< int, bool > > > ghost_
bool isTCCExternal(unsigned int TCCId)
std::map< unsigned int, unsigned int > myDCCMap_
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]