ATLAS Offline Software
Loading...
Searching...
No Matches
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
12 : JetCaloQualityTool(name) {
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;
71 m_cellCalculators.addCalculator( c );
72 }
73
74
75 for(size_t i=0;i<m_cellCalculators.numCalculators();i++) {
76 const jet::JetCaloCalculator* calc = m_cellCalculators.at(i);
77 ATH_MSG_INFO( "Will calculate cell calo attribute : "<< calc->name() );
78 }
79
80 return StatusCode::SUCCESS;
81
82}
83#endif
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
#define ADDCALCULATOR(klass)
Gaudi::Property< int > m_LArQualityCut
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
JetCaloCellQualityTool(const std::string &name)
jet::JetCaloCellCalculations m_cellCalculators
This objects holds a list of cell-based calculators.
Gaudi::Property< int > m_TileQualityCut
Gaudi::Property< std::vector< std::string > > m_calculationNames
JetCaloQualityTool(const std::string &name)
jet::JetCaloCalculations * m_calcProcessor
Gaudi::Property< std::vector< double > > m_timingTimeCuts
jet::JetCaloCalculations m_jetCalculations
This objects holds a list of cluster-based calculators.
Base class to support cpu-efficient calculation on calorimeter jets either at CaloCell or constituent...
std::string name(xAOD::JetAttribute::AttributeID id)