ATLAS Offline Software
Loading...
Searching...
No Matches
L1CaloRampMaker Class Reference

The L1CaloRampMaker creates a set of L1CaloRampData objects. More...

#include <L1CaloRampMaker.h>

Inheritance diagram for L1CaloRampMaker:

Public Member Functions

 L1CaloRampMaker (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~L1CaloRampMaker ()
StatusCode initialize ()
StatusCode execute (const EventContext &ctx)
 Execute method.
StatusCode finalize ()
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void setupRampDataContainer (const xAOD::TriggerTowerContainer *triggerTowerContainer)
double getTriggerTowerEnergy (const xAOD::TriggerTower *tt, SG::ReadCondHandle< L1CaloPprChanCalibContainer > pprCond)
double getCaloEnergy (const xAOD::TriggerTower *tt)
void checkProvenance (const xAOD::TriggerTower *tt)
bool validTower (const bool &isTile)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::string m_triggerTowerContainerName
std::string m_outputFolderName
std::string m_gainStrategyFolder
std::map< int, int > m_specialChannelRange
bool m_doLAr
bool m_doTile
bool m_isGain1
bool m_isOvEmb
bool m_isOvEmec
bool m_isFcalLowEta
bool m_isFcalHighEta
bool m_checkProvenance
unsigned int m_nEventsPerStep
unsigned int m_nSteps
int m_fadcSaturationCut
double m_tileSaturationCut
ToolHandle< LVL1::IL1TriggerTowerToolRun3m_ttTool
ToolHandle< LVL1::IL1CaloxAODOfflineTriggerTowerToolsm_xAODTTTools
ToolHandle< LVL1::IL1CaloOfflineTriggerTowerToolsm_jmTools
unsigned int m_nEvent
bool m_firstEvent
unsigned int m_nTTs
const CaloLVL1_IDm_lvl1Helper
std::unique_ptr< L1CaloRampDataContainerm_rampDataContainer
std::map< unsigned int, std::pair< unsigned int, double > > m_mapBadOFCIteration
SG::ReadCondHandleKey< CondAttrListCollectionm_strategy { this, "TRIGGER", "/TRIGGER/Receivers/Conditions/Strategy", "Strategy" }
SG::ReadCondHandleKey< L1CaloPprChanCalibContainerm_pprChanCalibContainer { this, "InputKeyCond", "L1CaloPprChanCalibContainer"}
SG::ReadCondHandleKey< L1CaloPprDisabledChannelContainerRun2m_pprDisabledChannelContainer { this, "InputKeyDisabledChannel", "L1CaloPprDisabledChannelContainerRun2"}
SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
SG::ReadHandleKey< CaloCellContainerm_caloCellsKey { this, "CaloCellsKey", "AllCalo", "CaloCellContainer key" }
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ L1CaloRampMaker()

L1CaloRampMaker::L1CaloRampMaker ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 42 of file L1CaloRampMaker.cxx.

43 : AthAlgorithm(name, pSvcLocator),
44 m_triggerTowerContainerName(LVL1::TrigT1CaloDefs::xAODTriggerTowerLocation),
45 m_outputFolderName("/L1CaloRampMaker/L1CaloRampDataContainer"),
46 m_gainStrategyFolder("/TRIGGER/Receivers/Conditions/Strategy"),
47 m_doLAr(false),
48 m_doTile(false),
49 m_isGain1(true),
50 m_isOvEmb(false),
51 m_isOvEmec(false),
52 m_isFcalLowEta(false),
53 m_isFcalHighEta(false),
54 m_checkProvenance(false),
55 m_nEventsPerStep(200),
56 m_nSteps(9),
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),
62 m_nEvent(1),
63 m_firstEvent(true),
64 m_nTTs(0),
65 m_lvl1Helper(nullptr),
66 m_rampDataContainer(nullptr)
67
68{
69 declareProperty("TriggerTowerCollectionName", m_triggerTowerContainerName);
70 declareProperty("OutputFolderName", m_outputFolderName);
71 declareProperty("GainStrategyFolder", m_gainStrategyFolder);
72 declareProperty("DoLAr", m_doLAr);
73 declareProperty("DoTile", m_doTile);
74 declareProperty("IsGain1", m_isGain1);
75 declareProperty("IsOvEmb", m_isOvEmb);
76 declareProperty("IsOvEmec", m_isOvEmec);
77 declareProperty("IsFcalLowEta", m_isFcalLowEta);
78 declareProperty("IsFcalHighEta", m_isFcalHighEta);
79 declareProperty("CheckProvenance", m_checkProvenance);
80 declareProperty("EventsPerEnergyStep", m_nEventsPerStep);
81 declareProperty("NumberOfEnergySteps", m_nSteps);
82 declareProperty("FADCSaturationCut", m_fadcSaturationCut);
83 declareProperty("TileSaturationCut", m_tileSaturationCut);
84 declareProperty("L1TriggerTowerToolRun3", m_ttTool);
85 declareProperty("SpecialChannelRange", m_specialChannelRange);
86}
Base class from which non-reentrant (not thread-safe) Athena algorithm classes should be derived.
static const std::string xAODTriggerTowerLocation

