|
ATLAS Offline Software
|
Go to the documentation of this file.
10 #include "CaloGeoHelpers/CaloSampling.h"
18 #include "GaudiKernel/PhysicalConstants.h"
31 ISvcLocator* pSvcLocator)
46 return StatusCode::SUCCESS;
69 return StatusCode::SUCCESS;
88 throw std::runtime_error(
"Could not load the " +
key.key() +
" segment container");
90 unsigned int ncbCounter = 0;
91 for (
const Trk::Segment *ncbSegment : *ncbSegmentHandle) {
97 ATH_MSG_WARNING(
"Found a muon segment in the container which pretends not to be a muon segment..");
110 constexpr
int highestSegQual = 3;
123 if (!caloClusterContainerReadHandle.
isPresent()){
124 throw std::runtime_error(
"Failed to load the calorimeter cluster container");
141 unsigned int caloClusterCounter = 0;
142 for (
const xAOD::CaloCluster* thisCaloCluster : *caloClusterContainerReadHandle) {
143 ++caloClusterCounter;
145 for (
auto lay : caloLayers){
146 eClus +=thisCaloCluster->eSample(lay);
158 rClus = rClus / std::cosh(thisCaloCluster->eta());
166 const double phiClus = thisCaloCluster->phi();
169 std::vector<int> matchedSegmentsPerCluster(cache.
m_indexSeg.size(), 0);
172 for (
unsigned int j = 0; j < cache.
m_indexSeg.size(); j++) {
176 const double phiSeg = globalPos.phi();
182 <<
"Segment: "<<
Amg::toString(globalPos)<<
", phi: "<<globalPos.phi()
183 <<
" --- Cluster: "<<phiClus);
187 const double rSeg = globalPos.perp();
191 <<
"Segment: "<<
Amg::toString(globalPos)<<
", phi: "<<globalPos.perp()
192 <<
" --- Cluster: "<<rClus);
195 matchedSegmentsPerCluster[j] = 1;
205 clusLink.
toIndexedElement(*caloClusterContainerReadHandle, caloClusterCounter - 1);
207 cache.
m_matchMatrix.push_back(std::move(matchedSegmentsPerCluster));
218 unsigned int nMeas{0};
234 constexpr
double tdcBinSize = 0.78125;
235 time += tdcBinSize * mdtPrd->
tdc();
263 for (
unsigned int segIndex = 0; segIndex < cache.
m_indexSeg.size(); ++segIndex) {
268 double zSeg = globalPos.z();
282 double inTime = -(-std::abs(zSeg) + globalPos.mag()) *
inv_c;
283 double early = -(std::abs(zSeg) + globalPos.mag()) *
inv_c;
289 if (timeStatus == 2) {
296 unsigned int segIndexA = segIndex;
299 int timeStatusA = timeStatus;
301 double phiSegA = globalPos.phi();
303 for (
unsigned int segIndexC = 0; segIndexC < cache.
m_indexSeg.size(); segIndexC++) {
308 double zSegC = globalPos.z();
320 double inTime = -(-std::abs(zSegC) + globalPos.mag()) *
inv_c;
321 double early = -(std::abs(zSegC) + globalPos.mag()) *
inv_c;
327 double phiSegC = globalPos.phi();
337 if (timeStatusA == 0 || timeStatusC == 0)
363 for (
unsigned int clusIndex = 0; clusIndex < cache.
m_indexClus.size();
372 rClus = rClus / std::cosh(clus->
eta());
373 double zClus = rClus * std::sinh(clus->
eta());
374 double tClus = clus->
time();
377 double expectedClusterTimeAC = -(zClus + std::hypot(rClus, zClus)) *
inv_c;
378 double expectedClusterTimeCA = -(-zClus + std::hypot(rClus, zClus)) *
inv_c;
380 for (
unsigned int segIndex = 0; segIndex < cache.
m_indexSeg.size(); segIndex++) {
388 double zSeg = globalPos.z();
394 double inTime = -(-std::abs(zSeg) + globalPos.mag()) *
inv_c;
395 double early = -(std::abs(zSeg) + globalPos.mag()) *
inv_c;
403 if ((zSeg > 0 && timeStatus == 2) || (zSeg < 0 && timeStatus == 1))
405 if ((zSeg > 0 && timeStatus == 1) || (zSeg < 0 && timeStatus == 2))
410 if (std::abs(tClus - expectedClusterTimeAC) <
m_cutClusTime ||
424 if (direction == 1) {
425 if (std::abs(tClus - expectedClusterTimeAC) <
m_cutClusTime) {
434 }
else if (direction == -1) {
435 if (std::abs(tClus - expectedClusterTimeCA) <
m_cutClusTime) {
478 for (
unsigned int clusIndex = 0; clusIndex < cache.
m_indexClus.size(); clusIndex++) {
480 for (
unsigned int segIndexA = 0; segIndexA < cache.
m_indexSeg.size(); segIndexA++) {
488 double zSegA = globalPos.z();
497 double inTime = -(-std::abs(zSegA) + globalPos.mag()) *
inv_c;
498 double early = -(std::abs(zSegA) + globalPos.mag()) *
inv_c;
505 for (
unsigned int segIndexC = 0; segIndexC < cache.
m_indexSeg.size(); segIndexC++) {
513 double zSegC = globalPos.z();
524 double inTime = -(-std::abs(zSegC) + globalPos.mag()) *
inv_c;
525 double early = -(std::abs(zSegC) + globalPos.mag()) *
inv_c;
538 if (timeStatusA == 0 || timeStatusC == 0)
549 if (timeStatusA == 2)
551 if (timeStatusC == 2)
578 for (
unsigned int clusIndex = 0; clusIndex < cache.
m_indexClus.size();
586 rClus = rClus / cosh(clus->
eta());
587 double zClus = rClus * sinh(clus->
eta());
599 for (; firstCell != lastCell; ++firstCell) {
602 if (
cell->time() == 0.)
604 if (
cell->energy() < 100.)
611 const double rCell = dde->
r();
612 const double zCell = dde->
z();
613 dr =
dr + (rCell - rClus) * (rCell - rClus);
614 dz = dz + (zCell - zClus) * (zCell - zClus);
619 dr = sqrt(
dr / nCell);
620 dz = sqrt(dz / nCell);
631 for (
unsigned int segIndex = 0; segIndex < cache.
m_indexSeg.size();
656 Cache& cache)
const {
665 if (!jetContainerReadHandle.
isValid()) {
671 unsigned int jetCounter = 0;
672 for (
const auto *thisJet : *jetContainerReadHandle) {
673 bool isFakeJet =
false;
680 for (; constIt != constItE; ++constIt) {
686 for (
unsigned int clusIndex = 0; clusIndex < cache.
m_indexClus.size();
690 if (jetConst == clus) {
@ CENTER_MAG
Cluster Centroid ( )
void SetNumNoTimeMedium(int numNoTimeMedium)
void SetNumSegmentAC(int numSegmentAC)
SG::ReadHandleKey< xAOD::JetContainer > m_jetContainerReadHandleKey
ReadHandleKey for JetContainer.
ElementLinkVector< Trk::SegmentCollection > m_indexSeg
void SegmentMethod(Cache &cache) const
This function looks at the segments found by the FillMatchMatrix function.
flt_t time() const
Access cluster time.
std::vector< int > m_resultClus
void SetNumClusterShape(int numClusterShape)
Gaudi::Property< double > m_cutDphiSegAC
void FillDrdzClus(std::vector< float > *drdzClus)
Gaudi::Property< double > m_clusRadiusHigh
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version)
Class to represent MM measurements.
void SetNumMatched(int numMatched)
void FillIndexJet(ElementLinkVector< xAOD::JetContainer >indexJet)
void SetNumNoTimeTight(int numNoTimeTight)
void SetNumOneSidedLoose(int numOneSidedLoose)
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_caloClusterContainerReadHandleKey
ReadHandleKey for CaloClusterContainer.
void SetNumOneSidedTight(int numOneSidedTight)
void FillBeamBackgroundData(SG::WriteHandle< BeamBackgroundData > &beamBackgroundDataWriteHandle, Cache &cache) const
This function stores all the results in BeamBackgroundData.
BeamBackgroundFiller(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< double > m_cutDphiClusSeg
Gaudi::Property< double > m_cutDradClusSeg
void SetNumSegmentACNoTime(int numSegmentACNoTime)
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
void SetNumNoTimeLoose(int numNoTimeLoose)
void FillResultClus(std::vector< int > *resultClus)
bool toIndexedElement(BaseConstReference data, index_type elemID, IProxyDict *sg=0)
Set the link to an element given by index and pointer to container.
virtual bool type(PrepRawDataType type) const =0
Interface method checking the type.
std::vector< size_t > vec
#define ATH_MSG_VERBOSE(x)
Property holding a SG store/key/clid from which a ReadHandle is made.
This file defines helper classes to deal with jet constituents.
ElementLinkVector< xAOD::CaloClusterContainer > m_indexClus
void FillResultJet(std::vector< int > *resultJet)
@ u
Enums for curvilinear frames.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
An algorithm that can be simultaneously executed in multiple threads.
void SetNumTwoSided(int numTwoSided)
Gaudi::Property< double > m_cutDrdz
Gaudi::Property< double > m_thetaCutNCB
Inclanation cut between the segment position and its direction.
void FillResultSeg(std::vector< int > *resultSeg)
double GetSegmentTime(const Muon::MuonSegment &pMuonSegment) const
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
Gaudi::Property< double > m_cutTimeDiffAC
ElementLinkVector< xAOD::JetContainer > m_indexJet
Description of a calorimeter cluster.
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
std::vector< int > m_resultJet
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Gaudi::Property< double > m_cutMuonTime
virtual StatusCode execute(const EventContext &ctx) const override
void SetDirection(int direction)
virtual double eta() const
The pseudorapidity ( ) of the particle.
std::vector< float > m_drdzClus
Gaudi::Property< double > m_clusRadiusLow
Class representing clusters from the CSC.
::StatusCode StatusCode
StatusCode definition for legacy code.
void SetDecision(int decision)
void FindFakeJets(const EventContext &ctx, Cache &cache) const
This function checks whether the matched clusters are contained in any jets.
const std::vector< const Trk::MeasurementBase * > & containedMeasurements() const
returns the vector of Trk::MeasurementBase objects
void ClusterShapeMethod(Cache &cache) const
This function is the implementation of the "Cluster-Shape Method".
double time() const
Returns the time.
#define CHECK(...)
Evaluate an expression and check for errors.
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
Gaudi::Property< double > m_cutClusTime
const IParticle * rawConstituent() const
Access the real underlying IParticle.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Gaudi::Property< double > m_clusEnergyCut
Minimum cut on the cluster energy to be considered.
virtual StatusCode initialize() override
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ElementLink implementation for ROOT usage.
Identifier identify() const
return the identifier
int tdc() const
Returns the TDC (typically range is 0 to 2500).
Type::ObjectType type() const
The full 4-momentum of the particle.
Helpers for checking error return status codes and reporting errors.
void SetNumTwoSidedNoTime(int numTwoSidedNoTime)
short int time() const
Returns the time (in ns)
std::vector< std::vector< int > > m_matchMatrix
Class to represent measurements from the Monitored Drift Tubes.
Eigen::Matrix< double, 3, 1 > Vector3D
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
SG::WriteHandleKey< BeamBackgroundData > m_beamBackgroundDataWriteHandleKey
void SetNumJet(int numJet)
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
ToolHandle< Muon::IMuonSegmentSelectionTool > m_segmentSelector
void FillMatchMatrix(const EventContext &ctx, Cache &cache) const
This function selects the muon segments with the direction parallel to the beam pipe and calorimeter ...
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Data object for each calorimeter readout cell.
void SetNumSegment(int numSegment)
def time(flags, cells_name, *args, **kw)
void FillMatchMatrix(std::vector< std::vector< int > > *matchMatrix)
#define ATH_MSG_WARNING(x)
void FillIndexSeg(ElementLinkVector< Trk::SegmentCollection > indexSeg)
std::vector< int > m_resultSeg
const_cell_iterator cell_end() const
void OneSidedMethod(Cache &cache) const
This function is the implementation of the "No-Time Method" and the "One-Sided Method".
void SetNumSegmentEarly(int numSegmentEarly)
StIndex
enum to classify the different station layers in the muon spectrometer
A vector of jet constituents at the scale used during jet finding.
bool isPresent() const
Is the referenced object present in SG?
virtual const Amg::Vector3D & globalPosition() const override final
global position
SG::ReadHandleKeyArray< Trk::SegmentCollection > m_segmentKeys
ReadHandleKey for Trk::SegmentCollection from CSC.
void TwoSidedMethod(Cache &cache) const
This function is the implementation of the "Two-Sided No-Time Method" and the "Two-Sided Method" that...
Class to represent sTgc measurements.
const_iterator to loop over cells belonging to a cluster
void SetNumOneSidedMedium(int numOneSidedMedium)
const Amg::Vector3D & globalDirection() const
global direction
void FillIndexClus(ElementLinkVector< xAOD::CaloClusterContainer > indexClus)