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 TileRawChannelrawChannel (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_tgetOverflowedChannels (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< TileDQstatusm_DQstatusKey
SG::ReadHandleKey< TileRawChannelContainerm_DSPContainerKey {this, "DSPContainer", "", "DSP Container key"}
SG::WriteHandleKey< TileRawChannelContainerm_rawChannelContainerKey
std::unique_ptr< TileMutableRawChannelContainerm_rawChannelCnt
TileFragHash::TYPE m_rChType
TileRawChannelUnit::UNIT m_rChUnit
unsigned int m_bsflags
int m_firstSample
bool m_calibrateEnergy
bool m_correctTime
bool m_useDSP
float m_ampMinThresh
 correct amplitude if it's above amplitude threshold (in ADC counts)
float m_timeMinThresh
 correct amplitude is time is above time min threshold
float m_timeMaxThresh
 correct amplitude is time is below time max threshold
int m_runType
const TileIDm_tileID
const TileHWIDm_tileHWID
ToolHandleArray< ITileRawChannelToolm_noiseFilterTools
ToolHandle< TileCondToolEmscalem_tileToolEmscale
ToolHandle< TileCondToolTimingm_tileToolTiming
ToolHandle< TileCondIdTransformsm_tileIdTransforms
ServiceHandle< TileCablingSvcm_cablingSvc
 Name of Tile cabling service.
const TileCablingServicem_cabling
 TileCabling instance.
Gaudi::Property< std::vector< int > > m_demoFragIDs
int m_trigType
bool m_idophys
bool m_idolas
bool m_idoped
bool m_idocis
int m_cischan
double m_capdaq
unsigned int m_evtCounter
unsigned int m_chCounter
int m_nChL
int m_nChH
double m_RChSumL
double m_RChSumH
Overflows_t m_overflows
int m_dataPoollSize
int m_error [MAX_CHANNELS]
int m_lastDrawer = -1
bool m_badDrawer = false
bool m_notUpgradeCabling
std::string m_infoName
const TileInfom_tileInfo
int m_i_ADCmax
float m_f_ADCmax
int m_i_ADCmaxPlus1
float m_f_ADCmaxPlus1
float m_ADCmaxMinusEps
float m_ADCmaskValueMinusEps
 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< StoreGateSvcStoreGateSvc_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
int m_frameLength
int m_channelNoiseRMS
int m_maxIterate
int m_extraSamplesLeft
int m_extraSamplesRight
double m_saturatedSampleError
double m_zeroSampleError
double m_noiseThresholdRMS
double m_maxTimeFromPeak
double m_noiseLow
double m_noiseHigh
const TilePulseShapesStructm_pulseShapes
ToolHandle< TileCondToolPulseShapem_tileToolPulseShape
ToolHandle< TileCondToolPulseShapem_tileToolLeak100Shape
ToolHandle< TileCondToolPulseShapem_tileToolLeak5p2Shape
ToolHandle< TileCondToolPulseShapem_tileToolPulse5p2Shape
ToolHandle< TileCondToolNoiseSamplem_tileToolNoiseSample
TilePulseShapesStructm_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 388 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
60 //declare properties
61 declareProperty("FrameLength", m_frameLength = 9);
62 declareProperty("MaxIterate", m_maxIterate = 9);
63 declareProperty("NoiseLowGain", m_noiseLow = 0.6);
64 declareProperty("NoiseHighGain", m_noiseHigh = 1.5);
65 declareProperty("RMSChannelNoise", m_channelNoiseRMS = 3);
66 declareProperty("ExtraSamplesLeft", m_extraSamplesLeft=0); // increase window on left side
67 declareProperty("ExtraSamplesRight", m_extraSamplesRight=0); // increase window on right side
68 declareProperty("SaturatedSampleError", m_saturatedSampleError = 6.0);
69 declareProperty("ZeroSampleError", m_zeroSampleError = 100.0);
70 declareProperty("NoiseThresholdRMS", m_noiseThresholdRMS = 3.0);
71 declareProperty("MaxTimeFromPeak", m_maxTimeFromPeak = 250.0);
72}
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
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 77 of file TileRawChannelBuilderFitFilterCool.cxx.

77 {
78 if (m_shapes) delete m_shapes;
79}

Member Function Documentation

◆ BadPatternName()

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

Definition at line 458 of file TileRawChannelBuilder.cxx.

458 {
459 static const char * const errname[26] = {
460 "-10 - good signal",
461 "-9 - underflow",
462 "-8 - overflow",
463 "-7 - underflow and overflow",
464 "-6 - constant signal",
465 "-5 - disconnected channel",
466 "-4 - half a drawer masked",
467 "-3 - bad DQ status",
468 "-2 - underflow in all samples",
469 "-1 - overflow in all samples",
470 "0 - unknown error",
471 "1 - jump from zero to saturation",
472 "2 - samples with zeros",
473 "3 - at least two saturated. others - close to pedestal",
474 "4 - two distinct levels with at least 2 samples each",
475 "5 - pedestal with jump up in one sample",
476 "6 - pedestal with jump down in one sample",
477 "7 - signal with jump up in one sample",
478 "8 - signal with jump down in one sample",
479 "9 - base line above threshold in low gain",
480 "10 - jump down in first sample in low gain",
481 "11 - jump down in last sample in low gain",
482 "12 - jump up in one sample above const",
483 "13 - jump down in one sample below const",
484 "14 - unrecoverable timing jump",
485 "15 - unknown error"
486 };
487
488 return errname[std::min(25, std::max(0, int((ped + 500) * 1e-4)))];
489}

◆ build()

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

Definition at line 492 of file TileRawChannelBuilder.cxx.

493{
494
495 int frag = coll->identify();
496
497 // make sure that error array is up-to-date
498 if (frag != m_lastDrawer && m_notUpgradeCabling) {
499 fill_drawer_errors(ctx, coll);
500 }
501
502 // Iterate over all digits in this collection
503 TileDigitsCollection::const_iterator digitItr = coll->begin();
504 TileDigitsCollection::const_iterator lastDigit = coll->end();
505
506 for (; digitItr != lastDigit; ++digitItr) {
507
508 TileRawChannel* rch = rawChannel((*digitItr), ctx);
509
511
512 int err = m_error[m_tileHWID->channel(rch->adc_HWID())];
513
514 if (err) {
515 if (err == -8 || err == -7) m_overflows.push_back(std::make_pair(rch, (*digitItr)));
516 float ped = rch->pedestal() + 100000 + 10000 * err;
517 rch->setPedestal(ped);
518 if (msgLvl(MSG::VERBOSE) && !m_badDrawer) {
519 if (err < -5) {
520 msg(MSG::VERBOSE) << "BadCh " << m_tileHWID->to_string(rch->adc_HWID())
521 << " warning = " << BadPatternName(ped) << endmsg;
522 } else {
523 msg(MSG::VERBOSE) << "BadCh " << m_tileHWID->to_string(rch->adc_HWID())
524 << " error = " << BadPatternName(ped) << endmsg;
525 }
526 }
527 }
528
529 }
530
531 ATH_CHECK( m_rawChannelCnt->push_back (rch) );
532 }
533
534 IdentifierHash hash = m_rawChannelCnt->hashFunc().hash(coll->identify());
535 TileRawChannelCollection* rawChannelCollection = m_rawChannelCnt->indexFindPtr(hash);
536 rawChannelCollection->setLvl1Id(coll->getLvl1Id());
537 rawChannelCollection->setLvl1Type(coll->getLvl1Type());
538 rawChannelCollection->setDetEvType(coll->getDetEvType());
539 rawChannelCollection->setRODBCID(coll->getRODBCID());
540
541 return StatusCode::SUCCESS;
542}
#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:838
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 544 of file TileRawChannelBuilder.cxx.

