|
ATLAS Offline Software
|
Go to the documentation of this file.
25 << numberOfCounters <<
") MBTS. Provided only "
28 return StatusCode::FAILURE;
72 bool doMenuInit =
false;
77 << numberOfCounters <<
") L1 MBTS triggers. Provided only "
80 ATH_MSG_WARNING(
"Autoconfiguration of CTP ID to L1 MBTS mapping is not possible: force useTrigger=false");
106 return StatusCode::SUCCESS;
113 ATH_MSG_INFO(
"Try to autoconfigure CTP ID to L1 MBTS trigger mapping from L1 menu");
130 return StatusCode::SUCCESS;
141 const int Trig_b7(7);
143 bool physicRun = (l1TriggerType == 0) || (((l1TriggerType >> Trig_b7) & 1) == 1);
146 ATH_MSG_DEBUG(
"Calibration Event found => skip filling histograms.");
147 return StatusCode::SUCCESS;
167 ctpDecoder.
setRDO(ctpRdoContainer.
get());
173 const CTP_BC & bunch = ctpBunchCrossings[l1aBunch];
179 const std::bitset<512> currentTBP(bunch.
getTBP());
185 ++triggerMultiplicityA;
187 ++triggerMultiplicityC;
192 fill(
"TileTriggerMultiplicityMBTSA", l1aBCID, triggerMultiplicityA);
193 fill(
"TileTriggerMultiplicityMBTSC", l1aBCID, triggerMultiplicityC);
194 fill(
"TileTriggerMultiplicityPerSideMBTS", triggerMultiplicityA, triggerMultiplicityC);
197 std::vector<int> triggerCounters;
198 std::vector<int> triggerInWindowCounters;
199 std::vector<int> deltaBCIDs;
203 for (
const CTP_BC& ctpBunchCrossing : ctpBunchCrossings) {
204 bcid = ctpBunchCrossing.getBCID();
206 int deltaBCID = l1aBCID -
bcid;
208 std::vector<std::reference_wrapper<const std::bitset<512>>>
triggers;
209 triggers.push_back(ctpBunchCrossing.getTBP());
210 triggers.push_back(ctpBunchCrossing.getTAP());
211 triggers.push_back(ctpBunchCrossing.getTAV());
214 for (
const std::bitset<512>& currentTrigger :
triggers) {
216 triggerCounters.clear();
217 triggerInWindowCounters.clear();
223 triggerInWindowCounters.push_back(
counter);
226 deltaBCIDs.push_back(deltaBCID);
229 if (
bcid == l1aBCID) {
230 triggerCounters.push_back(
counter);
247 if (
bcid == l1aBCID) {
254 std::vector<int> coincidentTriggers1;
255 std::vector<int> coincidentTriggers2;
256 for (
int counter1 : triggerCounters) {
257 for (
int counter2 : triggerCounters) {
258 coincidentTriggers1.push_back(counter1);
259 coincidentTriggers2.push_back(counter2);
276 std::vector<float> energyCounters;
280 std::vector<float> energies;
284 std::vector<float> timeCounters;
287 std::vector<float>
times;
290 std::vector<float> triggerEnergies;
293 std::vector<float> triggerTimes;
296 std::vector<int> energyHitCounters;
297 std::vector<int> triggerHitCounters;
314 energyCounters.push_back(
counter);
318 energies.push_back(
energy);
320 double time =
cell->time();
323 float quality =
cell->quality();
326 <<
", energy= " <<
energy <<
" pCb"
327 <<
", time= " << time
328 <<
", quality= " << quality);
339 monEfficiency = 1.0F;
340 triggerHitCounters.push_back(
counter);
341 triggerEnergies.push_back(
energy);
342 triggerTimes.push_back(time);
353 timeCounters.push_back(
counter);
354 times.push_back(time);
356 energyHitCounters.push_back(
counter);
362 if (std::abs(time) > 10
e-4) {
376 fill(
"TileOccupancyMBTS", monHitCounter);
377 fill(
"TileEnergySummaryMBTS", monEnergyCounter, monSummaryEnergy);
379 fill(
"TileTimeSummaryMBTS", monTimeCounter, monSummaryTime);
383 fill(
"TileTriggerOccupancyMBTS", monTriggerHitCounter);
384 fill(
"TileTriggerEnergySummaryMBTS", monTriggerHitCounter, monTriggerSummaryEnergy);
385 fill(
"TileTriggerTimeSummaryMBTS", monTriggerHitCounter, monTriggerSummaryTime);
391 fill(
"TileTimeMBTSA", monTimeA);
397 fill(
"TileTimeMBTSC", monTimeC);
400 if (nHitsA > 0 && nHitsC > 0) {
401 double timeDifference = timeA - timeC;
403 fill(
"TileTimeDifferenceMBTS", monTimeDifference);
404 fill(
"TileTimeDifferenceMBTSLB",
lumiBlock, monTimeDifference);
408 std::vector<int> coincidentCounters1;
411 std::vector<int> coincidentCounters2;
414 for (
int counter1 : energyHitCounters) {
415 for (
int counter2 : energyHitCounters) {
416 coincidentCounters1.push_back(counter1);
417 coincidentCounters2.push_back(counter2);
421 fill(
"TileCoincidentHitsMBTS", monCoincidentCounters1, monCoincidentCounters2);
426 std::vector<int> counters;
475 fill(
"TileErrorsMBTS", monErrorCounters, monErrors);
486 if (digitsCollection->empty())
continue;
487 HWIdentifier adc_id = digitsCollection->front()->adc_HWID();
493 if (MBTSchannel >= 0) {
494 for (
const TileDigits* tile_digits: *digitsCollection) {
496 adc_id = tile_digits->adc_HWID();
501 double sampleMean = 0;
502 double sampleRMS = 0;
504 std::vector<float> samples = tile_digits->samples();
505 unsigned int nSamples = samples.size();
508 for (
float sample : samples) {
513 auto min_max = std::minmax_element(samples.begin(), samples.end());
514 float minSample = *min_max.first;
515 float maxSample = *min_max.second;
517 if ((maxSample - minSample) > 10) {
521 std::vector<int> sampleNumbers;
523 for (
unsigned int i = 0;
i <
nSamples; ++
i) sampleNumbers.push_back(
i);
533 sampleRMS = sampleRMS /
nSamples - sampleMean * sampleMean;
539 monPedestal = samples.front();
550 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
int checkBCIDErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has BCID mismatch between DMU and ROD Since BCID errors in the DQ fragment are det...
Group
Properties of a chain group.
std::vector< int > m_timeTrigGroups
Gaudi::Property< bool > m_useTrigger
std::string find(const std::string &s)
return a remapped string
std::vector< int > m_coinTrigGroups
bool isChanDQgood(int partition, int drawer, int ch) const
returns status of single channel (if bigain, returns AND of ADCs' status
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
const TileHWID * m_tileHWID
std::vector< int > m_trigInWinGroups
#define ATH_MSG_VERBOSE(x)
bool is_valid() const
Check if id is in a valid state.
@ u
Enums for curvilinear frames.
SG::ReadHandleKey< TileDQstatus > m_DQstatusKey
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
def timer(name, disabled=False)
int checkGlobalCRCErr(int partition, int drawer, int gain) const
returns 1 if adc channel has global CRC error
SG::ReadHandleKey< TrigConf::L1Menu > m_L1MenuKey
uint32_t getNumberOfBunches() const
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
int checkROD_CRCErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has CRC error originating in ROD
static const unsigned int MAX_DRAWER
Number of drawers in ROS 1-4.
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
const TileCablingService * m_cabling
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
static const unsigned int MAX_MBTS_COUNTER
Class that holds Data Quality fragment information and provides functions to extract the data quality...
std::vector< int > m_hfnGroups
int m_MBTScounters[Tile::MAX_ROS - 3][Tile::MAX_DRAWER]
int getMBTSCounter(Identifier mbtsID) const
void setDigiError(std::vector< int > &counters, std::vector< int > &errors, int counter, int error) const
std::vector< std::vector< int > > m_bcidGroups
std::vector< int > m_pulseGroups
::StatusCode StatusCode
StatusCode definition for legacy code.
Identifier drawer2MBTS_id(const HWIdentifier &id) const
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
static const unsigned int MBTS_DMU
void setRDO(const CTP_RDO *rdo)
Set RDO and fill internal variables from the data object.
std::vector< int > m_energyTrigLBGroups
int checkHeaderFormatErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has header word format error
std::vector< int > m_pedestalGroups
std::vector< int > m_energyLBGroups
L1 threshold configuration.
SG::ReadHandleKey< CTP_RDO > m_ctpRdoKey
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable >> &&variables) const
Fills a vector of variables to a group by reference.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
static const unsigned int MAX_ROS
Number of ROSs
std::vector< int > m_trigGroups
SG::ReadHandle< xAOD::EventInfo > GetEventInfo(const EventContext &) const
Return a ReadHandle for an EventInfo object (get run/event numbers, etc.)
int m_MBTSchannels[Tile::MAX_ROS - 3][Tile::MAX_DRAWER]
uint32_t lumiBlock() const
The current event's luminosity block number.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
std::vector< std::vector< int > > m_deltaBCIDGroups
SG::ReadHandleKey< TileDigitsContainer > m_digitsContainerKey
ToolHandleArray< GenericMonitoringTool > m_tools
Array of Generic Monitoring Tools.
HWIdentifier drawer_id(int frag) const
ROS HWIdentifer.
int checkSampleParityErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has data word parity error
std::vector< int > m_energyGroups
const std::bitset< 512 > & getTBP() const
get bitset of TBP words
SG::ReadHandleKey< TileCellContainer > m_mbtsCellContainerKey
int checkHeaderParityErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has header word parity error
std::vector< int > m_energyTrigGroups
Gaudi::Property< std::vector< float > > m_energyCut
setEventNumber setTimeStamp bcid
uint32_t getBCID() const
Get BCID as unsigned integer.
std::vector< int > m_timeGroups
int checkSampleFormatErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has data word format error
virtual StatusCode start() override
uint32_t getL1AcceptBunchPosition() const
Class describing the basic event information.
const TileTBID * m_tileTBID
virtual StatusCode initialize() override
initialize
virtual StatusCode initialize() override
initialize
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
#define ATH_MSG_WARNING(x)
Gaudi::Property< std::vector< int > > m_ctpID
std::vector< int > m_trigSumGroups
uint16_t level1TriggerType() const
The Level-1 trigger type.
int phi(const Identifier &id) const
extract phi field from MBTS identifier
std::vector< int > m_effTrigGroups
Declare a monitored scalar variable.
Handle class for reading from StoreGate.
int eta(const Identifier &id) const
extract eta field from MBTS identifier
int checkMemoryParityErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has memory parity error
int checkFE_CRCErr(int partition, int drawer, int dmu, int gain) const
returns 1 if DMU has CRC error originating in FE electronics
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
std::vector< int > m_deltaBCIDSumGroups
const std::vector< CTP_BC > & getBunchCrossings()
Get vector reference of bunch-crossing data of the current event.
const ToolHandle< GenericMonitoringTool > & getGroup(const std::string &name) const
Get a specific monitoring tool from the tool handle array.
int side(const Identifier &id) const
define synonyms for minimum bias scintillators
HWIdentifier s2h_channel_id(const Identifier &id) const
std::vector< int > m_pulseTrigGroups
Gaudi::Property< std::vector< std::string > > m_l1Triggers
Gaudi::Property< bool > m_fillHistogramsPerMBTS