ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
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. More...
 
 ~TileRawChannelBuilderFitFilterCool ()
 Destructor. More...
 
virtual StatusCode initialize () override
 Initializer. More...
 
virtual StatusCode finalize () override
 
virtual TileRawChannelrawChannel (const TileDigits *digits, const EventContext &ctx) override
 Builder virtual method to be implemented by subclasses. More...
 
virtual void handle (const Incident &) override
 
virtual StatusCode createContainer (const EventContext &ctx)
 Create container in SG with name given by parameter (m_rawChannelContainerKey) More...
 
virtual StatusCode commitContainer (const EventContext &ctx)
 Commit RawChannelContiner in SG and make const. More...
 
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. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 AlgTool InterfaceID. More...
 
static double correctAmp (double phase, bool of2=true)
 Amplitude correction factor according to the time when using weights for tau=0 without iterations. More...
 
static double correctTime (double phase, bool of2=true)
 Time correction factor. More...
 
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 More...
 
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. More...
 

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) More...
 
float m_timeMinThresh
 correct amplitude is time is above time min threshold More...
 
float m_timeMaxThresh
 correct amplitude is time is below time max threshold More...
 
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. More...
 
const TileCablingServicem_cabling
 TileCabling instance. More...
 
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 More...
 

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. More...
 
double pulse (double x, const std::vector< double > *xvec, const std::vector< double > *yvec, bool zeroOutside=false) const
 pulse interpolation More...
 
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 > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

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) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
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.

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 }

◆ ~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 
510  if (m_notUpgradeCabling) {
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 }

◆ 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 
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 
632  ATH_CHECK( rawChannelsContainer.record(std::move(m_rawChannelCnt)) );
633 
634  endLog();
635 
636  return StatusCode::SUCCESS;
637 }

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

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

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

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

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

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

95 { return m_detStore; }

◆ 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() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ 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 
360  m_error[channel] = err;
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 }

◆ 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  {
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 
185  float y, dy;
186  unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(0, 0);
187 
188  float phase = 0;
189  if (m_idolas) {
190  // --- low gain
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
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
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
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;
305  m_dgPhysLo.push_back(pulse(rsamp, &(m_pulseShapes->m_tdlphys), &(m_pulseShapes->m_ydlphys)));
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
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
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
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
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
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
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
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
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 }

◆ 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
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
107  m_minTau = -m_maxTau;
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() );
127  ATH_CHECK( m_tileToolPulse5p2Shape.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 }

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