545{
546
547 const TileDQstatus* DQstatus = SG::makeHandle (m_DQstatusKey, ctx).get();
548
549 ToolHandleArray<ITileRawChannelTool>::iterator itrTool = m_noiseFilterTools.begin();
550 ToolHandleArray<ITileRawChannelTool>::iterator endTool = m_noiseFilterTools.end();
551
552 if ( m_useDSP && !m_DSPContainerKey.key().empty() &&
553 (DQstatus->incompleteDigits() || m_chCounter<12288) && itrTool!=endTool )
554 {
555 const TileRawChannelContainer * dspCnt = SG::makeHandle (m_DSPContainerKey, ctx).get();
556 ATH_MSG_DEBUG( "Incomplete container - use noise filter corrections from DSP container" );
557
558 uint32_t bsFlags = dspCnt->get_bsflags();
559 std::vector<IdentifierHash> hashes = m_rawChannelCnt->GetAllCurrentHashes();
560 std::vector<IdentifierHash> dspHashes = dspCnt->GetAllCurrentHashes();
561 if (bsFlags == 0) {
562 ATH_MSG_WARNING("Problem in applying noise corrections: DSP container ("
563 << m_DSPContainerKey.key() << ") seems to be emtpy!");
564 } else if (hashes != dspHashes) {
565 ATH_MSG_ERROR( " Error in applying noise corrections; "
566 "hash vectors do not match.");
567 } else {
568 // Go through all TileRawChannelCollections
569 for (IdentifierHash hash : hashes) {
570 TileRawChannelCollection* coll = m_rawChannelCnt->indexFindPtr (hash);
571 const TileRawChannelCollection* dcoll = dspCnt->indexFindPtr (hash);
572
573 if (coll->identify() != dcoll->identify()) {
574
575 ATH_MSG_ERROR( " Error in applying noise corrections " << MSG::hex
576 << " collection IDs 0x" << coll->identify() << " and 0x" << dcoll->identify()
577 << " do not match " << MSG::dec );
578 break;
579 }
580
581 // iterate over all channels in a collection
584
585 for (TileRawChannel* rch : *coll) {
586 HWIdentifier adc_id = rch->adc_HWID();
587 while (dspItr != dspLast && adc_id != (*dspItr)->adc_HWID()) {
588 ++dspItr;
589 }
590 if (dspItr != dspLast) {
591 float corr = (*dspItr)->pedestal();
592 ATH_MSG_VERBOSE( "Ch "<<m_tileHWID->to_string(adc_id)
593 <<" amp " << rch->amplitude() << " ped " << rch->pedestal()
594 << " corr " << corr );
595 if (corr<10000.) {
596 rch->setAmplitude (rch->amplitude() - corr); // just baseline shift
597 rch->setPedestal (rch->pedestal() + corr); // just baseline shift
598 } else {
599 float ped = rch->pedestal();
600 if (corr > ped) {
601 rch->setPedestal (fmod(ped,10000.) + int(corr)/10000 * 10000); // changing error status
602 ATH_MSG_VERBOSE( "New error status in ped "<<rch->pedestal());
603 }
604 }
605 } else {
606 ATH_MSG_WARNING(" Problem in applying noise corrections "
607 << " can not find channel in DSP container with HWID "
608 << m_tileHWID->to_string(adc_id) );
609 dspItr = dcoll->begin();
610 }
611 }
612 }
613 }
614
615 } else {
616
617 for (ToolHandle<ITileRawChannelTool>& noiseFilterTool : m_noiseFilterTools) {
618 if (noiseFilterTool->process(*m_rawChannelCnt.get(), ctx).isFailure()) {
619 ATH_MSG_ERROR( " Error status returned from noise filter " );
620 } else {
621 ATH_MSG_DEBUG( "Noise filter applied to the container" );
622 }
623 }
624
625 }
626
627 ATH_MSG_DEBUG( " nCh=" << m_chCounter
628 << " nChH/L=" << m_nChH << "/" << m_nChL
629 << " RChSumH/L=" << m_RChSumH << "/" << m_RChSumL );
630
631 SG::WriteHandle<TileRawChannelContainer> rawChannelsContainer(m_rawChannelContainerKey, ctx);
632 ATH_CHECK( rawChannelsContainer.record(std::move(m_rawChannelCnt)) );
633
634 endLog();
635
636 return StatusCode::SUCCESS;
637}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(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).
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 646 of file TileRawChannelBuilder.cxx.

