#include <LArDigitOscillationCorrTool.h>
◆ LArDigitOscillationCorrTool()
LArDigitOscillationCorrTool::LArDigitOscillationCorrTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~LArDigitOscillationCorrTool()
LArDigitOscillationCorrTool::~LArDigitOscillationCorrTool |
( |
| ) |
|
|
default |
◆ calculateEventPhase()
Definition at line 65 of file LArDigitOscillationCorrTool.cxx.
75 ATH_MSG_DEBUG (
"Retrieving channel phases and amplituides " );
78 unsigned int iHECChan(0);
79 std::vector<std::vector<short> > theSamples;
80 std::vector<float> thePedestals;
81 std::vector<double> theChannelAmplitudes;
82 std::vector<double> theChannelPhases;
83 std::vector<float> theRMSValues;
92 return StatusCode::FAILURE;
96 for (
unsigned int i=0;
i<theDC.
size();
i++) {
99 const std::vector<short>& samples = theDigit->
samples();
114 ATH_MSG_DEBUG (
"No pedestal RMS found for this cell. Exiting ...." );
115 return StatusCode::FAILURE;
118 const double& DBchannelPhase=larH6Oscillations->
channelPhase(chid);
122 if( DBpedestalRMS > 0 && DBchannelAmplitude>0 ) {
123 theRMSValues.push_back(DBpedestalRMS);
124 theSamples.push_back(samples);
125 theChannelPhases.push_back(DBchannelPhase);
126 theChannelAmplitudes.push_back(DBchannelAmplitude);
129 thePedestals.push_back(DBpedestal);
131 ATH_MSG_DEBUG (
"No valid pedestal found for this cell. Exiting ...." );
132 return StatusCode::FAILURE;
142 for(
double myEventPhase = -
M_PI; myEventPhase<
M_PI; myEventPhase+=0.1) {
144 for (
unsigned int i=0;
i<iHECChan;
i++) {
145 unsigned int nSamples = theSamples[
i].size();
146 for(
unsigned int j=0;j<
nSamples;j++) {
149 if ( j == 0 || (std::abs(theSamples[
i][j] - theSamples[
i][0]) <=
m_nSigma*theRMSValues[
i]
150 && ( j <= 0 || std::abs(theSamples[
i][j-1] - theSamples[
i][0]) <=
m_nSigma*theRMSValues[
i])
151 && ( j >=
nSamples-1 || std::abs(theSamples[
i][j+1] - theSamples[
i][0]) <=
m_nSigma*theRMSValues[
i])) ) {
155 lchitest +=
pow((theSamples[
i][j] - thePedestals[
i]
157 +theChannelPhases[
i]+myEventPhase))
162 if ( lchitest < lchimin || lchimin < 0 ) {
168 ATH_MSG_DEBUG (
"Ending eventphase calculation. Phase = <" <<
m_eventPhase <<
">, Number of Channels used = <" << iHECChan <<
">, Average Number of Samples Used = <"
169 << (iHECChan > 0 ? (
double)nTotSamples/iHECChan : 0)
171 return StatusCode::SUCCESS;
◆ correctLArDigits()
StatusCode LArDigitOscillationCorrTool::correctLArDigits |
( |
LArDigitContainer & |
theDC | ) |
|
|
override |
Definition at line 175 of file LArDigitOscillationCorrTool.cxx.
183 std::vector<double> theChannelAmplitudes;
184 std::vector<double> theChannelPhases;
193 return StatusCode::FAILURE;
196 for (
unsigned int i=0;
i<theDC.
size();
i++) {
199 const std::vector<short>& samples = theDigit->
samples();
200 unsigned int nSamples = samples.size();
213 const double& DBchannelPhase=larH6Oscillations->
channelPhase(chid);
217 <<
", the ChannelAmplitude is " << DBchannelAmplitude
218 <<
", the ChannelPhase is " << DBchannelPhase );
220 if( DBchannelAmplitude>0 ) {
221 std::vector<short> new_samples(
nSamples);
222 for(
unsigned int j=0;j<
nSamples;j++)
223 new_samples[j] = (
short)(samples[j] + 0.5
228 theDC[
i] = theNewDigit;
232 return StatusCode::SUCCESS;
◆ handle()
void LArDigitOscillationCorrTool::handle |
( |
const Incident & |
| ) |
|
|
overridevirtual |
◆ initialize()
StatusCode LArDigitOscillationCorrTool::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 41 of file LArDigitOscillationCorrTool.cxx.
43 ATH_MSG_DEBUG (
"LArDigitOscillationCorrTool initialize() begin" );
55 SmartIF<IIncidentSvc> incSvc{Gaudi::svcLocator()->service(
"IncidentSvc")};
59 incSvc->addListener(
this,
"BeginRun",
m_priority);
61 ATH_MSG_DEBUG (
"LArDigitOscillationCorrTool initialize() end" );
62 return StatusCode::SUCCESS;
◆ retrieveDB()
StatusCode LArDigitOscillationCorrTool::retrieveDB |
( |
| ) |
|
|
private |
◆ m_cablingKey
◆ m_emId
◆ m_eventPhase
double LArDigitOscillationCorrTool::m_eventPhase |
|
private |
◆ m_fcalId
◆ m_hecId
◆ m_lar_on_id
◆ m_nSigma
double LArDigitOscillationCorrTool::m_nSigma |
|
private |
◆ m_omega
double LArDigitOscillationCorrTool::m_omega |
|
private |
◆ m_priority
int LArDigitOscillationCorrTool::m_priority |
|
private |
The documentation for this class was generated from the following files:
virtual float pedestalRMS(const HWIdentifier &id, int gain) const =0
access to RMS of Pedestal index by Identifier, and gain setting