24#include "CaloDetDescr/CaloDetDescrElement.h"
35#include "CLHEP/Units/SystemOfUnits.h"
49 const IInterface* parent)
50 : base_class(
type, name, parent)
75 declareInterface<TileCellBuilder>(
this );
132 declareProperty(
"OF2",
m_of2 =
true);
146 declareProperty(
"TileInfoName",
m_infoName =
"TileInfo");
148 declareProperty(
"CheckDCS",
m_checkDCS =
false);
170 if (detStore()->retrieve(
m_mbtsMgr).isFailure()) {
171 ATH_MSG_WARNING(
"Unable to retrieve MbtsDetDescrManager from DetectorStore" );
226 ATH_MSG_INFO(
"TileCellBuilder initialization completed" );
233 return StatusCode::SUCCESS;
238 if (printReset)
ATH_MSG_INFO(
"Resetting options in " << name() );
249 ATH_MSG_INFO(
"none of thresholds set, all RawChannels will be converted to Cells");
269 return StatusCode::SUCCESS;
273 const EventContext& ctx)
const
283 if (!rawChannelContainer.isValid()) {
293 if (!theCellContainer->
empty()) {
295 return StatusCode::FAILURE;
302 params.m_RChType = rawChannelContainer->get_type();
303 params.m_RChUnit = rawChannelContainer->get_unit();
306 params.m_of2 =
m_of2;
307 unsigned int bsflags = rawChannelContainer->get_bsflags();
308 if (params.m_correctAmplitude || params.m_correctTime) {
309 int DataType = (bsflags & 0x30000000) >> 28;
311 bool of2 = ((bsflags & 0x4000000) != 0);
312 if (of2 != params.m_of2) {
314 ATH_MSG_WARNING(
"OF2 flag in data is " << ((params.m_of2)?
"True":
"False"));
316 params.m_maxTimeCorr = 63.9375;
317 if (params.m_correctAmplitude && ((bsflags & 0x3000000) != 0)) {
318 ATH_MSG_WARNING(
"Using results of Opt filter with interations from DSP, disabling amplitude correction" );
319 params.m_correctAmplitude =
false;
321 if (params.m_correctTime && ((bsflags & 0x3000000) == 0)) {
322 ATH_MSG_WARNING(
"Using results of Opt filter without interations from DSP, disabling time correction" );
323 params.m_correctTime =
false;
326 params.m_maxTimeCorr = ((bsflags >> 27) & 1) ? 100.0 : 75.0;
327 if (params.m_correctAmplitude && ((bsflags & 0x6000) != 0)) {
328 ATH_MSG_WARNING(
"Amplitude correction was done already in optimal filter, disabling it here" );
329 params.m_correctAmplitude =
false;
331 if (params.m_correctTime && ((bsflags & 0x9000) != 0)) {
332 ATH_MSG_WARNING(
"Time correction was done already in optimal filter or best phase is used, disabling it here" );
333 params.m_correctTime =
false;
338 std::unique_ptr<TileCellContainer> MBTSCells;
343 std::unique_ptr<TileCellContainer> E4prCells;
349 SelectAllObject<TileRawChannelContainer>::const_iterator begin = selAll.
begin();
350 SelectAllObject<TileRawChannelContainer>::const_iterator end = selAll.
end();
361 if (!dspRawChannelContainer.
isValid()) {
368 std::unique_ptr<TileMutableRawChannelContainer> copiedDspContainer;
372 <<
" (i.e. on second container only) " );
375 copiedDspContainer = std::make_unique<TileMutableRawChannelContainer> (*dspContainer);
376 ATH_CHECK( copiedDspContainer->status() );
377 dspContainer = copiedDspContainer.get();
380 ATH_CHECK( noiseFilterTool->process(*copiedDspContainer, ctx) );
386 unsigned int dspFlags = dspContainer->
get_bsflags();
387 int DataType = (dspFlags & 0x30000000) >> 28;
388 float dspTimeCut = params.m_maxTimeCorr;
389 bool dspCorrectAmplitude =
false, dspCorrectTime =
false, dspOf2 =
true;
391 dspOf2 = ((dspFlags & 0x4000000) != 0);
392 if (dspOf2 != params.m_of2)
ATH_MSG_DEBUG(
"OF2 flag in DSPcontainer is " << ((dspOf2)?
"True":
"False"));
393 dspTimeCut = 63.9375;
394 dspCorrectAmplitude = ((dspFlags & 0x3000000) == 0);
395 dspCorrectTime = ((dspFlags & 0x3000000) != 0);
397 dspTimeCut = ((dspFlags >> 27) & 1) ? 100.0 : 75.0;
401 SelectAllObject<TileRawChannelContainer>::const_iterator beginDsp = selAllDsp.
begin();
402 SelectAllObject<TileRawChannelContainer>::const_iterator endDsp = selAllDsp.
end();
404 std::vector<const TileRawChannel *> oflVec;
405 std::vector<const TileRawChannel *> dspVec;
407 SelectAllObject<TileRawChannelContainer>::const_iterator oflItr = begin;
408 SelectAllObject<TileRawChannelContainer>::const_iterator dspItr = beginDsp;
414 for (; dspItr != endDsp; ++dspItr) {
420 dspVec.push_back(p2);
421 }
else if (id2 == id1) {
422 oflVec.push_back(p1);
426 id1 = p1->adc_HWID();
433 oflVec.push_back(p1);
437 bool id2gtid1 = (id2 > id1);
438 id1 = p1->adc_HWID();
439 if (id2gtid1 && (id2 < id1)) {
440 dspVec.push_back(p2);
443 if (id2 == id1) ++dspItr;
447 if (id2 >= id1)
break;
451 for (; oflItr != end; ++oflItr) {
452 oflVec.push_back(*oflItr);
455 for (; dspItr != endDsp; ++dspItr) {
456 dspVec.push_back(*dspItr);
466 params2.
m_of2 = dspOf2;
472 &dspVec, params2, 0);
476 &dspVec, params2, 2);
479 <<
" offline vector size = " << oflVec.size()
480 <<
", dsp vector size = " << dspVec.size() );
482 build (ctx, drawerEvtStatus, params, vecBeg, vecEnd, theCellContainer,
483 MBTSCells.get(), E4prCells.get());
491 std::unique_ptr<TileMutableRawChannelContainer> copiedContainer;
492 std::unique_ptr<SelectAllObject<TileRawChannelContainer> > selCopied;
497 copiedContainer = std::make_unique<TileMutableRawChannelContainer> (*rawChannelContainer);
502 ATH_CHECK( noiseFilterTool->process(*copiedContainer, ctx) );
505 selCopied = std::make_unique<SelectAllObject<TileRawChannelContainer> > (copiedContainer.get());
506 begin = selCopied->begin();
507 end = selCopied->end();
511 build (ctx, drawerEvtStatus, params, begin, end, theCellContainer,
512 MBTSCells.get(), E4prCells.get());
545 unsigned int flag = 0;
547 int drConsecMaxMax = 0;
550 for (
int p = 1; p < 5; ++p) {
561 for (
int d = 0; d < 64; ++d) {
562 if (evt[d].nChannels == 0) {
566 }
else if (evt[d].nMaskedChannels >= evt[d].nChannels) {
571 if (drConsec > drConsecMax) {
572 drConsecMax = drConsec;
573 if (drConsecMax > drConsecMaxMax) {
574 drConsecMaxMax = drConsecMax;
575 drConsecNum = ((p - 1) << 6) | (d - drConsec);
579 if (evt[d].nMaskedChannels > 0) {
582 if (evt[d].nBadQuality) ++hasBadQ;
583 if (evt[d].nOverflow) ++hasOver;
584 if (evt[d].nUnderflow) ++hasUnder;
585 if (evt[d].nSomeSignal) ++hasSig;
588 if (drConsec != 0 && drConsecMax < 64) {
589 for (
int d = 0; d < drConsecMax; ++d) {
590 if (evt[d].nChannels == 0 || evt[d].nMaskedChannels >= evt[d].nChannels) {
596 if (drConsec > drConsecMax) {
597 drConsecMax = drConsec;
610 if (hasBadQ > 15) fl |= 0x00001000;
611 if (hasOver) fl |= 0x00000100;
612 if (hasUnder) fl |= 0x00000010;
613 if (hasSig) fl |= 0x00000001;
615#ifdef ALLOW_DEBUG_COUT
616 std::cout<<
"partition "<<p<<
" drAbsent "<<drAbsent<<
" drMasked "<<drMasked<<
" drConsec "<<drConsecMax
617 <<
" hasBadQ "<<hasBadQ<<
" hasOver "<<hasOver<<
" hasUnder "<<hasUnder<<
" hasSig "<<hasSig<<std::endl;
619 flag |= fl << (p - 1);
623 flag |= (std::min(15, drConsecMaxMax) << 16);
630 flag |= (drConsecNum << 20);
631#ifdef ALLOW_DEBUG_COUT
632 std::cout<<
"warning in partition " << (drConsecNum>>6)+1 <<
" for modules "
633 <<(drConsecNum)%64 <<
" - " <<(drConsecNum+drConsecMaxMax-1)%64 <<std::endl;
637#ifdef ALLOW_DEBUG_COUT
638 std::cout<<
"partition flag 0x0"<<std::hex<<flag<<std::dec<<
" error "<<
error<<std::endl;
651 ATH_MSG_DEBUG(
" set eventInfo for Tile for this event to 0x" << MSG::hex << flag << MSG::dec );
666 ATH_MSG_WARNING(
" cannot retrieve EventInfo, will not set Tile information " );
672 return StatusCode::SUCCESS;
677 ,
float ener,
float time,
unsigned char iqual,
unsigned char qbit,
int ch_type)
const {
685#ifdef ALLOW_DEBUG_COUT
686 std::cout <<
"channel with negative energy " << ener <<
" => setting quality to 255" << std::endl;
691 switch (correction) {
717 ++drawerEvtStatus[ros][drawer].nChannels;
720 if (overflow) ++drawerEvtStatus[ros][drawer].nOverflow;
721 if (underflow) ++drawerEvtStatus[ros][drawer].nUnderflow;
723#ifdef ALLOW_DEBUG_COUT
724 if (overflow) std::cout <<
"channel with overflow " << ((count_over)?
"":
"MBTS") << std::endl;
725 if (underflow) std::cout <<
"channel with underflow " << ((count_over)?
"":
"MBTS") << std::endl;
726 if (overfit) std::cout <<
"channel with corrected overflow " << ((count_over)?
"":
"MBTS") << std::endl;
737 ++drawerEvtStatus[ros][drawer].nSomeSignal;
759 ++drawerEvtStatus[ros][drawer].nBadQuality;
768 || (dcsState ? dcsState->
isStatusBad(ros, drawer, chan) :
false);
774 ++drawerEvtStatus[ros][drawer].nMaskedChannels;
806 bool single_PMT_C10 =
false;
813 int gain1 = pCell->
gain1();
827 ++drawerEvtStatus[ros1][drawer1].nBadQuality;
831 bad1 = (gain1 < 0) || chStatus1.
isBad();
835 bad1 = !(DQstatus->
isAdcDQgood(ros1, drawer1, chan1, gain1))
836 || (dcsState ? dcsState->
isStatusBad(ros1, drawer1, chan1) :
false);
845 ++drawerEvtStatus[ros1][drawer1].nMaskedChannels;
866 int gain2 = pCell->
gain2();
880 ++drawerEvtStatus[ros2][drawer2].nBadQuality;
884 bad2 = (gain2 < 0) || chStatus2.
isBad();
888 bad2 = !(DQstatus->
isAdcDQgood(ros2, drawer2, chan2, gain2))
889 || (dcsState ? dcsState->
isStatusBad(ros2, drawer2, chan2) :
false);
896 if (single_PMT_C10) {
902#ifdef ALLOW_DEBUG_COUT
906 << drawer2+1 <<
" status " << chan1 <<
"/" << chan2 <<
" "
907 << (chStatus1.
isBad()?
"bad":
"good") <<
"/"
908 << (chStatus2.
isBad()?
"bad":
"good") <<
"/"
909 << ((
m_run2plus)?
" RUN2+ cabling":
"RUN1 cabling")
915#ifdef ALLOW_DEBUG_COUT
917 std::cout <<
"Ene of chan1 was " << pCell->
ene1() <<
" changing to half of " << pCell->
ene2()
918 <<
" and setting bad1=true" << std::endl;
924 --drawerEvtStatus[ros1][drawer1].nMaskedChannels;
928#ifdef ALLOW_DEBUG_COUT
930 std::cout <<
"Ene of chan2 was " << pCell->
ene2() <<
" changing to half of " << pCell->
ene1()
931 <<
" and setting bad2=true" << std::endl;
937 --drawerEvtStatus[ros2][drawer2].nMaskedChannels;
943 ++drawerEvtStatus[ros1][drawer1].nMaskedChannels;
944 ++drawerEvtStatus[ros2][drawer2].nMaskedChannels;
959 }
else if (bad1 && !bad2) {
961 ++drawerEvtStatus[ros1][drawer1].nMaskedChannels;
963 float ene2 = pCell->
ene2();
964 pCell->
setEnergy(ene2, ene2, gain2, gain2);
967 uint8_t qual2 = pCell->
qual2();
968 uint8_t qual1 = qual2 + qualCorrection;
969 if (qual1 >
m_qualityCut && gain1 > gain2) qual1 = qual2 - qualCorrection;
984 }
else if (!bad1 && bad2) {
986 ++drawerEvtStatus[ros2][drawer2].nMaskedChannels;
988 float ene1 = pCell->
ene1();
989 pCell->
setEnergy(ene1, ene1, gain1, gain1);
992 uint8_t qual1 = pCell->
qual1();
993 uint8_t qual2 = qual1 + qualCorrection;
994 if (qual2 >
m_qualityCut && gain2 > gain1) qual2 = qual1 - qualCorrection;
1033 return single_PMT_C10;
1037template<
class ITERATOR,
class COLLECTION>
1041 const ITERATOR & begin,
1042 const ITERATOR & end,
1065 float eCellTot = 0.0;
1066 float eMBTSTot = 0.0;
1067 float eE4prTot = 0.0;
1068 bool EBdrawerPresent[128];
1069 memset(EBdrawerPresent, 0,
sizeof(EBdrawerPresent));
1076 std::vector<TileCell*> allCells (
m_tileID->cell_hash_max(),
nullptr);
1078 for (ITERATOR rawItr = begin; rawItr != end; ++rawItr) {
1091 if (channel == 0 && ros > 2) EBdrawerPresent[(ros - 3) * 64 + drawer] =
true;
1100 amp = emScale->undoOnlineChannelCalibration(drawerIdx, channel, gain, amp, params.m_RChUnit);
1109 ATH_MSG_ERROR(
"Units in raw channel container is " << params.m_RChUnit );
1110 ATH_MSG_ERROR(
"But amplitude correction works only with ADC counts " );
1111 ATH_MSG_ERROR(
"Please, disable CIS calibration in optimal filter " );
1115 float qual = pChannel->
quality();
1118 bool good_time = (fabs(time) < params.m_maxTimeCorr);
1120 ? ((qual > 2.99 && qual < 4.01))
1129 bool overflow =
false;
1130 bool underflow =
false;
1131 bool overfit =
false;
1135 }
else if (ped > 39500.) {
1158 if (params.m_correctTime && good_time && non_zero_time)
1161 time = pChannel->
time();
1167 int channel1 = channel;
1170 int pmt2channel[48] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,
1171 26,25,24,29,31,32,27,28,30,35,34,33,38,37,43,44,41,40,39,36,42,47,46,45};
1172 channel1 = pmt2channel[channel];
1175 && (ros == 2 && (drawer == 1 || drawer>2)) ) {
1176 int pmt2channel[48] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,
1177 26,25,24,29,28,27,32,31,30,35,34,33,38,37,36,41,40,39,44,43,42,47,46,45};
1178 channel1 = pmt2channel[channel];
1180 && (ros == 4 && drawer>=2) ) {
1181 int pmt2channelEB[48] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,
1182 31,32,30,35, 33,34, 38,37,41,40,39,36, 26,25,24,29,28,27, 44,43,42,47,46,45};
1183 channel1 = pmt2channelEB[channel];
1194 float ener = emScale->calibrateChannel(drawerIdx, channel, gain, amp, oldUnit
1198 unsigned char iqual =
iquality(qual);
1200 unsigned char qbit =
qbits(drawerEvtStatus, params.m_RChType,
1202 , overflow, underflow, overfit);
1210 pCell->
set(NULL, cell_id);
1218 if (msgLvl(MSG::VERBOSE)) {
1219 msg(MSG::VERBOSE) <<
" E4' cell_id=" <<
m_tileTBID->to_string(cell_id)
1220 <<
" adc_id=" <<
m_tileHWID->to_string(adc_id)
1223 <<
" time= " << time
1224 <<
" qual= " << pChannel->
quality()
1225 <<
" iqual= " << (int) iqual
1226 <<
" qbit = 0x" << MSG::hex << (
int) qbit << MSG::dec;
1235 *badChannels, pCell, adc_id))
1237 <<
" bad channel masked, new energy=" << pCell->
energy() );
1243 }
else if (
index == -2) {
1249 float ener = emScale->calibrateChannel(drawerIdx, channel, gain, amp , oldUnit
1253 unsigned char iqual =
iquality(qual);
1255 unsigned char qbit =
qbits(drawerEvtStatus, params.m_RChType,
1256 ros, drawer,
false, (good_time && non_zero_time),
1274 if (msgLvl(MSG::VERBOSE)) {
1275 msg(MSG::VERBOSE) <<
" MBTS cell_id=" <<
m_tileTBID->to_string(cell_id)
1276 <<
" adc_id=" <<
m_tileHWID->to_string(adc_id)
1279 <<
" time= " << time
1280 <<
" qual= " << pChannel->
quality()
1281 <<
" iqual= " << (int) iqual
1282 <<
" qbit = 0x" << MSG::hex << (
int) qbit << MSG::dec;
1291 *badChannels, pCell, adc_id))
1293 <<
" bad channel masked, new energy=" << pCell->
energy() );
1298 }
else if (
index != -1) {
1300 float ener = emScale->calibrateChannel(drawerIdx, channel, gain, amp
1305 unsigned char iqual =
iquality(qual);
1307 unsigned char qbit =
qbits(drawerEvtStatus, params.m_RChType,
1309 , overflow, underflow, overfit);
1314 int drawer2 =
m_cabling->E1_merged_with_run2plus(ros,drawer);
1316 int side = (ros == 3) ? 1 : -1;
1318 int index2 =
m_tileID->cell_hash(cell_id2);
1321 allCells[index2] = pCell2;
1323 pCell2->
set(dde2, cell_id2);
1327 correctCell(pCell2, 1, pmt2, gain, ener, time, iqual, qbit, 1);
1330 <<
" splitted into " <<
m_tileID->to_string(cell_id2));
1340 correctCell(pCell, 2, pmt, gain, ener, time, iqual, qbit, 0);
1345 pCell->
set(dde, cell_id);
1348 correctCell(pCell, 1, pmt, gain, ener, time, iqual, qbit, ch_type);
1351 if (msgLvl(MSG::VERBOSE)) {
1352 float calib1 = (amp != 0) ? ener / amp : 0.0;
1353 msg(MSG::VERBOSE) <<
" cell_id=" <<
m_tileID->to_string(cell_id, -2)
1354 <<
" adc_id=" <<
m_tileHWID->to_string(adc_id)
1355 <<
" calib=" << calib1
1356 <<
" nCell=" << nCell
1357 <<
" energy=" << ener <<
" (" << pCell->
energy() <<
", " << pCell->
eneDiff() <<
")" <<
endmsg;
1359 msg(MSG::VERBOSE) <<
" amp= " << amp
1360 <<
" time= " << time
1361 <<
" qual= " << pChannel->
quality()
1362 <<
" iqual= " << (int) iqual
1363 <<
" qbit = 0x" << MSG::hex << (
int) qbit << MSG::dec;
1373 if (msgLvl(MSG::VERBOSE)) {
1375 unsigned char iqual =
iquality(qual);
1376 unsigned char qbit =
qbits(drawerEvtStatus, params.m_RChType,
1377 0, drawer,
false, non_zero_time,
false, overflow, underflow, overfit);
1379 msg(MSG::VERBOSE) <<
" channel with adc_id=" <<
m_tileHWID->to_string(adc_id)
1380 <<
" is not connected" <<
endmsg;
1382 msg(MSG::VERBOSE) <<
" amp= " << amp
1383 <<
" time= " << time
1384 <<
" qual= " << pChannel->
quality()
1385 <<
" iqual= " << (int) iqual
1386 <<
" qbit = 0x" << MSG::hex << (
int) qbit << MSG::dec;
1394 if (msgLvl(MSG::VERBOSE)) {
1395 if ((params.m_correctTime && good_time && non_zero_time) || pChannel->
sizeTime() > 1) {
1396 msg(MSG::VERBOSE) <<
" OF_time = " << pChannel->
uncorrTime()
1397 <<
" corr_time = " << time <<
endmsg;
1412 if (
maskBadChannels (drawerEvtStatus, DQstatus, dcsState, *badChannels, pCell))
1414 <<
" bad channels masked, new energy=" << pCell->
energy() );
1424 coll->push_back(pCell);
1432 allCells[
index] = 0;
1442 if (EBdrawerPresent[ind]) {
1456 <<
" ene=" << pCell->
energy()
1457 <<
" status=" << (pCell->
badcell() ?
"bad" :
"good") );
1459 coll->push_back(pCell);
1465 if (msgLvl(MSG::DEBUG)) {
1466 msg(MSG::DEBUG) <<
" nChan=" << nChan
1467 <<
" RawChSum=" << eCh
1468 <<
" nCell=" << nCell
1470 <<
" nFake=" << nFake
1471 <<
" eneTot=" << eCellTot;
1474 msg(MSG::DEBUG) <<
" nMBTS=" << nMBTS
1475 <<
" eMBTS=" << eMBTSTot;
1477 msg(MSG::DEBUG) <<
" nE4pr=" << nE4pr
1478 <<
" eE4pr=" << eE4prTot;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
Helpers for checking error return status codes and reporting errors.
SelectAllObjectMT< DCC, OBJECT > SelectAllObject
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
static const InterfaceID IID_ITileCellBuilder("TileCellBuilder", 1, 0)
TileContainer< TileCell > TileCellContainer
Information produced by TileDQstatusAlg (used to be done by TileBeamInfoProvider).
Helper for holding non-const raw data prior to recording in SG.
Container class for CaloCell.
void setHasCalo(const CaloCell_ID::SUBCALO caloNum)
set which calo has been filled.
CaloCell_Base_ID::SUBCALO SUBCALO
double energy() const
get energy (data member)
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
void set(const CaloDetDescrElement *caloDDE, const Identifier &ID)
Fast method to change the identity of a cell.
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
This class groups all DetDescr information related to a CaloCell.
Identifier identify() const override final
cell identifier
IdentifierHash onl2() const
cell online identifier 2
IdentifierHash onl1() const
cell online identifier 1
a typed memory pool that saves time spent allocation small object.
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
value_type push_back(value_type pElem)
SG::OwnershipPolicy ownPolicy() const
Return the ownership policy setting for this container.
void clear()
Erase all the elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
This is a "hash" representation of an Identifier.
const_pointer_type cptr()
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Condition object to keep Tile channel and ADC status.
const TileBchStatus & getAdcStatus(const HWIdentifier adc_id) const
Return Tile ADC status.
Class holding bad channel problems.
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
ToolHandle< TileCondToolTiming > m_tileToolTiming
const TileDetDescrManager * m_tileMgr
Pointer to TileDetDescrManager.
SG::ReadHandleKey< TileRawChannelContainer > m_dspRawChannelContainerKey
int m_qualityCut
cut on channel quality (set energy to m_zeroEnergy for them)
virtual ~TileCellBuilder()
Destructor.
float m_timeMaxThresh
correct amplitude is time is below time max threshold
TileDrawerEvtStatus TileDrawerEvtStatusArray[5][64]
status of every drawer
SG::ReadHandleKey< TileDQstatus > m_DQstatusKey
const TileTBID * m_tileTBID
Pointer to TileTBID.
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
float m_timeMinThresh
correct amplitude is time is above time min threshold
void reset(bool fullSizeCont, bool printReset=true)
Method to reset the options of the TileCellContainer.
TileCellBuilder(const std::string &type, const std::string &name, const IInterface *parent)
Contructor.
SG::WriteDecorHandleKey< xAOD::EventInfo > m_EventInfoTileStatusKey
bool maskBadChannel(TileDrawerEvtStatusArray &drawerEvtStatus, const TileDQstatus *DQstatus, const TileDCSState *dcsState, const TileBadChannels *badChannels, TileCell *pCell, HWIdentifier hwid) const
method to check if channels are good or bad.
bool m_mergeChannels
If true, missing raw channels are taken from DSP container.
SG::ReadHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
const MbtsDetDescrManager * m_mbtsMgr
Pointer to MbtsDetDescrManager.
const TileInfo * m_tileInfo
bool m_fakeCrackCells
if true=> fake E3/E4 cells added
bool maskBadChannels(TileDrawerEvtStatusArray &drawerEvtStatus, const TileDQstatus *DQstatus, const TileDCSState *dcsState, const TileBadChannels *badChannels, TileCell *pCell) const
unsigned char iquality(float qual) const
bool m_thresholdNotSet
bool variable to check whether some threshold have been set
SG::ReadCondHandleKey< TileDCSState > m_DCSStateKey
Name of TileDCSState object in condition store.
bool m_of2
If true, assume OF2 method for amplitude correction, otherwise - OF1.
float m_ADCmaskValuePlusEps
const TileCablingService * m_cabling
TileCabling instance.
int m_skipGain
for two-gain calib runs skip one of two gains
float m_eneForTimeCut
keep time for channels with energy above cut
unsigned char qbits(TileDrawerEvtStatusArray &drawerEvtStatus, TileFragHash::TYPE RChType, int ros, int drawer, bool count_over, bool good_time, bool good_ener, bool overflow, bool underflow, bool good_overflowfit) const
method to compute the cell quality bits
const TileHWID * m_tileHWID
Pointer to TileHWID.
virtual StatusCode process(CaloCellContainer *theCellContainer, const EventContext &ctx) const override
method to process all raw channels and store them in container
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
Name of TileEMScale in condition store.
SG::WriteHandleKey< TileCellContainer > m_E4prContainerKey
float m_minEneChan[3]
channel energy thresholds for masking (normal,gap,mbts)
SG::WriteHandleKey< TileCellContainer > m_MBTSContainerKey
void correctCell(TileCell *pCell, int correction, int pmt, int gain, float ener, float time, unsigned char iqual, unsigned char qbit, int ch_type) const
Compute calibrated energy, time, etc.
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
static const InterfaceID & interfaceID()
SG::ReadCondHandleKey< TileBadChannels > m_badChannelsKey
Name of TileBadChannels in condition store.
float m_zeroEnergy
energy to store in every PMT if both PMT are bad
float m_maxChi2
maximum chi2 for the PMTs in the cels
ToolHandleArray< ITileRawChannelTool > m_noiseFilterTools
void build(const EventContext &ctx, TileDrawerEvtStatusArray &drawerEvtStatus, VecParams ¶ms, const ITERATOR &begin, const ITERATOR &end, COLLECTION *coll, TileCellContainer *MBTSCells, TileCellContainer *E4prCells) const
< method to process raw channels from a given vector and store them in collection
bool m_correctTime
should time be corrected (deltat added from CondDB)
float m_eneForTimeCutMBTS
similar cut for MBTS in pC
virtual StatusCode finalize() override
bool m_correctAmplitude
If true, amplitude is corrected by parabolic function (needed for OF without iterations).
float m_minTime
minimum time for the PMTs in the cels
float m_ampMinThresh
correct amplitude if it's above amplitude threshold (in ADC counts)
bool m_maskBadChannels
if true=> bad channels are masked
float m_maxTimeDiff
maximum time difference between the PMTs in the cell
float m_ADCmaskValueMinusEps
float m_maxTime
maximum time for the PMTs in the cels
const TileID * m_tileID
Pointer to TileID.
float m_minChi2
minimum chi2 for the PMTs in the cels
virtual StatusCode initialize() override
Initializer.
float m_eThreshold
cell energy threshold to consider the cell
uint8_t qual1(void) const
get quality of first PMT (data member)
void addEnergy(float e, int pmt, int gain)
set energy and gain for one PMT
float time1(void) const
get time of first PMT
void setEnergy_nonvirt(float e1, float e2, int gain1, int gain2)
void setQual2(unsigned char qual)
set quality of second PMT
virtual bool badcell(void) const override final
check if whole cell is bad (i.e.
void setTime_nonvirt(float t)
float eneDiff(void) const
all get methods
virtual void setEnergy(float ene) override final
set total energy, reset eneDiff to zero (final override of CaloCell method)
int gain2(void) const
get gain of second PMT
uint8_t qbit2(void) const
get quality bits of second PMT (data member)
int gain1(void) const
get gain of first PMT
uint8_t qual2(void) const
get quality of second PMT (data member)
void setQbit1(unsigned char qbit)
set quality bits of first PMT
void setQbit2(unsigned char qbit)
set quality bits of second PMT
void setQuality(unsigned char qual, unsigned char qbit, int pmt)
set quality value and quality bits for one PMT (TileCell specific overloads)
void setQual1(unsigned char qual)
set quality of first PMT
float ene1(void) const
get energy of first PMT
virtual void setTime(float t) override final
set cell time, reset timeDiff
float timeDiff(void) const
get time diff for two PMTs (data member)
float time2(void) const
get time of second PMT
uint8_t qbit1(void) const
get quality bits of first PMT (data member)
float ene2(void) const
get energy of second PMT
Condition object to keep Tile DCS status from DB.
bool isStatusBad(unsigned int ros, unsigned int drawer) const
Return true if given Tile drawer considered as bad by summary drawer states per LVPS otherwise return...
Class that holds Data Quality fragment information and provides functions to extract the data quality...
bool isAdcDQgood(int partition, int drawer, int ch, int gain) const
returns status of single ADC returns False if there are any errors
This class keep detailed status info about one drawer in a given event.
static const char * BadPatternName(float ped)
static double correctAmp(double phase, bool of2=true)
Amplitude correction factor according to the time when using weights for tau=0 without iterations.
float pedestal(void) const
float time(int ind=0) const
float quality(int ind=0) const
float amplitude(int ind=0) const
uint32_t get_bsflags() const
HWIdentifier adc_HWID(void) const
@ Tile
The Tile calorimeter.
EventFlagErrorState
States that a given sub-detector could be in.
@ Warning
The sub-detector issued a warning.
@ NotSet
The flag was not set to anything.
@ Error
The sub-detector issued an error.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
TileFragHash::TYPE m_RChType
TileRawChannelUnit::UNIT m_RChUnit