646 {
647
648 double corr = 1.0;
649 if (of2) {
650 // estimation from Belen for rel 14.0.0
651 /*double a,b,c;
652 if(fabs(phase)<5.){
653 a=0.137; b=0.0877; c=0.0865;
654 }else{
655 a=0.565; b=0.116; c=0.0751;
656 }
657 corr=(1+(a+b*phase+c*phase*phase)/100.);
658 */
659
660 // estimation from Vakhtang for rel 14.4.0
661 /*double k = (phase < 0.0 ? 0.0009400 : 0.0010160);
662 corr = (1.0 + k * phase * phase);
663 */
664
665 // Parabolic correction from Tigran
666 double a1,a2,b,c;
667 a1 = phase < 0.0 ? 0.000940774 : 0.00102111;
668 a2 = phase < 0.0 ? 0.000759051 : 0.000689625;
669 b = phase < 0.0 ? -2.0 * 7.0 * (a1 - a2) : 2.0 * 12.5 * (a1 - a2);
670 c = phase < 0.0 ? 1.0 - 7.0 * 7.0 * (a1-a2) : 1.0 - 12.5 * 12.5 * (a1-a2);
671 if (phase < 12.5 && phase > -7.0) corr = a1 * phase * phase + 1.0;
672 else corr = phase * ( a2 * phase + b) + c;
673
674
675 } else {
676 /*double a,b,c;
677 if(phase<0){
678 a=1.0002942; b=0.0003528; c=0.0005241;
679 }else{
680 a=1.0001841; b=-0.0004182; c=0.0006167;
681 }
682 corr = a + phase * ( b + c * phase);
683 */
684
685 /*double k = (phase < 0.0 ? 0.0005241 : 0.0006167);
686 corr = (1.0 + k * phase * phase);
687 */
688
689 // 4th degree polynomial correction from Tigran
690 double k1 = (phase < 0.0 ? -0.0000326707:0.000380336);
691 double k2 = (phase < 0.0 ? -0.000560962:-0.000670487);
692 double k3 = (phase < 0.0 ? -0.00000807869:0.00000501773);
693 double k4 = (phase < 0.0 ? -0.000000145008:0.0000000584647);
694
695 corr = 1.0 / (1.0 + (k1 + (k2 + (k3 + k4 *phase)*phase)*phase)*phase);
696
697
698 }
699
700 return corr;
701}

◆ correctTime()

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

Time correction factor.

Definition at line 705 of file TileRawChannelBuilder.cxx.

705 {
706
707 double correction = 0.0;
708
709 if (of2) {
710 if(phase < 0) {
711 correction = (-0.00695743 + (0.0020673 - (0.0002976 + 0.00000361305 * phase) * phase) * phase) * phase;
712 } else {
713 correction = (0.0130013 + (0.00128769 + (-0.000550218 + 0.00000755344 * phase) * phase) * phase) * phase;
714 }
715 }
716 // OF1 does not need correction
717
718 return correction;
719}
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 723 of file TileRawChannelBuilder.cxx.

