ATLAS Offline Software
Loading...
Searching...
No Matches
TileRawChannelBuilderFitFilterCool Class Reference

#include <TileRawChannelBuilderFitFilterCool.h>

Inheritance diagram for TileRawChannelBuilderFitFilterCool:
Collaboration diagram for TileRawChannelBuilderFitFilterCool:

Public Member Functions

 TileRawChannelBuilderFitFilterCool (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor.
 ~TileRawChannelBuilderFitFilterCool ()
 Destructor.
virtual StatusCode initialize () override
 Initializer.
virtual StatusCode finalize () override
virtual TileRawChannel * rawChannel (const TileDigits *digits, const EventContext &ctx) override
 Builder virtual method to be implemented by subclasses.
virtual void handle (const Incident &) override
virtual StatusCode createContainer (const EventContext &ctx)
 Create container in SG with name given by parameter (m_rawChannelContainerKey).
virtual StatusCode commitContainer (const EventContext &ctx)
 Commit RawChannelContiner in SG and make const.
void initLog (const EventContext &ctx)
void endLog ()
StatusCode build (const TileDigitsCollection *collection, const EventContext &ctx)
void resetDrawer ()
void resetOverflows (void)
Overflows_t & getOverflowedChannels (void)
std::string getTileRawChannelContainerID (void)
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()
 AlgTool InterfaceID.
static double correctAmp (double phase, bool of2=true)
 Amplitude correction factor according to the time when using weights for tau=0 without iterations.
static double correctTime (double phase, bool of2=true)
 Time correction factor.
static int CorruptedData (int ros, int drawer, int channel, int gain, const std::vector< float > &digits, float &dmin, float &dmax, float ADCmaxMinusEps, float ADCmaskValueMinusEps)
static const char * BadPatternName (float ped)

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

SG::ReadHandleKey< TileDQstatus > m_DQstatusKey
SG::ReadHandleKey< TileRawChannelContainer > m_DSPContainerKey {this, "DSPContainer", "", "DSP Container key"}
SG::WriteHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
std::unique_ptr< TileMutableRawChannelContainer > m_rawChannelCnt
TileFragHash::TYPE m_rChType {TileFragHash::Default}
TileRawChannelUnit::UNIT m_rChUnit {TileRawChannelUnit::ADCcounts}
unsigned int m_bsflags {0}
Gaudi::Property< int > m_firstSample {this, "FirstSample", 0, "First sample to start with the analysis"}
Gaudi::Property< bool > m_calibrateEnergy {this, "calibrateEnergy", false, "Calibrate energy"}
Gaudi::Property< bool > m_correctTime {this, "correctTime", false, "Correct time"}
Gaudi::Property< bool > m_useDSP {this, "UseDSPCorrection", true, "Use DSP noise correction for incomplete containers"}
Gaudi::Property< float > m_ampMinThresh
Gaudi::Property< float > m_timeMinThresh
Gaudi::Property< float > m_timeMaxThresh
Gaudi::Property< int > m_runType {this, "RunType", 0, "Run type used to override value of trigType in event"}
const TileID * m_tileID {nullptr}
const TileHWID * m_tileHWID {nullptr}
ToolHandleArray< ITileRawChannelTool > m_noiseFilterTools
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
ToolHandle< TileCondToolTiming > m_tileToolTiming
ToolHandle< TileCondIdTransforms > m_tileIdTransforms
ServiceHandle< TileCablingSvc > m_cablingSvc
 Name of Tile cabling service.
const TileCablingService * m_cabling {nullptr}
 TileCabling instance.
Gaudi::Property< std::vector< int > > m_demoFragIDs
int m_trigType {0}
bool m_idophys {false}
bool m_idolas {false}
bool m_idoped {false}
bool m_idocis {false}
int m_cischan {-1}
double m_capdaq {100.}
unsigned int m_evtCounter {0}
unsigned int m_chCounter {0}
int m_nChL {0}
int m_nChH {0}
double m_RChSumL {0.}
double m_RChSumH {0.}
Overflows_t m_overflows
Gaudi::Property< int > m_dataPoollSize {this, "DataPoolSize", -1, "Data pool size"}
int m_error [MAX_CHANNELS]
int m_lastDrawer {-1}
bool m_badDrawer {false}
bool m_notUpgradeCabling {true}
Gaudi::Property< std::string > m_infoName {this, "TileInfoName", "TileInfo", "Name of TileInfo object"}
const TileInfo * m_tileInfo {nullptr}
int m_i_ADCmax {0}
float m_f_ADCmax {0.f}
int m_i_ADCmaxPlus1 {0}
float m_f_ADCmaxPlus1 {0.f}
float m_ADCmaxMinusEps {0.f}
float m_ADCmaskValueMinusEps {0.f}
 indicates channels which were masked in background dataset

Static Protected Attributes

static const int MAX_CHANNELS = 48
static const int MAX_DMUS = 16

Private Types

typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

void pulseFit (const TileDigits *digit, double &amplitude, double &time, double &pedestal, double &chi2, const EventContext &ctx)
 Calculate energy, time and chi2 for one channel using fitted pulse shape.
double pulse (double x, const std::vector< double > *xvec, const std::vector< double > *yvec, bool zeroOutside=false) const
 pulse interpolation
double scaledPulse (double x, const std::vector< double > *xvec, const std::vector< double > *yvec) const
double derivative (double x, const std::vector< double > *xvec, const std::vector< double > *yvec) const
void fill_drawer_errors (const EventContext &ctx, const TileDigitsCollection *collection)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::vector< double > m_dummy
double m_t0Fit
double m_fnParameters [3] {}
int m_iPeak0
double m_minTime
double m_maxTime
double m_minTau
double m_maxTau
std::vector< double > m_gPhysLo
std::vector< double > m_dgPhysLo
std::vector< double > m_gPhysHi
std::vector< double > m_dgPhysHi
Gaudi::Property< int > m_frameLength {this, "FrameLength", 9, "Frame length (number of samples)"}
Gaudi::Property< int > m_channelNoiseRMS {this, "RMSChannelNoise", 3, "Which channel noise RMS to use"}
Gaudi::Property< int > m_maxIterate {this, "MaxIterate", 9, "Maximum number of fit iterations"}
Gaudi::Property< int > m_extraSamplesLeft {this, "ExtraSamplesLeft", 0, "Increase window on left side"}
Gaudi::Property< int > m_extraSamplesRight {this, "ExtraSamplesRight", 0, "Increase window on right side"}
Gaudi::Property< double > m_saturatedSampleError
Gaudi::Property< double > m_zeroSampleError
Gaudi::Property< double > m_noiseThresholdRMS
Gaudi::Property< double > m_maxTimeFromPeak
Gaudi::Property< double > m_noiseLow {this, "NoiseLowGain", 0.6, "Default low gain noise"}
Gaudi::Property< double > m_noiseHigh {this, "NoiseHighGain", 1.5, "Default high gain noise"}
const TilePulseShapesStruct * m_pulseShapes
ToolHandle< TileCondToolPulseShape > m_tileToolPulseShape
ToolHandle< TileCondToolPulseShape > m_tileToolLeak100Shape
ToolHandle< TileCondToolPulseShape > m_tileToolLeak5p2Shape
ToolHandle< TileCondToolPulseShape > m_tileToolPulse5p2Shape
ToolHandle< TileCondToolNoiseSample > m_tileToolNoiseSample
TilePulseShapesStruct * m_shapes
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 52 of file TileRawChannelBuilderFitFilterCool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 376 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TileRawChannelBuilderFitFilterCool()

TileRawChannelBuilderFitFilterCool::TileRawChannelBuilderFitFilterCool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Constructor.

Definition at line 42 of file TileRawChannelBuilderFitFilterCool.cxx.

44 : TileRawChannelBuilder(type, name, parent)
45 , m_t0Fit(0.0)
46 , m_iPeak0(0)
47 , m_minTime(0.0)
48 , m_maxTime(0.0)
49 , m_minTau(0)
50 , m_maxTau(0.0)
51 , m_pulseShapes(0)
52 , m_shapes(nullptr)
53{
54 //declare interfaces
55 declareInterface< TileRawChannelBuilder >( this );
56 declareInterface< TileRawChannelBuilderFitFilterCool >(this);
57
58 m_rawChannelContainerKey = "TileRawChannelFitCool";
59}
SG::WriteHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
TileRawChannelBuilder(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.

◆ ~TileRawChannelBuilderFitFilterCool()

TileRawChannelBuilderFitFilterCool::~TileRawChannelBuilderFitFilterCool ( )

Destructor.

Definition at line 64 of file TileRawChannelBuilderFitFilterCool.cxx.

64 {
65 if (m_shapes) delete m_shapes;
66}

Member Function Documentation

◆ BadPatternName()

const char * TileRawChannelBuilder::BadPatternName ( float ped)
staticinherited

Definition at line 424 of file TileRawChannelBuilder.cxx.

424 {
425 static const char * const errname[26] = {
426 "-10 - good signal",
427 "-9 - underflow",
428 "-8 - overflow",
429 "-7 - underflow and overflow",
430 "-6 - constant signal",
431 "-5 - disconnected channel",
432 "-4 - half a drawer masked",
433 "-3 - bad DQ status",
434 "-2 - underflow in all samples",
435 "-1 - overflow in all samples",
436 "0 - unknown error",
437 "1 - jump from zero to saturation",
438 "2 - samples with zeros",
439 "3 - at least two saturated. others - close to pedestal",
440 "4 - two distinct levels with at least 2 samples each",
441 "5 - pedestal with jump up in one sample",
442 "6 - pedestal with jump down in one sample",
443 "7 - signal with jump up in one sample",
444 "8 - signal with jump down in one sample",
445 "9 - base line above threshold in low gain",
446 "10 - jump down in first sample in low gain",
447 "11 - jump down in last sample in low gain",
448 "12 - jump up in one sample above const",
449 "13 - jump down in one sample below const",
450 "14 - unrecoverable timing jump",
451 "15 - unknown error"
452 };
453
454 return errname[std::min(25, std::max(0, int((ped + 500) * 1e-4)))];
455}

◆ build()

StatusCode TileRawChannelBuilder::build ( const TileDigitsCollection * collection,
const EventContext & ctx )
inherited

Definition at line 458 of file TileRawChannelBuilder.cxx.

459{
460
461 int frag = coll->identify();
462
463 // make sure that error array is up-to-date
464 if (frag != m_lastDrawer && m_notUpgradeCabling) {
465 fill_drawer_errors(ctx, coll);
466 }
467
468 // Iterate over all digits in this collection
469 TileDigitsCollection::const_iterator digitItr = coll->begin();
470 TileDigitsCollection::const_iterator lastDigit = coll->end();
471
472 for (; digitItr != lastDigit; ++digitItr) {
473
474 TileRawChannel* rch = rawChannel((*digitItr), ctx);
475
477
478 int err = m_error[m_tileHWID->channel(rch->adc_HWID())];
479
480 if (err) {
481 if (err == -8 || err == -7) m_overflows.push_back(std::make_pair(rch, (*digitItr)));
482 float ped = rch->pedestal() + 100000 + 10000 * err;
483 rch->setPedestal(ped);
484 if (msgLvl(MSG::VERBOSE) && !m_badDrawer) {
485 if (err < -5) {
486 msg(MSG::VERBOSE) << "BadCh " << m_tileHWID->to_string(rch->adc_HWID())
487 << " warning = " << BadPatternName(ped) << endmsg;
488 } else {
489 msg(MSG::VERBOSE) << "BadCh " << m_tileHWID->to_string(rch->adc_HWID())
490 << " error = " << BadPatternName(ped) << endmsg;
491 }
492 }
493 }
494
495 }
496
497 ATH_CHECK( m_rawChannelCnt->push_back (rch) );
498 }
499
500 IdentifierHash hash = m_rawChannelCnt->hashFunc().hash(coll->identify());
501 TileRawChannelCollection* rawChannelCollection = m_rawChannelCnt->indexFindPtr(hash);
502 rawChannelCollection->setLvl1Id(coll->getLvl1Id());
503 rawChannelCollection->setLvl1Type(coll->getLvl1Type());
504 rawChannelCollection->setDetEvType(coll->getDetEvType());
505 rawChannelCollection->setRODBCID(coll->getRODBCID());
506
507 return StatusCode::SUCCESS;
508}
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
bool msgLvl(const MSG::Level lvl) const
MsgStream & msg() const
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
Definition DataVector.h:861
static const char * BadPatternName(float ped)
std::unique_ptr< TileMutableRawChannelContainer > m_rawChannelCnt
void fill_drawer_errors(const EventContext &ctx, const TileDigitsCollection *collection)
virtual TileRawChannel * rawChannel(const TileDigits *digits, const EventContext &ctx)
Builder virtual method to be implemented by subclasses.
float pedestal(void) const
void setPedestal(float ped)
void setLvl1Type(uint32_t lvl1Type)
Setter for level1 type from ROD header.
void setLvl1Id(uint32_t lvl1Id)
Setter for level1 id from ROD header.
void setRODBCID(uint32_t rodBCID)
Setter for BCID from ROD header.
void setDetEvType(uint32_t detEvType)
Setter for detector event type from ROD header.
HWIdentifier adc_HWID(void) const
Definition TileRawData.h:53

◆ commitContainer()

StatusCode TileRawChannelBuilder::commitContainer ( const EventContext & ctx)
virtualinherited

Commit RawChannelContiner in SG and make const.

Definition at line 510 of file TileRawChannelBuilder.cxx.

511{
512
513 const TileDQstatus* DQstatus = SG::makeHandle (m_DQstatusKey, ctx).get();
514
515 ToolHandleArray<ITileRawChannelTool>::iterator itrTool = m_noiseFilterTools.begin();
516 ToolHandleArray<ITileRawChannelTool>::iterator endTool = m_noiseFilterTools.end();
517
518 if ( m_useDSP && !m_DSPContainerKey.key().empty() &&
519 (DQstatus->incompleteDigits() || m_chCounter<12288) && itrTool!=endTool )
520 {
521 const TileRawChannelContainer * dspCnt = SG::makeHandle (m_DSPContainerKey, ctx).get();
522 ATH_MSG_DEBUG( "Incomplete container - use noise filter corrections from DSP container" );
523
524 uint32_t bsFlags = dspCnt->get_bsflags();
525 std::vector<IdentifierHash> hashes = m_rawChannelCnt->GetAllCurrentHashes();
526 std::vector<IdentifierHash> dspHashes = dspCnt->GetAllCurrentHashes();
527 if (bsFlags == 0) {
528 ATH_MSG_WARNING("Problem in applying noise corrections: DSP container ("
529 << m_DSPContainerKey.key() << ") seems to be emtpy!");
530 } else if (hashes != dspHashes) {
531 ATH_MSG_ERROR( " Error in applying noise corrections; "
532 "hash vectors do not match.");
533 } else {
534 // Go through all TileRawChannelCollections
535 for (IdentifierHash hash : hashes) {
536 TileRawChannelCollection* coll = m_rawChannelCnt->indexFindPtr (hash);
537 const TileRawChannelCollection* dcoll = dspCnt->indexFindPtr (hash);
538
539 if (coll->identify() != dcoll->identify()) {
540
541 ATH_MSG_ERROR( " Error in applying noise corrections " << MSG::hex
542 << " collection IDs 0x" << coll->identify() << " and 0x" << dcoll->identify()
543 << " do not match " << MSG::dec );
544 break;
545 }
546
547 // iterate over all channels in a collection
550
551 for (TileRawChannel* rch : *coll) {
552 HWIdentifier adc_id = rch->adc_HWID();
553 while (dspItr != dspLast && adc_id != (*dspItr)->adc_HWID()) {
554 ++dspItr;
555 }
556 if (dspItr != dspLast) {
557 float corr = (*dspItr)->pedestal();
558 ATH_MSG_VERBOSE( "Ch "<<m_tileHWID->to_string(adc_id)
559 <<" amp " << rch->amplitude() << " ped " << rch->pedestal()
560 << " corr " << corr );
561 if (corr<10000.) {
562 rch->setAmplitude (rch->amplitude() - corr); // just baseline shift
563 rch->setPedestal (rch->pedestal() + corr); // just baseline shift
564 } else {
565 float ped = rch->pedestal();
566 if (corr > ped) {
567 rch->setPedestal (fmod(ped,10000.) + int(corr)/10000 * 10000); // changing error status
568 ATH_MSG_VERBOSE( "New error status in ped "<<rch->pedestal());
569 }
570 }
571 } else {
572 ATH_MSG_WARNING(" Problem in applying noise corrections "
573 << " can not find channel in DSP container with HWID "
574 << m_tileHWID->to_string(adc_id) );
575 dspItr = dcoll->begin();
576 }
577 }
578 }
579 }
580
581 } else {
582
583 for (ToolHandle<ITileRawChannelTool>& noiseFilterTool : m_noiseFilterTools) {
584 if (noiseFilterTool->process(*m_rawChannelCnt.get(), ctx).isFailure()) {
585 ATH_MSG_ERROR( " Error status returned from noise filter " );
586 } else {
587 ATH_MSG_DEBUG( "Noise filter applied to the container" );
588 }
589 }
590
591 }
592
593 ATH_MSG_DEBUG( " nCh=" << m_chCounter
594 << " nChH/L=" << m_nChH << "/" << m_nChL
595 << " RChSumH/L=" << m_RChSumH << "/" << m_RChSumL );
596
597 SG::WriteHandle<TileRawChannelContainer> rawChannelsContainer(m_rawChannelContainerKey, ctx);
598 ATH_CHECK( rawChannelsContainer.record(std::move(m_rawChannelCnt)) );
599
600 endLog();
601
602 return StatusCode::SUCCESS;
603}
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_VERBOSE(x,...)
Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Current TileRawChannelContainer
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
virtual std::vector< IdentifierHash > GetAllCurrentHashes() const override final
Returns a collection of all hashes availiable in this IDC.
virtual const T * indexFindPtr(IdentifierHash hashId) const override final
return pointer on the found entry or null if out of range using hashed index - fast version,...
bool incompleteDigits() const
A few extra items (from TileBeamInfoProvider).
Gaudi::Property< bool > m_useDSP
SG::ReadHandleKey< TileDQstatus > m_DQstatusKey
SG::ReadHandleKey< TileRawChannelContainer > m_DSPContainerKey
ToolHandleArray< ITileRawChannelTool > m_noiseFilterTools
uint32_t get_bsflags() const
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
setEventNumber uint32_t

◆ correctAmp()

double TileRawChannelBuilder::correctAmp ( double phase,
bool of2 = true )
staticinherited

Amplitude correction factor according to the time when using weights for tau=0 without iterations.

Definition at line 612 of file TileRawChannelBuilder.cxx.

612 {
613
614 double corr = 1.0;
615 if (of2) {
616 // estimation from Belen for rel 14.0.0
617 /*double a,b,c;
618 if(fabs(phase)<5.){
619 a=0.137; b=0.0877; c=0.0865;
620 }else{
621 a=0.565; b=0.116; c=0.0751;
622 }
623 corr=(1+(a+b*phase+c*phase*phase)/100.);
624 */
625
626 // estimation from Vakhtang for rel 14.4.0
627 /*double k = (phase < 0.0 ? 0.0009400 : 0.0010160);
628 corr = (1.0 + k * phase * phase);
629 */
630
631 // Parabolic correction from Tigran
632 double a1,a2,b,c;
633 a1 = phase < 0.0 ? 0.000940774 : 0.00102111;
634 a2 = phase < 0.0 ? 0.000759051 : 0.000689625;
635 b = phase < 0.0 ? -2.0 * 7.0 * (a1 - a2) : 2.0 * 12.5 * (a1 - a2);
636 c = phase < 0.0 ? 1.0 - 7.0 * 7.0 * (a1-a2) : 1.0 - 12.5 * 12.5 * (a1-a2);
637 if (phase < 12.5 && phase > -7.0) corr = a1 * phase * phase + 1.0;
638 else corr = phase * ( a2 * phase + b) + c;
639
640
641 } else {
642 /*double a,b,c;
643 if(phase<0){
644 a=1.0002942; b=0.0003528; c=0.0005241;
645 }else{
646 a=1.0001841; b=-0.0004182; c=0.0006167;
647 }
648 corr = a + phase * ( b + c * phase);
649 */
650
651 /*double k = (phase < 0.0 ? 0.0005241 : 0.0006167);
652 corr = (1.0 + k * phase * phase);
653 */
654
655 // 4th degree polynomial correction from Tigran
656 double k1 = (phase < 0.0 ? -0.0000326707:0.000380336);
657 double k2 = (phase < 0.0 ? -0.000560962:-0.000670487);
658 double k3 = (phase < 0.0 ? -0.00000807869:0.00000501773);
659 double k4 = (phase < 0.0 ? -0.000000145008:0.0000000584647);
660
661 corr = 1.0 / (1.0 + (k1 + (k2 + (k3 + k4 *phase)*phase)*phase)*phase);
662
663
664 }
665
666 return corr;
667}

◆ correctTime()

double TileRawChannelBuilder::correctTime ( double phase,
bool of2 = true )
staticinherited

Time correction factor.

Definition at line 671 of file TileRawChannelBuilder.cxx.

671 {
672
673 double correction = 0.0;
674
675 if (of2) {
676 if(phase < 0) {
677 correction = (-0.00695743 + (0.0020673 - (0.0002976 + 0.00000361305 * phase) * phase) * phase) * phase;
678 } else {
679 correction = (0.0130013 + (0.00128769 + (-0.000550218 + 0.00000755344 * phase) * phase) * phase) * phase;
680 }
681 }
682 // OF1 does not need correction
683
684 return correction;
685}
correction(mu, runmode, campaign, run=None)
Definition zlumi_mc_cf.py:4

◆ CorruptedData()

int TileRawChannelBuilder::CorruptedData ( int ros,
int drawer,
int channel,
int gain,
const std::vector< float > & digits,
float & dmin,
float & dmax,
float ADCmaxMinusEps,
float ADCmaskValueMinusEps )
staticinherited

Definition at line 689 of file TileRawChannelBuilder.cxx.

690 {
691 bool eb = (ros > 2);
692 bool ebsp = ((ros == 3 && drawer == 14) || (ros == 4 && drawer == 17));
693 bool empty = ((eb && ((channel > 23 && channel < 30) || channel > 41)) || (ebsp && channel < 3));
694 bool not_gap = !(empty || (eb && (channel == 0 || channel == 1 || channel == 12 || channel == 13))
695 || (ebsp && (channel == 18 || channel == 19)));
696
697 const float epsilon = 4.1; // allow +/- 2 counts fluctuations around const value
698 const float delta[4] = { 29.9, 29.9, 49.9, 99.9 }; // jump levels between constLG, constHG, non-constLG, non-constHG
699 const float level1 = 99.9; // jump from this level to m_i_ADCmax is bad
700 const float level2 = 149.9; // base line at this level in low gain is bad
701 const float narrowLevel[2] = { 29.9, 49.9 }; // minimal amplitude for narrow pulses
702 const float delt = std::min(std::min(std::min(delta[0], delta[1]), std::min(delta[2], delta[3])),
703 std::min(narrowLevel[0], narrowLevel[1]));
704 const float secondMaxLevel = 0.3;
705
706 int error = 0;
707
708 unsigned int nSamp = digits.size();
709 if (nSamp) {
710 dmin = dmax = digits[0];
711 unsigned int pmin = 0;
712 unsigned int pmax = 0;
713 unsigned int nzero = (dmin < 0.01) ? 1 : 0;
714 unsigned int nover = (dmax > ADCmaxMinusEps) ? 1 : 0;
715
716 for (unsigned int i = 1; i < nSamp; ++i) {
717 float dig = digits[i];
718 if (dig > dmax) {
719 dmax = dig;
720 pmax = i;
721 } else if (dig < dmin) {
722 dmin = dig;
723 pmin = i;
724 }
725 if (dig < 0.01) ++nzero;
726 else if (dig > ADCmaxMinusEps) ++nover;
727 }
728
729 float dmaxmin = dmax - dmin;
730 //std::cout << " ros " << ros << " drawer " << drawer << " channel " << channel << " not_gap " << not_gap << " nzero " << nzero << " nover " << nover << std::endl;
731
732 if (dmin > ADCmaxMinusEps) { // overflow in all samples
733 error = (dmin > ADCmaskValueMinusEps) ? -3 : -1; // dmin=m_tileInfo->ADCmaskValue() - masking in overlay job (set in TileDigitsMaker)
734
735 } else if (dmax < 0.01) { // underflow in all samples
736 error = (empty) ? -5 : -2; // set different type of errors for exsiting and non-existing channels
737
738 } else if (dmaxmin < 0.01) { // constant value in all samples
739 error = -6;
740
741 } else if (nzero && nover) { // jump from zero to saturation
742 error = 1;
743
744 } else if ((nzero && (not_gap || empty)) || nzero > 1) { // one sample at zero in normal channel
745 error = 2; // or 2 samples at zero in gap/crack/MBTS
746
747 } else if (gain == 0 && dmin > level2) { // baseline above threshold in low gain is bad
748 error = 9;
749
750 } else if (dmaxmin > delt) { // check that max-min is above minimal allowed jump
751
752 float abovemin = dmax;
753 float belowmax = dmin;
754 unsigned int nmin = 0;
755 unsigned int nmax = 0;
756 for (unsigned int i = 0; i < nSamp; ++i) {
757 float smp = digits[i];
758 if (smp - dmin < epsilon) {
759 ++nmin;
760 }
761 if (dmax - smp < epsilon) {
762 ++nmax;
763 }
764 if (smp < abovemin && smp > dmin) {
765 abovemin = smp;
766 }
767 if (smp > belowmax && smp < dmax) {
768 belowmax = smp;
769 }
770 }
771 // more than two different values - shift index by 2, i.e. use thresholds for non-const levels
772 int gainInd = (abovemin != dmax || belowmax != dmin) ? gain + 2 : gain;
773 bool big_jump = (dmaxmin > delta[gainInd]);
774 bool max_in_middle = (pmax > 0 && pmax < nSamp - 1);
775 bool min_in_middle = (pmin > 0 && pmin < nSamp - 1);
776
777 if (nover > 1 && belowmax < level1) { // at least two saturated. others - close to pedestal
778 error = 3;
779 } else if (nmax + nmin == nSamp && big_jump) {
780 if (nmax > 1 && nmin > 1) { // at least 2 samples at two distinct levels
781 error = 4;
782 } else if (nmax == 1) {
783 if (max_in_middle) { // jump up in one sample, but not at the edge
784 error = 5;
785 }
786 } else if (nmin == 1) { // jump down in one sample
787 error = 6;
788 }
789 }
790 if (error == 0 && dmaxmin > narrowLevel[gain]) {
791 float secondMax = dmaxmin * secondMaxLevel;
792 float dminPlus = dmin + secondMax;
793 float dmaxMinus = dmax - secondMax;
794 if (not_gap) { // jumps above two (or one) neighbour samples
795 if (max_in_middle && std::max(digits[pmax - 1], digits[pmax + 1]) < dminPlus) {
796 error = 7; // jump up in one sample in the middle, which is much higher than two neighbours
797 } else if (min_in_middle && std::min(digits[pmin - 1], digits[pmin + 1]) > dmaxMinus) {
798 error = 8; // jump down in one sample, which is much lower than two neighbours
799 } else if (big_jump && gain == 0) { // check first and last sample only in low gain
800 if (pmin == 0 && digits[1] > dmax - secondMax) {
801 error = 10; // jump down in first sample. which is much lower than next one
802 } else if (pmin == nSamp - 1 && digits[pmin - 1] > dmax - secondMax) {
803 error = 11; // jump down in last sample. which is much lower than previous one
804 }
805 }
806 }
807 if (!error && big_jump) { // jumps above all samples
808 if ((max_in_middle || gain == 0) && nmax == 1 && belowmax < dminPlus) {
809 error = 12; // jump up in one sample in the middle, which is much higher than all others
810 } else if ((min_in_middle || gain == 0) && nmin == 1 && abovemin > dmaxMinus) {
811 error = 13; // jump down in one sample, which is much lower than all others (
812 }
813 }
814 }
815 }
816
817 } else {
818 dmin = dmax = 0.0;
819 }
820
821 return error;
822}
const int nmax(200)
static const Attributes_t empty

◆ createContainer()

StatusCode TileRawChannelBuilder::createContainer ( const EventContext & ctx)
virtualinherited

Create container in SG with name given by parameter (m_rawChannelContainerKey).

Definition at line 199 of file TileRawChannelBuilder.cxx.

199 {
200 initLog(ctx);
201
202 // create TRC container
203 m_rawChannelCnt = std::make_unique<TileMutableRawChannelContainer>(true, m_rChType, m_rChUnit, SG::VIEW_ELEMENTS);
204 ATH_CHECK( m_rawChannelCnt->status() );
205 m_rawChannelCnt->set_bsflags(m_bsflags);
206
207 ATH_MSG_DEBUG( "Created TileRawChannelContainer '" << m_rawChannelContainerKey.key() << "'" );
208
209 return StatusCode::SUCCESS;
210}
TileRawChannelUnit::UNIT m_rChUnit
void initLog(const EventContext &ctx)
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ derivative()

double TileRawChannelBuilderFitFilterCool::derivative ( double x,
const std::vector< double > * xvec,
const std::vector< double > * yvec ) const
inlineprivate

Definition at line 87 of file TileRawChannelBuilderFitFilterCool.h.

87 {
88 return pulse(x, xvec, yvec, true);
89 }
#define x
double pulse(double x, const std::vector< double > *xvec, const std::vector< double > *yvec, bool zeroOutside=false) const
pulse interpolation

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ endLog()

void TileRawChannelBuilder::endLog ( )
inherited

Definition at line 605 of file TileRawChannelBuilder.cxx.

605 {
606 m_chCounter = 0;
607 m_nChL = m_nChH = 0;
608 m_RChSumL = m_RChSumH = 0.0;
609
610}

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ fill_drawer_errors()

void TileRawChannelBuilder::fill_drawer_errors ( const EventContext & ctx,
const TileDigitsCollection * collection )
privateinherited

Definition at line 266 of file TileRawChannelBuilder.cxx.

268{
269 const TileDQstatus* DQstatus = SG::makeHandle (m_DQstatusKey, ctx).get();
270
271 int frag = coll->identify();
272 int ros = (frag >> 8);
273 int drawer = (frag & 0xff);
274
275 m_lastDrawer = frag;
276
277 memset(m_error, 0, sizeof(m_error));
278 int dmuerr[MAX_DMUS] = {0};
279 int nch = 0;
280 bool bigain = DQstatus->isBiGain();
281 if (!bigain) { // in bigain runs we don't have DQ status fragment
282 for (int ch = 0; ch < MAX_CHANNELS; ch += 3) {
283 if (!DQstatus->isAdcDQgood(ros, drawer, ch, 0)) {
284 m_error[ch + 2] = m_error[ch + 1] = m_error[ch] = -3;
285 dmuerr[ch / 3] = 3;
286 nch += 3;
287 }
288 }
289 }
290 if (nch == MAX_CHANNELS) { // all bad - nothing to do
291 m_badDrawer = true;
292 ATH_MSG_VERBOSE( "Drawer 0x" << MSG::hex << frag << MSG::dec
293 << " is bad - skipping bad patterns check " );
294 return;
295 } else {
296 m_badDrawer = false;
297 ATH_MSG_VERBOSE( "Drawer 0x" << MSG::hex << frag << MSG::dec
298 << " looking for bad patterns in digits" );
299 }
300
301 float mindig, maxdig;
302 int nchbad[2] = { 0, 0 };
303
304 // Iterate over all digits in this collection
305 TileDigitsCollection::const_iterator digitItr = coll->begin();
306 TileDigitsCollection::const_iterator lastDigit = coll->end();
307
308 for (; digitItr != lastDigit; ++digitItr) {
309 const TileDigits * pDigits = (*digitItr);
310 HWIdentifier adcId = pDigits->adc_HWID();
311 int channel = m_tileHWID->channel(adcId);
312 int gain = m_tileHWID->adc(adcId);
313
314 if (m_error[channel]) {
315 ATH_MSG_VERBOSE( "BadCh " << ros
316 << "/" << drawer
317 << "/" << channel
318 << "/" << gain << " BAD DQ STATUS ");
319
320 } else {
321
322 int err = CorruptedData(ros, drawer, channel, gain, pDigits->samples(), mindig, maxdig, m_ADCmaxMinusEps, m_ADCmaskValueMinusEps);
323
324 if (err) {
325
327 if (err > -5) {
328 ++dmuerr[channel / 3];
329 ++nchbad[channel / 24];
330 }
331
332 if (msgLvl(MSG::VERBOSE)) {
333
334 msg(MSG::VERBOSE) << "BadCh " << ros
335 << "/" << drawer
336 << "/" << channel
337 << "/" << gain;
338 if (err < -5) msg(MSG::VERBOSE) << " Warning " << err;
339 else msg(MSG::VERBOSE) << " Error " << err;
340 if (mindig > m_ADCmaskValueMinusEps) msg(MSG::VERBOSE) << " BADDQ";
341 if (maxdig > m_ADCmaxMinusEps) msg(MSG::VERBOSE) << " Overflow";
342 if (mindig < 0.1) msg(MSG::VERBOSE) << " Underflow";
343 if (err < 0) msg(MSG::VERBOSE) << " Const";
344
345 msg(MSG::VERBOSE) << " samp=";
346 std::vector<float> digits = pDigits->samples();
347 for (unsigned int i = 0; i < digits.size(); ++i) {
348 msg(MSG::VERBOSE) << " " << digits[i];
349 }
350 msg(MSG::VERBOSE) << endmsg;
351 }
352
353 } else {
354 if (mindig < 0.01) err += 1;
355 if (maxdig > m_ADCmaxMinusEps) err += 2;
356 if (err) m_error[channel] = err - 10;
357 }
358 }
359 }
360
361 // check if we want to mask half a drawer
362 // in this case set error = -4 for channels which were good before
363
364 int ndmubad[2] = { 0, 0 };
365 int dmu = 0;
366 for (; dmu < MAX_DMUS / 2; ++dmu) { // first half
367 if (dmuerr[dmu] > 1)
368 ++ndmubad[0]; // count DMUs with at least two bad channels
369 }
370 for (; dmu < MAX_DMUS; ++dmu) { // second half
371 if (dmuerr[dmu] > 1)
372 ++ndmubad[1]; // count DMUs with at least two bad channels
373 }
374
375 int ndmulimit[2] = { 3, 3 }; // max number of bad DMUs when half-drawer is not yet masked
376 // if 4 DMUs will be bad - mask whole half-drawer
377 if (frag > 0x2ff) { // if extended barrel
378 if (frag == 0x30e || frag == 0x411)
379 ndmulimit[0] = 4; // in EB special one DMU is always bad (missing)
380 ndmulimit[1] = 5; // in second half of EB 4 DMUs ara always bad (missing)
381 // only if 7 DMUs are bad, mask whole half-drawer
382 }
383
384 bool printall = true;
385 for (int p = 0; p < 2; ++p) {
386 if (ndmubad[p] > ndmulimit[p] && nchbad[p] > 0) {
387 if (msgLvl(MSG::VERBOSE)) {
388 msg(MSG::VERBOSE) << "Drawer 0x" << MSG::hex << frag << MSG::dec
389 << " masking whole " << ((p) ? "second" : "first")
390 << " half" << endmsg;
391 if (printall) {
392 msg(MSG::VERBOSE) << "nDMuErr ";
393 for (int d = 0; d < MAX_DMUS; ++d) {
394 msg(MSG::VERBOSE) << " " << dmuerr[d];
395 }
396 msg(MSG::VERBOSE) << " total " << ndmubad[p] << " errors" << endmsg;
397
398 msg(MSG::VERBOSE) << "ChErr ";
399 int ch = 0;
400 while (ch < MAX_CHANNELS-2) {
401 msg(MSG::VERBOSE) << " " << m_error[ch++];
402 msg(MSG::VERBOSE) << " " << m_error[ch++];
403 msg(MSG::VERBOSE) << " " << m_error[ch++];
404 msg(MSG::VERBOSE) << " ";
405 }
406
407 msg(MSG::VERBOSE) << " total " << nchbad[p]
408 << " bad patterns" << endmsg;
409 printall = false;
410 }
411 }
412 int ch = (p) ? MAX_CHANNELS / 2 : 0;
413 int chmax = (p) ? MAX_CHANNELS : MAX_CHANNELS / 2;
414 for (; ch < chmax; ++ch) {
415 if (m_error[ch] == 0 || m_error[ch] < -5) { // channel was good before
416 m_error[ch] = -4;
417 }
418 }
419 }
420 }
421
422}
bool isAdcDQgood(int partition, int drawer, int ch, int gain) const
returns status of single ADC returns False if there are any errors
bool isBiGain() const
returns gain mode of run
const std::vector< float > & samples() const
Definition TileDigits.h:58
float m_ADCmaskValueMinusEps
indicates channels which were masked in background dataset
static int CorruptedData(int ros, int drawer, int channel, int gain, const std::vector< float > &digits, float &dmin, float &dmax, float ADCmaxMinusEps, float ADCmaskValueMinusEps)

◆ finalize()

StatusCode TileRawChannelBuilderFitFilterCool::finalize ( )
overridevirtual

Reimplemented from TileRawChannelBuilder.

Definition at line 514 of file TileRawChannelBuilderFitFilterCool.cxx.

514 {
515
516 ATH_MSG_DEBUG( "Finalizing" );
517
518 return StatusCode::SUCCESS;
519}

◆ getOverflowedChannels()

Overflows_t & TileRawChannelBuilder::getOverflowedChannels ( void )
inherited

Definition at line 37 of file TileRawChannelBuilder.cxx.

37 {
38 return m_overflows;
39}

◆ getTileRawChannelContainerID()

std::string TileRawChannelBuilder::getTileRawChannelContainerID ( void )
inherited

Definition at line 41 of file TileRawChannelBuilder.cxx.

41 {
42 return m_rawChannelContainerKey.key();
43}

◆ handle()

void TileRawChannelBuilderFitFilterCool::handle ( const Incident & inc)
overridevirtual

Definition at line 151 of file TileRawChannelBuilderFitFilterCool.cxx.

151 {
152
153 // -------- get pulse shapes from COOL
154
155 ATH_MSG_INFO( "TileRawChannelBuilderFitFilterCool handle" << inc.type() );
156
157 const EventContext &ctx = inc.context();
158
159 if (inc.type() == "BeginRun") {
160 // Do run initializations here...
161
162 ATH_MSG_DEBUG( "m_trigType " << m_trigType
163 << " m_runType " << m_runType.value()
164 << " m_idophys " << m_idophys
165 << " m_idolas " << m_idolas
166 << " m_idoped " << m_idoped
167 << " m_idocis " << m_idocis );
168
169 if (m_shapes) delete m_shapes;
170
171 m_shapes = new TilePulseShapesStruct;
172 float y, dy;
173 unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(0, 0);
174
175 float phase = 0;
176 if (m_idolas) {
177 // --- low gain
178 m_shapes->m_yllas.reserve(MAX_LO_PULSE_LAS);
179 m_shapes->m_tllas.reserve(MAX_LO_PULSE_LAS);
180 m_shapes->m_ydllas.reserve(MAX_LO_PULSE_LAS);
181 m_shapes->m_tdllas.reserve(MAX_LO_PULSE_LAS);
183 for (int i = 0; i < MAX_LO_PULSE_LAS; i++) {
184 // drawerIdx, channel,gain, phase+25*(i-3), py, pdy
185 m_tileToolPulseShape->getPulseShapeYDY(drawerIdx, 0, 0, phase, y, dy, ctx);
186 m_shapes->m_tllas.push_back(phase);
187 m_shapes->m_yllas.push_back(y);
188 m_shapes->m_tdllas.push_back(phase);
189 m_shapes->m_ydllas.push_back(dy);
190 if (msgLvl(MSG::DEBUG)) {
191 msg(MSG::DEBUG) << "new tllas= " << m_shapes->m_tllas[i]
192 << " yllas= " << m_shapes->m_yllas[i]
193 << " ydllas " << m_shapes->m_ydllas[i] << endmsg;
194
195 msg(MSG::DEBUG) << " old tllas= " << m_pulseShapes->m_tllas[i]
196 << " yllas= " << m_pulseShapes->m_yllas[i]
197 << " ydllas " << m_pulseShapes->m_ydllas[i] << endmsg;
198 }
199 phase += LAS_DT_LO;
200 }
201 // --- high gain
202 m_shapes->m_yhlas.reserve(MAX_HI_PULSE_LAS);
203 m_shapes->m_thlas.reserve(MAX_HI_PULSE_LAS);
204 m_shapes->m_ydhlas.reserve(MAX_HI_PULSE_LAS);
205 m_shapes->m_tdhlas.reserve(MAX_HI_PULSE_LAS);
207 for (int i = 0; i < MAX_HI_PULSE_LAS; i++) {
208 // drawerIdx, channel,gain, phase+25*(i-3), py, pdy
209 m_tileToolPulseShape->getPulseShapeYDY(drawerIdx, 0, 1, phase, y, dy, ctx);
210 m_shapes->m_thlas.push_back(phase);
211 m_shapes->m_yhlas.push_back(y);
212 m_shapes->m_tdhlas.push_back(phase);
213 m_shapes->m_ydhlas.push_back(dy);
214 if (msgLvl(MSG::DEBUG)) {
215 msg(MSG::DEBUG) << "n ew thlas= " << m_shapes->m_thlas[i]
216 << " yhlas= " << m_shapes->m_yhlas[i]
217 << " ydhlas " << m_shapes->m_ydhlas[i] << endmsg;
218
219 msg(MSG::DEBUG) << " old thlas= " << m_pulseShapes->m_thlas[i]
220 << " yhlas= " << m_pulseShapes->m_yhlas[i]
221 << " ydhlas " << m_pulseShapes->m_ydhlas[i] << endmsg;
222 }
223 phase += LAS_DT_HI;
224 }
225 } else if (m_idocis || m_idophys || m_idoped) {
226 // --- low gain
227 m_shapes->m_ylphys.reserve(MAX_LO_PULSE_PHYS);
228 m_shapes->m_tlphys.reserve(MAX_LO_PULSE_PHYS);
229 m_shapes->m_ydlphys.reserve(MAX_LO_PULSE_PHYS);
230 m_shapes->m_tdlphys.reserve(MAX_LO_PULSE_PHYS);
232 for (int i = 0; i < MAX_LO_PULSE_PHYS; i++) {
233 // drawerIdx, channel,gain, phase+25*(i-3), py, pdy
234 m_tileToolPulseShape->getPulseShapeYDY(drawerIdx, 0, 0, phase, y, dy, ctx);
235 m_shapes->m_tlphys.push_back(phase);
236 m_shapes->m_ylphys.push_back(y);
237 m_shapes->m_tdlphys.push_back(phase);
238 m_shapes->m_ydlphys.push_back(dy);
239 if (msgLvl(MSG::DEBUG)) {
240 msg(MSG::DEBUG) << " new tlphys= " << m_shapes->m_tlphys[i]
241 << " ylphys= " << m_shapes->m_ylphys[i]
242 << " ydlphys " << m_shapes->m_ydlphys[i] << endmsg;
243
244 msg(MSG::DEBUG) << " old tlphys= " << m_pulseShapes->m_tlphys[i]
245 << " ylphys= " << m_pulseShapes->m_ylphys[i]
246 << " ydlphys " << m_pulseShapes->m_ydlphys[i] << endmsg;
247 }
248 phase += PHYS_DT_LO;
249 }
250 // --- high gain
251 m_shapes->m_yhphys.reserve(MAX_HI_PULSE_PHYS);
252 m_shapes->m_thphys.reserve(MAX_HI_PULSE_PHYS);
253 m_shapes->m_ydhphys.reserve(MAX_HI_PULSE_PHYS);
254 m_shapes->m_tdhphys.reserve(MAX_HI_PULSE_PHYS);
256 for (int i = 0; i < MAX_HI_PULSE_PHYS; i++) {
257 // drawerIdx, channel,gain, phase+25*(i-3), py, pdy
258 m_tileToolPulseShape->getPulseShapeYDY(drawerIdx, 0, 1, phase, y, dy, ctx);
259 m_shapes->m_thphys.push_back(phase);
260 m_shapes->m_yhphys.push_back(y);
261 m_shapes->m_tdhphys.push_back(phase);
262 m_shapes->m_ydhphys.push_back(dy);
263 if (msgLvl(MSG::DEBUG)) {
264 msg(MSG::DEBUG) << " new thphys= " << m_shapes->m_thphys[i]
265 << " yhphys= " << m_shapes->m_yhphys[i]
266 << " ydhphys " << m_shapes->m_ydhphys[i] << endmsg;
267
268 msg(MSG::DEBUG) << " old thphys= " << m_pulseShapes->m_thphys[i]
269 << " yhphys= " << m_pulseShapes->m_yhphys[i]
270 << " ydhphys " << m_pulseShapes->m_ydhphys[i] << endmsg;
271 }
272 phase += PHYS_DT_HI;
273 }
274
275 //================================================
276 // Speedup for physics processing (max_iter=1):
277 // read initial pulse shapes into arrays
278 m_fnParameters[0] = 0.0;
279 m_fnParameters[1] = 0.0;
280 m_fnParameters[2] = 1.0;
281 m_t0Fit = 0.0;
282
283 m_gPhysLo.reserve(m_frameLength);
284 m_dgPhysLo.reserve(m_frameLength);
285 m_gPhysHi.reserve(m_frameLength);
286 m_dgPhysHi.reserve(m_frameLength);
287
288 double rsamp;
289 for (int isamp = 0; isamp < m_frameLength; ++isamp) {
290 rsamp = (isamp) * 1.0;
291 m_gPhysLo.push_back(scaledPulse(rsamp, &(m_pulseShapes->m_tlphys), &(m_pulseShapes->m_ylphys)));
292 m_dgPhysLo.push_back(pulse(rsamp, &(m_pulseShapes->m_tdlphys), &(m_pulseShapes->m_ydlphys)));
293 m_gPhysHi.push_back(scaledPulse(rsamp, &(m_pulseShapes->m_thphys), &(m_pulseShapes->m_yhphys)));
294 m_dgPhysHi.push_back(pulse(rsamp, &(m_pulseShapes->m_tdhphys), &(m_pulseShapes->m_ydhphys)));
295 }
296 } else {
297 ATH_MSG_ERROR( " Unknown run type "
298 << "idophys=" << m_idophys
299 << " idolas=" << m_idolas
300 << " idocis=" << m_idocis
301 << " idoped= " << m_idoped );
302 }
303
304 // -------------- CIS shapes
305
306 if (m_idocis) {
307 // --- low gain 100 pF Pulse
308 m_shapes->m_ylcis.reserve(MAX_LO_PULSE_CIS);
309 m_shapes->m_tlcis.reserve(MAX_LO_PULSE_CIS);
310 m_shapes->m_ydlcis.reserve(MAX_LO_PULSE_CIS);
311 m_shapes->m_tdlcis.reserve(MAX_LO_PULSE_CIS);
313 for (int i = 0; i < MAX_LO_PULSE_CIS; i++) {
314 // drawerIdx, channel,gain, phase+25*(i-3), py, pdy
315 m_tileToolPulseShape->getPulseShapeYDY(drawerIdx, 0, 0, phase, y, dy, ctx);
316 m_shapes->m_tlcis.push_back(phase);
317 m_shapes->m_ylcis.push_back(y);
318 m_shapes->m_tdlcis.push_back(phase);
319 m_shapes->m_ydlcis.push_back(dy);
320 //aa m_shapes->m_ydlcis.push_back(m_pulsevar->m_ydlcis[i]);
321 if (msgLvl(MSG::DEBUG)) {
322 msg(MSG::DEBUG) << " new tlcis= " << m_shapes->m_tlcis[i]
323 << " ylcis= " << m_shapes->m_ylcis[i]
324 << " ydlcis " << m_shapes->m_ydlcis[i] << endmsg;
325
326 msg(MSG::DEBUG) << " old tlcis= " << m_pulseShapes->m_tlcis[i]
327 << " ylcis= " << m_pulseShapes->m_ylcis[i]
328 << " ydlcis " << m_pulseShapes->m_ydlcis[i] << endmsg;
329 }
330 phase += CIS_DT_LO;
331 }
332 // --- high gain 100 pF Pulse
333 m_shapes->m_yhcis.reserve(MAX_HI_PULSE_CIS);
334 m_shapes->m_thcis.reserve(MAX_HI_PULSE_CIS);
335 m_shapes->m_ydhcis.reserve(MAX_HI_PULSE_CIS);
336 m_shapes->m_tdhcis.reserve(MAX_HI_PULSE_CIS);
338 for (int i = 0; i < MAX_HI_PULSE_CIS; i++) {
339 // drawerIdx, channel,gain, phase+25*(i-3), py, pdy
340 m_tileToolPulseShape->getPulseShapeYDY(drawerIdx, 0, 1, phase, y, dy, ctx);
341 m_shapes->m_thcis.push_back(phase);
342 m_shapes->m_yhcis.push_back(y);
343 m_shapes->m_tdhcis.push_back(phase);
344 m_shapes->m_ydhcis.push_back(dy);
345 //aa m_shapes->m_ydhcis.push_back(m_pulsevar->m_ydhcis[i]);
346 if (msgLvl(MSG::DEBUG)) {
347 msg(MSG::DEBUG) << " new thcis= " << m_shapes->m_thcis[i]
348 << " yhcis= " << m_shapes->m_yhcis[i]
349 << " ydhcis " << m_shapes->m_ydhcis[i] << endmsg;
350
351 msg(MSG::DEBUG) << " old thcis= " << m_pulseShapes->m_thcis[i]
352 << " yhcis= " << m_pulseShapes->m_yhcis[i]
353 << " ydhcis " << m_pulseShapes->m_ydhcis[i] << endmsg;
354 }
355 phase += CIS_DT_HI;
356 }
357
358 // --- low gain 5.2 pF Pulse
359 m_shapes->m_yslcis.reserve(MAX_LO_PULSE_CIS_SMALL);
360 m_shapes->m_tslcis.reserve(MAX_LO_PULSE_CIS_SMALL);
361 m_shapes->m_ydslcis.reserve(MAX_LO_PULSE_CIS_SMALL);
362 m_shapes->m_tdslcis.reserve(MAX_LO_PULSE_CIS_SMALL);
364 for (int i = 0; i < MAX_LO_PULSE_CIS; i++) {
365 // drawerIdx, channel,gain, phase+25*(i-3), py, pdy
366 m_tileToolPulse5p2Shape->getPulseShapeYDY(drawerIdx, 0, 0, phase, y, dy, ctx);
367 m_shapes->m_tslcis.push_back(phase);
368 m_shapes->m_yslcis.push_back(y);
369 m_shapes->m_tdslcis.push_back(phase);
370 m_shapes->m_ydslcis.push_back(dy);
371 //aa m_shapes->m_ydslcis.push_back(m_pulsevar->m_ydslcis[i]);
372 if (msgLvl(MSG::DEBUG)) {
373 msg(MSG::DEBUG) << " new tslcis= " << m_shapes->m_tslcis[i]
374 << " yslcis= " << m_shapes->m_yslcis[i]
375 << " ydslcis " << m_shapes->m_ydslcis[i] << endmsg;
376
377 msg(MSG::DEBUG) << " old tslcis= " << m_pulseShapes->m_tslcis[i]
378 << " yslcis= " << m_pulseShapes->m_yslcis[i]
379 << " ydslcis " << m_pulseShapes->m_ydslcis[i] << endmsg;
380 }
381 phase += CIS_DT_LO;
382 }
383 // --- high gain 5.2 pF Pulse
384 m_shapes->m_yshcis.reserve(MAX_HI_PULSE_CIS_SMALL);
385 m_shapes->m_tshcis.reserve(MAX_HI_PULSE_CIS_SMALL);
386 m_shapes->m_ydshcis.reserve(MAX_HI_PULSE_CIS_SMALL);
387 m_shapes->m_tdshcis.reserve(MAX_HI_PULSE_CIS_SMALL);
389 for (int i = 0; i < MAX_HI_PULSE_CIS; i++) {
390 // drawerIdx, channel,gain, phase+25*(i-3), py, pdy
391 m_tileToolPulse5p2Shape->getPulseShapeYDY(drawerIdx, 0, 1, phase, y, dy, ctx);
392 m_shapes->m_tshcis.push_back(phase);
393 m_shapes->m_yshcis.push_back(y);
394 m_shapes->m_tdshcis.push_back(phase);
395 m_shapes->m_ydshcis.push_back(dy);
396 //aa m_shapes->m_ydshcis.push_back(m_pulsevar->m_ydshcis[i]);
397 if (msgLvl(MSG::DEBUG)) {
398 msg(MSG::DEBUG) << " new tshcis= " << m_shapes->m_tshcis[i]
399 << " yshcis= " << m_shapes->m_yshcis[i]
400 << " ydshcis " << m_shapes->m_ydshcis[i] << endmsg;
401
402 msg(MSG::DEBUG) << " old tshcis= " << m_pulseShapes->m_tshcis[i]
403 << " yshcis= " << m_pulseShapes->m_yshcis[i]
404 << " ydshcis " << m_pulseShapes->m_ydshcis[i] << endmsg;
405 }
406 phase += CIS_DT_HI;
407 }
408
409 // --- low gain 100 pF Leak
410 m_shapes->m_leaklo.reserve(MAX_LO_PULSE_CIS);
411 m_shapes->m_tleaklo.reserve(MAX_LO_PULSE_CIS);
412 m_shapes->m_dleaklo.reserve(MAX_LO_PULSE_CIS);
413 m_shapes->m_tdleaklo.reserve(MAX_LO_PULSE_CIS);
415 for (int i = 0; i < MAX_LO_PULSE_CIS; i++) {
416 // drawerIdx, channel,gain, phase+25*(i-3), py, pdy
417 m_tileToolLeak100Shape->getPulseShapeYDY(drawerIdx, 0, 0, phase, y, dy, ctx);
418 m_shapes->m_tleaklo.push_back(phase);
419 m_shapes->m_leaklo.push_back(y);
420 m_shapes->m_tdleaklo.push_back(phase);
421 //aa m_shapes->m_dleaklo.push_back(m_pulsevar->m_dleaklo[i]);
422 m_shapes->m_dleaklo.push_back(dy);
423 if (msgLvl(MSG::DEBUG)) {
424 msg(MSG::DEBUG) << " new tleaklo = " << m_shapes->m_tleaklo[i]
425 << " leaklo = " << m_shapes->m_leaklo[i]
426 << " dleaklo " << m_shapes->m_dleaklo[i] << endmsg;
427
428 msg(MSG::DEBUG) << " old tleaklo= " << m_pulseShapes->m_tleaklo[i]
429 << " leaklo= " << m_pulseShapes->m_leaklo[i]
430 << " dleaklo " << m_pulseShapes->m_dleaklo[i] << endmsg;
431 }
432 phase += CIS_DT_LO;
433 }
434 // --- high gain 100 pF Leak
435 m_shapes->m_leakhi.reserve(MAX_HI_PULSE_CIS);
436 m_shapes->m_tleakhi.reserve(MAX_HI_PULSE_CIS);
437 m_shapes->m_dleakhi.reserve(MAX_HI_PULSE_CIS);
438 m_shapes->m_tdleakhi.reserve(MAX_HI_PULSE_CIS);
440 for (int i = 0; i < MAX_HI_PULSE_CIS; i++) {
441 // drawerIdx, channel,gain, phase+25*(i-3), py, pdy
442 m_tileToolLeak100Shape->getPulseShapeYDY(drawerIdx, 0, 1, phase, y, dy, ctx);
443 m_shapes->m_tleakhi.push_back(phase);
444 m_shapes->m_leakhi.push_back(y);
445 m_shapes->m_tdleakhi.push_back(phase);
446 m_shapes->m_dleakhi.push_back(dy);
447 //aa m_shapes->m_dleakhi.push_back(m_pulsevar->m_dleakhi[i]);
448 if (msgLvl(MSG::DEBUG)) {
449 msg(MSG::DEBUG) << " new tleakhi = " << m_shapes->m_tleakhi[i]
450 << " leakhi= " << m_shapes->m_leakhi[i]
451 << " dleakhi " << m_shapes->m_dleakhi[i] << endmsg;
452
453 msg(MSG::DEBUG) << " old tleakhi = " << m_pulseShapes->m_tleakhi[i]
454 << " leakhi= " << m_pulseShapes->m_leakhi[i]
455 << " dleakhi " << m_pulseShapes->m_dleakhi[i] << endmsg;
456 }
457 phase += CIS_DT_HI;
458 }
459
460 // --- low gain 5.2 pF Leak
461 m_shapes->m_sleaklo.reserve(MAX_LO_PULSE_CIS_SMALL);
462 m_shapes->m_tsleaklo.reserve(MAX_LO_PULSE_CIS_SMALL);
463 m_shapes->m_dsleaklo.reserve(MAX_LO_PULSE_CIS_SMALL);
464 m_shapes->m_tdsleaklo.reserve(MAX_LO_PULSE_CIS_SMALL);
466 for (int i = 0; i < MAX_LO_PULSE_CIS; i++) {
467 // drawerIdx, channel,gain, phase+25*(i-3), py, pdy
468 m_tileToolLeak5p2Shape->getPulseShapeYDY(drawerIdx, 0, 0, phase, y, dy, ctx);
469 m_shapes->m_tsleaklo.push_back(phase);
470 m_shapes->m_sleaklo.push_back(y);
471 m_shapes->m_tdsleaklo.push_back(phase);
472 m_shapes->m_dsleaklo.push_back(dy);
473 //aa m_shapes->m_dsleaklo.push_back(m_pulsevar->m_dsleaklo[i]);
474 if (msgLvl(MSG::DEBUG)) {
475 msg(MSG::DEBUG) << " new tsleaklo = " << m_shapes->m_tsleaklo[i]
476 << " sleaklo = " << m_shapes->m_sleaklo[i]
477 << " dsleaklo " << m_shapes->m_dsleaklo[i] << endmsg;
478
479 msg(MSG::DEBUG) << " old tsleaklo = " << m_pulseShapes->m_tslcis[i]
480 << " sleaklo= " << m_pulseShapes->m_sleaklo[i]
481 << " dsleaklo " << m_pulseShapes->m_dsleaklo[i] << endmsg;
482 }
483 phase += CIS_DT_LO;
484 }
485 // --- high gain 5.2 pF Leak
486 m_shapes->m_sleakhi.reserve(MAX_HI_PULSE_CIS_SMALL);
487 m_shapes->m_tsleakhi.reserve(MAX_HI_PULSE_CIS_SMALL);
488 m_shapes->m_dsleakhi.reserve(MAX_HI_PULSE_CIS_SMALL);
489 m_shapes->m_tdsleakhi.reserve(MAX_HI_PULSE_CIS_SMALL);
491 for (int i = 0; i < MAX_HI_PULSE_CIS; i++) {
492 // drawerIdx, channel,gain, phase+25*(i-3), py, pdy
493 m_tileToolLeak5p2Shape->getPulseShapeYDY(drawerIdx, 0, 1, phase, y, dy, ctx);
494 m_shapes->m_tsleakhi.push_back(phase);
495 m_shapes->m_sleakhi.push_back(y);
496 m_shapes->m_tdsleakhi.push_back(phase);
497 m_shapes->m_dsleakhi.push_back(dy);
498 //aa m_shapes->m_dsleakhi.push_back(m_pulsevar->m_dsleakhi[i]);
499 if (msgLvl(MSG::DEBUG)) {
500 msg(MSG::DEBUG) << " new tsleakhi= " << m_shapes->m_tsleakhi[i]
501 << " sleakhi = " << m_shapes->m_sleakhi[i]
502 << " dsleakhi " << m_shapes->m_dsleakhi[i] << endmsg;
503
504 msg(MSG::DEBUG) << " old tsleakhi= " << m_pulseShapes->m_tsleakhi[i]
505 << " sleakhi= " << m_pulseShapes->m_sleakhi[i]
506 << " dsleakhi " << m_pulseShapes->m_dsleakhi[i] << endmsg;
507 }
508 phase += CIS_DT_HI;
509 }
510 } // endif(m_idocis)
511 } // endif "beginrun"
512}
#define ATH_MSG_INFO(x,...)
#define MAX_LO_PULSE_PHYS
#define MAX_LO_PULSE_LAS
#define MAX_HI_PULSE_CIS_SMALL
#define MAX_LO_PULSE_CIS
#define MAX_HI_PULSE_CIS
#define MAX_HI_PULSE_PHYS
#define MAX_LO_PULSE_CIS_SMALL
#define MAX_HI_PULSE_LAS
#define y
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
ToolHandle< TileCondToolPulseShape > m_tileToolLeak100Shape
ToolHandle< TileCondToolPulseShape > m_tileToolPulseShape
double scaledPulse(double x, const std::vector< double > *xvec, const std::vector< double > *yvec) const
ToolHandle< TileCondToolPulseShape > m_tileToolPulse5p2Shape
ToolHandle< TileCondToolPulseShape > m_tileToolLeak5p2Shape
Gaudi::Property< int > m_runType
MsgStream & msg
Definition testRead.cxx:32

◆ initialize()

StatusCode TileRawChannelBuilderFitFilterCool::initialize ( )
overridevirtual

Initializer.

Reimplemented from TileRawChannelBuilder.

Definition at line 71 of file TileRawChannelBuilderFitFilterCool.cxx.

71 {
72
73 ATH_MSG_INFO( "TileRawChannelBuilderFitFilterCool::initialize()" );
74
76
77 // init in superclass
79
80 // Get pulse shapes from TileInfo
81 m_pulseShapes = m_tileInfo->getPulseShapes();
82
83 // Determine peak sample position
84 // peak sample position defines t=0
85 m_iPeak0 = (int) (m_frameLength) / 2 + (m_frameLength % 2) - 1;
86
87 // Min and max time are now calculated based on m_framelength - i.e. on the
88 // number of 25 ns samples read out. Don't forget t=0 corresponds to
89 // m_ipeak0-th sample
92 // maximal jump during one iteration
95
96 ATH_MSG_DEBUG( " ipeak0=" << m_iPeak0
97 << " min_time=" << m_minTime
98 << " max_time=" << m_maxTime
99 << " min_tau=" << m_minTau
100 << " max_tau=" << m_maxTau
101 << " physize=" << m_pulseShapes->m_ylphys.size()
102 << " cissize=" << m_pulseShapes->m_ylcis.size()
103 << " xpmin=" << m_pulseShapes->m_tlphys[0]
104 << " xpmax=" << m_pulseShapes->m_tlphys[MAX_LO_PULSE_PHYS - 1]
105 << " ypmin=" << m_pulseShapes->m_ylphys[0]
106 << " ypmax=" << m_pulseShapes->m_ylphys[MAX_LO_PULSE_PHYS - 1] );
107
108 //=== get TileCondToolPulseShape
109 ATH_CHECK( m_tileToolPulseShape.retrieve() );
110
111 if (m_idocis) {
112 ATH_CHECK( m_tileToolLeak100Shape.retrieve() );
113 ATH_CHECK( m_tileToolLeak5p2Shape.retrieve() );
115 } else {
116 m_tileToolLeak100Shape.disable();
117 m_tileToolLeak5p2Shape.disable();
118 m_tileToolPulse5p2Shape.disable();
119 }
120
121 //=== TileCondToolNoiseSample
122 ATH_CHECK( m_tileToolNoiseSample.retrieve() );
123
124 // Incident Service:
125 ServiceHandle<IIncidentSvc> incSvc("IncidentSvc", this->name());
126 ATH_CHECK(incSvc.retrieve());
127 //start listening to "BeginRun"
128 incSvc->addListener(this, "BeginRun");
129
130 if (msgLvl(MSG::DEBUG)) {
131 if (m_channelNoiseRMS) {
132 msg(MSG::DEBUG) << " noise for all channels from Conditions DB ";
133 if (TileCablingService::getInstance()->getTestBeam()) {
134 const EventContext &ctx = Gaudi::Hive::currentContext();
135 msg(MSG::DEBUG) << " rmsLow(LBA01/0) = " << m_tileToolNoiseSample->getHfn(20, 0, TileID::LOWGAIN, TileRawChannelUnit::ADCcounts, ctx)
136 << " rmsHi(LBA01/0) = " << m_tileToolNoiseSample->getHfn(20, 0, TileID::HIGHGAIN, TileRawChannelUnit::ADCcounts, ctx)
137 << endmsg;
138 } else {
139 msg(MSG::DEBUG) << endmsg;
140 }
141 } else {
142 msg(MSG::DEBUG) << " common noise for all channels (OBSOLETE): " << endmsg;
143 msg(MSG::DEBUG) << " rmsLow = " << m_noiseLow.value()
144 << " rmsHi = " << m_noiseHigh.value() << endmsg;
145 }
146 }
147
148 return StatusCode::SUCCESS;
149}
static const TileCablingService * getInstance()
get pointer to service instance
ToolHandle< TileCondToolNoiseSample > m_tileToolNoiseSample
virtual StatusCode initialize()
Initializer.

◆ initLog()

void TileRawChannelBuilder::initLog ( const EventContext & ctx)
inherited

Definition at line 212 of file TileRawChannelBuilder.cxx.

212 {
213
214 const TileDQstatus* DQstatus = SG::makeHandle (m_DQstatusKey, ctx).get();
215
216 // update only if there is new event
217 if (m_evtCounter != ctx.evt()) {
218
219 m_evtCounter = ctx.evt();
220 if (m_runType != 0) m_trigType = m_runType;
221 else m_trigType = DQstatus->trigType();
222
223 if (0 == m_trigType) {
224 m_idophys = (DQstatus->calibMode() == 0);
225 m_idolas = false;
226 m_idoped = false;
227 m_idocis = (DQstatus->calibMode() == 1);
228 } else {
229 m_idophys = (m_trigType <= 1);
230 m_idolas = ((m_trigType == 2) || (m_trigType == 3));
231 m_idoped = ((m_trigType == 4) || (m_trigType == 5));
232 m_idocis = ((m_trigType == 8) || (m_trigType == 9));
233 }
234
235 const unsigned int *cispar = DQstatus->cispar();
236 if (0 == cispar[7]) { // if capdaq not set, it can't be CIS event
237 if (m_idocis) { // cis flag was set incorrectly, change to ped
238 m_idoped = true;
239 m_idocis = false;
240 }
241 m_capdaq = 0.0;
242 } else {
243 m_capdaq = (cispar[7] < 10) ? 5.2 : 100.0;
244 }
245 m_cischan = cispar[8] - 1; // channel where CIS is fired (-1 = all channels)
246
247 ATH_MSG_DEBUG( "Trig type is " << m_trigType
248 << "; dophys is " << ((m_idophys) ? "true" : "false")
249 << "; dolas is " << ((m_idolas) ? "true" : "false")
250 << "; doped is " << ((m_idoped) ? "true" : "false")
251 << "; docis is " << ((m_idocis) ? "true" : "false")
252 << "; capacitor is " << m_capdaq
253 << "; cis chan is " << m_cischan );
254 }
255}
int trigType() const
Trigger type.
uint32_t calibMode() const
Calibration mode.
const uint32_t * cispar() const
CIS parameters.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & TileRawChannelBuilderFitFilterCool::interfaceID ( )
static

AlgTool InterfaceID.

Definition at line 34 of file TileRawChannelBuilderFitFilterCool.cxx.

34 {
36 //return TileRawChannelBuilderCool::interfaceID();
37}
static const InterfaceID IID_ITileRawChannelBuilderFitFilterCool("TileRawChannelBuilderFitFilterCool", 1, 0)

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ pulse()

double TileRawChannelBuilderFitFilterCool::pulse ( double x,
const std::vector< double > * xvec,
const std::vector< double > * yvec,
bool zeroOutside = false ) const
private

pulse interpolation

Definition at line 1812 of file TileRawChannelBuilderFitFilterCool.cxx.

1813 {
1814
1815 int size1 = xvec->size() - 1;
1816 if (size1 < 1) return 0.0;
1817
1818 const double delta = 1.e-6;
1819
1820 double xpmin = xvec->at(0);
1821 double xpmax = xvec->at(size1);
1822
1823 double xp = (x - m_iPeak0) * DTIME - m_t0Fit - m_fnParameters[0];
1824
1825 double val = 0.0;
1826 double tdiv = (xpmax - xpmin) / size1;
1827
1828 if (xp < xpmin + delta) {
1829 if (zeroOutside && xp < xpmin - delta)
1830 val = 0.0;
1831 else
1832 val = yvec->at(0);
1833#ifdef EXTRAPOLATE_TO_ZERO
1834 if (xp < xpmin - delta && val != 0.0) {
1835 double newval = val + ((yvec->at(1) - val) / tdiv) * (xp - xpmin);
1836 if (val * newval < 0.0) {
1837 val = 0.0;
1838 } else if (fabs(newval) < fabs(val)) {
1839 val = newval;
1840 }
1841 }
1842#endif
1843 } else if (xp > xpmax - delta) {
1844 if (zeroOutside && xp > xpmax + delta)
1845 val = 0.0;
1846 else
1847 val = yvec->at(size1);
1848#ifdef EXTRAPOLATE_TO_ZERO
1849 if (xp > xpmax + delta && val != 0.0) {
1850 double newval = val + ((yvec->at(size1 - 1) - val) / tdiv) * (xp - xpmax);
1851 if (val * newval < 0.0) {
1852 val = 0.0;
1853 } else if (fabs(newval) < fabs(val)) {
1854 val = newval;
1855 }
1856 }
1857#endif
1858 } else {
1859 int j = (int) ((xp - xpmin) / tdiv);
1860 val = yvec->at(j) + ((yvec->at(j + 1) - yvec->at(j)) / tdiv) * (xp - xvec->at(j));
1861 }
1862
1863 return val;
1864}
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ pulseFit()

void TileRawChannelBuilderFitFilterCool::pulseFit ( const TileDigits * digit,
double & amplitude,
double & time,
double & pedestal,
double & chi2,
const EventContext & ctx )
private

Calculate energy, time and chi2 for one channel using fitted pulse shape.

Method uses HFITV.

Parameters
samplesTileDigits

Definition at line 590 of file TileRawChannelBuilderFitFilterCool.cxx.

591 {
592
593 amplitude = 0.0;
594 time = 0.0;
595 pedestal = 0.0;
596 chi2 = MAX_CHI2;
597
598 const HWIdentifier adcId = digit->adc_HWID();
599 int ros = m_tileHWID->ros(adcId);
600 int channel = m_tileHWID->channel(adcId);
601 int igain = m_tileHWID->adc(adcId);
602
603 int drawer = m_tileHWID->drawer(adcId);
604 unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer);
605
606 // Estimate channel noise
607 double rms = 0.0;
608 int noise_channel = (ros < 3) ? channel : channel + 48;
609
610 if (igain == 0) {
611 switch (m_channelNoiseRMS.value()) {
612 case 3:
613 rms = m_tileToolNoiseSample->getHfn(drawerIdx, channel, igain, TileRawChannelUnit::ADCcounts, ctx);
614 if (rms > 0.0) break;
615 /* FALLTHROUGH */
616 case 2:
617 rms = m_pulseShapes->m_noiseNkLo[noise_channel];
618 if (rms > 0.0) break;
619 /* FALLTHROUGH */
620 case 1:
621 rms = m_pulseShapes->m_noiseOrigLo[noise_channel];
622 if (rms > 0.0) break;
623 /* FALLTHROUGH */
624 default:
625 rms = m_noiseLow;
626 }
627 } else if (igain == 1) {
628 switch (m_channelNoiseRMS.value()) {
629 case 3:
630 rms = m_tileToolNoiseSample->getHfn(drawerIdx, channel, igain, TileRawChannelUnit::ADCcounts, ctx);
631 if (rms > 0.0) break;
632 /* FALLTHROUGH */
633 case 2:
634 rms = m_pulseShapes->m_noiseNkHi[noise_channel];
635 if (rms > 0.0) break;
636 /* FALLTHROUGH */
637 case 1:
638 rms = m_pulseShapes->m_noiseOrigHi[noise_channel];
639 if (rms > 0.0) break;
640 /* FALLTHROUGH */
641 default:
643 }
644 } else {
645 // neither low nor hi-gain, (e.g. adder data)
646 chi2 = -1.0;
647 return;
648 }
649
650 ATH_MSG_VERBOSE ( "PulseFit:"
651 << " ROS=" << ros
652 << " Channel=" << channel
653 << " gain=" << igain
654 << " RMS=" << rms
655 << " RMSChNoise=" << m_channelNoiseRMS.value() );
656
657 // First sample to fit, number of samples to fit
658 int ifit1 = 0;
659 int nfit = std::min(m_frameLength.value(), digit->NtimeSamples());
660
661 int ipeakMax = m_iPeak0;
662 int ipeakMin = m_iPeak0;
663
664 ATH_MSG_VERBOSE ( "ipeak0=" << m_iPeak0
665 << " ifit1=" << ifit1
666 << " ifit2=" << ifit1 + nfit - 1
667 << " nfit=" << nfit
668 << " idolas=" << m_idolas
669 << " idocis=" << m_idocis
670 << " CISchan=" << m_cischan
671 << " capdaq=" << m_capdaq );
672
673 std::vector<float> samples = digit->samples();
674 double maxsamp = 0.0;
675 double minsamp = SATURATED_ADC_VALUE;
676
677 double xvec[MAX_SAMPLES], yvec0[MAX_SAMPLES];
678 double yvec[MAX_SAMPLES], eyvec[MAX_SAMPLES];
679
680 bool no_signal = true;
681 pedestal = samples[0];
682 const double delta = 1.e-6;
683
684 for (int isamp = 0; isamp < nfit; ++isamp) {
685 int j = isamp + ifit1;
686 xvec[isamp] = j;
687 yvec0[isamp] = samples[j];
688 if (no_signal) no_signal = (fabs(samples[j] - pedestal) < delta);
689
690 // Check for saturated or zero samples and de-weight accordingly
691 if ((yvec0[isamp] < SATURATED_ADC_VALUE) && (yvec0[isamp] > 0)) {
692 eyvec[isamp] = rms;
693 } else {
694 if (yvec0[isamp] >= SATURATED_ADC_VALUE) {
695 eyvec[isamp] = m_saturatedSampleError * rms;
696 ATH_MSG_VERBOSE ( "Saturated ADC value yvec0[" << isamp << "]=" << yvec0[isamp]
697 << " (MAX=" << SATURATED_ADC_VALUE << " ) RMS=" << eyvec[isamp] );
698 } else { // must be yvec0[isamp]==0
699 eyvec[isamp] = m_zeroSampleError * rms;
700 ATH_MSG_VERBOSE ( "Zero ADC value yvec0[" << isamp << "]=" << yvec0[isamp]
701 << " RMS=" << eyvec[isamp] );
702 }
703 }
704
705 if (yvec0[isamp] > maxsamp) {
706 // initial time guess based on
707 // sample with maximum value
708 maxsamp = yvec0[isamp];
709 ipeakMax = j;
710 }
711 if (yvec0[isamp] < minsamp) {
712 minsamp = yvec0[isamp];
713 ipeakMin = j;
714 }
715 ATH_MSG_VERBOSE ( "isamp=" << isamp
716 << ", xvec=" << xvec[isamp]
717 << ", yvec0=" << yvec0[isamp]
718 << ", eyvec=" << eyvec[isamp] );
719 }
720
721 if (no_signal) {
722 ATH_MSG_VERBOSE ( "No signal detected" );
723 return;
724 }
725
726 // Make an initial guess about pedestal
727 double pedg = (yvec0[0] + yvec0[nfit - 1]) / 2.0;
728
729 // Position of max sample compared to nominal peak position
730 int delta_peak = 0;
731 // Time offset in pulse functions
732 m_t0Fit = 0.0;
733 // Flag for fixed time in fit
734 bool fixedTime = (m_maxIterate < 0);
735
736 if (!fixedTime) {
737 if (maxsamp - pedg > m_noiseThresholdRMS * rms) {
738 delta_peak = ipeakMax - m_iPeak0; // Adjust initial phase guess,
739 m_t0Fit = (delta_peak) * DTIME; // positive amplitude
740 } else if (pedg - minsamp > m_noiseThresholdRMS * rms) {
741 delta_peak = ipeakMin - m_iPeak0; // Adjust initial phase guess,
742 m_t0Fit = (delta_peak) * DTIME; // negative amplitude
743 } else {
744 fixedTime = true; // no signal above noise
745 m_t0Fit = 0.0; // fit with fixed time
746 }
747 }
748
749 ATH_MSG_VERBOSE ( " initial value of t0fit=" << m_t0Fit
750 << " ipeakMax=" << ipeakMax
751 << " ipeakMin=" << ipeakMin
752 << " fixedTime=" << ((fixedTime) ? "true" : "false") );
753
754 const std::vector<double>* tpulse = &m_dummy;
755 const std::vector<double>* ypulse = &m_dummy;
756 const std::vector<double>* tdpulse = &m_dummy;
757 const std::vector<double>* dpulse = &m_dummy;
758 const std::vector<double>* tleak = &m_dummy;
759 const std::vector<double>* yleak = &m_dummy;
760 const std::vector<double>* tdleak = &m_dummy;
761 const std::vector<double>* dleak = &m_dummy;
762
763 if (m_idocis && ((m_cischan == -1) || (channel == m_cischan))) { // CIS pulse
764 if (igain == 0) { // low gain
765 if (m_capdaq > 10) { // 100 pF capacitor
766 tpulse = &(m_pulseShapes->m_tlcis);
767 ypulse = &(m_pulseShapes->m_ylcis);
768 tdpulse = &(m_pulseShapes->m_tdlcis);
769 dpulse = &(m_pulseShapes->m_ydlcis);
770 tleak = &(m_pulseShapes->m_tleaklo);
771 yleak = &(m_pulseShapes->m_leaklo);
772 tdleak = &(m_pulseShapes->m_tdleaklo);
773 dleak = &(m_pulseShapes->m_dleaklo);
774 } else { // 5.2 pF capacitor
775 tpulse = &(m_pulseShapes->m_tslcis);
776 ypulse = &(m_pulseShapes->m_yslcis);
777 tdpulse = &(m_pulseShapes->m_tdslcis);
778 dpulse = &(m_pulseShapes->m_ydslcis);
779 tleak = &(m_pulseShapes->m_tsleaklo);
780 yleak = &(m_pulseShapes->m_sleaklo);
781 tdleak = &(m_pulseShapes->m_tdsleaklo);
782 dleak = &(m_pulseShapes->m_dsleaklo);
783 }
784 } else { // igain==1 => high-gain
785 if (m_capdaq > 10) { // 100 pF capacitor
786 tpulse = &(m_pulseShapes->m_thcis);
787 ypulse = &(m_pulseShapes->m_yhcis);
788 tdpulse = &(m_pulseShapes->m_tdhcis);
789 dpulse = &(m_pulseShapes->m_ydhcis);
790 tleak = &(m_pulseShapes->m_tleakhi);
791 yleak = &(m_pulseShapes->m_leakhi);
792 tdleak = &(m_pulseShapes->m_tdleakhi);
793 dleak = &(m_pulseShapes->m_dleakhi);
794 } else { // 5.2 pF capacitor
795 tpulse = &(m_pulseShapes->m_tshcis);
796 ypulse = &(m_pulseShapes->m_yshcis);
797 tdpulse = &(m_pulseShapes->m_tdshcis);
798 dpulse = &(m_pulseShapes->m_ydshcis);
799 tleak = &(m_pulseShapes->m_tsleakhi);
800 yleak = &(m_pulseShapes->m_sleakhi);
801 tdleak = &(m_pulseShapes->m_tdsleakhi);
802 dleak = &(m_pulseShapes->m_dsleakhi);
803 }
804 }
805 } else {
806 if (m_idolas) { // laser pulse
807 if (igain == 0) { // low gain
808 tpulse = &(m_pulseShapes->m_tllas);
809 ypulse = &(m_pulseShapes->m_yllas);
810 tdpulse = &(m_pulseShapes->m_tdllas);
811 dpulse = &(m_pulseShapes->m_ydllas);
812 } else { // igain==1 => high-gain
813 tpulse = &(m_pulseShapes->m_thlas);
814 ypulse = &(m_pulseShapes->m_yhlas);
815 tdpulse = &(m_pulseShapes->m_tdhlas);
816 dpulse = &(m_pulseShapes->m_ydhlas);
817 }
818 } else { // physics pulse
819 if (igain == 0) { // low gain
820 tpulse = &(m_pulseShapes->m_tlphys);
821 ypulse = &(m_pulseShapes->m_ylphys);
822 tdpulse = &(m_pulseShapes->m_tdlphys);
823 dpulse = &(m_pulseShapes->m_ydlphys);
824 } else { // igain==1 => high-gain
825 tpulse = &(m_pulseShapes->m_thphys);
826 ypulse = &(m_pulseShapes->m_yhphys);
827 tdpulse = &(m_pulseShapes->m_tdhphys);
828 dpulse = &(m_pulseShapes->m_ydhphys);
829 }
830 }
831 }
832
833 // Variables used for iterative fitting
834 double gval, gpval, sy, syg, sygp, sg, sgp, sgg, sgpgp, sggp, serr, err2;
835 double dgg0, dgg, dggp, dgpgp, dyg, dygp, dg, dc, xd;
836 double sllp, sylp, slplp, dleakage, leakage;
837 double fixtau = 0.0, fixped = 0.0, fixampl = 0.0, fixchi2 = MAX_CHI2;
838 double leaktau = 0.0, leakped = 0.0, leakampl = 0.0, leakchi2 = MAX_CHI2;
839 double cistau = 0.0, cisped = 0.0, cisampl = 0.0, cisatau = 0.0, cischi2 = MAX_CHI2;
840 double tau, ped, ampl, atau = 0.0, tempChi2 = MAX_CHI2, oldchi2 = MAX_CHI2 / 2;
841
842 // number of iterations
843 int niter = 0;
844 do {
845 ++niter;
846 ATH_MSG_VERBOSE ( "niter=" << niter << " maxIterate=" << m_maxIterate.value() );
847
848 if (tempChi2 < oldchi2) oldchi2 = tempChi2; // best chi2 up to now
849
850 // parameters for pulse shape functions
851 // 0. phase
852 m_fnParameters[0] = 0.0;
853 // 1. pedestal
854 m_fnParameters[1] = 0.0;
855 // 2. amplitude
856 m_fnParameters[2] = 1.0;
857
858 // CIS events linear fit
859 if (m_idocis && ((m_cischan == -1) || (channel == m_cischan))) {
860 ATH_MSG_VERBOSE ( "Fit time with leakage" );
861 // CIS Part (A): fit for time using leakage pulse
862 sllp = 0.0;
863 sylp = 0.0;
864 slplp = 0.0;
865 for (int isamp = 0; isamp < nfit; ++isamp) {
866 ATH_MSG_VERBOSE ( "Lo gain leakage xvec[" << isamp << "]=" << xvec[isamp] );
867
868 leakage = pulse(xvec[isamp], tleak, yleak);
869 dleakage = derivative(xvec[isamp], tdleak, dleak);
870
871 // Samples with pedestal subtracted
872 yvec[isamp] = yvec0[isamp] - pedg;
873
874 ATH_MSG_VERBOSE ( " yvec[" << isamp << "]=" << yvec[isamp]
875 << " yvec0[" << isamp << "]=" << yvec0[isamp]
876 << " pedg=" << pedg );
877
878 sllp += leakage * dleakage;
879 sylp += yvec[isamp] * dleakage;
880 slplp += dleakage * dleakage;
881 }
882 // Also allow for fixed-time fit to CIS events
883 if (fabs(slplp) > EPS_DG && !fixedTime) {
884 leaktau = (sllp - sylp) / slplp;
885 // Also have to check the range for leaktau
886 if (leaktau > m_maxTau)
887 leaktau = m_maxTau;
888 else if (leaktau < m_minTau) leaktau = m_minTau;
889 } else {
890 leaktau = 0.0;
891 }
892
893 ATH_MSG_VERBOSE ( " sllp=" << sllp
894 << " sylp=" << sylp
895 << " slplp=" << slplp
896 << " leaktau=" << leaktau );
897
898 // CIS Part (B): using phase determined in part (A),
899 // subtract leakage pedestal and fit for amplitude, pedestal
900 m_fnParameters[0] = leaktau;
901 sy = 0.0;
902 sg = 0.0;
903 syg = 0.0;
904 sgg = 0.0;
905 serr = 0.0;
906 for (int isamp = 0; isamp < nfit; ++isamp) {
907 leakage = pulse(xvec[isamp], tleak, yleak);
908 gval = scaledPulse(xvec[isamp], tpulse, ypulse);
909 yvec[isamp] = yvec0[isamp] - leakage;
910
911 ATH_MSG_VERBOSE ( " yvec[" << isamp << "]=" << yvec[isamp]
912 << " yvec0[" << isamp << "]=" << yvec0[isamp]
913 << " leakage=" << leakage );
914
915 err2 = eyvec[isamp] * eyvec[isamp];
916 sy += yvec[isamp] / err2;
917 sg += gval / err2;
918 syg += yvec[isamp] * gval / err2;
919 sgg += gval * gval / err2;
920 serr += 1.0 / err2;
921 }
922 dgg0 = sg * sg - serr * sgg;
923 if (fabs(dgg0) > EPS_DG) {
924 leakampl = (sy * sg - serr * syg) / dgg0;
925 leakped = (syg * sg - sy * sgg) / dgg0;
926 } else {
927 leakampl = 0.0;
928 leakped = sy / serr;
929 }
930
931 // Determine Chi2 for corresponding function for CIS leakage + pulse
932 ATH_MSG_VERBOSE ( " Determine Chi2 for CIS leakage + pulse" );
933
934 leakchi2 = 0.0;
935 m_fnParameters[0] = leaktau;
936 m_fnParameters[1] = leakped;
937 m_fnParameters[2] = leakampl;
938 for (int isamp = 0; isamp < nfit; ++isamp) {
939 gval = scaledPulse(xvec[isamp], tpulse, ypulse);
940 leakage = pulse(xvec[isamp], tleak, yleak);
941 xd = yvec0[isamp] - (gval + leakage);
942 leakchi2 = leakchi2 + (xd * xd) / (eyvec[isamp] * eyvec[isamp]);
943
944 ATH_MSG_VERBOSE ( " isamp=" << isamp
945 << " yvec0[" << isamp << "]=" << yvec0[isamp]
946 << " gval=" << gval
947 << ", leakage=" << leakage
948 << ", xd=" << xd );
949 }
950 leakchi2 = leakchi2 / (nfit - 3.0);
951
952 ATH_MSG_VERBOSE ( " leaktau=" << leaktau
953 << " leakped=" << leakped
954 << " leakampl=" << leakampl
955 << " leakchi2=" << leakchi2 );
956
957 // CIS Part C: Least-squares fit with 3 parameters for pulse+leakage
958 if (!fixedTime) {
959 m_fnParameters[0] = 0.0;
960 m_fnParameters[1] = 0.0;
961 m_fnParameters[2] = 0.0;
962 for (int isamp = 0; isamp < nfit; ++isamp) {
963 leakage = pulse(xvec[isamp], tleak, yleak);
964
965 // Subtract leakage from samples
966 yvec[isamp] = yvec0[isamp] - leakage;
967
968 ATH_MSG_VERBOSE ( " isamp=" << isamp
969 << " yvec0[" << isamp << "]=" << yvec0[isamp]
970 << " leakage=" << leakage
971 << " yvec[" << isamp << "]=" << yvec[isamp] );
972 }
973 m_fnParameters[0] = 0.0;
974 m_fnParameters[1] = 0.0;
975 m_fnParameters[2] = 1.0;
976 sy = 0.0;
977 sg = 0.0;
978 sgp = 0.0;
979 syg = 0.0;
980 sygp = 0.0;
981 sgg = 0.0;
982 sggp = 0.0;
983 sgpgp = 0.0;
984 serr = 0.0;
985 for (int isamp = 0; isamp < nfit; ++isamp) {
986 gval = scaledPulse(xvec[isamp], tpulse, ypulse);
987 gpval = derivative(xvec[isamp], tdpulse, dpulse);
988 err2 = eyvec[isamp] * eyvec[isamp];
989 sy += yvec[isamp] / err2;
990 sg += gval / err2;
991 sgp += gpval / err2;
992 syg += yvec[isamp] * gval / err2;
993 sygp += yvec[isamp] * gpval / err2;
994 sgg += gval * gval / err2;
995 sggp += gval * gpval / err2;
996 sgpgp += gpval * gpval / err2;
997 serr += 1.0 / err2;
998 }
999 dgg = sgg - sg * sg / serr;
1000 dggp = sggp - sg * sgp / serr;
1001 dgpgp = sgpgp - sgp * sgp / serr;
1002 dyg = syg - sy * sg / serr;
1003 dygp = sygp - sy * sgp / serr;
1004 dg = dgg * dgpgp - dggp * dggp;
1005
1006 if (fabs(dg) > EPS_DG) {
1007 cisampl = (dyg * dgpgp - dygp * dggp) / dg;
1008 cisatau = (dyg * dggp - dygp * dgg) / dg;
1009 cisped = (sy
1010 - (dyg * dgpgp * sg - dygp * dggp * sg + dyg * dggp * sgp - dygp * dgg * sgp) / dg)
1011 / serr;
1012
1013 if (fabs(cisampl) > EPS_DG) {
1014 cistau = cisatau / cisampl;
1015 if (cistau > m_maxTau)
1016 cistau = m_maxTau;
1017 else if (cistau < m_minTau) cistau = m_minTau;
1018 } else {
1019 cistau = 0.0;
1020 }
1021 } else {
1022 cisampl = 0.0;
1023 cisatau = 0.0;
1024 cistau = 0.0;
1025 cisped = sy / serr;
1026 }
1027
1028 if (msgLvl(MSG::VERBOSE)) {
1029 msg(MSG::VERBOSE) << " sy=" << sy
1030 << " sg=" << sg
1031 << " sgp=" << sgp
1032 << " syg=" << syg
1033 << " sygp=" << sygp
1034 << " sgg=" << sgg
1035 << " sggp=" << sggp
1036 << " sgpgp=" << sgpgp << endmsg;
1037
1038 msg(MSG::VERBOSE) << " dgg=" << dgg
1039 << " dggp=" << dggp
1040 << " sgpgp=" << sgpgp
1041 << " dyg=" << dyg
1042 << " dygp=" << dygp
1043 << " dg=" << dg << endmsg;
1044
1045 msg(MSG::VERBOSE) << " cistau=" << cistau
1046 << " cisped=" << cisped
1047 << " cisampl=" << cisampl << endmsg;
1048 }
1049
1050 // Determine Chi2 for pulse shape + leakage fit CIS Part C
1051 cischi2 = 0.0;
1052 m_fnParameters[0] = cistau;
1053 m_fnParameters[1] = cisped;
1054 m_fnParameters[2] = cisampl;
1055 for (int isamp = 0; isamp < nfit; ++isamp) {
1056 gval = scaledPulse(xvec[isamp], tpulse, ypulse);
1057 leakage = pulse(xvec[isamp], tleak, yleak);
1058 // Subtract leakage from samples
1059 yvec[isamp] = yvec0[isamp] - leakage;
1060 xd = yvec[isamp] - gval;
1061 cischi2 = cischi2 + (xd * xd) / (eyvec[isamp] * eyvec[isamp]);
1062
1063 ATH_MSG_VERBOSE( " yvec0[" << isamp << "]=" << yvec0[isamp]
1064 << " yvec[" << isamp << "]=" << yvec[isamp]
1065 << " leakage=" << leakage
1066 << " gval=" << gval
1067 << " xd=" << xd );
1068 }
1069 cischi2 = cischi2 / (nfit - 3.0);
1070
1071 ATH_MSG_VERBOSE ( " cischi2=" << cischi2 );
1072 }
1073
1074 // Determine which set of parameters to use from CIS fit methods based on minimum chi2
1075 if ((cischi2 < leakchi2) && !fixedTime) {
1076 tau = cistau;
1077 ped = cisped;
1078 ampl = cisampl;
1079 tempChi2 = cischi2;
1080 } else {
1081 tau = leaktau;
1082 ped = leakped;
1083 ampl = leakampl;
1084 tempChi2 = leakchi2;
1085 }
1086 }
1087 // End of fit for CIS events
1088
1089 else { // Physics and laser events
1090
1091 if (niter == 1) { /* For first iteration, also calculate 2-Parameter Fit
1092 for pedestal and amplitude */
1093 double t0fit_old = m_t0Fit;
1094 m_t0Fit = 0.0;
1095
1096 sy = 0.0;
1097 sg = 0.0;
1098 sgg = 0.0;
1099 syg = 0.0;
1100 serr = 0.0;
1101
1102 for (int isamp = 0; isamp < nfit; ++isamp) {
1103 if (!m_idolas) {
1104 // Use initial values for speeding up the physics events
1105 int jsamp = (int) xvec[isamp] - delta_peak;
1106 if (jsamp < 0)
1107 jsamp = 0;
1108 else if (jsamp >= nfit) jsamp = nfit - 1;
1109
1110 if (igain == 0) {
1111 gval = m_gPhysLo[jsamp];
1112 } else {
1113 gval = m_gPhysHi[jsamp];
1114 }
1115 } else {
1116 gval = scaledPulse(xvec[isamp], tpulse, ypulse);
1117 }
1118 err2 = eyvec[isamp] * eyvec[isamp];
1119 sy += yvec0[isamp] / err2;
1120 sg += gval / err2;
1121 syg += yvec0[isamp] * gval / err2;
1122 sgg += gval * gval / err2;
1123 serr += 1.0 / err2;
1124 }
1125 fixtau = 0.0;
1126 dgg0 = sg * sg - serr * sgg;
1127 if (fabs(dgg0) > EPS_DG) {
1128 fixampl = (sy * sg - serr * syg) / dgg0;
1129 fixped = (syg * sg - sy * sgg) / dgg0;
1130 ATH_MSG_VERBOSE ( " 2-par fit:"
1131 << " fixampl = " << fixampl
1132 << " fixped = " << fixped );
1133 } else {
1134 fixampl = 0.0;
1135 fixped = sy / serr;
1136 ATH_MSG_VERBOSE ( " 2-par fit:"
1137 << " small dgg0 = " << dgg0
1138 << ", fixampl = " << fixampl
1139 << " fixped = " << fixped );
1140 }
1141 m_fnParameters[0] = fixtau; /* 2-Par fit Calculate chi2 for physics events */
1142 m_fnParameters[1] = fixped;
1143 m_fnParameters[2] = fixampl;
1144 fixchi2 = 0.0;
1145 for (int isamp = 0; isamp < nfit; ++isamp) {
1146 dc = yvec0[isamp] - scaledPulse(xvec[isamp], tpulse, ypulse);
1147 fixchi2 = fixchi2 + (dc * dc) / (eyvec[isamp] * eyvec[isamp]);
1148 ATH_MSG_VERBOSE ( " isamp= " << isamp
1149 << " yvec0[" << isamp << "]= " << yvec0[isamp]
1150 << " eyvec[" << isamp << "]= " << eyvec[isamp]
1151 << " fixchi2= " << fixchi2 );
1152 }
1153 fixchi2 = fixchi2 / (nfit - 2.0);
1154 ATH_MSG_VERBOSE ( " fixchi2/(nfit-2.0)=" << fixchi2 << " nfit=" << nfit );
1155
1156 m_t0Fit = t0fit_old;
1157
1158 // restore initial parameters for pulse shape functions - to be used in 3-par fit
1159 m_fnParameters[0] = 0.0;
1160 m_fnParameters[1] = 0.0;
1161 m_fnParameters[2] = 1.0;
1162 } /* end of 2-par fit in first iteration */
1163
1164 if (fixedTime) {
1165 m_t0Fit = 0.0;
1166 tau = fixtau;
1167 ped = fixped;
1168 ampl = fixampl;
1169 tempChi2 = oldchi2 = -fabs(fixchi2);
1170 } else {
1171
1172 sy = 0.0;
1173 sg = 0.0;
1174 sgp = 0.0;
1175 syg = 0.0;
1176 sygp = 0.0;
1177 sgg = 0.0;
1178 sggp = 0.0;
1179 sgpgp = 0.0;
1180 serr = 0.0;
1181
1182 for (int isamp = 0; isamp < nfit; ++isamp) {
1183 if ((niter == 1) && (!m_idolas)) {
1184 // Use initial function values stored in array for niter=1 physics
1185 // XXX: double->int
1186 int jsamp = (int) xvec[isamp] - delta_peak;
1187 if (jsamp < 0)
1188 jsamp = 0;
1189 else if (jsamp >= nfit) jsamp = nfit - 1;
1190
1191 if (igain == 0) { // igain ==0 => low-gain
1192 gval = m_gPhysLo[jsamp];
1193 gpval = m_dgPhysLo[jsamp];
1194 } else { // must be igain==1 => high-gain
1195 gval = m_gPhysHi[jsamp];
1196 gpval = m_dgPhysHi[jsamp];
1197 }
1198 } else {
1199 // Use the respective function values
1200 gval = scaledPulse(xvec[isamp], tpulse, ypulse);
1201 gpval = derivative(xvec[isamp], tdpulse, dpulse);
1202 }
1203
1204 err2 = eyvec[isamp] * eyvec[isamp];
1205 sy += yvec0[isamp] / err2;
1206 sg += gval / err2;
1207 sgp += gpval / err2;
1208 syg += yvec0[isamp] * gval / err2;
1209 sygp += yvec0[isamp] * gpval / err2;
1210 sgg += gval * gval / err2;
1211 sggp += gval * gpval / err2;
1212 sgpgp += gpval * gpval / err2;
1213 serr += 1.0 / err2;
1214
1215 ATH_MSG_VERBOSE ( " isamp=" << isamp
1216 << " gval=" << gval
1217 << " sg=" << sg
1218 << " gpval=" << gpval
1219 << " sgp=" << sgp );
1220 }
1221
1222 dgg = sgg - sg * sg / serr;
1223 dggp = sggp - sg * sgp / serr;
1224 dgpgp = sgpgp - sgp * sgp / serr;
1225 dyg = syg - sy * sg / serr;
1226 dygp = sygp - sy * sgp / serr;
1227 dg = dgg * dgpgp - dggp * dggp;
1228
1229 // Fit for time, pedestal, and amplitude
1230 if (fabs(dg) > EPS_DG) {
1231 // Amplitude : ampl
1232 ampl = (dyg * dgpgp - dygp * dggp) / dg;
1233 // and Amplitude * time: atau
1234 atau = (dyg * dggp - dygp * dgg) / dg;
1235 // Pedestal
1236 ped = (sy - ((dyg * dgpgp - dygp * dggp) * sg + (dyg * dggp - dygp * dgg) * sgp) / dg)
1237 / serr;
1238
1239 if (fabs(ampl) > EPS_DG) {
1240 // Time
1241 tau = atau / ampl;
1242 if (tau > m_maxTau)
1243 tau = m_maxTau;
1244 else if (tau < m_minTau) tau = m_minTau;
1245 } else {
1246 tau = 0.0;
1247 }
1248 } else {
1249 ampl = 0.0;
1250 atau = 0.0;
1251 tau = 0.0;
1252 ped = sy / serr;
1253 }
1254
1255 if (msgLvl(MSG::VERBOSE)) {
1256 msg(MSG::VERBOSE) << " ped=" << ped << endmsg;
1257 msg(MSG::VERBOSE) << " sy=" << sy
1258 << " sg=" << sg
1259 << " sgp=" << sgp << endmsg;
1260
1261 msg(MSG::VERBOSE) << " syg=" << syg
1262 << " sygp=" << sygp
1263 << " sgg=" << sgg << endmsg;
1264
1265 msg(MSG::VERBOSE) << " sggp=" << sggp
1266 << " sgpgp=" << sgpgp << endmsg;
1267
1268 msg(MSG::VERBOSE) << " ampl = (dyg*dgpgp - dygp*dggp)= " << ampl << endmsg;
1269
1270 msg(MSG::VERBOSE) << " dyg=" << dyg
1271 << " dgpgp=" << dgpgp
1272 << " dyg*dgpgp=" << (dyg * dgpgp) << endmsg;
1273
1274 msg(MSG::VERBOSE) << " dygp=" << dygp
1275 << " dggp=" << dggp
1276 << " dygp*dggp=" << (dygp * dggp) << endmsg;
1277
1278 msg(MSG::VERBOSE) << " dyg=" << dyg
1279 << " dggp=" << dggp
1280 << " dyg*dggp=" << (dyg * dggp) << endmsg;
1281
1282 msg(MSG::VERBOSE) << " dygp=" << dygp
1283 << " dgg=" << dgg
1284 << " dygp*dgg=" << (dygp * dgg) << endmsg;
1285
1286 msg(MSG::VERBOSE) << " dg=" << dg
1287 << " atau=" << atau
1288 << " tau=" << tau << endmsg;
1289 }
1290
1291 m_fnParameters[0] = tau;
1292 m_fnParameters[1] = ped;
1293 m_fnParameters[2] = ampl;
1294
1295 tempChi2 = 0;
1296 // Calculate chi2 for physics and laser events
1297 for (int isamp = 0; isamp < nfit; ++isamp) {
1298 dc = yvec0[isamp] - scaledPulse(xvec[isamp], tpulse, ypulse);
1299 tempChi2 = tempChi2 + (dc * dc) / (eyvec[isamp] * eyvec[isamp]);
1300 ATH_MSG_VERBOSE ( " isamp=" << isamp
1301 << " yvec0[" << isamp << "]=" << yvec0[isamp]
1302 << " eyvec[" << isamp << "]=" << eyvec[isamp]
1303 << " dc=" << dc << " chi2=" << tempChi2 );
1304 }
1305 tempChi2 = tempChi2 / (nfit - 3.0);
1306 ATH_MSG_VERBOSE ( " chi2/(nfit-3.0)=" << tempChi2 << " nfit=" << nfit );
1307 } // end if fixedTime
1308 } // end of physics and laser specific part
1309
1310 if (msgLvl(MSG::VERBOSE))
1311 msg(MSG::VERBOSE) << " t0fit: " << m_t0Fit << ((tau < 0.0) ? " - " : " + ") << fabs(tau);
1312
1313 // avoid infinite loop at the boundary
1314 if (fabs(m_t0Fit - m_maxTime) < 0.001 && tau >= 0.0) { // trying to go outside max boudary second time
1315 m_t0Fit = fixtau + (m_minTime - fixtau) * niter / m_maxIterate; // jump to negative time
1316 if (msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) << " jumping to " << m_t0Fit << endmsg;
1317 tempChi2 = MAX_CHI2;
1318 } else if (fabs(m_t0Fit - m_minTime) < 0.001 && tau <= 0.0) { // trying to go outside min boudary second time
1319 m_t0Fit = fixtau + (m_maxTime - fixtau) * niter / m_maxIterate; // jump to positive time
1320 if (msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) << " jumping to " << m_t0Fit << endmsg;
1321 tempChi2 = MAX_CHI2;
1322 } else {
1323
1324 // Iteration with parameter for time
1325 m_t0Fit += tau;
1326 if (msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) << " = " << m_t0Fit << endmsg;
1327
1328 // Check if total time does not exceed the limits:
1329 if (m_t0Fit > m_maxTime) {
1331 tempChi2 = MAX_CHI2;
1332 } else if (m_t0Fit < m_minTime) {
1334 tempChi2 = MAX_CHI2;
1335 }
1336 }
1337
1338 // save values of the best iteration
1339 if (tempChi2 < chi2) {
1340 time = m_t0Fit;
1341 pedestal = ped;
1342 amplitude = ampl;
1343 chi2 = tempChi2;
1344 }
1345
1346 if (!fixedTime && tempChi2 < MAX_CHI2 && fabs(tau) < EPS_DG) { // too small tau
1347 if (m_t0Fit > fixtau)
1348 m_t0Fit = fixtau + (m_minTime - fixtau) * niter / m_maxIterate; // jump to negative time
1349 else
1350 m_t0Fit = fixtau + (m_maxTime - fixtau) * niter / m_maxIterate; // jump to positive time
1351
1352 ATH_MSG_VERBOSE ( " too small tau - jump to " << m_t0Fit );
1353 }
1354
1355 ATH_MSG_VERBOSE ( " iter=" << niter
1356 << " t0fit=" << m_t0Fit
1357 << " phase=" << tau
1358 << " ped=" << ped
1359 << " ampl=" << ampl
1360 << " chi2=" << tempChi2 );
1361
1362 } while (fabs(tempChi2 - oldchi2) > DELTA_CHI2 && (niter < m_maxIterate));
1363
1364 //NGO never use the 2par fit result if non-pedestal event was detected!
1365// if ((fabs(fixchi2) <= fabs(p_chi2)) &&
1366// !(m_idocis && ((m_cischan == -1) || (channel == m_cischan)))) {
1367// /* results from 2-par fit */
1368// p_time = fixtau;
1369// p_pedestal = fixped;
1370// p_amplitude = fixampl;
1371// p_chi2 = - fabs(fixchi2);
1372// }
1373
1374// TD: fit converged, now one extra iteration, leaving out the samples that
1375// are more then m_MaxTimeFromPeak ns from the peak. We want to avoid to
1376// extrapolate the pulse shape beyond the region where it is known.
1377
1378// Do it only in case when at least last sample is beyond m_MaxTimeFromPeak:
1379 if ((nfit - 1 - m_iPeak0) * DTIME > time + m_maxTimeFromPeak) {
1380
1381 ATH_MSG_VERBOSE ( "Result before last iteration:"
1382 << " Time=" << time
1383 << " Ped=" << pedestal
1384 << " Amplitude=" << amplitude
1385 << " Chi2=" << chi2);
1386
1387 m_t0Fit = time;
1388 int nfit_real;
1389
1390 // parameters for pulse shape functions
1391 // 0. phase
1392 m_fnParameters[0] = 0.0;
1393 // 1. pedestal
1394 m_fnParameters[1] = 0.0;
1395 // 2. amplitude
1396 m_fnParameters[2] = 1.0;
1397
1398 // CIS events linear fit
1399 if (m_idocis && ((m_cischan == -1) || (channel == m_cischan))) {
1400 if (!fixedTime) {
1401 ATH_MSG_VERBOSE ( "Fit time with leakage" );
1402 // CIS Part (A): fit for time using leakage pulse
1403 sllp = 0.0;
1404 sylp = 0.0;
1405 slplp = 0.0;
1406 for (int isamp = 0;
1407 (isamp < nfit) && (DTIME * (isamp - m_iPeak0) - m_t0Fit < m_maxTimeFromPeak); ++isamp) {
1408 ATH_MSG_VERBOSE ( "Lo gain leakage xvec[" << isamp << "]=" << xvec[isamp] );
1409
1410 leakage = pulse(xvec[isamp], tleak, yleak);
1411 dleakage = derivative(xvec[isamp], tdleak, dleak);
1412
1413 // Samples with pedestal subtracted
1414 yvec[isamp] = yvec0[isamp] - pedg;
1415
1416 ATH_MSG_VERBOSE ( " yvec[" << isamp << "]=" << yvec[isamp]
1417 << " yvec0[" << isamp << "]=" << yvec0[isamp]
1418 << " pedg=" << pedg );
1419
1420 sllp += leakage * dleakage;
1421 sylp += yvec[isamp] * dleakage;
1422 slplp += dleakage * dleakage;
1423 }
1424 // Also allow for fixed-time fit to CIS events
1425 if (fabs(slplp) > EPS_DG && !fixedTime) {
1426 leaktau = (sllp - sylp) / slplp;
1427 // Also have to check the range for leaktau
1428 if (leaktau > m_maxTau)
1429 leaktau = m_maxTau;
1430 else if (leaktau < m_minTau) leaktau = m_minTau;
1431 } else {
1432 leaktau = 0.0;
1433 }
1434
1435 ATH_MSG_VERBOSE ( " sllp=" << sllp
1436 << " sylp=" << sylp
1437 << " slplp=" << slplp
1438 << " leaktau=" << leaktau );
1439
1440 // CIS Part (B): using phase determined in part (A),
1441 // subtract leakage pedestal and fit for amplitude, pedestal
1442 m_fnParameters[0] = leaktau;
1443 sy = 0.0;
1444 sg = 0.0;
1445 syg = 0.0;
1446 sgg = 0.0;
1447 serr = 0.0;
1448 for (int isamp = 0;
1449 (isamp < nfit) && (DTIME * (isamp - m_iPeak0) - m_t0Fit < m_maxTimeFromPeak); ++isamp) {
1450 leakage = pulse(xvec[isamp], tleak, yleak);
1451 gval = scaledPulse(xvec[isamp], tpulse, ypulse);
1452 yvec[isamp] = yvec0[isamp] - leakage;
1453
1454 ATH_MSG_VERBOSE ( " yvec[" << isamp << "]=" << yvec[isamp]
1455 << " yvec0[" << isamp << "]=" << yvec0[isamp]
1456 << " leakage=" << leakage );
1457
1458 err2 = eyvec[isamp] * eyvec[isamp];
1459 sy += yvec[isamp] / err2;
1460 sg += gval / err2;
1461 syg += yvec[isamp] * gval / err2;
1462 sgg += gval * gval / err2;
1463 serr += 1.0 / err2;
1464 }
1465 dgg0 = sg * sg - serr * sgg;
1466 if (fabs(dgg0) > EPS_DG) {
1467 leakampl = (sy * sg - serr * syg) / dgg0;
1468 leakped = (syg * sg - sy * sgg) / dgg0;
1469 } else {
1470 leakampl = 0.0;
1471 if (serr == 0.)[[unlikely]]{
1472 ATH_MSG_ERROR("serr is zero in TileRawChannelBuilderFitFilterCool::pulseFit");
1473 return;
1474 }
1475 leakped = sy / serr;
1476 }
1477
1478 // Determine Chi2 for corresponding function for CIS leakage + pulse
1479 ATH_MSG_VERBOSE( " Determine Chi2 for CIS leakage + pulse");
1480
1481 leakchi2 = 0.0;
1482 nfit_real = 0;
1483 m_fnParameters[0] = leaktau;
1484 m_fnParameters[1] = leakped;
1485 m_fnParameters[2] = leakampl;
1486 for (int isamp = 0;
1487 (isamp < nfit) && (DTIME * (isamp - m_iPeak0) - m_t0Fit < m_maxTimeFromPeak); ++isamp) {
1488 ++nfit_real;
1489 gval = scaledPulse(xvec[isamp], tpulse, ypulse);
1490 leakage = pulse(xvec[isamp], tleak, yleak);
1491 xd = yvec0[isamp] - (gval + leakage);
1492 leakchi2 = leakchi2 + (xd * xd) / (eyvec[isamp] * eyvec[isamp]);
1493
1494 ATH_MSG_VERBOSE ( " isamp=" << isamp
1495 << " yvec0[" << isamp << "]=" << yvec0[isamp]
1496 << " gval=" << gval
1497 << ", leakage=" << leakage
1498 << ", xd=" << xd );
1499 }
1500 leakchi2 = leakchi2 / (nfit_real - 3.0);
1501
1502 ATH_MSG_VERBOSE ( " leaktau=" << leaktau
1503 << " leakped=" << leakped
1504 << " leakampl=" << leakampl
1505 << " leakchi2=" << leakchi2 );
1506
1507 // CIS Part C: Least-squares fit with 3 parameters for pulse+leakage
1508 m_fnParameters[0] = 0.0;
1509 m_fnParameters[1] = 0.0;
1510 m_fnParameters[2] = 0.0;
1511 for (int isamp = 0;
1512 (isamp < nfit) && (DTIME * (isamp - m_iPeak0) - m_t0Fit < m_maxTimeFromPeak); ++isamp) {
1513
1514 leakage = pulse(xvec[isamp], tleak, yleak);
1515
1516 // Subtract leakage from samples
1517 yvec[isamp] = yvec0[isamp] - leakage;
1518
1519 ATH_MSG_VERBOSE ( " isamp=" << isamp
1520 << " yvec0[" << isamp << "]=" << yvec0[isamp]
1521 << " leakage=" << leakage
1522 << " yvec[" << isamp << "]=" << yvec[isamp] );
1523 }
1524 m_fnParameters[0] = 0.0;
1525 m_fnParameters[1] = 0.0;
1526 m_fnParameters[2] = 1.0;
1527 sy = 0.0;
1528 sg = 0.0;
1529 sgp = 0.0;
1530 syg = 0.0;
1531 sygp = 0.0;
1532 sgg = 0.0;
1533 sggp = 0.0;
1534 sgpgp = 0.0;
1535 serr = 0.0;
1536 for (int isamp = 0;
1537 (isamp < nfit) && (DTIME * (isamp - m_iPeak0) - m_t0Fit < m_maxTimeFromPeak); ++isamp) {
1538 gval = scaledPulse(xvec[isamp], tpulse, ypulse);
1539 gpval = derivative(xvec[isamp], tdpulse, dpulse);
1540 err2 = eyvec[isamp] * eyvec[isamp];
1541 sy += yvec[isamp] / err2;
1542 sg += gval / err2;
1543 sgp += gpval / err2;
1544 syg += yvec[isamp] * gval / err2;
1545 sygp += yvec[isamp] * gpval / err2;
1546 sgg += gval * gval / err2;
1547 sggp += gval * gpval / err2;
1548 sgpgp += gpval * gpval / err2;
1549 serr += 1.0 / err2;
1550 }
1551 if (serr == 0) serr = 1;
1552 dgg = sgg - sg * sg / serr;
1553 dggp = sggp - sg * sgp / serr;
1554 dgpgp = sgpgp - sgp * sgp / serr;
1555 dyg = syg - sy * sg / serr;
1556 dygp = sygp - sy * sgp / serr;
1557 dg = dgg * dgpgp - dggp * dggp;
1558
1559 if (fabs(dg) > EPS_DG) {
1560 cisampl = (dyg * dgpgp - dygp * dggp) / dg;
1561 cisatau = (dyg * dggp - dygp * dgg) / dg;
1562 cisped = (sy
1563 - (dyg * dgpgp * sg - dygp * dggp * sg + dyg * dggp * sgp - dygp * dgg * sgp) / dg)
1564 / serr;
1565
1566 if (fabs(cisampl) > EPS_DG) {
1567 cistau = cisatau / cisampl;
1568 if (cistau > m_maxTau)
1569 cistau = m_maxTau;
1570 else if (cistau < m_minTau) cistau = m_minTau;
1571 } else {
1572 cistau = 0.0;
1573 }
1574 } else {
1575 cisampl = 0.0;
1576 cisatau = 0.0;
1577 cistau = 0.0;
1578 cisped = sy / serr;
1579 }
1580
1581 if (msgLvl(MSG::VERBOSE)) {
1582 msg(MSG::VERBOSE) << " sy=" << sy
1583 << " sg=" << sg
1584 << " sgp=" << sgp
1585 << " syg=" << syg
1586 << " sygp=" << sygp
1587 << " sgg=" << sgg
1588 << " sggp=" << sggp
1589 << " sgpgp=" << sgpgp << endmsg;
1590
1591 msg(MSG::VERBOSE) << " dgg=" << dgg
1592 << " dggp=" << dggp
1593 << " sgpgp=" << sgpgp
1594 << " dyg=" << dyg
1595 << " dygp=" << dygp
1596 << " dg=" << dg << endmsg;
1597
1598 msg(MSG::VERBOSE) << " cistau=" << cistau
1599 << " cisped=" << cisped
1600 << " cisampl=" << cisampl << endmsg;
1601 }
1602
1603 // Determine Chi2 for pulse shape + leakage fit CIS
1604 cischi2 = 0.0;
1605 nfit_real = 0;
1606 m_fnParameters[0] = cistau;
1607 m_fnParameters[1] = cisped;
1608 m_fnParameters[2] = cisampl;
1609 for (int isamp = 0;
1610 (isamp < nfit) && (DTIME * (isamp - m_iPeak0) - m_t0Fit < m_maxTimeFromPeak); ++isamp) {
1611 ++nfit_real;
1612 gval = scaledPulse(xvec[isamp], tpulse, ypulse);
1613 leakage = pulse(xvec[isamp], tleak, yleak);
1614 // Subtract leakage from samples
1615 yvec[isamp] = yvec0[isamp] - leakage;
1616 xd = yvec[isamp] - gval;
1617 cischi2 = cischi2 + (xd * xd) / (eyvec[isamp] * eyvec[isamp]);
1618
1619 ATH_MSG_VERBOSE ( " yvec0[" << isamp << "]=" << yvec0[isamp]
1620 << " yvec[" << isamp << "]=" << yvec[isamp]
1621 << " leakage=" << leakage
1622 << " gval=" << gval
1623 << " xd=" << xd );
1624 }
1625 cischi2 = cischi2 / (nfit_real - 3.0);
1626
1627 ATH_MSG_VERBOSE ( " cischi2=" << cischi2 );
1628
1629 // Determine which set of parameters to use from CIS fit methods based on minimum chi2
1630 if ((cischi2 < leakchi2) && !fixedTime) {
1631 tau = cistau;
1632 ped = cisped;
1633 ampl = cisampl;
1634 tempChi2 = cischi2;
1635 } else {
1636 tau = leaktau;
1637 ped = leakped;
1638 ampl = leakampl;
1639 tempChi2 = leakchi2;
1640 }
1641 // End of fit for CIS events
1642 }
1643 } else { // Physics and laser events
1644 if (!fixedTime) {
1645
1646 // restore initial parameters for pulse shape functions - to be used in 3-par fit
1647 m_fnParameters[0] = 0.0;
1648 m_fnParameters[1] = 0.0;
1649 m_fnParameters[2] = 1.0;
1650
1651 sy = 0.0;
1652 sg = 0.0;
1653 sgp = 0.0;
1654 syg = 0.0;
1655 sygp = 0.0;
1656 sgg = 0.0;
1657 sggp = 0.0;
1658 sgpgp = 0.0;
1659 serr = 0.0;
1660
1661 for (int isamp = 0;
1662 (isamp < nfit) && (DTIME * (isamp - m_iPeak0) - m_t0Fit < m_maxTimeFromPeak); ++isamp) {
1663 // Use the respective function values
1664 gval = scaledPulse(xvec[isamp], tpulse, ypulse);
1665 gpval = derivative(xvec[isamp], tdpulse, dpulse);
1666
1667 err2 = eyvec[isamp] * eyvec[isamp];
1668 sy += yvec0[isamp] / err2;
1669 sg += gval / err2;
1670 sgp += gpval / err2;
1671 syg += yvec0[isamp] * gval / err2;
1672 sygp += yvec0[isamp] * gpval / err2;
1673 sgg += gval * gval / err2;
1674 sggp += gval * gpval / err2;
1675 sgpgp += gpval * gpval / err2;
1676 serr += 1.0 / err2;
1677
1678 ATH_MSG_VERBOSE ( " isamp=" << isamp
1679 << " gval=" << gval
1680 << " sg=" << sg
1681 << " gpval=" << gpval
1682 << " sgp=" << sgp );
1683 }
1684
1685 dgg = sgg - sg * sg / serr;
1686 dggp = sggp - sg * sgp / serr;
1687 dgpgp = sgpgp - sgp * sgp / serr;
1688 dyg = syg - sy * sg / serr;
1689 dygp = sygp - sy * sgp / serr;
1690 dg = dgg * dgpgp - dggp * dggp;
1691
1692 // Fit for time, pedestal, and amplitude
1693 if (fabs(dg) > EPS_DG) {
1694 // Amplitude : ampl
1695 ampl = (dyg * dgpgp - dygp * dggp) / dg;
1696 // and Amplitude * time: atau
1697 atau = (dyg * dggp - dygp * dgg) / dg;
1698 // Pedestal
1699 ped = (sy - ((dyg * dgpgp - dygp * dggp) * sg + (dyg * dggp - dygp * dgg) * sgp) / dg)
1700 / serr;
1701
1702 if (fabs(ampl) > EPS_DG) {
1703 // Time
1704 tau = atau / ampl;
1705 if (tau > m_maxTau)
1706 tau = m_maxTau;
1707 else if (tau < m_minTau) tau = m_minTau;
1708 } else {
1709 tau = 0.0;
1710 }
1711 } else {
1712 ampl = 0.0;
1713 atau = 0.0;
1714 tau = 0.0;
1715 ped = sy / serr;
1716 }
1717
1718 if (msgLvl(MSG::VERBOSE)) {
1719 msg(MSG::VERBOSE) << " ped=" << ped << endmsg;
1720 msg(MSG::VERBOSE) << " sy=" << sy
1721 << " sg=" << sg
1722 << " sgp=" << sgp << endmsg;
1723
1724 msg(MSG::VERBOSE) << " syg=" << syg
1725 << " sygp=" << sygp
1726 << " sgg=" << sgg << endmsg;
1727
1728 msg(MSG::VERBOSE) << " sggp=" << sggp
1729 << " sgpgp=" << sgpgp << endmsg;
1730
1731 msg(MSG::VERBOSE) << " ampl = (dyg*dgpgp - dygp*dggp)= " << ampl << endmsg;
1732 msg(MSG::VERBOSE) << " dyg=" << dyg
1733 << " dgpgp=" << dgpgp
1734 << " dyg*dgpgp=" << (dyg * dgpgp) << endmsg;
1735
1736 msg(MSG::VERBOSE) << " dygp=" << dygp
1737 << " dggp=" << dggp
1738 << " dygp*dggp=" << (dygp * dggp) << endmsg;
1739
1740 msg(MSG::VERBOSE) << " dyg=" << dyg
1741 << " dggp=" << dggp
1742 << " dyg*dggp=" << (dyg * dggp) << endmsg;
1743
1744 msg(MSG::VERBOSE) << " dygp=" << dygp
1745 << " dgg=" << dgg
1746 << " dygp*dgg=" << (dygp * dgg) << endmsg;
1747
1748 msg(MSG::VERBOSE) << " dg=" << dg
1749 << " atau=" << atau
1750 << " tau=" << tau << endmsg;
1751 }
1752
1753 m_fnParameters[0] = tau;
1754 m_fnParameters[1] = ped;
1755 m_fnParameters[2] = ampl;
1756
1757 tempChi2 = 0;
1758 nfit_real = 0;
1759 // Calculate chi2 for physics and laser events
1760 for (int isamp = 0;
1761 (isamp < nfit) && (DTIME * (isamp - m_iPeak0) - m_t0Fit < m_maxTimeFromPeak); ++isamp) {
1762 ++nfit_real;
1763 dc = yvec0[isamp] - scaledPulse(xvec[isamp], tpulse, ypulse);
1764 tempChi2 = tempChi2 + (dc * dc) / (eyvec[isamp] * eyvec[isamp]);
1765 ATH_MSG_VERBOSE ( " isamp=" << isamp
1766 << " yvec0[" << isamp << "]=" << yvec0[isamp]
1767 << " eyvec[" << isamp << "]=" << eyvec[isamp]
1768 << " dc=" << dc
1769 << " chi2=" << tempChi2 );
1770 }
1771 tempChi2 = tempChi2 / (nfit_real - 3.0);
1772 ATH_MSG_VERBOSE ( " chi2/(nfit_real-3.0)=" << tempChi2
1773 << " nfit_real=" << nfit_real );
1774 } // end if fixedTime
1775 } // end of physics and laser specific part
1776
1777 if (msgLvl(MSG::VERBOSE))
1778 msg(MSG::VERBOSE) << " t0fit: " << m_t0Fit << ((tau < 0.0) ? " - " : " + ") << fabs(tau);
1779 // Iteration with parameter for time
1780 m_t0Fit += tau;
1781 ATH_MSG_VERBOSE ( " = " << m_t0Fit );
1782
1783 // Check if total time does not exceed the limits:
1784 if (m_t0Fit > m_maxTime) {
1786 tempChi2 = MAX_CHI2;
1787 } else if (m_t0Fit < m_minTime) {
1789 tempChi2 = MAX_CHI2;
1790 }
1791
1792 if (tempChi2 < MAX_CHI2) {
1793 time = m_t0Fit;
1794 pedestal = ped;
1795 amplitude = ampl;
1796 chi2 = tempChi2;
1797 } // otherwise using the previous iteration
1798
1799 } // end if to use extra iteration
1800
1801 ATH_MSG_VERBOSE ( "Result:"
1802 << " Time=" << time
1803 << " Ped=" << pedestal
1804 << " Amplitude=" << amplitude
1805 << " Chi2=" << chi2 );
1806}
#define SATURATED_ADC_VALUE
#define MAX_SAMPLES
#define EPS_DG
#define DELTA_CHI2
#define MAX_CHI2
double derivative(double x, const std::vector< double > *xvec, const std::vector< double > *yvec) const
double chi2(TH1 *h0, TH1 *h1)
time(flags, cells_name, *args, **kw)
#define unlikely(x)

