|
ATLAS Offline Software
|
Go to the documentation of this file.
16 ISvcLocator *pSvcLocator)
18 m_LArADC2MeVObjKey(
"LArADC2MeV"),
19 m_LArOnOffIdMappingObjKey(
"LArOnOffIdMap"),
20 m_LArShapeObjKey(
"LArShapeSym"),
21 m_LArAutoCorrObjKey(
"LArAutoCorrSym"),
22 m_LArNoiseObjKey(
"LArNoiseSym"),
23 m_LArPedestalObjKey(
"LArPedestal"),
24 m_LArfSamplObjKey(
"LArfSamplSym"),
25 m_LArMinBiasObjKey(
"LArMinBiasSym"),
26 m_LArAutoCorrTotalObjKey(
"LArAutoCorrTotal"),
27 m_NoPile(false), m_isMC(true),
28 m_isSuperCell(false), m_Nsamples(5),
29 m_firstSample(0), m_deltaBunch(1) {
31 "Key to read LArADC2MeV object");
33 "Key to read LArOnOffIdMapping object");
35 "Key to read LArShape object");
37 "Key to read LArAutoCorr object");
39 "Key to read LArNoise object");
41 "Key to read LArPedestal object");
43 "Key to read LArfSampl object");
45 "Key to read LArMinBias object");
47 "Key to write LArAutoCorrTotal object");
54 "First sample to use for in-time event on the full pulse shape");
56 "Delta between filled bunches in 25 ns units");
85 return StatusCode::SUCCESS;
96 << writeHandle.
fullKey() <<
" is already valid.");
97 return StatusCode::SUCCESS;
105 larOnlineID = scidhelper;
109 larOnlineID = idhelper;
116 larOnOffIdMapping = *larOnOffIdMappingHdl;
117 if (larOnOffIdMapping ==
nullptr) {
118 ATH_MSG_ERROR(
"Failed to retrieve LArOnOffIdMapping object");
135 larADC2MeV = *ADC2MeVHdl;
136 if (larADC2MeV ==
nullptr) {
152 larNoise = *NoiseHdl;
156 larPedestal = *PedestalHdl;
161 larfSampl = *fSamplHdl;
165 larMinBias = *MinBiasHdl;
169 ATH_MSG_INFO(
"IOV found from intersection for AutoCorrTotal object: "
175 std::unique_ptr<LArAutoCorrTotal> larAutoCorrTotal =
176 std::make_unique<LArAutoCorrTotal>(larOnlineID, larOnOffIdMapping,
m_nGains);
192 const int nsamples_shape =
static_cast<int>(Shape.size());
195 larAutoCorr->autoCorr(chid,
igain);
197 if (
AC.size() == 0) {
203 int nsamples_AC_OFC =
AC.size() + 1;
210 unsigned int ihecshift = 0;
211 if (larOnlineID->
isHECchannel(chid) && nsamples_AC_OFC == 4 &&
231 SigmaNoise = RMSpedestal;
235 float fSampl = larfSampl->
FSAMPL(chid);
236 float MinBiasRMS = larMinBias->
minBiasRMS(chid);
238 MinBiasRMS /= fSampl;
239 const auto polynom_adc2mev =
242 if (polynom_adc2mev.size() > 0) {
243 Adc2MeV = (polynom_adc2mev)[1];
245 if (SigmaNoise != 0 && Adc2MeV != 0)
246 fSigma2 =
pow(MinBiasRMS / (SigmaNoise * Adc2MeV), 2);
248 if (fSampl == 0 || SigmaNoise == 0 || Adc2MeV == 0) {
252 <<
"fSampl (" << fSampl <<
"), SigmaNoise ("
253 << SigmaNoise <<
") or Adc2MeV (" << Adc2MeV
255 <<
"=> AutoCorrTotal = only AutoCorr elect. part ");
260 <<
") fSampl (" << fSampl <<
") "
261 <<
") SigmaNoise (" << SigmaNoise <<
") "
262 <<
") Adc2MeV (" << Adc2MeV <<
") "
274 int nsize_tot = (nsamples_AC_OFC - 1) * (nsamples_AC_OFC) / 2;
277 <<
") fSigma2 (" << fSigma2 <<
") "
278 <<
") nsamples_AC_OFC ( " << nsamples_AC_OFC);
279 std::vector<float> vTerms;
281 vTerms.resize(2 * nsize_tot + nsamples_AC_OFC, 0.);
284 for (
int j1 = 0;
j1 < nsamples_AC_OFC - 1;
j1++) {
285 for (
int j2 =
j1 + 1;
j2 < nsamples_AC_OFC;
j2++) {
286 int l = abs(
j2 -
j1) - 1;
288 j1 * nsamples_AC_OFC -
j1 * (
j1 + 1) / 2 +
j2 - (
j1 + 1);
294 <<
") vTerms[1] (" << vTerms[1] <<
") ");
296 for (
int j1 = 0;
j1 < nsamples_AC_OFC - 1; ++
j1) {
297 for (
int j2 =
j1 + 1;
j2 < nsamples_AC_OFC;
j2++) {
299 j1 * nsamples_AC_OFC -
j1 * (
j1 + 1) / 2 +
j2 - (
j1 + 1);
301 for (
int k = 0;
k < nsamples_shape; ++
k) {
302 if ((
j2 -
j1 +
k) >= 0 && (
j2 -
j1 +
k) < nsamples_shape) {
306 Rij += Shape[
k] * Shape[
j2 -
j1 +
k] * ibunch;
309 vTerms[nsize_tot +
index] = fSigma2 * Rij;
313 <<
") vTerms[mid] (" << vTerms[vTerms.size()/2] <<
") ");
316 for (
int j1 = 0;
j1 < nsamples_AC_OFC;
j1++) {
318 for (
int k = 0;
k < nsamples_shape; ++
k) {
322 Rms2i +=
pow(Shape[
k], 2) * ibunch;
324 vTerms[2 * nsize_tot +
j1] = fSigma2 * Rms2i;
327 <<
") vTerms[last] (" << vTerms[vTerms.size()-1] <<
") ");
331 larAutoCorrTotal->
set(hid,
igain, vTerms);
338 std::vector<float>
empty(nsize_tot, 0.);
344 ATH_MSG_INFO(
"LArAutoCorrTotal Ncell * Ngain " << count3);
352 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
const LArVectorProxy ADC2MEV(const HWIdentifier &id, int gain) const
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
SG::ReadCondHandleKey< LArADC2MeV > m_LArADC2MeVObjKey
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
bool set(const IdentifierHash &hid, const int gain, std::vector< float > &autocorrtotal)
const EventIDRange & getRange() const
virtual ~LArAutoCorrTotalCondAlg() override
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
This class defines the interface for accessing AutoCorrelation parameters for each channel @stereotyp...
unsigned int m_firstSample
virtual StatusCode execute() override
const DataObjID & fullKey() const
id_range channel_range() const
LArAutoCorrTotalCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual bool isHECchannel(const HWIdentifier id) const =0
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual const float & FSAMPL(const HWIdentifier &id) const =0
virtual const float & noise(const HWIdentifier &id, int gain) const =0
virtual StatusCode initialize() override
SG::WriteCondHandleKey< LArAutoCorrTotal > m_LArAutoCorrTotalObjKey
Helper for the Liquid Argon Calorimeter cell identifiers.
SG::ReadCondHandleKey< ILArPedestal > m_LArPedestalObjKey
StatusCode initialize(bool used=true)
SG::ReadCondHandleKey< ILArMinBias > m_LArMinBiasObjKey
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
SG::ReadCondHandleKey< LArOnOffIdMapping > m_LArOnOffIdMappingObjKey
Identifier cnvToIdentifier(const HWIdentifier &sid) const
create an Identifier from a HWIdentifier (inline)
virtual const float & minBiasRMS(const HWIdentifier &id) const =0
access to RMS of E in minimum bias events index by Identifier
SG::ReadCondHandleKey< ILArfSampl > m_LArfSamplObjKey
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
SG::ReadCondHandleKey< ILArNoise > m_LArNoiseObjKey
std::string channel_name(const HWIdentifier id) const
Return a string corresponding to a feedthrough name given an identifier.
SG::ReadCondHandleKey< ILArAutoCorr > m_LArAutoCorrObjKey
virtual float pedestalRMS(const HWIdentifier &id, int gain) const =0
access to RMS of Pedestal index by Identifier, and gain setting
bool isOnlineConnected(const HWIdentifier &sid) const
Test whether a HWIdentifier is connected of not (inline)
Proxy for accessing a range of float values like a vector.
SG::ReadCondHandleKey< ILArShape > m_LArShapeObjKey
void addDependency(const EventIDRange &range)