 |
ATLAS Offline Software
|
Go to the documentation of this file.
44 m_triggerTowerContainerName(
LVL1::TrigT1CaloDefs::xAODTriggerTowerLocation),
45 m_outputFolderName(
"/L1CaloRampMaker/L1CaloRampDataContainer"),
46 m_gainStrategyFolder(
"/TRIGGER/Receivers/Conditions/Strategy"),
52 m_isFcalLowEta(false),
53 m_isFcalHighEta(false),
54 m_checkProvenance(false),
55 m_nEventsPerStep(200),
57 m_fadcSaturationCut(963),
58 m_tileSaturationCut(150.),
59 m_ttTool(
"LVL1::L1TriggerTowerToolRun3/L1TriggerTowerToolRun3"),
60 m_xAODTTTools(
"LVL1::L1CaloxAODOfflineTriggerTowerTools/L1CaloxAODOfflineTriggerTowerTools", this),
61 m_jmTools(
"LVL1::L1CaloOfflineTriggerTowerTools/L1CaloOfflineTriggerTowerTools", this),
65 m_lvl1Helper(nullptr),
66 m_rampDataContainer(nullptr)
102 return StatusCode::FAILURE;
114 return StatusCode::SUCCESS;
124 <<
" events, skipping the rest" );
127 return StatusCode::SUCCESS;
135 return StatusCode::SUCCESS;
140 if(!
sc.isSuccess()) {
143 return StatusCode::RECOVERABLE;
147 const EventContext& ctx = getContext();
151 const unsigned evt=ctx.eventID().event_number();
168 std::string gainStrategy(
"");
174 bool consistent(
true);
175 for (; itr != itrE; ++itr) {
176 const unsigned int channel = itr->first;
179 const std::string
strategy(attrList[
"name"].data<std::string>());
180 const std::string
status(attrList[
"status"].data<std::string>());
183 <<
", status = " <<
status );
184 if (gainStrategy ==
"") gainStrategy =
strategy;
185 else if (gainStrategy !=
strategy) consistent =
false;
187 std::string newStrategy(
"");
188 if (
runNumber == 219978) newStrategy =
"GainOneOvEmecFcalLowEta";
189 if (
runNumber == 219979) newStrategy =
"GainOneOvEmbFcalHighEta";
190 if (
runNumber == 219980) newStrategy =
"CalibGainsEt";
191 if (
runNumber == 220013) newStrategy =
"GainOneOvEmecFcalLowEta";
192 if (
runNumber == 220014) newStrategy =
"GainOneOvEmbFcalHighEta";
193 if (
runNumber == 220015) newStrategy =
"CalibGainsEt";
194 if (
runNumber == 222871) newStrategy =
"GainOne";
195 if (
runNumber == 222872) newStrategy =
"GainOne";
196 if (
runNumber == 222873) newStrategy =
"GainOne";
197 if (
runNumber == 223073) newStrategy =
"GainOne";
198 if (
runNumber == 223074) newStrategy =
"GainOne";
199 if (
runNumber == 223075) newStrategy =
"GainOne";
200 if (newStrategy !=
"") {
201 ATH_MSG_INFO(
"Changing Gain Strategy to " << newStrategy);
202 gainStrategy = newStrategy;
204 if (gainStrategy !=
"" && consistent) {
205 m_isGain1 = (gainStrategy.find(
"GainOne") != std::string::npos);
206 m_isOvEmb = (gainStrategy.find(
"OvEmb") != std::string::npos);
207 m_isOvEmec = (gainStrategy.find(
"OvEmec") != std::string::npos);
208 m_isFcalLowEta = (gainStrategy.find(
"FcalLowEta") != std::string::npos);
209 m_isFcalHighEta = (gainStrategy.find(
"FcalHighEta") != std::string::npos);
210 }
else if (gainStrategy ==
"") {
233 <<
": old=" <<
m_nTTs <<
", new=" << tts->
size());
235 unsigned int nmiss = 0;
236 for(
auto*
tt: *tts) {
256 for(
auto *
tt : *tts) {
258 if(
tt->isJepSaturated())
continue;
261 auto max = std::max_element(
tt->adc().begin(),
tt->adc().end());
265 if(
m_ttTool->disabledChannel(
tt->coolId()))
continue;
278 if(specialChannelIt == specialChannelRangeEnd || level1Energy < specialChannelIt->
second) {
279 ATH_MSG_DEBUG(
"Adding Energy for " <<
tt->coolId() <<
":" << caloEnergy <<
" vs. " << level1Energy);
283 specialChannelIt->second = -1000;
291 return StatusCode::SUCCESS;
298 for(
auto*
tt: *tts) {
310 auto id =
m_ttTool->identifier(
tt->eta(),
tt->phi(),
tt->sampling());
313 if(
tt->sampling() == 0) {
318 std::vector<float> etRec =
m_jmTools->hadTTCellsEtByReceiver(&T);
319 if (etRec.size() == 2) {
322 else et = etRec[0] + etRec[1];
323 }
else if (etRec.size() == 1)
et = etRec[0];
329 std::vector<float> energyRec =
m_jmTools->emTTCellsEnergyByReceiver(&T);
330 if (energyRec.size() == 2) {
333 else energy = energyRec[1];
335 }
else et = energyRec[0] / std::cosh(
tt->eta());
337 et = ttCellsEnergy(*
tt) / std::cosh(
tt->eta());
347 auto max = std::max_element(
tt->adc().begin(),
tt->adc().end());
351 << std::hex <<
tt->coolId() << std::dec <<
"!");
365 auto id =
m_ttTool->identifier(
tt->eta(),
tt->phi(),
tt->sampling());
368 if(fabs(
tt->eta()) > 2.5) {
370 }
else if(fabs(
tt->eta()) > 1.9) {
391 (
cell->time()*oneOverNCells))));
394 if(!(
cell->provenance() & 0x100)) {
395 it->second.first += 1;
397 it->second.second += (
cell->time()*oneOverNCells);
410 std::ofstream bad_ofciter(
"bad-ofciter.txt");
413 bad_ofciter <<
"0x" << std::hex <<
it->first <<
" "
420 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
bool validTower(const bool &isTile)
const_iterator end() const
Extra patterns decribing particle interation process.
SG::ReadCondHandleKey< CondAttrListCollection > m_strategy
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
uint64_t eventNumber() const
The current event's event number.
bool is_fcal(const Identifier id) const
Test wether given tower or layer is part of the FCAL.
const CaloLVL1_ID * m_lvl1Helper
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
virtual ~L1CaloRampMaker()
bool is_barrel_end(const Identifier id) const
Test wether given tower or layer is part of the EM barrel END.
Helper class to provide constant type-safe access to aux data.
std::map< unsigned int, std::pair< unsigned int, double > > m_mapBadOFCIteration
This class is a collection of AttributeLists where each one is associated with a channel number....
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
uint32_t runNumber() const
The current event's run number.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
bool is_hec(const Identifier id) const
Test wether given tower or layer is part of the HEC.
void checkProvenance(const xAOD::TriggerTower *tt)
std::map< int, int > m_specialChannelRange
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
SG::ReadCondHandleKey< L1CaloPprDisabledChannelContainerRun2 > m_pprDisabledChannelContainer
This class initializes the Calo (LAr and Tile) offline identifiers.
SG::ReadHandleKey< CaloCellContainer > m_caloCellsKey
double m_tileSaturationCut
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
L1CaloRampMaker(const std::string &name, ISvcLocator *pSvcLocator)
Description of TriggerTower_v2.
const CaloLVL1_ID * getLVL1_ID(void) const
#define CHECK(...)
Evaluate an expression and check for errors.
Container of L1CaloRampData objects.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
double getTriggerTowerEnergy(const xAOD::TriggerTower *tt, SG::ReadCondHandle< L1CaloPprChanCalibContainer > pprCond)
ToolHandle< LVL1::IL1TriggerTowerToolRun3 > m_ttTool
SG::ReadCondHandleKey< L1CaloPprChanCalibContainer > m_pprChanCalibContainer
Trigger towers are the inputs to all other parts of the calorimeter trigger.
Helpers for checking error return status codes and reporting errors.
StatusCode initialize(bool used=true)
std::string m_outputFolderName
Container class for CaloCell.
std::string m_gainStrategyFolder
Class describing the basic event information.
const L1CaloPprChanCalib * pprChanCalib(unsigned int channelId) const
void setupRampDataContainer(const xAOD::TriggerTowerContainer *triggerTowerContainer)
std::unique_ptr< L1CaloRampDataContainer > m_rampDataContainer
#define ATH_MSG_WARNING(x)
ChanAttrListMap::const_iterator const_iterator
unsigned int pedValue() const
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
ToolHandle< LVL1::IL1CaloxAODOfflineTriggerTowerTools > m_xAODTTTools
virtual unsigned int ttKey(const TriggerTower &tower)
returns the key of the passed tower
unsigned int m_nEventsPerStep
bool is_tile(const Identifier id) const
Test wether given tower or layer is part of the Tile Calorimeter.
size_type size() const noexcept
Returns the number of elements in the collection.
ToolHandle< LVL1::IL1CaloOfflineTriggerTowerTools > m_jmTools
double getCaloEnergy(const xAOD::TriggerTower *tt)
Transient class to store the RampData calculated from calibration runs.
The TriggerTowerKey object provides the key for each trigger tower depending on its eta-phi coords.
std::string m_triggerTowerContainerName