◆ 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  {
35  return IID_ITileRawChannelBuilderFitFilterCool;
36  //return TileRawChannelBuilderCool::interfaceID();
37 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

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

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

◆ 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:
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:
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:
655  rms = m_noiseHigh;
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) {
1343  m_t0Fit = m_maxTime;
1344  tempChi2 = MAX_CHI2;
1345  } else if (m_t0Fit < m_minTime) {
1346  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  dgg = sgg - sg * sg / serr;
1561  dggp = sggp - sg * sgp / serr;
1562  dgpgp = sgpgp - sgp * sgp / serr;
1563  dyg = syg - sy * sg / serr;
1564  dygp = sygp - sy * sgp / serr;
1565  dg = dgg * dgpgp - dggp * dggp;
1566 
1567  if (fabs(dg) > EPS_DG) {
1568  cisampl = (dyg * dgpgp - dygp * dggp) / dg;
1569  cisatau = (dyg * dggp - dygp * dgg) / dg;
1570  cisped = (sy
1571  - (dyg * dgpgp * sg - dygp * dggp * sg + dyg * dggp * sgp - dygp * dgg * sgp) / dg)
1572  / serr;
1573 
1574  if (fabs(cisampl) > EPS_DG) {
1575  cistau = cisatau / cisampl;
1576  if (cistau > m_maxTau)
1577  cistau = m_maxTau;
1578  else if (cistau < m_minTau) cistau = m_minTau;
1579  } else {
1580  cistau = 0.0;
1581  }
1582  } else {
1583  cisampl = 0.0;
1584  cisatau = 0.0;
1585  cistau = 0.0;
1586  cisped = sy / serr;
1587  }
1588 
1589  if (msgLvl(MSG::VERBOSE)) {
1590  msg(MSG::VERBOSE) << " sy=" << sy
1591  << " sg=" << sg
1592  << " sgp=" << sgp
1593  << " syg=" << syg
1594  << " sygp=" << sygp
1595  << " sgg=" << sgg
1596  << " sggp=" << sggp
1597  << " sgpgp=" << sgpgp << endmsg;
1598 
1599  msg(MSG::VERBOSE) << " dgg=" << dgg
1600  << " dggp=" << dggp
1601  << " sgpgp=" << sgpgp
1602  << " dyg=" << dyg
1603  << " dygp=" << dygp
1604  << " dg=" << dg << endmsg;
1605 
1606  msg(MSG::VERBOSE) << " cistau=" << cistau
1607  << " cisped=" << cisped
1608  << " cisampl=" << cisampl << endmsg;
1609  }
1610 
1611  // Determine Chi2 for pulse shape + leakage fit CIS
1612  cischi2 = 0.0;
1613  nfit_real = 0;
1614  m_fnParameters[0] = cistau;
1615  m_fnParameters[1] = cisped;
1616  m_fnParameters[2] = cisampl;
1617  for (int isamp = 0;
1618  (isamp < nfit) && (DTIME * (isamp - m_iPeak0) - m_t0Fit < m_maxTimeFromPeak); ++isamp) {
1619  ++nfit_real;
1620  gval = scaledPulse(xvec[isamp], tpulse, ypulse);
1621  leakage = pulse(xvec[isamp], tleak, yleak);
1622  // Subtract leakage from samples
1623  yvec[isamp] = yvec0[isamp] - leakage;
1624  xd = yvec[isamp] - gval;
1625  cischi2 = cischi2 + (xd * xd) / (eyvec[isamp] * eyvec[isamp]);
1626 
1627  ATH_MSG_VERBOSE ( " yvec0[" << isamp << "]=" << yvec0[isamp]
1628  << " yvec[" << isamp << "]=" << yvec[isamp]
1629  << " leakage=" << leakage
1630  << " gval=" << gval
1631  << " xd=" << xd );
1632  }
1633  cischi2 = cischi2 / (nfit_real - 3.0);
1634 
1635  ATH_MSG_VERBOSE ( " cischi2=" << cischi2 );
1636 
1637  // Determine which set of parameters to use from CIS fit methods based on minimum chi2
1638  if ((cischi2 < leakchi2) && !fixedTime) {
1639  tau = cistau;
1640  ped = cisped;
1641  ampl = cisampl;
1642  tempChi2 = cischi2;
1643  } else {
1644  tau = leaktau;
1645  ped = leakped;
1646  ampl = leakampl;
1647  tempChi2 = leakchi2;
1648  }
1649  // End of fit for CIS events
1650  }
1651  } else { // Physics and laser events
1652  if (!fixedTime) {
1653 
1654  // restore initial parameters for pulse shape functions - to be used in 3-par fit
1655  m_fnParameters[0] = 0.0;
1656  m_fnParameters[1] = 0.0;
1657  m_fnParameters[2] = 1.0;
1658 
1659  sy = 0.0;
1660  sg = 0.0;
1661  sgp = 0.0;
1662  syg = 0.0;
1663  sygp = 0.0;
1664  sgg = 0.0;
1665  sggp = 0.0;
1666  sgpgp = 0.0;
1667  serr = 0.0;
1668 
1669  for (int isamp = 0;
1670  (isamp < nfit) && (DTIME * (isamp - m_iPeak0) - m_t0Fit < m_maxTimeFromPeak); ++isamp) {
1671  // Use the respective function values
1672  gval = scaledPulse(xvec[isamp], tpulse, ypulse);
1673  gpval = derivative(xvec[isamp], tdpulse, dpulse);
1674 
1675  err2 = eyvec[isamp] * eyvec[isamp];
1676  sy += yvec0[isamp] / err2;
1677  sg += gval / err2;
1678  sgp += gpval / err2;
1679  syg += yvec0[isamp] * gval / err2;
1680  sygp += yvec0[isamp] * gpval / err2;
1681  sgg += gval * gval / err2;
1682  sggp += gval * gpval / err2;
1683  sgpgp += gpval * gpval / err2;
1684  serr += 1.0 / err2;
1685 
1686  ATH_MSG_VERBOSE ( " isamp=" << isamp
1687  << " gval=" << gval
1688  << " sg=" << sg
1689  << " gpval=" << gpval
1690  << " sgp=" << sgp );
1691  }
1692 
1693  dgg = sgg - sg * sg / serr;
1694  dggp = sggp - sg * sgp / serr;
1695  dgpgp = sgpgp - sgp * sgp / serr;
1696  dyg = syg - sy * sg / serr;
1697  dygp = sygp - sy * sgp / serr;
1698  dg = dgg * dgpgp - dggp * dggp;
1699 
1700  // Fit for time, pedestal, and amplitude
1701  if (fabs(dg) > EPS_DG) {
1702  // Amplitude : ampl
1703  ampl = (dyg * dgpgp - dygp * dggp) / dg;
1704  // and Amplitude * time: atau
1705  atau = (dyg * dggp - dygp * dgg) / dg;
1706  // Pedestal
1707  ped = (sy - ((dyg * dgpgp - dygp * dggp) * sg + (dyg * dggp - dygp * dgg) * sgp) / dg)
1708  / serr;
1709 
1710  if (fabs(ampl) > EPS_DG) {
1711  // Time
1712  tau = atau / ampl;
1713  if (tau > m_maxTau)
1714  tau = m_maxTau;
1715  else if (tau < m_minTau) tau = m_minTau;
1716  } else {
1717  tau = 0.0;
1718  }
1719  } else {
1720  ampl = 0.0;
1721  atau = 0.0;
1722  tau = 0.0;
1723  ped = sy / serr;
1724  }
1725 
1726  if (msgLvl(MSG::VERBOSE)) {
1727  msg(MSG::VERBOSE) << " ped=" << ped << endmsg;
1728  msg(MSG::VERBOSE) << " sy=" << sy
1729  << " sg=" << sg
1730  << " sgp=" << sgp << endmsg;
1731 
1732  msg(MSG::VERBOSE) << " syg=" << syg
1733  << " sygp=" << sygp
1734  << " sgg=" << sgg << endmsg;
1735 
1736  msg(MSG::VERBOSE) << " sggp=" << sggp
1737  << " sgpgp=" << sgpgp << endmsg;
1738 
1739  msg(MSG::VERBOSE) << " ampl = (dyg*dgpgp - dygp*dggp)= " << ampl << endmsg;
1740  msg(MSG::VERBOSE) << " dyg=" << dyg
1741  << " dgpgp=" << dgpgp
1742  << " dyg*dgpgp=" << (dyg * dgpgp) << endmsg;
1743 
1744  msg(MSG::VERBOSE) << " dygp=" << dygp
1745  << " dggp=" << dggp
1746  << " dygp*dggp=" << (dygp * dggp) << endmsg;
1747 
1748  msg(MSG::VERBOSE) << " dyg=" << dyg
1749  << " dggp=" << dggp
1750  << " dyg*dggp=" << (dyg * dggp) << endmsg;
1751 
1752  msg(MSG::VERBOSE) << " dygp=" << dygp
1753  << " dgg=" << dgg
1754  << " dygp*dgg=" << (dygp * dgg) << endmsg;
1755 
1756  msg(MSG::VERBOSE) << " dg=" << dg
1757  << " atau=" << atau
1758  << " tau=" << tau << endmsg;
1759  }
1760 
1761  m_fnParameters[0] = tau;
1762  m_fnParameters[1] = ped;
1763  m_fnParameters[2] = ampl;
1764 
1765  tempChi2 = 0;
1766  nfit_real = 0;
1767  // Calculate chi2 for physics and laser events
1768  for (int isamp = 0;
1769  (isamp < nfit) && (DTIME * (isamp - m_iPeak0) - m_t0Fit < m_maxTimeFromPeak); ++isamp) {
1770  ++nfit_real;
1771  dc = yvec0[isamp] - scaledPulse(xvec[isamp], tpulse, ypulse);
1772  tempChi2 = tempChi2 + (dc * dc) / (eyvec[isamp] * eyvec[isamp]);
1773  ATH_MSG_VERBOSE ( " isamp=" << isamp
1774  << " yvec0[" << isamp << "]=" << yvec0[isamp]
1775  << " eyvec[" << isamp << "]=" << eyvec[isamp]
1776  << " dc=" << dc
1777  << " chi2=" << tempChi2 );
1778  }
1779  tempChi2 = tempChi2 / (nfit_real - 3.0);
1780  ATH_MSG_VERBOSE ( " chi2/(nfit_real-3.0)=" << tempChi2
1781  << " nfit_real=" << nfit_real );
1782  } // end if fixedTime
1783  } // end of physics and laser specific part
1784 
1785  if (msgLvl(MSG::VERBOSE))
1786  msg(MSG::VERBOSE) << " t0fit: " << m_t0Fit << ((tau < 0.0) ? " - " : " + ") << fabs(tau);
1787  // Iteration with parameter for time
1788  m_t0Fit += tau;
1789  ATH_MSG_VERBOSE ( " = " << m_t0Fit );
1790 
1791  // Check if total time does not exceed the limits:
1792  if (m_t0Fit > m_maxTime) {
1793  m_t0Fit = m_maxTime;
1794  tempChi2 = MAX_CHI2;
1795  } else if (m_t0Fit < m_minTime) {
1796  m_t0Fit = m_minTime;
1797  tempChi2 = MAX_CHI2;
1798  }
1799 
1800  if (tempChi2 < MAX_CHI2) {
1801  time = m_t0Fit;
1802  pedestal = ped;
1803  amplitude = ampl;
1804  chi2 = tempChi2;
1805  } // otherwise using the previous iteration
1806 
1807  } // end if to use extra iteration
1808 
1809  ATH_MSG_VERBOSE ( "Result:"
1810  << " Time=" << time
1811  << " Ped=" << pedestal
1812  << " Amplitude=" << amplitude
1813  << " Chi2=" << chi2 );
1814 }

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