724 {
725 bool eb = (ros > 2);
726 bool ebsp = ((ros == 3 && drawer == 14) || (ros == 4 && drawer == 17));
727 bool empty = ((eb && ((channel > 23 && channel < 30) || channel > 41)) || (ebsp && channel < 3));
728 bool not_gap = !(empty || (eb && (channel == 0 || channel == 1 || channel == 12 || channel == 13))
729 || (ebsp && (channel == 18 || channel == 19)));
730
731 const float epsilon = 4.1; // allow +/- 2 counts fluctuations around const value
732 const float delta[4] = { 29.9, 29.9, 49.9, 99.9 }; // jump levels between constLG, constHG, non-constLG, non-constHG
733 const float level1 = 99.9; // jump from this level to m_i_ADCmax is bad
734 const float level2 = 149.9; // base line at this level in low gain is bad
735 const float narrowLevel[2] = { 29.9, 49.9 }; // minimal amplitude for narrow pulses
736 const float delt = std::min(std::min(std::min(delta[0], delta[1]), std::min(delta[2], delta[3])),
737 std::min(narrowLevel[0], narrowLevel[1]));
738 const float secondMaxLevel = 0.3;
739
740 int error = 0;
741
742 unsigned int nSamp = digits.size();
743 if (nSamp) {
744 dmin = dmax = digits[0];
745 unsigned int pmin = 0;
746 unsigned int pmax = 0;
747 unsigned int nzero = (dmin < 0.01) ? 1 : 0;
748 unsigned int nover = (dmax > ADCmaxMinusEps) ? 1 : 0;
749
750 for (unsigned int i = 1; i < nSamp; ++i) {
751 float dig = digits[i];
752 if (dig > dmax) {
753 dmax = dig;
754 pmax = i;
755 } else if (dig < dmin) {
756 dmin = dig;
757 pmin = i;
758 }
759 if (dig < 0.01) ++nzero;
760 else if (dig > ADCmaxMinusEps) ++nover;
761 }
762
763 float dmaxmin = dmax - dmin;
764 //std::cout << " ros " << ros << " drawer " << drawer << " channel " << channel << " not_gap " << not_gap << " nzero " << nzero << " nover " << nover << std::endl;
765
766 if (dmin > ADCmaxMinusEps) { // overflow in all samples
767 error = (dmin > ADCmaskValueMinusEps) ? -3 : -1; // dmin=m_tileInfo->ADCmaskValue() - masking in overlay job (set in TileDigitsMaker)
768
769 } else if (dmax < 0.01) { // underflow in all samples
770 error = (empty) ? -5 : -2; // set different type of errors for exsiting and non-existing channels
771
772 } else if (dmaxmin < 0.01) { // constant value in all samples
773 error = -6;
774
775 } else if (nzero && nover) { // jump from zero to saturation
776 error = 1;
777
778 } else if ((nzero && (not_gap || empty)) || nzero > 1) { // one sample at zero in normal channel
779 error = 2; // or 2 samples at zero in gap/crack/MBTS
780
781 } else if (gain == 0 && dmin > level2) { // baseline above threshold in low gain is bad
782 error = 9;
783
784 } else if (dmaxmin > delt) { // check that max-min is above minimal allowed jump
785
786 float abovemin = dmax;
787 float belowmax = dmin;
788 unsigned int nmin = 0;
789 unsigned int nmax = 0;
790 for (unsigned int i = 0; i < nSamp; ++i) {
791 float smp = digits[i];
792 if (smp - dmin < epsilon) {
793 ++nmin;
794 }
795 if (dmax - smp < epsilon) {
796 ++nmax;
797 }
798 if (smp < abovemin && smp > dmin) {
799 abovemin = smp;
800 }
801 if (smp > belowmax && smp < dmax) {
802 belowmax = smp;
803 }
804 }
805 // more than two different values - shift index by 2, i.e. use thresholds for non-const levels
806 int gainInd = (abovemin != dmax || belowmax != dmin) ? gain + 2 : gain;
807 bool big_jump = (dmaxmin > delta[gainInd]);
808 bool max_in_middle = (pmax > 0 && pmax < nSamp - 1);
809 bool min_in_middle = (pmin > 0 && pmin < nSamp - 1);
810
811 if (nover > 1 && belowmax < level1) { // at least two saturated. others - close to pedestal
812 error = 3;
813 } else if (nmax + nmin == nSamp && big_jump) {
814 if (nmax > 1 && nmin > 1) { // at least 2 samples at two distinct levels
815 error = 4;
816 } else if (nmax == 1) {
817 if (max_in_middle) { // jump up in one sample, but not at the edge
818 error = 5;
819 }
820 } else if (nmin == 1) { // jump down in one sample
821 error = 6;
822 }
823 }
824 if (error == 0 && dmaxmin > narrowLevel[gain]) {
825 float secondMax = dmaxmin * secondMaxLevel;
826 float dminPlus = dmin + secondMax;
827 float dmaxMinus = dmax - secondMax;
828 if (not_gap) { // jumps above two (or one) neighbour samples
829 if (max_in_middle && std::max(digits[pmax - 1], digits[pmax + 1]) < dminPlus) {
830 error = 7; // jump up in one sample in the middle, which is much higher than two neighbours
831 } else if (min_in_middle && std::min(digits[pmin - 1], digits[pmin + 1]) > dmaxMinus) {
832 error = 8; // jump down in one sample, which is much lower than two neighbours
833 } else if (big_jump && gain == 0) { // check first and last sample only in low gain
834 if (pmin == 0 && digits[1] > dmax - secondMax) {
835 error = 10; // jump down in first sample. which is much lower than next one
836 } else if (pmin == nSamp - 1 && digits[pmin - 1] > dmax - secondMax) {
837 error = 11; // jump down in last sample. which is much lower than previous one
838 }
839 }
840 }
841 if (!error && big_jump) { // jumps above all samples
842 if ((max_in_middle || gain == 0) && nmax == 1 && belowmax < dminPlus) {
843 error = 12; // jump up in one sample in the middle, which is much higher than all others
844 } else if ((min_in_middle || gain == 0) && nmin == 1 && abovemin > dmaxMinus) {
845 error = 13; // jump down in one sample, which is much lower than all others (
846 }
847 }
848 }
849 }
850
851 } else {
852 dmin = dmax = 0.0;
853 }
854
855 return error;
856}
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 233 of file TileRawChannelBuilder.cxx.

233 {
234 initLog(ctx);
235
236 // create TRC container
237 m_rawChannelCnt = std::make_unique<TileMutableRawChannelContainer>(true, m_rChType, m_rChUnit, SG::VIEW_ELEMENTS);
238 ATH_CHECK( m_rawChannelCnt->status() );
239 m_rawChannelCnt->set_bsflags(m_bsflags);
240
241 ATH_MSG_DEBUG( "Created TileRawChannelContainer '" << m_rawChannelContainerKey.key() << "'" );
242
243 return StatusCode::SUCCESS;
244}
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 }

◆ 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 639 of file TileRawChannelBuilder.cxx.

639 {
640 m_chCounter = 0;
641 m_nChL = m_nChH = 0;
642 m_RChSumL = m_RChSumH = 0.0;
643
644}

◆ 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 300 of file TileRawChannelBuilder.cxx.

