Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
40 #include "CaloDetDescr/CaloDetDescrElement.h"
51 #include "eformat/ROBFragment.h"
52 #include "eformat/FullEventFragment.h"
55 #include "GaudiKernel/ITHistSvc.h"
56 #include "GaudiKernel/ThreadLocalContext.h"
61 #include "boost/date_time/local_time/local_time.hpp"
62 #include "boost/date_time/posix_time/posix_time.hpp"
66 #define CLEAR(array) \
67 memset(array,0,sizeof(array))
69 #define CLEAR1(array) \
70 memset(array,-1,sizeof(array))
72 #define CLEAR2(array,size) \
73 memset(array,0,sizeof(array)/size)
75 #define CLEAR3(array,size) \
76 memset(array,-1,sizeof(array)/size)
79 #define CLEAR4(array,size) \
80 memset(array,0,sizeof(*array)*N_ROS2*N_MODULES*N_CHANS*m_nSamples/size)
83 #define CLEAR5(array,size) \
84 memset(array,-1,sizeof(*array)*N_ROS2*N_MODULES*N_CHANS*m_nSamples/size)
87 #define CLEAR6(array) \
88 memset(array,0,sizeof(*array)*N_ROS*N_MODULES*N_TMDBCHANS*m_nSamples)
93 #define NAME2(s1,s2) \
96 #define NAME3(s1,s2,s3) \
99 #define NAME5(s1,s2,s3,s4,s5) \
100 (s1+s2+s3+s4+s5).c_str()
102 #define sample_ind(r,m,c,i) (((r*N_MODULES + m)*N_CHANS + c)*m_nSamples) + i
104 #define sample_ind_TMDB(r,m,c,i) (((r*N_MODULES + m)*N_TMDBCHANS + c)*m_nSamples) + i
132 , m_las_Temperature(0)
146 , m_thistSvc(
"THistSvc",
name)
151 , m_tileBadChanTool(
"TileBadChanTool")
152 , m_tileToolEmscale(
"TileCondToolEmscale")
249 m_arrays->m_sampleFlt = (
short *)
malloc(sample_size*
sizeof(
short));
250 m_arrays->m_sampleTMDB = (
unsigned char *)
malloc(sample_TMDB_size*
sizeof(
unsigned char));
271 return StatusCode::SUCCESS;
287 bool calibMode = (
calib == 1);
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();
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"};
577 for (
unsigned int i=0;
i<14; ++
i) {
593 <<
" rms " <<
m_arrays->m_las_D_AlphaPed_RMS[
gn][
i] );
598 return StatusCode::SUCCESS;
610 if (oldval != cispar[
i]) {
614 }
else if (last ==
i-1) {
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));
723 for(;
it != itEnd; ++
it) {
738 if(cmpCounter>48) rosI = rosH;
741 if(
adc == 1) rosI = rosH;
779 <<
" time=" << rch->
time()
787 m_arrays->m_ROD_GlobalCRC[rosL][
drawer] = (*itColl)->getFragGlobalCRC() & 1;
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;
836 return StatusCode::SUCCESS;
848 if (containerKey.
empty()) {
849 return StatusCode::FAILURE;
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));
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) {
979 <<
" time=" << rch->
time()
987 m_arrays->m_ROD_GlobalCRC[rosL][
drawer] = (*itColl)->getFragGlobalCRC() & 1;
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;
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;
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() );
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;
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) {
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);
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) {
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);
1172 for (;
it != itEnd; ++
it) {
1187 if (cmpCounter > 48) rosI = rosH;
1190 if (
gain == 1) rosI = rosH;
1198 const std::vector<float> & sampleVec =
digit->samples();
1199 int siz = sampleVec.size();
1206 for(
int i=0;
i<siz;
i++) {
1219 for (
int n = 0;
n < siz; ++
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) {
1275 for (
int n = 0;
n < 3; ++
n) {
1280 std::stringstream
ss;
1281 for (
int n = 0;
n < siz; ++
n) {
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;
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) {
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;
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 ");
1420 return StatusCode::SUCCESS;
1433 return StatusCode::SUCCESS;
1445 return StatusCode::SUCCESS;
1453 std::vector<std::string>
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];
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) {
1577 if ((ROS == 3 &&
drawer == 14) || (ROS == 4 &&
drawer == 17)) {
1578 if (pm < 0) pm = -pm;
1579 if (
chan == 2 ||
chan == 3) pm = -pm;
1595 ATH_MSG_WARNING(
"Unable to retrieve MbtsDetDescrManager from DetectorStore" );
1598 for (
int ROS = 1; ROS < 5; ++ROS) {
1613 if (caloDDE->
z() > 0.0)
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"};
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");
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);
1887 for (
int i = imin;
i <
imax; ++
i) {
1889 std::string f_suf(suf[
i]);
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) {
2272 for (
int ROS = 1; ROS < 5; ++ROS) {
2288 <<
" => " << ((drbad) ?
"bad" :
"good") );
2301 if (chbad || chStat.
isBad()) {
2319 <<
" => " << ((chbad) ?
"bad" :
"good") );
2341 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
Property holding a SG store/key/clid from which a ReadHandle is made.
void TMDB_clearBranch(void)
char m_dateTime[32]
event date and time
IdentifierHash onl2() const
cell online identifier 2
bool m_checkDCS
if false, do not use TileDCS at all
int getTDC(const unsigned int j, const unsigned int gain=0) const
Const iterator class for DataVector/DataList.
float m_sumE_yy[N_DRAWERS]
Sum E calcualted inside DSP.
#define CLEAR2(array, size)
TileRawChannelUnit::UNIT m_dspUnit
Unit for TileRawChannels in DSP.
StatusCode storeTMDBDigits(const EventContext &ctx)
Scalar phi() const
phi method
#define N_ROS
Filename : TileAANtuple.h Author : Alexander Solodkov (based on TileTBAANtuple) Created : April,...
static const TileCablingService * getInstance()
get pointer to service instance
Scalar eta() const
pseudorapidity method
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
int m_lumiBlock
lumiblock number in a run
double getPumpDiodeTemp() const
float pedestal(void) const
uint32_t getRobFromFragID(int frag_id) const
make a ROB SrcID for a fragment ID
ToolHandle< TileROD_Decoder > m_decoder
void fillCellMap(TTree *ntuplePtr)
///////////////////////////////////////////////////////////////////////////
uint32_t calibMode() const
Calibration mode.
ToolHandle< TileL2Builder > m_l2Builder
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
SG::ReadHandle< T > makeHandle(const SG::View *view, const SG::ReadHandleKey< T > &rhKey, const EventContext &context)
navigate from the TrigComposite to nearest view and fetch object from it
int m_finalUnit
calibrate everything to this level
Class holding bad channel problems.
#define sample_ind_TMDB(r, m, c, i)
int m_HHMMSS
event time in HH:MM:SS
ServiceHandle< ITHistSvc > m_thistSvc
double getAlpha(const unsigned int i, const unsigned int gain=0) const
int m_evBCID[N_RODS]
Event BCID from ROD header.
int sample(const Identifier &id) const
bool m_compareMode
If two sets of data should be compared (e.g.
ToolHandle< ITileBadChanTool > m_tileBadChanTool
Tile Bad Channel tool.
StatusCode initNTuple(const EventContext &ctx)
double getDiodeCurrOrd() const
#define CLEAR4(array, size)
bool msgLvl(const MSG::Level lvl) const
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
float m_sumEz_xx[N_DRAWERS]
Sum Ez recalculated offline using DSP raw channels.
bool m_pmtOrder
change channel ordering to pmt ordering in ntuple
Identifier h2s_cell_id_index(const HWIdentifier &id, int &index, int &pmt) const
SG::ReadHandleKey< TileLaserObject > m_laserObjectKey
int tower(const Identifier &id) const
std::vector< uint32_t > m_ROBID
bool m_calibrateEnergy
convert energy to new units or use amplitude from RawChannel directly
float m_sumE_xx[N_DRAWERS]
Sum E recalculated offline using DSP raw channels.
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
float m_sumEt_xx[N_DRAWERS]
Sum Et recalculated offline using DSP raw channels.
bool empty() const
Test if the key is blank.
#define CLEAR5(array, size)
HWIdentifier adc_HWID(void) const
float m_sumEz_zz[N_DRAWERS]
Sum Ez recalculated offline using offline OF.
void LASER_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree LASER variabl...
float time(int ind=0) const
bool isSet(int chan, int gain, int type) const
StatusCode storeTMDBDecision(const EventContext &ctx)
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
int m_evType[N_RODS]
Event Type from ROD header.
This class provides conversion between fragment ID and RESrcID.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
SG::ReadHandleKey< TileRawChannelContainer > m_wienerRawChannelContainerKey
int m_DCSBranches
mask like 110101 - which DCS branches to fill
int getPMADC(const unsigned int j, const unsigned int gain=0) const
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
StatusCode storeBeamElements(const TileDQstatus &DQstatus)
int getFiltNumber() const
StatusCode storeTMDBRawChannel(const EventContext &ctxx)
double getSigmaPedAlpha(const unsigned int i, const unsigned int gain=0) const
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
IdentifierHash onl1() const
cell online identifier 1
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)
float quality(int ind=0) const
void LASER_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree LASER variable...
Class that holds Data Quality fragment information and provides functions to extract the data quality...
Identifier identify() const override final
cell identifier
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
const TileCablingService * m_cabling
cabling tool
#define NAME3(s1, s2, s3)
float m_sumEt_zz[N_DRAWERS]
Sum Et recalculated offline using offline OF.
double getMean(int chan, int gain, int type) const
calo_element_const_iterator tile_cell_begin() const
SG::ReadHandleKey< TileRawChannelContainer > m_fitRawChannelContainerKey
bool getTDCTimeout() const
float amplitude(int ind=0) const
SG::ReadHandleKey< TileRawChannelContainer > m_of1RawChannelContainerKey
POOL::TEvent event(POOL::TEvent::kClassAccess)
StatusCode ntuple_initialize(const EventContext &ctx, const TileDQstatus &DQstatus)
TileAANtuple(const std::string &name, ISvcLocator *pSvcLocator)
bool m_calibMode
If data should be put in calib mode.
std::vector< HWIdentifier >::iterator it1
::StatusCode StatusCode
StatusCode definition for legacy code.
uint32_t get_bsflags() const
SG::ReadHandleKey< TileRawChannelContainer > m_dspRawChannelContainerKey
void TRIGGER_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree TRIGGER varia...
uint32_t m_cispar[N_CISPAR]
#define CLEAR3(array, size)
double chi2(TH1 *h0, TH1 *h1)
SG::ReadHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
bool m_bsInput
true if bytestream file is used
StatusCode initialize()
Alg standard interface function.
calo_element_const_iterator tile_cell_end() const
void CISPAR_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// Clear Tree CISPAR variab...
float m_sumE_zz[N_DRAWERS]
Sum E recalculated offline using offline OF.
SG::ReadHandleKey< TileRawChannelContainer > m_optRawChannelContainerKey
CaloDetDescrElement * get_element(const Identifier &elementId) const
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.
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
main Tile Calibration tool
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
SG::ReadHandleKey< TileL2Container > m_l2CntKey
outFile
Comment Out Those You do not wish to run.
SG::ReadHandleKey< TileRawChannelContainer > m_mfRawChannelContainerKey
ServiceHandle< IFileMgr > m_fileMgr
bool getQDCTimeout() const
float m_sumEt_yy[N_DRAWERS]
Sum Et calcualted inside DSP.
double getDiodeSigmaPedestal(const unsigned int i, const unsigned int gain=0) const
uint32_t m_dspFlags
DSP flags from BS.
std::string to_string(const DetectorType &type)
int getDiodeADC(const unsigned int i, const unsigned int gain=0) const
void DIGI_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree DIGI variables...
bool m_bad[N_ROS][N_MODULES][N_CHANS]
Helpers for checking error return status codes and reporting errors.
SG::ReadHandleKey< TileMuonReceiverContainer > m_tileMuRcvContainerKey
setEventNumber setTimeStamp bcid
SG::ReadHandleKey< TileBeamElemContainer > m_beamElemContainerKey
double getPMPedestal(const unsigned int j, const unsigned int gain=0) const
SG::ReadHandleKey< TileDigitsContainer > m_digitsContainerKey
SG::ReadHandleKey< TileRawChannelContainer > m_fitcRawChannelContainerKey
const uint32_t * cispar() const
CIS parameters.
double getDiodeCurrMeas() const
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
HWIdentifier adc_id(int ros, int drawer, int channel, int adc) const
adc HWIdentifer
int ir
counter of the current depth
static std::string getDrawerString(unsigned int ros, unsigned int drawer)
Return the drawer name, e.g.
void DIGI_clearBranch(void)
//////////////////////////////////////////////////////////////////////////// /Clear Tree DIGI variabl...
const TileDetDescrManager * m_tileMgr
Pointer to TileDetDescrManager.
Identifier cell_ID_index(int &index, int &pmt) const
StatusCode ntuple_clear()
SG::ReadHandleKey< TileRawChannelContainer > m_tileMuRcvRawChannelContainerKey
SG::ReadHandleKey< TileDigitsContainer > m_tileMuRcvDigitsContainerKey
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
def time(flags, cells_name, *args, **kw)
#define ATH_MSG_WARNING(x)
int m_trigType
trigger type (1=Phys, 2=Laser, 4=Ped, 8=CIS)
double getPMSigmaPedestal(const unsigned int j, const unsigned int gain=0) const
static int channel2hole(int ros, int channel)
double getDiodePedestal(const unsigned int i, const unsigned int gain=0) const
StatusCode storeLaser(const EventContext &ctx)
float m_sumEz_yy[N_DRAWERS]
Sum Ez calcualted inside DSP.
calo_element_vec::const_iterator calo_element_const_iterator
float eta() const
cell eta
float phi() const
cell phi
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
int digiChannel2PMT(int fragType, int chan)
int m_l1Type[N_RODS]
Level1 Type from ROD header.
short CheckDMUFormat(uint32_t header)
bit_31 of the DMU header must be 1 and bit_17 of the DMU header must be 0
void TRIGGER_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add TRIGGER variables t...
int m_l1ID[N_RODS]
Level1 ID from ROD header.
double getSigmaAlpha(const unsigned int i, const unsigned int gain=0) const
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
SG::ReadHandleKey< TileRawChannelContainer > m_qieRawChannelContainerKey
const TileHWID * m_tileHWID
SG::ReadHandleKey< TileDQstatus > m_DQstatusKey
short CheckDMUParity(uint32_t header)
Parity of the DMU header should be odd.
TileRawChannelUnit::UNIT m_rchUnit
Unit for TileRawChannels (ADC, pCb, MeV)
bool m_useDspUnits
true if energy should be converted to units used in DSP
#define sample_ind(r, m, c, i)
void TMDB_addBranch(void)
static unsigned int getDrawerIdxFromFragId(unsigned int fragId)
Returns a drawer hash from fragId This function assumes drawer context (i.e.
void CISPAR_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree CISPAR variabl...
ToolHandle< ITileDCSTool > m_tileDCS
int m_nSamples
number of samples
SG::ReadHandleKey< TileDigitsContainer > m_fltDigitsContainerKey
ServiceHandle< IROBDataProviderSvc > m_robSvc
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
int m_evt
event number in a run
double getSigma(int chan, int gain, int type) const
@ OnlineMegaElectronVolts
double getPedestalAlpha(const unsigned int i, const unsigned int gain=0) const
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
std::unique_ptr< Arrays > m_arrays