8#ifndef LARCALIBUTILS_LAROFCALGORITHM_H
9#define LARCALIBUTILS_LAROFCALGORITHM_H
13#include "GaudiKernel/ToolHandle.h"
23#include "tbb/blocked_range.h"
24#include "tbb/global_control.h"
44 LArOFCAlg (
const std::string& name, ISvcLocator* pSvcLocator);
46 StatusCode
execute() {
return StatusCode::SUCCESS;}
47 virtual StatusCode stop();
48 StatusCode
finalize(){
return StatusCode::SUCCESS;}
56 ,
"CaloDetDescrManager"
57 ,
"CaloDetDescrManager"
58 ,
"SG Key for CaloDetDescrManager in the Condition Store" };
61 ,
"CaloSuperCellDetDescrManager"
62 ,
"CaloSuperCellDetDescrManager"
63 ,
"SG Key for CaloSuperCellDetDescrManager in the Condition Store" };
72 std::vector<std::vector<float> >
ofc_a;
73 std::vector<std::vector<float> >
ofc_b;
78 std::vector<std::vector<float> >
shape;
96 static void optFilt(
const std::vector<float> &gWave_in,
const std::vector<float> &gDerivWave_in,
const Eigen::MatrixXd& autoCorrInv,
97 std::vector<float>& OFCa, std::vector<float>& OFCb
100 static void optFiltDelta(
const std::vector<float> &gWave_in,
const std::vector<float> &gDerivWave_in,
const Eigen::MatrixXd& autoCorrInv,
101 const Eigen::VectorXd& delta,
102 std::vector<float>& vecOFCa, std::vector<float>& vecOFCb
105 static void optFiltPed(
const std::vector<float> &gWave_in,
const std::vector<float> &gDerivWave_in,
const Eigen::MatrixXd& autoCorrInv,
106 std::vector<float>& OFCa, std::vector<float>& OFCb
112 bool verify(
const HWIdentifier chid,
const std::vector<float>& OFCa,
const std::vector<float>& OFCb,
113 const std::vector<float>& Shape,
const char* ofcversion,
const unsigned phase)
const;
115 static void printOFCVec(
const std::vector<float>&
vec, MsgStream& mLog) ;
124 StringArrayProperty
m_keylist{
this,
"KeyList", {},
"List of keys to process"};
125 BooleanProperty
m_verify{
this,
"Verify",
true,
"Verufy OFCs after computation"};
126 BooleanProperty
m_normalize{
this,
"Normalize",
false,
"Normalize input wave"};
127 BooleanProperty
m_timeShift{
this,
"TimeShift",
false,
"Shifting input wave"};
133 UnsignedIntegerProperty
m_nSamples{
this,
"Nsample", 5,
"How many sample to compute"};
134 UnsignedIntegerProperty
m_nPhases{
this,
"Nphase", 50,
"How many sphases to compute"};
135 UnsignedIntegerProperty
m_dPhases{
this,
"Dphase", 1,
"Number of samples between two neighboring phases (OFC sets)"};
136 UnsignedIntegerProperty
m_nDelays{
this,
"Ndelay", 24,
"Number of delays in one clock"};
137 FloatProperty
m_addOffset{
this,
"AddTimeOffset", 0.,
"Time offset to add"} ;
146 DoubleProperty
m_errAmpl{
this,
"ErrAmplitude", 0.01,
"Allowed amplitude difference in check"};
147 DoubleProperty
m_errTime{
this,
"ErrTime", 0.01,
"Allowed time difference in check"};
149 BooleanProperty
m_readCaliWave{
this,
"ReadCaliWave",
true,
"If false PhysWave is input"};
150 BooleanProperty
m_fillShape{
this,
"FillShape",
false,
"Fill also shape object"};
151 StringProperty
m_ofcKey{
this,
"KeyOFC",
"LArOFC",
"Output key non-pileup OFCs"};
152 StringProperty
m_ofcKeyV2{
this,
"KeyOFCV2",
"LArOFCV2",
"Output key pileup OFCs"};
153 StringProperty
m_shapeKey{
this,
"KeyShape",
"LArShape",
"Output key Shape object"};
154 BooleanProperty
m_storeMaxPhase{
this,
"StoreMaxPhase",
false,
"Store phase of input wave max.?"};
155 StringProperty
m_ofcBinKey{
this,
"LArOFCBinKey",
"LArOFCPhase",
"Key for storing OFCBin object for MAx phase"};
157 StringProperty
m_groupingType{
this,
"GroupingType",
"SubDetector",
"Which grouping type to use"};
160 IntegerProperty
m_useDelta{
this,
"UseDelta", 0,
"0= not use Delta, 1=only EMECIW/HEC/FCAL, 2=all , 3 = only EMECIW/HEC/FCAL1+high eta FCAL2-3"};
161 IntegerProperty
m_useDeltaV2{
this,
"UseDeltaV2", 0,
"Same af before for Delta"};
162 BooleanProperty
m_computeV2{
this,
"ComputeOFCV2",
false,
"Compute pileup OFCs?"};
163 BooleanProperty
m_computePed{
this,
"ComputeOFCPed",
false,
"Compute OFCs with additional constraint to pedestal?"};
164 IntegerProperty
m_nThreads{
this,
"nThreads", -1,
"-1: No TBB, 0: Let TBB decide, >0 number of threads"};
166 BooleanProperty
m_readDSPConfig{
this,
"ReadDSPConfig",
false,
"Read DSPConfig object ?"};
167 StringProperty
m_DSPConfigFolder{
this,
"DSPConfigFolder",
"/LAR/Configuration/DSPConfiguration",
"Folder for DSPConfig object"};
170 BooleanProperty
m_forceShift{
this,
"ForceShift",
false,
"Forcing shift of input wave ?"};
172 BooleanProperty
m_isSC{
this,
"isSC",
false,
"Running on cells or supercells?"};
174 Eigen::VectorXd getDelta(std::vector<float>& samples,
const HWIdentifier chid,
unsigned nSamples)
const;
180 static const float m_fcal3Delta[5];
181 static const float m_fcal2Delta[5];
182 static const float m_fcal1Delta[5];
190 void operator() (tbb::blocked_range<size_t>&
r)
const {
191 for (
size_t i=
r.begin();i!=
r.end();++i) {
Definition of CaloDetDescrManager.
std::vector< size_t > vec
Define macros for attributes used to control the static checker.
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Liquid Argon Cumulative Wave Container.
const LArOFCAlg * m_ofcAlg
Looper(std::vector< perChannelData_t > *p, const LArOnOffIdMapping *cabling, const LArOFCAlg *a)
std::vector< perChannelData_t > * m_perChanData
const LArOnOffIdMapping * m_cabling
UnsignedIntegerProperty m_nSamples
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKeySC
UnsignedIntegerProperty m_nDelays
BooleanProperty m_timeShift
ToolHandle< ILArAutoCorrDecoderTool > m_AutoCorrDecoder
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
StringProperty m_ofcKeyV2
ToolHandle< ILArAutoCorrDecoderTool > m_AutoCorrDecoderV2
StatusCode initCaliWaveContainer()
IntegerProperty m_timeShiftByIndex
UnsignedIntegerProperty m_nPhases
std::unique_ptr< LArDSPConfig > m_DSPConfig
const CaloDetDescrManager_Base * m_calo_dd_man
StringProperty m_ofcBinKey
BooleanProperty m_fillShape
IntegerProperty m_useDelta
BooleanProperty m_computeV2
const LArOnlineID_Base * m_onlineID
BooleanProperty m_readCaliWave
UnsignedIntegerProperty m_dPhases
IntegerProperty m_useDeltaV2
std::vector< perChannelData_t > m_allChannelData
StatusCode initPhysWaveContainer(const LArOnOffIdMapping *cabling)
const LArOFCBinComplete * m_larPhysWaveBin
static void optFilt(const std::vector< float > &gWave_in, const std::vector< float > &gDerivWave_in, const Eigen::MatrixXd &autoCorrInv, std::vector< float > &OFCa, std::vector< float > &OFCb)
static void optFiltPed(const std::vector< float > &gWave_in, const std::vector< float > &gDerivWave_in, const Eigen::MatrixXd &autoCorrInv, std::vector< float > &OFCa, std::vector< float > &OFCb)
BooleanProperty m_readDSPConfig
StringProperty m_DSPConfigFolder
BooleanProperty m_forceShift
StringProperty m_larPhysWaveBinKey
FloatProperty m_addOffset
BooleanProperty m_storeMaxPhase
StringProperty m_shapeKey
bool verify(const HWIdentifier chid, const std::vector< float > &OFCa, const std::vector< float > &OFCb, const std::vector< float > &Shape, const char *ofcversion, const unsigned phase) const
SG::ReadCondHandleKey< CaloSuperCellDetDescrManager > m_caloSuperCellMgrKey
static void printOFCVec(const std::vector< float > &vec, MsgStream &mLog)
StringProperty m_dumpOFCfile
BooleanProperty m_computePed
BooleanProperty m_normalize
StringArrayProperty m_keylist
LArCaliWaveContainer * m_waveCnt_nc
LArOFCAlg(const std::string &name, ISvcLocator *pSvcLocator)
StringProperty m_groupingType
static void optFiltDelta(const std::vector< float > &gWave_in, const std::vector< float > &gDerivWave_in, const Eigen::MatrixXd &autoCorrInv, const Eigen::VectorXd &delta, std::vector< float > &vecOFCa, std::vector< float > &vecOFCb)
IntegerProperty m_nThreads
Helper for the Liquid Argon Calorimeter cell identifiers.
const std::string process
std::vector< std::vector< float > > ofcV2_a
perChannelData_t(const LArWaveCumul *wave, const HWIdentifier hi, const unsigned g)
std::vector< std::vector< float > > ofc_b
std::vector< std::vector< float > > shapeDer
std::vector< std::vector< float > > ofcV2_b
std::vector< std::vector< float > > shape
std::vector< std::vector< float > > ofc_a
const LArWaveCumul * inputWave