◆ ~L1CaloRampMaker()

L1CaloRampMaker::~L1CaloRampMaker ( )
virtual

Definition at line 88 of file L1CaloRampMaker.cxx.

89{
90}

Member Function Documentation

◆ checkProvenance()

void L1CaloRampMaker::checkProvenance ( const xAOD::TriggerTower * tt)
private

Definition at line 383 of file L1CaloRampMaker.cxx.

383 {
384 const std::vector<const CaloCell*>& cells(m_xAODTTTools->getCaloCells(*tt));
385 double oneOverNCells = 1./double(cells.size());
386 for(const auto *cell : cells) {
387 auto it = m_mapBadOFCIteration.find(tt->coolId());
388 if(it == m_mapBadOFCIteration.end()) {
389 m_mapBadOFCIteration.insert(std::make_pair(tt->coolId(), std::make_pair(!(cell->provenance() & 0x100),
390 (cell->time()*oneOverNCells))));
391 continue;
392 }
393 if(!(cell->provenance() & 0x100)) {
394 it->second.first += 1;
395 }
396 it->second.second += (cell->time()*oneOverNCells);
397 }
398}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode L1CaloRampMaker::execute ( const EventContext & ctx)
virtual

Execute method.

Implements AthAlgorithm.

Definition at line 117 of file L1CaloRampMaker.cxx.

