|
ATLAS Offline Software
|
#include <GepPi0Alg.h>
|
| GepPi0Alg (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute (const EventContext &) const override |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual bool | isClonable () const override |
| Specify if the algorithm is clonable. More...
|
|
virtual unsigned int | cardinality () const override |
| Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
|
|
virtual StatusCode | sysExecute (const EventContext &ctx) override |
| Execute an algorithm. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
virtual bool | filterPassed (const EventContext &ctx) const |
|
virtual void | setFilterPassed (bool state, const EventContext &ctx) const |
|
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 |
|
|
StatusCode | twinpeaks_strategy (const CaloCell *seed, const std::vector< const CaloCell * > &laremCells, const std::vector< const CaloCell * > &emb1Cells, std::size_t iseed, const CaloNoise *, const CaloDetDescrManager *) const |
|
StatusCode | sort_strategy (const CaloCell *seed, const std::vector< const CaloCell * > &laremCells, const std::vector< const CaloCell * > &emb1Cells, std::size_t iseed, const CaloNoise *, const CaloDetDescrManager *) const |
|
StatusCode | crawl_strategy (const CaloCell *seed, const std::vector< const CaloCell * > &laremCells, const std::vector< const CaloCell * > &emb1Cells, std::size_t iseed, const CaloNoise *, const CaloDetDescrManager *) const |
|
StatusCode | neighborhood (const CaloCell *, const std::vector< const CaloCell * > &laremCells, std::vector< const CaloCell * > &neighs, const CaloDetDescrManager *) const |
|
StatusCode | dump_crawl (std::size_t iseed, const CaloCell *seed, float seed_signif, const CellVectors &, const PathsSignif &, const std::vector< std::string > &paths_pat) const |
|
StatusCode | dump_twinpeaks (std::size_t iseed, const CaloCell *seed, double seed_signif, const std::vector< const CaloCell * > &neighborhood, const std::vector< const CaloCell * > &peaks, const std::vector< double > &peak_signifs) const |
|
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 42 of file GepPi0Alg.h.
◆ CellVectors
◆ PathsSignif
◆ StoreGateSvc_t
◆ GepPi0Alg()
GepPi0Alg::GepPi0Alg |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ cardinality()
unsigned int AthReentrantAlgorithm::cardinality |
( |
| ) |
const |
|
overridevirtualinherited |
Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
Override this to return 0 for reentrant algorithms.
Override this to return 0 for reentrant algorithms.
Definition at line 55 of file AthReentrantAlgorithm.cxx.
◆ crawl_strategy()
Definition at line 423 of file GepPi0Alg.cxx.
430 if (!seed) {
return StatusCode::SUCCESS;}
431 if (allEMB1Cells.empty()) {
return StatusCode::SUCCESS;}
446 <<
" phi " <<
seed->phi());
452 std::vector<IdentifierHash> phi_starts;
455 phi_starts.push_back(seed_hash);
458 std::vector<LArNeighbours::neighbourOption>
464 auto cur_hash = seed_hash;
466 std::vector<IdentifierHash> v_adj;
470 if (rc != 0) {
break;}
472 if (v_adj.size() != 1) {
481 for (
const auto&
ha : v_adj) {
493 phi_starts.push_back(cur_hash);
498 << phi_starts.size());
499 for (
const auto&
h: phi_starts) {
504 std::vector<std::vector<IdentifierHash>> paths_hash;
510 auto calc_phihashes = [&
dir,
513 std::vector<IdentifierHash>
path;
514 std::vector<IdentifierHash>
adjacent;
516 for (
int i = 0;
i<nphi; ++
i) {
519 if (rc != 0) {
break;}
522 throw std::runtime_error(
"unexpected number of identifier hashes: " +
std::to_string(
size));
534 std::back_inserter(paths_hash),
539 << paths_hash.size());
544 paths_cell.reserve(paths_hash.size());
547 for (
const auto& p_h : paths_hash) {
548 std::vector<const CaloCell*>
path;
549 path.reserve(p_h.size());
551 std::back_inserter(
path),
552 [&laremCells](
const auto&
hash){
553 return laremCells.at(hash);});
554 paths_cell.push_back(
path);
563 auto signif = [&totalNoiseCDO,
566 if (
e <= 0){
return 0.;}
568 return signif < signif_min ? 0:signif;
574 paths_signif.reserve(paths_cell.size());
577 for (
const auto& p_c : paths_cell) {
578 std::vector<float> path_signif;
581 std::back_inserter(path_signif),
583 paths_signif.push_back(path_signif);
586 for (
const auto& p_s: paths_signif) {
587 std::stringstream
ss;
588 ss <<
"crawl - path signf ";
589 for (
const auto&
s : p_s) {
590 ss << std::setw(7) << std::setprecision(3)<<
s <<
" ";
596 std::vector<std::string> paths_pat;
597 paths_signif.reserve(paths_signif.size());
599 for (
const auto& p_s: paths_signif) {
600 std::string
pat{
"0"};
602 for (std::size_t
i = 1;
i != p_s.size(); ++
i) {
603 if (p_s[
i] > p_s[
i-1]) {
610 paths_pat.push_back(
pat);
615 ATH_MSG_DEBUG(
"crawl - no of patterns " << paths_pat.size());
617 for(
const auto&
p: paths_pat) {
ATH_MSG_DEBUG(
"crawl - pattern " <<
p);}
619 std::vector<std::regex> peaks_re{
622 std::vector<const CaloCell*> peak_cells;
625 for (
const auto&
s : paths_pat) {
627 for (
const auto&
regex : peaks_re) {
629 if(std::regex_search(
s,
m,
regex)){
630 auto pos =
m.position(1);
632 peak_cells.push_back(paths_cell[
idx][
pos]);
640 auto n_peaks = peak_cells.size();
643 <<
" phi " <<
seed->phi()
644 <<
" signif " <<signif(seed));
645 for (
const auto&
pc : peak_cells){
647 <<
" phi " <<
pc->phi()
648 <<
" signif " <<signif(
pc));
651 <<
seed->eta() -
pc->eta() <<
" dphi "
652 <<
seed->phi() -
pc->phi());
664 return StatusCode::SUCCESS;
◆ 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);
◆ 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.
◆ 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.
◆ 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()
◆ dump_crawl()
Definition at line 668 of file GepPi0Alg.cxx.
674 std::stringstream
ss;
675 ss <<
"crawl. cell source " <<
i <<
'\n';
676 ss <<
"seed " <<
seed->eta() <<
" " <<
seed->phi() <<
" "
677 <<
seed->e() <<
" " << seed_signif <<
'\n';
678 ss <<
"path etas:\n";
679 for (
const auto&
path: paths_cell) {
680 for (
const auto&
c :
path){
681 ss <<
c->eta() <<
" ";
685 ss <<
"path phis:\n";
686 for (
const auto&
path: paths_cell) {
687 for (
const auto&
c :
path){
688 ss <<
c->phi() <<
" ";
694 for (
const auto&
path: paths_cell) {
695 for (
const auto&
c :
path){
701 ss <<
"path signifs:\n";
702 for (
const auto&
path: signifs) {
709 ss <<
"path patterns:\n";
710 for (
const auto&
pat: paths_pat) {
715 std::stringstream
fn;
716 fn <<
"crawl_" <<
m_id <<
"_" <<
i <<
".txt";
717 std::ofstream
out(
fn.str());
720 return StatusCode::SUCCESS;
◆ dump_twinpeaks()
Definition at line 725 of file GepPi0Alg.cxx.
731 std::stringstream
ss;
732 ss <<
"twinpeaks. cell source " <<
i <<
'\n';
733 ss <<
"seed " <<
seed->eta() <<
" " <<
seed->phi() <<
" "
734 <<
seed->e() <<
" " << seed_signif <<
'\n';
735 ss <<
"neighborhood etas:\n";
737 ss <<
c->eta() <<
" ";
741 ss <<
"neighborhood phis:\n";
743 ss <<
c->phi() <<
" ";
747 ss <<
"neighborhood es:\n";
753 ss <<
"peak etas:\n";
754 for (
const auto&
c : peaks){
755 ss <<
c->eta() <<
" ";
759 ss <<
"peak phis:\n";
760 for (
const auto&
c : peaks){
761 ss <<
c->phi() <<
" ";
766 for (
const auto&
c : peaks){
772 ss <<
"peak signifs:\n";
773 for (
const auto&
s : peak_signifs){
778 std::stringstream
fn;
779 fn <<
"twinpeak_" <<
m_id <<
"_" <<
i <<
".txt";
780 std::ofstream
out(
fn.str());
783 return StatusCode::SUCCESS;
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode GepPi0Alg::execute |
( |
const EventContext & |
ctx | ) |
const |
|
overridevirtual |
Definition at line 40 of file GepPi0Alg.cxx.
48 CHECK(h_allCaloCells.isValid());
50 auto allCaloCells = *h_allCaloCells;
56 ATH_MSG_ERROR(
"CaloCellCollection does not contain LAREM cells");
57 return StatusCode::FAILURE;
65 std::vector<const CaloCell*>
77 constexpr
unsigned int LAREMHASH_LO{0};
79 if (front_idhash != LAREMHASH_LO) {
80 ATH_MSG_ERROR(
"front LARM identifier hash != 0, is " << front_idhash);
81 return StatusCode::FAILURE;
84 constexpr
unsigned int LAREMHASH_HI{173311};
86 if (back_idhash != LAREMHASH_HI) {
87 ATH_MSG_ERROR(
"back LARM identifier hash != 173311, is " << back_idhash);
88 return StatusCode::FAILURE;
91 if(!std::is_sorted(laremCells.begin(),
95 cc_id->calo_cell_hash(l->ID()) <
96 cc_id->calo_cell_hash(r->ID());
99 ATH_MSG_ERROR(
"LARM CaloCells are not sorted by identifier hash");
100 return StatusCode::FAILURE;
105 front_idhash <<
" " <<
106 back_idhash <<
" " <<
107 back_idhash-front_idhash <<
" " <<
113 std::vector<const CaloCell*> allEMB1Cells;
116 auto ha = calocell_id->calo_cell_hash(
cell->ID());
122 std::back_inserter(allEMB1Cells),
127 if (!totalNoiseHdl.isValid()) {
return StatusCode::FAILURE;}
128 const CaloNoise* totalNoiseCDO = *totalNoiseHdl;
137 std::vector<std::vector<const CaloCell*>> emb1CellVecs;
143 for (
const auto& cvec : emb1CellVecs) {
144 if (std::find_if_not(cvec.cbegin(),
146 EMB1Selector) != cvec.cend()){
148 return StatusCode::FAILURE;
153 std::vector<const CaloCell*> seeds(emb1CellVecs.size());
155 auto signif = [&totalNoiseCDO,
160 return sfc <
cut ? 0.:sfc;
163 auto findSeed = [&signif](
const auto& cellVec) ->
const CaloCell* {
164 return *std::max_element(cellVec.cbegin(),
166 [&signif](
const auto&
c1,
168 return signif(c1) < signif(c2);});};
171 for (
const auto&
v: emb1CellVecs) {
180 std::size_t iseed{0};
181 for(
const auto& seed : seeds) {
184 <<
" phi " <<
seed->phi()
185 <<
" significance "<< signif(seed)
204 }
catch (std::runtime_error&
e) {
206 return StatusCode::FAILURE;
224 }
catch (std::runtime_error&
e) {
226 return StatusCode::FAILURE;
230 return StatusCode::FAILURE;
236 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 & AthReentrantAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 79 of file AthReentrantAlgorithm.cxx.
86 return Algorithm::extraOutputDeps();
◆ filterPassed()
virtual bool AthReentrantAlgorithm::filterPassed |
( |
const EventContext & |
ctx | ) |
const |
|
inlinevirtualinherited |
◆ initialize()
StatusCode GepPi0Alg::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 25 of file GepPi0Alg.cxx.
36 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.
◆ isClonable()
bool AthReentrantAlgorithm::isClonable |
( |
| ) |
const |
|
overridevirtualinherited |
Specify if the algorithm is clonable.
Reentrant algorithms are clonable.
Reimplemented in Simulation::BeamEffectsAlg, InDet::SiTrackerSpacePointFinder, InDet::SCT_Clusterization, InDet::SiSPSeededTrackFinder, SCTRawDataProvider, InDet::GNNSeedingTrackMaker, SCT_PrepDataToxAOD, RoIBResultToxAOD, InDet::SiSPGNNTrackMaker, SCT_CablingCondAlgFromCoraCool, SCT_ReadCalibDataTestAlg, SCT_CablingCondAlgFromText, SCT_ReadCalibChipDataTestAlg, SCT_TestCablingAlg, SCT_ConfigurationConditionsTestAlg, ITkPixelCablingAlg, ITkStripCablingAlg, SCTEventFlagWriter, SCT_ConditionsSummaryTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_TdaqEnabledTestAlg, SCT_SiliconConditionsTestAlg, SCTSiLorentzAngleTestAlg, SCT_ByteStreamErrorsTestAlg, SCT_ConditionsParameterTestAlg, SCT_FlaggedConditionTestAlg, SCT_StripVetoTestAlg, SCT_RawDataToxAOD, and SCTSiPropertiesTestAlg.
Definition at line 44 of file AthReentrantAlgorithm.cxx.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ neighborhood()
Definition at line 789 of file GepPi0Alg.cxx.
800 auto seedID =
seed->ID();
802 auto seed_eta =
seed->eta();
803 auto seed_phi =
seed->phi();
805 std::queue<Identifier> to_process;
806 to_process.push(seedID);
808 auto accept = [&seed_eta, &seed_phi,
812 &caloMgr](
const auto& c_id){
814 auto c_eta = dde->
eta();
815 auto c_phi = dde->phi();
817 auto hash = calocell_id->calo_cell_hash(c_id);
820 auto deta = seed_eta-c_eta;
821 if( std::abs(deta) > neigh_half_eta) {
return false;}
823 auto dphi = seed_phi-c_phi;
824 return std::abs(dphi) < neigh_half_phi;
828 std::vector<Identifier>
mask;
829 auto add_neighbors_to_queue = [&to_process,
832 auto hash = cc_id->calo_cell_hash(
desc);
833 std::vector<IdentifierHash> neigh_hashes;
834 int rc = cc_id->get_neighbours(
hash,
838 return StatusCode::FAILURE;
841 for (
const auto& nh :neigh_hashes) {
842 auto cid = cc_id->cell_id(nh);
845 to_process.push(cc_id->cell_id(nh));
848 return StatusCode::SUCCESS;
852 CHECK(add_neighbors_to_queue(seedID));
853 std::vector<Identifier> neigh_idents;
856 while (!to_process.empty()){
857 const auto&
ident = to_process.front();
861 auto c_eta = dde->
eta();
862 auto c_phi = dde->phi();
864 <<
" phi " << c_phi);
865 neigh_idents.push_back(
ident);
866 add_neighbors_to_queue(
ident);
871 std::sort(neigh_idents.begin(), neigh_idents.end());
873 auto it{neigh_idents.begin()};
878 return StatusCode::SUCCESS;
◆ 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()
◆ setFilterPassed()
virtual void AthReentrantAlgorithm::setFilterPassed |
( |
bool |
state, |
|
|
const EventContext & |
ctx |
|
) |
| const |
|
inlinevirtualinherited |
◆ sort_strategy()
Definition at line 402 of file GepPi0Alg.cxx.
409 if (!seed) {
return StatusCode::SUCCESS;}
410 if (allEMB1Cells.empty()) {
return StatusCode::SUCCESS;}
412 std::vector<const CaloCell*> neigh_cells;
416 "nbhd size :" << neigh_cells.size());
419 return StatusCode::SUCCESS;
◆ sysExecute()
StatusCode AthReentrantAlgorithm::sysExecute |
( |
const EventContext & |
ctx | ) |
|
|
overridevirtualinherited |
Execute an algorithm.
We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.
Definition at line 67 of file AthReentrantAlgorithm.cxx.
69 return Gaudi::Algorithm::sysExecute (ctx);
◆ sysInitialize()
StatusCode AthReentrantAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
Override sysInitialize.
Override sysInitialize from the base class.
Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc
Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc
Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.
Reimplemented in InputMakerBase, and HypoBase.
Definition at line 96 of file AthReentrantAlgorithm.cxx.
107 if ( cs.retrieve().isFailure() ) {
109 return StatusCode::SUCCESS;
111 if (cs->regHandle(
this,*
h).isFailure()) {
112 sc = StatusCode::FAILURE;
113 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ twinpeaks_strategy()
Definition at line 241 of file GepPi0Alg.cxx.
254 if (!seed) {
return StatusCode::SUCCESS;}
255 if (allEMB1Cells.empty()) {
return StatusCode::SUCCESS;}
259 std::vector<const CaloCell*> neigh_cells;
264 ATH_MSG_DEBUG(
"twin peaks - neighborhood cells size " << neigh_cells.size()
265 <<
" input cell collection size " << allEMB1Cells.size());
268 auto signif = [&totalNoiseCDO](
const auto&
cell){
277 return signif(ncell) > signif_cut;
280 neigh_cells.resize(new_end - neigh_cells.begin());
282 ATH_MSG_DEBUG(
"twin peaks - neighborhood size after signif cut: "
283 << neigh_cells.size());
289 auto is_local_max = [neigh_cells,
291 &signif](
const auto& center_cell)
mutable {
299 std::vector<IdentifierHash> adj_hashes;
300 auto rc = cc_id->get_neighbours(cc_id->calo_cell_hash(center_cell->ID()),
304 throw std::runtime_error(
"twin peaks - error obtaining cell neighbors");
308 std::vector<Identifier> adj_idents;;
311 std::back_inserter(adj_idents),
312 [&cc_id](
const auto&
hash){
313 return cc_id->cell_id(hash);
318 auto id_cell_match = [&adj_idents](
const CaloCell* n_cell)->
bool {
321 n_cell->ID()) != adj_idents.end();};
327 for (
auto iter = neigh_cells.begin();
328 iter != adj_neigh_cell_end;
330 if (signif(*iter) > signif(center_cell)) {
return false;}
342 auto n_peaks = peaks_end - neigh_cells.begin();
343 ATH_MSG_DEBUG(
"twin peaks - number of local maxima " << n_peaks);
345 auto n_peaks_noseed = n_peaks;
346 if (
std::find(neigh_cells.begin(), peaks_end, seed) != peaks_end){--n_peaks_noseed;}
347 ATH_MSG_DEBUG(
"twin peaks - number of local maxima ommiting seed " << n_peaks_noseed);
350 <<
" phi " <<
seed->phi()
351 <<
" signif " <<signif(seed));
352 for (
auto iter = neigh_cells.begin(); iter != peaks_end; ++iter) {
354 <<
" phi " << (*iter)->phi()
355 <<
" signif " <<signif(*iter));
358 <<
seed->eta() - (*iter)->eta() <<
" dphi "
359 <<
seed->phi() - (*iter)->phi());
362 ATH_MSG_DEBUG(
"twin peaks: neighborhood size after signif cut "
363 << neigh_cells.size());
366 for (
const auto&
c: neigh_cells) {
367 if (!
c) {
throw std::runtime_error(
"Neighbor pointer is nullptr");}
371 <<
" phi " <<
c->phi()
372 <<
" signif " << signif(
c));
379 std::vector<const CaloCell*> peaks_cells(neigh_cells.begin(), peaks_end);
381 std::vector<double> peaks_signif;
384 std::back_inserter(peaks_signif),
397 return StatusCode::SUCCESS;
◆ updateVHKA()
◆ m_allCaloCellsKey
Initial value:{
this, "caloCells", "AllCalo", "key to read in a CaloCell constainer"}
Definition at line 60 of file GepPi0Alg.h.
◆ m_calocell_id
◆ m_caloMgrKey
Initial value:{this,
"caloDetDescrManager",
"CaloDetDescrManager",
"SG Key of the CaloDetDescrManager in the Consition Store"}
Definition at line 81 of file GepPi0Alg.h.
◆ m_cellsProducer
Initial value:{this,
"caloCellsProducer",
"EMB1CellsFromCaloCells",
"AlgTool to provide vectors of CaloCells ot GepPi0Alg"}
Definition at line 64 of file GepPi0Alg.h.
◆ m_crawl_signifcut
Gaudi::Property<float> GepPi0Alg::m_crawl_signifcut |
|
private |
Initial value:{
this, "crawl_signif_cut", {2.0}, "crawl min peak e/noise"}
Definition at line 116 of file GepPi0Alg.h.
◆ m_detStore
◆ m_dump
Gaudi::Property<bool> GepPi0Alg::m_dump |
|
private |
Initial value:{
this, "dump", false, "flag to trigger writing out debug information"}
Definition at line 126 of file GepPi0Alg.h.
◆ m_er_neta
Gaudi::Property<int> GepPi0Alg::m_er_neta |
|
private |
Initial value:{
this, "er_neta", {1}, "crawl number of steps eta"}
Definition at line 119 of file GepPi0Alg.h.
◆ m_er_nphi
Gaudi::Property<int> GepPi0Alg::m_er_nphi |
|
private |
Initial value:{
this, "er_nphi", {10}, "crawl number of steps phi"}
Definition at line 122 of file GepPi0Alg.h.
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthReentrantAlgorithm::m_extendedExtraObjects |
|
privateinherited |
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Empty if no symlinks were found.
Definition at line 153 of file AthReentrantAlgorithm.h.
◆ m_id
std::atomic<size_t> GepPi0Alg::m_id {0l} |
|
mutableprivate |
◆ m_neigh_half_eta
Gaudi::Property<float> GepPi0Alg::m_neigh_half_eta |
|
private |
Initial value:{
"neigh_half_eta",
{0.004},
"+- neighborhood extent in eta"}
Definition at line 88 of file GepPi0Alg.h.
◆ m_neigh_half_phi
Gaudi::Property<float> GepPi0Alg::m_neigh_half_phi |
|
private |
Initial value:{
this,
"neigh_half_phi",
{0.6},
"+- neighborhood extent in phi"}
Definition at line 94 of file GepPi0Alg.h.
◆ m_seed_signifcut
Gaudi::Property<float> GepPi0Alg::m_seed_signifcut |
|
private |
Initial value:{
this, "seed_signif_cut", {2.0}, "twin peak min peak e/noise"}
Definition at line 108 of file GepPi0Alg.h.
◆ m_strategies
Gaudi::Property<std::vector<std::string> > GepPi0Alg::m_strategies |
|
private |
Initial value:{
this,
"pi0strategies",
{"TWINPEAKS", "CRAWL"},
"list of pi0 detection strategies to be run"}
Definition at line 101 of file GepPi0Alg.h.
◆ m_totalNoiseKey
Initial value:{this,
"totalNoiseKey",
"totalNoise",
"SG Key of CaloNoise data object"}
Definition at line 71 of file GepPi0Alg.h.
◆ m_tp_signifcut
Gaudi::Property<float> GepPi0Alg::m_tp_signifcut |
|
private |
Initial value:{
this, "tp_signif_cut", {2.0}, "twin peak min peak e/noise"}
Definition at line 113 of file GepPi0Alg.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
path
python interpreter configuration --------------------------------------—
ToolHandle< ICaloCellsProducer > m_cellsProducer
std::string find(const std::string &s)
return a remapped string
Gaudi::Property< float > m_seed_signifcut
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StatusCode accept(const xAOD::Muon *mu)
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
StatusCode neighborhood(const CaloCell *, const std::vector< const CaloCell * > &laremCells, std::vector< const CaloCell * > &neighs, const CaloDetDescrManager *) const
bool adjacent(unsigned int strip1, unsigned int strip2)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
StatusCode twinpeaks_strategy(const CaloCell *seed, const std::vector< const CaloCell * > &laremCells, const std::vector< const CaloCell * > &emb1Cells, std::size_t iseed, const CaloNoise *, const CaloDetDescrManager *) const
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
Gaudi::Property< int > m_er_neta
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
SG::ReadCondHandleKey< CaloNoise > m_totalNoiseKey
StatusCode dump_crawl(std::size_t iseed, const CaloCell *seed, float seed_signif, const CellVectors &, const PathsSignif &, const std::vector< std::string > &paths_pat) const
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
AthReentrantAlgorithm()
Default constructor:
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
Gaudi::Property< bool > m_dump
::StatusCode StatusCode
StatusCode definition for legacy code.
std::reverse_iterator< DataModel_detail::iterator< DVL > > unique(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, BinaryPredicate pred)
Specialization of unique for DataVector/List.
SG::ReadHandleKey< CaloCellContainer > m_allCaloCellsKey
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
Out copy_if(In first, const In &last, Out res, const Pred &p)
Gaudi::Property< float > m_tp_signifcut
#define CHECK(...)
Evaluate an expression and check for errors.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
const CaloCell_ID * m_calocell_id
Gaudi::Property< float > m_crawl_signifcut
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
std::string to_string(const DetectorType &type)
std::vector< std::vector< const CaloCell * > > CellVectors
virtual StatusCode sysInitialize() override
Override sysInitialize.
int get_neighbours(const IdentifierHash caloHash, const LArNeighbours::neighbourOption &option, std::vector< IdentifierHash > &neighbourList) const
access to hashes for neighbours return == 0 for neighbours found
StatusCode initialize(bool used=true)
std::map< std::string, int > dirs
list of directories to be explicitly included, together with corresponding depths of subdirectories
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,...
This class provides the client interface for accessing the detector description information common to...
Data object for each calorimeter readout cell.
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
std::vector< std::vector< float > > PathsSignif
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
float eta() const
cell eta
StatusCode sort_strategy(const CaloCell *seed, const std::vector< const CaloCell * > &laremCells, const std::vector< const CaloCell * > &emb1Cells, std::size_t iseed, const CaloNoise *, const CaloDetDescrManager *) const
Gaudi::Property< float > m_neigh_half_eta
Gaudi::Property< std::vector< std::string > > m_strategies
Gaudi::Property< int > m_er_nphi
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
StatusCode crawl_strategy(const CaloCell *seed, const std::vector< const CaloCell * > &laremCells, const std::vector< const CaloCell * > &emb1Cells, std::size_t iseed, const CaloNoise *, const CaloDetDescrManager *) const
Gaudi::Property< float > m_neigh_half_phi
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
StatusCode dump_twinpeaks(std::size_t iseed, const CaloCell *seed, double seed_signif, const std::vector< const CaloCell * > &neighborhood, const std::vector< const CaloCell * > &peaks, const std::vector< double > &peak_signifs) const
std::atomic< size_t > m_id