|
ATLAS Offline Software
|
#include <LArPhysWaveHECTool.h>
|
| LArPhysWaveHECTool (const std::string &type, const std::string &name, const IInterface *parent) |
|
virtual | ~LArPhysWaveHECTool () |
|
virtual StatusCode | initialize () |
|
virtual StatusCode | finalize () |
|
StatusCode | makeLArPhysWaveHEC (LArWFParams &wfParams, LArCaliWave &caliWave, LArPhysWave &predLArPhysWave, const LArPhysWave &LArIdealPhysWave, float &MphysMcali, const HWIdentifier &chid, const int gain, int &LArPhysWaveFlag) |
|
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 | sysInitialize () override |
| Perform system initialization for an algorithm. 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 > &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 | predict_phys_HEC (LArWFParams &wfParams, LArCaliWave &caliWave, LArPhysWave &predLArPhysWave, float &MphysMcali, const HWIdentifier &chid, const int gain) |
|
TF1 * | CaliWave2PhysWaveHEC (TProfile *pcal, Double_t *par, double *parCL, TF1 *&deriv, Bool_t uset0, Bool_t norm, int adc, Double_t *xmax, bool gsl_flag) |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
Definition at line 38 of file LArPhysWaveHECTool.h.
◆ StoreGateSvc_t
◆ LArPhysWaveHECTool()
LArPhysWaveHECTool::LArPhysWaveHECTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~LArPhysWaveHECTool()
LArPhysWaveHECTool::~LArPhysWaveHECTool |
( |
| ) |
|
|
virtual |
◆ CaliWave2PhysWaveHEC()
TF1 * LArPhysWaveHECTool::CaliWave2PhysWaveHEC |
( |
TProfile * |
pcal, |
|
|
Double_t * |
par, |
|
|
double * |
parCL, |
|
|
TF1 *& |
deriv, |
|
|
Bool_t |
uset0, |
|
|
Bool_t |
norm, |
|
|
int |
adc, |
|
|
Double_t * |
xmax, |
|
|
bool |
gsl_flag |
|
) |
| |
|
private |
Definition at line 662 of file LArPhysWaveHECTool.cxx.
665 TF1 *fitfun{}, *fu{};
666 Int_t
i{},nbin{},nbino{},i5bin{},
count{} ;
667 Double_t pampl{},
t5{}, mcut{}, rshift{}, rmult{};
689 nbino = nbin = pcal->GetNbinsX();
697 mcut = 0.05*pcal->GetMaximum();
700 cout<<
"mcut: "<<mcut<<endl;
702 for(
i=1;
i<=nbin; ++
i) {
703 x[
i-1] = pcal->GetBinCenter(
i);
704 y[
i-1] = pcal->GetBinContent(
i);
705 if(i5bin == 0 &&
y[
i-1] > mcut) i5bin =
i;
709 printf(
"\n number of bins too small !\n");
712 t5 = (mcut-
y[i5bin-2])*(
x[i5bin-1]-
x[i5bin-2])/(
y[i5bin-1]-
y[i5bin-2]);
720 if(fabs((
x[1] -
x[0]) - (
x[3] -
x[2])) > 0.000001 ) {
721 cout<<
x[0] <<
" " <<
x[1] <<
" " <<
x[2] <<
" " <<
x[3] << endl;
722 printf(
"\n Nonuniform step !\n");
729 if(pref)
delete [] pref;
730 pref =
new Double_t[nbin];
733 for(
i=0;
i<nbin; ++
i) {
734 if(
x[
i] < t0) {pref[
i] = 0.;
continue;}
740 if(
i<nbin) nbin =
i+1;
743 if(splin)
delete splin;
744 splin =
new TSpline3(
"sp",
x,pref,nbin,
"b1",0.);
745 fu =
new TF1(
"fu",P,
x[15],
x[nbin-15],2);
746 fu->SetParName(0,
"t0 shift");
747 fu->SetParLimits(0,-15.,15.);
748 fu->SetParName(1,
"mult");
749 fu->SetParLimits(1,0.,10000.);
750 fu->SetParameters(5.,5.);
752 if( pcal->Fit(
"fu",
"RQ0") == 0) {
753 rshift = pcal->GetFunction(
"fu")->GetParameter(0);
754 rmult = pcal->GetFunction(
"fu")->GetParameter(1);
762 for(
i=0;
i<nbin; ++
i) {
763 if(
x[
i] < t0-rshift) {pref[
i] = 0.;
continue;}
769 if(
i<nbin) nbin =
i+1;
772 for(
i=1;
i<=nbin; ++
i)
x[
i-1] -= t0;
776 for(
i=1;
i<=nbin; ++
i)
x[
i-1] +=
par[0];
781 if(splin)
delete splin;
782 splin =
new TSpline3(
"sp",
x,pref,nbin,
"b1",0.);
787 fitfun =
new TF1(
"fitfun",&Tp,
x[0],
x[nbin-1],3);
789 fitfun =
new TF1(
"fitfun",&Tp_gsl,
x[0],
x[nbin-1],3);
791 fitfun->SetParName(0,
"t0 shift");
792 fitfun->SetParLimits(0,0.,100.);
793 fitfun->SetParName(1,
"mult");
794 fitfun->SetParLimits(1,0.,100.);
795 fitfun->SetParName(2,
"Taus");
796 fitfun->SetParLimits(2,0.1,10.);
797 fitfun->SetNpx(nbin+1);
798 fitfun->SetParameters(
par[0],
par[1],
par[2]);
807 deriv =
new TF1(
"derivfun",&DTp,
x[0],
x[nbin-1],3);
808 deriv->SetParName(0,
"t0 shift");
809 deriv->SetParLimits(0,0.,100.);
810 deriv->SetParName(1,
"mult");
811 deriv->SetParLimits(1,0.,100.);
812 deriv->SetParName(2,
"Taus");
813 deriv->SetParLimits(2,0.1,10.);
814 deriv->SetNpx(nbin+1);
815 deriv->SetParameters(
par[0],
par[1],
par[2]);
◆ 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]
◆ 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
◆ finalize()
virtual StatusCode LArPhysWaveHECTool::finalize |
( |
| ) |
|
|
inlinevirtual |
◆ initialize()
StatusCode LArPhysWaveHECTool::initialize |
( |
| ) |
|
|
virtual |
◆ 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.
◆ interfaceID()
static const InterfaceID& LArPhysWaveHECTool::interfaceID |
( |
| ) |
|
|
inlinestatic |
◆ makeLArPhysWaveHEC()
Definition at line 97 of file LArPhysWaveHECTool.cxx.
118 ATH_MSG_DEBUG (
" Tdrift="<< wfParam.tdrift() <<
" Tcal="<<wfParam.tcal()<<
" Fstep="<< wfParam.fstep()<<
" m_Omega0="<<
m_Omega0<<
" m_Taur="<<
m_Taur<<
" LArWaveFlag="
119 <<
LArWaveFlag <<
" LArPhysWaveFlag="<< LArPhysWaveFlag );
123 return StatusCode::SUCCESS;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ 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.
◆ predict_phys_HEC()
Definition at line 126 of file LArPhysWaveHECTool.cxx.
147 ATH_MSG_VERBOSE (
"*** Normalisation \t|-> YES (CaliWave peak = " << peak <<
")" );
151 gCaliMB = gCaliMB * (1./peak) ;
164 ATH_MSG_VERBOSE (
"*** Physics waveform\t|-> m_Tdrift = " << wfParam.tdrift() <<
" ns " );
165 ATH_MSG_VERBOSE (
"*** Physics waveform\t|-> m_Fstep = " << wfParam.fstep() <<
" ns " );
166 ATH_MSG_VERBOSE (
"*** Physics waveform\t|-> m_Tcal = " << wfParam.tcal() <<
" ns " );
171 unsigned int CaliWaveBins = gCaliMB.
getSize();
172 double const BinWidth=25.0/24;
173 double const HalfBinWidth=BinWidth/2.0;
174 double par[3]={0.0,1.0,0.10};
175 bool uset0=
false,
norm=
false;
177 double const QUAL_REQ=peak_tmp*0.04;
178 double const QUAL_REQ_AMPL=peak_tmp*0.3;
180 double DIFF=0,DIFF_AMPL=0;
181 unsigned short int repro_count=0;
182 int idx_bad_time=-1,idx_bad_time_ampl=-1;
184 const unsigned short int ITER_MAX = 10;
185 double Ampl_problem=-1, Time_problem=-1, Ampl_problem_ampl=-1, Time_problem_ampl=-1;
186 double CALIWAVE_SHIFT=0;
187 TProfile pcal(
"pcal",
"Amplitude vs Time",CaliWaveBins,0-HalfBinWidth,CaliWaveBins*BinWidth-HalfBinWidth);
188 while(( (
DIFF>=QUAL_REQ || DIFF_AMPL>=QUAL_REQ_AMPL) && repro_count<ITER_MAX)
193 CALIWAVE_SHIFT=0.0005*repro_count;
195 CALIWAVE_SHIFT=1.0*repro_count;
200 ATH_MSG_INFO (repro_count<<
". Iteration of INTEGRATION: CALIWAVE IS MOVED UP by "<<CALIWAVE_SHIFT<<
" ADC units");
201 if(DIFF_AMPL>=QUAL_REQ_AMPL)
202 ATH_MSG_INFO (
"Problematic DIFF_AMPL bin="<<idx_bad_time_ampl<<
" AmplPhysGSL="<<Ampl_problem_ampl<<
" Time="<< Time_problem_ampl <<
" Deviation="<<DIFF_AMPL<<
" ADC units"<<
" Peak="<<peak_tmp);
204 ATH_MSG_INFO (
"Problematic DIFF bin="<<idx_bad_time<<
" AmplPhysGSL="<<Ampl_problem<<
" Time="<<Time_problem<<
" Deviation="<<
DIFF<<
" ADC units"<<
" Peak="<<peak_tmp);
208 for(
unsigned tbin=1;tbin<=gCaliMB.
getSize();++tbin){
209 double AmplCalib = gCaliMB.
getSample(tbin-1)+CALIWAVE_SHIFT;
211 pcal.Fill(
Time,AmplCalib,1);
215 double parCL[2]={wfParam.tcal(),wfParam.fstep()};
218 if (deriv)
delete deriv;
223 PhysWaveFunc= (TF1*)pwf->Clone();
224 DIFF=0;DIFF_AMPL=0;Ampl_problem=-1; Time_problem=-1; Ampl_problem_ampl=-1; Time_problem_ampl=-1;
227 for(
int i=1;
i<pcal.GetNbinsX(); ++
i){
228 double TimePhys1 = pcal.GetBinCenter(
i+1);
229 double TimePhys0 = TimePhys1-BinWidth;
230 double DIFF_TMP = PhysWaveFunc->Eval(TimePhys1)-PhysWaveFunc->Eval(TimePhys0);
231 if(TimePhys1>200 &&
DIFF<fabs(DIFF_TMP)){
234 Ampl_problem=PhysWaveFunc->Eval(TimePhys1);
235 Time_problem=TimePhys1;
237 else if(TimePhys1<=200 && DIFF_AMPL<fabs(DIFF_TMP)){
238 DIFF_AMPL=fabs(DIFF_TMP);
240 Ampl_problem_ampl=PhysWaveFunc->Eval(TimePhys1);
241 Time_problem_ampl=TimePhys1;
246 if(repro_count>=ITER_MAX && (
DIFF>=QUAL_REQ || DIFF_AMPL>=QUAL_REQ_AMPL)){
247 ATH_MSG_WARNING (
"FT="<<
FT<<
" Slot="<<Slot<<
" Ch="<<
Channel<<
" Gain="<<
gain<<
" #iterations for CALIWAVE increasing reached the limit! LArWaveFlag set to -1" );
254 for(
unsigned int i=0;
i<gCaliMB.
getSize(); ++
i){
260 predLArPhysWave.
setSample(
i,PhysWaveFunc->Eval(
Time)-CALIWAVE_SHIFT);
269 MphysMcali = predLArPhysWave.
getSample( wHelper.
getMax(predLArPhysWave) ) ;
270 std::cout<<
"Normalized: MphysMcali="<<MphysMcali<<std::endl;
272 MphysMcali = predLArPhysWave.
getSample( wHelper.
getMax(predLArPhysWave) ) /
275 ATH_MSG_VERBOSE (
"*** Physics waveform\t|-> m_MphysMcali = " << MphysMcali <<
" adc=" <<
adc);
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
◆ 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()
◆ DEFAULT
const int LArPhysWaveHECTool::DEFAULT =-1 |
|
staticprivate |
◆ m_detStore
◆ m_evtStore
◆ m_FstepAverage
double LArPhysWaveHECTool::m_FstepAverage |
|
private |
◆ m_FstepMax
double LArPhysWaveHECTool::m_FstepMax |
|
private |
◆ m_FstepMin
double LArPhysWaveHECTool::m_FstepMin |
|
private |
◆ m_gIdealPhys
◆ m_isSC
bool LArPhysWaveHECTool::m_isSC |
|
private |
◆ m_MinAmp
double LArPhysWaveHECTool::m_MinAmp |
|
private |
◆ m_normalizeCali
bool LArPhysWaveHECTool::m_normalizeCali |
|
private |
◆ m_Omega0
double LArPhysWaveHECTool::m_Omega0 = 0.0 |
|
private |
◆ m_onlineHelper
◆ m_subtractBaseline
bool LArPhysWaveHECTool::m_subtractBaseline |
|
private |
◆ m_Taur
double LArPhysWaveHECTool::m_Taur = 0.0 |
|
private |
◆ m_TcalAverage
double LArPhysWaveHECTool::m_TcalAverage |
|
private |
◆ m_TcalMax
double LArPhysWaveHECTool::m_TcalMax |
|
private |
◆ m_TcalMin
double LArPhysWaveHECTool::m_TcalMin |
|
private |
◆ m_timeOriginShift
bool LArPhysWaveHECTool::m_timeOriginShift |
|
private |
◆ m_Tstart
unsigned LArPhysWaveHECTool::m_Tstart = 0U |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
size_t getSize() const
number of time samples
unsigned getStart(const LArWave &theWave) const
Identifier32::value_type Channel
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const std::vector< double > & getWave() const
Wave parameters.
double getBaseline(const LArWave &theWave, unsigned nBase) const
std::vector< ALFA_RawData_p1 > t0
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)
std::vector< SG::VarHandleKeyArray * > m_vhka
#define ATH_MSG_VERBOSE(x)
unsigned int getMax(const LArWave &theWave) const
return index of maximum sample
double getTime(const unsigned i) const
time
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
const double & getSample(const unsigned int i) const
Amplitude per time bin.
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
#define DIFF(_name, _a, _b)
def TProfile(*args, **kwargs)
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Helper for the Liquid Argon Calorimeter cell identifiers.
std::vector< LUCID_Digit_p2 > t5
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
#define ATH_MSG_WARNING(x)
void setSample(const unsigned i, const double aVal)
set the amplitude for time bin i
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
#define STEP(f, a, b, c, d, x, t, s)
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>