118{
119 // Skip spurious events
120 unsigned int wantedEvents = m_nEventsPerStep*m_nSteps;
121 if (m_nEvent > wantedEvents) {
122 if (m_nEvent == wantedEvents+1) {
123 ATH_MSG_INFO( "Processed " << wantedEvents
124 << " events, skipping the rest" );
125 }
126 ++m_nEvent;
127 return StatusCode::SUCCESS;
128 }
129
130 const xAOD::EventInfo* eventInfo = nullptr;
131 CHECK(evtStore()->retrieve(eventInfo));
132 if (eventInfo->eventNumber() == 0 && m_nEvent > 1) {
133 // Only allow event 0 as first event
134 ATH_MSG_WARNING( "Skipping spurious event number 0" );
135 return StatusCode::SUCCESS;
136 }
137
138 const xAOD::TriggerTowerContainer *tts = nullptr;
139 auto sc = evtStore()->retrieve(tts, m_triggerTowerContainerName);
140 if(!sc.isSuccess()) {
141 ATH_MSG_ERROR( "Cannot retrieve TriggerTowerCollection '"
142 << m_triggerTowerContainerName << "' from StoreGate." );
143 return StatusCode::RECOVERABLE;
144 }
145
146
147
148 SG::ReadHandle<CaloCellContainer> cells{ m_caloCellsKey,ctx};
149
150 const unsigned evt=ctx.eventID().event_number();
151 ATH_MSG_DEBUG("Event " << evt << " contains " << cells->size() << " CaloCells" );
152 const CaloCellContainer* cellCont = cells.get();
153
154
155
156 m_jmTools->caloCells(cellCont);
157
158 // init trigger tower to cell mapping
159 CHECK(m_xAODTTTools->initCaloCells());
160 ATH_MSG_DEBUG("GAIN STRATEGY " << m_strategy);
161
162
163
164 if(m_firstEvent) {
165 m_nTTs = tts->size();
166 unsigned int runNumber = eventInfo->runNumber();
167 std::string gainStrategy("");
168 const CondAttrListCollection* gainStrategyColl = 0;
169 sc = detStore()->retrieve(gainStrategyColl, m_gainStrategyFolder);
170 if(sc.isSuccess()) {
171 CondAttrListCollection::const_iterator itr = gainStrategyColl->begin();
172 CondAttrListCollection::const_iterator itrE = gainStrategyColl->end();
173 bool consistent(true);
174 for (; itr != itrE; ++itr) {
175 const unsigned int channel = itr->first;
176 if (channel != 1 && channel != 2) continue;
177 const coral::AttributeList& attrList = itr->second;
178 const std::string strategy(attrList["name"].data<std::string>());
179 const std::string status(attrList["status"].data<std::string>());
180 ATH_MSG_INFO( "Gain Strategy: channel = " << channel
181 << ", name = " << strategy
182 << ", status = " << status );
183 if (gainStrategy.empty()) gainStrategy = std::move(strategy);
184 else if (gainStrategy != strategy) consistent = false;
185 }
186 std::string newStrategy("");
187 if (runNumber == 219978) newStrategy = "GainOneOvEmecFcalLowEta";
188 if (runNumber == 219979) newStrategy = "GainOneOvEmbFcalHighEta";
189 if (runNumber == 219980) newStrategy = "CalibGainsEt";
190 if (runNumber == 220013) newStrategy = "GainOneOvEmecFcalLowEta";
191 if (runNumber == 220014) newStrategy = "GainOneOvEmbFcalHighEta";
192 if (runNumber == 220015) newStrategy = "CalibGainsEt";
193 if (runNumber == 222871) newStrategy = "GainOne";
194 if (runNumber == 222872) newStrategy = "GainOne";
195 if (runNumber == 222873) newStrategy = "GainOne";
196 if (runNumber == 223073) newStrategy = "GainOne";
197 if (runNumber == 223074) newStrategy = "GainOne";
198 if (runNumber == 223075) newStrategy = "GainOne";
199 if (not newStrategy.empty()) {
200 ATH_MSG_INFO( "Changing Gain Strategy to " << newStrategy);
201 gainStrategy = std::move(newStrategy);
202 }
203 if (!gainStrategy.empty() && consistent) {
204 m_isGain1 = (gainStrategy.find("GainOne") != std::string::npos);
205 m_isOvEmb = (gainStrategy.find("OvEmb") != std::string::npos);
206 m_isOvEmec = (gainStrategy.find("OvEmec") != std::string::npos);
207 m_isFcalLowEta = (gainStrategy.find("FcalLowEta") != std::string::npos);
208 m_isFcalHighEta = (gainStrategy.find("FcalHighEta") != std::string::npos);
209 } else if (gainStrategy == "") {
210 ATH_MSG_WARNING( "Gain Strategy collection empty" );
211 } else {
212 ATH_MSG_WARNING( "Inconsistent Gain Strategies" );
213 }
214 } else {
215 ATH_MSG_WARNING( "No Gain Strategy collection found" );
216 }
217 ATH_MSG_INFO( "isGain1 = " << m_isGain1
218 << ", isOvEmb = " << m_isOvEmb
219 << ", isOvEmec = " << m_isOvEmec
220 << ", isFcalLowEta = " << m_isFcalLowEta
221 << ", isFcalHighEta = " << m_isFcalHighEta );
222
226 m_firstEvent = false;
227 }
228 else {
229 if (tts->size() != m_nTTs) {
230 // Adding missing towers, if any
231 ATH_MSG_WARNING("Number of trigger towers changed in event " << eventInfo->eventNumber()
232 << ": old=" << m_nTTs << ", new=" << tts->size());
233
234 unsigned int nmiss = 0;
235 for(auto* tt: *tts) {
236 bool isTile = m_xAODTTTools->isTile(*tt);
237 if (this->validTower(isTile)) {
238 if (m_rampDataContainer->rampData(tt->coolId()) == nullptr) {
239 m_rampDataContainer->addRampData(tt->coolId(),L1CaloRampData());
240 nmiss++;
241 }
242 }
243 }
244 ATH_MSG_WARNING("Added " << nmiss << " missing towers");
245 m_nTTs = tts->size();
246 }
247 }
248
249 // Reading L1Calo conditions
250 SG::ReadCondHandle<L1CaloPprDisabledChannelContainerRun2> pprDisabledChannel(m_pprDisabledChannelContainer, ctx);
251 SG::ReadCondHandle<L1CaloPprChanCalibContainer> pprChanCalib( m_pprChanCalibContainer, ctx);
252
253 auto specialChannelRangeEnd = m_specialChannelRange.end();
254 bool nextStep = (m_nEvent % m_nEventsPerStep == 0);
255 for(auto *tt : *tts) {
256 // skip saturated towers
257 if(tt->isJepSaturated()) continue;
258
259 // isSaturated flag is not enough to check - test FADC for saturation, too
260 auto max = std::max_element(tt->adc().begin(), tt->adc().end());
261 if(*max >= m_fadcSaturationCut) continue;
262
263 // skip disabled channels
264 if(m_ttTool->disabledChannel(ctx, tt->coolId())) continue;
265
266 bool isTile = m_xAODTTTools->isTile(*tt);
267 if (this->validTower(isTile)) {
268 if(m_checkProvenance) checkProvenance(tt);
269 double level1Energy = getTriggerTowerEnergy(tt,pprChanCalib);
270 double caloEnergy = getCaloEnergy(tt);
271
272 // cut on 150 GeV ADC for Tile, lots of saturating calibration signals
273 if(isTile && level1Energy > m_tileSaturationCut) continue;
274
275 // see if we have a special channel and cut on level1 energy
276 auto specialChannelIt = m_specialChannelRange.find(tt->coolId());
277 if(specialChannelIt == specialChannelRangeEnd || level1Energy < specialChannelIt->second) {
278 ATH_MSG_DEBUG("Adding Energy for " << tt->coolId() << ":" << caloEnergy << " vs. " << level1Energy);
279 m_rampDataContainer->rampData(tt->coolId())->addData(caloEnergy, level1Energy);
280 } else {
281 // make sure we don't accidently miss the threshold again
282 specialChannelIt->second = -1000;
283 }
284 if(nextStep) m_rampDataContainer->rampData(tt->coolId())->nextStep();
285 }
286 }
287
288 ++m_nEvent;
289
290 return StatusCode::SUCCESS;
291}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
static Double_t sc
#define max(a, b)
Definition cfImp.cxx:41
const ServiceHandle< StoreGateSvc > & detStore() const
const_iterator end() const
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
ChanAttrListMap::const_iterator const_iterator
size_type size() const noexcept
Returns the number of elements in the collection.
void setGainStrategy(const std::string &strategy)
void addRampData(unsigned int channelId, const L1CaloRampData &rampData)
const L1CaloRampData * rampData(unsigned int channelId) const
void setRunNumber(unsigned int run)
void addData(unsigned int step, const std::pair< double, double > &energy)
ToolHandle< LVL1::IL1CaloxAODOfflineTriggerTowerTools > m_xAODTTTools
double getCaloEnergy(const xAOD::TriggerTower *tt)
ToolHandle< LVL1::IL1CaloOfflineTriggerTowerTools > m_jmTools
std::unique_ptr< L1CaloRampDataContainer > m_rampDataContainer
unsigned int m_nTTs
bool validTower(const bool &isTile)
SG::ReadHandleKey< CaloCellContainer > m_caloCellsKey
unsigned int m_nEventsPerStep
void setupRampDataContainer(const xAOD::TriggerTowerContainer *triggerTowerContainer)
double getTriggerTowerEnergy(const xAOD::TriggerTower *tt, SG::ReadCondHandle< L1CaloPprChanCalibContainer > pprCond)
void checkProvenance(const xAOD::TriggerTower *tt)
ToolHandle< LVL1::IL1TriggerTowerToolRun3 > m_ttTool
unsigned int m_nEvent
std::map< int, int > m_specialChannelRange
uint32_t runNumber() const
The current event's run number.
uint64_t eventNumber() const
The current event's event number.
status
Definition merge.py:16
EventInfo_v1 EventInfo
Definition of the latest event info version.
TriggerTowerContainer_v2 TriggerTowerContainer
Define the latest version of the TriggerTower container.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode L1CaloRampMaker::finalize ( )

