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 params.m_RChType = rawChannelContainer->get_type();
294 params.m_RChUnit = rawChannelContainer->get_unit();
297 params.m_of2 =
m_of2;
298 unsigned int bsflags = rawChannelContainer->get_bsflags();
299 if (params.m_correctAmplitude || params.m_correctTime) {
300 int DataType = (bsflags & 0x30000000) >> 28;
302 bool of2 = ((bsflags & 0x4000000) != 0);
303 if (of2 != params.m_of2) {
305 ATH_MSG_WARNING(
"OF2 flag in data is " << ((params.m_of2)?
"True":
"False"));
307 params.m_maxTimeCorr = 63.9375;
308 if (params.m_correctAmplitude && ((bsflags & 0x3000000) != 0)) {
309 ATH_MSG_WARNING(
"Using results of Opt filter with interations from DSP, disabling amplitude correction" );
310 params.m_correctAmplitude =
false;
312 if (params.m_correctTime && ((bsflags & 0x3000000) == 0)) {
313 ATH_MSG_WARNING(
"Using results of Opt filter without interations from DSP, disabling time correction" );
314 params.m_correctTime =
false;
317 params.m_maxTimeCorr = ((bsflags >> 27) & 1) ? 100.0 : 75.0;
318 if (params.m_correctAmplitude && ((bsflags & 0x6000) != 0)) {
319 ATH_MSG_WARNING(
"Amplitude correction was done already in optimal filter, disabling it here" );
320 params.m_correctAmplitude =
false;
322 if (params.m_correctTime && ((bsflags & 0x9000) != 0)) {
323 ATH_MSG_WARNING(
"Time correction was done already in optimal filter or best phase is used, disabling it here" );
324 params.m_correctTime =
false;
329 std::unique_ptr<TileCellContainer> MBTSCells;
334 std::unique_ptr<TileCellContainer> E4prCells;
340 SelectAllObject<TileRawChannelContainer>::const_iterator begin = selAll.
begin();
341 SelectAllObject<TileRawChannelContainer>::const_iterator end = selAll.
end();
352 if (!dspRawChannelContainer.
isValid()) {
359 std::unique_ptr<TileMutableRawChannelContainer> copiedDspContainer;
363 <<
" (i.e. on second container only) " );
366 copiedDspContainer = std::make_unique<TileMutableRawChannelContainer> (*dspContainer);
367 ATH_CHECK( copiedDspContainer->status() );
368 dspContainer = copiedDspContainer.get();
371 ATH_CHECK( noiseFilterTool->process(*copiedDspContainer, ctx) );
377 unsigned int dspFlags = dspContainer->
get_bsflags();
378 int DataType = (dspFlags & 0x30000000) >> 28;
379 float dspTimeCut = params.m_maxTimeCorr;
380 bool dspCorrectAmplitude =
false, dspCorrectTime =
false, dspOf2 =
true;
382 dspOf2 = ((dspFlags & 0x4000000) != 0);
383 if (dspOf2 != params.m_of2)
ATH_MSG_DEBUG(
"OF2 flag in DSPcontainer is " << ((dspOf2)?
"True":
"False"));
384 dspTimeCut = 63.9375;
385 dspCorrectAmplitude = ((dspFlags & 0x3000000) == 0);
386 dspCorrectTime = ((dspFlags & 0x3000000) != 0);
388 dspTimeCut = ((dspFlags >> 27) & 1) ? 100.0 : 75.0;
392 SelectAllObject<TileRawChannelContainer>::const_iterator beginDsp = selAllDsp.
begin();
393 SelectAllObject<TileRawChannelContainer>::const_iterator endDsp = selAllDsp.
end();
395 std::vector<const TileRawChannel *> oflVec;
396 std::vector<const TileRawChannel *> dspVec;
398 SelectAllObject<TileRawChannelContainer>::const_iterator oflItr = begin;
399 SelectAllObject<TileRawChannelContainer>::const_iterator dspItr = beginDsp;
405 for (; dspItr != endDsp; ++dspItr) {
411 dspVec.push_back(p2);
412 }
else if (
id2 == id1) {
413 oflVec.push_back(p1);
417 id1 = p1->adc_HWID();
424 oflVec.push_back(p1);
428 bool id2gtid1 = (
id2 > id1);
429 id1 = p1->adc_HWID();
430 if (id2gtid1 && (
id2 < id1)) {
431 dspVec.push_back(p2);
434 if (
id2 == id1) ++dspItr;
438 if (
id2 >= id1)
break;
442 for (; oflItr != end; ++oflItr) {
443 oflVec.push_back(*oflItr);
446 for (; dspItr != endDsp; ++dspItr) {
447 dspVec.push_back(*dspItr);
457 params2.
m_of2 = dspOf2;
463 &dspVec, params2, 0);
467 &dspVec, params2, 2);
470 <<
" offline vector size = " << oflVec.size()
471 <<
", dsp vector size = " << dspVec.size() );
473 build (ctx, drawerEvtStatus, params, vecBeg, vecEnd, theCellContainer,
474 MBTSCells.get(), E4prCells.get());
482 std::unique_ptr<TileMutableRawChannelContainer> copiedContainer;
483 std::unique_ptr<SelectAllObject<TileRawChannelContainer> > selCopied;
488 copiedContainer = std::make_unique<TileMutableRawChannelContainer> (*rawChannelContainer);
493 ATH_CHECK( noiseFilterTool->process(*copiedContainer, ctx) );
496 selCopied = std::make_unique<SelectAllObject<TileRawChannelContainer> > (copiedContainer.get());
497 begin = selCopied->begin();
498 end = selCopied->end();
502 build (ctx, drawerEvtStatus, params, begin, end, theCellContainer,
503 MBTSCells.get(), E4prCells.get());
536 unsigned int flag = 0;
538 int drConsecMaxMax = 0;
541 for (
int p = 1; p < 5; ++p) {
552 for (
int d = 0; d < 64; ++d) {
553 if (evt[d].nChannels == 0) {
557 }
else if (evt[d].nMaskedChannels >= evt[d].nChannels) {
562 if (drConsec > drConsecMax) {
563 drConsecMax = drConsec;
564 if (drConsecMax > drConsecMaxMax) {
565 drConsecMaxMax = drConsecMax;
566 drConsecNum = ((p - 1) << 6) | (d - drConsec);
570 if (evt[d].nMaskedChannels > 0) {
573 if (evt[d].nBadQuality) ++hasBadQ;
574 if (evt[d].nOverflow) ++hasOver;
575 if (evt[d].nUnderflow) ++hasUnder;
576 if (evt[d].nSomeSignal) ++hasSig;
579 if (drConsec != 0 && drConsecMax < 64) {
580 for (
int d = 0; d < drConsecMax; ++d) {
581 if (evt[d].nChannels == 0 || evt[d].nMaskedChannels >= evt[d].nChannels) {
587 if (drConsec > drConsecMax) {
588 drConsecMax = drConsec;
601 if (hasBadQ > 15) fl |= 0x00001000;
602 if (hasOver) fl |= 0x00000100;
603 if (hasUnder) fl |= 0x00000010;
604 if (hasSig) fl |= 0x00000001;
606#ifdef ALLOW_DEBUG_COUT
607 std::cout<<
"partition "<<p<<
" drAbsent "<<drAbsent<<
" drMasked "<<drMasked<<
" drConsec "<<drConsecMax
608 <<
" hasBadQ "<<hasBadQ<<
" hasOver "<<hasOver<<
" hasUnder "<<hasUnder<<
" hasSig "<<hasSig<<std::endl;
610 flag |= fl << (p - 1);
614 flag |= (std::min(15, drConsecMaxMax) << 16);
621 flag |= (drConsecNum << 20);
622#ifdef ALLOW_DEBUG_COUT
623 std::cout<<
"warning in partition " << (drConsecNum>>6)+1 <<
" for modules "
624 <<(drConsecNum)%64 <<
" - " <<(drConsecNum+drConsecMaxMax-1)%64 <<std::endl;
628#ifdef ALLOW_DEBUG_COUT
629 std::cout<<
"partition flag 0x0"<<std::hex<<flag<<std::dec<<
" error "<<
error<<std::endl;
642 ATH_MSG_DEBUG(
" set eventInfo for Tile for this event to 0x" << MSG::hex << flag << MSG::dec );
657 ATH_MSG_WARNING(
" cannot retrieve EventInfo, will not set Tile information " );
663 return StatusCode::SUCCESS;
668 ,
float ener,
float time,
unsigned char iqual,
unsigned char qbit,
int ch_type)
const {
676#ifdef ALLOW_DEBUG_COUT
677 std::cout <<
"channel with negative energy " << ener <<
" => setting quality to 255" << std::endl;
682 switch (correction) {
708 ++drawerEvtStatus[ros][drawer].nChannels;
711 if (overflow) ++drawerEvtStatus[ros][drawer].nOverflow;
712 if (underflow) ++drawerEvtStatus[ros][drawer].nUnderflow;
714#ifdef ALLOW_DEBUG_COUT
715 if (overflow) std::cout <<
"channel with overflow " << ((count_over)?
"":
"MBTS") << std::endl;
716 if (underflow) std::cout <<
"channel with underflow " << ((count_over)?
"":
"MBTS") << std::endl;
717 if (overfit) std::cout <<
"channel with corrected overflow " << ((count_over)?
"":
"MBTS") << std::endl;
728 ++drawerEvtStatus[ros][drawer].nSomeSignal;
750 ++drawerEvtStatus[ros][drawer].nBadQuality;
759 || (dcsState ? dcsState->
isStatusBad(ros, drawer, chan) :
false);
765 ++drawerEvtStatus[ros][drawer].nMaskedChannels;
797 bool single_PMT_C10 =
false;
804 int gain1 = pCell->
gain1();
818 ++drawerEvtStatus[ros1][drawer1].nBadQuality;
822 bad1 = (gain1 < 0) || chStatus1.
isBad();
826 bad1 = !(DQstatus->
isAdcDQgood(ros1, drawer1, chan1, gain1))
827 || (dcsState ? dcsState->
isStatusBad(ros1, drawer1, chan1) :
false);
836 ++drawerEvtStatus[ros1][drawer1].nMaskedChannels;
857 int gain2 = pCell->
gain2();
871 ++drawerEvtStatus[ros2][drawer2].nBadQuality;
875 bad2 = (gain2 < 0) || chStatus2.
isBad();
879 bad2 = !(DQstatus->
isAdcDQgood(ros2, drawer2, chan2, gain2))
880 || (dcsState ? dcsState->
isStatusBad(ros2, drawer2, chan2) :
false);
887 if (single_PMT_C10) {
893#ifdef ALLOW_DEBUG_COUT
897 << drawer2+1 <<
" status " << chan1 <<
"/" << chan2 <<
" "
898 << (chStatus1.
isBad()?
"bad":
"good") <<
"/"
899 << (chStatus2.
isBad()?
"bad":
"good") <<
"/"
900 << ((
m_run2plus)?
" RUN2+ cabling":
"RUN1 cabling")
906#ifdef ALLOW_DEBUG_COUT
908 std::cout <<
"Ene of chan1 was " << pCell->
ene1() <<
" changing to half of " << pCell->
ene2()
909 <<
" and setting bad1=true" << std::endl;
915 --drawerEvtStatus[ros1][drawer1].nMaskedChannels;
919#ifdef ALLOW_DEBUG_COUT
921 std::cout <<
"Ene of chan2 was " << pCell->
ene2() <<
" changing to half of " << pCell->
ene1()
922 <<
" and setting bad2=true" << std::endl;
928 --drawerEvtStatus[ros2][drawer2].nMaskedChannels;
934 ++drawerEvtStatus[ros1][drawer1].nMaskedChannels;
935 ++drawerEvtStatus[ros2][drawer2].nMaskedChannels;
950 }
else if (bad1 && !bad2) {
952 ++drawerEvtStatus[ros1][drawer1].nMaskedChannels;
954 float ene2 = pCell->
ene2();
955 pCell->
setEnergy(ene2, ene2, gain2, gain2);
958 uint8_t qual2 = pCell->
qual2();
959 uint8_t qual1 = qual2 + qualCorrection;
960 if (qual1 >
m_qualityCut && gain1 > gain2) qual1 = qual2 - qualCorrection;
975 }
else if (!bad1 && bad2) {
977 ++drawerEvtStatus[ros2][drawer2].nMaskedChannels;
979 float ene1 = pCell->
ene1();
980 pCell->
setEnergy(ene1, ene1, gain1, gain1);
983 uint8_t qual1 = pCell->
qual1();
984 uint8_t qual2 = qual1 + qualCorrection;
985 if (qual2 >
m_qualityCut && gain2 > gain1) qual2 = qual1 - qualCorrection;
1024 return single_PMT_C10;
1028template<
class ITERATOR,
class COLLECTION>
1032 const ITERATOR & begin,
1033 const ITERATOR & end,
1056 float eCellTot = 0.0;
1057 float eMBTSTot = 0.0;
1058 float eE4prTot = 0.0;
1059 bool EBdrawerPresent[128];
1060 memset(EBdrawerPresent, 0,
sizeof(EBdrawerPresent));
1067 std::vector<TileCell*> allCells (
m_tileID->cell_hash_max(),
nullptr);
1069 for (ITERATOR rawItr = begin; rawItr != end; ++rawItr) {
1082 if (channel == 0 && ros > 2) EBdrawerPresent[(ros - 3) * 64 + drawer] =
true;
1091 amp = emScale->undoOnlineChannelCalibration(drawerIdx, channel, gain, amp, params.m_RChUnit);
1100 ATH_MSG_ERROR(
"Units in raw channel container is " << params.m_RChUnit );
1101 ATH_MSG_ERROR(
"But amplitude correction works only with ADC counts " );
1102 ATH_MSG_ERROR(
"Please, disable CIS calibration in optimal filter " );
1106 float qual = pChannel->
quality();
1109 bool good_time = (fabs(time) < params.m_maxTimeCorr);
1111 ? ((qual > 2.99 && qual < 4.01))
1120 bool overflow =
false;
1121 bool underflow =
false;
1122 bool overfit =
false;
1126 }
else if (ped > 39500.) {
1149 if (params.m_correctTime && good_time && non_zero_time)
1152 time = pChannel->
time();
1158 int channel1 = channel;
1161 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,
1162 26,25,24,29,31,32,27,28,30,35,34,33,38,37,43,44,41,40,39,36,42,47,46,45};
1163 channel1 = pmt2channel[channel];
1166 && (ros == 2 && (drawer == 1 || drawer>2)) ) {
1167 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,
1168 26,25,24,29,28,27,32,31,30,35,34,33,38,37,36,41,40,39,44,43,42,47,46,45};
1169 channel1 = pmt2channel[channel];
1171 && (ros == 4 && drawer>=2) ) {
1172 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,
1173 31,32,30,35, 33,34, 38,37,41,40,39,36, 26,25,24,29,28,27, 44,43,42,47,46,45};
1174 channel1 = pmt2channelEB[channel];
1185 float ener = emScale->calibrateChannel(drawerIdx, channel, gain, amp, oldUnit
1189 unsigned char iqual =
iquality(qual);
1191 unsigned char qbit =
qbits(drawerEvtStatus, params.m_RChType,
1193 , overflow, underflow, overfit);
1201 pCell->
set(NULL, cell_id);
1209 if (msgLvl(MSG::VERBOSE)) {
1210 msg(MSG::VERBOSE) <<
" E4' cell_id=" <<
m_tileTBID->to_string(cell_id)
1211 <<
" adc_id=" <<
m_tileHWID->to_string(adc_id)
1214 <<
" time= " << time
1215 <<
" qual= " << pChannel->
quality()
1216 <<
" iqual= " << (int) iqual
1217 <<
" qbit = 0x" << MSG::hex << (
int) qbit << MSG::dec;
1226 *badChannels, pCell, adc_id))
1228 <<
" bad channel masked, new energy=" << pCell->
energy() );
1234 }
else if (
index == -2) {
1240 float ener = emScale->calibrateChannel(drawerIdx, channel, gain, amp , oldUnit
1244 unsigned char iqual =
iquality(qual);
1246 unsigned char qbit =
qbits(drawerEvtStatus, params.m_RChType,
1247 ros, drawer,
false, (good_time && non_zero_time),
1265 if (msgLvl(MSG::VERBOSE)) {
1266 msg(MSG::VERBOSE) <<
" MBTS cell_id=" <<
m_tileTBID->to_string(cell_id)
1267 <<
" adc_id=" <<
m_tileHWID->to_string(adc_id)
1270 <<
" time= " << time
1271 <<
" qual= " << pChannel->
quality()
1272 <<
" iqual= " << (int) iqual
1273 <<
" qbit = 0x" << MSG::hex << (
int) qbit << MSG::dec;
1282 *badChannels, pCell, adc_id))
1284 <<
" bad channel masked, new energy=" << pCell->
energy() );
1289 }
else if (
index != -1) {
1291 float ener = emScale->calibrateChannel(drawerIdx, channel, gain, amp
1296 unsigned char iqual =
iquality(qual);
1298 unsigned char qbit =
qbits(drawerEvtStatus, params.m_RChType,
1300 , overflow, underflow, overfit);
1305 int drawer2 =
m_cabling->E1_merged_with_run2plus(ros,drawer);
1307 int side = (ros == 3) ? 1 : -1;
1309 int index2 =
m_tileID->cell_hash(cell_id2);
1312 allCells[index2] = pCell2;
1314 pCell2->
set(dde2, cell_id2);
1318 correctCell(pCell2, 1, pmt2, gain, ener, time, iqual, qbit, 1);
1321 <<
" splitted into " <<
m_tileID->to_string(cell_id2));
1331 correctCell(pCell, 2, pmt, gain, ener, time, iqual, qbit, 0);
1336 pCell->
set(dde, cell_id);
1339 correctCell(pCell, 1, pmt, gain, ener, time, iqual, qbit, ch_type);
1342 if (msgLvl(MSG::VERBOSE)) {
1343 float calib1 = (amp != 0) ? ener / amp : 0.0;
1344 msg(MSG::VERBOSE) <<
" cell_id=" <<
m_tileID->to_string(cell_id, -2)
1345 <<
" adc_id=" <<
m_tileHWID->to_string(adc_id)
1346 <<
" calib=" << calib1
1347 <<
" nCell=" << nCell
1348 <<
" energy=" << ener <<
" (" << pCell->
energy() <<
", " << pCell->
eneDiff() <<
")" <<
endmsg;
1350 msg(MSG::VERBOSE) <<
" amp= " << amp
1351 <<
" time= " << time
1352 <<
" qual= " << pChannel->
quality()
1353 <<
" iqual= " << (int) iqual
1354 <<
" qbit = 0x" << MSG::hex << (
int) qbit << MSG::dec;
1364 if (msgLvl(MSG::VERBOSE)) {
1366 unsigned char iqual =
iquality(qual);
1367 unsigned char qbit =
qbits(drawerEvtStatus, params.m_RChType,
1368 0, drawer,
false, non_zero_time,
false, overflow, underflow, overfit);
1370 msg(MSG::VERBOSE) <<
" channel with adc_id=" <<
m_tileHWID->to_string(adc_id)
1371 <<
" is not connected" <<
endmsg;
1373 msg(MSG::VERBOSE) <<
" amp= " << amp
1374 <<
" time= " << time
1375 <<
" qual= " << pChannel->
quality()
1376 <<
" iqual= " << (int) iqual
1377 <<
" qbit = 0x" << MSG::hex << (
int) qbit << MSG::dec;
1385 if (msgLvl(MSG::VERBOSE)) {
1386 if ((params.m_correctTime && good_time && non_zero_time) || pChannel->
sizeTime() > 1) {
1387 msg(MSG::VERBOSE) <<
" OF_time = " << pChannel->
uncorrTime()
1388 <<
" corr_time = " << time <<
endmsg;
1403 if (
maskBadChannels (drawerEvtStatus, DQstatus, dcsState, *badChannels, pCell))
1405 <<
" bad channels masked, new energy=" << pCell->
energy() );
1415 coll->push_back(pCell);
1423 allCells[
index] = 0;
1433 if (EBdrawerPresent[ind]) {
1447 <<
" ene=" << pCell->
energy()
1448 <<
" status=" << (pCell->
badcell() ?
"bad" :
"good") );
1450 coll->push_back(pCell);
1456 if (msgLvl(MSG::DEBUG)) {
1457 msg(MSG::DEBUG) <<
" nChan=" << nChan
1458 <<
" RawChSum=" << eCh
1459 <<
" nCell=" << nCell
1461 <<
" nFake=" << nFake
1462 <<
" eneTot=" << eCellTot;
1465 msg(MSG::DEBUG) <<
" nMBTS=" << nMBTS
1466 <<
" eMBTS=" << eMBTSTot;
1468 msg(MSG::DEBUG) <<
" nE4pr=" << nE4pr
1469 <<
" 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)
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