 |
ATLAS Offline Software
|
Go to the documentation of this file.
25 ATH_MSG_FATAL(
"Configuration problem: LArNoisyROTool assumes that the QFactor cut to declare a channel noisy is softer than the QFactor cut to declare the quality saturated !" );
26 return StatusCode::FAILURE;
30 ATH_MSG_FATAL(
"Configuration problem: LArNoisyROTool assumes that MNBLooseCut is smaller than MNBTightCut" );
31 return StatusCode::FAILURE;
56 return StatusCode::SUCCESS;
64 if(doHVline && ( !nCellsperLine || !cddm || !hvid)) {
65 ATH_MSG_ERROR(
"HV line flagging asked, but missing ingrediences, switching off !!");
69 std::unique_ptr<LArNoisyROSummary> noisyRO=std::make_unique<LArNoisyROSummary>();
71 if(!cellContainer)
return noisyRO;
79 unsigned int NsaturatedTightCutBarrelA = 0;
80 unsigned int NsaturatedTightCutBarrelC = 0;
81 unsigned int NsaturatedTightCutEMECA = 0;
82 unsigned int NsaturatedTightCutEMECC = 0;
105 if (
sideA ) { NsaturatedTightCutBarrelA++; }
106 else { NsaturatedTightCutBarrelC++; }
110 if (
sideA ) { NsaturatedTightCutEMECA++; }
111 else { NsaturatedTightCutEMECC++; }
124 FEBStats[FEBindex].addBadChannel(
channel);
129 std::vector<HWIdentifier> hvlines;
131 for(
unsigned int i=0;
i<hvlines.size(); ++
i) {
132 if(HVStats.contains(hvlines[
i])) HVStats[hvlines[
i]] += 1;
else HVStats[hvlines[
i]]=1;
139 uint8_t SatTightPartitions = 0;
144 bool badSaturatedTightCut = (SatTightPartitions != 0);
145 if ( badSaturatedTightCut ) noisyRO-> SetSatTightFlaggedPartitions(SatTightPartitions);
149 for (
auto&
it : FEBStats) {
150 ATH_MSG_VERBOSE(
" candidate FEB " <<
it.first <<
" with " <<
it.second.badChannels() <<
" bad channels");
161 unsigned int associatedPSFEB = 0;
164 associatedPSFEB = assoc_it->second;
166 if (associatedPSFEB != 0){
181 unsigned int NBadFEBEMECA = 0;
unsigned int NBadFEBEMECA_W = 0;
182 unsigned int NBadFEBEMECC = 0;
unsigned int NBadFEBEMECC_W = 0;
183 unsigned int NBadFEBEMBA = 0;
unsigned int NBadFEBEMBA_W = 0;
184 unsigned int NBadFEBEMBC = 0;
unsigned int NBadFEBEMBC_W = 0;
186 const std::vector<HWIdentifier>& badfebs = noisyRO->
get_noisy_febs();
199 const unsigned int int_id = febid.get_identifier32().get_compact();
200 if (knownBadFEBs->find(int_id)!=knownBadFEBs->end())
weight=2;
205 NBadFEBEMBA_W = NBadFEBEMBA_W +
weight;
209 NBadFEBEMBC_W = NBadFEBEMBC_W +
weight;
216 NBadFEBEMECA_W = NBadFEBEMECA_W +
weight;
220 NBadFEBEMECC_W = NBadFEBEMECC_W +
weight;
231 if ( BadFEBPartitions != 0 ) noisyRO-> SetBadFEBFlaggedPartitions(BadFEBPartitions);
233 uint8_t BadFEBPartitions_W = 0;
238 if ( BadFEBPartitions_W != 0 ) noisyRO-> SetBadFEB_WFlaggedPartitions(BadFEBPartitions_W);
244 uint8_t MNBTight_PsVetoPartition=0;
247 std::array<unsigned,5> nTightMNBFEBSperPartition{};
248 std::array<unsigned,5> nTight_PsVetoMNBFEBSperPartition{};
249 std::array<unsigned,5> nLooseMNBFEBSperPartition{};
251 auto statIt=FEBStats.find(febid.get_identifier32().get_compact());
252 if (statIt!=FEBStats.end()) {
259 if (
unsigned int associatedPSFEB =
found->second; associatedPSFEB != 0){
260 if (FEBStats.count(associatedPSFEB) == 0) (nTight_PsVetoMNBFEBSperPartition[
partitionNumber(febid)])++;
273 for (
unsigned iP=0;iP<4;++iP) {
274 ATH_MSG_DEBUG(
"Partition " << iP <<
": Found " << nLooseMNBFEBSperPartition[iP] <<
" MNB FEBs with more than " <<
m_MNBLooseCut <<
" bad-Q channels" );
275 ATH_MSG_DEBUG(
"Partition " << iP <<
": Found " << nTightMNBFEBSperPartition[iP] <<
" MNB FEBs with more than " <<
m_MNBTightCut <<
" bad-Q channels" );
276 if (nLooseMNBFEBSperPartition[iP]>0) MNBLoosePartition |=
m_partitionMask[iP];
277 if (nTightMNBFEBSperPartition[iP]>0) MNBTightPartition |=
m_partitionMask[iP];
278 if (nTight_PsVetoMNBFEBSperPartition[iP]>0) MNBTight_PsVetoPartition |=
m_partitionMask[iP];
286 if(!hvid || !nCellsperLine )
return noisyRO;
289 unsigned int NBadHVEMECA = 0;
290 unsigned int NBadHVEMECC = 0;
291 unsigned int NBadHVEMBA = 0;
292 unsigned int NBadHVEMBC = 0;
293 unsigned int NBadHVHECA = 0;
294 unsigned int NBadHVHECC = 0;
295 unsigned int NBadHVFCALA = 0;
296 unsigned int NBadHVFCALC = 0;
299 for ( HVlinesStatMap::const_iterator
it = HVStats.begin();
it != HVStats.end(); ++
it ) {
300 ATH_MSG_DEBUG(ctx.eventID().event_number()<<
" candidate HVline " <<
it->first <<
" with " <<
it->second <<
" bad channels, out of "<<nCellsperLine->
HVNcell(
HWIdentifier(
it->first))<<
" channels");
310 case 0:
case 1:{NBadHVEMBC += 1;
break;}
311 case 2:
case 3:{NBadHVEMECC += 1;
break;}
312 case 4: {NBadHVHECC += 1;
break;}
313 case 5: {NBadHVFCALC += 1;
break;}
318 case 0: {
switch(
part){
319 case 0:
case 1:{NBadHVEMBA += 1;
break;}
320 case 2:
case 3:{NBadHVEMECA += 1;
break;}
321 case 4: {NBadHVHECA += 1;
break;}
322 case 5: {NBadHVFCALA += 1;
break;}
341 if ( BadHVPartitions != 0 ) noisyRO-> SetBadHVlinesPartitions(BadHVPartitions);
def retrieve(aClass, aKey=None)
void SetMNBLooseFlaggedPartitions(uint8_t bitpattern)
bool is_em_endcap(const Identifier id) const
test if the id belongs to the EM Endcap
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
id_iterator feb_begin() const
Returns an iterator pointing to a feb identifier collection.
void SetMNBTight_PsVetoFlaggedPartitions(uint8_t bitpattern)
#define ATH_MSG_VERBOSE(x)
int barrel_ec(const HWIdentifier id) const
Return the position barrel or endcap of a hardware cell identifier: barrel_ec = [0,...
void add_MNBTight_feb(HWIdentifier febid)
value_type get_compact() const
Get the compact id.
bool is_em(const Identifier id) const
test if the id belongs to LArEM
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
bool isEMECchannel(const HWIdentifier id) const override final
int sampling(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
::StatusCode StatusCode
StatusCode definition for legacy code.
int zside(const HWIdentifier id) const
Return an integer corresponding to the side of an hardware electrode identifier.
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
bool is_em_endcap_inner(const Identifier id) const
test if the id belongs to the EM Endcap inner wheel
int pos_neg(const HWIdentifier id) const
Return the side of a hardware cell identifier pos_neg = [0,1] positive-side or negative-side Barrel...
const std::vector< HWIdentifier > & get_noisy_febs() const
void add_MNBLoose_feb(HWIdentifier febid)
int detector(const HWIdentifier id) const
Return an integer corresponding to the detector of an hardware electrode identifier.
HWIdentifier feb_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Create feb_Id from fields.
unsigned constexpr int sideA
void add_MNBTight_PsVeto_feb(HWIdentifier febid)
id_iterator feb_end() const
bool is_em_barrel(const Identifier id) const
test if the id belongs to the EM barrel
void add_noisy_hvline(HWIdentifier hvid)
void SetMNBTightFlaggedPartitions(uint8_t bitpattern)
StatusCode initialize(bool used=true)
Container class for CaloCell.
bool isEMBchannel(const HWIdentifier id) const
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
This class provides the client interface for accessing the detector description information common to...
Data object for each calorimeter readout cell.
#define ATH_MSG_WARNING(x)
short HVNcell(const HWIdentifier &chid) const
std::string channel_name(const HWIdentifier id) const
Return a string corresponding to a feedthrough name given an identifier.
void add_noisy_feb(HWIdentifier febid)
const std::vector< HWIdentifier > & getLArElectrodeIDvec(HWIdentifier &hvlineId) const
Return a vector of LArElectrodeID corresponding to a given LArHVLineID.