ATLAS Offline Software
JetCaloCellQualityTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef XAOD_ANALYSIS
6 
9 #include <iostream>
10 
13  declareInterface<IJetDecorator>(this);
14 }
15 
17  ATH_MSG_DEBUG(" initialize() ");
18 
19  // In this tool we're using the cell-based calculators
21 
22  // Define and use a macro to compactify the addition of calo calculators
23  // The macro defines a JetCalculator as 'c' in case addition setting are needed.
24 #define ADDCALCULATOR( klass ) klass *c = new klass(); c->setName( c->name() + m_attSuffix); m_cellCalculators.addCellCalculator(c)
25 
26  // convert names passed as property into calo calculators
27  for( std::string & calcN : m_calculationNames){
28 
29  if ( calcN == "LArQuality") {
30  ADDCALCULATOR( jet::JetCalcQuality_fromCells );
31  c->LArQualityCut = m_LArQualityCut; // c is defined in the macro.
32  } else if ( calcN == "TileQuality") {
33  ADDCALCULATOR( jet::JetCalcQuality_fromCells );
34  c->setName( "TileQuality" );
35  c->TileQualityCut = m_TileQualityCut; // c is defined in the macro.
36  c->includeTile = true;
37  c->includeLAr = false;
38  } else if ( calcN == "Timing") {
39  ADDCALCULATOR( jet::JetCalcTimeCells_fromCells );
40  } else if ( calcN == "QualityHEC") {
41  ADDCALCULATOR( jet::JetCalcQualityHEC_fromCells );
42  } else if ( calcN == "NegativeE") {
43  ADDCALCULATOR( jet::JetCalcNegativeEnergy_fromCells );
44  } else if ( calcN == "AverageLArQF") {
45  ADDCALCULATOR( jet::JetCalcAverageLArQualityF_fromCells );
46  } else if ( calcN == "Centroid") {
47  ADDCALCULATOR( jet::JetCalcCentroid_fromCells );
48  } else if ( calcN == "N90Cells") {
49  ADDCALCULATOR( jet::JetCalcnLeadingCells_fromCells );
51  } else if ( calcN == "BchCorrCell") {
52  ATH_MSG_ERROR(" No BchCorrCell implemented yet using CaloCell direct access");
53  return StatusCode::FAILURE;
54  } else if (calcN == "FracSamplingMax") {
55  m_doFracSamplingMax = true; // no caculator, as this is a special case.
56  }
57 
58  }// end loop over m_calculationNames
59 
60 
61  // Define OOT calculators.
62  for( double & timeCut : m_timingTimeCuts){
63 
64  // build the moment name from the base-name and the value of the timing cut
65  std::stringstream s;
66  s << std::setprecision(0) << std::fixed << "OotFracCells" << timeCut;
67 
68  jet::JetCalcOutOfTimeEnergyFraction_fromCells* c = new jet::JetCalcOutOfTimeEnergyFraction_fromCells();
69  c->setName(s.str());
70  c->timecut = timeCut;
72  }
73 
74 
75  for(size_t i=0;i<m_cellCalculators.numCalculators();i++) {
77  ATH_MSG_INFO( "Will calculate cell calo attribute : "<< calc->name() );
78  }
79 
80  return StatusCode::SUCCESS;
81 
82 }
83 #endif
JetCaloQualityTool::m_timingTimeCuts
Gaudi::Property< std::vector< double > > m_timingTimeCuts
Definition: JetCaloQualityTool.h:53
JetCaloCellQualityTool.h
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
JetCaloCellQualityTool::m_TileQualityCut
Gaudi::Property< int > m_TileQualityCut
Definition: JetCaloCellQualityTool.h:49
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
ADDCALCULATOR
#define ADDCALCULATOR(klass)
JetCaloQualityTool
Definition: JetCaloQualityTool.h:39
xAOD::JetAttribute::N90Cells
@ N90Cells
Definition: JetAttributes.h:92
JetCaloQualityTool::m_calculationNames
Gaudi::Property< std::vector< std::string > > m_calculationNames
Definition: JetCaloQualityTool.h:51
xAOD::JetAttributeAccessor::name
std::string name(xAOD::JetAttribute::AttributeID id)
Definition: JetAccessorMap.h:30
jet::JetCaloCalculations::numCalculators
size_t numCalculators() const
Definition: JetCaloCalculations.h:161
JetCaloCellQualityTool::m_LArQualityCut
Gaudi::Property< int > m_LArQualityCut
Definition: JetCaloCellQualityTool.h:48
JetCaloQualityTool::m_doFracSamplingMax
bool m_doFracSamplingMax
Definition: JetCaloQualityTool.h:67
JetAccessorMap.h
JetCaloQualityTool::m_jetCalculations
jet::JetCaloCalculations m_jetCalculations
This objects holds a list of cluster-based calculators
Definition: JetCaloQualityTool.h:62
JetCaloCellQualityTool::initialize
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition: JetCaloCellQualityTool.cxx:16
jet::JetCaloCalculations::at
const JetCaloCalculator * at(size_t i) const
Definition: JetCaloCalculations.h:162
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
JetCaloQualityTool::m_calcProcessor
jet::JetCaloCalculations * m_calcProcessor
Definition: JetCaloQualityTool.h:65
JetCaloCellQualityTool::JetCaloCellQualityTool
JetCaloCellQualityTool(const std::string &name)
Definition: JetCaloCellQualityTool.cxx:11
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
JetCaloCellQualityTool::m_cellCalculators
jet::JetCaloCellCalculations m_cellCalculators
This objects holds a list of cell-based calculators.
Definition: JetCaloCellQualityTool.h:43
jet::JetCaloCalculations::addCalculator
void addCalculator(JetCaloCalculator *c)
Definition: JetCaloCalculations.cxx:257
jet::JetCaloCalculator
Definition: JetCaloCalculations.h:76
beamspotnt.calc
calc
Definition: bin/beamspotnt.py:1252
python.compressB64.c
def c
Definition: compressB64.py:93