|
ATLAS Offline Software
|
Go to the documentation of this file.
50 #include <CLHEP/Random/Randomize.h>
66 , m_tileToolEmscale(
"TileCondToolEmscale")
97 ATH_MSG_INFO(
"TileDigitsToTTL1 initialisation completed" );
99 return StatusCode::SUCCESS;
124 <<
", iTrig=" << iTrig
125 <<
", tileNoise=" << ((tileNoise) ?
"true" :
"false")
126 <<
", tileThresh=" << ((tileThresh) ?
"true" :
"false") );
136 ATH_CHECK( ttl1Container.
record(std::make_unique<TileTTL1Container>()) );
151 float ttAmpTotIg = 0.;
152 int minieta, maxieta, posneg;
155 std::vector<float> ttL1samples(nSamp);
188 posneg = minieta = maxieta = 0;
192 memset(ttDigit, 0,
sizeof(ttDigit));
193 std::vector<std::vector<float> > myttAmp(16);
194 for (
int ii = 0; ii < 16; ++ii)
195 myttAmp[ii].resize(nSamp);
197 nTT = nIgnore = nDigit = 0;
201 for (
const TileDigits* tile_digits : *digitsCollection) {
204 std::vector<float>
samples = tile_digits->samples();
208 if (nSamp2 != nSamp) {
210 <<
" nSamp from digits= " << nSamp2 );
218 for (
int jsamp = 0; jsamp < nSamp; ++jsamp) {
236 for (
int jsamp = 0; jsamp < nSamp; ++jsamp) {
237 myttAmp[ieta][jsamp] +=
samples[jsamp];
241 ttDigit[ieta] =
true;
242 for (
int jsamp = 0; jsamp < nSamp; ++jsamp) {
243 myttAmp[ieta][jsamp] =
samples[jsamp];
245 if (ieta >= minieta && ieta <= maxieta)
249 if (ieta < minieta || ieta > maxieta)
257 if (ieta >= minieta && ieta <= maxieta) {
276 <<
", tower=" << tower
283 if (ieta >= minieta && ieta <= maxieta)
296 nIgnoreTot += nIgnore;
301 <<
"; posneg=" << posneg
302 <<
", minieta=" << minieta
303 <<
", maxieta=" << maxieta
305 <<
", nDigit=" << nDigit
306 <<
", nIgnore=" << nIgnore );
312 for (
int ieta = minieta; ieta <= maxieta; ++ieta) {
314 bool Good = ttDigit[ieta];
323 for (
int jsamp = 0; jsamp < nSamp; ++jsamp) {
324 myttAmp[ieta][jsamp] *= ttL1Calib;
329 CLHEP::RandGauss::shootArray(nSamp, Rndm);
332 for (
int jsamp = 0; jsamp < nSamp; ++jsamp) {
333 ttL1samples[jsamp] = myttAmp[ieta][jsamp] + ttL1Ped;
335 ttL1samples[jsamp] += ttL1NoiseSigma * Rndm[jsamp];
339 if (ttL1samples[iTrig] - ttL1Ped < ttL1Thresh)
349 <<
", digitTrue=" << ttDigit[ieta]
351 <<
", amp0=" << myttAmp[ieta][iTrig]
352 <<
", digitIn=" << ttL1samples[iTrig] );
373 ttl1Container->
push_back(std::make_unique<TileTTL1>(ttId[ieta], ttL1samples));
382 <<
" nDigitTot=" << nDigitTot
383 <<
" nIgnoreTot=" << nIgnoreTot
384 <<
" ttAmpTot=" << ttAmpTot
385 <<
" ttAmpTotIg=" << ttAmpTotIg
386 <<
" =>eneTot=" << ttAmpTot + ttAmpTotIg );
388 return StatusCode::SUCCESS;
395 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
virtual ~TileDigitsToTTL1()
int NdigitSamples() const
Returns the number of sammples (digits) per event.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
SG::ReadHandleKey< TileDigitsContainer > m_digitsContainerKey
int pmt(const Identifier &id) const
TileDigitsToTTL1(const std::string &name, ISvcLocator *pSvcLocator)
int side(const Identifier &id) const
int sample(const Identifier &id) const
bool msgLvl(const MSG::Level lvl) const
int tower(const Identifier &id) const
SG::WriteHandleKey< TileTTL1Container > m_ttl1ContainerKey
#define ATH_MSG_VERBOSE(x)
bool is_valid() const
Check if id is in a valid state.
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
int phi(const Identifier id) const
return phi according to :
Handle class for recording to StoreGate.
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
int ItrigSample() const
The sample at which the pulse should ideally peak.
double TTL1NoiseSigma(const Identifier &) const
Returns the sigma (in mV) of Noise in TTL1 adcs.
::StatusCode StatusCode
StatusCode definition for legacy code.
double TTL1Ped(const Identifier &) const
Returns the pedestal (in mV) for TTL1 adcs.
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
main Tile Calibration tool
#define CHECK(...)
Evaluate an expression and check for errors.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
HWIdentifier drawer_id(int frag) const
ROS HWIdentifer.
Helpers for checking error return status codes and reporting errors.
int eta(const Identifier id) const
return eta according to :
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const CaloLVL1_ID * m_TT_ID
bool TileNoise() const
Noise switched on/off?
bool TileZeroSuppress() const
Zero suppression switched on/off?
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
Handle class for reading from StoreGate.
const TileHWID * m_tileHWID
Identifier tower_id(int pos_neg_z, int sampling, int region, int eta, int phi) const
build a tower identifier
TileFragHash::TYPE m_rChType
double TTL1Thresh(const Identifier &) const
Returns the threshold (in mV) for TTL1 adcs.
const TileInfo * m_tileInfo
double TTL1Calib(const Identifier &) const
Returns the factor which converts amplitude in pCb to mV in TTL1.