|
ATLAS Offline Software
|
Go to the documentation of this file.
9 #include "Gaudi/Property.h"
20 #include "CLHEP/Matrix/Matrix.h"
32 static const InterfaceID IID_ITileRawChannelBuilderWienerFilter(
"TileRawChannelBuilderWienerFilter", 1, 0);
36 return IID_ITileRawChannelBuilderWienerFilter;
40 #define TILE_WienerFilterBUILDERVERBOSE false
43 const std::string&
name,
const IInterface *
parent)
50 , m_t0SamplePosition(0)
56 declareInterface< TileRawChannelBuilder >(
this );
57 declareInterface< TileRawChannelBuilderWienerFilter >(
this);
125 <<
"] and number of samples [" <<
m_nSamples <<
"]" );
126 return StatusCode::FAILURE;
151 return StatusCode::SUCCESS;
164 return StatusCode::SUCCESS;
172 double pedestal = 0.;
183 <<
" gain=" <<
gain );
201 <<
" ped=" << pedestal
252 for (
unsigned int i = 0;
i <
m_digits.size();
i++) {
261 for (
unsigned int i = 0;
i <
m_digits.size();
i++) {
322 const int distFront = bcData->
distanceFromFront(
bcid, BunchCrossingCondData::BunchDistanceType::BunchCrossings);
323 const int distTail = bcData->
distanceFromTail(
bcid, BunchCrossingCondData::BunchDistanceType::BunchCrossings);
327 <<
" DistFront=" << distFront
328 <<
" DistTail=" << distTail);
330 if (distFront == -1 || distTail == -1) {
332 }
else if (distFront < 3 && distTail > distFront) {
333 bcidIndex = distFront;
334 }
else if (distTail < 3 && distTail < distFront) {
335 bcidIndex = 6 - distTail;
353 ,
int &
gain,
double &pedestal,
double &litude,
double &
time,
const EventContext &ctx) {
362 float minDigit = *minMaxDigits.first;
363 float maxDigit = *minMaxDigits.second;
365 if (maxDigit - minDigit < 0.01) {
369 ATH_MSG_VERBOSE(
"CASE NO SIGNAL: maxdig-mindig = " << maxDigit <<
"-" << minDigit
370 <<
" = " << maxDigit - minDigit );
376 memset(weights, 0,
sizeof(weights));
383 for (
unsigned int i = 0;
i < 8;
i++) {
388 for (
unsigned int i = 0;
i < 8;
i++) {
394 for (
unsigned int i = 0;
i <
m_digits.size();
i++) {
397 amplitude += weights[7];
411 double &pedestal,
double &litude,
double &
time,
double&
phase) {
418 <<
" pedestal=" << pedestal
419 <<
" amplitude=" << amplitude
421 <<
" phase=" <<
phase );
def retrieve(aClass, aKey=None)
int distanceFromTail(const bcid_type bcid, const BunchDistanceType type=NanoSec) const
The distance of the specific bunch crossing from the tail of the train.
int m_nConst
internal counters
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
static const InterfaceID & interfaceID()
AlgTool InterfaceID.
double m_maxTime
max allowed time = 25*(m_nSamples-1)/2
int NdigitSamples() const
Returns the number of sammples (digits) per event.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
double m_minTime
min allowed time = -25*(m_nSamples-1)/2
const TileHWID * m_tileHWID
int m_nSamples
number of samples in the data
virtual StatusCode initialize()
Initializer.
bool m_isMC
bool variable for MC: true=> MC; false=> data
bool msgLvl(const MSG::Level lvl) const
#define ATH_MSG_VERBOSE(x)
double m_timeForConvergence
minimum time difference to quit iteration procedure
HWIdentifier adc_HWID(void) const
ToolHandle< TileCondToolTiming > m_tileToolTiming
float time(int ind=0) const
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
void assign(const HWIdentifier &id, float amplitude, float time, float quality, float ped=0.0)
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
const TileWienerFilterWeightsStruct * getWienerFilterWeights() const
Return pointer to TileWienerFilterWeights.
setScaleOne setStatusOne saturated
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
TileFragHash::TYPE m_rChType
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
int ItrigSample() const
The sample at which the pulse should ideally peak.
std::vector< float > m_digits
double generalWeights[4][48][8]
~TileRawChannelBuilderWienerFilter()
Destructor.
int m_nCenter
internal counters
SG::WriteHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::ReadCondHandleKey< BunchCrossingCondData > m_bunchCrossingKey
Tool to get distance into bunch train.
int m_nSignal
internal counters
bool m_correctAmplitude
If true, resulting amplitude is corrected when using weights for tau=0 without iteration.
double chi2(TH1 *h0, TH1 *h1)
bool m_correctTimeNI
If true, resulting time is corrected when using method without iteration.
virtual StatusCode finalize() override
Finalize method.
double compute(int ros, int drawer, int channel, int gain, double &pedestal, double &litude, double &time, double &phase)
Gets the BCID index within the train.
virtual StatusCode initialize() override
Initialize method.
bool m_minus1Iter
bool variable for whether to apply -1 iteration (initial phase guess)
int findMaxDigitPosition()
Finds maximum digit position in the pulse.
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
const std::vector< float > & samples() const
int m_maxIterations
maximum number of iteration to perform
int distanceFromFront(const bcid_type bcid, const BunchDistanceType type=NanoSec) const
The distance of the specific bunch crossing from the front of the train.
const TileInfo * m_tileInfo
Helpers for checking error return status codes and reporting errors.
void insertTime(float time)
bool m_confTB
use testbeam configuration
TileRawChannelBuilderWienerFilter(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
StatusCode initialize(bool used=true)
setEventNumber setTimeStamp bcid
ToolHandle< TileCondToolNoiseSample > m_tileToolNoiseSample
Class describing the basic event information.
int m_pedestalMode
pedestal mode to use
float getPedestal(int ros, int drawer, int channel, int gain, const EventContext &ctx)
Computes A,time,ped using OF.
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
def time(flags, cells_name, *args, **kw)
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
int m_nNegative
internal counters
double filter(int ros, int drawer, int channel, int &gain, double &pedestal, double &litude, double &time, const EventContext &ctx)
virtual TileRawChannel * rawChannel(const TileDigits *digits, const EventContext &ctx) override
Builder virtual method to be implemented by subclasses.
int m_t0SamplePosition
position of peak sample = (m_nSamples-1)/2
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
std::string to_string(const HWIdentifier &id, int level=0) const
extract all fields from HW identifier HWIdentifier get_all_fields ( const HWIdentifier & id,...
int getBCIDIndex(const EventContext &ctx)
uint32_t bcid() const
The bunch crossing ID of the event.
const TileWienerFilterWeightsStruct * m_weights
structure for Wiener Filter weights
double optimalWeights[7][8]