302{
303 const TileDQstatus* DQstatus = SG::makeHandle (m_DQstatusKey, ctx).get();
304
305 int frag = coll->identify();
306 int ros = (frag >> 8);
307 int drawer = (frag & 0xff);
308
309 m_lastDrawer = frag;
310
311 memset(m_error, 0, sizeof(m_error));
312 int dmuerr[MAX_DMUS] = {0};
313 int nch = 0;
314 bool bigain = DQstatus->isBiGain();
315 if (!bigain) { // in bigain runs we don't have DQ status fragment
316 for (int ch = 0; ch < MAX_CHANNELS; ch += 3) {
317 if (!DQstatus->isAdcDQgood(ros, drawer, ch, 0)) {
318 m_error[ch + 2] = m_error[ch + 1] = m_error[ch] = -3;
319 dmuerr[ch / 3] = 3;
320 nch += 3;
321 }
322 }
323 }
324 if (nch == MAX_CHANNELS) { // all bad - nothing to do
325 m_badDrawer = true;
326 ATH_MSG_VERBOSE( "Drawer 0x" << MSG::hex << frag << MSG::dec
327 << " is bad - skipping bad patterns check " );
328 return;
329 } else {
330 m_badDrawer = false;
331 ATH_MSG_VERBOSE( "Drawer 0x" << MSG::hex << frag << MSG::dec
332 << " looking for bad patterns in digits" );
333 }
334
335 float mindig, maxdig;
336 int nchbad[2] = { 0, 0 };
337
338 // Iterate over all digits in this collection
339 TileDigitsCollection::const_iterator digitItr = coll->begin();
340 TileDigitsCollection::const_iterator lastDigit = coll->end();
341
342 for (; digitItr != lastDigit; ++digitItr) {
343 const TileDigits * pDigits = (*digitItr);
344 HWIdentifier adcId = pDigits->adc_HWID();
345 int channel = m_tileHWID->channel(adcId);
346 int gain = m_tileHWID->adc(adcId);
347
348 if (m_error[channel]) {
349 ATH_MSG_VERBOSE( "BadCh " << ros
350 << "/" << drawer
351 << "/" << channel
352 << "/" << gain << " BAD DQ STATUS ");
353
354 } else {
355
356 int err = CorruptedData(ros, drawer, channel, gain, pDigits->samples(), mindig, maxdig, m_ADCmaxMinusEps, m_ADCmaskValueMinusEps);
357
358 if (err) {
359
361 if (err > -5) {
362 ++dmuerr[channel / 3];
363 ++nchbad[channel / 24];
364 }
365
366 if (msgLvl(MSG::VERBOSE)) {
367
368 msg(MSG::VERBOSE) << "BadCh " << ros
369 << "/" << drawer
370 << "/" << channel
371 << "/" << gain;
372 if (err < -5) msg(MSG::VERBOSE) << " Warning " << err;
373 else msg(MSG::VERBOSE) << " Error " << err;
374 if (mindig > m_ADCmaskValueMinusEps) msg(MSG::VERBOSE) << " BADDQ";
375 if (maxdig > m_ADCmaxMinusEps) msg(MSG::VERBOSE) << " Overflow";
376 if (mindig < 0.1) msg(MSG::VERBOSE) << " Underflow";
377 if (err < 0) msg(MSG::VERBOSE) << " Const";
378
379 msg(MSG::VERBOSE) << " samp=";
380 std::vector<float> digits = pDigits->samples();
381 for (unsigned int i = 0; i < digits.size(); ++i) {
382 msg(MSG::VERBOSE) << " " << digits[i];
383 }
384 msg(MSG::VERBOSE) << endmsg;
385 }
386
387 } else {
388 if (mindig < 0.01) err += 1;
389 if (maxdig > m_ADCmaxMinusEps) err += 2;
390 if (err) m_error[channel] = err - 10;
391 }
392 }
393 }
394
395 // check if we want to mask half a drawer
396 // in this case set error = -4 for channels which were good before
397
398 int ndmubad[2] = { 0, 0 };
399 int dmu = 0;
400 for (; dmu < MAX_DMUS / 2; ++dmu) { // first half
401 if (dmuerr[dmu] > 1)
402 ++ndmubad[0]; // count DMUs with at least two bad channels
403 }
404 for (; dmu < MAX_DMUS; ++dmu) { // second half
405 if (dmuerr[dmu] > 1)
406 ++ndmubad[1]; // count DMUs with at least two bad channels
407 }
408
409 int ndmulimit[2] = { 3, 3 }; // max number of bad DMUs when half-drawer is not yet masked
410 // if 4 DMUs will be bad - mask whole half-drawer
411 if (frag > 0x2ff) { // if extended barrel
412 if (frag == 0x30e || frag == 0x411)
413 ndmulimit[0] = 4; // in EB special one DMU is always bad (missing)
414 ndmulimit[1] = 5; // in second half of EB 4 DMUs ara always bad (missing)
415 // only if 7 DMUs are bad, mask whole half-drawer
416 }
417
418 bool printall = true;
419 for (int p = 0; p < 2; ++p) {
420 if (ndmubad[p] > ndmulimit[p] && nchbad[p] > 0) {
421 if (msgLvl(MSG::VERBOSE)) {
422 msg(MSG::VERBOSE) << "Drawer 0x" << MSG::hex << frag << MSG::dec
423 << " masking whole " << ((p) ? "second" : "first")
424 << " half" << endmsg;
425 if (printall) {
426 msg(MSG::VERBOSE) << "nDMuErr ";
427 for (int d = 0; d < MAX_DMUS; ++d) {
428 msg(MSG::VERBOSE) << " " << dmuerr[d];
429 }
430 msg(MSG::VERBOSE) << " total " << ndmubad[p] << " errors" << endmsg;
431
432 msg(MSG::VERBOSE) << "ChErr ";
433 int ch = 0;
434 while (ch < MAX_CHANNELS-2) {
435 msg(MSG::VERBOSE) << " " << m_error[ch++];
436 msg(MSG::VERBOSE) << " " << m_error[ch++];
437 msg(MSG::VERBOSE) << " " << m_error[ch++];
438 msg(MSG::VERBOSE) << " ";
439 }
440
441 msg(MSG::VERBOSE) << " total " << nchbad[p]
442 << " bad patterns" << endmsg;
443 printall = false;
444 }
445 }
446 int ch = (p) ? MAX_CHANNELS / 2 : 0;
447 int chmax = (p) ? MAX_CHANNELS : MAX_CHANNELS / 2;
448 for (; ch < chmax; ++ch) {
449 if (m_error[ch] == 0 || m_error[ch] < -5) { // channel was good before
450 m_error[ch] = -4;
451 }
452 }
453 }
454 }
455
456}
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 527 of file TileRawChannelBuilderFitFilterCool.cxx.

527 {
528
529 ATH_MSG_DEBUG( "Finalizing" );
530
531 return StatusCode::SUCCESS;
532}

◆ getOverflowedChannels()

Overflows_t & TileRawChannelBuilder::getOverflowedChannels ( void )
inherited

Definition at line 38 of file TileRawChannelBuilder.cxx.

38 {
39 return m_overflows;
40}

◆ getTileRawChannelContainerID()

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

