13using Athena::Units::GeV;
14using Athena::Units::ns;
41 Tile::MAX_ROS, nL1Triggers);
72 int nClusters = caloClusterContainer->size();
73 ATH_MSG_DEBUG(
"Number of clusters in the event: " << nClusters );
76 for (
int l1TriggerIdx : l1TriggersIndices) {
81 return StatusCode::SUCCESS;
85 caloClusterContainer->begin(), caloClusterContainer->end(),
87 return cluster1->e() < cluster2->e();
90 const CaloCell* mostEnCell =
nullptr;
91 double mostEnClusterPhi = 0.0;
93 if (mostEnCluster->
e() > 0.0) {
94 mostEnClusterPhi = mostEnCluster->
phi();
101 for (
int l1TriggerIdx : l1TriggersIndices) {
108 mostEnCell = *std::max_element(mostEnCluster->
begin(), mostEnCluster->
end(),
110 return cell1->energy() < cell2->energy();
116 for (
int l1TriggerIdx : l1TriggersIndices) {
129 double correlClusterEnergy = 0.0;
133 float energy = cluster->e();
134 float phi = cluster->phi();
135 float pt = cluster->pt();
136 float px = pt * std::cos(
phi);
137 float py = pt * std::sin(
phi);
142 if (
phi * mostEnClusterPhi < 0.0
143 && energy > correlClusterEnergy) {
144 correlCluster = cluster;
145 correlClusterEnergy = energy;
149 <<
", Energy= " << energy
150 <<
", Et()= " << cluster->et()
151 <<
", Eta= " << cluster->eta()
152 <<
", Phi= " << cluster->phi() );
158 return cluster->
eta();
163 return cluster->
phi();
171 float sumEt = sqrt(sumPx * sumPx + sumPy * sumPy);
176 for (
int l1TriggerIdx : l1TriggersIndices) {
187 if (mostEnCluster->
e() > 0.0 && correlCluster) {
189 float energyDiff = (mostEnClusterPhi > 0.0) ? mostEnCluster->
e() - correlCluster->
e()
190 : correlCluster->
e() - mostEnCluster->
e();
192 float etaDelta = std::abs(correlCluster->
eta()) - std::abs(mostEnCluster->
eta());
193 float phiDelta = std::abs(correlCluster->
phi() - mostEnCluster->
phi());
198 for (
int l1TriggerIdx : l1TriggersIndices) {
203 const CaloCell* correlCell =
nullptr;
205 correlCell = *std::max_element( correlCluster->
begin(), correlCluster->
end(),
207 return cell1->energy() < cell2->energy();
211 if (mostEnCell && correlCell) {
212 float timeDiff = mostEnCell->
time() - correlCell->
time();
214 for (
int l1TriggerIdx : l1TriggersIndices) {
225 std::set<Identifier> usedCells;
226 std::vector<float> partitionTime[
MAX_PART];
230 for (
const CaloCell* cell : *cluster) {
236 || usedCells.find(
id) != usedCells.end() )
continue;
238 usedCells.insert(
id);
247 bool single_PMT = single_PMT_C10 || single_PMT_scin;
252 partitionTime[partition].push_back(cell->time());
260 for (
int partition = 0; partition <
MAX_PART; ++partition) {
261 if (!partitionTime[partition].
empty()) {
270 fill(
"TileClusterMonExecuteTime", timer);
272 return StatusCode::SUCCESS;
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
Handle class for reading from StoreGate.
Wrapper to avoid constant divisions when using units.
static const Attributes_t empty
const ServiceHandle< StoreGateSvc > & detStore() const
SG::ReadHandle< xAOD::EventInfo > GetEventInfo(const EventContext &) const
Return a ReadHandle for an EventInfo object (get run/event numbers, etc.)
ToolHandleArray< GenericMonitoringTool > m_tools
Array of Generic Monitoring Tools.
Data object for each calorimeter readout cell.
float time() const
get time (data member)
Declare a monitored scalar variable.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Static class providing several utility functions and constants.
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
std::vector< std::vector< int > > m_clusterEnergyGroups
const TileCablingService * m_cabling
std::vector< int > m_clusterSumPyGroups
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_caloClusterContainerKey
std::vector< int > m_clusterNCellsGroups
Gaudi::Property< float > m_cellEnergyThresholdForTiming
std::vector< int > m_clusterSumEtGroups
std::vector< int > m_nClustersGroups
std::vector< int > m_partitionTimeLBGroups
std::vector< int > m_clusterEneDiffGroups
std::vector< int > m_allClusterEneEtaPhiGroups
Gaudi::Property< bool > m_fillTimingHistograms
std::vector< int > m_clusterTimeDiffGroups
virtual StatusCode initialize() override
initialize
std::vector< int > m_allClusterEtaPhiGroups
std::vector< int > m_clusterEtaPhiGroups
std::vector< int > m_allClusterEnergyGroups
std::vector< int > m_clusterEtGroups
std::vector< int > m_clusterSumPxGroups
std::vector< int > m_clusterEtaPhiDiffGroups
int getNumberOfL1Triggers(void) const
Return number of L1 triggers for which histograms should be filled.
virtual StatusCode initialize() override
initialize
std::vector< int > getL1TriggerIndices(uint32_t lvl1TriggerType) const
Return indices of histograms to be filled according fired L1 trigger type.
Partition getPartition(const CaloCell *cell, const TileID *tileID) const
Return Partition for Tile cell or MAX_PART otherwise.
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
const_iterator end() const
const_iterator begin() const
virtual double eta() const
The pseudorapidity ( ) of the particle.
size_t size() const
size method (forwarded from CaloClusterCellLink obj)
virtual double e() const
The total energy of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
uint32_t lumiBlock() const
The current event's luminosity block number.
@ Tile
The Tile calorimeter.
uint16_t level1TriggerType() const
The Level-1 trigger type.
@ Error
The sub-detector issued an error.
EventFlagErrorState errorState(EventFlagSubDet subDet) const
Get the error state for a particular sub-detector.
Generic monitoring tool for athena components.
std::vector< V > buildToolMap(const ToolHandleArray< GenericMonitoringTool > &tools, const std::string &baseName, int nHist)
Builds an array of indices (base case)
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
EventInfo_v1 EventInfo
Definition of the latest event info version.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
void fill(H5::Group &out_file, size_t iterations)