◆ 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
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 DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

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.

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

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

◆ m_DSPContainerKey

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

Definition at line 125 of file TileRawChannelBuilder.h.

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

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

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

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

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

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

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

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

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

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

◆ m_tileToolTiming

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

Definition at line 169 of file TileRawChannelBuilder.h.

◆ 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:
python.root_lsr_rank.hashes
hashes
Definition: root_lsr_rank.py:34
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
TilePulseShapesStruct::m_yllas
std::vector< double > m_yllas
Definition: TilePulseShapes.h:63
TileRawChannelBuilderFitFilterCool::m_pulseShapes
const TilePulseShapesStruct * m_pulseShapes
Definition: TileRawChannelBuilderFitFilterCool.h:126
TilePulseShapesStruct::m_ydhphys
std::vector< double > m_ydhphys
Definition: TilePulseShapes.h:97
TilePulseShapesStruct::m_tllas
std::vector< double > m_tllas
Low Gain Pulse Laser.
Definition: TilePulseShapes.h:62
TileRawChannelContainer
Definition: TileRawChannelContainer.h:13
TileRawChannelBuilder::CorruptedData
static int CorruptedData(int ros, int drawer, int channel, int gain, const std::vector< float > &digits, float &dmin, float &dmax, float ADCmaxMinusEps, float ADCmaskValueMinusEps)
Definition: TileRawChannelBuilder.cxx:723
LEAK_START_T_LO
#define LEAK_START_T_LO
Definition: TileRawChannelBuilderFitFilterCool.h:42
TileRawDataCollection::setRODBCID
void setRODBCID(uint32_t rodBCID)
Setter for BCID from ROD header.
Definition: TileRawDataCollection.h:104
ReadOfcFromCool.phase
phase
Definition: ReadOfcFromCool.py:127
TilePulseShapesStruct::m_tlphys
std::vector< double > m_tlphys
Low Gain Pulse Physics.
Definition: TilePulseShapes.h:54
fitman.sy
sy
Definition: fitman.py:524
TilePulseShapesStruct::m_tdleakhi
std::vector< double > m_tdleakhi
Definition: TilePulseShapes.h:86
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
TileRawChannelBuilderFitFilterCool::pulse
double pulse(double x, const std::vector< double > *xvec, const std::vector< double > *yvec, bool zeroOutside=false) const
pulse interpolation
Definition: TileRawChannelBuilderFitFilterCool.cxx:1820
TileRawChannelBuilderFitFilterCool::derivative
double derivative(double x, const std::vector< double > *xvec, const std::vector< double > *yvec) const
Definition: TileRawChannelBuilderFitFilterCool.h:87
TileRawChannelBuilder::m_dataPoollSize
int m_dataPoollSize
Definition: TileRawChannelBuilder.h:204
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
max
#define max(a, b)
Definition: cfImp.cxx:41
TileRawChannelBuilder::TileRawChannelBuilder
TileRawChannelBuilder(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition: TileRawChannelBuilder.cxx:49
checkCoolLatestUpdate.dg
dg
Definition: checkCoolLatestUpdate.py:9
TilePulseShapesStruct::m_ylphys
std::vector< double > m_ylphys
Definition: TilePulseShapes.h:55
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
TileRawChannelBuilder::m_noiseFilterTools
ToolHandleArray< ITileRawChannelTool > m_noiseFilterTools
Definition: TileRawChannelBuilder.h:163
TileRawChannelBuilder::m_tileToolEmscale
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
Definition: TileRawChannelBuilder.h:166
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TileRawChannelBuilder::m_chCounter
unsigned int m_chCounter
Definition: TileRawChannelBuilder.h:196
TileRawChannelBuilderFitFilterCool::m_dummy
std::vector< double > m_dummy
Definition: TileRawChannelBuilderFitFilterCool.h:91
TileRawDataCollection::setDetEvType
void setDetEvType(uint32_t detEvType)
Setter for detector event type from ROD header.
Definition: TileRawDataCollection.h:98
TileCablingService::getInstance
static const TileCablingService * getInstance()
get pointer to service instance
Definition: TileCablingService.cxx:24
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
SCIS_START_T_LO
#define SCIS_START_T_LO
Definition: TileRawChannelBuilderFitFilterCool.h:39
LEAK_START_T_HI
#define LEAK_START_T_HI
Definition: TileRawChannelBuilderFitFilterCool.h:41
TilePulseShapesStruct::m_tdllas
std::vector< double > m_tdllas
Low Gain Pulse Laser.
Definition: TilePulseShapes.h:100
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TileRawChannelBuilder::m_calibrateEnergy
bool m_calibrateEnergy
Definition: TileRawChannelBuilder.h:142
TileRawChannelBuilderFitFilterCool::m_t0Fit
double m_t0Fit
Definition: TileRawChannelBuilderFitFilterCool.h:94
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
hist_file_dump.d
d
Definition: hist_file_dump.py:137
TilePulseShapesStruct::m_ydlphys
std::vector< double > m_ydlphys
Definition: TilePulseShapes.h:93
TileRawChannelBuilderFitFilterCool::m_fnParameters
double m_fnParameters[3]
Definition: TileRawChannelBuilderFitFilterCool.h:97
TilePulseShapesStruct::m_dleakhi
std::vector< double > m_dleakhi
Definition: TilePulseShapes.h:87
TileRawChannel::pedestal
float pedestal(void) const
Definition: TileRawChannel.h:106
TileRawChannelBuilder::m_tileHWID
const TileHWID * m_tileHWID
Definition: TileRawChannelBuilder.h:161
ReadCalibFromCool.chmax
chmax
Definition: ReadCalibFromCool.py:488
TileRawChannelBuilderFitFilterCool::m_gPhysHi
std::vector< double > m_gPhysHi
Definition: TileRawChannelBuilderFitFilterCool.h:107
TileDQstatus::calibMode
uint32_t calibMode() const
Calibration mode.
Definition: TileDQstatus.h:148
PHYS_DT_HI
#define PHYS_DT_HI
Definition: TileRawChannelBuilderFitFilterCool.h:34
TilePulseShapesStruct::m_ylcis
std::vector< double > m_ylcis
Definition: TilePulseShapes.h:35
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
TilePulseShapesStruct::m_yhphys
std::vector< double > m_yhphys
Definition: TilePulseShapes.h:59
TileRawChannelBuilder::m_rawChannelCnt
std::unique_ptr< TileMutableRawChannelContainer > m_rawChannelCnt
Definition: TileRawChannelBuilder.h:133
TileDQstatus::isBiGain
bool isBiGain() const
returns gain mode of run
Definition: TileDQstatus.h:60
TileRawChannelBuilderFitFilterCool::m_shapes
TilePulseShapesStruct * m_shapes
Definition: TileRawChannelBuilderFitFilterCool.h:143
TileRawChannelBuilder::m_useDSP
bool m_useDSP
Definition: TileRawChannelBuilder.h:149
TileRawChannelBuilder::initialize
virtual StatusCode initialize()
Initializer.
Definition: TileRawChannelBuilder.cxx:98
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
TilePulseShapesStruct::m_tsleaklo
std::vector< double > m_tsleaklo
Definition: TilePulseShapes.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
TileRawChannelBuilder::m_runType
int m_runType
Definition: TileRawChannelBuilder.h:157
TileRawChannel::setPedestal
void setPedestal(float ped)
Definition: TileRawChannel.h:94
TilePulseShapesStruct::m_tdlphys
std::vector< double > m_tdlphys
Low Gain Pulse Physics.
Definition: TilePulseShapes.h:92
Tile_Base_ID::HIGHGAIN
@ HIGHGAIN
Definition: Tile_Base_ID.h:57
TileRawChannelBuilder::m_notUpgradeCabling
bool m_notUpgradeCabling
Definition: TileRawChannelBuilder.h:212
TileRawChannelBuilderFitFilterCool::m_tileToolNoiseSample
ToolHandle< TileCondToolNoiseSample > m_tileToolNoiseSample
Definition: TileRawChannelBuilderFitFilterCool.h:140
TileRawChannelBuilderFitFilterCool::m_extraSamplesLeft
int m_extraSamplesLeft
Definition: TileRawChannelBuilderFitFilterCool.h:114
TilePulseShapesStruct::m_tleakhi
std::vector< double > m_tleakhi
Definition: TilePulseShapes.h:48
TileRawChannelBuilder::m_ADCmaxMinusEps
float m_ADCmaxMinusEps
Definition: TileRawChannelBuilder.h:221
TilePulseShapesStruct::m_noiseNkHi
std::vector< double > m_noiseNkHi
Definition: TilePulseShapes.h:115
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
checkRpcDigits.digit
digit
Definition: checkRpcDigits.py:186
TilePulseShapesStruct::m_tdhcis
std::vector< double > m_tdhcis
Hi Gain Pulse CIS.
Definition: TilePulseShapes.h:82
TileRawData::adc_HWID
HWIdentifier adc_HWID(void) const
Definition: TileRawData.h:53
HWIdentifier
Definition: HWIdentifier.h:13
x
#define x
PHYS_START_T_HI
#define PHYS_START_T_HI
Definition: TileRawChannelBuilderFitFilterCool.h:32
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
TileRawChannelBuilder::m_tileToolTiming
ToolHandle< TileCondToolTiming > m_tileToolTiming
Definition: TileRawChannelBuilder.h:169
TileRawChannel::time
float time(int ind=0) const
Definition: TileRawChannel.h:103
MAX_HI_PULSE_PHYS
#define MAX_HI_PULSE_PHYS
Definition: TilePulseShapes.h:21
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
TilePulseShapesStruct::m_thphys
std::vector< double > m_thphys
Hi Gain Pulse Physics.
Definition: TilePulseShapes.h:58
TileRawChannelBuilder::m_ADCmaskValueMinusEps
float m_ADCmaskValueMinusEps
indicates channels which were masked in background dataset
Definition: TileRawChannelBuilder.h:222
TilePulseShapesStruct::m_yhlas
std::vector< double > m_yhlas
Definition: TilePulseShapes.h:67
TileRawChannelBuilder::m_cischan
int m_cischan
Definition: TileRawChannelBuilder.h:192
PHYS_START_T_LO
#define PHYS_START_T_LO
Definition: TileRawChannelBuilderFitFilterCool.h:33
TileHWID::channel
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
Definition: TileHWID.h:189
TileRawChannelBuilder::m_DSPContainerKey
SG::ReadHandleKey< TileRawChannelContainer > m_DSPContainerKey
Definition: TileRawChannelBuilder.h:126
TileRawChannelBuilderFitFilterCool::m_maxTimeFromPeak
double m_maxTimeFromPeak
Definition: TileRawChannelBuilderFitFilterCool.h:120
SCIS_START_T_HI
#define SCIS_START_T_HI
Definition: TileRawChannelBuilderFitFilterCool.h:38
TileRawChannelBuilderFitFilterCool::m_tileToolLeak5p2Shape
ToolHandle< TileCondToolPulseShape > m_tileToolLeak5p2Shape
Definition: TileRawChannelBuilderFitFilterCool.h:134
TilePulseShapesStruct::m_tslcis
std::vector< double > m_tslcis
Definition: TilePulseShapes.h:36
TileRawChannel::assign
void assign(const HWIdentifier &id, float amplitude, float time, float quality, float ped=0.0)
Definition: TileRawChannel.h:63
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
TileHWID::ros
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
Definition: TileHWID.h:167
TileRawChannelBuilderFitFilterCool::m_minTau
double m_minTau
Definition: TileRawChannelBuilderFitFilterCool.h:101
TilePulseShapesStruct::m_ydlcis
std::vector< double > m_ydlcis
Definition: TilePulseShapes.h:73
MAX_LO_PULSE_LAS
#define MAX_LO_PULSE_LAS
Definition: TilePulseShapes.h:22
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:269
TileDQstatus::trigType
int trigType() const
Trigger type.
Definition: TileDQstatus.h:156
tools.zlumi_mc_cf.correction
def correction(mu, runmode, campaign, run=None)
Definition: zlumi_mc_cf.py:4
TilePulseShapesStruct::m_dsleaklo
std::vector< double > m_dsleaklo
Definition: TilePulseShapes.h:79
TileDQstatus::incompleteDigits
bool incompleteDigits() const
A few extra items (from TileBeamInfoProvider).
Definition: TileDQstatus.h:144
TileRawChannelBuilderFitFilterCool::m_noiseThresholdRMS
double m_noiseThresholdRMS
Definition: TileRawChannelBuilderFitFilterCool.h:119
TilePulseShapesStruct::m_ydslcis
std::vector< double > m_ydslcis
Definition: TilePulseShapes.h:75
TilePulseShapesStruct::m_yhcis
std::vector< double > m_yhcis
Definition: TilePulseShapes.h:45
TileDQstatus
Class that holds Data Quality fragment information and provides functions to extract the data quality...
Definition: TileDQstatus.h:49
TileRawChannelBuilder::m_rChType
TileFragHash::TYPE m_rChType
Definition: TileRawChannelBuilder.h:136
TileHWID::adc
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
Definition: TileHWID.h:193
TileRawChannelBuilder::m_lastDrawer
int m_lastDrawer
Definition: TileRawChannelBuilder.h:209
TilePulseShapesStruct::m_tshcis
std::vector< double > m_tshcis
Definition: TilePulseShapes.h:46
TilePulseShapesStruct::m_dleaklo
std::vector< double > m_dleaklo
Definition: TilePulseShapes.h:77
EPS_DG
#define EPS_DG
Definition: TilePulseShapes.h:26
TileRawChannelBuilder::m_nChL
int m_nChL
Definition: TileRawChannelBuilder.h:198
TilePulseShapesStruct::m_yshcis
std::vector< double > m_yshcis
Definition: TilePulseShapes.h:47
AthCommonDataStore
Definition: AthCommonDataStore.h:52
TileRawChannelBuilder::m_overflows
Overflows_t m_overflows
Definition: TileRawChannelBuilder.h:203
TileRawChannelBuilderFitFilterCool::m_gPhysLo
std::vector< double > m_gPhysLo
Definition: TileRawChannelBuilderFitFilterCool.h:105
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TileRawChannelBuilderFitFilterCool::m_channelNoiseRMS
int m_channelNoiseRMS
Definition: TileRawChannelBuilderFitFilterCool.h:112
IdentifiableContainerMT::GetAllCurrentHashes
virtual std::vector< IdentifierHash > GetAllCurrentHashes() const override final
Returns a collection of all hashes availiable in this IDC.
Definition: IdentifiableContainerMT.h:231
TilePulseShapesStruct::m_ydllas
std::vector< double > m_ydllas
Definition: TilePulseShapes.h:101
TileRawChannelBuilderFitFilterCool::m_minTime
double m_minTime
Definition: TileRawChannelBuilderFitFilterCool.h:99
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:193
TilePulseShapesStruct::m_noiseNkLo
std::vector< double > m_noiseNkLo
(2) Noise with resistors added to PMT channels (so-called noise-killers)
Definition: TilePulseShapes.h:114
TileRawChannelBuilderFitFilterCool::m_dgPhysHi
std::vector< double > m_dgPhysHi
Definition: TileRawChannelBuilderFitFilterCool.h:108
lumiFormat.i
int i
Definition: lumiFormat.py:92
CIS_START_T_HI
#define CIS_START_T_HI
Definition: TileRawChannelBuilderFitFilterCool.h:36
TileRawChannelBuilder::m_bsflags
unsigned int m_bsflags
Definition: TileRawChannelBuilder.h:138
TilePulseShapesStruct::m_leakhi
std::vector< double > m_leakhi
Definition: TilePulseShapes.h:49
CIS_START_T_LO
#define CIS_START_T_LO
Definition: TileRawChannelBuilderFitFilterCool.h:37
LAS_START_T_HI
#define LAS_START_T_HI
Definition: TileRawChannelBuilderFitFilterCool.h:46
TileRawChannelBuilder::m_capdaq
double m_capdaq
Definition: TileRawChannelBuilder.h:193
TileRawChannelBuilder::m_rawChannelContainerKey
SG::WriteHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
Definition: TileRawChannelBuilder.h:129
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TilePulseShapesStruct::m_thcis
std::vector< double > m_thcis
Hi Gain Pulse CIS.
Definition: TilePulseShapes.h:44
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
01SubmitToGrid.samples
samples
Definition: 01SubmitToGrid.py:58
TileRawDataContainer::get_bsflags
uint32_t get_bsflags() const
Definition: TileRawDataContainer.h:64
MAX_HI_PULSE_LAS
#define MAX_HI_PULSE_LAS
Definition: TilePulseShapes.h:23
TileRawChannelBuilder::m_tileIdTransforms
ToolHandle< TileCondIdTransforms > m_tileIdTransforms
Definition: TileRawChannelBuilder.h:172
TileRawChannelBuilderFitFilterCool::pulseFit
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.
Definition: TileRawChannelBuilderFitFilterCool.cxx:603
MAX_LO_PULSE_CIS
#define MAX_LO_PULSE_CIS
Definition: TilePulseShapes.h:16
TileRawChannelBuilder::m_nChH
int m_nChH
Definition: TileRawChannelBuilder.h:199
TileRawChannelBuilderFitFilterCool::m_tileToolLeak100Shape
ToolHandle< TileCondToolPulseShape > m_tileToolLeak100Shape
Definition: TileRawChannelBuilderFitFilterCool.h:131
TilePulseShapesStruct::m_leaklo
std::vector< double > m_leaklo
Definition: TilePulseShapes.h:39
TileRawChannelBuilderFitFilterCool::m_noiseHigh
double m_noiseHigh
Definition: TileRawChannelBuilderFitFilterCool.h:123
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
TileRawChannel
Definition: TileRawChannel.h:35
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TileRawChannelBuilder::m_idophys
bool m_idophys
Definition: TileRawChannelBuilder.h:188
SLEAK_START_T_LO
#define SLEAK_START_T_LO
Definition: TileRawChannelBuilderFitFilterCool.h:44
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TileRawChannelBuilder::m_RChSumL
double m_RChSumL
Definition: TileRawChannelBuilder.h:200
TilePulseShapesStruct::m_ydhlas
std::vector< double > m_ydhlas
Definition: TilePulseShapes.h:105
Tile_Base_ID::LOWGAIN
@ LOWGAIN
Definition: Tile_Base_ID.h:57
TileRawChannelBuilder::m_rChUnit
TileRawChannelUnit::UNIT m_rChUnit
Definition: TileRawChannelBuilder.h:137
WriteCellNoiseToCool.igain
igain
Definition: WriteCellNoiseToCool.py:338
LAS_DT_HI
#define LAS_DT_HI
Definition: TileRawChannelBuilderFitFilterCool.h:48
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TilePulseShapesStruct::m_noiseOrigHi
std::vector< double > m_noiseOrigHi
Definition: TilePulseShapes.h:111
TilePulseShapesStruct
Definition: TilePulseShapes.h:31
TileRawChannelBuilder::fill_drawer_errors
void fill_drawer_errors(const EventContext &ctx, const TileDigitsCollection *collection)
Definition: TileRawChannelBuilder.cxx:300
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
plotBeamSpotCompare.xd
xd
Definition: plotBeamSpotCompare.py:220
TilePulseShapesStruct::m_dsleakhi
std::vector< double > m_dsleakhi
Definition: TilePulseShapes.h:89
TileDigits::samples
const std::vector< float > & samples() const
Definition: TileDigits.h:58
TileRawChannelBuilder::MAX_CHANNELS
static const int MAX_CHANNELS
Definition: TileRawChannelBuilder.h:206
TileDQstatus::isAdcDQgood
bool isAdcDQgood(int partition, int drawer, int ch, int gain) const
returns status of single ADC returns False if there are any errors
Definition: TileDQstatus.cxx:178
TileRawChannelBuilderFitFilterCool::m_extraSamplesRight
int m_extraSamplesRight
Definition: TileRawChannelBuilderFitFilterCool.h:115
TilePulseShapesStruct::m_tdhlas
std::vector< double > m_tdhlas
Hi Gain Pulse Laser.
Definition: TilePulseShapes.h:104
TilePulseShapesStruct::m_tdsleaklo
std::vector< double > m_tdsleaklo
Definition: TilePulseShapes.h:78
min
#define min(a, b)
Definition: cfImp.cxx:40
TileRawChannelBuilder::m_correctTime
bool m_correctTime
Definition: TileRawChannelBuilder.h:145
TileRawDataCollection::identify
ID identify() const
Definition: TileRawDataCollection.h:71
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
TileRawChannelBuilderFitFilterCool::m_maxTime
double m_maxTime
Definition: TileRawChannelBuilderFitFilterCool.h:100
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
TilePulseShapesStruct::m_tdhphys
std::vector< double > m_tdhphys
Hi Gain Pulse Physics.
Definition: TilePulseShapes.h:96
TileRawChannelBuilder::m_tileInfo
const TileInfo * m_tileInfo
Definition: TileRawChannelBuilder.h:216
MAX_LO_PULSE_CIS_SMALL
#define MAX_LO_PULSE_CIS_SMALL
Definition: TilePulseShapes.h:17
DTIME
#define DTIME
Definition: TileRawChannelBuilderFitFilter.h:116
TileInfo::getPulseShapes
const TilePulseShapesStruct * getPulseShapes() const
Return pointer to TilePulseShapes.
Definition: TileInfo.h:253
TilePulseShapesStruct::m_ydshcis
std::vector< double > m_ydshcis
Definition: TilePulseShapes.h:85
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
TileDigits
Definition: TileDigits.h:30
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
PHYS_DT_LO
#define PHYS_DT_LO
Definition: TileRawChannelBuilderFitFilterCool.h:35
TileRawChannel::insertTime
void insertTime(float time)
Definition: TileRawChannel.cxx:76
TileRawChannelCollection
Definition: TileRawChannelCollection.h:12
DELTA_CHI2
#define DELTA_CHI2
Definition: TilePulseShapes.h:28
TileRawChannelBuilderFitFilterCool::m_maxTau
double m_maxTau
Definition: TileRawChannelBuilderFitFilterCool.h:102
LAS_START_T_LO
#define LAS_START_T_LO
Definition: TileRawChannelBuilderFitFilterCool.h:47
TilePulseShapesStruct::m_tleaklo
std::vector< double > m_tleaklo
Definition: TilePulseShapes.h:38
TileDQstatus::cispar
const uint32_t * cispar() const
CIS parameters.
Definition: TileDQstatus.h:152
TileRawChannelBuilder::BadPatternName
static const char * BadPatternName(float ped)
Definition: TileRawChannelBuilder.cxx:458
TileRawChannelBuilder::rawChannel
virtual TileRawChannel * rawChannel(const TileDigits *digits, const EventContext &ctx)
Builder virtual method to be implemented by subclasses.
Definition: TileRawChannelBuilder.cxx:291
SATURATED_ADC_VALUE
#define SATURATED_ADC_VALUE
Definition: TilePulseShapes.h:27
TileRawChannelBuilderFitFilterCool::m_tileToolPulse5p2Shape
ToolHandle< TileCondToolPulseShape > m_tileToolPulse5p2Shape
Definition: TileRawChannelBuilderFitFilterCool.h:137
TilePulseShapesStruct::m_tdshcis
std::vector< double > m_tdshcis
Definition: TilePulseShapes.h:84
Example_ReadSampleNoise.ped
ped
Definition: Example_ReadSampleNoise.py:45
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
IdentifiableContainerMT::indexFindPtr
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,...
Definition: IdentifiableContainerMT.h:292
MAX_SAMPLES
#define MAX_SAMPLES
Definition: TilePulseShapes.h:14
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
TilePulseShapesStruct::m_tlcis
std::vector< double > m_tlcis
Low Gain Pulse CIS.
Definition: TilePulseShapes.h:34
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
MAX_HI_PULSE_CIS
#define MAX_HI_PULSE_CIS
Definition: TilePulseShapes.h:18
MAX_HI_PULSE_CIS_SMALL
#define MAX_HI_PULSE_CIS_SMALL
Definition: TilePulseShapes.h:19
LAS_DT_LO
#define LAS_DT_LO
Definition: TileRawChannelBuilderFitFilterCool.h:49
TilePulseShapesStruct::m_sleaklo
std::vector< double > m_sleaklo
Definition: TilePulseShapes.h:41
TilePulseShapesStruct::m_tsleakhi
std::vector< double > m_tsleakhi
Definition: TilePulseShapes.h:50
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
TileRawChannelBuilder::m_badDrawer
bool m_badDrawer
Definition: TileRawChannelBuilder.h:210
y
#define y
h
TilePulseShapesStruct::m_yslcis
std::vector< double > m_yslcis
Definition: TilePulseShapes.h:37
TileHWID::drawer
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
Definition: TileHWID.h:171
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
TileRawChannelBuilder::m_evtCounter
unsigned int m_evtCounter
Definition: TileRawChannelBuilder.h:195
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
TileRawChannelBuilder::m_DQstatusKey
SG::ReadHandleKey< TileDQstatus > m_DQstatusKey
Definition: TileRawChannelBuilder.h:120
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TilePulseShapesStruct::m_tdslcis
std::vector< double > m_tdslcis
Definition: TilePulseShapes.h:74
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TileRawChannelBuilder::initLog
void initLog(const EventContext &ctx)
Definition: TileRawChannelBuilder.cxx:246
DEBUG
#define DEBUG
Definition: page_access.h:11
TilePulseShapesStruct::m_sleakhi
std::vector< double > m_sleakhi
Definition: TilePulseShapes.h:51
TileRawChannelBuilder::m_RChSumH
double m_RChSumH
Definition: TileRawChannelBuilder.h:201
TileRawChannelBuilderFitFilterCool::m_zeroSampleError
double m_zeroSampleError
Definition: TileRawChannelBuilderFitFilterCool.h:118
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
TileRawChannelBuilder::MAX_DMUS
static const int MAX_DMUS
Definition: TileRawChannelBuilder.h:207
beamspotnt.rms
rms
Definition: bin/beamspotnt.py:1266
DataPool
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
Definition: DataPool.h:47
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
TileFragHash::FitFilterCool
@ FitFilterCool
Definition: TileFragHash.h:35
SLEAK_START_T_HI
#define SLEAK_START_T_HI
Definition: TileRawChannelBuilderFitFilterCool.h:43
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
TileCalibUtils::getDrawerIdx
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
Definition: TileCalibUtils.cxx:60
TileRawDataCollection::setLvl1Id
void setLvl1Id(uint32_t lvl1Id)
Setter for level1 id from ROD header.
Definition: TileRawDataCollection.h:86
TileRawChannelBuilder::m_idocis
bool m_idocis
Definition: TileRawChannelBuilder.h:191
LB_AnalMapSplitter.of2
of2
Definition: LB_AnalMapSplitter.py:50
CIS_DT_HI
#define CIS_DT_HI
Definition: TileRawChannelBuilderFitFilterCool.h:40
TilePulseShapesStruct::m_tdsleakhi
std::vector< double > m_tdsleakhi
Definition: TilePulseShapes.h:88
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
python.output.AtlRunQueryRoot.yvec
yvec
Definition: AtlRunQueryRoot.py:989
TileHWID::to_string
std::string to_string(const HWIdentifier &id, int level=0) const
extract all fields from HW identifier HWIdentifier get_all_fields ( const HWIdentifier & id,...
Definition: TileHWID.cxx:49
TileRawChannelBuilderFitFilterCool::m_tileToolPulseShape
ToolHandle< TileCondToolPulseShape > m_tileToolPulseShape
Definition: TileRawChannelBuilderFitFilterCool.h:128
TileRawChannelBuilder::endLog
void endLog()
Definition: TileRawChannelBuilder.cxx:639
TileRawChannelBuilderFitFilterCool::scaledPulse
double scaledPulse(double x, const std::vector< double > *xvec, const std::vector< double > *yvec) const
Definition: TileRawChannelBuilderFitFilterCool.h:83
IdentifierHash
Definition: IdentifierHash.h:38
get_generator_info.error
error
Definition: get_generator_info.py:40
MAX_CHI2
#define MAX_CHI2
Definition: TilePulseShapes.h:29
TileRawChannelBuilderFitFilterCool::m_noiseLow
double m_noiseLow
Definition: TileRawChannelBuilderFitFilterCool.h:122
TileRawChannelBuilder::m_trigType
int m_trigType
Definition: TileRawChannelBuilder.h:187
TileRawChannelBuilderFitFilterCool::m_iPeak0
int m_iPeak0
Definition: TileRawChannelBuilderFitFilterCool.h:98
error
Definition: IImpactPoint3dEstimator.h:70
TilePulseShapesStruct::m_thlas
std::vector< double > m_thlas
Hi Gain Pulse Laser.
Definition: TilePulseShapes.h:66
TileRawChannelBuilderFitFilterCool::m_frameLength
int m_frameLength
Definition: TileRawChannelBuilderFitFilterCool.h:111
python.compressB64.c
def c
Definition: compressB64.py:93
TilePulseShapesStruct::m_tdlcis
std::vector< double > m_tdlcis
Low Gain Pulse CIS.
Definition: TilePulseShapes.h:72
TileRawChannelBuilder::m_idolas
bool m_idolas
Definition: TileRawChannelBuilder.h:189
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
TileRawChannelBuilderFitFilterCool::m_dgPhysLo
std::vector< double > m_dgPhysLo
Definition: TileRawChannelBuilderFitFilterCool.h:106
nmax
const int nmax(200)
CIS_DT_LO
#define CIS_DT_LO
Definition: TileRawChannelBuilderFitFilterCool.h:45
TileRawChannelBuilderFitFilterCool::m_saturatedSampleError
double m_saturatedSampleError
Definition: TileRawChannelBuilderFitFilterCool.h:117
TileRawChannelBuilderFitFilterCool::m_maxIterate
int m_maxIterate
Definition: TileRawChannelBuilderFitFilterCool.h:113
TileRawDataCollection::setLvl1Type
void setLvl1Type(uint32_t lvl1Type)
Setter for level1 type from ROD header.
Definition: TileRawDataCollection.h:92
TilePulseShapesStruct::m_tdleaklo
std::vector< double > m_tdleaklo
Definition: TilePulseShapes.h:76
TileRawChannelUnit::ADCcounts
@ ADCcounts
Definition: TileRawChannelUnit.h:17
TileRawChannelBuilder::m_idoped
bool m_idoped
Definition: TileRawChannelBuilder.h:190
TileRawChannelBuilder::m_error
int m_error[MAX_CHANNELS]
Definition: TileRawChannelBuilder.h:208
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528
TilePulseShapesStruct::m_ydhcis
std::vector< double > m_ydhcis
Definition: TilePulseShapes.h:83
MAX_LO_PULSE_PHYS
#define MAX_LO_PULSE_PHYS
Definition: TilePulseShapes.h:20
ServiceHandle< IIncidentSvc >
TilePulseShapesStruct::m_noiseOrigLo
std::vector< double > m_noiseOrigLo
(1) Original noise
Definition: TilePulseShapes.h:110