 |
ATLAS Offline Software
|
Go to the documentation of this file.
9 #include "GaudiKernel/MsgStream.h"
12 #include "GaudiKernel/SystemOfUnits.h"
26 m_calo_id_man(nullptr),
28 m_lar_hec_id(nullptr),
29 m_lar_fcal_id(nullptr),
30 m_calocell_id(nullptr),
104 return StatusCode::SUCCESS;
112 const EventContext& ctx = Gaudi::Hive::currentContext();
115 if(!caloMgrHandle.isValid()) {
117 return StatusCode::FAILURE;
128 if (writeElecHandle.isValid() && writePileupHandle.isValid()) {
130 return StatusCode::SUCCESS;
135 writeElecHandle.addDependency (fullRange);
136 writePileupHandle.addDependency (fullRange);
140 if(!cablingHdl.isValid()) {
142 return StatusCode::FAILURE;
145 writeElecHandle.addDependency (cablingHdl);
146 writePileupHandle.addDependency (cablingHdl);
152 return StatusCode::FAILURE;
154 writeElecHandle.addDependency (adc2mevHdl);
155 writePileupHandle.addDependency (adc2mevHdl);
159 if(!pedHdl.isValid()){
161 return StatusCode::FAILURE;
164 writeElecHandle.addDependency (pedHdl);
167 if(!noiseHdl.isValid()){
169 return StatusCode::FAILURE;
172 writeElecHandle.addDependency (noiseHdl);
177 if(!acorrHdl.isValid()){
179 return StatusCode::FAILURE;
182 writeElecHandle.addDependency (acorrHdl);
185 if(!ofcHdl.isValid()){
187 return StatusCode::FAILURE;
190 writeElecHandle.addDependency (ofcHdl);
191 writePileupHandle.addDependency (ofcHdl);
194 if(!shapeHdl.isValid()){
196 return StatusCode::FAILURE;
199 writeElecHandle.addDependency (shapeHdl);
200 writePileupHandle.addDependency (shapeHdl);
203 if(!fsamplHdl.isValid()){
205 return StatusCode::FAILURE;
208 writePileupHandle.addDependency (fsamplHdl);
212 if(!minbiasHdl.isValid()){
214 return StatusCode::FAILURE;
217 writePileupHandle.addDependency (minbiasHdl);
224 std::unique_ptr<CaloNoise> pileupNoiseObj=std::make_unique<CaloNoise>(
m_LArHashMax,
m_nGains, 0,4,
228 auto& pileupnoise = pileupNoiseObj->
larStorage();
239 pileupnoise[
igain][ihash] = pns;
244 ATH_CHECK(writeElecHandle.record(std::move(elecNoiseObj)));
245 ATH_MSG_INFO(
"recorded new CaloNoise object with key " << writeElecHandle.key() <<
" and range " << writeElecHandle.getRange());
247 ATH_CHECK(writePileupHandle.record(std::move(pileupNoiseObj)));
248 ATH_MSG_INFO(
"recorded new CaloNoise object with key " << writePileupHandle.key() <<
" and range " << writePileupHandle.getRange());
250 return StatusCode::SUCCESS;
276 return StatusCode::SUCCESS;
286 static_cast<unsigned int> (-1));
374 else idSymmCaloHash=idCaloHash;
405 return StatusCode::SUCCESS;
444 if (sc.isFailure()) {
474 return StatusCode::SUCCESS;
497 if(polynom_adc2mev.size()==0)
498 adc2mevVector.push_back(0.);
500 adc2mevVector.push_back(polynom_adc2mev[1]);
506 return StatusCode::SUCCESS;
533 ATH_MSG_INFO(
"===== Diagnostic for gain "<<igain<<
" =====");
546 for(
int i=0;
i<10;++
i)
552 return StatusCode::SUCCESS;
572 return StatusCode::SUCCESS;
631 float OFC_AC_OFC,OFC_OFC;
635 float REST = OFC_OFC*(1./12.);
654 if(noiseOK &&
sigma<0)
678 const float &Nminbias)
680 if(Nminbias<=0.000001)
return 0.;
709 if(
sc.isFailure())
return 0.;
724 float OFC_AC_OFC,OFC_OFC;
732 PileUp*=std::sqrt(OFC_AC_OFC);
749 if(
i==j)
m_c[
i][j] = 1.;
762 for (
int k=0;
k<nsize;
k++) {
763 if ((j-
i+
k)>=0 && (j-
i+
k)<nsize) {
844 for(
unsigned int i=0;
i<
m_OFC.size();++
i)
883 StatusCode StatusDatabase=StatusCode::SUCCESS;
890 StatusDatabase=StatusCode::FAILURE;
900 StatusDatabase=StatusCode::FAILURE;
913 StatusDatabase=StatusCode::FAILURE;
917 StatusDatabase=StatusCode::FAILURE;
931 StatusDatabase=StatusCode::FAILURE;
935 StatusDatabase=StatusCode::FAILURE;
941 unsigned int n_OFCnull=0;
943 if(std::fabs(
ofc)<0.000001) ++n_OFCnull;
957 StatusDatabase=StatusCode::FAILURE;
965 StatusDatabase=StatusCode::FAILURE;
971 unsigned int n_SHAPEnull=0;
973 if(std::fabs(shp)<0.000001) ++n_SHAPEnull;
974 if(n_SHAPEnull==
m_Shape.size())
986 ATH_MSG_DEBUG(
"AutoCorr and OFC vectors have not the same " <<
"number of elements" <<
" ("<<
m_AutoCorr.size()<<
"/"<<
m_OFC.size() <<
" ) => will take into account only " <<
m_nsamples <<
" samples !" );
1007 StatusDatabase=StatusCode::FAILURE;
1012 return StatusDatabase;
1021 if (nTmp >= 5000)
return;
1023 if (nr >= 10)
return;
1068 igain=
static_cast<int>(convertedGain);
1073 ATH_MSG_WARNING(
" ask noise for invalid/unknown gain, will return noise for high gain " );
1077 if (iCalo<0 ||
index<0)
1085 const std::vector<float>* sigmaVector = 0;
1090 int gain_wanted=
igain;
1091 int gain_shifted=gain_wanted;
1098 gain_shifted=gain_wanted-shift_gain;
1100 sigma = (*sigmaVector)[gain_shifted];
1107 if(shift_gain<=
igain) retry=
true;
1123 std::vector<float>
sigma;
1126 sigma.push_back(this->elecNoiseRMS(caloDDE,
1148 const float Nminbias) {
1156 const float Nminbias) {
1158 float pileupNoiseRMS_tmp = this->
pileupNoiseRMS(theCell,Nminbias);
1160 if(elecNoiseRMS_tmp>=0)
1161 return std::sqrt((elecNoiseRMS_tmp*elecNoiseRMS_tmp) + (pileupNoiseRMS_tmp*pileupNoiseRMS_tmp));
1171 const float Nminbias)
1202 const float Nminbias)
1205 float pileupNoiseRMS_tmp = this->
pileupNoiseRMS(caloDDE,Nminbias);
1210 if(elecNoiseRMS_tmp>0)
1211 totalNoiseRMS= std::sqrt((elecNoiseRMS_tmp*elecNoiseRMS_tmp) + (pileupNoiseRMS_tmp*pileupNoiseRMS_tmp) );
1220 const float Nminbias)
1229 const float Nminbias)
1234 throw std::runtime_error(
"Invalid CaloID in CaloNoiseCompCondAlg::totalNoiseRMSHighestGain");
1267 ATH_MSG_WARNING(
"CaloNoiseCompCondAlg::adc2mev(id,gain) : NOT IMPLEMENTED !" <<
"for TILE (-> returns 1. for the moment)" );
def retrieve(aClass, aKey=None)
SG::ReadCondHandleKey< ILArNoise > m_noiseKey
const ILArOFC * m_ofccond
bool valid() const
Test to see if the proxy has been initialized.
float adc2mev(const CaloDetDescrElement *caloDDE, const CaloGain::CaloGain gain)
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
void updateDiagnostic(int reason, const std::string &reason_name, int igain, bool &noiseOK)
CaloGain::CaloGain m_highestGain[m_nCalos]
void commonCalculations(float &OFC_AC_OFC, float &OFC_OFC, int icase, unsigned int firstSample=0)
const ILArNoise * m_noise
int eta(const Identifier id) const
return eta [0,9] outer part [0,3] inner part
Scalar phi() const
phi method
int phi_min(const Identifier regId) const
min value of phi index (-999 == failure)
int pos_neg(const Identifier id) const
pos_neg : +/- 2 (A/C side)
std::vector< IdentifierHash > m_indexContainer
size_type channel_hash_max() const
One more than the largest channel (cell) hash code.
StatusCode initPileUpNoise()
Scalar eta() const
pseudorapidity method
SG::ReadCondHandleKey< ILArOFC > m_LArOFCObjKey
const ILArShape * m_shapecond
const LArHEC_Base_ID * m_lar_hec_id
Identifier region_id(const ExpandedIdentifier &exp_id) const
Build a cell identifier from an expanded identifier.
const LArFCAL_Base_ID * m_lar_fcal_id
VectorContainer m_elecNoiseRAWContainer
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
const LArEM_ID * getEM_ID(void) const
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
bool m_diagnostic[m_nGains]
static EventIDRange infiniteMixed()
Produces an mixed EventIDRange that is infinite in Time and RunLumi.
VectorContainer m_adc2mevContainer
BooleanProperty m_DiagnosticLG
BooleanProperty m_UseSymmetry
int module(const Identifier id) const
module [1,3]
SingleContainer m_pileupNoiseContainer
int region(const Identifier id) const
return region according to :
int sampling(const Identifier id) const
return sampling according to :
int m_nReason[5000][m_nGains]
const LArOnOffIdMapping * m_cabling
#define ATH_MSG_VERBOSE(x)
bool empty() const
Test if the key is blank.
float calculatePileUpNoise(const IdentifierHash &idCaloHash, const float &Nminbias)
Identifier region_id(const ExpandedIdentifier &exp_id) const
region identifier for a channel from ExpandedIdentifier
Identifier channel_id(const ExpandedIdentifier &exp_id) const
Build a cell identifier from an expanded identifier.
const LArEM_Base_ID * m_lar_em_id
@ u
Enums for curvilinear frames.
int eta(const Identifier id) const
return eta according to :
virtual AutoCorrRef_t autoCorr(const HWIdentifier &CellID, int gain) const =0
int eta(const Identifier id) const
eta [0,63] module 1 ; [0,31] module 2 ; [0,15] module 3
LArVectorProxy m_AutoCorr
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
SG::ReadCondHandleKey< ILArShape > m_shapeKey
CaloCell_ID::SUBCALO getSubCalo() const
cell subcalo
StatusCode retrieveCellDatabase(const IdentifierHash &idCaloHash, const Identifier &id, int igain, std::vector< bool > &retrieve)
UnsignedIntegerProperty m_firstSample
int m_reason[5000][10][m_nGains]
int phi(const Identifier id) const
phi [0,15]
StatusCode initAdc2MeV(const LArADC2MeV *adc2mev)
Identifier identify() const override final
cell identifier
int index(const IdentifierHash &idCaloHash)
float m_LowGainThresh[m_nCalos]
IdentifierHash m_CaloHashMin
const LArHEC_ID * getHEC_ID(void) const
IdentifierHash calo_hash() const
cell calo hash
StatusCode initElecNoise()
msgSvc
Provide convenience handles for various services.
StatusCode checkCellDatabase(const Identifier &id, int igain, std::vector< bool > &retrieve)
bool checkIfConnected(const Identifier &id)
::StatusCode StatusCode
StatusCode definition for legacy code.
const CaloIdManager * m_calo_id_man
virtual const float & FSAMPL(const HWIdentifier &id) const =0
float elecNoiseRMS(const CaloCell *caloCell)
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Identifier channel_id(const ExpandedIdentifier &exp_id) const
cell identifier for a channel from ExpandedIdentifier
SUBCALO
enumeration of sub calorimeters
float pileupNoiseRMS(const CaloCell *caloCell, const float Nminbias=-1)
std::vector< float > elecNoiseRMS3gains(const CaloDetDescrElement *caloDDE)
const LArFCAL_ID * getFCAL_ID(void) const
virtual StatusCode execute() override final
standard Athena-Algorithm method
virtual const float & noise(const HWIdentifier &id, int gain) const =0
CaloNoiseCompCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
const CaloDetDescrManager * m_calo_dd_man
Identifier module_id(const ExpandedIdentifier &exp_id) const
module identifier for a channel from ExpandedIdentifier
IdentifierHash m_LArHashMax
StatusCode initContainers()
bool is_lar_hec(Identifier id) const
const ILArPedestal * m_ped
SG::WriteCondHandleKey< CaloNoise > m_outputElecKey
HWIdentifier createSignalChannelID(const Identifier &id) const
create a HWIdentifier from an Identifier (not inline)
SG::ReadCondHandleKey< ILArfSampl > m_fSamplKey
BooleanProperty m_DiagnosticMG
SG::ReadCondHandleKey< ILArMinBias > m_LArMinBiasObjKey
float totalNoiseRMS(const CaloCell *caloCell, const float Nminbias=-1)
BooleanProperty m_DiagnosticHG
float m_HighGainThresh[m_nCalos]
int barrel_ec(const Identifier id) const
return barrel_ec according to :
int m_idHash[5000][m_nGains]
CaloGain::CaloGain gain() const
get gain (data member )
Identifier channel_id(const ExpandedIdentifier &exp_id) const
channel identifier for a channel from ExpandedIdentifier
StatusCode initialize(bool used=true)
const ILArMinBias * m_minbias
std::string m_reasonName[10]
Identifier cell_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy, const int eta, const int phi) const
Make a cell (== channel) ID from constituting fields and subCalo index; for (Mini)FCAL,...
SG::ReadCondHandleKey< LArADC2MeV > m_adc2mevKey
StatusCode initData(const LArADC2MeV *adc2mev)
float totalNoiseRMSHighestGain(const CaloCell *caloCell, const float Nminbias=-1)
Data object for each calorimeter readout cell.
int m_nCellsWithProblem[m_nGains]
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
SG::ReadCondHandleKey< ILArPedestal > m_pedestalKey
SG::ReadCondHandleKey< ILArAutoCorr > m_acorrKey
#define ATH_MSG_WARNING(x)
boost::multi_array< float, 2 > & larStorage()
Non-const accessor to underlying storage for filling:
virtual const float & minBiasRMS(const HWIdentifier &id) const =0
access to RMS of E in minimum bias events index by Identifier
int sampling(const Identifier id) const
return sampling [0,3] (only 0 for supercells)
virtual StatusCode initialize() override final
standard Athena-Algorithm method
const CaloCell_SuperCell_ID * getCaloCell_SuperCell_ID(void) const
int pos_neg(const Identifier id) const
return pos_neg -2 (C side) or 2 (A side)
const ILArAutoCorr * m_acorr
const CaloCell_ID * getCaloCell_ID() const
get calo cell ID helper
virtual OFCRef_t OFC_a(const HWIdentifier &id, int gain, int tbin=0) const =0
access to OFCs by online ID, gain, and tbin (!=0 for testbeam)
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
VectorContainer m_elecNoiseCELLContainer
std::vector< float > calculateElecNoiseForLAR(const IdentifierHash &idCaloHash)
std::vector< IdentifierHash > m_idSymmCaloHashContainer
static constexpr int m_nGains
bool isBadValue(float tested_value)
SG::WriteCondHandleKey< CaloNoise > m_outputPileupKey
IntegerProperty m_deltaBunch
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
const CaloCell_SuperCell_ID * m_calosupercell_id
virtual float pedestalRMS(const HWIdentifier &id, int gain) const =0
access to RMS of Pedestal index by Identifier, and gain setting
int region(const Identifier id) const
return region [0,1]
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Exception class for LAr Identifiers.
int m_itReason[10][m_nGains]
bool isOnlineConnected(const HWIdentifier &sid) const
Test whether a HWIdentifier is connected of not (inline)
const ILArfSampl * m_fsamplcond
const CaloCell_ID * m_calocell_id
CaloCell_ID::SUBCALO caloNum(const IdentifierHash idCaloHash)
virtual ShapeRef_t Shape(const HWIdentifier &id, int gain, int tbin=0, int mode=0) const =0
IdentifierHash m_CaloHashMax