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};
47 static std::atomic<int> ncall{0};
65 <<
"without forced bit + with forced bit set:\n"
68 <<
" low interest TT(s) in barrel\n"
69 << nTriggerTowerB[
SINGLE] <<
" + "
71 <<
" single TT(s) in barrel\n"
74 <<
" neighbor interest TT(s) in barrel\n"
75 << nTriggerTowerB[
CENTER] <<
" + "
77 <<
" centre interest TT(s) in barrel\n"
80 <<
" low interest TT(s) in endcap\n"
81 << nTriggerTowerE[
SINGLE] <<
" + "
83 <<
" single TT(s) in endcap\n"
86 <<
" neighbor TT(s) in endcap\n"
87 << nTriggerTowerE[
CENTER] <<
" + "
89 <<
" center TT(s) in endcap\n";
96 #ifndef ECALSELECTIVEREADOUT_NOGEOM
98 for(std::vector<DetId>::const_iterator eeDetIdItr = endcapDetIds.begin();
99 eeDetIdItr != endcapDetIds.end(); ++eeDetIdItr){
107 int iz = (eeDetId.zside() > 0) ? 1 : 0;
113 #else //ECALSELECTIVEREADOUT_NOGEOM defined
115 for(
int iZ0=0; iZ0<2; ++iZ0){
119 if (!(xtal.
validDetId(iX0+1, iY0+1, (iZ0>0?1:-1)))){
122 xtal =
EEDetId(iX0+1, iY0+1, (iZ0>0?1:-1));
124 if(39 <= iX0 && iX0 <= 60 && 45 <= iY0 && iY0 <= 54){
141 #endif //ECALSELECTIVEREADOUT_NOGEOM not defined
171 const int iZ0 =
id.
zside()>0 ? 1 : 0;
172 const int iDcc0 =
id.dccId()-1;
173 const int iDccPhi0 = (iDcc0<9)?iDcc0:(iDcc0-45);
174 const int iDccCh0 =
id.towerId()-1;
188 const int iZ0 = (scDetId.
zside()>0) ? 1: 0;
189 const int iDcc0 = dccAndDccCh.first-1;
190 const int iDccPhi0 = (iDcc0<9)?iDcc0:(iDcc0-45);
191 const int iDccCh0 = dccAndDccCh.second-1;
207 int iPhi = tower.
iphi() - 1;
219 for(
int iPhi=0; iPhi < (int)nTriggerTowersInPhi; ++iPhi){
225 for(
int iPhi=0; iPhi < (int)nTriggerTowersInPhi; ++iPhi){
233 for(
int iEtaNeigh = std::max<int>(0,iEta-
dEta);
236 for(
int iPhiNeigh = iPhi-
dPhi;
237 iPhiNeigh <= iPhi+
dPhi;
241 int iPhiNeigh_ = iPhiNeigh%(int)nTriggerTowersInPhi;
259 const size_t innerEtas[] = {0, 1,
261 for(
size_t i=0;
i < 4; ++
i){
262 size_t iEta = innerEtas[
i];
273 os <<
"#SRP flag map\n#\n"
337 selectiveReadout.
print(os);
344 for(
int i=-1;
i<=68; ++
i){
345 if((
i+1)%10==0) os <<
"//";
346 os << std::setw(2) <<
i <<
": " << (
char)(
'0'+
i);
347 if(i%10==9) os <<
"\n";
else os <<
" ";
353 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)
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