|
ATLAS Offline Software
|
Go to the documentation of this file.
20 #include "Gaudi/Property.h"
28 #include "CLHEP/Matrix/Matrix.h"
37 , m_t0SamplePosition(0)
43 declareInterface<TileRawChannelBuilder>(
this);
44 declareInterface<TileRawChannelBuilderMF>(
this);
107 ATH_MSG_DEBUG(
"TileRawChannelBuilderMF::initialize() completed successfully");
109 return StatusCode::SUCCESS;
119 return StatusCode::SUCCESS;
147 double cof[7] = { 0., 0., 0., 0., 0., 0., 0. };
149 double chisq_ch = 0.;
151 double amp_norm = 0.;
158 float mindig, maxdig;
161 if (
are3FF(mindig, maxdig)) {
164 if (mindig > 2046.99)
212 CLHEP::HepMatrix
A(
n,
n, 0);
214 double signalModel[7]={};
219 float ofcPhase(-t_ch);
238 amp_norm +=
g[
k] *
g[
k];
242 if (
it == 0) amp_mf = amp_mf / amp_norm;
250 if (((
col +
t) > 6) || ((
col +
t) < 0)) {
265 CLHEP::HepMatrix
B(
n,
n, 0);
270 double xDecon[7] = { 0, 0, 0, 0, 0, 0, 0 };
271 for (j = 0; j <
n; ++j) {
272 for (
i = 0;
i <
n; ++
i) {
278 double thr[7] = { 0, 0, 0, 0, 0, 0, 0 };
279 for (j = 0; j <
n; ++j) {
280 for (
i = 0;
i <
n; ++
i) {
281 thr[j] += (rms_aux * rms_aux) * (
B[
i][j] *
B[
i][j]);
283 thr[j] = sqrt(thr[j]);
287 int pileupDet[7] = { 0, 0, 0, 1, 0, 0, 0 };
289 for (
i = 0;
i <
n; ++
i) {
290 if (
i == 3)
continue;
291 if ((
ros == 1) || (
ros == 2)) {
292 if (xDecon[
i] > 4 * thr[
i]) {
296 }
else if ((
ros == 3) || (
ros == 4)) {
297 if (xDecon[
i] > 3 * thr[
i]) {
314 CLHEP::HepMatrix
H(constraint,
n, 0);
320 if (pileupDet[
row] == 0)
continue;
322 if (((
col +
t) > 6) || ((
col +
t) < 0)) {
323 H[rowAux][
col] = 0.0;
341 CLHEP::HepMatrix tH(
n, constraint, 0);
342 CLHEP::HepMatrix resultH(constraint,
n, 0);
343 CLHEP::HepMatrix multH(constraint, constraint, 0);
349 for (j = 0; j <
n; j++) {
350 signalModel[j] = 0.0;
357 for (j = 0; j <
n; j++) {
358 signalModel[j] += cof[3] *
A[3][j];
361 for (
i = 0;
i <
n; ++
i) {
362 if (pileupDet[
i] == 0)
continue;
363 if (
i == 3) iBC3 =
r;
364 for (j = 0; j <
n; j++) {
365 cof[
i] += (
m_digits[j] - ped_ch) * resultH[
r][j];
367 for (j = 0; j <
n; j++) {
368 signalModel[j] += cof[
i] *
A[
i][j];
377 for (j = 0; j <
n; j++) {
379 t_aux += (
m_digits[j] - ped_ch) * (-resultH[rowAux][j]);
384 for (j = 0; j <
n; j++) {
391 goodEne = (fabs(cof[3]) > 1.0e-04);
397 for (
i = 0;
i <
n; ++
i) {
414 for (j = 0; j <
n; ++j) {
429 for (
i = 0;
i <
n; ++
i) {
436 double dqf = (signalModel[
k] - (
m_digits[
k] - ped_ch));
439 chisq_ch = sqrt(MFchi2);
441 if (fabs(chisq_ch) > 1.0
e-04 || goodEne) {
461 float times[7] = { (
float)t_ch, -75, -50, -25, 25, 50, 75};
465 &chisq_ch, &chisq_ch+1,
474 ATH_MSG_VERBOSE(
"Creating RawChannel" <<
" a=" << amp_ch <<
" t=" << t_ch <<
" q=" << chisq_ch);
495 bool allSaturated =
true;
498 unsigned int nSamp =
m_digits.size();
502 for (
unsigned int i = 1;
i < nSamp; ++
i) {
506 else if (dig < dmin) dmin = dig;
512 const float epsilon = 2.1;
513 const float delta = 99.9;
514 const float level0 = 39.9;
515 const float level1 = 99.9;
517 if (!allSaturated && (dmax - dmin) > delta) {
518 float abovemin = dmax;
519 float belowmax = dmin;
520 unsigned int nmin = 0;
521 unsigned int nmax = 0;
523 unsigned int pmax = nSamp;
524 for (
unsigned int i = 0;
i < nSamp; ++
i) {
526 if (smp - dmin < epsilon) {
530 if (dmax - smp < epsilon) {
534 if (smp < abovemin && smp > dmin) {
537 if (smp > belowmax && smp < dmax) {
544 }
else if (dmin < 0.01 && abovemin > level0 && nmin > 1) {
548 }
else if (
nmax + nmin == nSamp) {
549 if (
nmax > 1 && nmin > 1) {
551 }
else if (
nmax == 1) {
552 if (pmax > 0 && pmax < nSamp - 1) {
555 }
else if (nmin == 1) {
562 <<
" mindig= " << dmin
563 <<
" maxdig= " << dmax
564 <<
" allSat= " << allSaturated
565 <<
" jump= " << jump);
575 return (allSaturated || jump);
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
int NdigitSamples() const
Returns the number of sammples (digits) per event.
float m_ampMinThresh
correct amplitude if it's above amplitude threshold (in ADC counts)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const TileHWID * m_tileHWID
ToolHandle< ITileCondToolOfc > m_tileCondToolOfcOnFly
virtual StatusCode initialize()
Initializer.
bool msgLvl(const MSG::Level lvl) const
void setAmplitude(float a, int ind=0)
#define ATH_MSG_VERBOSE(x)
HWIdentifier adc_HWID(void) const
int m_nSamples
number of samples in the data
ToolHandle< TileCondToolTiming > m_tileToolTiming
float time(int ind=0) const
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
void assign(const HWIdentifier &id, float amplitude, float time, float quality, float ped=0.0)
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
TileFragHash::TYPE m_rChType
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
ToolHandle< TileCondToolNoiseSample > m_tileToolNoiseSample
int ItrigSample() const
The sample at which the pulse should ideally peak.
bool are3FF(float &dmin, float &dmax)
Checks that all the samples are 0x3FF (as sent by the DSP when no data arrives)
TileRawChannelBuilderMF(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
SG::WriteHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
::StatusCode StatusCode
StatusCode definition for legacy code.
double m_maxTime
max allowed time = 25*(m_nSamples-1)/2
virtual TileRawChannel * rawChannel(const TileDigits *digits, const EventContext &ctx) override
Builder virtual method to be implemented by subclasses.
float m_chPed[5][64][48][2]
const std::vector< float > & samples() const
virtual StatusCode finalize() override
Finalize.
const TileInfo * m_tileInfo
int m_chPedCounter[5][64][48][2]
Helpers for checking error return status codes and reporting errors.
void insertTime(float time)
ToolHandle< ITileCondToolOfc > m_tileCondToolOfc
float m_timeMaxThresh
correct amplitude is time is below time max threshold
virtual StatusCode initialize() override
Initialize.
double m_minTime
min allowed time = -25*(m_nSamples-1)/2
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
std::vector< float > m_digits
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
~TileRawChannelBuilderMF()
Destructor.
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
int m_t0SamplePosition
position of peak sample = (m_nSamples-1)/2
std::string to_string(const HWIdentifier &id, int level=0) const
extract all fields from HW identifier HWIdentifier get_all_fields ( const HWIdentifier & id,...
bool m_correctAmplitude
If true, resulting amplitude is corrected when using weights for tau=0 without iteration.
float m_timeMinThresh
correct amplitude is time is above time min threshold
int m_maxIterations
maximum number of iteration to perform