#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;
117 const double& DBchannelPhase=larH6Oscillations->
channelPhase(chid);
120 if( DBpedestalRMS > 0 && DBchannelAmplitude>0 ) {
121 theRMSValues.push_back(DBpedestalRMS);
122 theSamples.push_back(samples);
123 theChannelPhases.push_back(DBchannelPhase);
124 theChannelAmplitudes.push_back(DBchannelAmplitude);
127 thePedestals.push_back(DBpedestal);
129 ATH_MSG_DEBUG (
"No valid pedestal found for this cell. Exiting ...." );
130 return StatusCode::FAILURE;
140 for(
double myEventPhase = -
M_PI; myEventPhase<
M_PI; myEventPhase+=0.1) {
142 for (
unsigned int i=0;
i<iHECChan;
i++) {
143 unsigned int nSamples = theSamples[
i].size();
144 for(
unsigned int j=0;j<
nSamples;j++) {
147 if ( j == 0 || (std::abs(theSamples[
i][j] - theSamples[
i][0]) <=
m_nSigma*theRMSValues[
i]
148 && ( j <= 0 || std::abs(theSamples[
i][j-1] - theSamples[
i][0]) <=
m_nSigma*theRMSValues[
i])
149 && ( j >=
nSamples-1 || std::abs(theSamples[
i][j+1] - theSamples[
i][0]) <=
m_nSigma*theRMSValues[
i])) ) {
153 lchitest +=
pow((theSamples[
i][j] - thePedestals[
i]
155 +theChannelPhases[
i]+myEventPhase))
160 if ( lchitest < lchimin || lchimin < 0 ) {
166 ATH_MSG_DEBUG (
"Ending eventphase calculation. Phase = <" <<
m_eventPhase <<
">, Number of Channels used = <" << iHECChan <<
">, Average Number of Samples Used = <"
167 << (iHECChan > 0 ? (
double)nTotSamples/iHECChan : 0)
169 return StatusCode::SUCCESS;
◆ correctLArDigits()
| StatusCode LArDigitOscillationCorrTool::correctLArDigits |
( |
LArDigitContainer & |
theDC | ) |
|
|
override |
Definition at line 173 of file LArDigitOscillationCorrTool.cxx.
181 std::vector<double> theChannelAmplitudes;
182 std::vector<double> theChannelPhases;
191 return StatusCode::FAILURE;
194 for (
unsigned int i=0;
i<theDC.
size();
i++) {
197 const std::vector<short>& samples = theDigit->
samples();
198 unsigned int nSamples = samples.size();
211 const double& DBchannelPhase=larH6Oscillations->
channelPhase(chid);
215 <<
", the ChannelAmplitude is " << DBchannelAmplitude
216 <<
", the ChannelPhase is " << DBchannelPhase );
218 if( DBchannelAmplitude>0 ) {
219 std::vector<short> new_samples(
nSamples);
220 for(
unsigned int j=0;j<
nSamples;j++)
221 new_samples[j] = (
short)(samples[j] + 0.5
226 theDC[
i] = theNewDigit;
230 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