ATLAS Offline Software
CaloTopoClusterMaker.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 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  return StatusCode::SUCCESS;
351 
352 }
353 
354 //#############################################################################
355 
357 CaloTopoClusterMaker::execute(const EventContext& ctx,
358  xAOD::CaloClusterContainer* clusColl) const
359 {
360  // minimal significance - should be > 0 in order to avoid
361  // throwing away of bad cells
362  const float epsilon = 0.00001;
363 
364  //ATH_MSG_DEBUG( "Executing " << name());
365 
367  using HashCluster = CaloTopoTmpHashCluster;
368 
372 
373  // create cell list for cells above seed cut (for seed growing algo)
374  std::vector<HashCell> mySeedCells;
375  mySeedCells.reserve (2000);
376  // create initial cluster list (one cell per cluster)
377  std::vector<HashCluster *> myHashClusters;
378  myHashClusters.reserve (10000);
379 
380  // create vector to hold all cells.
381  std::vector<HashCell> cellVector (m_hashMax - m_hashMin);
382  HashCell* hashCells = cellVector.data() - m_hashMin;
383 
384 
386  const CaloNoise* noiseCDO=*noiseHdl;
387 
388  //---- Get the CellContainers ----------------
389 
390  // for (const std::string& cellsName : m_cellsNames) {
392  if( !cellColl.isValid()){
393  ATH_MSG_ERROR( " Can not retrieve CaloCellContainer: "
394  << cellColl.name() );
395  return StatusCode::RECOVERABLE;
396  }
397 
398  const DataLink<CaloCellContainer> cellCollLink (cellColl.name(),ctx);
399 
400  //ATH_MSG_DEBUG("CaloCell container: "<< cellsName
401  // <<" contains " << cellColl->size() << " cells");
402 
403  for (int isubdet = 0; isubdet < CaloCell_ID::NSUBCALO; ++isubdet) {
404  CaloCell_ID::SUBCALO subdet = (CaloCell_ID::SUBCALO)isubdet;
405  if (m_subcaloUsed[subdet] && cellColl->hasCalo(subdet)) {
406  auto cellIter = cellColl->beginConstCalo (subdet);
407  auto cellIterEnd = cellColl->endConstCalo (subdet);
408  for (int iCell = cellColl->indexFirstCellCalo(subdet);
409  cellIter != cellIterEnd;
410  ++iCell, ++cellIter)
411  {
412  CaloPrefetch::nextDDE(cellIter, cellIterEnd, 2);
413  const CaloCell* pCell = *cellIter;
414  const float noiseSigma = m_twogaussiannoise ? \
415  noiseCDO->getEffectiveSigma(pCell->ID(),pCell->gain(),pCell->energy()) : \
416  noiseCDO->getNoise(pCell->ID(),pCell->gain());
417 
418  float signedE = pCell->energy();
419  float signedEt = pCell->et();
420  float signedRatio = epsilon; // not 0 in order to keep bad cells
421  if ( finite(noiseSigma) && noiseSigma > 0 && !CaloBadCellHelper::isBad(pCell,m_treatL1PredictedCellsAsGood) )
422  signedRatio = signedE/noiseSigma;
423 
424  bool passedCellCut = (m_cellCutsInAbsE?std::abs(signedRatio):signedRatio) > m_cellThresholdOnEorAbsEinSigma;
425  bool passedNeighborCut = (m_neighborCutsInAbsE?std::abs(signedRatio):signedRatio) > m_neighborThresholdOnEorAbsEinSigma;
426  bool passedSeedCut = (m_seedCutsInAbsE?std::abs(signedRatio):signedRatio) > m_seedThresholdOnEorAbsEinSigma;
427 
428  bool applyTimeCut = m_seedCutsInT && (!m_useTimeCutUpperLimit || signedRatio <= m_timeCutUpperLimit);
429  bool passTimeCut_seedCell = (!applyTimeCut || passCellTimeCut(pCell,cellColl.cptr()));
430  bool passedSeedAndTimeCut = (passedSeedCut && passTimeCut_seedCell);
431 
432  bool passedNeighborAndTimeCut = passedNeighborCut;
433  if(m_cutOOTseed && passedSeedCut && !passTimeCut_seedCell) passedNeighborAndTimeCut=false; //exclude Out-Of-Time seeds from neighbouring stage as well (if required)
434 
435  bool passedCellAndTimeCut = passedCellCut;
436  if(m_cutOOTseed && passedSeedCut && !passTimeCut_seedCell) passedCellAndTimeCut=false; //exclude Out-Of-Time seeds from cluster (if required)
437 
438  if ( passedCellAndTimeCut || passedNeighborAndTimeCut || passedSeedAndTimeCut ) {
439  const CaloDetDescrElement* dde = pCell->caloDDE();
440  IdentifierHash hashid = dde ? dde->calo_hash() : m_calo_id->calo_cell_hash(pCell->ID());
441  CaloTopoTmpClusterCell *tmpClusterCell =
442  new (tmpcell_pool.allocate())
443  CaloTopoTmpClusterCell(hashid,subdet,iCell,signedRatio,signedEt);
444 #if 0
445  // some debug printout - can also be used to construct neighbor
446  // tables offline ...
447  if ( m_doALotOfPrintoutInFirstEvent ) {
448  ATH_MSG_DEBUG( " [ExtId|Id|SubDet|HashId|eta|phi|E/noise|Et]: "
449  << "[" << m_calo_id->show_to_string(pCell->ID(),0,'/')
450  << "|" << mypCell->ID().getString()
451  << "|" << subdet
452  << "|" << (unsigned int)hashid
453  << "|" << pCell->eta()
454  << "|" << pCell->phi()
455  << "|" << signedRatio
456  << "|" << signedEt
457  << "]");
458 
459  }
460 #endif
461  HashCell hashCell(tmpClusterCell);
462  if ( passedNeighborAndTimeCut || passedSeedAndTimeCut ) {
463  HashCluster *tmpCluster =
464  new (tmpclus_pool.allocate()) HashCluster (tmplist_pool);
465  tmpClusterCell->setCaloTopoTmpHashCluster(tmpCluster);
466  tmpCluster->add(hashCell);
467  myHashClusters.push_back(tmpCluster);
468  int caloSample = dde ? dde->getSampling() : m_calo_id->calo_sample(pCell->ID());
469  if ( passedSeedAndTimeCut
470  && caloSample >= m_minSampling
471  && caloSample <= m_maxSampling
472  && m_useSampling[caloSample-m_minSampling]) {
473  tmpClusterCell->setUsed();
474  mySeedCells.push_back(hashCell);
475  }
476  }
477  hashCells[hashid] = hashCell;
478  }
479  }//end loop over cells
480  }//end if use subcalo
481  }//end loop over subcalos
482 
483 
484  // sort initial seed cells to start with the cell of largest S/N
485  // this makes the resulting clusters independent of the initial
486  // ordering of the cells
487  if ( m_useGPUCriteria) {
488  if ( m_seedCutsInAbsE) {
490  std::sort(mySeedCells.begin(),mySeedCells.end(),compareSoverN);
491  }
492  else {
494  std::sort(mySeedCells.begin(),mySeedCells.end(),compareSoverN);
495  }
496  }
497  else {
498  if ( m_seedCutsInAbsE) {
500  std::sort(mySeedCells.begin(),mySeedCells.end(),compareSoverN);
501  }
502  else {
504  std::sort(mySeedCells.begin(),mySeedCells.end(),compareSoverN);
505  }
506  }
507 
508 #if 1
509  if (msgLvl(MSG::DEBUG)) {
510  for (const HashCell& hc : mySeedCells) {
511  ATH_MSG_DEBUG( " SeedCell ["
512  << hc.getCaloTopoTmpClusterCell()->getSubDet()
513  << "|"
514  << (unsigned int)hc.getCaloTopoTmpClusterCell()->getID()
515  << "] has S/N = "
516  << hc.getCaloTopoTmpClusterCell()->getSignedRatio()
517  );
518  }
519  }
520 #endif
521 
522  std::vector<HashCell> myNextCells;
523  myNextCells.reserve (1000);
524 
525  std::vector<IdentifierHash> theNeighbors;
526  theNeighbors.reserve(22);
527 #if 0
528  std::vector<IdentifierHash> theNNeighbors;
529  theNNeighbors.reserve(22);
530 #endif
531 
532  bool doRestrictHECIWandFCal = m_restrictHECIWandFCalNeighbors &&
534 
535  bool doRestrictPS = m_restrictPSNeighbors &&
537 
538  while ( !mySeedCells.empty() ) {
539  // create cell list for next neighbor cells to consider
540  myNextCells.clear();
541 
542  // loop over all current neighbor cells (for Seed Growing Algo)
543  for (HashCell& hc : mySeedCells) {
544  CaloTopoTmpClusterCell* pCell= hc.getCaloTopoTmpClusterCell();
545  IdentifierHash hashid = pCell->getID();
546  HashCluster *myCluster = pCell->getCaloTopoTmpHashCluster();
547  CaloCell_ID::SUBCALO mySubDet = pCell->getSubDet();
548  // in case we use all3d or super3D and the current cell is in the
549  // HEC IW or FCal2 & 3 or PS and we want to restrict their neighbors,
550  // use only next in sampling neighbors
552  if (( mySubDet != CaloCell_ID::LAREM &&
553  doRestrictHECIWandFCal &&
554  ( ( mySubDet == CaloCell_ID::LARHEC &&
555  m_calo_id->region(m_calo_id->cell_id(hashid)) == 1 ) ||
556  ( mySubDet == CaloCell_ID::LARFCAL &&
557  m_calo_id->sampling(m_calo_id->cell_id(hashid)) > 1 ) ) ) ||
558  ( doRestrictPS &&
559  ( ( mySubDet == CaloCell_ID::LAREM &&
560  m_calo_id->sampling(m_calo_id->cell_id(hashid)) == 0 ) ) ) ) {
562  }
563  m_calo_id->get_neighbours(hashid,opt,theNeighbors);
564  // loop over all neighbors of that cell (Seed Growing Algo)
565  for (IdentifierHash nId : theNeighbors) {
566  CaloCell_ID::SUBCALO otherSubDet =
568  if ( m_subcaloUsed[otherSubDet] ) {
569  HashCell neighborCell = hashCells[nId];
570  if ( neighborCell.getCaloTopoTmpClusterCell() ) {
571  CaloTopoTmpClusterCell* pNCell =
572  neighborCell.getCaloTopoTmpClusterCell();
573  // check neighbor threshold only since seed cells are already in
574  // the original list
575  bool isAboveNeighborThreshold =
577  // checking the neighbors
578  if ( isAboveNeighborThreshold && !pNCell->getUsed() ) {
579  pNCell->setUsed();
580  myNextCells.push_back(neighborCell);
581  }
582  HashCluster *otherCluster = pNCell->getCaloTopoTmpHashCluster();
583  if ( myCluster != otherCluster ) {
584  HashCluster *toKill = nullptr;
585  HashCluster *toKeep = nullptr;
586  if ( !otherCluster || isAboveNeighborThreshold ) {
587 
588  auto compareClusters = [&](const auto & c1, const auto & c2) {
589  if (m_useGPUCriteria) {
590  //The seed cell with the largest SNR wins
591  if (m_seedCutsInAbsE) {
593  return compare(*(c1->begin()), *(c2->begin()));
594  }
595  else {
597  return compare(*(c1->begin()), *(c2->begin()));
598  }
599  }
600  else {
601  //We merge the smallest cluster to the largest...
602  return c1->size() > c2->size();
603  }
604  };
605 
606  if ( !otherCluster || compareClusters(myCluster, otherCluster) ) {
607  toKill = otherCluster;
608  toKeep = myCluster;
609  }
610  else {
611  toKill = myCluster;
612  toKeep = otherCluster;
613  }
614  if ( toKill ) {
615  for (auto *hc : *toKill)
616  hc->setCaloTopoTmpHashCluster(toKeep);
617  toKeep->add(*toKill);
618  toKill->removeAll();
619  }
620  else {
621  toKeep->add(neighborCell);
622  pNCell->setCaloTopoTmpHashCluster(toKeep);
623  }
624  myCluster = toKeep;
625  }
626  }
627  }
628  }
629  }
630  }
631  mySeedCells.swap (myNextCells);
632  }
633 
634 
635  //Create temporary list of proto-clusters
636  //Clusters below Et cut will be dropped.
637  //The remaining clusters will be sorted in E_t before storing
638  std::vector<std::unique_ptr<CaloProtoCluster> > sortClusters;
639  sortClusters.reserve (myHashClusters.size());
640 
641  for (HashCluster* tmpCluster : myHashClusters) {
642  bool addCluster(false);
643  if ( tmpCluster->size() > 1 )
644  addCluster = true;
645  else if ( tmpCluster->size() == 1 ) {
646  // need to check if seed cell was good
647  HashCluster::iterator clusCellIter=tmpCluster->begin();
648  if ( clusCellIter->getUsed() )
649  addCluster = true;
650  }
651  if ( addCluster) {
652  std::unique_ptr<CaloProtoCluster> myCluster = std::make_unique<CaloProtoCluster>(cellCollLink);
653  //CaloProtoCluster* myCluster = new CaloProtoCluster(cellCollLink);
654  myCluster->getCellLinks()->reserve(tmpCluster->size());
655 
656  for (CaloTopoTmpClusterCell* cell : *tmpCluster) {
657  const size_t iCell = cell->getCaloCell();
658  myCluster->addCell(iCell,1.);
659  }
660  const float cl_et = myCluster->et();
661  if ( (m_clusterCutsInAbsE ? std::abs(cl_et) : cl_et) > m_clusterEtorAbsEtCut ) {
662  sortClusters.push_back(std::move(myCluster));
663  }
664  }
665  }
666 
667  // Sort the clusters according to Et
668  std::sort(sortClusters.begin(),sortClusters.end(),[](const std::unique_ptr<CaloProtoCluster>& pc1,
669  const std::unique_ptr<CaloProtoCluster>& pc2) {
670  //As in CaloUtils/CaloClusterEtSort.
671  //assign to volatile to avoid excess precison on in FP unit on x386 machines
672  volatile double et1(pc1->et());
673  volatile double et2(pc2->et());
674  //return (et1 < et2); //This is the order we had from CaloRec-02-13-11 to CaloRec-03-00-31
675  return (et1 > et2); //This is the order we should have
676  }
677  );
678  // add to cluster container
679  clusColl->reserve(sortClusters.size());
680 
681  for (const auto& protoCluster: sortClusters) {
682  xAOD::CaloCluster* xAODCluster=new xAOD::CaloCluster();
683  clusColl->push_back(xAODCluster);
684  xAODCluster->addCellLink(protoCluster->releaseCellLinks());//Hand over ownership to xAOD::CaloCluster
685  xAODCluster->setClusterSize(m_clusterSize);
686  CaloClusterKineHelper::calculateKine(xAODCluster,false,true, m_useGPUCriteria); //No weight at this point!
687  }
688 
689  tmpclus_pool.erase();
690  tmpcell_pool.erase();
691 
692  return StatusCode::SUCCESS;
693 }
694 
697 
701 
703 
704  }else if(m_seedThresholdOnEorAbsEinSigma==4.
707 
709  }
710  ATH_MSG_DEBUG( "Cluster size = " << m_clusterSize);
711 }
712 
713 
714 inline bool CaloTopoClusterMaker::passCellTimeCut(const CaloCell* pCell, const CaloCellContainer* cellColl) const {
715  // get the cell time to cut on (the same as in CaloEvent/CaloCluster.h)
716  bool isInTime = true;
717  // need sampling number already for time
718  CaloSampling::CaloSample sam = pCell->caloDDE()->getSampling();
719  // check for unknown sampling
721  const unsigned pmask= pCell->caloDDE()->is_tile() ? 0x8080 : 0x2000;
722  //0x2000 is used to tell that time and quality information are available for this channel
723  //(from TWiki: https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/CaloEventDataModel#The_Raw_Data_Model)
724  // Is time defined?
725  if(pCell->provenance() & pmask) {
726  isInTime = (std::abs(pCell->time())<m_seedThresholdOnTAbs);
727  if ( m_xtalkEM2 && (!isInTime) && (pCell->energy() > 0 && (sam == CaloSampling::EMB2 || (sam == CaloSampling::EME2 && std::abs(pCell->eta()) < 2.5)))) {
728  // relax time constraints in EMB2 and EME2_OW due to xTalk from direct phi neighbours
729  // check if |E| is less than 0.25 times one of the |E| values of direct
730  // phi-neighbours. In case that phi-neigbour is in-time, expand upper limit by m_xtalkDeltaT
731  IdentifierHash hashid = pCell->caloDDE()->calo_hash();
732  std::vector<IdentifierHash> theNeighbors;
733  LArNeighbours::neighbourOption opt = (LArNeighbours::neighbourOption)(((int)LArNeighbours::prevInPhi)|((int)LArNeighbours::nextInPhi)); // shoud make a proper enum in LarNeighbours.h for this one ...
734  m_calo_id->get_neighbours(hashid,opt,theNeighbors);
735  // loop over all neighbors of that cell (Seed Growing Algo)
736  for (IdentifierHash nId : theNeighbors) {
737  const CaloCell * pNCell = cellColl->findCell(nId);
738  if ( pNCell ) {
739  if ( pNCell->energy() > m_xtalk2Eratio1*pCell->energy() ) {
740  if ( (!(pNCell->provenance() & pmask)) || std::abs(pNCell->time()) < m_seedThresholdOnTAbs) {
741  isInTime = ((pCell->time() > -m_seedThresholdOnTAbs) && (pCell->time() < m_seedThresholdOnTAbs + m_xtalkDeltaT));
742  if ( isInTime ) {
743  // exit after first phi neighbour in case that already made
744  // the time-cut pass
745  break;
746  }
747  }
748  }
749 
750  // check second neighbor
751  if (m_xtalkEM2n) {
752  std::vector<IdentifierHash> theNextNeighbors;
753  m_calo_id->get_neighbours(nId,opt,theNextNeighbors);
754  for (IdentifierHash n2Id : theNextNeighbors) {
755  if (n2Id != hashid) {
756  const CaloCell * p2NCell = cellColl->findCell(n2Id);
757  if (p2NCell) {
758  if (p2NCell->energy() > m_xtalk2Eratio2*pCell->energy()) {
759  if ( (!(p2NCell->provenance() & pmask)) || std::abs(p2NCell->time()) < m_seedThresholdOnTAbs) {
760  isInTime = ((pCell->time() > -m_seedThresholdOnTAbs) && (pCell->time() < m_seedThresholdOnTAbs + m_xtalkDeltaT));
761  if (isInTime) break;
762  }
763  }
764  }
765  }
766  } // loop over 2nd neighbors
767  }
768  } // if (pNcell)
769  } // loop over first neighbors
770  } // special case for layer 2
771 
772  // check cross talk in eta
773  if ( m_xtalkEMEta && (!isInTime) && (pCell->energy() > 0 && (sam == CaloSampling::EMB2 || (sam == CaloSampling::EME2 && std::abs(pCell->eta()) < 2.5)))) {
774  IdentifierHash hashid = pCell->caloDDE()->calo_hash();
775  std::vector<IdentifierHash> theNeighbors;
777  m_calo_id->get_neighbours(hashid,opt,theNeighbors);
778  for (IdentifierHash nId : theNeighbors) {
779  const CaloCell * pNCell = cellColl->findCell(nId);
780  if ( pNCell ) {
781  if ( pNCell->energy() > m_xtalkEtaEratio*pCell->energy() ) {
782  if ( (!(pNCell->provenance() & pmask)) || std::abs(pNCell->time()) < m_seedThresholdOnTAbs) {
783  isInTime = ((pCell->time() > -m_seedThresholdOnTAbs) && (pCell->time() < m_seedThresholdOnTAbs + m_xtalkDeltaT));
784  if ( isInTime ) {
785  // exit after first phi neighbour in case that already made
786  // the time-cut pass
787  break;
788  }
789  }
790  }
791  }
792  }
793  }
794 
795  // option for all2D
796  if ( m_xtalkEM2D && (!isInTime) && (pCell->energy() > 0 && (sam == CaloSampling::EMB2 || (sam == CaloSampling::EME2 && std::abs(pCell->eta()) < 2.5)))) {
797  IdentifierHash hashid = pCell->caloDDE()->calo_hash();
798  std::vector<IdentifierHash> theNeighbors;
800  m_calo_id->get_neighbours(hashid,opt,theNeighbors);
801  for (IdentifierHash nId : theNeighbors) {
802  const CaloCell * pNCell = cellColl->findCell(nId);
803  if ( pNCell ) {
804  if ( pNCell->energy() > m_xtalk2DEratio*pCell->energy() ) {
805  if ( (!(pNCell->provenance() & pmask)) || std::abs(pNCell->time()) < m_seedThresholdOnTAbs) {
806  isInTime = ((pCell->time() > -m_seedThresholdOnTAbs) && (pCell->time() < m_seedThresholdOnTAbs + m_xtalkDeltaT));
807  if ( isInTime ) break;
808  }
809  }
810  }
811  }
812  }
813 
814  // relax also time constraint for EMB3 and EME2_OW
815  if ( m_xtalkEM3 && (!isInTime) && (pCell->energy() > 0 && (sam == CaloSampling::EMB3 || (sam == CaloSampling::EME3 && std::abs(pCell->eta()) < 2.5)))) {
816  // check previous sampling cell, should be >10 times more (TBC)
817  IdentifierHash hashid = pCell->caloDDE()->calo_hash();
818  std::vector<IdentifierHash> theNeighbors;
820  m_calo_id->get_neighbours(hashid,opt,theNeighbors);
821  for (IdentifierHash nId : theNeighbors) {
822  const CaloCell * pNCell = cellColl->findCell(nId);
823  if ( pNCell ) {
824  if ( pNCell->energy() > m_xtalk3Eratio*pCell->energy() ) {
825  if ( (!(pNCell->provenance() & pmask)) || std::abs(pNCell->time()) < m_seedThresholdOnTAbs) {
826  isInTime = ((pCell->time() > -m_seedThresholdOnTAbs) && (pCell->time() < m_seedThresholdOnTAbs + m_xtalkDeltaT));
827  if (isInTime) break;
828  }
829  } // Eratio cut at 10
830  }
831  } // loop over neighors
832  } // cell is layer 3 EM
833 
834  }
835  }
836  return isInTime;
837 }
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:695
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
max
#define max(a, b)
Definition: cfImp.cxx:41
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
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:357
CaloCell_ID_FCS::TileExt0
@ TileExt0
Definition: FastCaloSim_CaloCell_ID.h:37
CaloCell_ID_FCS::TileBar1
@ TileBar1
Definition: FastCaloSim_CaloCell_ID.h:32
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
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:581
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
min
#define min(a, b)
Definition: cfImp.cxx:40
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:192
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
pmontree.opt
opt
Definition: pmontree.py:16
CaloCell_ID_FCS::TileExt1
@ TileExt1
Definition: FastCaloSim_CaloCell_ID.h:38
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
compileRPVLLRates.c2
c2
Definition: compileRPVLLRates.py:361
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:714
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
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
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
Definition: IdentifierHash.h:38
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