|
ATLAS Offline Software
|
#include <CscPeakThresholdClusterBuilderTool.h>
|
| CscPeakThresholdClusterBuilderTool (const std::string &type, const std::string &aname, const IInterface *) |
|
| ~CscPeakThresholdClusterBuilderTool () |
|
StatusCode | initialize () |
| AlgTool InterfaceID. More...
|
|
StatusCode | getClusters (std::vector< IdentifierHash > &idVect, std::vector< IdentifierHash > &selectedIdVect, Muon::CscPrepDataContainer *object) |
|
StatusCode | finalize () |
|
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 |
|
◆ StoreGateSvc_t
◆ CscPeakThresholdClusterBuilderTool()
CscPeakThresholdClusterBuilderTool::CscPeakThresholdClusterBuilderTool |
( |
const std::string & |
type, |
|
|
const std::string & |
aname, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~CscPeakThresholdClusterBuilderTool()
CscPeakThresholdClusterBuilderTool::~CscPeakThresholdClusterBuilderTool |
( |
| ) |
|
|
default |
◆ 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()
StatusCode CscPeakThresholdClusterBuilderTool::finalize |
( |
| ) |
|
◆ getClusters() [1/3]
Definition at line 148 of file CscPeakThresholdClusterBuilderTool.cxx.
152 decodedIds.push_back(givenHashId);
153 ATH_MSG_DEBUG(
"A collection already exists in the container for offline id hash. " << (
int)givenHashId);
154 return StatusCode::SUCCESS;
159 if (pdigcon.isValid()) {
163 return StatusCode::SUCCESS;
169 if (
nullptr ==
col) {
170 unsigned int coll_hash = givenHashId;
171 ATH_MSG_WARNING(
"Specific CSC Strip PrepData collection retrieving failed for collection hash = " << coll_hash);
172 return StatusCode::SUCCESS;
178 int istation =
m_idHelperSvc->cscIdHelper().stationName(colid) - 49;
185 vector<const CscStripPrepData*> strips[8];
186 int maxstrip[8] = {0, 0, 0, 0, 0, 0, 0, 0};
191 if (MuonDetMgr ==
nullptr) {
192 ATH_MSG_ERROR(
"Null pointer to the MuonDetectorManager conditions object");
193 return StatusCode::FAILURE;
198 for (CscStripPrepDataCollection::const_iterator idig =
col->begin(); idig !=
col->end(); ++idig) {
205 int idx = 2 * (wlay - 1) + measphi;
207 if (maxstrip[
idx] == 0) {
209 for (
int istrip = 0; istrip < maxstrip[
idx]; ++istrip) strips[
idx].push_back(
nullptr);
212 if (istrip < 0 || istrip >= maxstrip[
idx]) {
216 strips[
idx][istrip] = &dig;
221 for (
int measphi = 0; measphi < 2; ++measphi) {
222 for (
int wlay = 1; wlay < 5; ++wlay) {
223 int idx = 2 * (wlay - 1) + measphi;
232 ATH_MSG_ERROR(
"Couldn't add CscPrepdataCollection to container!");
233 return StatusCode::FAILURE;
235 decodedIds.push_back(
hash);
238 return StatusCode::SUCCESS;
◆ getClusters() [2/3]
Implements ICscClusterBuilder.
Definition at line 124 of file CscPeakThresholdClusterBuilderTool.cxx.
129 if (!givenIDs.empty()) {
130 for (
unsigned int i = 0;
i < givenIDs.size(); ++
i) {
131 if (
getClusters(givenIDs[
i], decodedIds,
object).isFailure()) {
132 ATH_MSG_ERROR(
"Unable to decode CSC RDO " <<
i <<
"th into CSC PrepRawData");
133 return StatusCode::RECOVERABLE;
139 ATH_MSG_ERROR(
"Unable to decode CSC RDO into CSC PrepRawData");
140 return StatusCode::RECOVERABLE;
143 return StatusCode::SUCCESS;
◆ getClusters() [3/3]
Definition at line 243 of file CscPeakThresholdClusterBuilderTool.cxx.
247 if (pdigcon.isValid()) {
251 return StatusCode::SUCCESS;
257 for (CscStripPrepDataContainer::const_iterator
icol = con.begin();
icol != con.end(); ++
icol) {
260 int istation =
m_idHelperSvc->cscIdHelper().stationName(colid) - 49;
266 vector<const CscStripPrepData*> strips[8];
267 int maxstrip[8] = {0, 0, 0, 0, 0, 0, 0, 0};
272 if (MuonDetMgr ==
nullptr) {
273 ATH_MSG_ERROR(
"Null pointer to the MuonDetectorManager conditions object");
274 return StatusCode::FAILURE;
279 for (CscStripPrepDataCollection::const_iterator idig =
col.begin(); idig !=
col.end(); ++idig) {
286 int idx = 2 * (wlay - 1) + measphi;
288 if (maxstrip[
idx] == 0) {
290 for (
int istrip = 0; istrip < maxstrip[
idx]; ++istrip) strips[
idx].push_back(
nullptr);
293 if (istrip < 0 || istrip >= maxstrip[
idx]) {
297 strips[
idx][istrip] = &dig;
302 for (
int measphi = 0; measphi < 2; ++measphi) {
303 for (
int wlay = 1; wlay < 5; ++wlay) {
304 int idx = 2 * (wlay - 1) + measphi;
313 ATH_MSG_ERROR(
"Couldn't add CscPrepdataCollection to container!");
314 return StatusCode::FAILURE;
316 decodedIds.push_back(
hash);
320 return StatusCode::SUCCESS;
◆ initialize()
StatusCode CscPeakThresholdClusterBuilderTool::initialize |
( |
| ) |
|
◆ 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& ICscClusterBuilder::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
Must declare this, with name of interface
Definition at line 30 of file ICscClusterBuilder.h.
32 static const InterfaceID IID_ICscClusterBuilder(
"ICscClusterBuilder", 1, 0);
33 return IID_ICscClusterBuilder;
◆ make_clusters()
Definition at line 338 of file CscPeakThresholdClusterBuilderTool.cxx.
343 unsigned int maxstrip = strips.size();
345 ATH_MSG_DEBUG(
" Clustering for " << setaphi(measphi) <<
" plane with " << maxstrip <<
" strips");
351 std::vector<bool> astrip;
354 for (
unsigned int istrip = 0; istrip < strips.size(); ++istrip) {
362 if (!newCollection) {
366 newCollection->setIdentifier(elementId);
375 ATH_MSG_DEBUG(
" Strip " << setw(3) << istrip + 1 <<
": charge= " << setw(7) <<
int(
res.charge) <<
" time=" << setw(3)
376 <<
int(
res.time + 0.5));
385 stripfits.push_back(
res);
390 bool incluster =
false;
394 std::vector<const CscStripPrepData*> clusterStrips;
395 std::vector<Identifier> prd_digit_ids;
396 for (
unsigned int istrip = 0; istrip < strips.size(); ++istrip) {
402 if (!astrip[istrip])
continue;
409 first_strip = istrip;
411 clusterStrips.clear();
412 prd_digit_ids.clear();
417 sfits.push_back(sfit);
418 clusterStrips.push_back(pstrip);
419 prd_digit_ids.push_back(pstrip->
identify());
420 if (
q > qpeak) qpeak =
q;
424 if (istrip != maxstrip - 1 && astrip[istrip + 1])
continue;
438 std::vector<ICscClusterFitter::Result>
results;
477 res.clusterStatus = oldclustatus;
486 if (MuonDetMgr ==
nullptr) {
487 ATH_MSG_ERROR(
"Null pointer to the MuonDetectorManager conditions object");
492 unsigned int nresults =
results.size();
493 for (
unsigned int ire = 0; ire < nresults; ++ire) {
502 unsigned int id_strip =
results[ire].strip;
503 double cluster_charge =
results[ire].charge;
504 double cluster_time =
results[ire].time;
507 if (id_strip >= sfits.size()) {
513 if (id_strip < clusterStrips.size()) pstrip_id = clusterStrips[id_strip];
522 int zsec =
m_idHelperSvc->cscIdHelper().stationEta(cluster_id);
523 int wlay =
m_idHelperSvc->cscIdHelper().wireLayer(cluster_id);
530 Amg::Vector2D plpos(measphi ? local_pos.y() : local_pos.z(), measphi ? local_pos.z() : local_pos.y());
534 ATH_MSG_DEBUG(
" ID strip: " << first_strip + id_strip <<
"(" << first_strip <<
":" << id_strip <<
")");
535 ATH_MSG_DEBUG(
" local position: " << plpos.x() <<
" " << plpos.y());
541 std::vector<Identifier> prd_digit_ids_submit;
542 unsigned int fstrip =
results[ire].fstrip;
543 unsigned int lstrip =
results[ire].lstrip;
544 prd_digit_ids_submit.reserve(lstrip + 1);
545 for (
unsigned int ids_index = fstrip; ids_index < lstrip + 1; ++ids_index) {
546 if (ids_index >= prd_digit_ids.size())
547 ATH_MSG_WARNING(
" bad index " << ids_index <<
" maximum " << prd_digit_ids.size());
549 prd_digit_ids_submit.push_back(prd_digit_ids[ids_index]);
555 prd_digit_ids_submit,
558 int(cluster_charge + 0.5),
563 newCollection->size());
565 newCollection->push_back(pclus);
◆ 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()
◆ 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()
◆ m_cluster_handle
◆ m_DetectorManagerKey
Initial value:{
this,
"DetectorManagerKey",
"MuonDetectorManager",
"Key of input MuonDetectorManager condition data",
}
retrieve MuonDetectorManager from the conditions store
Definition at line 144 of file CscPeakThresholdClusterBuilderTool.h.
◆ m_detStore
◆ m_digit_key
◆ m_evtStore
◆ m_idHelperSvc
◆ m_pfitter_def
◆ m_pfitter_prec
◆ m_pfitter_split
◆ m_pstrip_fitter
ToolHandle<ICscStripFitter> CscPeakThresholdClusterBuilderTool::m_pstrip_fitter |
|
private |
◆ m_q3sum_threshold_eta
double CscPeakThresholdClusterBuilderTool::m_q3sum_threshold_eta |
|
private |
◆ m_q3sum_threshold_phi
double CscPeakThresholdClusterBuilderTool::m_q3sum_threshold_phi |
|
private |
◆ m_qpeak_threshold_eta
double CscPeakThresholdClusterBuilderTool::m_qpeak_threshold_eta |
|
private |
◆ m_qpeak_threshold_phi
double CscPeakThresholdClusterBuilderTool::m_qpeak_threshold_phi |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
virtual StatusCode addCollection(const T *coll, IdentifierHash hashId) override final
insert collection into container with id hash if IDC should not take ownership of collection,...
MuonPrepDataCollection< CscStripPrepData > CscStripPrepDataCollection
Eigen::Matrix< double, 2, 1 > Vector2D
Amg::Vector3D nominalLocalClusterPos(int eta, int wireLayer, int measPhi, double x0) const
ignores internal alignment parameters, hence gives generally incorrect answer (local here is the stat...
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
#define ATH_MSG_VERBOSE(x)
virtual const IdentifierHash collectionHash() const final
returns the IdentifierHash corresponding to the channel.
virtual void setOwner(IDataHandleHolder *o)=0
Class representing the raw data of one CSC strip (for clusters look at Muon::CscPrepData).
std::string toString(CscStripStatus cstat)
Return a string description of a CSC cluster status flag.
int maxNumberOfStrips(int measuresPhi) const
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
const CscReadoutElement * getCscReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
void setHashAndIndex(unsigned short collHash, unsigned short objIndex)
TEMP for testing: might make some classes friends later ...
Class representing clusters from the CSC.
std::pair< std::vector< unsigned int >, bool > res
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
MuonPrepDataContainerT< CscStripPrepData > CscStripPrepDataContainer
@ CscStatusUndefined
Undefined, should not happen, most likely indicates a problem.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Identifier identify() const
return the identifier
MuonPrepDataCollection< CscPrepData > CscPrepDataCollection
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
virtual const T * indexFindPtr(IdentifierHash hashId) const override final
return pointer on the found entry or null if out of range using hashed index - fast version,...
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
std::vector< StripFit > StripFitList
CscClusterStatus
Enum to represent the cluster status - see the specific enum values for more details.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
CscTimeStatus
Enum to represent the cluster time measurement status - see the specific enum values for more details...