Definition at line 42 of file TileRawChannelBuilder.cxx.

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

◆ handle()

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

Definition at line 164 of file TileRawChannelBuilderFitFilterCool.cxx.

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

◆ initialize()

StatusCode TileRawChannelBuilderFitFilterCool::initialize ( )
overridevirtual

Initializer.

Reimplemented from TileRawChannelBuilder.

Definition at line 84 of file TileRawChannelBuilderFitFilterCool.cxx.

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

246 {
247
248 const TileDQstatus* DQstatus = SG::makeHandle (m_DQstatusKey, ctx).get();
249
250 // update only if there is new event
251 if (m_evtCounter != ctx.evt()) {
252
253 m_evtCounter = ctx.evt();
254 if (m_runType != 0) m_trigType = m_runType;
255 else m_trigType = DQstatus->trigType();
256
257 if (0 == m_trigType) {
258 m_idophys = (DQstatus->calibMode() == 0);
259 m_idolas = false;
260 m_idoped = false;
261 m_idocis = (DQstatus->calibMode() == 1);
262 } else {
263 m_idophys = (m_trigType <= 1);
264 m_idolas = ((m_trigType == 2) || (m_trigType == 3));
265 m_idoped = ((m_trigType == 4) || (m_trigType == 5));
266 m_idocis = ((m_trigType == 8) || (m_trigType == 9));
267 }
268
269 const unsigned int *cispar = DQstatus->cispar();
270 if (0 == cispar[7]) { // if capdaq not set, it can't be CIS event
271 if (m_idocis) { // cis flag was set incorrectly, change to ped
272 m_idoped = true;
273 m_idocis = false;
274 }
275 m_capdaq = 0.0;
276 } else {
277 m_capdaq = (cispar[7] < 10) ? 5.2 : 100.0;
278 }
279 m_cischan = cispar[8] - 1; // channel where CIS is fired (-1 = all channels)
280
281 ATH_MSG_DEBUG( "Trig type is " << m_trigType
282 << "; dophys is " << ((m_idophys) ? "true" : "false")
283 << "; dolas is " << ((m_idolas) ? "true" : "false")
284 << "; doped is " << ((m_idoped) ? "true" : "false")
285 << "; docis is " << ((m_idocis) ? "true" : "false")
286 << "; capacitor is " << m_capdaq
287 << "; cis chan is " << m_cischan );
288 }
289}
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 1821 of file TileRawChannelBuilderFitFilterCool.cxx.

1822 {
1823
1824 int size1 = xvec->size() - 1;
1825 if (size1 < 1) return 0.0;
1826
1827 const double delta = 1.e-6;
1828
1829 double xpmin = xvec->at(0);
1830 double xpmax = xvec->at(size1);
1831
1832 double xp = (x - m_iPeak0) * DTIME - m_t0Fit - m_fnParameters[0];
1833
1834 double val = 0.0;
1835 double tdiv = (xpmax - xpmin) / size1;
1836
1837 if (xp < xpmin + delta) {
1838 if (zeroOutside && xp < xpmin - delta)
1839 val = 0.0;
1840 else
1841 val = yvec->at(0);
1842#ifdef EXTRAPOLATE_TO_ZERO
1843 if (xp < xpmin - delta && val != 0.0) {
1844 double newval = val + ((yvec->at(1) - val) / tdiv) * (xp - xpmin);
1845 if (val * newval < 0.0) {
1846 val = 0.0;
1847 } else if (fabs(newval) < fabs(val)) {
1848 val = newval;
1849 }
1850 }
1851#endif
1852 } else if (xp > xpmax - delta) {
1853 if (zeroOutside && xp > xpmax + delta)
1854 val = 0.0;
1855 else
1856 val = yvec->at(size1);
1857#ifdef EXTRAPOLATE_TO_ZERO
1858 if (xp > xpmax + delta && val != 0.0) {
1859 double newval = val + ((yvec->at(size1 - 1) - val) / tdiv) * (xp - xpmax);
1860 if (val * newval < 0.0) {
1861 val = 0.0;
1862 } else if (fabs(newval) < fabs(val)) {
1863 val = newval;
1864 }
1865 }
1866#endif
1867 } else {
1868 int j = (int) ((xp - xpmin) / tdiv);
1869 val = yvec->at(j) + ((yvec->at(j + 1) - yvec->at(j)) / tdiv) * (xp - xvec->at(j));
1870 }
1871
1872 return val;
1873}

◆ 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 603 of file TileRawChannelBuilderFitFilterCool.cxx.

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

◆ 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 534 of file TileRawChannelBuilderFitFilterCool.cxx.

534 {
535
536 ++m_chCounter;
537
538 const HWIdentifier adcId = digits->adc_HWID();
539
540 ATH_MSG_VERBOSE ( "Running FitFilter for TileRawChannel with HWID "
541 << m_tileHWID->to_string(adcId) );
542
543 // tmp variables for filtering
544 double amplitude = 0.0;
545 double chi2 = 0.0;
546 double time = 0.0;
547 double pedestal = 0.0;
548
549 // use fit filter
550 pulseFit(digits, amplitude, time, pedestal, chi2, ctx);
551
552 unsigned int drawerIdx(0), channel(0), adc(0);
553 m_tileIdTransforms->getIndices(adcId, drawerIdx, channel, adc);
554
555 // fit filter calib
556 // note that when called from TileROD_Decoder, m_calibrateEnergy is set
557 // from TileROD_Decoder...
558 if (m_calibrateEnergy) {
559 amplitude = m_tileToolEmscale->doCalibCis(drawerIdx, channel, adc, amplitude);
560 }
561
562 ATH_MSG_VERBOSE ( "Creating RawChannel"
563 << " a=" << amplitude
564 << " t=" << time
565 << " q=" << chi2
566 << " ped=" << pedestal );
567
568 // return new TileRawChannel
569 // TileRawChannel *rawCh = new TileRawChannel(adcId,amplitude,time,chi2,pedestal);
570
571 DataPool<TileRawChannel> tileRchPool(m_dataPoollSize);
572 TileRawChannel *rawCh = tileRchPool.nextElementPtr();
573 rawCh->assign (adcId,
574 amplitude,
575 time,
576 chi2,
577 pedestal);
578
579 if (m_correctTime && chi2 > 0) {
580 time -= m_tileToolTiming->getSignalPhase(drawerIdx, channel, adc);
581 rawCh->insertTime(time);
582 ATH_MSG_VERBOSE ( "Correcting time, new time=" << rawCh->time() );
583
584 }
585
586 int gain = m_tileHWID->adc(adcId);
587 if (TileID::HIGHGAIN == gain) {
588 ++m_nChH;
589 m_RChSumH += amplitude;
590 } else {
591 ++m_nChL;
592 m_RChSumL += amplitude;
593 }
594
595 return rawCh;
596}
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
ToolHandle< TileCondIdTransforms > m_tileIdTransforms
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
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 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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 364 of file AthCommonDataStore.h.