Definition at line 404 of file L1CaloRampMaker.cxx.

405{
406 CHECK(detStore()->record(std::move(m_rampDataContainer), m_outputFolderName));
407
408 if(m_checkProvenance) {
409 std::ofstream bad_ofciter("bad-ofciter.txt");
410 std::map<unsigned int, std::pair<unsigned int, double> >::const_iterator it(m_mapBadOFCIteration.begin()), itE(m_mapBadOFCIteration.end());
411 for(;it != itE; ++it) {
412 bad_ofciter << "0x" << std::hex << it->first << " "
413 << std::dec << double(it->second.first) / double(m_nEvent)
414 << " " << it->second.second / double(m_nEvent) << std::endl;
415 }
416 bad_ofciter.close();
417 }
418
419 return StatusCode::SUCCESS;
420}

◆ getCaloEnergy()

double L1CaloRampMaker::getCaloEnergy ( const xAOD::TriggerTower * tt)
private

Definition at line 306 of file L1CaloRampMaker.cxx.

307{
308 double et(0.);
309 auto id = m_ttTool->identifier(tt->eta(), tt->phi(), tt->sampling());
310
311 if(m_lvl1Helper->is_fcal(id)) {
312 if(tt->sampling() == 0) { // fcal em - use decorated value
313 et = ttCellsET(*tt);
314 } else { // had
315 LVL1::TriggerTowerKey K(tt->phi(), tt->eta());
316 LVL1::TriggerTower T(tt->phi(), tt->eta(), K.ttKey(tt->phi(), tt->eta()));
317 std::vector<float> etRec = m_jmTools->hadTTCellsEtByReceiver(&T);
318 if (etRec.size() == 2) {
319 if (m_isFcalLowEta) et = etRec[1];//FCAL high and low eta receivers swapped here due to LAr baseplane misrouting
320 else if (m_isFcalHighEta) et = etRec[0];
321 else et = etRec[0] + etRec[1];
322 } else if (etRec.size() == 1) et = etRec[0];
323 }
324 } else {
325 if(m_lvl1Helper->is_barrel_end(id) && (m_isOvEmb || m_isOvEmec)) {
326 LVL1::TriggerTowerKey K(tt->phi(), tt->eta());
327 LVL1::TriggerTower T(tt->phi(), tt->eta(), K.ttKey(tt->phi(), tt->eta()));
328 std::vector<float> energyRec = m_jmTools->emTTCellsEnergyByReceiver(&T);
329 if (energyRec.size() == 2) {
330 double energy(0.);
331 if (m_isOvEmec) energy = energyRec[0];
332 else energy = energyRec[1];
333 et = energy / std::cosh(tt->eta());
334 } else et = energyRec[0] / std::cosh(tt->eta());
335 } else {
336 et = ttCellsEnergy(*tt) / std::cosh(tt->eta());
337 }
338 }
339 return et;
340}
float et(const xAOD::jFexSRJetRoI *j)
bool is_barrel_end(const Identifier id) const
Test wether given tower or layer is part of the EM barrel END.
bool is_fcal(const Identifier id) const
Test wether given tower or layer is part of the FCAL.
const CaloLVL1_ID * m_lvl1Helper
The TriggerTowerKey object provides the key for each trigger tower depending on its eta-phi coords.
Trigger towers are the inputs to all other parts of the calorimeter trigger.
unsigned long long T
Extra patterns decribing particle interation process.

