ATLAS Offline Software
CaloTopoClusterMaker.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //-----------------------------------------------------------------------
6 // File and Version Information:
7 // $Id: CaloTopoClusterMaker.cxx,v 1.44 2009-05-19 10:04:47 gunal Exp $
8 //
9 // Description: see CaloTopoClusterMaker.h
10 //
11 // Environment:
12 // Software developed for the ATLAS Detector at CERN LHC
13 //
14 // Author List:
15 // Sven Menke
16 //
17 //-----------------------------------------------------------------------
18 
19 //-----------------------
20 // This Class's Header --
21 //-----------------------
22 #include "CaloTopoClusterMaker.h"
23 #include "CaloTopoTmpClusterCell.h"
24 #include "CaloTopoTmpHashCluster.h"
25 #include "CaloTopoTmpHashCell.h"
29 #include "CaloEvent/CaloCell.h"
31 #include "CaloEvent/CaloPrefetch.h"
34 #include "GaudiKernel/StatusCode.h"
35 #include "CLHEP/Units/SystemOfUnits.h"
36 #include <vector>
37 #include <algorithm>
38 #include <iterator>
39 #include <sstream>
40 #include <memory>
41 
43 
44 #include "CaloProtoCluster.h"
45 
46 using CLHEP::MeV;
47 using CLHEP::ns;
48 
49 //#############################################################################
50 
52  const std::string& name,
53  const IInterface* parent)
54 
56  m_calo_id(nullptr),
57  m_cellsKey(""),
58  m_subcaloUsed(),
59  m_cellThresholdOnEorAbsEinSigma ( 0.),
60  m_neighborThresholdOnEorAbsEinSigma( 3.),
61  m_seedThresholdOnEorAbsEinSigma ( 6.),
62  m_seedThresholdOnTAbs ( 12.5*ns),
63  m_timeCutUpperLimit ( 20.),
64  m_xtalkDeltaT ( 15.*ns),
65  m_xtalk2Eratio1 ( 4.),
66  m_xtalk2Eratio2 ( 25.),
67  m_xtalk3Eratio ( 10.),
68  m_xtalkEtaEratio (4.),
69  m_xtalk2DEratio (4.),
70  m_neighborOption ("super3D"),
71  m_nOption (LArNeighbours::super3D),
72  m_restrictHECIWandFCalNeighbors (false),
73  m_restrictPSNeighbors (false),
74  m_seedCutsInAbsE (false),
75  m_neighborCutsInAbsE (true),
76  m_cellCutsInAbsE (true),
77  m_clusterCutsInAbsE (true),
78  m_clusterEtorAbsEtCut ( 0.*MeV),
79  m_twogaussiannoise (false),
80  m_treatL1PredictedCellsAsGood (true),
81  m_seedCutsInT (false),
82  m_cutOOTseed (false),
83  m_useTimeCutUpperLimit (false),
84  m_xtalkEM2 (false),
85  m_xtalkEM2D (false),
86  m_xtalkEM2n (false),
87  m_xtalkEM3 (false),
88  m_xtalkEMEta (false),
89  m_minSampling (0),
90  m_maxSampling (0),
91  m_hashMin (999999),
92  m_hashMax (0),
93  m_clusterSize ()
94 {
95  declareInterface<CaloClusterCollectionProcessor> (this);
96  // Name(s) of Cell Containers
97  declareProperty("CellsName",m_cellsKey);
98 
99  // Name(s) of Calorimeters to consider
100  declareProperty("CalorimeterNames",m_caloNames);
101 
102  // Name(s) of Calorimeter Samplings to consider for seeds
103  declareProperty("SeedSamplingNames",m_samplingNames);
104 
105  // Energy thresholds (in units of noise Sigma)
106  declareProperty("SeedThresholdOnEorAbsEinSigma",
108  declareProperty("NeighborThresholdOnEorAbsEinSigma",
110  declareProperty("CellThresholdOnEorAbsEinSigma",
112 
113  // Seed and cluster cuts are in E or Abs E
114  declareProperty("SeedCutsInAbsE",m_seedCutsInAbsE);
115 
116  // Time thresholds (in abs. val.)
117  declareProperty("SeedThresholdOnTAbs",m_seedThresholdOnTAbs);
118 
119  // Significance upper limit for applying time cut
120  declareProperty("TimeCutUpperLimit",m_timeCutUpperLimit);
121 
122  //do Seed cuts on Time
123  declareProperty("SeedCutsInT",m_seedCutsInT);
124  //exclude out-of-time seeds from neighbouring and cell stage
125  declareProperty("CutOOTseed",m_cutOOTseed);
126  //do not apply time cut on cells of large significance
127  declareProperty("UseTimeCutUpperLimit",m_useTimeCutUpperLimit);
128  //relax time window (if timing is used) in EM2 when xTalk is present
129  declareProperty("XTalkEM2",m_xtalkEM2);
130  //relax time window (if timing is used) in EM2 when xTalk is present for all 2D neighbirs
131  declareProperty("XTalkEM2D",m_xtalkEM2D);
132  //relax time window (if timing is used) in EM2 Eta directionwhen xTalk is present
133  declareProperty("XTalkEMEta",m_xtalkEMEta);
134  //relax time window (if timing is used) in EM2 when xTalk is present also for 2nd phi neighbors (if XTalkEM2 is also set)
135  declareProperty("XTalkEM2n",m_xtalkEM2n);
136  //relax time window (if timing is used) in EM3 when xTalk is present for layer 3 neighbor of high energy layer 2 cells
137  declareProperty("XTalkEM3",m_xtalkEM3);
138  //delta T to add to upper time threshold for EM2 cells affected by xtalk
139  declareProperty("XTalkDeltaT",m_xtalkDeltaT);
140  //Eratio for first phi neighbor in layer2
141  declareProperty("XTalk2Eratio1",m_xtalk2Eratio1);
142  //Eratio for second phi neighbor in layer2
143  declareProperty("XTalk2Eratio2",m_xtalk2Eratio2);
144  //Eratio for previous sampling neighbor in layer 3
145  declareProperty("XTalk3Eratio",m_xtalk3Eratio);
146  //Eratio for cross-talk in eta layer 2
147  declareProperty("XTalkEtaEratio",m_xtalkEtaEratio);
148  //Eratio for cross-talk in all 2D layer 2 neighbors
149  declareProperty("XTalk2DEratio",m_xtalk2DEratio);
150 
151  // Neighbor cuts are in E or Abs E
152  declareProperty("NeighborCutsInAbsE",m_neighborCutsInAbsE);
153 
154  // Cell cuts are in E or Abs E
155  declareProperty("CellCutsInAbsE",m_cellCutsInAbsE);
156 
157  // Neighbor Option
158  declareProperty("NeighborOption",m_neighborOption);
159 
160  // Restrict HEC IW and FCal Neighbors
161  declareProperty("RestrictHECIWandFCalNeighbors",m_restrictHECIWandFCalNeighbors);
162 
163  // Restrict PS Neighbors
164  declareProperty("RestrictPSNeighbors",m_restrictPSNeighbors);
165 
166  //Cluster cuts are in E_t or Abs E_t
167  declareProperty("ClusterCutsInAbsEt",m_clusterCutsInAbsE);
168 
169  // Cluster E_t or Abs E_t cut
170  declareProperty("ClusterEtorAbsEtCut",m_clusterEtorAbsEtCut);
171 
172  // use 2-gaussian noise for Tile
173  declareProperty("TwoGaussianNoise",m_twogaussiannoise);
174 
175  // Treat bad cells with dead OTX if predicted from L1 as good
176  declareProperty("TreatL1PredictedCellsAsGood",m_treatL1PredictedCellsAsGood);
177 }
178 
179 //#############################################################################
180 
182 {
183  ATH_MSG_INFO( "Initializing " << name() );
184  ATH_MSG_INFO( "Treat L1 Predicted Bad Cells as Good set to" << ((m_treatL1PredictedCellsAsGood) ? "true" : "false") );
185  ATH_MSG_INFO( "Two-Gaussian noise for Tile set to " << ((m_twogaussiannoise) ? "true" : "false") );
187  getClusterSize();
188 
189  ATH_CHECK( detStore()->retrieve (m_calo_id, "CaloCell_ID") );
190 
191  ATH_MSG_INFO( "Threshold choices:"
192  << (m_seedCutsInAbsE?" SeedThresholdOnAbsEinSigma=":
193  " SeedThresholdOnEinSigma=")
195  << (m_neighborCutsInAbsE?", NeighborThresholdOnAbsEinSigma=":
196  ", NeighborThresholdOnEinSigma=")
198  << (m_cellCutsInAbsE?", CellThresholdOnAbsEinSigma=":
199  ", CellThresholdOnEinSigma=")
201  );
202 
203  ATH_MSG_INFO( "Time cut option: " << ((!m_seedCutsInT) ? "None" : (m_cutOOTseed ? "Seed Extended" : "Seed")));
204  ATH_MSG_INFO( "E/sigma veto on T cut: m_useTimeCutUpperLimit=" << (m_useTimeCutUpperLimit ? "true" : "false") << ", m_timeCutUpperLimit=" << m_timeCutUpperLimit);
205 
206  //--- set Neighbor Option
207 
208  if ( m_neighborOption == "all2D" )
210  else if ( m_neighborOption == "all3D" )
212  else if ( m_neighborOption == "super3D" )
214  else {
215  ATH_MSG_ERROR( "Invalid Neighbor Option "
216  << m_neighborOption << ", exiting ..." );
217  return StatusCode::FAILURE;
218  }
219 
220  ATH_MSG_INFO( "Neighbor Option "
221  << m_neighborOption << " is selected!" );
222 
223  //--- check calorimeter names to use
224  for (const std::string& caloName : m_caloNames) {
225  if ( caloName == "LAREM" )
227  else if ( caloName == "LARHEC" )
229  else if ( caloName == "LARFCAL" )
231  else if ( caloName == "TILE" )
233  else
234  ATH_MSG_ERROR( "Calorimeter " << caloName
235  << " is not a valid Calorimeter name and will be ignored! "
236  << "Valid names are: LAREM, LARHEC, LARFCAL, and TILE." );
237  }
238 
239  //--- check sampling names to use for seeds
240  for (const std::string& sampName : m_samplingNames) {
241  if ( sampName == "PreSamplerB" )
243  else if ( sampName == "EMB1" )
245  else if ( sampName == "EMB2" )
247  else if ( sampName == "EMB3" )
249  else if ( sampName == "PreSamplerE" )
251  else if ( sampName == "EME1" )
253  else if ( sampName == "EME2" )
255  else if ( sampName == "EME3" )
257  else if ( sampName == "HEC0" )
259  else if ( sampName == "HEC1" )
261  else if ( sampName == "HEC2" )
263  else if ( sampName == "HEC3" )
265  else if ( sampName == "TileBar0" )
267  else if ( sampName == "TileBar1" )
269  else if ( sampName == "TileBar2" )
271  else if ( sampName == "TileGap1" )
273  else if ( sampName == "TileGap2" )
275  else if ( sampName == "TileGap3" )
277  else if ( sampName == "TileExt0" )
279  else if ( sampName == "TileExt1" )
281  else if ( sampName == "TileExt2" )
283  else if ( sampName == "FCAL0" )
285  else if ( sampName == "FCAL1" )
287  else if ( sampName == "FCAL2" )
289  else
290  ATH_MSG_ERROR( "Calorimeter sampling" << sampName
291  << " is not a valid Calorimeter sampling name and will be ignored! "
292  << "Valid names are: "
293  << "PreSamplerB, EMB1, EMB2, EMB3, "
294  << "PreSamplerE, EME1, EME2, EME3, "
295  << "HEC0, HEC1, HEC2, HEC3, "
296  << "TileBar0, TileBar1, TileBar2, "
297  << "TileGap1, TileGap2, TileGap3, "
298  << "TileExt0, TileExt1, TileExt2, "
299  << "FCAL0, FCAL1, FCAL2." );
300  }
301 
302  msg(MSG::INFO) << "Samplings to consider for seeds:";
303  for (const std::string& sampName : m_samplingNames)
304  msg() << " " << sampName;
305  msg() << endmsg;
306 
307  m_minSampling=0;
308  m_maxSampling=0;
309  for (int s : m_validSamplings) {
310  if ( s > m_maxSampling )
311  m_maxSampling = s;
312  if ( s < m_minSampling )
313  m_minSampling = s;
314  }
315 
316  m_useSampling.resize(m_maxSampling-m_minSampling+1,false);
317 
318  for (int s : m_validSamplings) {
319  m_useSampling[s-m_minSampling] = true;
320  }
321 
322  ATH_MSG_INFO( "CellCollection to use: " << m_cellsKey.key() );
323 
324  msg(MSG::INFO) << "Calorimeters to consider:";
325  for (const std::string& caloName : m_caloNames)
326  msg() << " " << caloName;
327  msg() << endmsg;
328 
329  //---- retrieve the noise CDO ----------------
330 
332 
333  ATH_MSG_INFO( (m_clusterCutsInAbsE?"ClusterAbsEtCut= ":"ClusterEtCut= ")
334  << m_clusterEtorAbsEtCut << " MeV" );
335 
336  m_hashMin = 999999;
337  m_hashMax = 0;
338  for (int subdet = 0; subdet < CaloCell_ID::NSUBCALO; ++subdet) {
339  if (m_subcaloUsed[subdet]) {
340  IdentifierHash thismin, thismax;
342  thismin, thismax);
343  m_hashMin = std::min (m_hashMin, thismin);
344  m_hashMax = std::max (m_hashMax, thismax);
345  }
346  }
347 
348  //ATH_CHECK( m_cablingKey.initialize() );
349 
350  // silence possible warnings from AuxSelection (ATLASRECTS-7180)
351  xAOD::CaloCluster dummyCluster;
352  static const SG::ConstAccessor<ElementLink<CaloClusterCellLinkContainer> > accCellLinks("CellLink");
353  (void) accCellLinks.isAvailable(dummyCluster);
354 
355  return StatusCode::SUCCESS;
356 
357 }
358 
359 //#############################################################################
360 
362 CaloTopoClusterMaker::execute(const EventContext& ctx,
363  xAOD::CaloClusterContainer* clusColl) const
364 {
365  // minimal significance - should be > 0 in order to avoid
366  // throwing away of bad cells
367  const float epsilon = 0.00001;
368 
369  //ATH_MSG_DEBUG( "Executing " << name());
370 
372  using HashCluster = CaloTopoTmpHashCluster;
373 
377 
378  // create cell list for cells above seed cut (for seed growing algo)
379  std::vector<HashCell> mySeedCells;
380  mySeedCells.reserve (2000);
381  // create initial cluster list (one cell per cluster)
382  std::vector<HashCluster *> myHashClusters;
383  myHashClusters.reserve (10000);
384 
385  // create vector to hold all cells.
386  std::vector<HashCell> cellVector (m_hashMax - m_hashMin);
387  HashCell* hashCells = cellVector.data() - m_hashMin;
388 
389 
391  const CaloNoise* noiseCDO=*noiseHdl;
392 
393  //---- Get the CellContainers ----------------
394 
395  // for (const std::string& cellsName : m_cellsNames) {
397  if( !cellColl.isValid()){
398  ATH_MSG_ERROR( " Can not retrieve CaloCellContainer: "
399  << cellColl.name() );
400  return StatusCode::RECOVERABLE;
401  }
402 
403  const DataLink<CaloCellContainer> cellCollLink (cellColl.name(),ctx);
404 
405  //ATH_MSG_DEBUG("CaloCell container: "<< cellsName
406  // <<" contains " << cellColl->size() << " cells");
407 
408  for (int isubdet = 0; isubdet < CaloCell_ID::NSUBCALO; ++isubdet) {
409  CaloCell_ID::SUBCALO subdet = (CaloCell_ID::SUBCALO)isubdet;
410  if (m_subcaloUsed[subdet] && cellColl->hasCalo(subdet)) {
411  auto cellIter = cellColl->beginConstCalo (subdet);
412  auto cellIterEnd = cellColl->endConstCalo (subdet);
413  for (int iCell = cellColl->indexFirstCellCalo(subdet);
414  cellIter != cellIterEnd;
415  ++iCell, ++cellIter)
416  {
417  CaloPrefetch::nextDDE(cellIter, cellIterEnd, 2);
418  const CaloCell* pCell = *cellIter;
419  const float noiseSigma = m_twogaussiannoise ? \
420  noiseCDO->getEffectiveSigma(pCell->ID(),pCell->gain(),pCell->energy()) : \
421  noiseCDO->getNoise(pCell->ID(),pCell->gain());
422 
423  float signedE = pCell->energy();
424  float signedEt = pCell->et();
425  float signedRatio = epsilon; // not 0 in order to keep bad cells
426  if ( finite(noiseSigma) && noiseSigma > 0 && !CaloBadCellHelper::isBad(pCell,m_treatL1PredictedCellsAsGood) )
427  signedRatio = signedE/noiseSigma;
428 
429  bool passedCellCut = (m_cellCutsInAbsE?std::abs(signedRatio):signedRatio) > m_cellThresholdOnEorAbsEinSigma;
430  bool passedNeighborCut = (m_neighborCutsInAbsE?std::abs(signedRatio):signedRatio) > m_neighborThresholdOnEorAbsEinSigma;
431  bool passedSeedCut = (m_seedCutsInAbsE?std::abs(signedRatio):signedRatio) > m_seedThresholdOnEorAbsEinSigma;
432 
433  bool applyTimeCut = m_seedCutsInT && (!m_useTimeCutUpperLimit || signedRatio <= m_timeCutUpperLimit);
434  bool passTimeCut_seedCell = (!applyTimeCut || passCellTimeCut(pCell,cellColl.cptr()));
435  bool passedSeedAndTimeCut = (passedSeedCut && passTimeCut_seedCell);
436 
437  bool passedNeighborAndTimeCut = passedNeighborCut;
438  if(m_cutOOTseed && passedSeedCut && !passTimeCut_seedCell) passedNeighborAndTimeCut=false; //exclude Out-Of-Time seeds from neighbouring stage as well (if required)
439 
440  bool passedCellAndTimeCut = passedCellCut;
441  if(m_cutOOTseed && passedSeedCut && !passTimeCut_seedCell) passedCellAndTimeCut=false; //exclude Out-Of-Time seeds from cluster (if required)
442 
443  if ( passedCellAndTimeCut || passedNeighborAndTimeCut || passedSeedAndTimeCut ) {
444  const CaloDetDescrElement* dde = pCell->caloDDE();
445  IdentifierHash hashid = dde ? dde->calo_hash() : m_calo_id->calo_cell_hash(pCell->ID());
446  CaloTopoTmpClusterCell *tmpClusterCell =
447  new (tmpcell_pool.allocate())
448  CaloTopoTmpClusterCell(hashid,subdet,iCell,signedRatio,signedEt);
449 #if 0
450  // some debug printout - can also be used to construct neighbor
451  // tables offline ...
452  if ( m_doALotOfPrintoutInFirstEvent ) {
453  ATH_MSG_DEBUG( " [ExtId|Id|SubDet|HashId|eta|phi|E/noise|Et]: "
454  << "[" << m_calo_id->show_to_string(pCell->ID(),0,'/')
455  << "|" << mypCell->ID().getString()
456  << "|" << subdet
457  << "|" << (unsigned int)hashid
458  << "|" << pCell->eta()
459  << "|" << pCell->phi()
460  << "|" << signedRatio
461  << "|" << signedEt
462  << "]");
463 
464  }
465 #endif
466  HashCell hashCell(tmpClusterCell);
467  if ( passedNeighborAndTimeCut || passedSeedAndTimeCut ) {
468  HashCluster *tmpCluster =
469  new (tmpclus_pool.allocate()) HashCluster (tmplist_pool);
470  tmpClusterCell->setCaloTopoTmpHashCluster(tmpCluster);
471  tmpCluster->add(hashCell);
472  myHashClusters.push_back(tmpCluster);
473  int caloSample = dde ? dde->getSampling() : m_calo_id->calo_sample(pCell->ID());
474  if ( passedSeedAndTimeCut
475  && caloSample >= m_minSampling
476  && caloSample <= m_maxSampling
477  && m_useSampling[caloSample-m_minSampling]) {
478  tmpClusterCell->setUsed();
479  mySeedCells.push_back(hashCell);
480  }
481  }
482  hashCells[hashid] = hashCell;
483  }
484  }//end loop over cells
485  }//end if use subcalo
486  }//end loop over subcalos
487 
488 
489  // sort initial seed cells to start with the cell of largest S/N
490  // this makes the resulting clusters independent of the initial
491  // ordering of the cells
492  if ( m_useGPUCriteria) {
493  if ( m_seedCutsInAbsE) {
495  std::sort(mySeedCells.begin(),mySeedCells.end(),compareSoverN);
496  }
497  else {
499  std::sort(mySeedCells.begin(),mySeedCells.end(),compareSoverN);
500  }
501  }
502  else {
503  if ( m_seedCutsInAbsE) {
505  std::sort(mySeedCells.begin(),mySeedCells.end(),compareSoverN);
506  }
507  else {
509  std::sort(mySeedCells.begin(),mySeedCells.end(),compareSoverN);
510  }
511  }
512 
513 #if 1
514  if (msgLvl(MSG::DEBUG)) {
515  for (const HashCell& hc : mySeedCells) {
516  ATH_MSG_DEBUG( " SeedCell ["
517  << hc.getCaloTopoTmpClusterCell()->getSubDet()
518  << "|"
519  << (unsigned int)hc.getCaloTopoTmpClusterCell()->getID()
520  << "] has S/N = "
521  << hc.getCaloTopoTmpClusterCell()->getSignedRatio()
522  );
523  }
524  }
525 #endif
526 
527  std::vector<HashCell> myNextCells;
528  myNextCells.reserve (1000);
529 
530  std::vector<IdentifierHash> theNeighbors;
531  theNeighbors.reserve(22);
532 #if 0
533  std::vector<IdentifierHash> theNNeighbors;
534  theNNeighbors.reserve(22);
535 #endif
536 
537  bool doRestrictHECIWandFCal = m_restrictHECIWandFCalNeighbors &&
539 
540  bool doRestrictPS = m_restrictPSNeighbors &&
542 
543  while ( !mySeedCells.empty() ) {
544  // create cell list for next neighbor cells to consider
545  myNextCells.clear();
546 
547  // loop over all current neighbor cells (for Seed Growing Algo)
548  for (HashCell& hc : mySeedCells) {
549  CaloTopoTmpClusterCell* pCell= hc.getCaloTopoTmpClusterCell();
550  IdentifierHash hashid = pCell->getID();
551  HashCluster *myCluster = pCell->getCaloTopoTmpHashCluster();
552  CaloCell_ID::SUBCALO mySubDet = pCell->getSubDet();
553  // in case we use all3d or super3D and the current cell is in the
554  // HEC IW or FCal2 & 3 or PS and we want to restrict their neighbors,
555  // use only next in sampling neighbors
557  if (( mySubDet != CaloCell_ID::LAREM &&
558  doRestrictHECIWandFCal &&
559  ( ( mySubDet == CaloCell_ID::LARHEC &&
560  m_calo_id->region(m_calo_id->cell_id(hashid)) == 1 ) ||
561  ( mySubDet == CaloCell_ID::LARFCAL &&
562  m_calo_id->sampling(m_calo_id->cell_id(hashid)) > 1 ) ) ) ||
563  ( doRestrictPS &&
564  ( ( mySubDet == CaloCell_ID::LAREM &&
565  m_calo_id->sampling(m_calo_id->cell_id(hashid)) == 0 ) ) ) ) {
567  }
568  m_calo_id->get_neighbours(hashid,opt,theNeighbors);
569  // loop over all neighbors of that cell (Seed Growing Algo)
570  for (IdentifierHash nId : theNeighbors) {
571  CaloCell_ID::SUBCALO otherSubDet =
573  if ( m_subcaloUsed[otherSubDet] ) {
574  HashCell neighborCell = hashCells[nId];
575  if ( neighborCell.getCaloTopoTmpClusterCell() ) {
576  CaloTopoTmpClusterCell* pNCell =
577  neighborCell.getCaloTopoTmpClusterCell();
578  // check neighbor threshold only since seed cells are already in
579  // the original list
580  bool isAboveNeighborThreshold =
582  // checking the neighbors
583  if ( isAboveNeighborThreshold && !pNCell->getUsed() ) {
584  pNCell->setUsed();
585  myNextCells.push_back(neighborCell);
586  }
587  HashCluster *otherCluster = pNCell->getCaloTopoTmpHashCluster();
588  if ( myCluster != otherCluster ) {
589  HashCluster *toKill = nullptr;
590  HashCluster *toKeep = nullptr;
591  if ( !otherCluster || isAboveNeighborThreshold ) {
592 
593  auto compareClusters = [&](const auto & c1, const auto & c2) {
594  if (m_useGPUCriteria) {
595  //The seed cell with the largest SNR wins
596  if (m_seedCutsInAbsE) {
598  return compare(*(c1->begin()), *(c2->begin()));
599  }
600  else {
602  return compare(*(c1->begin()), *(c2->begin()));
603  }
604  }
605  else {
606  //We merge the smallest cluster to the largest...
607  return c1->size() > c2->size();
608  }
609  };
610 
611  if ( !otherCluster || compareClusters(myCluster, otherCluster) ) {
612  toKill = otherCluster;
613  toKeep = myCluster;
614  }
615  else {
616  toKill = myCluster;
617  toKeep = otherCluster;
618  }
619  if ( toKill ) {
620  for (auto *hc : *toKill)
621  hc->setCaloTopoTmpHashCluster(toKeep);
622  toKeep->add(*toKill);
623  toKill->removeAll();
624  }
625  else {
626  toKeep->add(neighborCell);
627  pNCell->setCaloTopoTmpHashCluster(toKeep);
628  }
629  myCluster = toKeep;
630  }
631  }
632  }
633  }
634  }
635  }
636  mySeedCells.swap (myNextCells);
637  }
638 
639 
640  //Create temporary list of proto-clusters
641  //Clusters below Et cut will be dropped.
642  //The remaining clusters will be sorted in E_t before storing
643  std::vector<std::unique_ptr<CaloProtoCluster> > sortClusters;
644  sortClusters.reserve (myHashClusters.size());
645 
646  for (HashCluster* tmpCluster : myHashClusters) {
647  bool addCluster(false);
648  if ( tmpCluster->size() > 1 )
649  addCluster = true;
650  else if ( tmpCluster->size() == 1 ) {
651  // need to check if seed cell was good
652  HashCluster::iterator clusCellIter=tmpCluster->begin();
653  if ( clusCellIter->getUsed() )
654  addCluster = true;
655  }
656  if ( addCluster) {
657  std::unique_ptr<CaloProtoCluster> myCluster = std::make_unique<CaloProtoCluster>(cellCollLink);
658  //CaloProtoCluster* myCluster = new CaloProtoCluster(cellCollLink);
659  myCluster->getCellLinks()->reserve(tmpCluster->size());
660 
661  for (CaloTopoTmpClusterCell* cell : *tmpCluster) {
662  const size_t iCell = cell->getCaloCell();
663  myCluster->addCell(iCell,1.);
664  }
665  const float cl_et = myCluster->et();
666  if ( (m_clusterCutsInAbsE ? std::abs(cl_et) : cl_et) > m_clusterEtorAbsEtCut ) {
667  sortClusters.push_back(std::move(myCluster));
668  }
669  }
670  }
671 
672  // Sort the clusters according to Et
673  std::sort(sortClusters.begin(),sortClusters.end(),[](const std::unique_ptr<CaloProtoCluster>& pc1,
674  const std::unique_ptr<CaloProtoCluster>& pc2) {
675  //As in CaloUtils/CaloClusterEtSort.
676  //assign to volatile to avoid excess precison on in FP unit on x386 machines
677  volatile double et1(pc1->et());
678  volatile double et2(pc2->et());
679  //return (et1 < et2); //This is the order we had from CaloRec-02-13-11 to CaloRec-03-00-31
680  return (et1 > et2); //This is the order we should have
681  }
682  );
683  // add to cluster container
684  clusColl->reserve(sortClusters.size());
685 
686  for (const auto& protoCluster: sortClusters) {
687  xAOD::CaloCluster* xAODCluster=new xAOD::CaloCluster();
688  clusColl->push_back(xAODCluster);
689  xAODCluster->addCellLink(protoCluster->releaseCellLinks());//Hand over ownership to xAOD::CaloCluster
690  xAODCluster->setClusterSize(m_clusterSize);
691  CaloClusterKineHelper::calculateKine(xAODCluster,false,true, m_useGPUCriteria); //No weight at this point!
692  }
693 
694  tmpclus_pool.erase();
695  tmpcell_pool.erase();
696 
697  return StatusCode::SUCCESS;
698 }
699 
702 
706 
708 
709  }else if(m_seedThresholdOnEorAbsEinSigma==4.
712 
714  }
715  ATH_MSG_DEBUG( "Cluster size = " << m_clusterSize);
716 }
717 
718 
719 inline bool CaloTopoClusterMaker::passCellTimeCut(const CaloCell* pCell, const CaloCellContainer* cellColl) const {
720  // get the cell time to cut on (the same as in CaloEvent/CaloCluster.h)
721  bool isInTime = true;
722  // need sampling number already for time
723  CaloSampling::CaloSample sam = pCell->caloDDE()->getSampling();
724  // check for unknown sampling
726  const unsigned pmask= pCell->caloDDE()->is_tile() ? 0x8080 : 0x2000;
727  //0x2000 is used to tell that time and quality information are available for this channel
728  //(from TWiki: https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/CaloEventDataModel#The_Raw_Data_Model)
729  // Is time defined?
730  if(pCell->provenance() & pmask) {
731  isInTime = (std::abs(pCell->time())<m_seedThresholdOnTAbs);
732  if ( m_xtalkEM2 && (!isInTime) && (pCell->energy() > 0 && (sam == CaloSampling::EMB2 || (sam == CaloSampling::EME2 && std::abs(pCell->eta()) < 2.5)))) {
733  // relax time constraints in EMB2 and EME2_OW due to xTalk from direct phi neighbours
734  // check if |E| is less than 0.25 times one of the |E| values of direct
735  // phi-neighbours. In case that phi-neigbour is in-time, expand upper limit by m_xtalkDeltaT
736  IdentifierHash hashid = pCell->caloDDE()->calo_hash();
737  std::vector<IdentifierHash> theNeighbors;
738  LArNeighbours::neighbourOption opt = (LArNeighbours::neighbourOption)(((int)LArNeighbours::prevInPhi)|((int)LArNeighbours::nextInPhi)); // shoud make a proper enum in LarNeighbours.h for this one ...
739  m_calo_id->get_neighbours(hashid,opt,theNeighbors);
740  // loop over all neighbors of that cell (Seed Growing Algo)
741  for (IdentifierHash nId : theNeighbors) {
742  const CaloCell * pNCell = cellColl->findCell(nId);
743  if ( pNCell ) {
744  if ( pNCell->energy() > m_xtalk2Eratio1*pCell->energy() ) {
745  if ( (!(pNCell->provenance() & pmask)) || std::abs(pNCell->time()) < m_seedThresholdOnTAbs) {
746  isInTime = ((pCell->time() > -m_seedThresholdOnTAbs) && (pCell->time() < m_seedThresholdOnTAbs + m_xtalkDeltaT));
747  if ( isInTime ) {
748  // exit after first phi neighbour in case that already made
749  // the time-cut pass
750  break;
751  }
752  }
753  }
754 
755  // check second neighbor
756  if (m_xtalkEM2n) {
757  std::vector<IdentifierHash> theNextNeighbors;
758  m_calo_id->get_neighbours(nId,opt,theNextNeighbors);
759  for (IdentifierHash n2Id : theNextNeighbors) {
760  if (n2Id != hashid) {
761  const CaloCell * p2NCell = cellColl->findCell(n2Id);
762  if (p2NCell) {
763  if (p2NCell->energy() > m_xtalk2Eratio2*pCell->energy()) {
764  if ( (!(p2NCell->provenance() & pmask)) || std::abs(p2NCell->time()) < m_seedThresholdOnTAbs) {
765  isInTime = ((pCell->time() > -m_seedThresholdOnTAbs) && (pCell->time() < m_seedThresholdOnTAbs + m_xtalkDeltaT));
766  if (isInTime) break;
767  }
768  }
769  }
770  }
771  } // loop over 2nd neighbors
772  }
773  } // if (pNcell)
774  } // loop over first neighbors
775  } // special case for layer 2
776 
777  // check cross talk in eta
778  if ( m_xtalkEMEta && (!isInTime) && (pCell->energy() > 0 && (sam == CaloSampling::EMB2 || (sam == CaloSampling::EME2 && std::abs(pCell->eta()) < 2.5)))) {
779  IdentifierHash hashid = pCell->caloDDE()->calo_hash();
780  std::vector<IdentifierHash> theNeighbors;
782  m_calo_id->get_neighbours(hashid,opt,theNeighbors);
783  for (IdentifierHash nId : theNeighbors) {
784  const CaloCell * pNCell = cellColl->findCell(nId);
785  if ( pNCell ) {
786  if ( pNCell->energy() > m_xtalkEtaEratio*pCell->energy() ) {
787  if ( (!(pNCell->provenance() & pmask)) || std::abs(pNCell->time()) < m_seedThresholdOnTAbs) {
788  isInTime = ((pCell->time() > -m_seedThresholdOnTAbs) && (pCell->time() < m_seedThresholdOnTAbs + m_xtalkDeltaT));
789  if ( isInTime ) {
790  // exit after first phi neighbour in case that already made
791  // the time-cut pass
792  break;
793  }
794  }
795  }
796  }
797  }
798  }
799 
800  // option for all2D
801  if ( m_xtalkEM2D && (!isInTime) && (pCell->energy() > 0 && (sam == CaloSampling::EMB2 || (sam == CaloSampling::EME2 && std::abs(pCell->eta()) < 2.5)))) {
802  IdentifierHash hashid = pCell->caloDDE()->calo_hash();
803  std::vector<IdentifierHash> theNeighbors;
805  m_calo_id->get_neighbours(hashid,opt,theNeighbors);
806  for (IdentifierHash nId : theNeighbors) {
807  const CaloCell * pNCell = cellColl->findCell(nId);
808  if ( pNCell ) {
809  if ( pNCell->energy() > m_xtalk2DEratio*pCell->energy() ) {
810  if ( (!(pNCell->provenance() & pmask)) || std::abs(pNCell->time()) < m_seedThresholdOnTAbs) {
811  isInTime = ((pCell->time() > -m_seedThresholdOnTAbs) && (pCell->time() < m_seedThresholdOnTAbs + m_xtalkDeltaT));
812  if ( isInTime ) break;
813  }
814  }
815  }
816  }
817  }
818 
819  // relax also time constraint for EMB3 and EME2_OW
820  if ( m_xtalkEM3 && (!isInTime) && (pCell->energy() > 0 && (sam == CaloSampling::EMB3 || (sam == CaloSampling::EME3 && std::abs(pCell->eta()) < 2.5)))) {
821  // check previous sampling cell, should be >10 times more (TBC)
822  IdentifierHash hashid = pCell->caloDDE()->calo_hash();
823  std::vector<IdentifierHash> theNeighbors;
825  m_calo_id->get_neighbours(hashid,opt,theNeighbors);
826  for (IdentifierHash nId : theNeighbors) {
827  const CaloCell * pNCell = cellColl->findCell(nId);
828  if ( pNCell ) {
829  if ( pNCell->energy() > m_xtalk3Eratio*pCell->energy() ) {
830  if ( (!(pNCell->provenance() & pmask)) || std::abs(pNCell->time()) < m_seedThresholdOnTAbs) {
831  isInTime = ((pCell->time() > -m_seedThresholdOnTAbs) && (pCell->time() < m_seedThresholdOnTAbs + m_xtalkDeltaT));
832  if (isInTime) break;
833  }
834  } // Eratio cut at 10
835  }
836  } // loop over neighors
837  } // cell is layer 3 EM
838 
839  }
840  }
841  return isInTime;
842 }
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
CaloPrefetch::ArenaHandlePrefetch
Wrapper for SG::ArenaHandle with pre-fetching.
Definition: CaloPrefetch.h:102
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
CaloTopoClusterMaker::m_xtalkEMEta
bool m_xtalkEMEta
if set to true, the time window is softened in the EMB2 and EME2_OW due to xtalk from direct neighbou...
Definition: CaloTopoClusterMaker.h:310
CaloClusterKineHelper.h
LArNeighbours::neighbourOption
neighbourOption
Definition: LArNeighbours.h:12
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
CaloTopoClusterMaker::m_xtalkEM2D
bool m_xtalkEM2D
if set to true, the time window is softened in the EMB2 and EME2_OW due to xtalk from all 2D neighors
Definition: CaloTopoClusterMaker.h:294
xAOD::CaloCluster_v1::CSize_Unknown
@ CSize_Unknown
Definition: CaloCluster_v1.h:112
CaloTopoClusterMaker::getClusterSize
void getClusterSize()
Definition: CaloTopoClusterMaker.cxx:700
CaloCell_Base_ID::LARFCAL
@ LARFCAL
Definition: CaloCell_Base_ID.h:46
CaloTopoClusterMaker::m_noiseCDOKey
SG::ReadCondHandleKey< CaloNoise > m_noiseCDOKey
Key of the CaloNoise Conditions data object.
Definition: CaloTopoClusterMaker.h:167
Amg::compare
std::pair< int, int > compare(const AmgSymMatrix(N) &m1, const AmgSymMatrix(N) &m2, double precision=1e-9, bool relative=false)
compare two matrices, returns the indices of the first element that fails the condition,...
Definition: EventPrimitivesHelpers.h:109
CaloPrefetch.h
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
CaloCell_ID_FCS::TileExt2
@ TileExt2
Definition: FastCaloSim_CaloCell_ID.h:39
ArenaHandle.h
User interface for allocating memory. See Arena.h for an overview of the arena-based memory allocator...
CaloCell::phi
virtual double phi() const override final
get phi (through CaloDetDescrElement)
Definition: CaloCell.h:359
CaloTopoClusterMaker::m_xtalkDeltaT
float m_xtalkDeltaT
additional max.
Definition: CaloTopoClusterMaker.h:141
CaloCell_Base_ID::calo_cell_hash
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
CaloCell_Base_ID::region
int region(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
CaloTopoTmpHashCell.h
CaloTopoTmpHashCluster
Definition: CaloTopoTmpHashCluster.h:29
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
CaloTopoClusterMaker::m_samplingNames
std::vector< std::string > m_samplingNames
vector of names of the calorimeter samplings to consider for seeds.
Definition: CaloTopoClusterMaker.h:323
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloTopoTmpHashCellSort::compareAbsWithIndex
Definition: CaloTopoTmpHashCellSort.h:76
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
CaloTopoClusterMaker::m_seedCutsInAbsE
bool m_seedCutsInAbsE
if set to true seed cuts are on and .
Definition: CaloTopoClusterMaker.h:227
CaloTopoClusterMaker::m_validSamplings
std::set< int > m_validSamplings
actual set of samplings to be used for seeds
Definition: CaloTopoClusterMaker.h:330
make_coralServer_rep.opt
opt
Definition: make_coralServer_rep.py:19
CaloTopoClusterMaker::m_restrictPSNeighbors
bool m_restrictPSNeighbors
if set to true limit the neighbors in presampler Barrel and Endcap.
Definition: CaloTopoClusterMaker.h:217
CaloTopoTmpHashCell
Definition: CaloTopoTmpHashCell.h:22
CaloTopoClusterMaker::m_seedCutsInT
bool m_seedCutsInT
if set to true, time cut is applied to seed cells, no cut otherwise
Definition: CaloTopoClusterMaker.h:274
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
SG::VarHandleBase::name
const std::string & name() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:75
CaloTopoClusterMaker::execute
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloClusterContainer *theClusters) const override
Execute on an entire collection of clusters.
Definition: CaloTopoClusterMaker.cxx:362
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
CaloCell_ID_FCS::TileExt0
@ TileExt0
Definition: FastCaloSim_CaloCell_ID.h:37
CaloCell_ID_FCS::TileBar1
@ TileBar1
Definition: FastCaloSim_CaloCell_ID.h:32
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
extractSporadic.c1
c1
Definition: extractSporadic.py:134
CaloTopoClusterMaker::m_caloNames
std::vector< std::string > m_caloNames
vector of names of the calorimeters to consider.
Definition: CaloTopoClusterMaker.h:81
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
CaloTopoTmpClusterCell
Definition: CaloTopoTmpClusterCell.h:27
CaloTopoTmpHashCellSort::compareAbs
Definition: CaloTopoTmpHashCellSort.h:42
CaloTopoClusterMaker::m_calo_id
const CaloCell_ID * m_calo_id
Definition: CaloTopoClusterMaker.h:65
CaloTopoTmpClusterCell::setCaloTopoTmpHashCluster
void setCaloTopoTmpHashCluster(CaloTopoTmpHashCluster *cluster)
Definition: CaloTopoTmpClusterCell.h:64
CaloCellContainer::beginConstCalo
CaloCellContainer::const_iterator beginConstCalo(CaloCell_ID::SUBCALO caloNum) const
get const iterators on cell of just one calo
Definition: CaloCellContainer.cxx:119
CaloTopoClusterMaker::m_minSampling
int m_minSampling
smallest valid seed sampling found
Definition: CaloTopoClusterMaker.h:338
CaloCell_ID_FCS::FCAL1
@ FCAL1
Definition: FastCaloSim_CaloCell_ID.h:41
CaloCell.h
CaloTopoClusterMaker::m_seedThresholdOnTAbs
float m_seedThresholdOnTAbs
threshold used for timing cut on seed cells.
Definition: CaloTopoClusterMaker.h:132
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
CaloBadCellHelper.h
CaloTopoClusterMaker::m_xtalk2Eratio1
float m_xtalk2Eratio1
cut on Eneighbor/E to revover out of time cell close to energetic first phi neighbor cell
Definition: CaloTopoClusterMaker.h:145
CaloTopoClusterMaker::CaloTopoClusterMaker
CaloTopoClusterMaker(const std::string &type, const std::string &name, const IInterface *parent)
Definition: CaloTopoClusterMaker.cxx:51
CaloCell_Base_ID::LARHEC
@ LARHEC
Definition: CaloCell_Base_ID.h:46
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
CaloTopoClusterMaker::m_clusterCutsInAbsE
bool m_clusterCutsInAbsE
if set to true final cluster cuts are on .
Definition: CaloTopoClusterMaker.h:251
CaloCell_ID_FCS::HEC2
@ HEC2
Definition: FastCaloSim_CaloCell_ID.h:29
CaloCell_Base_ID::calo_sample
int calo_sample(const Identifier id) const
returns an int taken from Sampling enum and describing the subCalo to which the Id belongs.
Definition: CaloCell_Base_ID.cxx:141
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
CaloCell::provenance
uint16_t provenance() const
get provenance (data member)
Definition: CaloCell.h:338
CaloCell::time
float time() const
get time (data member)
Definition: CaloCell.h:352
CaloTopoClusterMaker::m_xtalkEM2n
bool m_xtalkEM2n
if set to true (together with m_xtalkEM2) we also extend the time window for 2nd phi neighbors
Definition: CaloTopoClusterMaker.h:299
LArNeighbours::prevInPhi
@ prevInPhi
Definition: LArNeighbours.h:12
CaloCell_ID_FCS::TileGap3
@ TileGap3
Definition: FastCaloSim_CaloCell_ID.h:36
CaloTopoClusterMaker::m_neighborOption
std::string m_neighborOption
type of neighbor relations to use.
Definition: CaloTopoClusterMaker.h:196
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition: Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
CaloCell::energy
double energy() const
get energy (data member)
Definition: CaloCell.h:311
CaloProtoCluster::getCellLinks
CaloClusterCellLink * getCellLinks()
Get a pointer to the underlying CaloClusterCellLink object.
Definition: CaloProtoCluster.h:58
CaloTopoClusterMaker::m_subcaloUsed
bool m_subcaloUsed[CaloCell_ID::NSUBCALO]
Flag which subdetectors are to be used.
Definition: CaloTopoClusterMaker.h:88
LArNeighbours::nextInSamp
@ nextInSamp
Definition: LArNeighbours.h:20
xAOD::CaloCluster_v1::Topo_633
@ Topo_633
Definition: CaloCluster_v1.h:103
LArNeighbours::nextInPhi
@ nextInPhi
Definition: LArNeighbours.h:13
CaloCell_ID::SUBCALO
CaloCell_Base_ID::SUBCALO SUBCALO
Definition: CaloCell_ID.h:50
CaloCellContainer::indexFirstCellCalo
int indexFirstCellCalo(const CaloCell_ID::SUBCALO caloNum) const
index of first cell of given calorimeter (-1 if none).
Definition: CaloCellContainer.cxx:137
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
CaloTopoClusterMaker::m_nOption
LArNeighbours::neighbourOption m_nOption
Definition: CaloTopoClusterMaker.h:197
CaloDetDescrElement::calo_hash
IdentifierHash calo_hash() const
cell calo hash
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:412
CaloCell_ID_FCS::HEC1
@ HEC1
Definition: FastCaloSim_CaloCell_ID.h:28
CaloTopoClusterMaker::m_useGPUCriteria
Gaudi::Property< bool > m_useGPUCriteria
Definition: CaloTopoClusterMaker.h:362
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CaloTopoClusterMaker::m_neighborCutsInAbsE
bool m_neighborCutsInAbsE
if set to true neighbor cuts are on and .
Definition: CaloTopoClusterMaker.h:235
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloCell_Base_ID::calo_cell_hash_range
void calo_cell_hash_range(const Identifier id, IdentifierHash &caloCellMin, IdentifierHash &caloCellMax) const
to loop on 'global' cell hashes of one sub-calorimeter alone
CaloTopoClusterMaker::initialize
virtual StatusCode initialize() override
Definition: CaloTopoClusterMaker.cxx:181
CaloCell_ID_FCS::TileBar0
@ TileBar0
Definition: FastCaloSim_CaloCell_ID.h:31
CaloTopoTmpClusterCellBase::getSubDet
CaloCell_ID::SUBCALO getSubDet() const
Definition: CaloTopoTmpClusterCellBase.h:72
CaloCell_Base_ID::sampling
int sampling(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CaloProtoCluster.h
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
CaloCell_ID_FCS::TileGap2
@ TileGap2
Definition: FastCaloSim_CaloCell_ID.h:35
CaloCell::caloDDE
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition: CaloCell.h:305
CaloProtoCluster::addCell
void addCell(const unsigned cellIdx, const CaloClusterCellLink::weight_t weight=1.0)
Add a cell (forward to underlying CaloClusterCellLink)
Definition: CaloProtoCluster.h:46
CaloCell_Base_ID::SUBCALO
SUBCALO
enumeration of sub calorimeters
Definition: CaloCell_Base_ID.h:46
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloCell::et
virtual double et() const override final
get et
Definition: CaloCell.h:407
CaloTopoClusterMaker::m_xtalkEM2
bool m_xtalkEM2
if set to true, the time window is softened in the EMB2 and EME2_OW due to xtalk from direct neighbou...
Definition: CaloTopoClusterMaker.h:289
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
CaloCell_Base_ID::sub_calo
int sub_calo(const Identifier id) const
returns an int taken from SUBCALO enum and describing the subCalo to which the Id belongs.
CaloTopoClusterMaker::m_cellThresholdOnEorAbsEinSigma
float m_cellThresholdOnEorAbsEinSigma
all cells have to satisfy
Definition: CaloTopoClusterMaker.h:106
CaloTopoClusterMaker::m_neighborThresholdOnEorAbsEinSigma
float m_neighborThresholdOnEorAbsEinSigma
cells with extend the cluster
Definition: CaloTopoClusterMaker.h:117
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloCell_Base_ID::TILE
@ TILE
Definition: CaloCell_Base_ID.h:46
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
xAOD::CaloCluster_v1::Topo_420
@ Topo_420
Definition: CaloCluster_v1.h:102
CaloTopoTmpHashCellSort.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
CaloCell_ID_FCS::TileGap1
@ TileGap1
Definition: FastCaloSim_CaloCell_ID.h:34
LArNeighbours::prevInSamp
@ prevInSamp
Definition: LArNeighbours.h:19
CaloTopoTmpClusterCellBase::getID
const IdentifierHash & getID() const
Definition: CaloTopoTmpClusterCellBase.h:61
CxxUtils::pointer_list::allocator
Allocator for pointer_list, specialized for NELT.
Definition: pointer_list.h:256
LArNeighbours::super3D
@ super3D
Definition: LArNeighbours.h:29
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
CaloTopoClusterMaker::m_restrictHECIWandFCalNeighbors
bool m_restrictHECIWandFCalNeighbors
if set to true limit the neighbors in HEC IW and FCal2&3.
Definition: CaloTopoClusterMaker.h:208
CaloTopoTmpClusterCell.h
CaloPrefetch::ArenaHandlePrefetch::allocate
void * allocate()
Return space for new element, then allocate and prefetch one more.
Definition: CaloPrefetch.h:124
CaloTopoClusterMaker::m_cellCutsInAbsE
bool m_cellCutsInAbsE
if set to true cell cuts are on and .
Definition: CaloTopoClusterMaker.h:243
CaloTopoClusterMaker.h
CaloCellContainer::findCell
const CaloCell * findCell(const IdentifierHash theHash) const
fast find method given identifier hash.
Definition: CaloCellContainer.cxx:345
CaloTopoTmpHashCluster.h
CaloDetDescrElement::is_tile
bool is_tile() const
cell belongs to Tile
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:442
CaloNoise
Definition: CaloNoise.h:16
CaloTopoClusterMaker::m_clusterEtorAbsEtCut
float m_clusterEtorAbsEtCut
cut on the final cluster.
Definition: CaloTopoClusterMaker.h:259
CaloTopoTmpHashCellSort::compareWithIndex
Definition: CaloTopoTmpHashCellSort.h:57
CaloTopoClusterMaker::m_xtalk2DEratio
float m_xtalk2DEratio
cut on Eneighbor/E to remove out of time layer layer2 all 2D neighbors
Definition: CaloTopoClusterMaker.h:161
CaloTopoTmpHashCellSort::compare
Definition: CaloTopoTmpHashCellSort.h:28
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
CaloTopoClusterMaker::m_treatL1PredictedCellsAsGood
bool m_treatL1PredictedCellsAsGood
if set to true treat cells with a dead OTX which can be predicted by L1 trigger info as good instead ...
Definition: CaloTopoClusterMaker.h:269
CaloCell_ID_FCS::TileExt1
@ TileExt1
Definition: FastCaloSim_CaloCell_ID.h:38
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
CaloTopoClusterMaker::m_hashMin
IdentifierHash m_hashMin
Definition: CaloTopoClusterMaker.h:355
CaloTopoClusterMaker::m_xtalk3Eratio
float m_xtalk3Eratio
cut on Eneighbor/E to revover out of time layer 3cell close to energetic previous sampling neighbor
Definition: CaloTopoClusterMaker.h:153
ArenaPoolAllocator.h
Pool-based allocator. See Arena.h for an overview of the arena-based memory allocators.
CaloCell::gain
CaloGain::CaloGain gain() const
get gain (data member )
Definition: CaloCell.h:345
CaloCell_Base_ID::get_neighbours
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
Definition: CaloCell_Base_ID.cxx:190
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
CaloCell::ID
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition: CaloCell.h:279
CaloTopoTmpClusterCellBase::getUsed
bool getUsed() const
Definition: CaloTopoTmpClusterCellBase.h:87
CaloCellContainer.h
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
CaloCell_Base_ID::cell_id
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,...
CaloTopoClusterMaker::m_timeCutUpperLimit
float m_timeCutUpperLimit
upper limit on the energy significance, for applying the cell time cut
Definition: CaloTopoClusterMaker.h:136
CaloTopoTmpClusterCellBase::setUsed
void setUsed()
Definition: CaloTopoTmpClusterCellBase.h:92
CaloCell_ID_FCS::HEC0
@ HEC0
Definition: FastCaloSim_CaloCell_ID.h:27
CaloClusterStoreHelper.h
CaloProtoCluster::et
double et()
Return the weighted Et of the list of cells.
Definition: CaloProtoCluster.h:40
CaloTopoClusterMaker::passCellTimeCut
bool passCellTimeCut(const CaloCell *, const CaloCellContainer *) const
Definition: CaloTopoClusterMaker.cxx:719
CaloTopoClusterMaker::m_seedThresholdOnEorAbsEinSigma
float m_seedThresholdOnEorAbsEinSigma
cells with start a cluster
Definition: CaloTopoClusterMaker.h:127
CaloTopoClusterMaker::m_maxSampling
int m_maxSampling
largest valid seed sampling found
Definition: CaloTopoClusterMaker.h:346
python.DataFormatRates.c2
c2
Definition: DataFormatRates.py:123
xAOD::CaloCluster_v1::addCellLink
void addCellLink(CaloClusterCellLink *CCCL)
Definition: CaloCluster_v1.h:721
CaloTopoClusterMaker::m_twogaussiannoise
bool m_twogaussiannoise
if set to true use 2-gaussian noise description for TileCal
Definition: CaloTopoClusterMaker.h:264
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
xAOD::CaloCluster_v1::setClusterSize
void setClusterSize(const ClusterSize)
Get cluster size.
Definition: CaloCluster_v1.cxx:369
AtlasDetectorID::show_to_string
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
Definition: AtlasDetectorID.cxx:574
CaloDetDescrElement::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
CaloCell_ID_FCS::PreSamplerE
@ PreSamplerE
Definition: FastCaloSim_CaloCell_ID.h:23
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LArNeighbours::nextInEta
@ nextInEta
Definition: LArNeighbours.h:15
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
CaloCellContainer::endConstCalo
CaloCellContainer::const_iterator endConstCalo(CaloCell_ID::SUBCALO caloNum) const
Definition: CaloCellContainer.cxx:133
CaloTopoClusterMaker::m_cellsKey
SG::ReadHandleKey< CaloCellContainer > m_cellsKey
vector of names of the cell containers to use as input.
Definition: CaloTopoClusterMaker.h:70
LArNeighbours
Definition: LArNeighbours.h:11
CaloClusterKineHelper::calculateKine
static void calculateKine(xAOD::CaloCluster *clu, const bool useweight=true, const bool updateLayers=true, const bool useGPUCriteria=false)
Helper class to calculate cluster kinematics based on cells.
Definition: CaloClusterKineHelper.cxx:223
python.SystemOfUnits.ns
int ns
Definition: SystemOfUnits.py:130
CaloCellContainer::hasCalo
bool hasCalo(const CaloCell_ID::SUBCALO caloNum) const
tell wether it has been filled with cells (maybe none) of a given calo
Definition: CaloCellContainer.cxx:209
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
CaloCell_ID_FCS::FCAL2
@ FCAL2
Definition: FastCaloSim_CaloCell_ID.h:42
CaloTopoClusterMaker::m_cutOOTseed
bool m_cutOOTseed
if set to true, seed cells failing the time cut are also excluded from cluster at all
Definition: CaloTopoClusterMaker.h:279
CaloTopoClusterMaker::m_xtalk2Eratio2
float m_xtalk2Eratio2
cut on Eneighbor/E to revover out of time cell close to energetic second phi neighbor cell
Definition: CaloTopoClusterMaker.h:149
LArNeighbours::all3D
@ all3D
Definition: LArNeighbours.h:24
LArNeighbours::prevInEta
@ prevInEta
Definition: LArNeighbours.h:14
CaloCell_Base_ID::NSUBCALO
@ NSUBCALO
Definition: CaloCell_Base_ID.h:46
CaloTopoClusterMaker::m_hashMax
IdentifierHash m_hashMax
Definition: CaloTopoClusterMaker.h:356
AthAlgTool
Definition: AthAlgTool.h:26
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
CaloTopoTmpClusterCellBase::getSignedRatio
const float & getSignedRatio() const
Definition: CaloTopoTmpClusterCellBase.h:77
CaloCell_ID_FCS::HEC3
@ HEC3
Definition: FastCaloSim_CaloCell_ID.h:30
CaloCell_Base_ID::LAREM
@ LAREM
Definition: CaloCell_Base_ID.h:46
CaloTopoClusterMaker::m_xtalkEtaEratio
float m_xtalkEtaEratio
cut on Eneighbor/E to revover out of time layer 2 cell close in eta to energetic neighor cell
Definition: CaloTopoClusterMaker.h:157
CaloCell_ID_FCS::FCAL0
@ FCAL0
Definition: FastCaloSim_CaloCell_ID.h:40
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
CaloCell_ID_FCS::TileBar2
@ TileBar2
Definition: FastCaloSim_CaloCell_ID.h:33
CaloPrefetch::nextDDE
void nextDDE(Iter iter, Iter endIter)
Prefetch next CaloDDE.
Definition: CaloPrefetch.h:47
CaloTopoClusterMaker::m_clusterSize
xAOD::CaloCluster::ClusterSize m_clusterSize
Cluster size enum. Set based on energy cut jobO.
Definition: CaloTopoClusterMaker.h:360
CaloTopoClusterMaker::m_useSampling
std::vector< bool > m_useSampling
flag for all samplings - true for used ones, false for excluded ones
Definition: CaloTopoClusterMaker.h:353
LArNeighbours::all2D
@ all2D
Definition: LArNeighbours.h:18
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
CaloBadCellHelper::isBad
static bool isBad(const CaloCell *pCell, bool treatL1PredictedCellsAsGood)
Definition: CaloBadCellHelper.h:27
CaloTopoClusterMaker::m_xtalkEM3
bool m_xtalkEM3
if set to true we extend the time window for direct layer 3 neighbors of high energy layer 2 cells
Definition: CaloTopoClusterMaker.h:304
CaloTopoTmpClusterCell::getCaloTopoTmpHashCluster
const CaloTopoTmpHashCluster * getCaloTopoTmpHashCluster() const
Definition: CaloTopoTmpClusterCell.h:54
CaloCell::eta
virtual double eta() const override final
get eta (through CaloDetDescrElement)
Definition: CaloCell.h:366
CaloTopoClusterMaker::m_useTimeCutUpperLimit
bool m_useTimeCutUpperLimit
if set to true, the time cut is not applied on cell of large significance
Definition: CaloTopoClusterMaker.h:284
CaloPrefetch::ArenaHandlePrefetch::erase
void erase()
Free all allocated elements.
Definition: CaloPrefetch.h:136