364 {
366 }

◆ resetDrawer()

void TileRawChannelBuilder::resetDrawer ( )
inherited

Definition at line 29 of file TileRawChannelBuilder.cxx.

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

◆ resetOverflows()

void TileRawChannelBuilder::resetOverflows ( void )
inherited

Definition at line 34 of file TileRawChannelBuilder.cxx.

34 {
35 m_overflows.clear();
36}

◆ 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 >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ 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 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_ADCmaskValueMinusEps

float TileRawChannelBuilder::m_ADCmaskValueMinusEps
protectedinherited

indicates channels which were masked in background dataset

Definition at line 222 of file TileRawChannelBuilder.h.

◆ m_ADCmaxMinusEps

float TileRawChannelBuilder::m_ADCmaxMinusEps
protectedinherited

Definition at line 221 of file TileRawChannelBuilder.h.

◆ m_ampMinThresh

float TileRawChannelBuilder::m_ampMinThresh
protectedinherited

correct amplitude if it's above amplitude threshold (in ADC counts)

Definition at line 152 of file TileRawChannelBuilder.h.

◆ m_badDrawer

bool TileRawChannelBuilder::m_badDrawer = false
protectedinherited

Definition at line 210 of file TileRawChannelBuilder.h.

◆ m_bsflags

unsigned int TileRawChannelBuilder::m_bsflags
protectedinherited

Definition at line 138 of file TileRawChannelBuilder.h.

◆ m_cabling

const TileCablingService* TileRawChannelBuilder::m_cabling
protectedinherited

TileCabling instance.

Definition at line 182 of file TileRawChannelBuilder.h.

◆ 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 179 of file TileRawChannelBuilder.h.

179 { this,
180 "TileCablingSvc", "TileCablingSvc", "The Tile cabling service"};

◆ m_calibrateEnergy

bool TileRawChannelBuilder::m_calibrateEnergy
protectedinherited

Definition at line 142 of file TileRawChannelBuilder.h.

◆ m_capdaq

double TileRawChannelBuilder::m_capdaq
protectedinherited

Definition at line 193 of file TileRawChannelBuilder.h.

◆ m_channelNoiseRMS

int TileRawChannelBuilderFitFilterCool::m_channelNoiseRMS
private

Definition at line 112 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_chCounter

unsigned int TileRawChannelBuilder::m_chCounter
protectedinherited

Definition at line 196 of file TileRawChannelBuilder.h.

◆ m_cischan

int TileRawChannelBuilder::m_cischan
protectedinherited

Definition at line 192 of file TileRawChannelBuilder.h.

◆ m_correctTime

bool TileRawChannelBuilder::m_correctTime
protectedinherited

Definition at line 145 of file TileRawChannelBuilder.h.

◆ m_dataPoollSize

int TileRawChannelBuilder::m_dataPoollSize
protectedinherited

Definition at line 204 of file TileRawChannelBuilder.h.

◆ 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 184 of file TileRawChannelBuilder.h.