◆ getTriggerTowerEnergy()

double L1CaloRampMaker::getTriggerTowerEnergy ( const xAOD::TriggerTower * tt,
SG::ReadCondHandle< L1CaloPprChanCalibContainer > pprCond )
private

Definition at line 344 of file L1CaloRampMaker.cxx.

344 {
345 // calibration is against ADC energy "(adc peak value - pedestal) / 4"
346 auto max = std::max_element(tt->adc().begin(), tt->adc().end());
347
348 if(!pprChanCalib->pprChanCalib(tt->coolId())) {
349 ATH_MSG_WARNING("Empty PPrChanCalib for 0x "
350 << std::hex << tt->coolId() << std::dec << "!");
351 return 0.;
352 }
353
354 double energy = (*max - int( pprChanCalib->pprChanCalib(tt->coolId())->pedValue())) * 0.25;
355 ATH_MSG_DEBUG("PedValue " << tt->coolId() << ":" << int( pprChanCalib->pprChanCalib(tt->coolId())->pedValue()) );
356
357
358 if (energy < 0.) energy = 0.;
359
360 // no corrections if gain is set correctly
361 if(!m_isGain1) return energy;
362
363 // correct hec and tile if gain 1
364 auto id = m_ttTool->identifier(tt->eta(), tt->phi(), tt->sampling());
365 if(m_lvl1Helper->is_hec(id)) {
366 energy /= std::cosh(tt->eta());
367 if(fabs(tt->eta()) > 2.5) {
368 energy *= 10.;
369 } else if(fabs(tt->eta()) > 1.9) {
370 energy *= 5.;
371 } else {
372 energy *= 3.125;
373 }
374 } else if(m_lvl1Helper->is_tile(id)) {
375 energy /= std::cosh(tt->eta());
376 }
377
378 return energy;
379}
bool is_tile(const Identifier id) const
Test wether given tower or layer is part of the Tile Calorimeter.
bool is_hec(const Identifier id) const
Test wether given tower or layer is part of the HEC.

