39#include "CaloDetDescr/CaloDetDescrElement.h"
50#include "eformat/ROBFragment.h"
51#include "eformat/FullEventFragment.h"
54#include "GaudiKernel/ITHistSvc.h"
55#include "GaudiKernel/ThreadLocalContext.h"
60#include "boost/date_time/local_time/local_time.hpp"
61#include "boost/date_time/posix_time/posix_time.hpp"
66memset(array,0,sizeof(array))
68#define CLEAR1(array) \
69memset(array,-1,sizeof(array))
71#define CLEAR2(array,size) \
72 memset(array,0,sizeof(array)/size)
74#define CLEAR3(array,size) \
75 memset(array,-1,sizeof(array)/size)
78#define CLEAR4(array,size) \
79memset(array,0,sizeof(*array)*N_ROS2*N_MODULES*N_CHANS*m_nSamples/size)
82#define CLEAR5(array,size) \
83memset(array,-1,sizeof(*array)*N_ROS2*N_MODULES*N_CHANS*m_nSamples/size)
86#define CLEAR6(array) \
87memset(array,0,sizeof(*array)*N_ROS*N_MODULES*N_TMDBCHANS*m_nSamples)
95#define NAME3(s1,s2,s3) \
98#define NAME5(s1,s2,s3,s4,s5) \
99(s1+s2+s3+s4+s5).c_str()
101#define sample_ind(r,m,c,i) (((r*N_MODULES + m)*N_CHANS + c)*m_nSamples) + i
103#define sample_ind_TMDB(r,m,c,i) (((r*N_MODULES + m)*N_TMDBCHANS + c)*m_nSamples) + i
247 m_arrays->m_sample = (
short *) malloc(sample_size*
sizeof(
short));
248 m_arrays->m_sampleFlt = (
short *) malloc(sample_size*
sizeof(
short));
249 m_arrays->m_sampleTMDB = (
unsigned char *) malloc(sample_TMDB_size*
sizeof(
unsigned char));
271 return StatusCode::SUCCESS;
287 bool calibMode = (calib == 1);
288 if ( calibMode !=
m_calibMode && calib!=0xFFFFFFFF ) {
289 ATH_MSG_INFO(
"Calib mode from data is " << calibMode );
300 ATH_MSG_INFO(
"Final offline units are not set, will use DSP units" );
305 ATH_MSG_INFO(
"calibrateEnergy is disabled, don't want to use DSP units" );
328 return StatusCode::SUCCESS;
333 const EventContext& ctx = Gaudi::Hive::currentContext();
387 const eformat::FullEventFragment<const uint32_t*>*
event =
nullptr;
390 std::vector<const ROBDataProviderSvc::ROBF*> robf;
393 robFrag = (robf.size() > 0 ) ? robf[0] :
nullptr;
395 m_evTime =
event->bc_time_seconds();
399 m_l1ID[rod] = robFrag->rod_lvl1_id();
400 m_l1Type[rod] = robFrag->rod_lvl1_trigger_type();
401 m_evType[rod] = robFrag->rod_detev_type();
402 m_evBCID[rod] = robFrag->rod_bc_id();
411 m_run = ctx.eventID().run_number();
412 m_evt = ctx.eventID().event_number();
414 if ( ctx.eventID().lumi_block() ){
419 if (ctx.eventID().time_stamp() > 0) {
420 m_evTime = ctx.eventID().time_stamp();
424 using namespace boost::local_time;
425 using namespace boost::posix_time;
442 static const time_zone_ptr gva_tz(
new posix_time_zone((std::string)
"CET+01CEST01:00:00,M3.5.0/02:00:00,M10.5.0/03:00:00"));
443 local_date_time gva_time(from_time_t(
m_evTime),gva_tz);
452 struct tm gva_tm(to_tm(gva_time));
453 strftime(
m_dateTime, 32,
"%Y-%b-%d %H:%M:%S %Z", &gva_tm);
454 m_HHMMSS = gva_tm.tm_hour*10000+gva_tm.tm_min*100+gva_tm.tm_sec;
472 ATH_MSG_WARNING(
"Some problems in execute - ntuple was not filled at all" );
485 return StatusCode::SUCCESS;
495 const char* gainnames[2] = {
"LG",
"HG"};
524 for(
int chan=0;chan<28;++chan){
532 for(
int chan=28;chan<32;++chan){
541 for(
int chan=0;chan<32;++chan){
555 msg(MSG::DEBUG) << gainnames[gn] <<
" CHAN " << ch <<
" SIG= " <<
m_arrays->m_chan[chan] <<
endmsg;
556 msg(MSG::DEBUG) << gainnames[gn] <<
" CHAN " << ch <<
" PED= " <<
m_arrays->m_chan_Ped[chan] <<
"+/-" <<
m_arrays->m_chan_SPed[chan] <<
" ( " << laserObj->
isSet(ch, gn, 0) <<
" ) " <<
endmsg;
557 msg(MSG::DEBUG) << gainnames[gn] <<
" CHAN " << ch <<
" PED= " <<
m_arrays->m_chan_Lin[chan] <<
"+/-" <<
m_arrays->m_chan_SLin[chan] <<
" ( " << laserObj->
isSet(ch, gn, 1) <<
" ) " <<
endmsg;
558 msg(MSG::DEBUG) << gainnames[gn] <<
" CHAN " << ch <<
" LED= " <<
m_arrays->m_chan_Led[chan] <<
"+/-" <<
m_arrays->m_chan_SLed[chan] <<
" ( " << laserObj->
isSet(ch, gn, 2) <<
" ) " <<
endmsg;
559 msg(MSG::DEBUG) << gainnames[gn] <<
" CHAN " << ch <<
" ALP= " <<
m_arrays->m_chan_Alpha[chan] <<
"+/-" <<
m_arrays->m_chan_SAlpha[chan] <<
" ( " << laserObj->
isSet(ch, gn, 3) <<
" ) " <<
endmsg;
571 <<
" adc " <<
m_arrays->m_las_PMT_ADC[gn][i]
572 <<
" ped " <<
m_arrays->m_las_PMT_Ped[gn][i]
573 <<
" rms " <<
m_arrays->m_las_PMT_Ped_RMS[gn][i]
574 <<
" tdc " <<
m_arrays->m_las_PMT_TDC[gn][i] );
577 for (
unsigned int i=0; i<14; ++i) {
587 <<
" adc " <<
m_arrays->m_las_D_ADC[gn][i]
588 <<
" ped " <<
m_arrays->m_las_D_Ped[gn][i]
589 <<
" rms " <<
m_arrays->m_las_D_Ped_RMS[gn][i]
590 <<
" alp " <<
m_arrays->m_las_D_Alpha[gn][i]
591 <<
" rms " <<
m_arrays->m_las_D_Alpha_RMS[gn][i]
592 <<
" ape " <<
m_arrays->m_las_D_AlphaPed[gn][i]
593 <<
" rms " <<
m_arrays->m_las_D_AlphaPed_RMS[gn][i] );
598 return StatusCode::SUCCESS;
603 const uint32_t* cispar = DQstatus.
cispar();
609 if (
msgLvl(MSG::VERBOSE)) {
610 if (oldval != cispar[i]) {
614 }
else if (last == i-1) {
623 if (
msgLvl(MSG::VERBOSE)) {
634 return StatusCode::SUCCESS;
650 if (containerKey.
empty()) {
651 return StatusCode::FAILURE;
671 ATH_MSG_ERROR(
"RawChannel units are not ADC counts, can't apply DSP-like calibration" );
672 return StatusCode::FAILURE;
686 std::vector<float> sumE(3);
698 for(; itColl != itCollEnd; ++itColl) {
699 int fragId = (*itColl)->identify();
701 int drawer = fragId & 0x3F;
702 int ROS = (fragId>>8);
705 int rosH = rosI +
N_ROS;
709 <<
" Frag id 0x" << MSG::hex << fragId << MSG::dec
711 <<
" drawer " << drawer );
714 it = (*itColl)->begin();
715 itEnd = (*itColl)->end();
719 memset(E, 0,
sizeof(E));
720 memset(gain, 0,
sizeof(gain));
723 for(; it != itEnd; ++it) {
738 if(cmpCounter>48) rosI = rosH;
741 if(adc == 1) rosI = rosH;
755 ene[rosI][drawer][channel] = energy;
756 time[rosI][drawer][channel] = rch->
time();
758 ped[rosI][drawer][channel] = rch->
pedestal();
759 if (
m_arrays->m_gain[rosI][drawer][channel] < 0)
760 m_arrays->m_gain[rosI][drawer][channel] = adc;
772 if (
msgLvl(MSG::VERBOSE)) {
777 <<
" type " << std::min(
index,0)
779 <<
" time=" << rch->
time()
787 m_arrays->m_ROD_GlobalCRC[rosL][drawer] = (*itColl)->getFragGlobalCRC() & 1;
788 m_arrays->m_ROD_BCID[rosL][drawer] = (*itColl)->getFragDSPBCID();
789 m_arrays->m_ROD_DMUMask[rosL][drawer][0] = (*itColl)->getFragRODChipMask();
790 m_arrays->m_ROD_DMUMask[rosL][drawer][1] = (*itColl)->getFragFEChipMask();
792 for(
unsigned int dmu=0;dmu<
N_DMUS;dmu++) {
794 m_arrays->m_ROD_DMUBCIDErr[rosL][drawer][dmu] = ((*itColl)->getFragBCID() >> dmu) & 1;
795 m_arrays->m_ROD_DMUmemoryErr[rosL][drawer][dmu] = ((*itColl)->getFragMemoryPar() >> dmu) & 1;
796 m_arrays->m_ROD_DMUSstrobeErr[rosL][drawer][dmu] = ((*itColl)->getFragSstrobe() >> dmu) & 1;
797 m_arrays->m_ROD_DMUDstrobeErr[rosL][drawer][dmu] = ((*itColl)->getFragDstrobe() >> dmu) & 1;
798 m_arrays->m_ROD_DMUHeadformatErr[rosL][drawer][dmu] = ((*itColl)->getFragHeaderBit() >> dmu) & 1;
799 m_arrays->m_ROD_DMUHeadparityErr[rosL][drawer][dmu] = ((*itColl)->getFragHeaderPar() >> dmu) & 1;
800 m_arrays->m_ROD_DMUDataformatErr[rosL][drawer][dmu] = ((*itColl)->getFragSampleBit() >> dmu) & 1;
801 m_arrays->m_ROD_DMUDataparityErr[rosL][drawer][dmu] = ((*itColl)->getFragSamplePar() >> dmu) & 1;
802 m_arrays->m_ROD_DMUfeCRC[rosL][drawer][dmu] = ((*itColl)->getFragFEChipMask() >> dmu) & 1;
803 m_arrays->m_ROD_DMUrodCRC[rosL][drawer][dmu] = ((*itColl)->getFragRODChipMask() >> dmu) & 1;
829 for(; it != end; ++it) {
836 return StatusCode::SUCCESS;
848 if (containerKey.
empty()) {
849 return StatusCode::FAILURE;
854 SG::makeHandle (containerKey, ctx).get();
868 ATH_MSG_ERROR(
"RawChannel units are not ADC counts, can't apply DSP-like calibration" );
869 return StatusCode::FAILURE;
883 std::vector<float> sumE(3);
895 for (; itColl != itCollEnd; ++itColl) {
896 int fragId = (*itColl)->identify();
898 int drawer = fragId & 0x3F;
899 int ROS = (fragId >> 8);
902 int rosH = rosI +
N_ROS;
906 <<
" Frag id 0x" << MSG::hex << fragId << MSG::dec
908 <<
" drawer " << drawer );
911 it = (*itColl)->begin();
912 itEnd = (*itColl)->end();
916 memset(E, 0,
sizeof(E));
917 memset(gain, 0,
sizeof(gain));
919 for(; it != itEnd; ++it) {
934 if(cmpCounter>48) rosI = rosH;
937 if(adc == 1) rosI = rosH;
944 for (
int i = 0; i < 7; ++i) {
953 ene[
sample_ind(rosI,drawer,channel,i)] = energy;
957 ped[rosI][drawer][channel] = rch->
pedestal();
959 if (
m_arrays->m_gain[rosI][drawer][channel] < 0)
960 m_arrays->m_gain[rosI][drawer][channel] = adc;
963 E[channel] = ene[
sample_ind(rosI,drawer,channel,0)];
966 m_bad[rosL][drawer][channel] = (rch->
quality() > 15.99);
972 if (
msgLvl(MSG::VERBOSE)) {
977 <<
" type " << std::min(
index,0)
978 <<
" ene=" << ene[
sample_ind(rosI,drawer,channel,0)]
979 <<
" time=" << rch->
time()
987 m_arrays->m_ROD_GlobalCRC[rosL][drawer] = (*itColl)->getFragGlobalCRC() & 1;
988 m_arrays->m_ROD_BCID[rosL][drawer] = (*itColl)->getFragDSPBCID();
989 m_arrays->m_ROD_DMUMask[rosL][drawer][0] = (*itColl)->getFragRODChipMask();
990 m_arrays->m_ROD_DMUMask[rosL][drawer][1] = (*itColl)->getFragFEChipMask();
992 for(
unsigned int dmu=0;dmu<
N_DMUS;dmu++) {
994 m_arrays->m_ROD_DMUBCIDErr[rosL][drawer][dmu] = ((*itColl)->getFragBCID() >> dmu) & 1;
995 m_arrays->m_ROD_DMUmemoryErr[rosL][drawer][dmu] = ((*itColl)->getFragMemoryPar() >> dmu) & 1;
996 m_arrays->m_ROD_DMUSstrobeErr[rosL][drawer][dmu] = ((*itColl)->getFragSstrobe() >> dmu) & 1;
997 m_arrays->m_ROD_DMUDstrobeErr[rosL][drawer][dmu] = ((*itColl)->getFragDstrobe() >> dmu) & 1;
998 m_arrays->m_ROD_DMUHeadformatErr[rosL][drawer][dmu] = ((*itColl)->getFragHeaderBit() >> dmu) & 1;
999 m_arrays->m_ROD_DMUHeadparityErr[rosL][drawer][dmu] = ((*itColl)->getFragHeaderPar() >> dmu) & 1;
1000 m_arrays->m_ROD_DMUDataformatErr[rosL][drawer][dmu] = ((*itColl)->getFragSampleBit() >> dmu) & 1;
1001 m_arrays->m_ROD_DMUDataparityErr[rosL][drawer][dmu] = ((*itColl)->getFragSamplePar() >> dmu) & 1;
1002 m_arrays->m_ROD_DMUfeCRC[rosL][drawer][dmu] = ((*itColl)->getFragFEChipMask() >> dmu) & 1;
1003 m_arrays->m_ROD_DMUrodCRC[rosL][drawer][dmu] = ((*itColl)->getFragRODChipMask() >> dmu) & 1;
1029 for(; it != end; ++it) {
1036 return StatusCode::SUCCESS;
1050 if (containerKey.
empty())
1051 return StatusCode::FAILURE;
1057 bool emptyColl =
true;
1064 for(; itColl != itCollEnd; ++itColl) {
1065 int fragId = (*itColl)->identify();
1066 int drawer = fragId & 0x3F;
1067 int ROS = (fragId>>8);
1070 int rosH = rosI +
N_ROS;
1072 if (
msgLvl(MSG::VERBOSE)) {
1074 <<
" Frag id 0x" << MSG::hex << fragId << MSG::dec
1076 <<
" drawer " << drawer );
1080 <<
" BCID=" << (*itColl)->getFragBCID() << MSG::hex
1081 <<
" CRC=0x" << ((*itColl)->getFragCRC()&0xffff)
1082 <<
" DMUMask=0x" << ((*itColl)->getFragDMUMask()&0xffff) << MSG::dec );
1085 <<
" Lvl1Type=" << (*itColl)->getLvl1Type()
1086 <<
" EvBCID=" << (*itColl)->getRODBCID()
1087 <<
" EvType=" << (*itColl)->getDetEvType() );
1099 rod = (((rod>>2)<<1) | (rod&1));
1102 m_l1ID[rod] = (*itColl)->getLvl1Id();
1103 m_l1Type[rod] = (*itColl)->getLvl1Type();
1104 m_evType[rod] = (*itColl)->getDetEvType();
1105 m_evBCID[rod] = (*itColl)->getRODBCID();
1120 m_arrays->m_rodBCID[rosL][drawer] = (*itColl)->getRODBCID();
1121 m_arrays->m_fragSize[rosL][drawer]=(*itColl)->getFragSize();
1123 m_arrays->m_slinkCRC[rosL][drawer][0] = ((*itColl)->getFragCRC()>>16) & 0xffff;
1124 m_arrays->m_dmuMask[rosL][drawer][0] = ((*itColl)->getFragDMUMask()>>16) & 0xffff;
1125 m_arrays->m_slinkCRC[rosL][drawer][1] = (*itColl)->getFragCRC() & 0xffff;
1126 m_arrays->m_dmuMask[rosL][drawer][1] = (*itColl)->getFragDMUMask() & 0xffff;
1128 uint32_t CRCmask = (*itColl)->getFragDMUMask();
1129 uint32_t fe_crc = CRCmask & 0xFFFF;
1130 uint32_t rod_crc = CRCmask >> 16;
1132 const std::vector<uint32_t> & headerVec = (*itColl)->getFragChipHeaderWords();
1133 unsigned int headsize = std::min(16U,
static_cast<unsigned int>(headerVec.size()));
1135 for (
unsigned int ih = 0; ih < headsize; ++ih) {
1137 m_arrays->m_DMUheader[rosL][drawer][ih] = headerVec[ih];
1138 m_arrays->m_DMUbcid[rosL][drawer][ih] = (headerVec[ih] & 0xFFF);
1141 m_arrays->m_DMUmemoryErr[rosL][drawer][ih] = (headerVec[ih] >> 25 & 0x1);
1142 m_arrays->m_DMUSstrobeErr[rosL][drawer][ih] = (headerVec[ih] >> 24 & 0x1);
1143 m_arrays->m_DMUDstrobeErr[rosL][drawer][ih] = (headerVec[ih] >> 23 & 0x1);
1145 m_arrays->m_feCRC[rosL][drawer][ih] = (fe_crc >> ih & 0x1);
1146 m_arrays->m_rodCRC[rosL][drawer][ih] = (rod_crc >> ih & 0x1);
1150 const std::vector<uint32_t> & headerVecHi = (*itColl)->getFragChipHeaderWordsHigh();
1151 unsigned int headsizehi = std::min(16U,
static_cast<unsigned int>(headerVecHi.size()));
1153 for (
unsigned int ih = 0; ih < headsizehi; ++ih) {
1155 m_arrays->m_DMUheader[rosH][drawer][ih] = headerVecHi[ih];
1156 m_arrays->m_DMUbcid[rosH][drawer][ih] = (headerVecHi[ih] & 0xFFF);
1159 m_arrays->m_DMUmemoryErr[rosH][drawer][ih] = (headerVecHi[ih] >> 25 & 0x1);
1160 m_arrays->m_DMUSstrobeErr[rosH][drawer][ih] = (headerVecHi[ih] >> 24 & 0x1);
1161 m_arrays->m_DMUDstrobeErr[rosH][drawer][ih] = (headerVecHi[ih] >> 23 & 0x1);
1163 m_arrays->m_feCRC[rosH][drawer][ih] = -1 ;
1164 m_arrays->m_rodCRC[rosH][drawer][ih] = -1;
1172 for (; it != itEnd; ++it) {
1187 if (cmpCounter > 48) rosI = rosH;
1190 if (gain == 1) rosI = rosH;
1195 a_gain[rosI][drawer][channel] = gain;
1198 const std::vector<float> & sampleVec = digit->samples();
1199 int siz = sampleVec.size();
1200 if (
msgLvl(MSG::VERBOSE)) {
1202 digit->cell_ID_index(
index,pmt);
1203 msg(MSG::VERBOSE) <<
"TD ch " << channel
1205 <<
" type " << std::min(
index,0) <<
" {";
1206 for(
int i=0;i<siz;i++) {
1207 msg(MSG::VERBOSE) <<(int)sampleVec[i] <<
" ";
1213 if (
msgLvl(MSG::VERBOSE))
1216 if (
msgLvl(MSG::VERBOSE))
1219 for (
int n = 0; n < siz; ++n) {
1220 a_sample[
sample_ind(rosI,drawer,channel,n)] = (short) sampleVec[n];
1226 if (emptyColl)
return StatusCode::FAILURE;
1227 else return StatusCode::SUCCESS;
1232 const char * part[4] = {
"LBA",
"LBC",
"EBA",
"EBC"};
1250 for(; it != itLast; ++it) {
1254 const std::vector<bool> & decision = obj->GetDecision();
1255 int siz = decision.size();
1259 int fragId = (*it)->identify();
1260 int drawer = fragId & 0x3F;
1261 int ros = ((fragId>>8) & 0xF) - 1;
1262 bcid[2] = ((fragId>>24) & 0xF);
1263 bcid[1] = ((fragId>>20) & 0xF);
1264 bcid[0] = ((fragId>>16) & 0XF);
1271 for (
int n = 0; n < siz; ++n) {
1272 m_arrays->m_decisionTMDB[ros][drawer][n] = (
unsigned char) decision[n];
1275 for (
int n = 0; n < 3; ++n) {
1276 m_arrays->m_bcidTMDB[ros][drawer][n] = (
unsigned char) bcid[n];
1279 if (
msgLvl(MSG::VERBOSE)) {
1280 std::stringstream
ss;
1281 for (
int n = 0; n < siz; ++n) {
1282 ss<<std::setw(5)<<(int)
m_arrays->m_decisionTMDB[ros][drawer][n];
1284 ATH_MSG_VERBOSE(
"TMDB 0x" <<MSG::hex<< fragId <<MSG::dec<<
" "<< part[ros]
1285 << std::setfill(
'0') << std::setw(2)
1286 << drawer+1 << std::setfill(
' ')
1287 <<
" BCID check " << bcid[0] <<
"/"<< bcid[1] <<
"/"<< bcid[2] <<
" decision: " <<
ss.str() );
1293 return StatusCode::SUCCESS;
1298 const char * part[4] = {
"LBA",
"LBC",
"EBA",
"EBC"};
1313 for(; itColl1 != itCollEnd1; ++itColl1) {
1320 int fragId = (*itColl1)->identify();
1321 int drawer = fragId & 0x3F;
1322 int ros = (fragId>>8) - 1;
1325 ATH_MSG_VERBOSE(
"TMDB 0x" <<MSG::hex<< fragId <<MSG::dec<<
" "<< part[ros]
1326 << std::setfill(
'0') << std::setw(2)
1327 << drawer+1 << std::setfill(
' ') );
1329 for (; it1 != itEnd1; ++it1) {
1332 ATH_MSG_WARNING(
"Too many channels in TMDB Digi container for frag 0x" <<MSG::hex<< fragId <<MSG::dec <<
" keeping only first " <<
N_TMDBCHANS <<
" channels in ntuple ");
1339 const std::vector<float> & sampleVec = digit->samples();
1340 int siz = sampleVec.size();
1347 for (
int n = 0; n < siz; ++n) {
1351 if (
msgLvl(MSG::VERBOSE)) {
1352 std::stringstream
ss;
1353 for (
int n = 0; n < siz; ++n) {
1365 return StatusCode::SUCCESS;
1370 const char * part[4] = {
"LBA",
"LBC",
"EBA",
"EBC"};
1385 for(; itColl2 != itCollEnd2; ++itColl2) {
1392 int fragId = (*itColl2)->identify();
1393 int drawer = fragId & 0x3F;
1394 int ros = (fragId>>8) - 1;
1397 ATH_MSG_VERBOSE(
"TMDB 0x" <<MSG::hex<< fragId <<MSG::dec<<
" "<< part[ros]
1398 << std::setfill(
'0') << std::setw(2)
1399 << drawer+1 << std::setfill(
' ') );
1401 for (; it2 != itEnd2; ++it2) {
1404 ATH_MSG_WARNING(
"Too many channels in TMDB RCh container for frag 0x" <<MSG::hex<< fragId <<MSG::dec <<
" keeping only first " <<
N_TMDBCHANS <<
" channels in ntuple ");
1410 m_arrays->m_eTMDB[ros][drawer][ichannel] =
rc -> amplitude();
1420 return StatusCode::SUCCESS;
1433 return StatusCode::SUCCESS;
1445 return StatusCode::SUCCESS;
1453 std::vector<std::string>
files;
1454 m_fileMgr->getFiles(Io::ROOT, ( Io::WRITE | Io::CREATE ),
files);
1468 TTree* ntuplePtr =
new TTree(ntupleID.c_str(),
"TileCal-CellMap");
1470 ATH_MSG_ERROR(
"Problem registering TileRec CellMap Tree" );
1496 std::string ntupleDCS =
"Tile_DCS";
1497 m_DCSntuplePtr =
new TTree(ntupleDCS.c_str(),
"TileCal-DCS data");
1504 return StatusCode::SUCCESS;
1536 float eta[4][64][48];
1537 float phi[4][64][48];
1538 short tower[4][64][48];
1539 short sample[4][64][48];
1540 short ind[4][64][48];
1541 short pmt[4][64][48];
1542 short bad[4][64][48][2];
1552 ntuplePtr->Branch(
"eta",
eta,
"eta[4][64][48]/F");
1553 ntuplePtr->Branch(
"phi",
phi,
"phi[4][64][48]/F");
1554 ntuplePtr->Branch(
"tower", tower,
"tower[4][64][48]/S");
1555 ntuplePtr->Branch(
"sample", sample,
"sample[4][64][48]/S");
1556 ntuplePtr->Branch(
"ind", ind,
"ind[4][64][48]/S");
1557 ntuplePtr->Branch(
"pmt", pmt,
"pmt[4][64][48]/S");
1558 ntuplePtr->Branch(
"bad",
bad,
"bad[4][64][48][2]/S");
1563 for (; itr != end; ++itr) {
1567 for (
int i = 0; i < 2; ++i) {
1576 pm =
m_cabling->channel2hole(ROS, chan);
1577 if ((ROS == 3 && drawer == 14) || (ROS == 4 && drawer == 17)) {
1578 if (pm < 0) pm = -pm;
1579 if (chan == 2 || chan == 3) pm = -pm;
1583 eta[rosI][drawer][chan] = caloDDE->
eta();
1584 phi[rosI][drawer][chan] = caloDDE->
phi();
1585 tower[rosI][drawer][chan] =
m_tileID->tower(cell_id);
1586 sample[rosI][drawer][chan] =
m_tileID->sample(cell_id);
1587 ind[rosI][drawer][chan] =
index;
1588 pmt[rosI][drawer][chan] = pm;
1594 if (
detStore()->retrieve(mbtsMgr).isFailure() ) {
1595 ATH_MSG_WARNING(
"Unable to retrieve MbtsDetDescrManager from DetectorStore" );
1598 for (
int ROS = 1; ROS < 5; ++ROS) {
1600 for (
int drawer = 0; drawer < 64; ++drawer) {
1601 for (
int chan = 0; chan < 48; ++chan) {
1602 for (
int adc = 0; adc < 2; ++adc) {
1608 ind[rosI][drawer][chan] =
index;
1609 pmt[rosI][drawer][chan] = 1;
1613 if (caloDDE->
z() > 0.0)
1614 eta[rosI][drawer][chan] = fabs(caloDDE->
eta());
1616 eta[rosI][drawer][chan] = -fabs(caloDDE->
eta());
1617 phi[rosI][drawer][chan] = caloDDE->
phi();
1648 std::string dim =
"[" + std::to_string(
N_RODS) +
"]/I";
1659 //Clear Tree TRIGGER variables
1692 //Clear Tree CISPAR variables
1713 const char* gainnames[2] = {
"LG",
"HG"};
1714 const char* channames[16] = {
"Diode0",
"Diode1",
"Diode2",
"Diode3",
"Diode4",
"Diode5",
"Diode6",
"Diode7",
1715 "Diode8",
"Diode9",
"ExtCIS0",
"IntCIS",
"DiodePhocal",
"ExtCIS1",
"PMT1",
"PMT2"};
1730 for(
int chan=0;chan<32;++chan){
1733 m_ntuplePtr->Branch(Form(
"LASER_%s_%s_ADC",gainnames[gn],channames[ch]),&(
m_arrays->m_chan[chan]),Form(
"LASER_%s_%s_ADC/I",gainnames[gn],channames[ch]));
1734 m_ntuplePtr->Branch(Form(
"LASER_%s_%s_Ped",gainnames[gn],channames[ch]),&(
m_arrays->m_chan_Ped[chan]),Form(
"LASER_%s_%s_Ped/F",gainnames[gn],channames[ch]));
1735 m_ntuplePtr->Branch(Form(
"LASER_%s_%s_Led",gainnames[gn],channames[ch]),&(
m_arrays->m_chan_Led[chan]),Form(
"LASER_%s_%s_Led/F",gainnames[gn],channames[ch]));
1736 m_ntuplePtr->Branch(Form(
"LASER_%s_%s_Ped1",gainnames[gn],channames[ch]),&(
m_arrays->m_chan_Lin[chan]),Form(
"LASER_%s_%s_Ped1/F",gainnames[gn],channames[ch]));
1737 m_ntuplePtr->Branch(Form(
"LASER_%s_%s_Alpha",gainnames[gn],channames[ch]),&(
m_arrays->m_chan_Alpha[chan]),Form(
"LASER_%s_%s_Alpha/F",gainnames[gn],channames[ch]));
1738 m_ntuplePtr->Branch(Form(
"LASER_%s_%s_Sigma_Ped",gainnames[gn],channames[ch]),&(
m_arrays->m_chan_SPed[chan]),Form(
"LASER_%s_%s_Sigma_Ped/F",gainnames[gn],channames[ch]));
1739 m_ntuplePtr->Branch(Form(
"LASER_%s_%s_Sigma_Led",gainnames[gn],channames[ch]),&(
m_arrays->m_chan_SLed[chan]),Form(
"LASER_%s_%s_Sigma_Led/F",gainnames[gn],channames[ch]));
1740 m_ntuplePtr->Branch(Form(
"LASER_%s_%s_Sigma_Ped1",gainnames[gn],channames[ch]),&(
m_arrays->m_chan_SLin[chan]),Form(
"LASER_%s_%s_Sigma_Ped1/F",gainnames[gn],channames[ch]));
1741 m_ntuplePtr->Branch(Form(
"LASER_%s_%s_Sigma_Alpha",gainnames[gn],channames[ch]),&(
m_arrays->m_chan_SAlpha[chan]),Form(
"LASER_%s_%s_Sigma_Alpha/F",gainnames[gn],channames[ch]));
1748 m_ntuplePtr->Branch(
"LASER_Diode_1_ADC", &(
m_arrays->m_las_D_ADC[0][0]),
"LASER_Diode_1_ADC/I");
1749 m_ntuplePtr->Branch(
"LASER_Diode_2_ADC", &(
m_arrays->m_las_D_ADC[0][1]),
"LASER_Diode_2_ADC/I");
1750 m_ntuplePtr->Branch(
"LASER_Diode_3_ADC", &(
m_arrays->m_las_D_ADC[0][2]),
"LASER_Diode_3_ADC/I");
1751 m_ntuplePtr->Branch(
"LASER_Diode_4_ADC", &(
m_arrays->m_las_D_ADC[0][3]),
"LASER_Diode_4_ADC/I");
1753 m_ntuplePtr->Branch(
"LASER_Diode_1_Ped", &(
m_arrays->m_las_D_Ped[0][0]),
"LASER_Diode_1_Ped/F");
1754 m_ntuplePtr->Branch(
"LASER_Diode_2_Ped", &(
m_arrays->m_las_D_Ped[0][1]),
"LASER_Diode_2_Ped/F");
1755 m_ntuplePtr->Branch(
"LASER_Diode_3_Ped", &(
m_arrays->m_las_D_Ped[0][2]),
"LASER_Diode_3_Ped/F");
1756 m_ntuplePtr->Branch(
"LASER_Diode_4_Ped", &(
m_arrays->m_las_D_Ped[0][3]),
"LASER_Diode_4_Ped/F");
1758 m_ntuplePtr->Branch(
"LASER_Diode_1_Ped_RMS", &(
m_arrays->m_las_D_Ped_RMS[0][0]),
"LASER_Diode_1_Ped_RMS/F");
1759 m_ntuplePtr->Branch(
"LASER_Diode_2_Ped_RMS", &(
m_arrays->m_las_D_Ped_RMS[0][1]),
"LASER_Diode_2_Ped_RMS/F");
1760 m_ntuplePtr->Branch(
"LASER_Diode_3_Ped_RMS", &(
m_arrays->m_las_D_Ped_RMS[0][2]),
"LASER_Diode_3_Ped_RMS/F");
1761 m_ntuplePtr->Branch(
"LASER_Diode_4_Ped_RMS", &(
m_arrays->m_las_D_Ped_RMS[0][3]),
"LASER_Diode_4_Ped_RMS/F");
1763 m_ntuplePtr->Branch(
"LASER_Diode_1_Alpha", &(
m_arrays->m_las_D_Alpha[0][0]),
"LASER_Diode_1_Alpha/F");
1764 m_ntuplePtr->Branch(
"LASER_Diode_2_Alpha", &(
m_arrays->m_las_D_Alpha[0][1]),
"LASER_Diode_2_Alpha/F");
1765 m_ntuplePtr->Branch(
"LASER_Diode_3_Alpha", &(
m_arrays->m_las_D_Alpha[0][2]),
"LASER_Diode_3_Alpha/F");
1766 m_ntuplePtr->Branch(
"LASER_Diode_4_Alpha", &(
m_arrays->m_las_D_Alpha[0][3]),
"LASER_Diode_4_Alpha/F");
1768 m_ntuplePtr->Branch(
"LASER_Diode_1_Alpha_RMS", &(
m_arrays->m_las_D_Alpha_RMS[0][0]),
"LASER_Diode_1_Alpha_RMS/F");
1769 m_ntuplePtr->Branch(
"LASER_Diode_2_Alpha_RMS", &(
m_arrays->m_las_D_Alpha_RMS[0][1]),
"LASER_Diode_2_Alpha_RMS/F");
1770 m_ntuplePtr->Branch(
"LASER_Diode_3_Alpha_RMS", &(
m_arrays->m_las_D_Alpha_RMS[0][2]),
"LASER_Diode_3_Alpha_RMS/F");
1771 m_ntuplePtr->Branch(
"LASER_Diode_4_Alpha_RMS", &(
m_arrays->m_las_D_Alpha_RMS[0][3]),
"LASER_Diode_4_Alpha_RMS/F");
1773 m_ntuplePtr->Branch(
"LASER_Diode_1_AlphaPed", &(
m_arrays->m_las_D_AlphaPed[0][0]),
"LASER_Diode_1_AlphaPed/F");
1774 m_ntuplePtr->Branch(
"LASER_Diode_2_AlphaPed", &(
m_arrays->m_las_D_AlphaPed[0][1]),
"LASER_Diode_2_AlphaPed/F");
1775 m_ntuplePtr->Branch(
"LASER_Diode_3_AlphaPed", &(
m_arrays->m_las_D_AlphaPed[0][2]),
"LASER_Diode_3_AlphaPed/F");
1776 m_ntuplePtr->Branch(
"LASER_Diode_4_AlphaPed", &(
m_arrays->m_las_D_AlphaPed[0][3]),
"LASER_Diode_4_AlphaPed/F");
1778 m_ntuplePtr->Branch(
"LASER_Diode_1_AlphaPed_RMS", &(
m_arrays->m_las_D_AlphaPed_RMS[0][0]),
"LASER_Diode_1_AlphaPed_RMS/F");
1779 m_ntuplePtr->Branch(
"LASER_Diode_2_AlphaPed_RMS", &(
m_arrays->m_las_D_AlphaPed_RMS[0][1]),
"LASER_Diode_2_AlphaPed_RMS/F");
1780 m_ntuplePtr->Branch(
"LASER_Diode_3_AlphaPed_RMS", &(
m_arrays->m_las_D_AlphaPed_RMS[0][2]),
"LASER_Diode_3_AlphaPed_RMS/F");
1781 m_ntuplePtr->Branch(
"LASER_Diode_4_AlphaPed_RMS", &(
m_arrays->m_las_D_AlphaPed_RMS[0][3]),
"LASER_Diode_4_AlphaPed_RMS/F");
1783 m_ntuplePtr->Branch(
"LASER_PMT_1_ADC", &(
m_arrays->m_las_PMT_ADC[0][0]),
"LASER_PMT_1_ADC/I");
1784 m_ntuplePtr->Branch(
"LASER_PMT_2_ADC", &(
m_arrays->m_las_PMT_ADC[0][1]),
"LASER_PMT_2_ADC/I");
1786 m_ntuplePtr->Branch(
"LASER_PMT_1_TDC", &(
m_arrays->m_las_PMT_TDC[0][0]),
"LASER_PMT_1_TDC/I");
1787 m_ntuplePtr->Branch(
"LASER_PMT_2_TDC", &(
m_arrays->m_las_PMT_TDC[0][1]),
"LASER_PMT_2_TDC/I");
1789 m_ntuplePtr->Branch(
"LASER_PMT_1_Ped", &(
m_arrays->m_las_PMT_Ped[0][0]),
"LASER_PMT_1_Ped/F");
1790 m_ntuplePtr->Branch(
"LASER_PMT_2_Ped", &(
m_arrays->m_las_PMT_Ped[0][1]),
"LASER_PMT_2_Ped/F");
1792 m_ntuplePtr->Branch(
"LASER_PMT_1_Ped_RMS", &(
m_arrays->m_las_PMT_Ped_RMS[0][0]),
"LASER_PMT_1_Ped_RMS/F");
1793 m_ntuplePtr->Branch(
"LASER_PMT_2_Ped_RMS", &(
m_arrays->m_las_PMT_Ped_RMS[0][1]),
"LASER_PMT_2_Ped_RMS/F");
1804 //Clear Tree LASER variables
1835 memset(
m_arrays->m_las_D_Alpha_RMS, 0,
sizeof(
m_arrays->m_las_D_Alpha_RMS));
1837 memset(
m_arrays->m_las_D_AlphaPed_RMS, 0,
sizeof(
m_arrays->m_las_D_AlphaPed_RMS));
1842 memset(
m_arrays->m_las_PMT_Ped_RMS, 0,
sizeof(
m_arrays->m_las_PMT_Ped_RMS));
1856 std::string suf[3] = {
"_lo",
"_hi",
""};
1874 int imin = 2,
imax = 3,
ir = 0, is = 0;
1882 int size = sample_size * (
imax-imin);
1883 m_arrays->m_eMF = (
float *) malloc(size*
sizeof(
float));
1884 m_arrays->m_tMF = (
float *) malloc(size*
sizeof(
float));
1887 for (
int i = imin; i <
imax; ++i) {
1889 std::string f_suf(suf[i]);
1907 std::string samples =
"[4][64][48][" + std::to_string(
m_nSamples) +
"]/S";
2016 std::string f_samples =
"[4][64][48][" + std::to_string(
m_nSamples) +
"]/F";
2025 m_ntuplePtr->Branch(
"ROD_GlobalCRC",
m_arrays->m_ROD_GlobalCRC,
"ROD_GlobalCRC[4][64]/S");
2027 m_ntuplePtr->Branch(
"ROD_DMUBCIDErr",
m_arrays->m_ROD_DMUBCIDErr,
"ROD_DMUBCIDErr[4][64][16]/S");
2028 m_ntuplePtr->Branch(
"ROD_DMUmemoryErr",
m_arrays->m_ROD_DMUmemoryErr,
"ROD_DMUmemoryErr[4][64][16]/S");
2029 m_ntuplePtr->Branch(
"ROD_DMUSstrobeErr",
m_arrays->m_ROD_DMUSstrobeErr,
"ROD_DMUSstrobeErr[4][64][16]/S");
2030 m_ntuplePtr->Branch(
"ROD_DMUDstrobeErr",
m_arrays->m_ROD_DMUDstrobeErr,
"ROD_DMUDstrobeErr[4][64][16]/S");
2031 m_ntuplePtr->Branch(
"ROD_DMUheadformatErr",
m_arrays->m_ROD_DMUHeadformatErr,
"ROD_DMUheadformatErr[4][64][16]/S");
2032 m_ntuplePtr->Branch(
"ROD_DMUheadparityErr",
m_arrays->m_ROD_DMUHeadparityErr,
"ROD_DMUheadparityErr[4][64][16]/S");
2033 m_ntuplePtr->Branch(
"ROD_DMUdataformatErr",
m_arrays->m_ROD_DMUDataformatErr,
"ROD_DMUdataformatErr[4][64][16]/S");
2034 m_ntuplePtr->Branch(
"ROD_DMUdataparityErr",
m_arrays->m_ROD_DMUDataparityErr,
"ROD_DMUdataparityErr[4][64][16]/S");
2196 m_ntuplePtr->Branch(
"decisionTMDB",
m_arrays->m_decisionTMDB,
"decisionTMDB[4][64][4]/b");
2222 for (
int i = 0; i < 9; ++i) {
2223 br[i] = (mask % 10);
2272 for (
int ROS = 1; ROS < 5; ++ROS) {
2275 for (
int drawer = 0; drawer < 64; ++drawer) {
2278 bool drbad =
m_tileDCS->isStatusBad(ROS, drawer);
2286 <<
" DRSTATES=" <<
m_arrays->m_DRSTATES[rosI][drawer]
2287 <<
" DRSTATUS=" <<
m_arrays->m_DRSTATUS[rosI][drawer]
2288 <<
" => " << ((drbad) ?
"bad" :
"good") );
2292 for (
int channel=0; channel<48; ++channel){
2294 m_arrays->m_HV[rosI][drawer][channel] =
m_tileDCS->getChannelHV(ROS, drawer, channel);
2295 m_arrays->m_HVSET[rosI][drawer][channel] =
m_tileDCS->getChannelHVSet(ROS, drawer, channel);
2296 m_arrays->m_HVSTATUS[rosI][drawer][channel] =
m_tileDCS->getDCSHVStatus(ROS, drawer, channel);
2297 m_arrays->m_CHSTATUS[rosI][drawer][channel] =
m_tileDCS->getDCSStatus(ROS, drawer, channel)
2299 bool chbad =
m_tileDCS->isStatusBad(ROS, drawer, channel);
2301 if (chbad || chStat.
isBad()) {
2307 if (
m_tileDCS->isStatusHVBad(ROS, drawer, channel)) {
2311 if (
msgLvl(MSG::VERBOSE) || (chbad && !drbad)) {
2312 int pmt=abs(
m_cabling->channel2hole(ROS,channel));
2314 <<
" channel=" << channel <<
" pmt=" << pmt
2315 <<
" HV=" <<
m_arrays->m_HV[rosI][drawer][channel]
2316 <<
" HVSET=" <<
m_arrays->m_HVSET[rosI][drawer][channel]
2317 <<
" HVSTATUS=" <<
m_arrays->m_HVSTATUS[rosI][drawer][channel]
2318 <<
" CHSTATUS=" <<
m_arrays->m_CHSTATUS[rosI][drawer][channel]
2319 <<
" => " << ((chbad) ?
"bad" :
"good") );
2323 for (
int ind=0; ind<7; ++ind){
2324 m_arrays->m_TEMP[rosI][drawer][ind] =
m_tileDCS->getChannelHV(ROS, drawer, ind+48);
2326 <<
" TEMP" << ind+1 <<
"=" <<
m_arrays->m_TEMP[rosI][drawer][ind] );
2341 return StatusCode::SUCCESS;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#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.
Property holding a SG store/key/clid from which a ReadHandle is made.
#define CLEAR5(array, size)
#define CLEAR4(array, size)
#define sample_ind_TMDB(r, m, c, i)
#define CLEAR2(array, size)
#define sample_ind(r, m, c, i)
#define NAME3(s1, s2, s3)
#define CLEAR3(array, size)
#define N_ROS
Filename : TileAANtuple.h Author : Alexander Solodkov (based on TileTBAANtuple) Created : April,...
TileContainer< TileMuonReceiverObj > TileMuonReceiverContainer
TileContainer< TileL2 > TileL2Container
static const Attributes_t empty
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
This class groups all DetDescr information related to a CaloCell.
Identifier identify() const override final
cell identifier
float eta() const
cell eta
float phi() const
cell phi
IdentifierHash onl2() const
cell online identifier 2
IdentifierHash onl1() const
cell online identifier 1
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
const_iterator end() const noexcept
const_iterator begin() const noexcept
This is a "hash" representation of an Identifier.
CaloDetDescrElement * get_element(const Identifier &elementId) const
Property holding a SG store/key/clid from which a ReadHandle is made.
const std::string & key() const
Return the StoreGate ID for the referenced object.
bool empty() const
Test if the key is blank.
int m_l1ID[N_RODS]
Level1 ID from ROD header.
float m_sumEt_yy[N_DRAWERS]
Sum Et calcualted inside DSP.
StatusCode storeTMDBDigits(const EventContext &ctx)
float m_sumEt_zz[N_DRAWERS]
Sum Et recalculated offline using offline OF.
bool m_pmtOrder
change channel ordering to pmt ordering in ntuple
StatusCode storeRawChannels(const EventContext &ctx, const SG::ReadHandleKey< TileRawChannelContainer > &containerKey, float ene[N_ROS2][N_MODULES][N_CHANS], float time[N_ROS2][N_MODULES][N_CHANS], float chi2[N_ROS2][N_MODULES][N_CHANS], float ped[N_ROS2][N_MODULES][N_CHANS], bool fillAll)
/ Fill ntuple with data from TRC.
StatusCode storeBeamElements(const TileDQstatus &DQstatus)
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
void TRIGGER_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add TRIGGER variables t...
SG::ReadHandleKey< TileBeamElemContainer > m_beamElemContainerKey
bool m_calibMode
If data should be put in calib mode.
int m_finalUnit
calibrate everything to this level
void DIGI_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree DIGI variables...
SG::ReadHandleKey< TileLaserObject > m_laserObjectKey
bool m_useDspUnits
true if energy should be converted to units used in DSP
std::unique_ptr< Arrays > m_arrays
StatusCode initNTuple(const EventContext &ctx)
StatusCode storeTMDBRawChannel(const EventContext &ctxx)
uint32_t m_cispar[N_CISPAR]
StatusCode storeLaser(const EventContext &ctx)
float m_sumE_xx[N_DRAWERS]
Sum E recalculated offline using DSP raw channels.
ToolHandle< ITileDCSTool > m_tileDCS
float m_sumEz_xx[N_DRAWERS]
Sum Ez recalculated offline using DSP raw channels.
float m_sumEz_yy[N_DRAWERS]
Sum Ez calcualted inside DSP.
StatusCode initialize()
Alg standard interface function.
TileRawChannelUnit::UNIT m_rchUnit
Unit for TileRawChannels (ADC, pCb, MeV)
SG::ReadHandleKey< TileDigitsContainer > m_tileMuRcvDigitsContainerKey
StatusCode storeMFRawChannels(const EventContext &ctx, const SG::ReadHandleKey< TileRawChannelContainer > &containerKey, float *ene, float *time, float chi2[N_ROS2][N_MODULES][N_CHANS], float ped[N_ROS2][N_MODULES][N_CHANS], bool fillAll)
void LASER_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree LASER variabl...
SG::ReadHandleKey< TileL2Container > m_l2CntKey
void CISPAR_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree CISPAR variabl...
ServiceHandle< IFileMgr > m_fileMgr
bool m_bad[N_ROS][N_MODULES][N_CHANS]
TileRawChannelUnit::UNIT m_dspUnit
Unit for TileRawChannels in DSP.
void TMDB_addBranch(void)
SG::ReadHandleKey< TileDQstatus > m_DQstatusKey
SG::ReadHandleKey< TileRawChannelContainer > m_of1RawChannelContainerKey
std::vector< uint32_t > m_ROBID
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
main Tile Calibration tool
void fillCellMap(TTree *ntuplePtr)
///////////////////////////////////////////////////////////////////////////
ServiceHandle< IROBDataProviderSvc > m_robSvc
bool m_compareMode
If two sets of data should be compared (e.g.
float m_sumEt_xx[N_DRAWERS]
Sum Et recalculated offline using DSP raw channels.
int digiChannel2PMT(int fragType, int chan)
StatusCode storeDigits(const EventContext &ctx, const SG::ReadHandleKey< TileDigitsContainer > &containerKey, short *sample, short gain[N_ROS2][N_MODULES][N_CHANS], bool fillAll)
/ Fill Ntuple with info from TileDigits / Return true if the collection is empty
SG::ReadHandleKey< TileRawChannelContainer > m_dspRawChannelContainerKey
int m_evt
event number in a run
void TMDB_clearBranch(void)
SG::ReadHandleKey< TileDigitsContainer > m_fltDigitsContainerKey
StatusCode storeTMDBDecision(const EventContext &ctx)
int m_nSamples
number of samples
ToolHandle< TileL2Builder > m_l2Builder
ServiceHandle< ITHistSvc > m_thistSvc
TileAANtuple(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< TileRawChannelContainer > m_wienerRawChannelContainerKey
short CheckDMUFormat(uint32_t header)
bit_31 of the DMU header must be 1 and bit_17 of the DMU header must be 0
short CheckDMUParity(uint32_t header)
Parity of the DMU header should be odd.
SG::ReadHandleKey< TileRawChannelContainer > m_qieRawChannelContainerKey
int m_l1Type[N_RODS]
Level1 Type from ROD header.
float m_sumEz_zz[N_DRAWERS]
Sum Ez recalculated offline using offline OF.
bool m_calibrateEnergy
convert energy to new units or use amplitude from RawChannel directly
int m_lumiBlock
lumiblock number in a run
SG::ReadHandleKey< TileDigitsContainer > m_digitsContainerKey
uint32_t m_dspFlags
DSP flags from BS.
int m_trigType
trigger type (1=Phys, 2=Laser, 4=Ped, 8=CIS)
void CISPAR_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree CISPAR variab...
SG::ReadHandleKey< TileRawChannelContainer > m_fitcRawChannelContainerKey
bool m_checkDCS
if false, do not use TileDCS at all
void DIGI_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// /Clear Tree DIGI variabl...
float m_sumE_zz[N_DRAWERS]
Sum E recalculated offline using offline OF.
void LASER_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree LASER variable...
int m_HHMMSS
event time in HH:MM:SS
SG::ReadHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
SG::ReadCondHandleKey< TileHid2RESrcID > m_hid2RESrcIDKey
float m_sumE_yy[N_DRAWERS]
Sum E calcualted inside DSP.
const TileCablingService * m_cabling
cabling tool
SG::ReadHandleKey< TileRawChannelContainer > m_fitRawChannelContainerKey
bool m_bsInput
true if bytestream file is used
SG::ReadHandleKey< TileRawChannelContainer > m_mfRawChannelContainerKey
void TRIGGER_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree TRIGGER varia...
SG::ReadHandleKey< TileMuonReceiverContainer > m_tileMuRcvContainerKey
int m_evType[N_RODS]
Event Type from ROD header.
SG::ReadHandleKey< TileRawChannelContainer > m_optRawChannelContainerKey
SG::ReadHandleKey< TileRawChannelContainer > m_tileMuRcvRawChannelContainerKey
int m_DCSBranches
mask like 110101 - which DCS branches to fill
ToolHandle< ITileBadChanTool > m_tileBadChanTool
Tile Bad Channel tool.
const TileDetDescrManager * m_tileMgr
Pointer to TileDetDescrManager.
int m_evBCID[N_RODS]
Event BCID from ROD header.
char m_dateTime[32]
event date and time
StatusCode ntuple_clear()
const TileHWID * m_tileHWID
StatusCode ntuple_initialize(const EventContext &ctx, const TileDQstatus &DQstatus)
Class holding bad channel problems.
static const TileCablingService * getInstance()
get pointer to service instance
static std::string getDrawerString(unsigned int ros, unsigned int drawer)
Return the drawer name, e.g.
static unsigned int getDrawerIdxFromFragId(unsigned int fragId)
Returns a drawer hash from fragId This function assumes drawer context (i.e.
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
Class that holds Data Quality fragment information and provides functions to extract the data quality...
uint32_t calibMode() const
Calibration mode.
const uint32_t * cispar() const
CIS parameters.
calo_element_vec::const_iterator calo_element_const_iterator
int getFiltNumber() const
double getSigmaPedAlpha(const unsigned int i, const unsigned int gain=0) const
double getSigmaAlpha(const unsigned int i, const unsigned int gain=0) const
double getPedestalAlpha(const unsigned int i, const unsigned int gain=0) const
double getMean(int chan, int gain, int type) const
double getPumpDiodeTemp() const
int getPMADC(const unsigned int j, const unsigned int gain=0) const
double getPMSigmaPedestal(const unsigned int j, const unsigned int gain=0) const
double getAlpha(const unsigned int i, const unsigned int gain=0) const
double getDiodeCurrOrd() const
int getDiodeADC(const unsigned int i, const unsigned int gain=0) const
bool getQDCTimeout() const
double getDiodeSigmaPedestal(const unsigned int i, const unsigned int gain=0) const
double getDiodePedestal(const unsigned int i, const unsigned int gain=0) const
bool isSet(int chan, int gain, int type) const
int getTDC(const unsigned int j, const unsigned int gain=0) const
double getDiodeCurrMeas() const
bool getTDCTimeout() const
double getSigma(int chan, int gain, int type) const
double getPMPedestal(const unsigned int j, const unsigned int gain=0) const
@ OnlineMegaElectronVolts
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
Identifier cell_ID_index(int &index, int &pmt) const
HWIdentifier adc_HWID(void) const
double chi2(TH1 *h0, TH1 *h1)
int ir
counter of the current depth
std::vector< std::string > files
file names and file pointers
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())