|
ATLAS Offline Software
|
#include <TileDigiNoiseCalibAlg.h>
|
| TileDigiNoiseCalibAlg (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual | ~TileDigiNoiseCalibAlg () |
|
virtual StatusCode | initialize () override |
| Only array initialization is done here All the helpers initialization is done at the first event. More...
|
|
virtual StatusCode | execute () override |
| Main method. More...
|
|
virtual StatusCode | finalize () override |
| The output ntuple is created in finalize method. More...
|
|
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 > &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 |
|
Definition at line 46 of file TileDigiNoiseCalibAlg.h.
◆ StoreGateSvc_t
◆ Tile
◆ trigtype
◆ TileDigiNoiseCalibAlg()
TileDigiNoiseCalibAlg::TileDigiNoiseCalibAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~TileDigiNoiseCalibAlg()
TileDigiNoiseCalibAlg::~TileDigiNoiseCalibAlg |
( |
| ) |
|
|
virtual |
◆ 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()
◆ digiChannel2PMT()
int TileDigiNoiseCalibAlg::digiChannel2PMT |
( |
int |
ros, |
|
|
int |
chan |
|
) |
| |
|
inlineprivate |
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode TileDigiNoiseCalibAlg::execute |
( |
| ) |
|
|
overridevirtual |
Main method.
Definition at line 195 of file TileDigiNoiseCalibAlg.cxx.
197 const EventContext& ctx = Gaudi::Hive::currentContext();
209 bool calibMode = (dqStatus->
calibMode() == 1);
232 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();
◆ fillDigits()
fillDigits is called at every events.
Statistics is summed for Average, RMS and covariance calculations
Definition at line 378 of file TileDigiNoiseCalibAlg.cxx.
387 for (; collItr != lastColl; ++collItr) {
392 if (digitsItr != lastDigits) {
401 double mean_tmp[48][16][2] = {};
404 for (; digitsItr != lastDigits; ++digitsItr) {
406 adc_id = (*digitsItr)->adc_HWID();
415 std::vector<float> vdigits = (*digitsItr)->samples();
432 <<
" channel: " <<
chan
434 <<
" due to DQ error found." );
441 <<
" channel: " <<
chan
442 <<
" due to DQ error found." );
447 double meansamp = 0.0;
448 double rmssamp = 0.0;
449 unsigned int dsize = vdigits.size();
452 ATH_MSG_ERROR(
"length of digits vector " << dsize <<
" - greater than 16 !" );
456 for (
unsigned int i = 0;
i < dsize; ++
i) {
457 double dig = vdigits[
i];
459 rmssamp += dig * dig;
469 rmssamp = rmssamp / dsize - meansamp * meansamp;
470 rmssamp = (rmssamp > 0.0) ? sqrt(rmssamp * dsize / (dsize - 1)) : 0.0;
497 return StatusCode::SUCCESS;
◆ finalDigits()
void TileDigiNoiseCalibAlg::finalDigits |
( |
| ) |
|
|
private |
finalDigits is called during finalize Here the average Ped, m_lfn, m_hfn and covariance are calculated.
Definition at line 503 of file TileDigiNoiseCalibAlg.cxx.
516 float tmpCorr[9][9] = {};
538 PedRMS = (PedRMS > 0.0) ? sqrt(PedRMS *
nev / (
nev - 1)) : 0.0;
580 double covar[48][48];
581 double mean_cov_ii = 0.;
582 double mean_cov_ij = 0.;
588 if (chan_j < chan_i) {
589 mean_cov_ij += covar[chan_i][chan_j];
592 mean_cov_ii += covar[chan_i][chan_i];
595 if (mean_cov_ii != 0.) {
◆ finalize()
StatusCode TileDigiNoiseCalibAlg::finalize |
( |
| ) |
|
|
overridevirtual |
The output ntuple is created in finalize method.
Definition at line 236 of file TileDigiNoiseCalibAlg.cxx.
242 std::ostringstream sStr;
243 std::string trig_str;
253 sStr <<
m_file <<
"_" <<
m_run <<
"_" << trig_str <<
".root";
259 TFile*
fout =
new TFile(
m_file.c_str(),
"recreate");
262 TTree*
t =
new TTree(
m_ntupleID.c_str(),
"TileCalib-Ntuple");
264 t->Branch(
"RunNumber", &
m_run,
"RunNumber/I");
266 t->Branch(
"Time", &
m_time,
"Time/I");
267 t->Branch(
"Year", &
m_year,
"Year/I");
268 t->Branch(
"Month", &
m_month,
"Month/I");
269 t->Branch(
"Day", &
m_day,
"Day/I");
270 t->Branch(
"YDay", &
m_yday,
"YDay/I");
271 t->Branch(
"Hour", &
m_hour,
"Hour/I");
272 t->Branch(
"Min", &
m_min,
"Min/I");
274 t->Branch(
"nEvt", &
m_evtNr,
"nEvt/I");
275 t->Branch(
"ros", *
m_ros,
"ros[5][64][48][2]/b");
276 t->Branch(
"drawer", *
m_drawer,
"drawer[5][64][48][2]/b");
277 t->Branch(
"channel", *
m_channel,
"channel[5][64][48][2]/b");
278 t->Branch(
"gain", *
m_gain,
"gain[5][64][48][2]/O");
279 t->Branch(
"EvtGood", *
m_evt,
"Evt[5][64][48][2]/I");
280 t->Branch(
"ped", *
m_ped,
"ped[5][64][48][2]/F");
281 t->Branch(
"lfn", *
m_lfn,
"lfn[5][64][48][2]/F");
282 t->Branch(
"hfn", *
m_hfn,
"hfn[5][64][48][2]/F");
283 t->Branch(
"noise_cov", *
m_noise_cov,
"noise_cov[5][64][2]/F");
285 t->Branch(
"auto_corr", *
m_auto_corr,
"auto_corr[5][64][48][2][36]/F");
294 return StatusCode::SUCCESS;
◆ FirstEvt_initialize()
StatusCode TileDigiNoiseCalibAlg::FirstEvt_initialize |
( |
| ) |
|
|
private |
Initialization done at the first event.
All the helpers and data dependent variables are initialized here
Definition at line 131 of file TileDigiNoiseCalibAlg.cxx.
158 if (
sc.isFailure()) {
160 return StatusCode::FAILURE;
175 if (cnvSvc.retrieve().isFailure()) {
181 ATH_MSG_ERROR(
" Can't get TileBeamElemContByteStreamCnv " );
191 return StatusCode::SUCCESS;
◆ initialize()
StatusCode TileDigiNoiseCalibAlg::initialize |
( |
| ) |
|
|
overridevirtual |
Only array initialization is done here All the helpers initialization is done at the first event.
Definition at line 116 of file TileDigiNoiseCalibAlg.cxx.
126 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()
◆ 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.
◆ renounce()
◆ renounceArray()
◆ StoreRunInfo()
StoreRunInfo is called only during the first event.
Definition at line 298 of file TileDigiNoiseCalibAlg.cxx.
308 ATH_MSG_WARNING(
"TileDigiNoiseCalibAlg::StoreRunInfo : dqStatus pointer is null" );
339 if ( !eventInfo.isValid() ) {
340 ATH_MSG_ERROR(
"No EventInfo object found! Can't read run number!" );
345 m_run = eventInfo->runNumber();
346 m_time = eventInfo->timeStamp();
358 localtime_r(&t_time, &
t);
◆ 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()
◆ m_adderFilterAlgTool
Initial value:{this,
"TileAdderFlatFilter","TileRawChannelBuilderFlatFilter/TileAdderFlatFilter","Tile adder flat filter"}
Definition at line 97 of file TileDigiNoiseCalibAlg.h.
◆ m_auto_corr
◆ m_beamCnv
◆ m_beamElemContainer
std::string TileDigiNoiseCalibAlg::m_beamElemContainer |
|
private |
◆ m_cabling
◆ m_calibMode
bool TileDigiNoiseCalibAlg::m_calibMode |
|
private |
◆ m_channel
◆ m_cispar
const uint32_t* TileDigiNoiseCalibAlg::m_cispar |
|
private |
◆ m_day
int TileDigiNoiseCalibAlg::m_day |
|
private |
◆ m_detStore
◆ m_digitsContainer
std::string TileDigiNoiseCalibAlg::m_digitsContainer |
|
private |
◆ m_digitsContainerKey
Initial value:{this,
"TileDigitsContainer", "TileDigitsCnt", "Tile digits container"}
Definition at line 91 of file TileDigiNoiseCalibAlg.h.
◆ m_doAvgCorr
bool TileDigiNoiseCalibAlg::m_doAvgCorr |
|
private |
◆ m_doRobustCov
bool TileDigiNoiseCalibAlg::m_doRobustCov |
|
private |
◆ m_dqStatusKey
◆ m_drawer
◆ m_dspRawChannelContainer
std::string TileDigiNoiseCalibAlg::m_dspRawChannelContainer |
|
private |
◆ m_eventInfoKey
◆ m_evt
◆ m_evtNr
int TileDigiNoiseCalibAlg::m_evtNr |
|
private |
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_file
std::string TileDigiNoiseCalibAlg::m_file |
|
private |
◆ m_gain
◆ m_hfn
◆ m_hour
int TileDigiNoiseCalibAlg::m_hour |
|
private |
◆ m_lfn
◆ m_meanAmp
◆ m_meanAmp_ij
◆ m_min
int TileDigiNoiseCalibAlg::m_min |
|
private |
◆ m_month
int TileDigiNoiseCalibAlg::m_month |
|
private |
◆ m_noise_cov
◆ m_nSamples
int TileDigiNoiseCalibAlg::m_nSamples |
|
private |
◆ m_ntupleID
std::string TileDigiNoiseCalibAlg::m_ntupleID |
|
private |
◆ m_ped
◆ m_ros
◆ m_run
int TileDigiNoiseCalibAlg::m_run |
|
private |
◆ m_sumPed2
◆ m_sumRms2
◆ m_tileHWID
◆ m_tileID
◆ m_tileOFCorrelation
◆ m_time
int TileDigiNoiseCalibAlg::m_time |
|
private |
◆ m_treeSize
int64_t TileDigiNoiseCalibAlg::m_treeSize |
|
private |
◆ m_trigType
int TileDigiNoiseCalibAlg::m_trigType |
|
private |
◆ m_usePMT
bool TileDigiNoiseCalibAlg::m_usePMT |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_yday
int TileDigiNoiseCalibAlg::m_yday |
|
private |
◆ m_year
int TileDigiNoiseCalibAlg::m_year |
|
private |
The documentation for this class was generated from the following files:
bool validBeamFrag() const
def retrieve(aClass, aKey=None)
Const iterator class for DataVector/DataList.
void SetCorrelationZero(MsgStream &log, int dignum)
void CalcRunningCorrelation(MsgStream &log, int dignum, int chthres, bool flag_7to9)
static const TileCablingService * getInstance()
get pointer to service instance
bool isChanDQgood(int partition, int drawer, int ch) const
returns status of single channel (if bigain, returns AND of ADCs' status
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
double(* m_sumRms2)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
uint32_t calibMode() const
Calibration mode.
ToolHandle< TileRawChannelBuilderFlatFilter > m_adderFilterAlgTool
@ IS_CALIBRATION
true: calibration, false: physics
void GetCorrelation(int dignum, float tmpCorr[][9], int ros, int drawer, int chan, int gain)
const eformat::ROBFragment< const uint32_t * > * robFragment() const
void CalcCorrelation(MsgStream &log, int dignum, bool flag_7to9, bool doRobustCov)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
void RunningCorrelation(std::vector< float > &digits, int ros, int drawer, int channel, int gain, MsgStream &log, bool debug, int &dignum, int chthres)
const uint32_t * m_cispar
float(* m_ped)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
int digiChannel2PMT(int ros, int chan)
const std::string & key() const
Return the StoreGate ID for the referenced object.
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
int(* m_evt)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
static const unsigned int MAX_DRAWER
Number of drawers in ROS 1-4.
void StoreRunInfo(const TileDQstatus *dqStatus)
StoreRunInfo is called only during the first event.
virtual void setOwner(IDataHandleHolder *o)=0
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
void finalDigits()
finalDigits is called during finalize Here the average Ped, m_lfn, m_hfn and covariance are calculate...
bool(* m_gain)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Class that holds Data Quality fragment information and provides functions to extract the data quality...
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
uint8_t(* m_ros)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
::StatusCode StatusCode
StatusCode definition for legacy code.
std::string m_beamElemContainer
Default, invalid implementation of ClassID_traits.
const TileHWID * m_tileHWID
float(* m_lfn)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
#define CHECK(...)
Evaluate an expression and check for errors.
const TileCablingService * m_cabling
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode FirstEvt_initialize()
Initialization done at the first event.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
static const unsigned int MAX_ROS
Number of ROSs
This AthConstConverter class provides conversion from ByteStream to TileBeamElemContainer.
bool isAdcDQgood(int partition, int drawer, int ch, int gain) const
returns status of single ADC returns False if there are any errors
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
double(* m_meanAmp_ij)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_CHAN][Tile::MAX_GAIN]
double(* m_sumPed2)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
const uint32_t * cispar() const
CIS parameters.
float(* m_noise_cov)[Tile::MAX_DRAWER][Tile::MAX_GAIN]
SG::ReadHandleKey< TileDQstatus > m_dqStatusKey
TileOFCorrelation * m_tileOFCorrelation
float(* m_auto_corr)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN][NVALS]
static std::string getDrawerString(unsigned int ros, unsigned int drawer)
Return the drawer name, e.g.
DataObjIDColl m_extendedExtraObjects
StatusCode fillDigits(const TileDQstatus *theDQstatus)
fillDigits is called at every events.
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
#define ATH_MSG_WARNING(x)
static int channel2hole(int ros, int channel)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
double(* m_meanAmp)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
uint8_t(* m_channel)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
TileBeamElemContByteStreamCnv * m_beamCnv
SG::ReadHandleKey< TileDigitsContainer > m_digitsContainerKey
AthAlgorithm()
Default constructor:
std::string m_dspRawChannelContainer
float(* m_hfn)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
static const unsigned int MAX_CHAN
Number of channels in drawer.
uint8_t(* m_drawer)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
void Sum(std::vector< float > &digits, int ros, int drawer, int channel, int gain, MsgStream &log, bool debug, int &dignum, bool doRobustCov)
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
static const unsigned int MAX_GAIN
Number of gains per channel