#include <EcalSelectiveReadout.h>
Public Types | |
enum | towerInterest_t { UNKNOWN = -1 & ~FORCED_MASK, LOWINTEREST = 0x0, SINGLE = 0x1, NEIGHBOUR = 0x2, CENTER = 0x3, FORCED_LOWINTEREST = 0x4, FORCED_SINGLE = 0x5, FORCED_NEIGHBOUR = 0x6, FORCED_CENTER = 0x7 } |
enum | ttFlag_t { TTF_UNKNOWN = -1, TTF_LOW_INTEREST = 0x0, TTF_MID_INTEREST = 0x1, TTF_HIGH_INTEREST = 0X3, TTF_FORCED_LOW_INTEREST = 0x4, TTF_FORCED_MID_INTEREST = 0x5, TTF_FORCED_HIGH_INTEREST = 0x7 } |
Public Member Functions | |
EcalSelectiveReadout (int dEta=1, int dPhi=1) | |
towerInterest_t | getCrystalInterest (const EBDetId &ebDetId) const |
towerInterest_t | getCrystalInterest (const EEDetId &eeDetId) const |
towerInterest_t | getSuperCrystalInterest (const EcalScDetId &scDetId) const |
towerInterest_t | getTowerInterest (const EcalTrigTowerDetId &towerId) const |
void | print (std::ostream &os) const |
print out the map | |
void | printBarrel (std::ostream &os) const |
void | printEndcap (int endcap, std::ostream &s) const |
void | printHeader (std::ostream &os) const |
print out header for the map: see print(std::ostream&) | |
void | runSelectiveReadout0 (const ttFlag_t towerFlags[nTriggerTowersInEta][nTriggerTowersInPhi]) |
void | setElecMap (const EcalElectronicsMapping *map) |
void | setTriggerMap (const EcalTrigTowerConstituentsMap *map) |
the mapping of which cell goes with which trigger tower | |
Static Public Attributes | |
static const int | FORCED_MASK = 0x4 |
static const int | maxDccChs = 68 |
static const size_t | nBarrelEtaBins = 170 |
static const size_t | nBarrelPhiBins = 360 |
static const size_t | nBarrelTowerEtaBins = nBarrelEtaBins/5 |
static const size_t | nBarrelTowerPhiBins = nBarrelPhiBins/5 |
static const size_t | nBarrelTriggerTowersInEta = 34 |
static const int | nDccPerEe = 9 |
static const size_t | nEndcaps = 2 |
static const size_t | nEndcapTriggerTowersInEta = 11 |
static const size_t | nEndcapXBins = 100 |
static const size_t | nEndcapYBins = 100 |
static const size_t | nSupercrystalXBins = nEndcapXBins/supercrystalEdge |
static const size_t | nSupercrystalYBins = nEndcapYBins/supercrystalEdge |
static const size_t | nTriggerTowersInEta |
static const size_t | nTriggerTowersInPhi = 72 |
static const size_t | supercrystalEdge = 5 |
static const int | TTF_FORCED_RO_MASK = FORCED_MASK |
Private Member Functions | |
void | classifyTriggerTowers (const ttFlag_t ttFlags[nTriggerTowersInEta][nTriggerTowersInPhi]) |
template<class T > | |
void | combineFlags (T &var, T val) const |
towerInterest_t & | eeRuInterest (const EcalScDetId &id) |
towerInterest_t & | eeRuInterest (const EEDetId &id) |
void | printDccChMap (std::ostream &os) const |
void | resetEeRuInterest () |
template<class T > | |
void | setHigher (T &var, T val) const |
void | setLower (int &var, int val) const |
Private Attributes | |
int | dEta |
int | dPhi |
towerInterest_t | eeRuInterest_ [nEndcaps][nDccPerEe][maxDccChs] |
const EcalElectronicsMapping * | theElecMap |
const EcalTrigTowerConstituentsMap * | theTriggerMap |
towerInterest_t | towerInterest [nTriggerTowersInEta][nTriggerTowersInPhi] |
Static Private Attributes | |
static const char | srpFlagMarker [] |
This class is used to run the selective readout processing on the electromagnetic calorimeter. Normal user do not need to access directly this class: the selective readout is made at digitization by the CaloDataFrameFormatter class which uses the EcalSelectiveReadout class for this purpose: see CaloDataFrameFormatter class documentation. The ECAL event size must be reduced by a factor ~1/20th online at the LV1 rate. This reduction is achieved by suppressing channels whose energy, evaluated on line by a FIR, is below a threshold ("zero suppression"). This threshold is dynamic and determined for the channel of each readout unit. A readout unit is a group of 5x5 crystals: a trigger tower for the barrel and a supercrystal for the endcap) basis. The selective readout classifies the readout units in three classes:
. Single, neighbour and center classes consitute the "high interest" readout units and their channels the "high interest" channels. Two zero suppresion thresholds, eventually -/+ infinity, are defined: one for the "Low interest" channels and one for the "high interest" channels. The low interest threshold must be higher than the high interest one.
Note: Forced bit processing: ---------------------------
The trigger tower flag (TTF) issued by the TCC and indicating the level of transverse deposited energy (classified is three levels called low interest, mid interest, high interest), the selective readout flags (SRF) are made of 2 bits. An additionnal bit, called force bit, is used to indicate if some information was missing to compute the flag and if therefore some default value was used. TCC can substitute a default value to a TTF. In such case the forced bit is set. Similarly SRP can substitute a default value to a SRF and set the forced bit accordingly. If the TTF forced bit of a trigger tower is set the SRP propagates it to the SRF by setting the forced bit of every readout unit overlapping with the trigger tower. Note that for the barrel readout units match with trigger towers.
Definition at line 65 of file EcalSelectiveReadout.h.
trigger tower classification ("SRP flags")
UNKNOWN | |
LOWINTEREST | |
SINGLE | |
NEIGHBOUR | |
CENTER | |
FORCED_LOWINTEREST | |
FORCED_SINGLE | |
FORCED_NEIGHBOUR | |
FORCED_CENTER |
Definition at line 72 of file EcalSelectiveReadout.h.
{UNKNOWN = -1 & ~FORCED_MASK, LOWINTEREST = 0x0, SINGLE = 0x1, NEIGHBOUR = 0x2, CENTER = 0x3, FORCED_LOWINTEREST = 0x4, //0x0 | 0x4 FORCED_SINGLE = 0x5, //0x1 | 0x4 FORCED_NEIGHBOUR = 0x6, //0x2 | 0x4 FORCED_CENTER = 0x7 //0x3 | 0x4 } towerInterest_t;
TTF_UNKNOWN | |
TTF_LOW_INTEREST | |
TTF_MID_INTEREST | |
TTF_HIGH_INTEREST | |
TTF_FORCED_LOW_INTEREST | |
TTF_FORCED_MID_INTEREST | |
TTF_FORCED_HIGH_INTEREST |
Definition at line 83 of file EcalSelectiveReadout.h.
{ TTF_UNKNOWN =-1, TTF_LOW_INTEREST = 0x0, TTF_MID_INTEREST = 0x1, /* 0x2 not used */ TTF_HIGH_INTEREST = 0X3, TTF_FORCED_LOW_INTEREST = 0x4, //0x0 | 0x4 TTF_FORCED_MID_INTEREST = 0x5, //0x1 | 0x4 /* 0x6 not used*/ TTF_FORCED_HIGH_INTEREST = 0x7 //0x3 | 0x4 // TTF_FORCED_RO_LINK_SYNC_ERR = 0x4, // TTF_FORCED_RO_HAMMING_ERR = 0X5, // TTF_FORCED_RO_OTHER1 = 0X6, // TTF_FORCED_RO_OTHER2 = 0X7 } ttFlag_t;
EcalSelectiveReadout::EcalSelectiveReadout | ( | int | dEta = 1 , |
int | dPhi = 1 |
||
) |
Constructs a ecalselectivereadout. Neighbours are taken in a trigger tower matrix of size 2(dEta+1))x2(dPhi+1) around a 'center' tower.
dEta | neighborhood extend in number of trigger towers along eta |
dPhi | neighborgooh extend in number if trigger towers along phi in 'low interest', 'single' or 'center. First element is the lower threshold, second element is the higher one. |
Definition at line 21 of file EcalSelectiveReadout.cc.
: theTriggerMap(0), theElecMap(0), dEta(dEta_), dPhi(dPhi_) { }
void EcalSelectiveReadout::classifyTriggerTowers | ( | const ttFlag_t | ttFlags[nTriggerTowersInEta][nTriggerTowersInPhi] | ) | [private] |
Classifies trigger tower in three classes:
Definition at line 216 of file EcalSelectiveReadout.cc.
References CENTER, combineFlags(), dEta, dPhi, FORCED_MASK, i, LOWINTEREST, max(), NEIGHBOUR, nTriggerTowersInEta, nTriggerTowersInPhi, SINGLE, towerInterest, TTF_HIGH_INTEREST, and TTF_MID_INTEREST.
Referenced by runSelectiveReadout0().
{ //starts with a all low interest map: for(int iEta=0; iEta < (int)nTriggerTowersInEta; ++iEta){ for(int iPhi=0; iPhi < (int)nTriggerTowersInPhi; ++iPhi){ towerInterest[iEta][iPhi] = LOWINTEREST; } } for(int iEta=0; iEta < (int)nTriggerTowersInEta; ++iEta){ for(int iPhi=0; iPhi < (int)nTriggerTowersInPhi; ++iPhi){ //copy forced bit from ttFlags to towerInterests: towerInterest[iEta][iPhi] = (towerInterest_t) (towerInterest[iEta][iPhi] | (ttFlags[iEta][iPhi] & FORCED_MASK)) ; if((ttFlags[iEta][iPhi] & ~FORCED_MASK) == TTF_HIGH_INTEREST){ //flags this tower as a center tower towerInterest[iEta][iPhi] = CENTER; //flags the neighbours of this tower for(int iEtaNeigh = std::max<int>(0,iEta-dEta); iEtaNeigh <= std::min<int>(nTriggerTowersInEta-1, iEta+dEta); ++iEtaNeigh){ for(int iPhiNeigh = iPhi-dPhi; iPhiNeigh <= iPhi+dPhi; ++iPhiNeigh){ //beware, iPhiNeigh must be moved to [0,72] interval //=> %nTriggerTowersInPhi required int iPhiNeigh_ = iPhiNeigh%(int)nTriggerTowersInPhi; if(iPhiNeigh_<0) { iPhiNeigh_ += nTriggerTowersInPhi; } combineFlags(towerInterest[iEtaNeigh][iPhiNeigh_], NEIGHBOUR); } } } else if((ttFlags[iEta][iPhi] & ~FORCED_MASK) == TTF_MID_INTEREST){ combineFlags(towerInterest[iEta][iPhi], SINGLE); } } } //dealing with pseudo-TT in the two innest eta-ring of the endcaps //=>choose the highest priority SRF of the 2 pseudo-TT constituting //a TT. Note that for S and C, the 2 pseudo-TT must already have the //same mask. const size_t innerEtas[] = {0, 1, nTriggerTowersInEta-2, nTriggerTowersInEta-1}; for(size_t i=0; i < 4; ++i){ size_t iEta = innerEtas[i]; for(size_t iPhi = 0 ; iPhi < nTriggerTowersInPhi; iPhi+=2){ const towerInterest_t srf = std::max(towerInterest[iEta][iPhi], towerInterest[iEta][iPhi+1]); towerInterest[iEta][iPhi] = srf; towerInterest[iEta][iPhi+1] = srf; } } }
void EcalSelectiveReadout::combineFlags | ( | T & | var, |
T | val | ||
) | const [inline, private] |
Combine two flags. Forced bit and actual flag fields are treated separately. For both fields, the highst value is selected.
var | [in,out] flag to change in place |
val | flag to combine with the first. |
T | towerInterest_t or |
Definition at line 311 of file EcalSelectiveReadout.h.
References gather_cfg::cout, max(), and TTF_FORCED_RO_MASK.
Referenced by classifyTriggerTowers(), and runSelectiveReadout0().
{ var = (T)(std::max(val & ~TTF_FORCED_RO_MASK, //actual flag value: // take highest var & ~TTF_FORCED_RO_MASK) //beware: must work also // for UNKNOW=-1 // ->compare the whole // integer but with // the forced bit masked. | ((val | var) & 0x4));//forced bit: set it if any of the two is // already set if(var < 0 || var > 7){ std::cout << __FILE__ << ":" << __LINE__ << ": ---------->" << var << " " << val << " " << std::max(val & 0x3, var & 0x3) << " " << (val | var) << " " << ((val | var) & 0x4) << " " << (std::max(val & 0x3, var & 0x3) | ((val | var) & 0x4)) << " " << (T)(std::max(val & 0x3, var & 0x3) | ((val | var) & 0x4)) << "\n"; } }
EcalSelectiveReadout::towerInterest_t & EcalSelectiveReadout::eeRuInterest | ( | const EEDetId & | id | ) | [private] |
Get access to eeRuInterest element corresponding to an EE det Id
id | the EE det id |
Definition at line 170 of file EcalSelectiveReadout.cc.
References eeRuInterest_, EcalElectronicsMapping::getElectronicsId(), maxDccChs, nDccPerEe, theElecMap, UNKNOWN, and EcalElectronicsId::zside().
Referenced by getCrystalInterest(), getSuperCrystalInterest(), and runSelectiveReadout0().
{ const EcalElectronicsId& id = theElecMap->getElectronicsId(eeDetId); const int iZ0 = id.zside()>0 ? 1 : 0; const int iDcc0 = id.dccId()-1; const int iDccPhi0 = (iDcc0<9)?iDcc0:(iDcc0-45); const int iDccCh0 = id.towerId()-1; assert(0 <= iDccPhi0 && iDccPhi0 < nDccPerEe); assert(0 <= iDccCh0 && iDccCh0 < maxDccChs); assert(eeRuInterest_[iZ0][iDccPhi0][iDccCh0] == UNKNOWN || (0<= eeRuInterest_[iZ0][iDccPhi0][iDccCh0] && eeRuInterest_[iZ0][iDccPhi0][iDccCh0] <=7)); return eeRuInterest_[iZ0][iDccPhi0][iDccCh0]; }
EcalSelectiveReadout::towerInterest_t & EcalSelectiveReadout::eeRuInterest | ( | const EcalScDetId & | id | ) | [private] |
Get access to eeRuInterest element corresponding to an SC det Id
id | the SC det id |
Definition at line 187 of file EcalSelectiveReadout.cc.
References eeRuInterest_, EcalElectronicsMapping::getDCCandSC(), maxDccChs, nDccPerEe, theElecMap, and EcalScDetId::zside().
{ std::pair<int, int> dccAndDccCh = theElecMap->getDCCandSC(scDetId); const int iZ0 = (scDetId.zside()>0) ? 1: 0; const int iDcc0 = dccAndDccCh.first-1; const int iDccPhi0 = (iDcc0<9)?iDcc0:(iDcc0-45); const int iDccCh0 = dccAndDccCh.second-1; assert(0 <= iDccPhi0 && iDccPhi0 <= nDccPerEe); assert(0 <= iDccCh0 && iDccCh0 <= maxDccChs); assert(-1<= eeRuInterest_[iZ0][iDccPhi0][iDccCh0] && eeRuInterest_[iZ0][iDccPhi0][iDccCh0] <=7); return eeRuInterest_[iZ0][iDccPhi0][iDccCh0]; }
EcalSelectiveReadout::towerInterest_t EcalSelectiveReadout::getCrystalInterest | ( | const EEDetId & | eeDetId | ) | const |
Gets the SR interest classification of an EE channel
eeDetId | id of the crystal |
Definition at line 154 of file EcalSelectiveReadout.cc.
References eeRuInterest().
{ // int iz = (eeDetId.zside() > 0) ? 1 : 0; // int superCrystalX = (eeDetId.ix()-1) / 5; // int superCrystalY = (eeDetId.iy()-1) / 5; // return supercrystalInterest[iz][superCrystalX][superCrystalY]; return const_cast<EcalSelectiveReadout*>(this)->eeRuInterest(eeDetId); }
EcalSelectiveReadout::towerInterest_t EcalSelectiveReadout::getCrystalInterest | ( | const EBDetId & | ebDetId | ) | const |
Gets the SR interest classification of an EB channel
ebDetId | id of the crystal |
interest |
Definition at line 146 of file EcalSelectiveReadout.cc.
References getTowerInterest(), theTriggerMap, and EcalTrigTowerConstituentsMap::towerOf().
{ EcalTrigTowerDetId thisTower = theTriggerMap->towerOf(ebDetId); return getTowerInterest(thisTower); }
EcalSelectiveReadout::towerInterest_t EcalSelectiveReadout::getSuperCrystalInterest | ( | const EcalScDetId & | scDetId | ) | const |
Gets the SR interest classification of an EE supercrystal
scDetId | id of the crystal |
Definition at line 164 of file EcalSelectiveReadout.cc.
References eeRuInterest().
Referenced by printEndcap().
{ return const_cast<EcalSelectiveReadout*>(this)->eeRuInterest(scDetId); }
EcalSelectiveReadout::towerInterest_t EcalSelectiveReadout::getTowerInterest | ( | const EcalTrigTowerDetId & | towerId | ) | const |
Gets the SR interest classification of a trigger tower (TT).
iEta | index of the TT along eta |
iPhi | index of the TT along phi |
Definition at line 203 of file EcalSelectiveReadout.cc.
References EcalTrigTowerDetId::ieta(), EcalTrigTowerDetId::iphi(), nTriggerTowersInEta, and towerInterest.
Referenced by getCrystalInterest(), and runSelectiveReadout0().
{ // remember, array indices start at zero int iEta = tower.ieta()<0? tower.ieta() + nTriggerTowersInEta/2 : tower.ieta() + nTriggerTowersInEta/2 -1; int iPhi = tower.iphi() - 1; assert(-1 <= towerInterest[iEta][iPhi] && towerInterest[iEta][iPhi] < 8); return towerInterest[iEta][iPhi]; }
void EcalSelectiveReadout::print | ( | std::ostream & | os | ) | const |
print out the map
Definition at line 286 of file EcalSelectiveReadout.cc.
References printBarrel(), and printEndcap().
Referenced by operator<<().
{ //EE- printEndcap(0, os); //EB printBarrel(os); //EE+ printEndcap(1, os); }
void EcalSelectiveReadout::printBarrel | ( | std::ostream & | os | ) | const |
Definition at line 299 of file EcalSelectiveReadout.cc.
References nBarrelTriggerTowersInEta, nEndcapTriggerTowersInEta, nTriggerTowersInPhi, srpFlagMarker, and towerInterest.
Referenced by print().
{ for(size_t iEta = nEndcapTriggerTowersInEta; iEta < nEndcapTriggerTowersInEta + nBarrelTriggerTowersInEta; ++iEta){ for(size_t iPhi = 0; iPhi < nTriggerTowersInPhi; ++iPhi){ towerInterest_t srFlag = towerInterest[iEta][iPhi]; os << srpFlagMarker[srFlag]; } os << "\n"; //one phi per line } }
void EcalSelectiveReadout::printDccChMap | ( | std::ostream & | os | ) | const [private] |
Propagate TTF flag bit on towerInterest. TT interest forced bit is set if TTF forced bit is set, otherwise it is not touched.
ttFlags | TT flags |
Definition at line 344 of file EcalSelectiveReadout.cc.
References Reference_intrackfit_cff::endcap, EcalElectronicsMapping::getDCCandSC(), i, nSupercrystalXBins, nSupercrystalYBins, theElecMap, and EcalScDetId::validDetId().
{ for(int i=-1; i<=68; ++i){ if((i+1)%10==0) os << "//"; os << std::setw(2) << i << ": " << (char)('0'+i); if(i%10==9) os << "\n"; else os << " "; } os << "\n"; for(int endcap = 0; endcap < 2; ++endcap){ os << "Sc2DCCch0: " << (endcap?"EE+":"EE-") << "\n"; for(size_t iY=0; iY<nSupercrystalYBins; ++iY){ os << "Sc2DCCch0: "; for(size_t iX=0; iX<nSupercrystalXBins; ++iX){ //if(iX) os << ","; if(!EcalScDetId::validDetId(iX+1,iY+1,endcap>=1?1:-1)){ //os << std::setw(2) << -1; os << (char)('0'-1); } else{ //os << std::setw(2) << theElecMap->getDCCandSC(EcalScDetId(iX+1, iY+1, endcap>0?1:-1)).second-1; os << (char)('0'+(theElecMap->getDCCandSC(EcalScDetId(iX+1, iY+1, endcap>0?1:-1)).second-1)); } } os << "\n"; } os << "\n"; } os << "\n"; }
void EcalSelectiveReadout::printEndcap | ( | int | endcap, |
std::ostream & | s | ||
) | const |
Definition at line 315 of file EcalSelectiveReadout.cc.
References trackerHits::c, getSuperCrystalInterest(), nSupercrystalXBins, nSupercrystalYBins, srpFlagMarker, UNKNOWN, and EcalScDetId::validDetId().
Referenced by print().
{ for(size_t iX=0; iX<nSupercrystalXBins; ++iX){ for(size_t iY=0; iY<nSupercrystalYBins; ++iY){ towerInterest_t srFlag; char c; if(!EcalScDetId::validDetId(iX+1,iY+1,endcap>=1?1:-1)){ // srFlag = UNKNOWN; c = ' '; } else{ srFlag = getSuperCrystalInterest(EcalScDetId(iX+1, iY+1, endcap>=1?1:-1));//supercrystalInterest[endcap][iX][iY]; c = srFlag==UNKNOWN ? '?' : srpFlagMarker[srFlag]; } os << c; } os << "\n"; //one Y supercystal column per line } //next supercrystal X-index }
void EcalSelectiveReadout::printHeader | ( | std::ostream & | os | ) | const |
print out header for the map: see print(std::ostream&)
Definition at line 273 of file EcalSelectiveReadout.cc.
References srpFlagMarker.
{ os << "#SRP flag map\n#\n" "# +-->Phi/Y " << srpFlagMarker[0] << ": low interest\n" "# | " << srpFlagMarker[1] << ": single\n" "# | " << srpFlagMarker[2] << ": neighbour\n" "# V Eta/X " << srpFlagMarker[3] << ": center\n" "# " << srpFlagMarker[4] << ": forced low interest\n" "# " << srpFlagMarker[5] << ": forced single\n" "# " << srpFlagMarker[6] << ": forced neighbout\n" "# " << srpFlagMarker[7] << ": forced center\n" "#\n"; }
void EcalSelectiveReadout::resetEeRuInterest | ( | ) | [private] |
Sets all endcap RU interest flags to 'unknown'
Definition at line 25 of file EcalSelectiveReadout.cc.
References eeRuInterest_, maxDccChs, nDccPerEe, nEndcaps, and UNKNOWN.
Referenced by runSelectiveReadout0().
{ //init superCrystalInterest (sets all elts to 'UNKNOWN'): for(size_t iCap=0; iCap < nEndcaps; ++iCap){ for(int iDccPhi = 0; iDccPhi < nDccPerEe; ++iDccPhi){ for(int iDccCh = 0; iDccCh < maxDccChs; ++iDccCh){ eeRuInterest_[iCap][iDccPhi][iDccCh] = UNKNOWN; } } } }
void EcalSelectiveReadout::runSelectiveReadout0 | ( | const ttFlag_t | towerFlags[nTriggerTowersInEta][nTriggerTowersInPhi] | ) |
Selective readout algorithm type 0. The algorithm is the following:
For the barrel a crystal inherit the single/center/neighbour/low_interst classification of its TT. For the endcap,
An endcap crystal inherits the SRP flag of its SC.
triggerTowerEt | array of the transverse enrgy deposited in the trigger tower. First index is for eta,2nd index for phi. |
Definition at line 37 of file EcalSelectiveReadout.cc.
References CENTER, classifyTriggerTowers(), combineFlags(), DetId::Ecal, EcalEndcap, eeRuInterest(), FORCED_MASK, getTowerInterest(), LOWINTEREST, nBarrelTriggerTowersInEta, NEIGHBOUR, nEndcapTriggerTowersInEta, nEndcapXBins, nEndcapYBins, nTriggerTowersInEta, nTriggerTowersInPhi, DetId::rawId(), resetEeRuInterest(), SINGLE, theTriggerMap, towerInterest, EcalTrigTowerConstituentsMap::towerOf(), and EEDetId::validDetId().
{ //printDccChMap(std::cout); //classifies the trigger towers (single,center,neighbor,low interest) classifyTriggerTowers(ttFlags); //count number of TT in each interest class for debugging display int nTriggerTowerE[] = {0, 0, 0, 0, 0, 0, 0, 0}; int nTriggerTowerB[] = {0, 0, 0, 0, 0, 0, 0, 0}; static int ncall = 0; if(ncall < 10){ ++ncall; for(size_t iPhi = 0; iPhi < nTriggerTowersInPhi; ++iPhi){ for(size_t iEta = 0; iEta < nTriggerTowersInEta; ++iEta){ if(iEta < nEndcapTriggerTowersInEta || iEta >= nBarrelTriggerTowersInEta + nEndcapTriggerTowersInEta){ //in endcaps ++nTriggerTowerE[towerInterest[iEta][iPhi]]; } else{//in barrel ++nTriggerTowerB[towerInterest[iEta][iPhi]]; } assert(towerInterest[iEta][iPhi] >= 0 && towerInterest[iEta][iPhi] <= 0x7); } } edm::LogInfo("EcalSelectiveReadout") << "without forced bit + with forced bit set:\n" << nTriggerTowerB[LOWINTEREST] << " + " << nTriggerTowerB[LOWINTEREST | FORCED_MASK] << " low interest TT(s) in barrel\n" << nTriggerTowerB[SINGLE] << " + " << nTriggerTowerB[SINGLE | FORCED_MASK] << " single TT(s) in barrel\n" << nTriggerTowerB[NEIGHBOUR] << " + " << nTriggerTowerB[NEIGHBOUR | FORCED_MASK] << " neighbor interest TT(s) in barrel\n" << nTriggerTowerB[CENTER] << " + " << nTriggerTowerB[CENTER | FORCED_MASK] << " centre interest TT(s) in barrel\n" << nTriggerTowerE[LOWINTEREST] << " + " << nTriggerTowerE[LOWINTEREST | FORCED_MASK] << " low interest TT(s) in endcap\n" << nTriggerTowerE[SINGLE] << " + " << nTriggerTowerE[SINGLE | FORCED_MASK] << " single TT(s) in endcap\n" << nTriggerTowerE[NEIGHBOUR] << " + " << nTriggerTowerE[NEIGHBOUR | FORCED_MASK] << " neighbor TT(s) in endcap\n" << nTriggerTowerE[CENTER] << " + " << nTriggerTowerE[CENTER | FORCED_MASK] << " center TT(s) in endcap\n"; } //end TT interest class composition debugging display //For the endcap the TT classification must be mapped to the SC: resetEeRuInterest(); #ifndef ECALSELECTIVEREADOUT_NOGEOM const std::vector<DetId>& endcapDetIds = theGeometry->getValidDetIds(DetId::Ecal, EcalEndcap); for(std::vector<DetId>::const_iterator eeDetIdItr = endcapDetIds.begin(); eeDetIdItr != endcapDetIds.end(); ++eeDetIdItr){ // for each superCrystal, the interest is the highest interest // of any trigger tower associated with at least one crystal from this SC. // The forced bit must be set if the flag of one of these trigger towers has // the forced bit set. EcalTrigTowerDetId trigTower = theTriggerMap->towerOf(*eeDetIdItr); assert(trigTower.rawId() != 0); EEDetId eeDetId(*eeDetIdItr); int iz = (eeDetId.zside() > 0) ? 1 : 0; //Following statement will set properly the actual 2-bit flag value //and the forced bit: TTF forced bit is propagated to every RU that //overlaps with the corresponding TT. combineFlags(eeRuInterest(eeDetId), getTowerInterest(trigTower)); } #else //ECALSELECTIVEREADOUT_NOGEOM defined EEDetId xtal; for(int iZ0=0; iZ0<2; ++iZ0){//0->EE-, 1->EE+ for(unsigned iX0=0; iX0<nEndcapXBins; ++iX0){ for(unsigned iY0=0; iY0<nEndcapYBins; ++iY0){ if (!(xtal.validDetId(iX0+1, iY0+1, (iZ0>0?1:-1)))){ continue; } xtal = EEDetId(iX0+1, iY0+1, (iZ0>0?1:-1)); //works around a EEDetId bug. To remove once the bug fixed. if(39 <= iX0 && iX0 <= 60 && 45 <= iY0 && iY0 <= 54){ continue; } // for each superCrystal, the interest is the highest interest // of any trigger tower associated with any crystal in this SC EcalTrigTowerDetId trigTower = theTriggerMap->towerOf(xtal); assert(trigTower.rawId() != 0); //Following statement will set properly the actual 2-bit flag value //and the forced bit: TTF forced bit is propagated to every RU that //overlaps with the corresponding TT. combineFlags(eeRuInterest(xtal), getTowerInterest(trigTower)); assert(0<= eeRuInterest(xtal) && eeRuInterest(xtal) <= 0x7); } //next iY0 } //next iX0 } //next iZ0 #endif //ECALSELECTIVEREADOUT_NOGEOM not defined }
void EcalSelectiveReadout::setElecMap | ( | const EcalElectronicsMapping * | map | ) | [inline] |
the electronics map, used to get information about the DCC and DCC channel used to read a crystal channel
Definition at line 179 of file EcalSelectiveReadout.h.
References Association::map, and theElecMap.
{ theElecMap = map; }
Changes the value of a variable iff that has the effect to increase the variable value var = max(var,val)
var | the variable |
val | the new candidate value |
Definition at line 300 of file EcalSelectiveReadout.h.
{
if(val>var) var = val;
}
void EcalSelectiveReadout::setLower | ( | int & | var, |
int | val | ||
) | const [inline, private] |
Changes the value of a variable iff that has the effect to decrease the variable value var = min(var,val)
var | the variable |
val | the new candidate value |
Definition at line 289 of file EcalSelectiveReadout.h.
{
if(val<var) var = val;
}
void EcalSelectiveReadout::setTriggerMap | ( | const EcalTrigTowerConstituentsMap * | map | ) | [inline] |
the mapping of which cell goes with which trigger tower
Definition at line 173 of file EcalSelectiveReadout.h.
References Association::map, and theTriggerMap.
{ theTriggerMap = map; }
int EcalSelectiveReadout::dEta [private] |
Definition at line 357 of file EcalSelectiveReadout.h.
Referenced by classifyTriggerTowers().
int EcalSelectiveReadout::dPhi [private] |
Definition at line 358 of file EcalSelectiveReadout.h.
Referenced by classifyTriggerTowers().
Definition at line 356 of file EcalSelectiveReadout.h.
Referenced by eeRuInterest(), and resetEeRuInterest().
const int EcalSelectiveReadout::FORCED_MASK = 0x4 [static] |
Definition at line 67 of file EcalSelectiveReadout.h.
Referenced by classifyTriggerTowers(), EcalSelectiveReadoutSuppressor::initCellThresholds(), and runSelectiveReadout0().
const int EcalSelectiveReadout::maxDccChs = 68 [static] |
Maximum number of DCC channels used from crystal channels (channel #69 and #70 used for MEM are not counted here)
Definition at line 152 of file EcalSelectiveReadout.h.
Referenced by eeRuInterest(), and resetEeRuInterest().
const size_t EcalSelectiveReadout::nBarrelEtaBins = 170 [static] |
Number of crystals along eta in barrel
Definition at line 107 of file EcalSelectiveReadout.h.
const size_t EcalSelectiveReadout::nBarrelPhiBins = 360 [static] |
Number of crystals in a eta ring of the barrel
Definition at line 110 of file EcalSelectiveReadout.h.
const size_t EcalSelectiveReadout::nBarrelTowerEtaBins = nBarrelEtaBins/5 [static] |
Number of trigger tower along eta in the barrel
Definition at line 128 of file EcalSelectiveReadout.h.
const size_t EcalSelectiveReadout::nBarrelTowerPhiBins = nBarrelPhiBins/5 [static] |
Number of trigger tower in a eta ring of the barrel
Definition at line 131 of file EcalSelectiveReadout.h.
const size_t EcalSelectiveReadout::nBarrelTriggerTowersInEta = 34 [static] |
Number of barrel trigger towers along eta
Definition at line 140 of file EcalSelectiveReadout.h.
Referenced by printBarrel(), and runSelectiveReadout0().
const int EcalSelectiveReadout::nDccPerEe = 9 [static] |
Number of DCC per endcap
Definition at line 156 of file EcalSelectiveReadout.h.
Referenced by eeRuInterest(), and resetEeRuInterest().
const size_t EcalSelectiveReadout::nEndcaps = 2 [static] |
Number of endcap, obviously tow
Definition at line 134 of file EcalSelectiveReadout.h.
Referenced by resetEeRuInterest().
const size_t EcalSelectiveReadout::nEndcapTriggerTowersInEta = 11 [static] |
Number of trigger towers along eta in one endcap
Definition at line 137 of file EcalSelectiveReadout.h.
Referenced by printBarrel(), and runSelectiveReadout0().
const size_t EcalSelectiveReadout::nEndcapXBins = 100 [static] |
Range of the x-index of endcap crystals (xman-xmin+1).
Definition at line 113 of file EcalSelectiveReadout.h.
Referenced by runSelectiveReadout0().
const size_t EcalSelectiveReadout::nEndcapYBins = 100 [static] |
Range of the y-index of endcap crystals (yman-ymin+1).
Definition at line 116 of file EcalSelectiveReadout.h.
Referenced by runSelectiveReadout0().
const size_t EcalSelectiveReadout::nSupercrystalXBins = nEndcapXBins/supercrystalEdge [static] |
Range of endcap supercrystal x-index (xmax-xmin+1)
Definition at line 122 of file EcalSelectiveReadout.h.
Referenced by printDccChMap(), and printEndcap().
const size_t EcalSelectiveReadout::nSupercrystalYBins = nEndcapYBins/supercrystalEdge [static] |
Range of endcap supercrystal y-index (ymay-ymin+1)
Definition at line 125 of file EcalSelectiveReadout.h.
Referenced by printDccChMap(), and printEndcap().
const size_t EcalSelectiveReadout::nTriggerTowersInEta [static] |
Number of trigger towers along eta for the whole ECAL
Definition at line 143 of file EcalSelectiveReadout.h.
Referenced by classifyTriggerTowers(), getTowerInterest(), and runSelectiveReadout0().
const size_t EcalSelectiveReadout::nTriggerTowersInPhi = 72 [static] |
Number of trigger towers in an eta ring
Definition at line 147 of file EcalSelectiveReadout.h.
Referenced by classifyTriggerTowers(), printBarrel(), and runSelectiveReadout0().
const char EcalSelectiveReadout::srpFlagMarker [static, private] |
{'.', 'S', 'N', 'C', '4', '5', '6', '7'}
Definition at line 361 of file EcalSelectiveReadout.h.
Referenced by printBarrel(), printEndcap(), and printHeader().
const size_t EcalSelectiveReadout::supercrystalEdge = 5 [static] |
Edge size of a supercrystal. A supercrystal is a tower of 5x5 crystals.
Definition at line 119 of file EcalSelectiveReadout.h.
const EcalElectronicsMapping* EcalSelectiveReadout::theElecMap [private] |
Definition at line 349 of file EcalSelectiveReadout.h.
Referenced by eeRuInterest(), printDccChMap(), and setElecMap().
const EcalTrigTowerConstituentsMap* EcalSelectiveReadout::theTriggerMap [private] |
Definition at line 348 of file EcalSelectiveReadout.h.
Referenced by getCrystalInterest(), runSelectiveReadout0(), and setTriggerMap().
towerInterest_t EcalSelectiveReadout::towerInterest[nTriggerTowersInEta][nTriggerTowersInPhi] [private] |
Definition at line 354 of file EcalSelectiveReadout.h.
Referenced by classifyTriggerTowers(), getTowerInterest(), printBarrel(), and runSelectiveReadout0().
const int EcalSelectiveReadout::TTF_FORCED_RO_MASK = FORCED_MASK [static] |
Definition at line 100 of file EcalSelectiveReadout.h.
Referenced by combineFlags().