 |
ATLAS Offline Software
|
#include <LArOFCAlg.h>
|
| LArOFCAlg (const std::string &name, ISvcLocator *pSvcLocator) |
|
StatusCode | initialize () |
|
StatusCode | execute () |
|
virtual StatusCode | stop () |
|
StatusCode | finalize () |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
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 | 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, V, H > &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 |
|
|
void | process (perChannelData_t &, const LArOnOffIdMapping *cabling) const |
|
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 |
|
StatusCode | initPhysWaveContainer (const LArOnOffIdMapping *cabling) |
|
StatusCode | initCaliWaveContainer () |
|
Eigen::VectorXd | getDelta (std::vector< float > &samples, const HWIdentifier chid, unsigned nSamples) const |
|
bool | useDelta (const HWIdentifier chid, const int jobOFlag, const LArOnOffIdMapping *cabling) const |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
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 | 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) |
|
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) |
|
static void | printOFCVec (const std::vector< float > &vec, MsgStream &mLog) |
|
|
SG::ReadCondHandleKey< LArOnOffIdMapping > | m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"} |
|
SG::ReadCondHandleKey< LArOnOffIdMapping > | m_cablingKeySC {this,"ScCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"} |
|
SG::ReadCondHandleKey< CaloDetDescrManager > | m_caloMgrKey |
|
SG::ReadCondHandleKey< CaloSuperCellDetDescrManager > | m_caloSuperCellMgrKey |
|
std::vector< perChannelData_t > | m_allChannelData |
|
unsigned int | m_nPoints {0} |
|
StringProperty | m_dumpOFCfile {this, "DumpOFCfile", ""} |
|
StringArrayProperty | m_keylist {this, "KeyList", {}, "List of keys to process"} |
|
BooleanProperty | m_verify {this, "Verify", true, "Verufy OFCs after computation"} |
|
BooleanProperty | m_normalize {this, "Normalize", false, "Normalize input wave"} |
|
BooleanProperty | m_timeShift {this, "TimeShift", false, "Shifting input wave"} |
|
IntegerProperty | m_timeShiftByIndex {this, "TimeShiftByIndex", -1, "shifting by n bins input wave"} |
|
LArCaliWaveContainer * | m_waveCnt_nc =nullptr |
|
UnsignedIntegerProperty | m_nSamples {this, "Nsample", 5, "How many sample to compute"} |
|
UnsignedIntegerProperty | m_nPhases {this, "Nphase", 50, "How many sphases to compute"} |
|
UnsignedIntegerProperty | m_dPhases {this, "Dphase", 1, "Number of samples between two neighboring phases (OFC sets)"} |
|
UnsignedIntegerProperty | m_nDelays {this, "Ndelay", 24, "Number of delays in one clock"} |
|
FloatProperty | m_addOffset {this, "AddTimeOffset", 0., "Time offset to add"} |
|
ToolHandle< ILArAutoCorrDecoderTool > | m_AutoCorrDecoder {this,"DecoderTool",{} } |
|
ToolHandle< ILArAutoCorrDecoderTool > | m_AutoCorrDecoderV2 {this,"DecoderToolV2", {} } |
|
const CaloDetDescrManager_Base * | m_calo_dd_man {} |
|
const LArOnlineID_Base * | m_onlineID {} |
|
const LArOFCBinComplete * | m_larPhysWaveBin {} |
|
DoubleProperty | m_errAmpl {this, "ErrAmplitude", 0.01, "Allowed amplitude difference in check"} |
|
DoubleProperty | m_errTime {this, "ErrTime", 0.01, "Allowed time difference in check"} |
|
BooleanProperty | m_readCaliWave {this, "ReadCaliWave", true, "If false PhysWave is input"} |
|
BooleanProperty | m_fillShape {this, "FillShape", false, "Fill also shape object"} |
|
StringProperty | m_ofcKey {this, "KeyOFC", "LArOFC", "Output key non-pileup OFCs"} |
|
StringProperty | m_ofcKeyV2 {this, "KeyOFCV2", "LArOFCV2", "Output key pileup OFCs"} |
|
StringProperty | m_shapeKey {this, "KeyShape", "LArShape", "Output key Shape object"} |
|
BooleanProperty | m_storeMaxPhase {this,"StoreMaxPhase", false, "Store phase of input wave max.?"} |
|
StringProperty | m_ofcBinKey {this, "LArOFCBinKey", "LArOFCPhase","Key for storing OFCBin object for MAx phase"} |
|
StringProperty | m_groupingType {this, "GroupingType", "SubDetector","Which grouping type to use"} |
|
StringProperty | m_larPhysWaveBinKey {this,"LArPhysWaveBinKey", "", "Key for object to choose bin"} |
|
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"} |
|
IntegerProperty | m_useDeltaV2 {this, "UseDeltaV2", 0, "Same af before for Delta"} |
|
BooleanProperty | m_computeV2 {this, "ComputeOFCV2", false, "Compute pileup OFCs?"} |
|
BooleanProperty | m_computePed {this, "ComputeOFCPed", false, "Compute OFCs with additional constraint to pedestal?"} |
|
IntegerProperty | m_nThreads {this, "nThreads", -1, "-1: No TBB, 0: Let TBB decide, >0 number of threads"} |
|
BooleanProperty | m_readDSPConfig {this, "ReadDSPConfig", false, "Read DSPConfig object ?"} |
|
StringProperty | m_DSPConfigFolder {this,"DSPConfigFolder","/LAR/Configuration/DSPConfiguration", "Folder for DSPConfig object"} |
|
std::unique_ptr< LArDSPConfig > | m_DSPConfig |
|
BooleanProperty | m_forceShift {this, "ForceShift", false, "Forcing shift of input wave ?"} |
|
BooleanProperty | m_isSC {this, "isSC", false, "Running on cells or supercells?"} |
|
DataObjIDColl | m_extendedExtraObjects |
|
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 |
|
|
static const float | m_fcal3Delta [5] ={0.0790199937765, 0.0952000226825, 0.0790199937765, 0.0952000226825, 0.0790199937765} |
|
static const float | m_fcal2Delta [5] ={-0.01589001104, -0.0740399733186, -0.01589001104, -0.0740399733186, -0.01589001104} |
|
static const float | m_fcal1Delta [5] ={0.0679600232979, -0.139479996869, 0.0679600232979, -0.139479996869, 0.0679600232979} |
|
Definition at line 39 of file LArOFCAlg.h.
◆ StoreGateSvc_t
◆ LArOFCAlg()
LArOFCAlg::LArOFCAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode LArOFCAlg::execute |
( |
| ) |
|
|
inline |
Definition at line 46 of file LArOFCAlg.h.
46 {
return StatusCode::SUCCESS;}
◆ extraDeps_update_handler()
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
◆ extraOutputDeps()
const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
57 return Algorithm::extraOutputDeps();
◆ finalize()
StatusCode LArOFCAlg::finalize |
( |
| ) |
|
|
inline |
Definition at line 48 of file LArOFCAlg.h.
48 {
return StatusCode::SUCCESS;}
◆ getDelta()
Eigen::VectorXd LArOFCAlg::getDelta |
( |
std::vector< float > & |
samples, |
|
|
const HWIdentifier |
chid, |
|
|
unsigned |
nSamples |
|
) |
| const |
|
private |
Definition at line 853 of file LArOFCAlg.cxx.
881 for (
unsigned int i = 0;
i<samples.size();++
i) {
◆ initCaliWaveContainer()
StatusCode LArOFCAlg::initCaliWaveContainer |
( |
| ) |
|
|
private |
Definition at line 623 of file LArOFCAlg.cxx.
636 ATH_MSG_INFO(
"LArCaliWaveContainer: Corrections not yet applied, applying them now..." );
638 ATH_MSG_ERROR(
"Failed to apply corrections to LArCaliWaveContainer!" );
639 return StatusCode::FAILURE;
642 ATH_MSG_INFO(
"Applied corrections to non-const Wave container");
650 return StatusCode::FAILURE;
659 WAVEIT it_e=waveCnt->
end(
gain);
660 for (;
it!=it_e;++
it) {
662 for (
const auto& cw : wVec) {
671 return StatusCode::SUCCESS;
◆ initialize()
StatusCode LArOFCAlg::initialize |
( |
| ) |
|
Definition at line 46 of file LArOFCAlg.cxx.
52 return StatusCode::FAILURE;
58 return StatusCode::FAILURE;
68 return StatusCode::FAILURE;
78 msg(MSG::ERROR) <<
"Could not get LArOnlineID helper !" <<
endmsg;
79 return StatusCode::FAILURE;
89 msg(MSG::ERROR) <<
"Could not get LArOnlineID helper !" <<
endmsg;
90 return StatusCode::FAILURE;
109 return StatusCode::SUCCESS;
◆ initPhysWaveContainer()
Definition at line 589 of file LArOFCAlg.cxx.
598 if (
sc.isFailure()) {
607 WAVEIT it_e=waveCnt->
end(
gain);
608 for (;
it!=it_e;++
it) {
610 if (
cabling->isOnlineConnected (chid)){
619 return StatusCode::SUCCESS;
◆ inputHandles()
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.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ optFilt()
void LArOFCAlg::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 |
|
) |
| |
|
staticprivate |
Definition at line 675 of file LArOFCAlg.cxx.
677 assert(gWave.size()==gDerivWave.size());
679 const int optNpt = gWave.size();
681 Eigen::VectorXd gResp(optNpt), gDerivResp(optNpt);
682 for (
int i=0;
i<optNpt;
i++) {
684 gDerivResp[
i] = gDerivWave[
i];
687 Eigen::Matrix2d isol;
689 (gResp.transpose()*acInverse*gResp)[0],
690 (gResp.transpose()*acInverse*gDerivResp)[0],
691 (gDerivResp.transpose()*acInverse*gResp)[0],
692 (gDerivResp.transpose()*acInverse*gDerivResp)[0];
695 Eigen::Vector2d Atau;
696 Eigen::Vector2d Ktemp;
697 Eigen::Matrix2d isolInv = isol.inverse();
706 Atau = isolInv*Ktemp;
709 Eigen::VectorXd OFCa = Amp[0]*acInverse*gResp + Amp[1]*acInverse*gDerivResp;
710 Eigen::VectorXd OFCb = Atau[0]*acInverse*gResp + Atau[1]*acInverse*gDerivResp;
713 vecOFCa.resize(optNpt);
714 vecOFCb.resize(optNpt);
715 for (
int i=0;
i<optNpt;
i++) {
◆ optFiltDelta()
void LArOFCAlg::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 |
|
) |
| |
|
staticprivate |
HepVector delta(5) ;
delta[0]=3.79198742146; delta[1]=-4.84165741965; delta[2]=3.20189843985; delta[3]=-5.90850592618; delta[4]=1.8260451328;
Definition at line 773 of file LArOFCAlg.cxx.
779 assert(gWave.size()==gDerivWave.size());
781 const int optNpt = gWave.size();
783 Eigen::VectorXd gResp(optNpt), gDerivResp(optNpt);
784 for (
int i=0;
i<optNpt;
i++) {
786 gDerivResp[
i] = gDerivWave[
i];
801 Eigen::Matrix3d isol;
803 (gResp.transpose()*acInverse*gResp)[0],
804 (gResp.transpose()*acInverse*gDerivResp),
805 (gResp.transpose()*acInverse*delta)[0],
807 (gDerivResp.transpose()*acInverse*gResp)[0],
808 (gDerivResp.transpose()*acInverse*gDerivResp)[0],
809 (gDerivResp.transpose()*acInverse*delta)[0],
811 (delta.transpose()*acInverse*gResp)[0],
812 (delta.transpose()*acInverse*gDerivResp)[0],
813 (delta.transpose()*acInverse*delta)[0];
817 Eigen::Vector3d Atau;
818 Eigen::Vector3d Ktemp;
819 Eigen::Matrix3d isolInv = isol.inverse();
831 Atau = isolInv*Ktemp;
834 Eigen::VectorXd OFCa = Amp[0]*acInverse*gResp + Amp[1]*acInverse*gDerivResp + Amp[2]*acInverse * delta;
835 Eigen::VectorXd OFCb = Atau[0]*acInverse*gResp + Atau[1]*acInverse*gDerivResp + Atau[2]*acInverse * delta ;
839 vecOFCa.resize(optNpt);
840 vecOFCb.resize(optNpt);
841 for (
int i=0;
i<optNpt;
i++) {
◆ optFiltPed()
void LArOFCAlg::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 |
|
) |
| |
|
staticprivate |
Definition at line 721 of file LArOFCAlg.cxx.
723 assert(gWave.size()==gDerivWave.size());
725 const int optNpt = gWave.size();
727 Eigen::VectorXd gResp(optNpt), gDerivResp(optNpt);
728 for (
int i=0;
i<optNpt;
i++) {
730 gDerivResp[
i] = gDerivWave[
i];
733 Eigen::Matrix3d isol;
734 Eigen::Vector3d Kunit(1.,1.,1.);
735 auto s3=(gDerivResp.transpose()*acInverse*gResp)[0];
736 auto s4=(gResp.transpose()*acInverse*Kunit)[0];
737 auto s5=(gDerivResp.transpose()*acInverse*Kunit)[0];
739 (gResp.transpose()*acInverse*gResp)[0],
s3,
s4,
740 s3, (gDerivResp.transpose()*acInverse*gResp)[0], s5,
741 s4, s5, (Kunit.transpose()*acInverse*Kunit)[0];
744 Eigen::Vector3d Atau;
745 Eigen::Vector3d Ktemp;
746 Eigen::Matrix3d isolInv = isol.inverse();
757 Atau = isolInv*Ktemp;
760 Eigen::VectorXd OFCa = Amp[0]*acInverse*gResp + Amp[1]*acInverse*gDerivResp + Amp[2]*acInverse*Kunit;
761 Eigen::VectorXd OFCb = Atau[0]*acInverse*gResp + Atau[1]*acInverse*gDerivResp + Atau[2]*acInverse*Kunit;
764 vecOFCa.resize(optNpt);
765 vecOFCb.resize(optNpt);
766 for (
int i=0;
i<optNpt;
i++) {
◆ outputHandles()
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.
◆ printOFCVec()
void LArOFCAlg::printOFCVec |
( |
const std::vector< float > & |
vec, |
|
|
MsgStream & |
mLog |
|
) |
| |
|
staticprivate |
Definition at line 992 of file LArOFCAlg.cxx.
993 mLog << MSG::WARNING <<
"OFCs";
◆ process()
Definition at line 395 of file LArOFCAlg.cxx.
407 const unsigned gain=chanData.gain;
414 <<
") is too small to fit your OFC request (" <<
m_nPoints <<
" points)" ) ;
415 chanData.shortWave=
true;
442 aWave = aWave * (1./peak);
449 chanData.tstart = larWaveHelper.
getStart(aWave) ;
462 float maxSampleValAt3=-1;
477 Eigen::MatrixXd acInverseV2;
491 for (
unsigned iPhase=0;iPhase<
m_nPhases;iPhase++) {
494 <<
", Gain = " <<
gain <<
", Phase = " << iPhase <<
":");
498 std::vector<float>& theSamples=chanData.shape[iPhase];
499 std::vector<float>& theSamplesDer=chanData.shapeDer[iPhase];
505 for (
unsigned iSample=0;iSample<
m_nSamples;++iSample){
506 const unsigned tbin = chanData.tstart + iPhase*
m_dPhases + (iSample+tShift)*
m_nDelays ;
507 theSamples.push_back( aWave.
getSample(tbin) );
508 theSamplesDer.push_back( aDerivedWave.
getSample(tbin) );
513 maxSampleValAt3=theSamples[2];
514 chanData.phasewMaxAt3=iPhase;
519 Eigen::VectorXd delta;
521 if (thisChanUseDelta || thisChanUseDeltaV2) {
522 std::vector<float> theSamples32;
523 theSamples32.reserve(32);
524 for (
unsigned iSample=0;iSample<32 ;++iSample){
525 const unsigned tbin = chanData.tstart + iPhase*
m_dPhases + (iSample+tShift)*
m_nDelays ;
526 if (tbin>=aWave.
getSize())
continue;
527 theSamples32.push_back( aWave.
getSample(tbin) );
534 std::vector<float>& vOFC_a= chanData.ofc_a[iPhase];
535 std::vector<float>& vOFC_b= chanData.ofc_b[iPhase];
538 optFiltPed(theSamples,theSamplesDer,acInverse,vOFC_a,vOFC_b);
540 if (thisChanUseDelta) {
541 optFiltDelta(theSamples,theSamplesDer,acInverse,delta,vOFC_a,vOFC_b);
544 optFilt(theSamples,theSamplesDer,acInverse,vOFC_a,vOFC_b);
550 chanData.faultyOFC |=
verify(chanData.chid,vOFC_a,vOFC_b,theSamples,
"OFC",iPhase);
557 std::vector<float>& vOFCV2_a= chanData.ofcV2_a[iPhase];
558 std::vector<float>& vOFCV2_b= chanData.ofcV2_b[iPhase];
561 optFiltPed(theSamples,theSamplesDer,acInverseV2,vOFCV2_a,vOFCV2_b);
563 if (thisChanUseDeltaV2) {
564 optFiltDelta(theSamples,theSamplesDer,acInverseV2,delta,vOFCV2_a,vOFCV2_b);
567 optFilt(theSamples,theSamplesDer,acInverseV2,vOFCV2_a,vOFCV2_b);
573 chanData.faultyOFC |=
verify(chanData.chid,vOFCV2_a,vOFCV2_b,theSamples,
"OFCV2",iPhase);
◆ renounce()
◆ renounceArray()
◆ stop()
StatusCode LArOFCAlg::stop |
( |
| ) |
|
|
virtual |
TBB global control parameter
Definition at line 113 of file LArOFCAlg.cxx.
132 ATH_CHECK(caloSuperCellMgrHandle.isValid());
150 ATH_MSG_INFO(
" Will use helper class for start time." );
175 m_DSPConfig = std::make_unique<LArDSPConfig>(attrList);
181 return StatusCode::FAILURE;
206 std::unique_ptr<tbb::global_control> tbbgc;
209 tbbgc=std::make_unique<tbb::global_control>( tbb::global_control::max_allowed_parallelism,
m_nThreads);
216 tbb::parallel_for(tbb::blocked_range<size_t>(0,
m_allChannelData.size()),looper);
231 std::unique_ptr<LArOFCComplete> larOFCComplete=std::make_unique<LArOFCComplete>();
233 if (
sc.isFailure()) {
234 ATH_MSG_ERROR(
"Failed to set groupingType for LArOFCComplete object" );
238 if (
sc.isFailure()) {
244 std::unique_ptr<LArOFCComplete> larOFCCompleteV2=std::make_unique<LArOFCComplete>();
246 if (
sc.isFailure()) {
247 ATH_MSG_ERROR(
"Failed to set groupingType for LArOFCComplete object" );
251 if (
sc.isFailure()) {
257 std::unique_ptr<LArOFCBinComplete> larOFCBinComplete;
259 larOFCBinComplete=std::make_unique<LArOFCBinComplete>();
261 if (
sc.isFailure()) {
262 ATH_MSG_ERROR(
"Failed to set groupingType for LArOFCBinComplete object" );
266 if (
sc.isFailure() ) {
267 ATH_MSG_ERROR(
"Could not initialize LArOFCComplete data object - exit!" ) ;
273 std::unique_ptr<LArShapeComplete> larShapeComplete;
275 larShapeComplete = std::make_unique<LArShapeComplete>();
277 if (
sc.isFailure()) {
278 ATH_MSG_ERROR(
"Failed to set groupingType for LArShapeComplete object" );
282 if (
sc.isFailure()) {
283 ATH_MSG_ERROR(
"Failed initialize LArShapeComplete object" );
295 if (chanData.faultyOFC) ++nFailed;
298 const int gain=chanData.gain;
300 const std::vector<std::vector<float> > & allPhaseOFCa=chanData.ofc_a;
301 const std::vector<std::vector<float> > & allPhaseOFCb=chanData.ofc_b;
302 const std::vector<std::vector<float> > & allPhaseShape=chanData.shape;
303 const std::vector<std::vector<float> > & allPhaseShapeDer=chanData.shapeDer;
304 larOFCComplete->
set(ch_id,
gain,allPhaseOFCa,allPhaseOFCb,chanData.tstart,chanData.timeBinWidthOFC);
305 if (larOFCBinComplete) larOFCBinComplete->
set(ch_id,
gain,chanData.phasewMaxAt3);
306 if (
m_fillShape ) larShapeComplete->
set(ch_id,
gain,allPhaseShape,allPhaseShapeDer,chanData.tstart,chanData.timeBinWidthOFC);
310 const std::vector<std::vector<float> > & allPhaseOFCV2a=chanData.ofcV2_a;
311 const std::vector<std::vector<float> > & allPhaseOFCV2b=chanData.ofcV2_b;
312 larOFCCompleteV2->
set(ch_id,
gain,allPhaseOFCV2a,allPhaseOFCV2b,chanData.tstart,chanData.timeBinWidthOFC);
319 ATH_MSG_ERROR(
"Number of channels * gains with failed OFC verification: " << nFailed );
327 if (
sc.isFailure()) {
329 return StatusCode::FAILURE;
334 if (
sc.isFailure()) {
335 ATH_MSG_ERROR(
"Could not symlink ILArOFC with LArOFCComplete." );
336 return StatusCode::FAILURE;
344 if (
sc.isFailure()) {
346 return StatusCode::FAILURE;
351 if (
sc.isFailure()) {
352 ATH_MSG_ERROR(
"Could not symlink ILArOFC with LArOFCComplete." );
353 return StatusCode::FAILURE;
358 if (larOFCBinComplete) {
360 if (
sc.isFailure()) {
362 return StatusCode::FAILURE;
370 if (
sc.isFailure()) {
372 return StatusCode::FAILURE;
375 ATH_MSG_DEBUG(
"Trying to symlink ILArShape with LArShapeComplete");
377 if (
sc.isFailure()) {
378 ATH_MSG_ERROR(
"Could not symlink ILArShape with LArShapeComplete." );
379 return StatusCode::FAILURE;
381 ATH_MSG_INFO(
"ILArShape symlink with LArShapeComplete successfully" ) ;
388 ATH_MSG_INFO(
"Reverted corrections of non-cost wave container");
391 return StatusCode::SUCCESS;
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ useDelta()
Definition at line 902 of file LArOFCAlg.cxx.
920 if (
cabling->isOnlineConnected (chid)){
924 ATH_MSG_ERROR(
" dde = 0 , onl_id, ofl_id= "<< chid<<
" "<<ofl_id );
933 if (fabs(dde->
eta())>4.0){
943 if (fabs(dde->
eta())>4.0){
◆ verify()
Definition at line 958 of file LArOFCAlg.cxx.
962 float recAmpl=0, recTime=0;
963 for (
unsigned iSample=0;iSample<
m_nSamples;++iSample){
965 #ifdef LAROFCALG_DEBUGOUTPUT
966 ATH_MSG_VERBOSE(
"a["<<iSample<<
"]="<<vOFC_a[iSample] <<
" b["<<iSample<<
"]="<<vOFC_b[iSample]
967 <<
" Sample=" << aWave.getSample(tbin));
969 recAmpl += OFCa[iSample] * Shape[iSample];
970 recTime += OFCb[iSample] * Shape[iSample];
978 ATH_MSG_WARNING(
"Applying phase " <<
phase <<
" of " << ofcversion <<
" to original wave yields an Amplitude of "<< recAmpl
984 ATH_MSG_WARNING(
"Applying phase " <<
phase <<
" of " << ofcversion <<
" to original wave yields a time offset of " << recTime
◆ m_addOffset
FloatProperty LArOFCAlg::m_addOffset {this, "AddTimeOffset", 0., "Time offset to add"} |
|
private |
◆ m_allChannelData
◆ m_AutoCorrDecoder
◆ m_AutoCorrDecoderV2
◆ m_cablingKey
◆ m_cablingKeySC
◆ m_calo_dd_man
◆ m_caloMgrKey
Initial value:{ this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" }
Definition at line 55 of file LArOFCAlg.h.
◆ m_caloSuperCellMgrKey
Initial value:{ this
, "CaloSuperCellDetDescrManager"
, "CaloSuperCellDetDescrManager"
, "SG Key for CaloSuperCellDetDescrManager in the Condition Store" }
Definition at line 60 of file LArOFCAlg.h.
◆ m_computePed
BooleanProperty LArOFCAlg::m_computePed {this, "ComputeOFCPed", false, "Compute OFCs with additional constraint to pedestal?"} |
|
private |
◆ m_computeV2
BooleanProperty LArOFCAlg::m_computeV2 {this, "ComputeOFCV2", false, "Compute pileup OFCs?"} |
|
private |
◆ m_detStore
◆ m_dPhases
UnsignedIntegerProperty LArOFCAlg::m_dPhases {this, "Dphase", 1, "Number of samples between two neighboring phases (OFC sets)"} |
|
private |
◆ m_DSPConfig
◆ m_DSPConfigFolder
StringProperty LArOFCAlg::m_DSPConfigFolder {this,"DSPConfigFolder","/LAR/Configuration/DSPConfiguration", "Folder for DSPConfig object"} |
|
private |
◆ m_dumpOFCfile
StringProperty LArOFCAlg::m_dumpOFCfile {this, "DumpOFCfile", ""} |
|
private |
◆ m_errAmpl
DoubleProperty LArOFCAlg::m_errAmpl {this, "ErrAmplitude", 0.01, "Allowed amplitude difference in check"} |
|
private |
◆ m_errTime
DoubleProperty LArOFCAlg::m_errTime {this, "ErrTime", 0.01, "Allowed time difference in check"} |
|
private |
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_fcal1Delta
const float LArOFCAlg::m_fcal1Delta ={0.0679600232979, -0.139479996869, 0.0679600232979, -0.139479996869, 0.0679600232979} |
|
staticprivate |
◆ m_fcal2Delta
const float LArOFCAlg::m_fcal2Delta ={-0.01589001104, -0.0740399733186, -0.01589001104, -0.0740399733186, -0.01589001104} |
|
staticprivate |
◆ m_fcal3Delta
const float LArOFCAlg::m_fcal3Delta ={0.0790199937765, 0.0952000226825, 0.0790199937765, 0.0952000226825, 0.0790199937765} |
|
staticprivate |
◆ m_fillShape
BooleanProperty LArOFCAlg::m_fillShape {this, "FillShape", false, "Fill also shape object"} |
|
private |
◆ m_forceShift
BooleanProperty LArOFCAlg::m_forceShift {this, "ForceShift", false, "Forcing shift of input wave ?"} |
|
private |
◆ m_groupingType
StringProperty LArOFCAlg::m_groupingType {this, "GroupingType", "SubDetector","Which grouping type to use"} |
|
private |
◆ m_isSC
BooleanProperty LArOFCAlg::m_isSC {this, "isSC", false, "Running on cells or supercells?"} |
|
private |
◆ m_keylist
StringArrayProperty LArOFCAlg::m_keylist {this, "KeyList", {}, "List of keys to process"} |
|
private |
◆ m_larPhysWaveBin
◆ m_larPhysWaveBinKey
StringProperty LArOFCAlg::m_larPhysWaveBinKey {this,"LArPhysWaveBinKey", "", "Key for object to choose bin"} |
|
private |
◆ m_nDelays
UnsignedIntegerProperty LArOFCAlg::m_nDelays {this, "Ndelay", 24, "Number of delays in one clock"} |
|
private |
◆ m_normalize
BooleanProperty LArOFCAlg::m_normalize {this, "Normalize", false, "Normalize input wave"} |
|
private |
◆ m_nPhases
UnsignedIntegerProperty LArOFCAlg::m_nPhases {this, "Nphase", 50, "How many sphases to compute"} |
|
private |
◆ m_nPoints
unsigned int LArOFCAlg::m_nPoints {0} |
|
private |
◆ m_nSamples
UnsignedIntegerProperty LArOFCAlg::m_nSamples {this, "Nsample", 5, "How many sample to compute"} |
|
private |
◆ m_nThreads
IntegerProperty LArOFCAlg::m_nThreads {this, "nThreads", -1, "-1: No TBB, 0: Let TBB decide, >0 number of threads"} |
|
private |
◆ m_ofcBinKey
StringProperty LArOFCAlg::m_ofcBinKey {this, "LArOFCBinKey", "LArOFCPhase","Key for storing OFCBin object for MAx phase"} |
|
private |
◆ m_ofcKey
StringProperty LArOFCAlg::m_ofcKey {this, "KeyOFC", "LArOFC", "Output key non-pileup OFCs"} |
|
private |
◆ m_ofcKeyV2
StringProperty LArOFCAlg::m_ofcKeyV2 {this, "KeyOFCV2", "LArOFCV2", "Output key pileup OFCs"} |
|
private |
◆ m_onlineID
◆ m_readCaliWave
BooleanProperty LArOFCAlg::m_readCaliWave {this, "ReadCaliWave", true, "If false PhysWave is input"} |
|
private |
◆ m_readDSPConfig
BooleanProperty LArOFCAlg::m_readDSPConfig {this, "ReadDSPConfig", false, "Read DSPConfig object ?"} |
|
private |
◆ m_shapeKey
StringProperty LArOFCAlg::m_shapeKey {this, "KeyShape", "LArShape", "Output key Shape object"} |
|
private |
◆ m_storeMaxPhase
BooleanProperty LArOFCAlg::m_storeMaxPhase {this,"StoreMaxPhase", false, "Store phase of input wave max.?"} |
|
private |
◆ m_timeShift
BooleanProperty LArOFCAlg::m_timeShift {this, "TimeShift", false, "Shifting input wave"} |
|
private |
◆ m_timeShiftByIndex
IntegerProperty LArOFCAlg::m_timeShiftByIndex {this, "TimeShiftByIndex", -1, "shifting by n bins input wave"} |
|
private |
◆ m_useDelta
IntegerProperty LArOFCAlg::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"} |
|
private |
◆ m_useDeltaV2
IntegerProperty LArOFCAlg::m_useDeltaV2 {this, "UseDeltaV2", 0, "Same af before for Delta"} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_verify
BooleanProperty LArOFCAlg::m_verify {this, "Verify", true, "Verufy OFCs after computation"} |
|
private |
◆ m_vhka
◆ m_waveCnt_nc
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
BooleanProperty m_computeV2
Eigen::VectorXd getDelta(std::vector< float > &samples, const HWIdentifier chid, unsigned nSamples) const
unsigned constexpr int nChannels
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)
SG::ReadCondHandleKey< CaloSuperCellDetDescrManager > m_caloSuperCellMgrKey
UnsignedIntegerProperty m_nDelays
StatusCode applyCorrections()
apply correction set
void set(const HWIdentifier &CellID, int gain, const std::vector< std::vector< float > > &vOFC_a, const std::vector< std::vector< float > > &vOFC_b, float timeOffset=0, float timeBinWidth=25./24.)
size_t getSize() const
number of time samples
unsigned getStart(const LArWave &theWave) const
unsigned getFlag() const
flag: ...
virtual const int & bin(const HWIdentifier &chid, const int &gain) const
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
StatusCode undoCorrections()
undo corrections that have been already applied
StringProperty m_DSPConfigFolder
virtual bool isEMECIW(const HWIdentifier id) const =0
BooleanProperty m_fillShape
Declaration of const iterator.
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
StringProperty m_groupingType
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
BooleanProperty m_timeShift
const double & getDt() const
delta time
int slot(const HWIdentifier id) const
Return the slot number of a hardware cell identifier: slot = [1,15] Slot-ID in top part of the crat...
LArWave translate(const LArWave &theWave, int nShift, double baseline=0.) const
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
bool useDelta(const HWIdentifier chid, const int jobOFlag, const LArOnOffIdMapping *cabling) const
std::vector< SG::VarHandleKeyArray * > m_vhka
const coral::AttributeList & coralList() const
IntegerProperty m_nThreads
BooleanProperty m_normalize
StringArrayProperty m_keylist
std::vector< size_t > vec
#define ATH_MSG_VERBOSE(x)
unsigned int getMax(const LArWave &theWave) const
return index of maximum sample
static const float m_fcal1Delta[5]
StringProperty m_ofcKeyV2
value_type get_compact() const
Get the compact id.
Liquid Argon Physics Wave Container.
StringProperty m_larPhysWaveBinKey
Liquid Argon Cumulative Wave Container.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
static const float m_fcal3Delta[5]
ToolHandle< ILArAutoCorrDecoderTool > m_AutoCorrDecoder
FloatProperty m_addOffset
void process(perChannelData_t &, const LArOnOffIdMapping *cabling) const
bool isFCALchannel(const HWIdentifier id) const
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
const double & getSample(const unsigned int i) const
Amplitude per time bin.
std::vector< perChannelData_t > m_allChannelData
BooleanProperty m_computePed
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
virtual StatusCode sysInitialize() override
Override sysInitialize.
bool isEmpty() const
is LArWave uninitialized?
StatusCode initPhysWaveContainer(const LArOnOffIdMapping *cabling)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
ConstConditionsMapIterator end(unsigned int gain) const
end of all channels for this gain
const LArOnlineID_Base * m_onlineID
virtual bool isHECchannel(const HWIdentifier id) const =0
const CaloDetDescrManager_Base * m_calo_dd_man
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
static const float m_fcal2Delta[5]
IntegerProperty m_useDelta
StringProperty m_ofcBinKey
Default, invalid implementation of ClassID_traits.
static void printOFCVec(const std::vector< float > &vec, MsgStream &mLog)
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)
StringProperty m_dumpOFCfile
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
BooleanProperty m_readCaliWave
ToolHandle< ILArAutoCorrDecoderTool > m_AutoCorrDecoderV2
int getTimeOffset() const
std::unique_ptr< LArDSPConfig > m_DSPConfig
StatusCode initCaliWaveContainer()
HWIdentifier feb_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Create feb_Id from fields.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
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)
UnsignedIntegerProperty m_nSamples
BooleanProperty m_forceShift
Helper for the Liquid Argon Calorimeter cell identifiers.
void set(const HWIdentifier &CellID, int gain, const std::vector< std::vector< float > > &vShape, const std::vector< std::vector< float > > &vShapeDer, float timeOffset=0, float timeBinWidth=25./24.)
IntegerProperty m_timeShiftByIndex
const LArOFCBinComplete * m_larPhysWaveBin
StatusCode initialize(bool used=true)
UnsignedIntegerProperty m_dPhases
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKeySC
DataObjIDColl m_extendedExtraObjects
LArCaliWaveContainer * m_waveCnt_nc
CaloCell_ID::CaloSample getSampling() const
cell sampling
virtual StatusCode initialize()
Initialization done after creation or read back - derived classes may augment the functionality.
#define ATH_MSG_WARNING(x)
ConstConditionsMapIterator begin(unsigned int gain) const
get iterator for all channels for a gain
BooleanProperty m_readDSPConfig
LArWave derive_smooth(const LArWave &theWave) const
smoothed derivative
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
float eta() const
cell eta
AthAlgorithm()
Default constructor:
UnsignedIntegerProperty m_nPhases
IntegerProperty m_useDeltaV2
void dumpOFC(const std::string &output_file_name) const
void set(const HWIdentifier &chid, const int &gain, const int &bin)
std::string channel_name(const HWIdentifier id) const
Return a string corresponding to a feedthrough name given an identifier.
StringProperty m_shapeKey
BooleanProperty m_storeMaxPhase
bool correctionsApplied() const
Have corrections been applied?