◆ rawChannel()

TileRawChannel * TileRawChannelBuilderFitFilterCool::rawChannel ( const TileDigits * digits,
const EventContext & ctx )
overridevirtual

Builder virtual method to be implemented by subclasses.

Parameters
digitsPointer to TileDigitsContainer

Reimplemented from TileRawChannelBuilder.

Definition at line 521 of file TileRawChannelBuilderFitFilterCool.cxx.

521 {
522
523 ++m_chCounter;
524
525 const HWIdentifier adcId = digits->adc_HWID();
526
527 ATH_MSG_VERBOSE ( "Running FitFilter for TileRawChannel with HWID "
528 << m_tileHWID->to_string(adcId) );
529
530 // tmp variables for filtering
531 double amplitude = 0.0;
532 double chi2 = 0.0;
533 double time = 0.0;
534 double pedestal = 0.0;
535
536 // use fit filter
537 pulseFit(digits, amplitude, time, pedestal, chi2, ctx);
538
539 unsigned int drawerIdx(0), channel(0), adc(0);
540 m_tileIdTransforms->getIndices(adcId, drawerIdx, channel, adc);
541
542 // fit filter calib
543 // note that when called from TileROD_Decoder, m_calibrateEnergy is set
544 // from TileROD_Decoder...
545 if (m_calibrateEnergy) {
546 amplitude = m_tileToolEmscale->doCalibCis(drawerIdx, channel, adc, amplitude);
547 }
548
549 ATH_MSG_VERBOSE ( "Creating RawChannel"
550 << " a=" << amplitude
551 << " t=" << time
552 << " q=" << chi2
553 << " ped=" << pedestal );
554
555 // return new TileRawChannel
556 // TileRawChannel *rawCh = new TileRawChannel(adcId,amplitude,time,chi2,pedestal);
557
558 DataPool<TileRawChannel> tileRchPool(m_dataPoollSize);
559 TileRawChannel *rawCh = tileRchPool.nextElementPtr();
560 rawCh->assign (adcId,
561 amplitude,
562 time,
563 chi2,
564 pedestal);
565
566 if (m_correctTime && chi2 > 0) {
567 time -= m_tileToolTiming->getSignalPhase(drawerIdx, channel, adc);
568 rawCh->insertTime(time);
569 ATH_MSG_VERBOSE ( "Correcting time, new time=" << rawCh->time() );
570
571 }
572
573 int gain = m_tileHWID->adc(adcId);
574 if (TileID::HIGHGAIN == gain) {
575 ++m_nChH;
576 m_RChSumH += amplitude;
577 } else {
578 ++m_nChL;
579 m_RChSumL += amplitude;
580 }
581
582 return rawCh;
583}
void pulseFit(const TileDigits *digit, double &amplitude, double &time, double &pedestal, double &chi2, const EventContext &ctx)
Calculate energy, time and chi2 for one channel using fitted pulse shape.
ToolHandle< TileCondToolTiming > m_tileToolTiming
Gaudi::Property< int > m_dataPoollSize
Gaudi::Property< bool > m_correctTime
ToolHandle< TileCondIdTransforms > m_tileIdTransforms
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
Gaudi::Property< bool > m_calibrateEnergy
void assign(const HWIdentifier &id, float amplitude, float time, float quality, float ped=0.0)
void insertTime(float time)
float time(int ind=0) const

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ resetDrawer()