◆ initialize()

StatusCode L1CaloRampMaker::initialize ( )

Definition at line 92 of file L1CaloRampMaker.cxx.

93{
94
95 CHECK(m_caloCellsKey.initialize());
96
97 const CaloIdManager *caloMgr = nullptr;
98 CHECK(detStore()->retrieve(caloMgr));
99 m_lvl1Helper = caloMgr->getLVL1_ID();
100 if(!m_lvl1Helper) {
101 ATH_MSG_FATAL( "Cannot access CaloLVL1_ID helper." );
102 return StatusCode::FAILURE;
103 }
104
105 ATH_CHECK( m_cablingKey.initialize() );
106 ATH_CHECK(m_ttTool.retrieve());
107 ATH_CHECK(m_xAODTTTools.retrieve());
108 ATH_CHECK(m_jmTools.retrieve());
109
110 ATH_CHECK( m_strategy.initialize() );
111 ATH_CHECK( m_pprDisabledChannelContainer.initialize() );
112 ATH_CHECK( m_pprChanCalibContainer.initialize() );
113
114 return StatusCode::SUCCESS;
115}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
This class initializes the Calo (LAr and Tile) offline identifiers.
const CaloLVL1_ID * getLVL1_ID(void) const
StatusCode initialize(bool used=true)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ return false; }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ setupRampDataContainer()

void L1CaloRampMaker::setupRampDataContainer ( const xAOD::TriggerTowerContainer * triggerTowerContainer)
private

Definition at line 293 of file L1CaloRampMaker.cxx.

294{
295 m_rampDataContainer.reset(new L1CaloRampDataContainer());
297 for(auto* tt: *tts) {
298 bool isTile = m_xAODTTTools->isTile(*tt);
299 if (this->validTower(isTile)) {
300 m_rampDataContainer->addRampData(tt->coolId(), rd);
301 }
302 }
303}
Container of L1CaloRampData objects.
Transient class to store the RampData calculated from calibration runs.

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

◆ validTower()

bool L1CaloRampMaker::validTower ( const bool & isTile)
private

Definition at line 400 of file L1CaloRampMaker.cxx.

400 {
401 return ((m_doLAr && !isTile) || (m_doTile && isTile));
402}

Member Data Documentation

◆ m_cablingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> L1CaloRampMaker::m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
private

Definition at line 106 of file L1CaloRampMaker.h.

106{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};

◆ m_caloCellsKey

SG::ReadHandleKey<CaloCellContainer> L1CaloRampMaker::m_caloCellsKey { this, "CaloCellsKey", "AllCalo", "CaloCellContainer key" }
private

Definition at line 107 of file L1CaloRampMaker.h.

107{ this, "CaloCellsKey", "AllCalo", "CaloCellContainer key" };

◆ m_checkProvenance

bool L1CaloRampMaker::m_checkProvenance
private

Definition at line 70 of file L1CaloRampMaker.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doLAr

bool L1CaloRampMaker::m_doLAr
private

Definition at line 63 of file L1CaloRampMaker.h.

◆ m_doTile

bool L1CaloRampMaker::m_doTile
private

Definition at line 64 of file L1CaloRampMaker.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_fadcSaturationCut

int L1CaloRampMaker::m_fadcSaturationCut
private

Definition at line 73 of file L1CaloRampMaker.h.

◆ m_firstEvent

bool L1CaloRampMaker::m_firstEvent
private

Definition at line 83 of file L1CaloRampMaker.h.

◆ m_gainStrategyFolder

std::string L1CaloRampMaker::m_gainStrategyFolder
private

Definition at line 61 of file L1CaloRampMaker.h.

◆ m_isFcalHighEta

bool L1CaloRampMaker::m_isFcalHighEta
private

Definition at line 69 of file L1CaloRampMaker.h.

◆ m_isFcalLowEta

bool L1CaloRampMaker::m_isFcalLowEta
private