184 {this,
185 "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 393 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 208 of file TileRawChannelBuilder.h.

◆ m_evtCounter

unsigned int TileRawChannelBuilder::m_evtCounter
protectedinherited

Definition at line 195 of file TileRawChannelBuilder.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extraSamplesLeft

int TileRawChannelBuilderFitFilterCool::m_extraSamplesLeft
private

Definition at line 114 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_extraSamplesRight

int TileRawChannelBuilderFitFilterCool::m_extraSamplesRight
private

Definition at line 115 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_f_ADCmax

float TileRawChannelBuilder::m_f_ADCmax
protectedinherited

Definition at line 218 of file TileRawChannelBuilder.h.

◆ m_f_ADCmaxPlus1

float TileRawChannelBuilder::m_f_ADCmaxPlus1
protectedinherited

Definition at line 220 of file TileRawChannelBuilder.h.

◆ m_firstSample

int TileRawChannelBuilder::m_firstSample
protectedinherited

Definition at line 140 of file TileRawChannelBuilder.h.

◆ m_fnParameters

double TileRawChannelBuilderFitFilterCool::m_fnParameters[3] {}
private

Definition at line 97 of file TileRawChannelBuilderFitFilterCool.h.

97{};

◆ m_frameLength

int TileRawChannelBuilderFitFilterCool::m_frameLength
private

Definition at line 111 of file TileRawChannelBuilderFitFilterCool.h.

◆ 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
protectedinherited

Definition at line 217 of file TileRawChannelBuilder.h.

◆ m_i_ADCmaxPlus1

int TileRawChannelBuilder::m_i_ADCmaxPlus1
protectedinherited

Definition at line 219 of file TileRawChannelBuilder.h.

◆ m_idocis

bool TileRawChannelBuilder::m_idocis
protectedinherited

Definition at line 191 of file TileRawChannelBuilder.h.

◆ m_idolas

bool TileRawChannelBuilder::m_idolas
protectedinherited

Definition at line 189 of file TileRawChannelBuilder.h.

◆ m_idoped

bool TileRawChannelBuilder::m_idoped
protectedinherited

Definition at line 190 of file TileRawChannelBuilder.h.

◆ m_idophys

bool TileRawChannelBuilder::m_idophys
protectedinherited

Definition at line 188 of file TileRawChannelBuilder.h.

◆ m_infoName

std::string TileRawChannelBuilder::m_infoName
protectedinherited

Definition at line 215 of file TileRawChannelBuilder.h.

◆ 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 209 of file TileRawChannelBuilder.h.

◆ m_maxIterate

int TileRawChannelBuilderFitFilterCool::m_maxIterate
private

Definition at line 113 of file TileRawChannelBuilderFitFilterCool.h.

◆ 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

double TileRawChannelBuilderFitFilterCool::m_maxTimeFromPeak
private

Definition at line 120 of file TileRawChannelBuilderFitFilterCool.h.

◆ 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
protectedinherited

Definition at line 199 of file TileRawChannelBuilder.h.

◆ m_nChL

int TileRawChannelBuilder::m_nChL
protectedinherited

Definition at line 198 of file TileRawChannelBuilder.h.

◆ m_noiseFilterTools

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

Definition at line 163 of file TileRawChannelBuilder.h.

163 {this,
164 "NoiseFilterTools", {}, "Tile noise filter tools"};

◆ m_noiseHigh

double TileRawChannelBuilderFitFilterCool::m_noiseHigh
private

Definition at line 123 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_noiseLow

double TileRawChannelBuilderFitFilterCool::m_noiseLow
private

Definition at line 122 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_noiseThresholdRMS

double TileRawChannelBuilderFitFilterCool::m_noiseThresholdRMS
private

Definition at line 119 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_notUpgradeCabling

bool TileRawChannelBuilder::m_notUpgradeCabling
protectedinherited

Definition at line 212 of file TileRawChannelBuilder.h.

◆ m_overflows

Overflows_t TileRawChannelBuilder::m_overflows
protectedinherited

Definition at line 203 of file TileRawChannelBuilder.h.

◆ m_pulseShapes

const TilePulseShapesStruct* TileRawChannelBuilderFitFilterCool::m_pulseShapes
private

Definition at line 126 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
protectedinherited

Definition at line 201 of file TileRawChannelBuilder.h.

◆ m_RChSumL

double TileRawChannelBuilder::m_RChSumL
protectedinherited

Definition at line 200 of file TileRawChannelBuilder.h.

◆ m_rChType

TileFragHash::TYPE TileRawChannelBuilder::m_rChType
protectedinherited

Definition at line 136 of file TileRawChannelBuilder.h.

◆ m_rChUnit

TileRawChannelUnit::UNIT TileRawChannelBuilder::m_rChUnit
protectedinherited

Definition at line 137 of file TileRawChannelBuilder.h.

◆ m_runType

int TileRawChannelBuilder::m_runType
protectedinherited

Definition at line 157 of file TileRawChannelBuilder.h.

◆ m_saturatedSampleError

double TileRawChannelBuilderFitFilterCool::m_saturatedSampleError
private

Definition at line 117 of file TileRawChannelBuilderFitFilterCool.h.

◆ m_shapes

TilePulseShapesStruct* TileRawChannelBuilderFitFilterCool::m_shapes
private

Definition at line 143 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
protectedinherited

Definition at line 161 of file TileRawChannelBuilder.h.

◆ m_tileID

const TileID* TileRawChannelBuilder::m_tileID
protectedinherited

Definition at line 160 of file TileRawChannelBuilder.h.

◆ 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 172 of file TileRawChannelBuilder.h.

172 {this,
173 "TileCondIdTransforms", "TileCondIdTransforms",
174 "Tile tool to tranlate hardware identifier to the drawerIdx, channel, and adc"};

◆ m_tileInfo

const TileInfo* TileRawChannelBuilder::m_tileInfo
protectedinherited

Definition at line 216 of file TileRawChannelBuilder.h.

◆ m_tileToolEmscale

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

Definition at line 166 of file TileRawChannelBuilder.h.

166 {this,
167 "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 131 of file TileRawChannelBuilderFitFilterCool.h.

131 {this,
132 "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 134 of file TileRawChannelBuilderFitFilterCool.h.

134 {this,
135 "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 140 of file TileRawChannelBuilderFitFilterCool.h.

140 {this,
141 "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 137 of file TileRawChannelBuilderFitFilterCool.h.

137 {this,
138 "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 128 of file TileRawChannelBuilderFitFilterCool.h.

128 {this,
129 "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 169 of file TileRawChannelBuilder.h.

169 {this,
170 "TileCondToolTiming", "TileCondToolTiming", "Tile timing tool"};

◆ m_timeMaxThresh

float TileRawChannelBuilder::m_timeMaxThresh
protectedinherited

correct amplitude is time is below time max threshold

Definition at line 154 of file TileRawChannelBuilder.h.

◆ m_timeMinThresh

float TileRawChannelBuilder::m_timeMinThresh
protectedinherited

correct amplitude is time is above time min threshold

Definition at line 153 of file TileRawChannelBuilder.h.

◆ m_trigType

int TileRawChannelBuilder::m_trigType
protectedinherited

Definition at line 187 of file TileRawChannelBuilder.h.

◆ m_useDSP

bool TileRawChannelBuilder::m_useDSP
protectedinherited

Definition at line 149 of file TileRawChannelBuilder.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_zeroSampleError

double TileRawChannelBuilderFitFilterCool::m_zeroSampleError
private

Definition at line 118 of file TileRawChannelBuilderFitFilterCool.h.

◆ MAX_CHANNELS

const int TileRawChannelBuilder::MAX_CHANNELS = 48
staticprotectedinherited

Definition at line 206 of file TileRawChannelBuilder.h.

◆ MAX_DMUS

const int TileRawChannelBuilder::MAX_DMUS = 16
staticprotectedinherited

Definition at line 207 of file TileRawChannelBuilder.h.


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