15#include "CLHEP/Random/RandGaussZiggurat.h"
17#include "CLHEP/Random/Randomize.h"
68 ATH_MSG_ERROR(
"Unable to retrieve CaloIdManager from DetectorStore" );
70 return StatusCode::FAILURE;
82 return StatusCode::FAILURE;
92 return StatusCode::SUCCESS;
132 return StatusCode::FAILURE;
146 std::vector<Identifier>::const_iterator tower_it =
m_lvl1Helper->tower_begin();
172 std::vector<double> vnoise;
174 for(
unsigned int sample=0;sample<
m_nSamples;++sample) vnoise.push_back(CLHEP::RandGaussZiggurat::shoot(0.,
m_pedRMS));
178 std::vector< std::vector<double> > vAutoCorrMatrix(
m_nSamples, std::vector<double>(
m_nSamples,0));
180 for(
unsigned int sample=0;sample<
m_nSamples;++sample) vAutoCorrMatrix[sample][sample] = 1;
184 std::vector<double> vsamples;
186 for(
unsigned int sample=0;sample<
m_nSamples;++sample) {
190 for(
unsigned int jj=0;jj<
m_nSamples;++jj) noise+= vAutoCorrMatrix[sample][jj]*vnoise[jj];
206 if(bIsTile||bIsHadronic) TT->addHadAmps(vsamples);
208 else TT->addEMAmps(vsamples);
226 std::map<unsigned int, LVL1::InternalTriggerTower*>::const_iterator it =
m_IntTTContainer->begin();
230 double eta = it->second->eta();
232 double phi = it->second->phi();
234 unsigned int key = it->second->key();
238 std::vector<double> vEmAmps = it->second->EmAmps();
240 std::vector<int> emDigits(vEmAmps.size());
241 for (
size_t i = 0; i < vEmAmps.size(); i++)
242 emDigits[i] =
static_cast<int> (vEmAmps[i]);
245 std::vector<double> vHadAmps = it->second->HadAmps();
247 std::vector<int> hadDigits(vHadAmps.size());
248 for (
size_t i = 0; i < vHadAmps.size(); i++)
249 hadDigits[i] =
static_cast<int> (vHadAmps[i]);
258 std::vector<int> emEt; emEt.push_back(0);
260 std::vector<int> hadEt; hadEt.push_back(0);
262 std::vector<int> emBCID; emBCID.push_back(0);
264 std::vector<int> hadBCID; hadBCID.push_back(0);
266 std::vector<int> emExt; emExt.push_back(0);
268 std::vector<int> hadExt; hadExt.push_back(0);
282 emDigits, emEt, emExt, emBCID, 0, peak, emADCPeak,
284 hadDigits, hadEt, hadExt, hadBCID, 0, peak, hadADCPeak);
308 return StatusCode::FAILURE;
324 return StatusCode::SUCCESS;
345 return StatusCode::SUCCESS;
359 unsigned int key =
m_towerKey->ttKey(tower_phi,tower_eta);
375 std::map<unsigned int, LVL1::InternalTriggerTower*>::iterator it =
m_IntTTContainer->find( key );
387 m_IntTTContainer->insert(std::map<unsigned int, LVL1::InternalTriggerTower*>::value_type(key,TT));
405 int region = l1id->
region(
id);
407 int ieta = l1id->
eta(
id);
413 double gran[4] = {0.1, 0.2, 0.1, 0.425};
415 double offset[4] = {0., 2.5, 3.1, 3.2};
421 if (region>=0 && region<=3) {
423 eta =
sign* ( ( (ieta+0.5) * gran[region] ) + offset[region] );
445 double phiMax = l1id->
phi_max(regId);
447 int iphi = l1id->
phi(
id);
451 double phi = (iphi+0.5)*2*
M_PI/(phiMax+1);
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
DataVector< LVL1::TriggerTower > TriggerTowerCollection
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
const ServiceHandle< StoreGateSvc > & detStore() const
Helper class for offline TT identifiers.
int phi_max(const Identifier regId) const
min value of phi index (-999 == failure)
Identifier region_id(int pos_neg_z, int sampling, int region) const
build a region (of towers) identifier
int region(const Identifier id) const
return region according to :
int pos_neg_z(const Identifier id) const
return pos_neg_z according to :
int eta(const Identifier id) const
return eta according to :
int phi(const Identifier id) const
return phi according to :
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
double IDeta(const Identifier &id, const CaloLVL1_ID *l1id)
const CaloLVL1_ID * m_lvl1Helper
double IDphi(const Identifier &id, const CaloLVL1_ID *l1id)
L1CaloPedestalGenerator(const std::string &name, ISvcLocator *pSvcLocator)
virtual ~L1CaloPedestalGenerator()
virtual StatusCode finalize()
LVL1::TriggerTowerKey * m_towerKey
virtual StatusCode execute()
LVL1::InternalTriggerTower * findInternalTriggerTower(const Identifier &towerId, bool bCreate=true)
std::map< unsigned int, LVL1::InternalTriggerTower * > * m_IntTTContainer
virtual StatusCode initialize()
const CaloIdManager * m_caloMgr
A version of the TriggerTower that contains information that would not be availiable during datatakin...
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.