Definition at line 68 of file L1CaloRampMaker.h.

◆ m_isGain1

bool L1CaloRampMaker::m_isGain1
private

Definition at line 65 of file L1CaloRampMaker.h.

◆ m_isOvEmb

bool L1CaloRampMaker::m_isOvEmb
private

Definition at line 66 of file L1CaloRampMaker.h.

◆ m_isOvEmec

bool L1CaloRampMaker::m_isOvEmec
private

Definition at line 67 of file L1CaloRampMaker.h.

◆ m_jmTools

ToolHandle<LVL1::IL1CaloOfflineTriggerTowerTools> L1CaloRampMaker::m_jmTools
private

Definition at line 79 of file L1CaloRampMaker.h.

◆ m_lvl1Helper

const CaloLVL1_ID* L1CaloRampMaker::m_lvl1Helper
private

Definition at line 86 of file L1CaloRampMaker.h.

◆ m_mapBadOFCIteration

std::map<unsigned int, std::pair<unsigned int, double> > L1CaloRampMaker::m_mapBadOFCIteration
private

Definition at line 98 of file L1CaloRampMaker.h.

◆ m_nEvent

unsigned int L1CaloRampMaker::m_nEvent
private

Definition at line 82 of file L1CaloRampMaker.h.

◆ m_nEventsPerStep

unsigned int L1CaloRampMaker::m_nEventsPerStep
private

Definition at line 71 of file L1CaloRampMaker.h.

◆ m_nSteps

unsigned int L1CaloRampMaker::m_nSteps
private

Definition at line 72 of file L1CaloRampMaker.h.

◆ m_nTTs

unsigned int L1CaloRampMaker::m_nTTs
private

Definition at line 84 of file L1CaloRampMaker.h.

◆ m_outputFolderName

std::string L1CaloRampMaker::m_outputFolderName
private

Definition at line 60 of file L1CaloRampMaker.h.

◆ m_pprChanCalibContainer

SG::ReadCondHandleKey<L1CaloPprChanCalibContainer> L1CaloRampMaker::m_pprChanCalibContainer { this, "InputKeyCond", "L1CaloPprChanCalibContainer"}
private

Definition at line 102 of file L1CaloRampMaker.h.

102{ this, "InputKeyCond", "L1CaloPprChanCalibContainer"};

◆ m_pprDisabledChannelContainer

SG::ReadCondHandleKey<L1CaloPprDisabledChannelContainerRun2> L1CaloRampMaker::m_pprDisabledChannelContainer { this, "InputKeyDisabledChannel", "L1CaloPprDisabledChannelContainerRun2"}
private

Definition at line 103 of file L1CaloRampMaker.h.

103{ this, "InputKeyDisabledChannel", "L1CaloPprDisabledChannelContainerRun2"};

◆ m_rampDataContainer

std::unique_ptr<L1CaloRampDataContainer> L1CaloRampMaker::m_rampDataContainer
private

Definition at line 88 of file L1CaloRampMaker.h.

◆ m_specialChannelRange

std::map<int, int> L1CaloRampMaker::m_specialChannelRange
private

Definition at line 62 of file L1CaloRampMaker.h.

◆ m_strategy

SG::ReadCondHandleKey<CondAttrListCollection> L1CaloRampMaker::m_strategy { this, "TRIGGER", "/TRIGGER/Receivers/Conditions/Strategy", "Strategy" }
private

Definition at line 100 of file L1CaloRampMaker.h.

100{ this, "TRIGGER", "/TRIGGER/Receivers/Conditions/Strategy", "Strategy" };

◆ m_tileSaturationCut

double L1CaloRampMaker::m_tileSaturationCut
private

Definition at line 74 of file L1CaloRampMaker.h.

◆ m_triggerTowerContainerName

std::string L1CaloRampMaker::m_triggerTowerContainerName
private

Definition at line 59 of file L1CaloRampMaker.h.

◆ m_ttTool

ToolHandle<LVL1::IL1TriggerTowerToolRun3> L1CaloRampMaker::m_ttTool
private

Definition at line 75 of file L1CaloRampMaker.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_xAODTTTools

ToolHandle<LVL1::IL1CaloxAODOfflineTriggerTowerTools> L1CaloRampMaker::m_xAODTTTools
private

Definition at line 78 of file L1CaloRampMaker.h.


The documentation for this class was generated from the following files: