22 theTriggerMap(0), theElecMap(0), dEta(dEta_),
dPhi(dPhi_) {
27 for(
size_t iCap=0; iCap <
nEndcaps; ++iCap){
28 for(
int iDccPhi = 0; iDccPhi <
nDccPerEe; ++iDccPhi){
29 for(
int iDccCh = 0; iDccCh <
maxDccChs; ++iDccCh){
45 int nTriggerTowerE[] = {0, 0, 0, 0, 0, 0, 0, 0};
46 int nTriggerTowerB[] = {0, 0, 0, 0, 0, 0, 0, 0};
66 <<
"without forced bit + with forced bit set:\n"
69 <<
" low interest TT(s) in barrel\n"
70 << nTriggerTowerB[
SINGLE] <<
" + "
72 <<
" single TT(s) in barrel\n"
75 <<
" neighbor interest TT(s) in barrel\n"
76 << nTriggerTowerB[
CENTER] <<
" + "
78 <<
" centre interest TT(s) in barrel\n"
81 <<
" low interest TT(s) in endcap\n"
82 << nTriggerTowerE[
SINGLE] <<
" + "
84 <<
" single TT(s) in endcap\n"
87 <<
" neighbor TT(s) in endcap\n"
88 << nTriggerTowerE[
CENTER] <<
" + "
90 <<
" center TT(s) in endcap\n";
97 #ifndef ECALSELECTIVEREADOUT_NOGEOM
99 for(std::vector<DetId>::const_iterator eeDetIdItr = endcapDetIds.begin();
100 eeDetIdItr != endcapDetIds.end(); ++eeDetIdItr){
106 assert(trigTower.
rawId() != 0);
108 int iz = (eeDetId.zside() > 0) ? 1 : 0;
114 #else //ECALSELECTIVEREADOUT_NOGEOM defined
116 for(
int iZ0=0; iZ0<2; ++iZ0){
120 if (!(xtal.
validDetId(iX0+1, iY0+1, (iZ0>0?1:-1)))){
123 xtal =
EEDetId(iX0+1, iY0+1, (iZ0>0?1:-1));
125 if(39 <= iX0 && iX0 <= 60 && 45 <= iY0 && iY0 <= 54){
131 assert(trigTower.
rawId() != 0);
142 #endif //ECALSELECTIVEREADOUT_NOGEOM not defined
172 const int iZ0 =
id.
zside()>0 ? 1 : 0;
173 const int iDcc0 =
id.dccId()-1;
174 const int iDccPhi0 = (iDcc0<9)?iDcc0:(iDcc0-45);
175 const int iDccCh0 =
id.towerId()-1;
176 assert(0 <= iDccPhi0 && iDccPhi0 <
nDccPerEe);
177 assert(0 <= iDccCh0 && iDccCh0 <
maxDccChs);
189 const int iZ0 = (scDetId.
zside()>0) ? 1: 0;
190 const int iDcc0 = dccAndDccCh.first-1;
191 const int iDccPhi0 = (iDcc0<9)?iDcc0:(iDcc0-45);
192 const int iDccCh0 = dccAndDccCh.second-1;
193 assert(0 <= iDccPhi0 && iDccPhi0 <=
nDccPerEe);
194 assert(0 <= iDccCh0 && iDccCh0 <=
maxDccChs);
208 int iPhi = tower.
iphi() - 1;
220 for(
int iPhi=0; iPhi < (int)nTriggerTowersInPhi; ++iPhi){
226 for(
int iPhi=0; iPhi < (int)nTriggerTowersInPhi; ++iPhi){
234 for(
int iEtaNeigh = std::max<int>(0,iEta-
dEta);
237 for(
int iPhiNeigh = iPhi-
dPhi;
238 iPhiNeigh <= iPhi+
dPhi;
242 int iPhiNeigh_ = iPhiNeigh%(int)nTriggerTowersInPhi;
260 const size_t innerEtas[] = {0, 1,
262 for(
size_t i=0;
i < 4; ++
i){
263 size_t iEta = innerEtas[
i];
274 os <<
"#SRP flag map\n#\n"
338 selectiveReadout.
print(os);
345 for(
int i=-1;
i<=68; ++
i){
346 if((
i+1)%10==0) os <<
"//";
347 os << std::setw(2) <<
i <<
": " << (char)(
'0'+
i);
348 if(i%10==9) os <<
"\n";
else os <<
" ";
354 os <<
"Sc2DCCch0: " << (
endcap?
"EE+":
"EE-") <<
"\n";
static bool validDetId(int ix, int iy, int iz)
static const int FORCED_MASK
static const size_t nEndcapXBins
towerInterest_t getSuperCrystalInterest(const EcalScDetId &scDetId) const
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
static const size_t nSupercrystalXBins
void printHeader(std::ostream &os) const
print out header for the map: see print(std::ostream&)
std::pair< int, int > getDCCandSC(EcalScDetId id) const
towerInterest_t getTowerInterest(const EcalTrigTowerDetId &towerId) const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
static const size_t nEndcaps
static const int nDccPerEe
EcalTrigTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
void printEndcap(int endcap, std::ostream &s) const
int ieta() const
get the tower ieta
void classifyTriggerTowers(const ttFlag_t ttFlags[nTriggerTowersInEta][nTriggerTowersInPhi])
towerInterest_t & eeRuInterest(const EEDetId &id)
static const size_t nEndcapYBins
uint32_t rawId() const
get the raw id
static const size_t nSupercrystalYBins
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
EcalSelectiveReadout(int dEta=1, int dPhi=1)
double dPhi(double phi1, double phi2)
const T & max(const T &a, const T &b)
static const int maxDccChs
void combineFlags(T &var, T val) const
void printBarrel(std::ostream &os) const
static const size_t nEndcapTriggerTowersInEta
const EcalElectronicsMapping * theElecMap
int zside() const
zside = +1 or -1
towerInterest_t eeRuInterest_[nEndcaps][nDccPerEe][maxDccChs]
int iphi() const
get the tower iphi
const EcalTrigTowerConstituentsMap * theTriggerMap
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
void print(std::ostream &os) const
print out the map
static const size_t nTriggerTowersInEta
static const size_t nTriggerTowersInPhi
static const char srpFlagMarker[]
void runSelectiveReadout0(const ttFlag_t towerFlags[nTriggerTowersInEta][nTriggerTowersInPhi])
towerInterest_t towerInterest[nTriggerTowersInEta][nTriggerTowersInPhi]
static const size_t nBarrelTriggerTowersInEta
towerInterest_t getCrystalInterest(const EBDetId &ebDetId) const
void printDccChMap(std::ostream &os) const