void TileRawChannelBuilder::resetDrawer ( )
inherited

Definition at line 28 of file TileRawChannelBuilder.cxx.

28 {
29 m_lastDrawer = -1;
30 m_badDrawer = false;
31}

◆ resetOverflows()

void TileRawChannelBuilder::resetOverflows ( void )
inherited

Definition at line 33 of file TileRawChannelBuilder.cxx.

33 {
34 m_overflows.clear();
35}

◆ scaledPulse()

double TileRawChannelBuilderFitFilterCool::scaledPulse ( double x,
const std::vector< double > * xvec,
const std::vector< double > * yvec ) const
inlineprivate

Definition at line 83 of file TileRawChannelBuilderFitFilterCool.h.

83 {
84 return m_fnParameters[1] + m_fnParameters[2] * pulse(x, xvec, yvec, false);
85 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, and AthCheckedComponent<::AthAlgTool >.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_ADCmaskValueMinusEps

float TileRawChannelBuilder::m_ADCmaskValueMinusEps {0.f}
protectedinherited

indicates channels which were masked in background dataset

Definition at line 225 of file TileRawChannelBuilder.h.

225{0.f};

◆ m_ADCmaxMinusEps

float TileRawChannelBuilder::m_ADCmaxMinusEps {0.f}
protectedinherited

Definition at line 224 of file TileRawChannelBuilder.h.

224{0.f};

◆ m_ampMinThresh

Gaudi::Property<float> TileRawChannelBuilder::m_ampMinThresh
protectedinherited
Initial value:
{this, "AmpMinForAmpCorrection", 15.0,
"Correct amplitude if it's above amplitude threshold (in ADC counts)"}

Definition at line 152 of file TileRawChannelBuilder.h.

152 {this, "AmpMinForAmpCorrection", 15.0,
153 "Correct amplitude if it's above amplitude threshold (in ADC counts)"};

◆ m_badDrawer

bool TileRawChannelBuilder::m_badDrawer {false}
protectedinherited

Definition at line 213 of file TileRawChannelBuilder.h.

213{false};

◆ m_bsflags

unsigned int TileRawChannelBuilder::m_bsflags {0}
protectedinherited

Definition at line 138 of file TileRawChannelBuilder.h.

138{0};

◆ m_cabling

const TileCablingService* TileRawChannelBuilder::m_cabling {nullptr}
protectedinherited

TileCabling instance.

Definition at line 185 of file TileRawChannelBuilder.h.

185{nullptr};

◆ m_cablingSvc

ServiceHandle<TileCablingSvc> TileRawChannelBuilder::m_cablingSvc
protectedinherited
Initial value:
{ this,
"TileCablingSvc", "TileCablingSvc", "The Tile cabling service"}

Name of Tile cabling service.

Definition at line 182 of file TileRawChannelBuilder.h.

182 { this,
183 "TileCablingSvc", "TileCablingSvc", "The Tile cabling service"};

◆ m_calibrateEnergy

Gaudi::Property<bool> TileRawChannelBuilder::m_calibrateEnergy {this, "calibrateEnergy", false, "Calibrate energy"}
protectedinherited

Definition at line 142 of file TileRawChannelBuilder.h.

142{this, "calibrateEnergy", false, "Calibrate energy"};

◆ m_capdaq

double TileRawChannelBuilder::m_capdaq {100.}
protectedinherited

Definition at line 196 of file TileRawChannelBuilder.h.

196{100.}; // Capacitor

◆ m_channelNoiseRMS

Gaudi::Property<int> TileRawChannelBuilderFitFilterCool::m_channelNoiseRMS {this, "RMSChannelNoise", 3, "Which channel noise RMS to use"}
private

Definition at line 112 of file TileRawChannelBuilderFitFilterCool.h.

112{this, "RMSChannelNoise", 3, "Which channel noise RMS to use"};

◆ m_chCounter

unsigned int TileRawChannelBuilder::m_chCounter {0}
protectedinherited

Definition at line 199 of file TileRawChannelBuilder.h.

199{0};

◆ m_cischan

int TileRawChannelBuilder::m_cischan {-1}
protectedinherited

Definition at line 195 of file TileRawChannelBuilder.h.

195{-1}; // which channel is fired by CIS

◆ m_correctTime

Gaudi::Property<bool> TileRawChannelBuilder::m_correctTime {this, "correctTime", false, "Correct time"}
protectedinherited

Definition at line 145 of file TileRawChannelBuilder.h.

145{this, "correctTime", false, "Correct time"};

◆ m_dataPoollSize

Gaudi::Property<int> TileRawChannelBuilder::m_dataPoollSize {this, "DataPoolSize", -1, "Data pool size"}
protectedinherited

Definition at line 207 of file TileRawChannelBuilder.h.

207{this, "DataPoolSize", -1, "Data pool size"};

◆ m_demoFragIDs

Gaudi::Property<std::vector<int> > TileRawChannelBuilder::m_demoFragIDs
protectedinherited
Initial value:
{this,
"DemoFragIDs", {}, "List of Tile frag IDs with new electronics (demonstrator)"}

Definition at line 187 of file TileRawChannelBuilder.h.

187 {this,
188 "DemoFragIDs", {}, "List of Tile frag IDs with new electronics (demonstrator)"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_dgPhysHi

std::vector<double> TileRawChannelBuilderFitFilterCool::m_dgPhysHi
private

Definition at line 108 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_dgPhysLo

std::vector<double> TileRawChannelBuilderFitFilterCool::m_dgPhysLo
private

Definition at line 106 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_DQstatusKey

SG::ReadHandleKey<TileDQstatus> TileRawChannelBuilder::m_DQstatusKey
protectedinherited
Initial value:
{this, "TileDQstatus",
"TileDQstatus",
"TileDQstatus key"}

Definition at line 120 of file TileRawChannelBuilder.h.

120 {this, "TileDQstatus",
121 "TileDQstatus",
122 "TileDQstatus key"};

◆ m_DSPContainerKey

SG::ReadHandleKey<TileRawChannelContainer> TileRawChannelBuilder::m_DSPContainerKey {this, "DSPContainer", "", "DSP Container key"}
protectedinherited

Definition at line 125 of file TileRawChannelBuilder.h.

126{this, "DSPContainer", "", "DSP Container key"};

◆ m_dummy

std::vector<double> TileRawChannelBuilderFitFilterCool::m_dummy
private

Definition at line 91 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_error

int TileRawChannelBuilder::m_error[MAX_CHANNELS]
protectedinherited

Definition at line 211 of file TileRawChannelBuilder.h.

◆ m_evtCounter

unsigned int TileRawChannelBuilder::m_evtCounter {0}
protectedinherited

Definition at line 198 of file TileRawChannelBuilder.h.

198{0};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_extraSamplesLeft

Gaudi::Property<int> TileRawChannelBuilderFitFilterCool::m_extraSamplesLeft {this, "ExtraSamplesLeft", 0, "Increase window on left side"}
private

Definition at line 114 of file TileRawChannelBuilderFitFilterCool.h.

114{this, "ExtraSamplesLeft", 0, "Increase window on left side"};

◆ m_extraSamplesRight

Gaudi::Property<int> TileRawChannelBuilderFitFilterCool::m_extraSamplesRight {this, "ExtraSamplesRight", 0, "Increase window on right side"}
private

Definition at line 115 of file TileRawChannelBuilderFitFilterCool.h.

115{this, "ExtraSamplesRight", 0, "Increase window on right side"};

◆ m_f_ADCmax

float TileRawChannelBuilder::m_f_ADCmax {0.f}
protectedinherited

Definition at line 221 of file TileRawChannelBuilder.h.

221{0.f};

◆ m_f_ADCmaxPlus1

float TileRawChannelBuilder::m_f_ADCmaxPlus1 {0.f}
protectedinherited

Definition at line 223 of file TileRawChannelBuilder.h.

223{0.f};

◆ m_firstSample

Gaudi::Property<int> TileRawChannelBuilder::m_firstSample {this, "FirstSample", 0, "First sample to start with the analysis"}
protectedinherited

Definition at line 140 of file TileRawChannelBuilder.h.

140{this, "FirstSample", 0, "First sample to start with the analysis"};

◆ m_fnParameters

double TileRawChannelBuilderFitFilterCool::m_fnParameters[3] {}
private

Definition at line 97 of file TileRawChannelBuilderFitFilterCool.h.

97{};

◆ m_frameLength

Gaudi::Property<int> TileRawChannelBuilderFitFilterCool::m_frameLength {this, "FrameLength", 9, "Frame length (number of samples)"}
private

Definition at line 111 of file TileRawChannelBuilderFitFilterCool.h.

111{this, "FrameLength", 9, "Frame length (number of samples)"};

◆ m_gPhysHi

std::vector<double> TileRawChannelBuilderFitFilterCool::m_gPhysHi
private

Definition at line 107 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_gPhysLo

std::vector<double> TileRawChannelBuilderFitFilterCool::m_gPhysLo
private

Definition at line 105 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_i_ADCmax

int TileRawChannelBuilder::m_i_ADCmax {0}
protectedinherited

Definition at line 220 of file TileRawChannelBuilder.h.

220{0};

◆ m_i_ADCmaxPlus1

int TileRawChannelBuilder::m_i_ADCmaxPlus1 {0}
protectedinherited

Definition at line 222 of file TileRawChannelBuilder.h.

222{0};

◆ m_idocis

bool TileRawChannelBuilder::m_idocis {false}
protectedinherited

Definition at line 194 of file TileRawChannelBuilder.h.

194{false}; // CIS fitting

◆ m_idolas

bool TileRawChannelBuilder::m_idolas {false}
protectedinherited

Definition at line 192 of file TileRawChannelBuilder.h.

192{false}; // Laser fitting

◆ m_idoped

bool TileRawChannelBuilder::m_idoped {false}
protectedinherited

Definition at line 193 of file TileRawChannelBuilder.h.

193{false}; // Ped run, phys fitting

◆ m_idophys

bool TileRawChannelBuilder::m_idophys {false}
protectedinherited

Definition at line 191 of file TileRawChannelBuilder.h.

191{false}; // Phys fitting

◆ m_infoName

Gaudi::Property<std::string> TileRawChannelBuilder::m_infoName {this, "TileInfoName", "TileInfo", "Name of TileInfo object"}
protectedinherited

Definition at line 218 of file TileRawChannelBuilder.h.

218{this, "TileInfoName", "TileInfo", "Name of TileInfo object"};

◆ m_iPeak0

int TileRawChannelBuilderFitFilterCool::m_iPeak0
private

Definition at line 98 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_lastDrawer

int TileRawChannelBuilder::m_lastDrawer {-1}
protectedinherited

Definition at line 212 of file TileRawChannelBuilder.h.

212{-1};

◆ m_maxIterate

Gaudi::Property<int> TileRawChannelBuilderFitFilterCool::m_maxIterate {this, "MaxIterate", 9, "Maximum number of fit iterations"}
private

Definition at line 113 of file TileRawChannelBuilderFitFilterCool.h.

113{this, "MaxIterate", 9, "Maximum number of fit iterations"};

◆ m_maxTau

double TileRawChannelBuilderFitFilterCool::m_maxTau
private

Definition at line 102 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_maxTime

double TileRawChannelBuilderFitFilterCool::m_maxTime
private

Definition at line 100 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_maxTimeFromPeak

Gaudi::Property<double> TileRawChannelBuilderFitFilterCool::m_maxTimeFromPeak
private
Initial value:
{this, "MaxTimeFromPeak", 250.0,
"Max time for fitting the pulse shapes. Samples with t>t0+MaxTimeFromPeak are not fitted"}

Definition at line 127 of file TileRawChannelBuilderFitFilterCool.h.

127 {this, "MaxTimeFromPeak", 250.0,
128 "Max time for fitting the pulse shapes. Samples with t>t0+MaxTimeFromPeak are not fitted"};

◆ m_minTau

double TileRawChannelBuilderFitFilterCool::m_minTau
private

Definition at line 101 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_minTime

double TileRawChannelBuilderFitFilterCool::m_minTime
private

Definition at line 99 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_nChH

int TileRawChannelBuilder::m_nChH {0}
protectedinherited

Definition at line 202 of file TileRawChannelBuilder.h.

202{0};

◆ m_nChL

int TileRawChannelBuilder::m_nChL {0}
protectedinherited

Definition at line 201 of file TileRawChannelBuilder.h.

201{0};

◆ m_noiseFilterTools

ToolHandleArray<ITileRawChannelTool> TileRawChannelBuilder::m_noiseFilterTools
protectedinherited
Initial value:
{this,
"NoiseFilterTools", {}, "Tile noise filter tools"}

Definition at line 166 of file TileRawChannelBuilder.h.

166 {this,
167 "NoiseFilterTools", {}, "Tile noise filter tools"};

◆ m_noiseHigh

Gaudi::Property<double> TileRawChannelBuilderFitFilterCool::m_noiseHigh {this, "NoiseHighGain", 1.5, "Default high gain noise"}
private

Definition at line 133 of file TileRawChannelBuilderFitFilterCool.h.

133{this, "NoiseHighGain", 1.5, "Default high gain noise"};

◆ m_noiseLow

Gaudi::Property<double> TileRawChannelBuilderFitFilterCool::m_noiseLow {this, "NoiseLowGain", 0.6, "Default low gain noise"}
private

Definition at line 131 of file TileRawChannelBuilderFitFilterCool.h.

131{this, "NoiseLowGain", 0.6, "Default low gain noise"};

◆ m_noiseThresholdRMS

Gaudi::Property<double> TileRawChannelBuilderFitFilterCool::m_noiseThresholdRMS
private
Initial value:
{this, "NoiseThresholdRMS", 3.0,
"For pedestal-like events only 2-parametric fit is applied"}

Definition at line 124 of file TileRawChannelBuilderFitFilterCool.h.

124 {this, "NoiseThresholdRMS", 3.0,
125 "For pedestal-like events only 2-parametric fit is applied"};

◆ m_notUpgradeCabling

bool TileRawChannelBuilder::m_notUpgradeCabling {true}
protectedinherited

Definition at line 215 of file TileRawChannelBuilder.h.

215{true};

◆ m_overflows

Overflows_t TileRawChannelBuilder::m_overflows
protectedinherited

Definition at line 206 of file TileRawChannelBuilder.h.

◆ m_pulseShapes

const TilePulseShapesStruct* TileRawChannelBuilderFitFilterCool::m_pulseShapes
private

Definition at line 136 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_rawChannelCnt

std::unique_ptr<TileMutableRawChannelContainer> TileRawChannelBuilder::m_rawChannelCnt
protectedinherited

Definition at line 133 of file TileRawChannelBuilder.h.

◆ m_rawChannelContainerKey

SG::WriteHandleKey<TileRawChannelContainer> TileRawChannelBuilder::m_rawChannelContainerKey
protectedinherited
Initial value:
{this,"TileRawChannelContainer","TileRawChannelFiltered",
"Output Tile raw channels container key"}

Definition at line 129 of file TileRawChannelBuilder.h.

129 {this,"TileRawChannelContainer","TileRawChannelFiltered",
130 "Output Tile raw channels container key"};

◆ m_RChSumH

double TileRawChannelBuilder::m_RChSumH {0.}
protectedinherited

Definition at line 204 of file TileRawChannelBuilder.h.

204{0.};

◆ m_RChSumL

double TileRawChannelBuilder::m_RChSumL {0.}
protectedinherited

Definition at line 203 of file TileRawChannelBuilder.h.

203{0.};

◆ m_rChType

TileFragHash::TYPE TileRawChannelBuilder::m_rChType {TileFragHash::Default}
protectedinherited

Definition at line 136 of file TileRawChannelBuilder.h.

◆ m_rChUnit

TileRawChannelUnit::UNIT TileRawChannelBuilder::m_rChUnit {TileRawChannelUnit::ADCcounts}
protectedinherited

Definition at line 137 of file TileRawChannelBuilder.h.

◆ m_runType

Gaudi::Property<int> TileRawChannelBuilder::m_runType {this, "RunType", 0, "Run type used to override value of trigType in event"}
protectedinherited

Definition at line 160 of file TileRawChannelBuilder.h.

160{this, "RunType", 0, "Run type used to override value of trigType in event"};

◆ m_saturatedSampleError

Gaudi::Property<double> TileRawChannelBuilderFitFilterCool::m_saturatedSampleError
private
Initial value:
{this, "SaturatedSampleError", 6.0,
"Error in terms of RMS assigned to the saturated sample"}

Definition at line 118 of file TileRawChannelBuilderFitFilterCool.h.

118 {this, "SaturatedSampleError", 6.0,
119 "Error in terms of RMS assigned to the saturated sample"};

◆ m_shapes

TilePulseShapesStruct* TileRawChannelBuilderFitFilterCool::m_shapes
private

Definition at line 153 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_t0Fit

double TileRawChannelBuilderFitFilterCool::m_t0Fit
private

Definition at line 94 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_tileHWID

const TileHWID* TileRawChannelBuilder::m_tileHWID {nullptr}
protectedinherited

Definition at line 164 of file TileRawChannelBuilder.h.

164{nullptr};

◆ m_tileID

const TileID* TileRawChannelBuilder::m_tileID {nullptr}
protectedinherited

Definition at line 163 of file TileRawChannelBuilder.h.

163{nullptr};

◆ m_tileIdTransforms

ToolHandle<TileCondIdTransforms> TileRawChannelBuilder::m_tileIdTransforms
protectedinherited
Initial value:
{this,
"TileCondIdTransforms", "TileCondIdTransforms",
"Tile tool to tranlate hardware identifier to the drawerIdx, channel, and adc"}

Definition at line 175 of file TileRawChannelBuilder.h.

175 {this,
176 "TileCondIdTransforms", "TileCondIdTransforms",
177 "Tile tool to tranlate hardware identifier to the drawerIdx, channel, and adc"};

◆ m_tileInfo

const TileInfo* TileRawChannelBuilder::m_tileInfo {nullptr}
protectedinherited

Definition at line 219 of file TileRawChannelBuilder.h.

219{nullptr};

◆ m_tileToolEmscale

ToolHandle<TileCondToolEmscale> TileRawChannelBuilder::m_tileToolEmscale
protectedinherited
Initial value:
{this,
"TileCondToolEmscale", "TileCondToolEmscale", "Tile EM scale calibration tool"}

Definition at line 169 of file TileRawChannelBuilder.h.

169 {this,
170 "TileCondToolEmscale", "TileCondToolEmscale", "Tile EM scale calibration tool"};

◆ m_tileToolLeak100Shape

ToolHandle<TileCondToolPulseShape> TileRawChannelBuilderFitFilterCool::m_tileToolLeak100Shape
private
Initial value:
{this,
"TileCondToolLeak100Shape", "", "Tile CIS leakage shape for 100 pF capacitor tool"}

Definition at line 141 of file TileRawChannelBuilderFitFilterCool.h.

141 {this,
142 "TileCondToolLeak100Shape", "", "Tile CIS leakage shape for 100 pF capacitor tool"};

◆ m_tileToolLeak5p2Shape

ToolHandle<TileCondToolPulseShape> TileRawChannelBuilderFitFilterCool::m_tileToolLeak5p2Shape
private
Initial value:
{this,
"TileCondToolLeak5p2Shape", "", "Tile CIS leakage shape for 5.2 pF capacitor tool"}

Definition at line 144 of file TileRawChannelBuilderFitFilterCool.h.

144 {this,
145 "TileCondToolLeak5p2Shape", "", "Tile CIS leakage shape for 5.2 pF capacitor tool"};

◆ m_tileToolNoiseSample

ToolHandle<TileCondToolNoiseSample> TileRawChannelBuilderFitFilterCool::m_tileToolNoiseSample
private
Initial value:
{this,
"TileCondToolNoiseSample", "TileCondToolNoiseSample", "Tile sample noise tool"}

Definition at line 150 of file TileRawChannelBuilderFitFilterCool.h.

150 {this,
151 "TileCondToolNoiseSample", "TileCondToolNoiseSample", "Tile sample noise tool"};

◆ m_tileToolPulse5p2Shape

ToolHandle<TileCondToolPulseShape> TileRawChannelBuilderFitFilterCool::m_tileToolPulse5p2Shape
private
Initial value:
{this,
"TileCondToolPulse5p2Shape", "", "Tile CIS pulse shape for 5.2 pF capacitor tool"}

Definition at line 147 of file TileRawChannelBuilderFitFilterCool.h.

147 {this,
148 "TileCondToolPulse5p2Shape", "", "Tile CIS pulse shape for 5.2 pF capacitor tool"};

◆ m_tileToolPulseShape

ToolHandle<TileCondToolPulseShape> TileRawChannelBuilderFitFilterCool::m_tileToolPulseShape
private
Initial value:
{this,
"TileCondToolPulseShape", "TileCondToolPulseShape", "Tile pulse shape tool"}

Definition at line 138 of file TileRawChannelBuilderFitFilterCool.h.

138 {this,
139 "TileCondToolPulseShape", "TileCondToolPulseShape", "Tile pulse shape tool"};

◆ m_tileToolTiming

ToolHandle<TileCondToolTiming> TileRawChannelBuilder::m_tileToolTiming
protectedinherited
Initial value:
{this,
"TileCondToolTiming", "TileCondToolTiming", "Tile timing tool"}

Definition at line 172 of file TileRawChannelBuilder.h.

172 {this,
173 "TileCondToolTiming", "TileCondToolTiming", "Tile timing tool"};

◆ m_timeMaxThresh

Gaudi::Property<float> TileRawChannelBuilder::m_timeMaxThresh
protectedinherited
Initial value:
{this, "TimeMaxForAmpCorrection", 12.5,
"Correct amplitude if time is below time max threshold"}

Definition at line 156 of file TileRawChannelBuilder.h.

156 {this, "TimeMaxForAmpCorrection", 12.5,
157 "Correct amplitude if time is below time max threshold"};

◆ m_timeMinThresh

Gaudi::Property<float> TileRawChannelBuilder::m_timeMinThresh
protectedinherited
Initial value:
{this, "TimeMinForAmpCorrection", -12.5,
"Correct amplitude if time is above time min threshold"}

Definition at line 154 of file TileRawChannelBuilder.h.

154 {this, "TimeMinForAmpCorrection", -12.5,
155 "Correct amplitude if time is above time min threshold"};

◆ m_trigType

int TileRawChannelBuilder::m_trigType {0}
protectedinherited

Definition at line 190 of file TileRawChannelBuilder.h.

190{0};

◆ m_useDSP

Gaudi::Property<bool> TileRawChannelBuilder::m_useDSP {this, "UseDSPCorrection", true, "Use DSP noise correction for incomplete containers"}
protectedinherited

Definition at line 149 of file TileRawChannelBuilder.h.

149{this, "UseDSPCorrection", true, "Use DSP noise correction for incomplete containers"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 386 of file AthCommonDataStore.h.

◆ m_zeroSampleError

Gaudi::Property<double> TileRawChannelBuilderFitFilterCool::m_zeroSampleError
private
Initial value:
{this, "ZeroSampleError", 100.0,
"Error in terms of RMS assigned to the zero sample (== 0)"}

Definition at line 121 of file TileRawChannelBuilderFitFilterCool.h.

121 {this, "ZeroSampleError", 100.0,
122 "Error in terms of RMS assigned to the zero sample (== 0)"};

◆ MAX_CHANNELS

const int TileRawChannelBuilder::MAX_CHANNELS = 48
staticprotectedinherited

Definition at line 209 of file TileRawChannelBuilder.h.

◆ MAX_DMUS

const int TileRawChannelBuilder::MAX_DMUS = 16
staticprotectedinherited

Definition at line 210 of file TileRawChannelBuilder.h.


The documentation for this class was generated from the following files: