|
ATLAS Offline Software
|
#include <CaloCellNoiseAlg.h>
|
| CaloCellNoiseAlg (const std::string &name, ISvcLocator *pSvcLocator) |
| Standard Athena-Algorithm Constructor. More...
|
|
virtual | ~CaloCellNoiseAlg () |
| Default Destructor. More...
|
|
virtual StatusCode | initialize () override |
| standard Athena-Algorithm method More...
|
|
virtual StatusCode | execute () override |
| standard Athena-Algorithm method More...
|
|
virtual StatusCode | finalize () override |
| standard Athena-Algorithm method More...
|
|
virtual StatusCode | stop () override |
| standard Athena-Algorithm 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 |
|
|
ServiceHandle< ITHistSvc > | m_thistSvc {this,"THistSvc","THistSvc"} |
|
SG::ReadCondHandleKey< CaloDetDescrManager > | m_caloMgrKey |
|
const CaloCell_ID * | m_calo_id {nullptr} |
|
SG::ReadCondHandleKey< ILArNoise > | m_noiseKey {this,"NoiseKey","LArNoiseSym","SG Key of ILArNoise object"} |
|
SG::ReadCondHandleKey< ILArPedestal > | m_pedestalKey {this,"PedestalKey","LArPedestal","SG Key of LArPedestal object"} |
|
SG::ReadCondHandleKey< LArADC2MeV > | m_adc2mevKey { this, "ADC2MeVKey", "LArADC2MeV", "SG Key of the LArADC2MeV CDO" } |
|
SG::ReadCondHandleKey< CaloNoise > | m_totalNoiseKey { this, "TotalNoiseKey", "totalNoise", "SG conditions key for total noise" } |
|
SG::ReadCondHandleKey< CaloNoise > | m_elecNoiseKey { this, "ElecNoiseKey", "electronicNoise", "SG conditions key for electronic noise" } |
|
std::vector< CellInfo > | m_CellList |
|
int | m_ncell |
|
unsigned int | m_lumiblock |
|
unsigned int | m_lumiblockOld |
|
bool | m_first |
|
std::unique_ptr< TreeData > | m_treeData |
|
TTree * | m_tree |
|
bool | m_doMC |
|
bool | m_readNtuple |
|
bool | m_doFit |
|
bool | m_doLumiFit |
|
int | m_nmin |
|
ToolHandle< Trig::TrigDecisionTool > | m_trigDecTool |
| TDT handle. More...
|
|
std::string | m_triggerChainProp |
|
FloatArrayProperty | m_cuts |
|
SG::ReadCondHandleKey< LArOnOffIdMapping > | m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"} |
|
std::string | m_lumiFolderName |
|
int | m_addlumiblock |
|
float | m_deltaLumi |
|
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 |
|
Definition at line 34 of file CaloCellNoiseAlg.h.
◆ StoreGateSvc_t
◆ CaloCellNoiseAlg()
CaloCellNoiseAlg::CaloCellNoiseAlg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~CaloCellNoiseAlg()
CaloCellNoiseAlg::~CaloCellNoiseAlg |
( |
| ) |
|
|
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()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode CaloCellNoiseAlg::execute |
( |
| ) |
|
|
overridevirtual |
standard Athena-Algorithm method
Definition at line 153 of file CaloCellNoiseAlg.cxx.
163 bool passTrig =
false;
168 return StatusCode::SUCCESS;
176 const EventContext& ctx = Gaudi::Hive::currentContext();
177 unsigned int lumiblock = ctx.eventID().lumi_block();
194 return StatusCode::SUCCESS;
208 return StatusCode::SUCCESS;
215 totalNoise = noiseH.cptr();
229 cell0.identifier =
id.get_identifier32().get_compact();
231 cell0.eta = calodde->
eta();
232 cell0.phi = calodde->
phi();
252 m_tree =
new TTree(
"mytree",
"Calo Noise ntuple");
255 m_tree->Branch(
"identifier",
m_treeData->m_identifier,
"identifier[ncell]/I");
267 return StatusCode::SUCCESS;
277 return StatusCode::SUCCESS;
283 for (; first_cell != end_cell; ++first_cell)
293 double energy= (*first_cell)->energy();
305 double frac = oldN/(1.+oldN);
306 double Anew = 1.+oldN;
307 double newAverage =
frac*oldAverage +
energy/Anew;
308 double deltaE = (
energy-oldAverage);
309 double newRMS =
frac*(oldRMS + deltaE*deltaE/Anew);
320 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();
◆ fillNtuple()
StatusCode CaloCellNoiseAlg::fillNtuple |
( |
| ) |
|
|
private |
◆ finalize()
StatusCode CaloCellNoiseAlg::finalize |
( |
| ) |
|
|
overridevirtual |
standard Athena-Algorithm method
Definition at line 663 of file CaloCellNoiseAlg.cxx.
665 return StatusCode::SUCCESS;
◆ fitNoise()
StatusCode CaloCellNoiseAlg::fitNoise |
( |
| ) |
|
|
private |
Definition at line 392 of file CaloCellNoiseAlg.cxx.
394 const EventContext& ctx = Gaudi::Hive::currentContext();
404 noise = noiseH.cptr();
408 pedestal = pedH.cptr();
414 elecNoise = noiseH.cptr();
419 FILE*
fp = fopen(
"calonoise.txt",
"w");
421 TBranch* b1 =
m_tree->GetBranch(
"luminosity");
422 TBranch* b2 =
m_tree->GetBranch(
"nevt");
423 TBranch* b3 =
m_tree->GetBranch(
"average");
424 TBranch* b4 =
m_tree->GetBranch(
"rms");
425 TBranch* b5 =
m_tree->GetBranch(
"nevt_good");
434 std::vector<float> anoise;
435 std::vector<float> bnoise;
440 std::vector<float>
x;
441 std::vector<float>
y;
442 std::vector<float> ey;
457 if (
x.size()==1) anoise[
icell]=
y[0];
460 HepMatrix alpha(2,2);
463 for (
unsigned int i=0;
i<2;
i++) {
464 for (
unsigned int j=0;j<2;j++) {
466 for (
unsigned int k=0;
k<
x.size();
k++) {
471 for (
unsigned int i=0;
i<2;
i++) {
473 for (
unsigned int k=0;
k<
x.size();
k++) {
484 for (
unsigned int i=0;
i<
x.size();
i++) {
506 ATH_MSG_DEBUG (
" regionId,eta,phimin,phimax " << regionId <<
" " <<
eta <<
" " << phimin <<
" " << phimax );
524 float patched_noise =
sum/((
float)(nring));
525 if (patched_noise>anoise[
icell]) anoise[
icell] = patched_noise;
527 ATH_MSG_DEBUG(
" corrected noise nring, anoise[icell] " << nring <<
" " << anoise[
icell] );
566 int ii = (
int) (idSubHash);
582 float anoise_corr=anoise[
icell];
584 if (
gain != gainref) {
594 polynom_adc2mev0 = adc2mev->ADC2MEV(
id,gainref);
596 if (polynom_adc2mev0.size()>1) adc2mev0=polynom_adc2mev0[1];
607 polynom_adc2mev1 = adc2mev->ADC2MEV(hwid,
gain);
609 if (polynom_adc2mev1.size()>1) adc2mev1=polynom_adc2mev1[1];
614 if (noise0>0 && noise1>0 && adc2mev0>0 && adc2mev1>0.) {
615 anoise_corr = anoise[
icell]*noise1/noise0 * adc2mev1/adc2mev0;
626 if (anoise_corr<1. && adb>1
e-6) {
631 float delta = std::fabs((anoise_corr-adb)/adb);
634 <<
" computed " << anoise_corr <<
" reference " << adb );
639 fprintf(
fp,
"%5d %5d %5d %8.3f %8.3f\n",iCool,ii,
gain,anoise_corr,bnoise[
icell]);
650 float anoise_corr = anoise[
icell];
653 fprintf(
fp,
"%5d %5d %5d %8.3f %8.3f\n",iCool,ii,
gain,anoise_corr,bnoise[
icell]);
660 return StatusCode::SUCCESS;
◆ getLuminosity()
float CaloCellNoiseAlg::getLuminosity |
( |
| ) |
|
|
private |
Definition at line 324 of file CaloCellNoiseAlg.cxx.
331 if (
sc.isFailure() || !attrListColl) {
339 if ((*first).first == 0) {
340 std::ostringstream attrStr1;
341 (*first).second.toOutputStream( attrStr1 );
343 " Attribute list " << attrStr1.str() );
345 luminosity = attrList[
"LBAvInstLumi"].data<
float>() *1
e-3;
◆ initialize()
StatusCode CaloCellNoiseAlg::initialize |
( |
| ) |
|
|
overridevirtual |
standard Athena-Algorithm method
Definition at line 88 of file CaloCellNoiseAlg.cxx.
121 ATH_MSG_INFO (
" end of CaloCellNoiseAlg::initialize " );
122 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.
◆ readNtuple()
StatusCode CaloCellNoiseAlg::readNtuple |
( |
| ) |
|
|
staticprivate |
◆ renounce()
◆ renounceArray()
◆ stop()
StatusCode CaloCellNoiseAlg::stop |
( |
| ) |
|
|
overridevirtual |
standard Athena-Algorithm method
Definition at line 125 of file CaloCellNoiseAlg.cxx.
132 return StatusCode::SUCCESS;
138 return StatusCode::SUCCESS;
145 return StatusCode::SUCCESS;
149 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()
◆ m_adc2mevKey
◆ m_addlumiblock
int CaloCellNoiseAlg::m_addlumiblock |
|
private |
◆ m_cablingKey
◆ m_calo_id
◆ m_caloMgrKey
Initial value:{ this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" }
Definition at line 63 of file CaloCellNoiseAlg.h.
◆ m_CellList
std::vector<CellInfo> CaloCellNoiseAlg::m_CellList |
|
private |
◆ m_cuts
FloatArrayProperty CaloCellNoiseAlg::m_cuts |
|
private |
◆ m_deltaLumi
float CaloCellNoiseAlg::m_deltaLumi |
|
private |
◆ m_detStore
◆ m_doFit
bool CaloCellNoiseAlg::m_doFit |
|
private |
◆ m_doLumiFit
bool CaloCellNoiseAlg::m_doLumiFit |
|
private |
◆ m_doMC
bool CaloCellNoiseAlg::m_doMC |
|
private |
◆ m_elecNoiseKey
SG::ReadCondHandleKey<CaloNoise> CaloCellNoiseAlg::m_elecNoiseKey { this, "ElecNoiseKey", "electronicNoise", "SG conditions key for electronic noise" } |
|
private |
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_first
bool CaloCellNoiseAlg::m_first |
|
private |
◆ m_lumiblock
unsigned int CaloCellNoiseAlg::m_lumiblock |
|
private |
◆ m_lumiblockOld
unsigned int CaloCellNoiseAlg::m_lumiblockOld |
|
private |
◆ m_lumiFolderName
std::string CaloCellNoiseAlg::m_lumiFolderName |
|
private |
◆ m_ncell
int CaloCellNoiseAlg::m_ncell |
|
private |
◆ m_nmin
int CaloCellNoiseAlg::m_nmin |
|
private |
◆ m_noiseKey
◆ m_pedestalKey
◆ m_readNtuple
bool CaloCellNoiseAlg::m_readNtuple |
|
private |
◆ m_thistSvc
ServiceHandle<ITHistSvc> CaloCellNoiseAlg::m_thistSvc {this,"THistSvc","THistSvc"} |
|
private |
◆ m_totalNoiseKey
◆ m_tree
TTree* CaloCellNoiseAlg::m_tree |
|
private |
◆ m_treeData
std::unique_ptr<TreeData> CaloCellNoiseAlg::m_treeData |
|
private |
◆ m_trigDecTool
◆ m_triggerChainProp
std::string CaloCellNoiseAlg::m_triggerChainProp |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
char data[hepevt_bytes_allocation_ATLAS]
const_iterator end() const
Const iterator class for DataVector/DataList.
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
Scalar phi() const
phi method
int phi_min(const Identifier regId) const
min value of phi index (-999 == failure)
bool is_lar(Identifier id) const
Scalar eta() const
pseudorapidity method
SG::ReadCondHandleKey< CaloNoise > m_elecNoiseKey
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
bool is_em_endcap(const Identifier id) const
test if the id belongs to the EM Endcap
int pos_neg(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Identifier region_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy) const
Make a region ID from constituting fields and subCalo index; for (Mini)FCAL and Tiles,...
ServiceHandle< ITHistSvc > m_thistSvc
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::unique_ptr< TreeData > m_treeData
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
int calo_sample(const Identifier id) const
returns an int taken from Sampling enum and describing the subCalo to which the Id belongs.
bool is_tile(const Identifier id) const
test if the id belongs to the Tiles
bool empty() const
Test if the key is blank.
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
This class is a collection of AttributeLists where each one is associated with a channel number....
const CaloCell_ID * m_calo_id
bool is_valid() const
Check if id is in a valid state.
std::string m_lumiFolderName
bool is_hec(const Identifier id) const
test if the id belongs to the HEC
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
int phi_max(const Identifier regId) const
max value of phi index (-999 == failure)
bool is_em(const Identifier id) const
test if the id belongs to LArEM
virtual StatusCode sysInitialize() override
Override sysInitialize.
This class initializes the Calo (LAr and Tile) offline identifiers.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
bool is_fcal(const Identifier id) const
test if the id belongs to the FCAL - true also for MiniFCAL
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::ReadCondHandleKey< ILArNoise > m_noiseKey
int eta(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
IdentifierHash subcalo_cell_hash(const Identifier cellId, int &subCalo) const
create hash id from 'global' cell id
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
ToolHandle< Trig::TrigDecisionTool > m_trigDecTool
TDT handle.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
bool is_em_barrel(const Identifier id) const
test if the id belongs to the EM barrel
static StatusCode readNtuple()
unsigned int m_lumiblockOld
std::string m_triggerChainProp
SG::ReadCondHandleKey< ILArPedestal > m_pedestalKey
StatusCode initialize(bool used=true)
Container class for CaloCell.
Identifier cell_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy, const int eta, const int phi) const
Make a cell (== channel) ID from constituting fields and subCalo index; for (Mini)FCAL,...
FloatArrayProperty m_cuts
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DataObjIDColl m_extendedExtraObjects
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
#define ATH_MSG_WARNING(x)
ChanAttrListMap::const_iterator const_iterator
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
float eta() const
cell eta
AthAlgorithm()
Default constructor:
float phi() const
cell phi
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
SG::ReadCondHandleKey< CaloNoise > m_totalNoiseKey
virtual float pedestalRMS(const HWIdentifier &id, int gain) const =0
access to RMS of Pedestal index by Identifier, and gain setting
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
SG::ReadCondHandleKey< LArADC2MeV > m_adc2mevKey
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
Proxy for accessing a range of float values like a vector.
size_type calo_cell_hash_max(void) const
cell 'global' hash table max size
std::vector< CellInfo > m_CellList