35#include "CaloDetDescr/CaloDetDescrElement.h"
46#include "eformat/ROBFragment.h"
47#include "eformat/FullEventFragment.h"
50#include "GaudiKernel/ITHistSvc.h"
55#include "boost/date_time/local_time/local_time.hpp"
56#include "boost/date_time/posix_time/posix_time.hpp"
61memset(array,0,sizeof(array))
63#define CLEAR1(array) \
64memset(array,-1,sizeof(array))
66#define CLEAR2(array,size) \
67 memset(array,0,sizeof(array)/size)
69#define CLEAR3(array,size) \
70 memset(array,-1,sizeof(array)/size)
73#define CLEAR4(array,size) \
74memset(array,0,sizeof(*array)*N_ROS2*N_MODULES*N_CHANS*m_nSamples/size)
77#define CLEAR5(array,size) \
78memset(array,-1,sizeof(*array)*N_ROS2*N_MODULES*N_CHANS*m_nSamples/size)
81#define CLEAR6(array) \
82memset(array,0,sizeof(*array)*N_ROS*N_MODULES*N_TMDBCHANS*m_nSamples)
90#define NAME3(s1,s2,s3) \
93#define NAME5(s1,s2,s3,s4,s5) \
94(s1+s2+s3+s4+s5).c_str()
96#define sample_ind(r,m,c,i) (((r*N_MODULES + m)*N_CHANS + c)*m_nSamples) + i
98#define sample_ind_TMDB(r,m,c,i) (((r*N_MODULES + m)*N_TMDBCHANS + c)*m_nSamples) + i
155 m_arrays->m_sample = (
short *) malloc(sample_size*
sizeof(
short));
156 m_arrays->m_sampleFlt = (
short *) malloc(sample_size*
sizeof(
short));
157 m_arrays->m_sampleTMDB = (
unsigned char *) malloc(sample_TMDB_size*
sizeof(
unsigned char));
179 return StatusCode::SUCCESS;
195 bool calibMode = (calib == 1);
196 if ( calibMode !=
m_calibMode && calib!=0xFFFFFFFF ) {
197 ATH_MSG_INFO(
"Calib mode from data is " << calibMode );
208 ATH_MSG_INFO(
"Final offline units are not set, will use DSP units" );
213 ATH_MSG_INFO(
"calibrateEnergy is disabled, don't want to use DSP units" );
236 return StatusCode::SUCCESS;
294 const eformat::FullEventFragment<const uint32_t*>*
event =
nullptr;
297 std::vector<const ROBDataProviderSvc::ROBF*> robf;
300 robFrag = (robf.size() > 0 ) ? robf[0] :
nullptr;
302 m_evTime =
event->bc_time_seconds();
306 m_l1ID[rod] = robFrag->rod_lvl1_id();
307 m_l1Type[rod] = robFrag->rod_lvl1_trigger_type();
308 m_evType[rod] = robFrag->rod_detev_type();
309 m_evBCID[rod] = robFrag->rod_bc_id();
318 m_run = ctx.eventID().run_number();
319 m_evt = ctx.eventID().event_number();
321 if ( ctx.eventID().lumi_block() ){
326 if (ctx.eventID().time_stamp() > 0) {
327 m_evTime = ctx.eventID().time_stamp();
331 using namespace boost::local_time;
332 using namespace boost::posix_time;
349 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"));
350 local_date_time gva_time(from_time_t(
m_evTime),gva_tz);
359 struct tm gva_tm(to_tm(gva_time));
360 strftime(
m_dateTime, 32,
"%Y-%b-%d %H:%M:%S %Z", &gva_tm);
361 m_HHMMSS = gva_tm.tm_hour*10000+gva_tm.tm_min*100+gva_tm.tm_sec;
379 ATH_MSG_WARNING(
"Some problems in execute - ntuple was not filled at all" );
392 return StatusCode::SUCCESS;
402 const char* gainnames[2] = {
"LG",
"HG"};
431 for(
int chan=0;chan<28;++chan){
439 for(
int chan=28;chan<32;++chan){
448 for(
int chan=0;chan<32;++chan){
462 msg(MSG::DEBUG) << gainnames[gn] <<
" CHAN " << ch <<
" SIG= " <<
m_arrays->m_chan[chan] <<
endmsg;
463 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;
464 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;
465 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;
466 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;
478 <<
" adc " <<
m_arrays->m_las_PMT_ADC[gn][i]
479 <<
" ped " <<
m_arrays->m_las_PMT_Ped[gn][i]
480 <<
" rms " <<
m_arrays->m_las_PMT_Ped_RMS[gn][i]
481 <<
" tdc " <<
m_arrays->m_las_PMT_TDC[gn][i] );
484 for (
unsigned int i=0; i<14; ++i) {
494 <<
" adc " <<
m_arrays->m_las_D_ADC[gn][i]
495 <<
" ped " <<
m_arrays->m_las_D_Ped[gn][i]
496 <<
" rms " <<
m_arrays->m_las_D_Ped_RMS[gn][i]
497 <<
" alp " <<
m_arrays->m_las_D_Alpha[gn][i]
498 <<
" rms " <<
m_arrays->m_las_D_Alpha_RMS[gn][i]
499 <<
" ape " <<
m_arrays->m_las_D_AlphaPed[gn][i]
500 <<
" rms " <<
m_arrays->m_las_D_AlphaPed_RMS[gn][i] );
505 return StatusCode::SUCCESS;
510 const uint32_t* cispar = DQstatus.
cispar();
516 if (
msgLvl(MSG::VERBOSE)) {
517 if (oldval != cispar[i]) {
521 }
else if (last == i-1) {
530 if (
msgLvl(MSG::VERBOSE)) {
541 return StatusCode::SUCCESS;
557 if (containerKey.
empty()) {
558 return StatusCode::FAILURE;
578 ATH_MSG_ERROR(
"RawChannel units are not ADC counts, can't apply DSP-like calibration" );
579 return StatusCode::FAILURE;
593 std::vector<float> sumE(3);
605 for(; itColl != itCollEnd; ++itColl) {
606 int fragId = (*itColl)->identify();
608 int drawer = fragId & 0x3F;
609 int ROS = (fragId>>8);
612 int rosH = rosI +
N_ROS;
616 <<
" Frag id 0x" << MSG::hex << fragId << MSG::dec
618 <<
" drawer " << drawer );
621 it = (*itColl)->begin();
622 itEnd = (*itColl)->end();
626 memset(E, 0,
sizeof(E));
627 memset(gain, 0,
sizeof(gain));
630 for(; it != itEnd; ++it) {
645 if(cmpCounter>48) rosI = rosH;
648 if(adc == 1) rosI = rosH;
662 ene[rosI][drawer][channel] = energy;
663 time[rosI][drawer][channel] = rch->
time();
665 ped[rosI][drawer][channel] = rch->
pedestal();
666 if (
m_arrays->m_gain[rosI][drawer][channel] < 0)
667 m_arrays->m_gain[rosI][drawer][channel] = adc;
679 if (
msgLvl(MSG::VERBOSE)) {
684 <<
" type " << std::min(
index,0)
686 <<
" time=" << rch->
time()
694 m_arrays->m_ROD_GlobalCRC[rosL][drawer] = (*itColl)->getFragGlobalCRC() & 1;
695 m_arrays->m_ROD_BCID[rosL][drawer] = (*itColl)->getFragDSPBCID();
696 m_arrays->m_ROD_DMUMask[rosL][drawer][0] = (*itColl)->getFragRODChipMask();
697 m_arrays->m_ROD_DMUMask[rosL][drawer][1] = (*itColl)->getFragFEChipMask();
699 for(
unsigned int dmu=0;dmu<
N_DMUS;dmu++) {
701 m_arrays->m_ROD_DMUBCIDErr[rosL][drawer][dmu] = ((*itColl)->getFragBCID() >> dmu) & 1;
702 m_arrays->m_ROD_DMUmemoryErr[rosL][drawer][dmu] = ((*itColl)->getFragMemoryPar() >> dmu) & 1;
703 m_arrays->m_ROD_DMUSstrobeErr[rosL][drawer][dmu] = ((*itColl)->getFragSstrobe() >> dmu) & 1;
704 m_arrays->m_ROD_DMUDstrobeErr[rosL][drawer][dmu] = ((*itColl)->getFragDstrobe() >> dmu) & 1;
705 m_arrays->m_ROD_DMUHeadformatErr[rosL][drawer][dmu] = ((*itColl)->getFragHeaderBit() >> dmu) & 1;
706 m_arrays->m_ROD_DMUHeadparityErr[rosL][drawer][dmu] = ((*itColl)->getFragHeaderPar() >> dmu) & 1;
707 m_arrays->m_ROD_DMUDataformatErr[rosL][drawer][dmu] = ((*itColl)->getFragSampleBit() >> dmu) & 1;
708 m_arrays->m_ROD_DMUDataparityErr[rosL][drawer][dmu] = ((*itColl)->getFragSamplePar() >> dmu) & 1;
709 m_arrays->m_ROD_DMUfeCRC[rosL][drawer][dmu] = ((*itColl)->getFragFEChipMask() >> dmu) & 1;
710 m_arrays->m_ROD_DMUrodCRC[rosL][drawer][dmu] = ((*itColl)->getFragRODChipMask() >> dmu) & 1;
736 for(; it != end; ++it) {
743 return StatusCode::SUCCESS;
755 if (containerKey.
empty()) {
756 return StatusCode::FAILURE;
761 SG::makeHandle (containerKey, ctx).get();
775 ATH_MSG_ERROR(
"RawChannel units are not ADC counts, can't apply DSP-like calibration" );
776 return StatusCode::FAILURE;
790 std::vector<float> sumE(3);
802 for (; itColl != itCollEnd; ++itColl) {
803 int fragId = (*itColl)->identify();
805 int drawer = fragId & 0x3F;
806 int ROS = (fragId >> 8);
809 int rosH = rosI +
N_ROS;
813 <<
" Frag id 0x" << MSG::hex << fragId << MSG::dec
815 <<
" drawer " << drawer );
818 it = (*itColl)->begin();
819 itEnd = (*itColl)->end();
823 memset(E, 0,
sizeof(E));
824 memset(gain, 0,
sizeof(gain));
826 for(; it != itEnd; ++it) {
841 if(cmpCounter>48) rosI = rosH;
844 if(adc == 1) rosI = rosH;
851 for (
int i = 0; i < 7; ++i) {
860 ene[
sample_ind(rosI,drawer,channel,i)] = energy;
864 ped[rosI][drawer][channel] = rch->
pedestal();
866 if (
m_arrays->m_gain[rosI][drawer][channel] < 0)
867 m_arrays->m_gain[rosI][drawer][channel] = adc;
870 E[channel] = ene[
sample_ind(rosI,drawer,channel,0)];
873 m_bad[rosL][drawer][channel] = (rch->
quality() > 15.99);
879 if (
msgLvl(MSG::VERBOSE)) {
884 <<
" type " << std::min(
index,0)
885 <<
" ene=" << ene[
sample_ind(rosI,drawer,channel,0)]
886 <<
" time=" << rch->
time()
894 m_arrays->m_ROD_GlobalCRC[rosL][drawer] = (*itColl)->getFragGlobalCRC() & 1;
895 m_arrays->m_ROD_BCID[rosL][drawer] = (*itColl)->getFragDSPBCID();
896 m_arrays->m_ROD_DMUMask[rosL][drawer][0] = (*itColl)->getFragRODChipMask();
897 m_arrays->m_ROD_DMUMask[rosL][drawer][1] = (*itColl)->getFragFEChipMask();
899 for(
unsigned int dmu=0;dmu<
N_DMUS;dmu++) {
901 m_arrays->m_ROD_DMUBCIDErr[rosL][drawer][dmu] = ((*itColl)->getFragBCID() >> dmu) & 1;
902 m_arrays->m_ROD_DMUmemoryErr[rosL][drawer][dmu] = ((*itColl)->getFragMemoryPar() >> dmu) & 1;
903 m_arrays->m_ROD_DMUSstrobeErr[rosL][drawer][dmu] = ((*itColl)->getFragSstrobe() >> dmu) & 1;
904 m_arrays->m_ROD_DMUDstrobeErr[rosL][drawer][dmu] = ((*itColl)->getFragDstrobe() >> dmu) & 1;
905 m_arrays->m_ROD_DMUHeadformatErr[rosL][drawer][dmu] = ((*itColl)->getFragHeaderBit() >> dmu) & 1;
906 m_arrays->m_ROD_DMUHeadparityErr[rosL][drawer][dmu] = ((*itColl)->getFragHeaderPar() >> dmu) & 1;
907 m_arrays->m_ROD_DMUDataformatErr[rosL][drawer][dmu] = ((*itColl)->getFragSampleBit() >> dmu) & 1;
908 m_arrays->m_ROD_DMUDataparityErr[rosL][drawer][dmu] = ((*itColl)->getFragSamplePar() >> dmu) & 1;
909 m_arrays->m_ROD_DMUfeCRC[rosL][drawer][dmu] = ((*itColl)->getFragFEChipMask() >> dmu) & 1;
910 m_arrays->m_ROD_DMUrodCRC[rosL][drawer][dmu] = ((*itColl)->getFragRODChipMask() >> dmu) & 1;
936 for(; it != end; ++it) {
943 return StatusCode::SUCCESS;
957 if (containerKey.
empty())
958 return StatusCode::FAILURE;
964 bool emptyColl =
true;
971 for(; itColl != itCollEnd; ++itColl) {
972 int fragId = (*itColl)->identify();
973 int drawer = fragId & 0x3F;
974 int ROS = (fragId>>8);
977 int rosH = rosI +
N_ROS;
979 if (
msgLvl(MSG::VERBOSE)) {
981 <<
" Frag id 0x" << MSG::hex << fragId << MSG::dec
983 <<
" drawer " << drawer );
987 <<
" BCID=" << (*itColl)->getFragBCID() << MSG::hex
988 <<
" CRC=0x" << ((*itColl)->getFragCRC()&0xffff)
989 <<
" DMUMask=0x" << ((*itColl)->getFragDMUMask()&0xffff) << MSG::dec );
992 <<
" Lvl1Type=" << (*itColl)->getLvl1Type()
993 <<
" EvBCID=" << (*itColl)->getRODBCID()
994 <<
" EvType=" << (*itColl)->getDetEvType() );
1006 rod = (((rod>>2)<<1) | (rod&1));
1009 m_l1ID[rod] = (*itColl)->getLvl1Id();
1010 m_l1Type[rod] = (*itColl)->getLvl1Type();
1011 m_evType[rod] = (*itColl)->getDetEvType();
1012 m_evBCID[rod] = (*itColl)->getRODBCID();
1027 m_arrays->m_rodBCID[rosL][drawer] = (*itColl)->getRODBCID();
1028 m_arrays->m_fragSize[rosL][drawer]=(*itColl)->getFragSize();
1030 m_arrays->m_slinkCRC[rosL][drawer][0] = ((*itColl)->getFragCRC()>>16) & 0xffff;
1031 m_arrays->m_dmuMask[rosL][drawer][0] = ((*itColl)->getFragDMUMask()>>16) & 0xffff;
1032 m_arrays->m_slinkCRC[rosL][drawer][1] = (*itColl)->getFragCRC() & 0xffff;
1033 m_arrays->m_dmuMask[rosL][drawer][1] = (*itColl)->getFragDMUMask() & 0xffff;
1035 uint32_t CRCmask = (*itColl)->getFragDMUMask();
1036 uint32_t fe_crc = CRCmask & 0xFFFF;
1037 uint32_t rod_crc = CRCmask >> 16;
1039 const std::vector<uint32_t> & headerVec = (*itColl)->getFragChipHeaderWords();
1040 unsigned int headsize = std::min(16U,
static_cast<unsigned int>(headerVec.size()));
1042 for (
unsigned int ih = 0; ih < headsize; ++ih) {
1044 m_arrays->m_DMUheader[rosL][drawer][ih] = headerVec[ih];
1045 m_arrays->m_DMUbcid[rosL][drawer][ih] = (headerVec[ih] & 0xFFF);
1048 m_arrays->m_DMUmemoryErr[rosL][drawer][ih] = (headerVec[ih] >> 25 & 0x1);
1049 m_arrays->m_DMUSstrobeErr[rosL][drawer][ih] = (headerVec[ih] >> 24 & 0x1);
1050 m_arrays->m_DMUDstrobeErr[rosL][drawer][ih] = (headerVec[ih] >> 23 & 0x1);
1052 m_arrays->m_feCRC[rosL][drawer][ih] = (fe_crc >> ih & 0x1);
1053 m_arrays->m_rodCRC[rosL][drawer][ih] = (rod_crc >> ih & 0x1);
1057 const std::vector<uint32_t> & headerVecHi = (*itColl)->getFragChipHeaderWordsHigh();
1058 unsigned int headsizehi = std::min(16U,
static_cast<unsigned int>(headerVecHi.size()));
1060 for (
unsigned int ih = 0; ih < headsizehi; ++ih) {
1062 m_arrays->m_DMUheader[rosH][drawer][ih] = headerVecHi[ih];
1063 m_arrays->m_DMUbcid[rosH][drawer][ih] = (headerVecHi[ih] & 0xFFF);
1066 m_arrays->m_DMUmemoryErr[rosH][drawer][ih] = (headerVecHi[ih] >> 25 & 0x1);
1067 m_arrays->m_DMUSstrobeErr[rosH][drawer][ih] = (headerVecHi[ih] >> 24 & 0x1);
1068 m_arrays->m_DMUDstrobeErr[rosH][drawer][ih] = (headerVecHi[ih] >> 23 & 0x1);
1070 m_arrays->m_feCRC[rosH][drawer][ih] = -1 ;
1071 m_arrays->m_rodCRC[rosH][drawer][ih] = -1;
1079 for (; it != itEnd; ++it) {
1094 if (cmpCounter > 48) rosI = rosH;
1097 if (gain == 1) rosI = rosH;
1102 a_gain[rosI][drawer][channel] = gain;
1105 const std::vector<float> & sampleVec = digit->samples();
1106 int siz = sampleVec.size();
1107 if (
msgLvl(MSG::VERBOSE)) {
1109 digit->cell_ID_index(
index,pmt);
1110 msg(MSG::VERBOSE) <<
"TD ch " << channel
1112 <<
" type " << std::min(
index,0) <<
" {";
1113 for(
int i=0;i<siz;i++) {
1114 msg(MSG::VERBOSE) <<(int)sampleVec[i] <<
" ";
1120 if (
msgLvl(MSG::VERBOSE))
1123 if (
msgLvl(MSG::VERBOSE))
1126 for (
int n = 0; n < siz; ++n) {
1127 a_sample[
sample_ind(rosI,drawer,channel,n)] = (short) sampleVec[n];
1133 if (emptyColl)
return StatusCode::FAILURE;
1134 else return StatusCode::SUCCESS;
1139 const char * part[4] = {
"LBA",
"LBC",
"EBA",
"EBC"};
1157 for(; it != itLast; ++it) {
1161 const std::vector<bool> & decision = obj->GetDecision();
1162 int siz = decision.size();
1166 int fragId = (*it)->identify();
1167 int drawer = fragId & 0x3F;
1168 int ros = ((fragId>>8) & 0xF) - 1;
1169 bcid[2] = ((fragId>>24) & 0xF);
1170 bcid[1] = ((fragId>>20) & 0xF);
1171 bcid[0] = ((fragId>>16) & 0XF);
1178 for (
int n = 0; n < siz; ++n) {
1179 m_arrays->m_decisionTMDB[ros][drawer][n] = (
unsigned char) decision[n];
1182 for (
int n = 0; n < 3; ++n) {
1183 m_arrays->m_bcidTMDB[ros][drawer][n] = (
unsigned char) bcid[n];
1186 if (
msgLvl(MSG::VERBOSE)) {
1187 std::stringstream
ss;
1188 for (
int n = 0; n < siz; ++n) {
1189 ss<<std::setw(5)<<(int)
m_arrays->m_decisionTMDB[ros][drawer][n];
1191 ATH_MSG_VERBOSE(
"TMDB 0x" <<MSG::hex<< fragId <<MSG::dec<<
" "<< part[ros]
1192 << std::setfill(
'0') << std::setw(2)
1193 << drawer+1 << std::setfill(
' ')
1194 <<
" BCID check " << bcid[0] <<
"/"<< bcid[1] <<
"/"<< bcid[2] <<
" decision: " <<
ss.str() );
1200 return StatusCode::SUCCESS;
1205 const char * part[4] = {
"LBA",
"LBC",
"EBA",
"EBC"};
1220 for(; itColl1 != itCollEnd1; ++itColl1) {
1227 int fragId = (*itColl1)->identify();
1228 int drawer = fragId & 0x3F;
1229 int ros = (fragId>>8) - 1;
1232 ATH_MSG_VERBOSE(
"TMDB 0x" <<MSG::hex<< fragId <<MSG::dec<<
" "<< part[ros]
1233 << std::setfill(
'0') << std::setw(2)
1234 << drawer+1 << std::setfill(
' ') );
1236 for (; it1 != itEnd1; ++it1) {
1239 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 ");
1246 const std::vector<float> & sampleVec = digit->samples();
1247 int siz = sampleVec.size();
1254 for (
int n = 0; n < siz; ++n) {
1258 if (
msgLvl(MSG::VERBOSE)) {
1259 std::stringstream
ss;
1260 for (
int n = 0; n < siz; ++n) {
1272 return StatusCode::SUCCESS;
1277 const char * part[4] = {
"LBA",
"LBC",
"EBA",
"EBC"};
1292 for(; itColl2 != itCollEnd2; ++itColl2) {
1299 int fragId = (*itColl2)->identify();
1300 int drawer = fragId & 0x3F;
1301 int ros = (fragId>>8) - 1;
1304 ATH_MSG_VERBOSE(
"TMDB 0x" <<MSG::hex<< fragId <<MSG::dec<<
" "<< part[ros]
1305 << std::setfill(
'0') << std::setw(2)
1306 << drawer+1 << std::setfill(
' ') );
1308 for (; it2 != itEnd2; ++it2) {
1311 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 ");
1317 m_arrays->m_eTMDB[ros][drawer][ichannel] =
rc -> amplitude();
1327 return StatusCode::SUCCESS;
1340 return StatusCode::SUCCESS;
1352 return StatusCode::SUCCESS;
1360 std::vector<std::string>
files;
1361 m_fileMgr->getFiles(Io::ROOT, ( Io::WRITE | Io::CREATE ),
files);
1373 std::string ntupleID =
m_ntupleID.value() +
"_map";
1375 TTree* ntuplePtr =
new TTree(ntupleID.c_str(),
"TileCal-CellMap");
1377 ATH_MSG_ERROR(
"Problem registering TileRec CellMap Tree" );
1403 std::string ntupleDCS =
"Tile_DCS";
1404 m_DCSntuplePtr =
new TTree(ntupleDCS.c_str(),
"TileCal-DCS data");
1411 return StatusCode::SUCCESS;
1444 float eta[4][64][48];
1445 float phi[4][64][48];
1446 short tower[4][64][48];
1447 short sample[4][64][48];
1448 short ind[4][64][48];
1449 short pmt[4][64][48];
1450 short bad[4][64][48][2];
1460 ntuplePtr->Branch(
"eta",
eta,
"eta[4][64][48]/F");
1461 ntuplePtr->Branch(
"phi",
phi,
"phi[4][64][48]/F");
1462 ntuplePtr->Branch(
"tower", tower,
"tower[4][64][48]/S");
1463 ntuplePtr->Branch(
"sample", sample,
"sample[4][64][48]/S");
1464 ntuplePtr->Branch(
"ind", ind,
"ind[4][64][48]/S");
1465 ntuplePtr->Branch(
"pmt", pmt,
"pmt[4][64][48]/S");
1466 ntuplePtr->Branch(
"bad",
bad,
"bad[4][64][48][2]/S");
1471 for (; itr != end; ++itr) {
1475 for (
int i = 0; i < 2; ++i) {
1484 pm =
m_cabling->channel2hole(ROS, chan);
1485 if ((ROS == 3 && drawer == 14) || (ROS == 4 && drawer == 17)) {
1486 if (pm < 0) pm = -pm;
1487 if (chan == 2 || chan == 3) pm = -pm;
1491 eta[rosI][drawer][chan] = caloDDE->
eta();
1492 phi[rosI][drawer][chan] = caloDDE->
phi();
1493 tower[rosI][drawer][chan] =
m_tileID->tower(cell_id);
1494 sample[rosI][drawer][chan] =
m_tileID->sample(cell_id);
1495 ind[rosI][drawer][chan] =
index;
1496 pmt[rosI][drawer][chan] = pm;
1503 if (
detStore()->retrieve(mbtsMgr).isFailure() ) {
1504 ATH_MSG_WARNING(
"Unable to retrieve MbtsDetDescrManager from DetectorStore" );
1507 for (
int ROS = 1; ROS < 5; ++ROS) {
1509 for (
int drawer = 0; drawer < 64; ++drawer) {
1510 for (
int chan = 0; chan < 48; ++chan) {
1511 for (
int adc = 0; adc < 2; ++adc) {
1517 ind[rosI][drawer][chan] =
index;
1518 pmt[rosI][drawer][chan] = 1;
1522 if (caloDDE->
z() > 0.0)
1523 eta[rosI][drawer][chan] = fabs(caloDDE->
eta());
1525 eta[rosI][drawer][chan] = -fabs(caloDDE->
eta());
1526 phi[rosI][drawer][chan] = caloDDE->
phi();
1557 std::string dim =
"[" + std::to_string(
N_RODS) +
"]/I";
1568 //Clear Tree TRIGGER variables
1601 //Clear Tree CISPAR variables
1622 const char* gainnames[2] = {
"LG",
"HG"};
1623 const char* channames[16] = {
"Diode0",
"Diode1",
"Diode2",
"Diode3",
"Diode4",
"Diode5",
"Diode6",
"Diode7",
1624 "Diode8",
"Diode9",
"ExtCIS0",
"IntCIS",
"DiodePhocal",
"ExtCIS1",
"PMT1",
"PMT2"};
1639 for(
int chan=0;chan<32;++chan){
1642 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]));
1643 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]));
1644 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]));
1645 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]));
1646 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]));
1647 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]));
1648 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]));
1649 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]));
1650 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]));
1657 m_ntuplePtr->Branch(
"LASER_Diode_1_ADC", &(
m_arrays->m_las_D_ADC[0][0]),
"LASER_Diode_1_ADC/I");
1658 m_ntuplePtr->Branch(
"LASER_Diode_2_ADC", &(
m_arrays->m_las_D_ADC[0][1]),
"LASER_Diode_2_ADC/I");
1659 m_ntuplePtr->Branch(
"LASER_Diode_3_ADC", &(
m_arrays->m_las_D_ADC[0][2]),
"LASER_Diode_3_ADC/I");
1660 m_ntuplePtr->Branch(
"LASER_Diode_4_ADC", &(
m_arrays->m_las_D_ADC[0][3]),
"LASER_Diode_4_ADC/I");
1662 m_ntuplePtr->Branch(
"LASER_Diode_1_Ped", &(
m_arrays->m_las_D_Ped[0][0]),
"LASER_Diode_1_Ped/F");
1663 m_ntuplePtr->Branch(
"LASER_Diode_2_Ped", &(
m_arrays->m_las_D_Ped[0][1]),
"LASER_Diode_2_Ped/F");
1664 m_ntuplePtr->Branch(
"LASER_Diode_3_Ped", &(
m_arrays->m_las_D_Ped[0][2]),
"LASER_Diode_3_Ped/F");
1665 m_ntuplePtr->Branch(
"LASER_Diode_4_Ped", &(
m_arrays->m_las_D_Ped[0][3]),
"LASER_Diode_4_Ped/F");
1667 m_ntuplePtr->Branch(
"LASER_Diode_1_Ped_RMS", &(
m_arrays->m_las_D_Ped_RMS[0][0]),
"LASER_Diode_1_Ped_RMS/F");
1668 m_ntuplePtr->Branch(
"LASER_Diode_2_Ped_RMS", &(
m_arrays->m_las_D_Ped_RMS[0][1]),
"LASER_Diode_2_Ped_RMS/F");
1669 m_ntuplePtr->Branch(
"LASER_Diode_3_Ped_RMS", &(
m_arrays->m_las_D_Ped_RMS[0][2]),
"LASER_Diode_3_Ped_RMS/F");
1670 m_ntuplePtr->Branch(
"LASER_Diode_4_Ped_RMS", &(
m_arrays->m_las_D_Ped_RMS[0][3]),
"LASER_Diode_4_Ped_RMS/F");
1672 m_ntuplePtr->Branch(
"LASER_Diode_1_Alpha", &(
m_arrays->m_las_D_Alpha[0][0]),
"LASER_Diode_1_Alpha/F");
1673 m_ntuplePtr->Branch(
"LASER_Diode_2_Alpha", &(
m_arrays->m_las_D_Alpha[0][1]),
"LASER_Diode_2_Alpha/F");
1674 m_ntuplePtr->Branch(
"LASER_Diode_3_Alpha", &(
m_arrays->m_las_D_Alpha[0][2]),
"LASER_Diode_3_Alpha/F");
1675 m_ntuplePtr->Branch(
"LASER_Diode_4_Alpha", &(
m_arrays->m_las_D_Alpha[0][3]),
"LASER_Diode_4_Alpha/F");
1677 m_ntuplePtr->Branch(
"LASER_Diode_1_Alpha_RMS", &(
m_arrays->m_las_D_Alpha_RMS[0][0]),
"LASER_Diode_1_Alpha_RMS/F");
1678 m_ntuplePtr->Branch(
"LASER_Diode_2_Alpha_RMS", &(
m_arrays->m_las_D_Alpha_RMS[0][1]),
"LASER_Diode_2_Alpha_RMS/F");
1679 m_ntuplePtr->Branch(
"LASER_Diode_3_Alpha_RMS", &(
m_arrays->m_las_D_Alpha_RMS[0][2]),
"LASER_Diode_3_Alpha_RMS/F");
1680 m_ntuplePtr->Branch(
"LASER_Diode_4_Alpha_RMS", &(
m_arrays->m_las_D_Alpha_RMS[0][3]),
"LASER_Diode_4_Alpha_RMS/F");
1682 m_ntuplePtr->Branch(
"LASER_Diode_1_AlphaPed", &(
m_arrays->m_las_D_AlphaPed[0][0]),
"LASER_Diode_1_AlphaPed/F");
1683 m_ntuplePtr->Branch(
"LASER_Diode_2_AlphaPed", &(
m_arrays->m_las_D_AlphaPed[0][1]),
"LASER_Diode_2_AlphaPed/F");
1684 m_ntuplePtr->Branch(
"LASER_Diode_3_AlphaPed", &(
m_arrays->m_las_D_AlphaPed[0][2]),
"LASER_Diode_3_AlphaPed/F");
1685 m_ntuplePtr->Branch(
"LASER_Diode_4_AlphaPed", &(
m_arrays->m_las_D_AlphaPed[0][3]),
"LASER_Diode_4_AlphaPed/F");
1687 m_ntuplePtr->Branch(
"LASER_Diode_1_AlphaPed_RMS", &(
m_arrays->m_las_D_AlphaPed_RMS[0][0]),
"LASER_Diode_1_AlphaPed_RMS/F");
1688 m_ntuplePtr->Branch(
"LASER_Diode_2_AlphaPed_RMS", &(
m_arrays->m_las_D_AlphaPed_RMS[0][1]),
"LASER_Diode_2_AlphaPed_RMS/F");
1689 m_ntuplePtr->Branch(
"LASER_Diode_3_AlphaPed_RMS", &(
m_arrays->m_las_D_AlphaPed_RMS[0][2]),
"LASER_Diode_3_AlphaPed_RMS/F");
1690 m_ntuplePtr->Branch(
"LASER_Diode_4_AlphaPed_RMS", &(
m_arrays->m_las_D_AlphaPed_RMS[0][3]),
"LASER_Diode_4_AlphaPed_RMS/F");
1692 m_ntuplePtr->Branch(
"LASER_PMT_1_ADC", &(
m_arrays->m_las_PMT_ADC[0][0]),
"LASER_PMT_1_ADC/I");
1693 m_ntuplePtr->Branch(
"LASER_PMT_2_ADC", &(
m_arrays->m_las_PMT_ADC[0][1]),
"LASER_PMT_2_ADC/I");
1695 m_ntuplePtr->Branch(
"LASER_PMT_1_TDC", &(
m_arrays->m_las_PMT_TDC[0][0]),
"LASER_PMT_1_TDC/I");
1696 m_ntuplePtr->Branch(
"LASER_PMT_2_TDC", &(
m_arrays->m_las_PMT_TDC[0][1]),
"LASER_PMT_2_TDC/I");
1698 m_ntuplePtr->Branch(
"LASER_PMT_1_Ped", &(
m_arrays->m_las_PMT_Ped[0][0]),
"LASER_PMT_1_Ped/F");
1699 m_ntuplePtr->Branch(
"LASER_PMT_2_Ped", &(
m_arrays->m_las_PMT_Ped[0][1]),
"LASER_PMT_2_Ped/F");
1701 m_ntuplePtr->Branch(
"LASER_PMT_1_Ped_RMS", &(
m_arrays->m_las_PMT_Ped_RMS[0][0]),
"LASER_PMT_1_Ped_RMS/F");
1702 m_ntuplePtr->Branch(
"LASER_PMT_2_Ped_RMS", &(
m_arrays->m_las_PMT_Ped_RMS[0][1]),
"LASER_PMT_2_Ped_RMS/F");
1713 //Clear Tree LASER variables
1744 memset(
m_arrays->m_las_D_Alpha_RMS, 0,
sizeof(
m_arrays->m_las_D_Alpha_RMS));
1746 memset(
m_arrays->m_las_D_AlphaPed_RMS, 0,
sizeof(
m_arrays->m_las_D_AlphaPed_RMS));
1751 memset(
m_arrays->m_las_PMT_Ped_RMS, 0,
sizeof(
m_arrays->m_las_PMT_Ped_RMS));
1765 std::string suf[3] = {
"_lo",
"_hi",
""};
1783 int imin = 2,
imax = 3,
ir = 0, is = 0;
1791 int size = sample_size * (
imax-imin);
1792 m_arrays->m_eMF = (
float *) malloc(
size*
sizeof(
float));
1793 m_arrays->m_tMF = (
float *) malloc(
size*
sizeof(
float));
1796 for (
int i = imin; i <
imax; ++i) {
1798 std::string f_suf(suf[i]);
1816 std::string samples =
"[4][64][48][" + std::to_string(
m_nSamples.value()) +
"]/S";
1925 std::string f_samples =
"[4][64][48][" + std::to_string(
m_nSamples.value()) +
"]/F";
1934 m_ntuplePtr->Branch(
"ROD_GlobalCRC",
m_arrays->m_ROD_GlobalCRC,
"ROD_GlobalCRC[4][64]/S");
1936 m_ntuplePtr->Branch(
"ROD_DMUBCIDErr",
m_arrays->m_ROD_DMUBCIDErr,
"ROD_DMUBCIDErr[4][64][16]/S");
1937 m_ntuplePtr->Branch(
"ROD_DMUmemoryErr",
m_arrays->m_ROD_DMUmemoryErr,
"ROD_DMUmemoryErr[4][64][16]/S");
1938 m_ntuplePtr->Branch(
"ROD_DMUSstrobeErr",
m_arrays->m_ROD_DMUSstrobeErr,
"ROD_DMUSstrobeErr[4][64][16]/S");
1939 m_ntuplePtr->Branch(
"ROD_DMUDstrobeErr",
m_arrays->m_ROD_DMUDstrobeErr,
"ROD_DMUDstrobeErr[4][64][16]/S");
1940 m_ntuplePtr->Branch(
"ROD_DMUheadformatErr",
m_arrays->m_ROD_DMUHeadformatErr,
"ROD_DMUheadformatErr[4][64][16]/S");
1941 m_ntuplePtr->Branch(
"ROD_DMUheadparityErr",
m_arrays->m_ROD_DMUHeadparityErr,
"ROD_DMUheadparityErr[4][64][16]/S");
1942 m_ntuplePtr->Branch(
"ROD_DMUdataformatErr",
m_arrays->m_ROD_DMUDataformatErr,
"ROD_DMUdataformatErr[4][64][16]/S");
1943 m_ntuplePtr->Branch(
"ROD_DMUdataparityErr",
m_arrays->m_ROD_DMUDataparityErr,
"ROD_DMUdataparityErr[4][64][16]/S");
2105 m_ntuplePtr->Branch(
"decisionTMDB",
m_arrays->m_decisionTMDB,
"decisionTMDB[4][64][4]/b");
2131 for (
int i = 0; i < 9; ++i) {
2132 br[i] = (mask % 10);
2181 for (
int ROS = 1; ROS < 5; ++ROS) {
2184 for (
int drawer = 0; drawer < 64; ++drawer) {
2187 bool drbad =
m_tileDCS->isStatusBad(ROS, drawer);
2195 <<
" DRSTATES=" <<
m_arrays->m_DRSTATES[rosI][drawer]
2196 <<
" DRSTATUS=" <<
m_arrays->m_DRSTATUS[rosI][drawer]
2197 <<
" => " << ((drbad) ?
"bad" :
"good") );
2201 for (
int channel=0; channel<48; ++channel){
2203 m_arrays->m_HV[rosI][drawer][channel] =
m_tileDCS->getChannelHV(ROS, drawer, channel);
2204 m_arrays->m_HVSET[rosI][drawer][channel] =
m_tileDCS->getChannelHVSet(ROS, drawer, channel);
2205 m_arrays->m_HVSTATUS[rosI][drawer][channel] =
m_tileDCS->getDCSHVStatus(ROS, drawer, channel);
2206 m_arrays->m_CHSTATUS[rosI][drawer][channel] =
m_tileDCS->getDCSStatus(ROS, drawer, channel)
2208 bool chbad =
m_tileDCS->isStatusBad(ROS, drawer, channel);
2210 if (chbad || chStat.
isBad()) {
2216 if (
m_tileDCS->isStatusHVBad(ROS, drawer, channel)) {
2220 if (
msgLvl(MSG::VERBOSE) || (chbad && !drbad)) {
2221 int pmt=abs(
m_cabling->channel2hole(ROS,channel));
2223 <<
" channel=" << channel <<
" pmt=" << pmt
2224 <<
" HV=" <<
m_arrays->m_HV[rosI][drawer][channel]
2225 <<
" HVSET=" <<
m_arrays->m_HVSET[rosI][drawer][channel]
2226 <<
" HVSTATUS=" <<
m_arrays->m_HVSTATUS[rosI][drawer][channel]
2227 <<
" CHSTATUS=" <<
m_arrays->m_CHSTATUS[rosI][drawer][channel]
2228 <<
" => " << ((chbad) ?
"bad" :
"good") );
2232 for (
int ind=0; ind<7; ++ind){
2233 m_arrays->m_TEMP[rosI][drawer][ind] =
m_tileDCS->getChannelHV(ROS, drawer, ind+48);
2235 <<
" TEMP" << ind+1 <<
"=" <<
m_arrays->m_TEMP[rosI][drawer][ind] );
2250 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_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_VERBOSE(x,...)
#define ATH_MSG_INFO(x,...)
Helpers for checking error return status codes and reporting errors.
Property holding a SG store/key/clid from which a ReadHandle is made.
size_t size() const
Number of registered mappings.
#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.
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.
Gaudi::Property< int > m_nSamples
number of samples
int m_l1ID[N_RODS]
Level1 ID from ROD header.
Gaudi::Property< int > m_compressSettings
float m_sumEt_yy[N_DRAWERS]
Sum Et calcualted inside DSP.
StatusCode storeTMDBDigits(const EventContext &ctx)
Gaudi::Property< bool > m_calibMode
If data should be put in calib mode.
StatusCode storeDCS(const EventContext &ctx)
float m_sumEt_zz[N_DRAWERS]
Sum Et recalculated offline using offline OF.
Gaudi::Property< bool > m_reduced
StatusCode execute(const EventContext &ctx)
Execute method.
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
void DIGI_addBranch(void)
//////////////////////////////////////////////////////////////////////////// /Add Tree DIGI variables...
Gaudi::Property< int64_t > m_treeSize
SG::ReadHandleKey< TileLaserObject > m_laserObjectKey
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.
Gaudi::Property< std::string > m_streamName
ToolHandle< ITileDCSTool > m_tileDCS
float m_sumEz_xx[N_DRAWERS]
Sum Ez recalculated offline using DSP raw channels.
Gaudi::Property< bool > m_pmtOrder
change channel ordering to pmt ordering in ntuple
Gaudi::Property< bool > m_checkDCS
if false, do not use TileDCS at all
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]
Gaudi::Property< bool > m_compareMode
If two sets of data should be compared (e.g.
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
void fillCellMap(TTree *ntuplePtr, const EventContext &ctx)
///////////////////////////////////////////////////////////////////////////
Gaudi::Property< int > m_finalUnit
calibrate everything to this level
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
main Tile Calibration tool
ServiceHandle< IROBDataProviderSvc > m_robSvc
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
Gaudi::Property< bool > m_calibrateEnergy
convert energy to new units or use amplitude from RawChannel directly
void TMDB_clearBranch(void)
SG::ReadHandleKey< TileDigitsContainer > m_fltDigitsContainerKey
StatusCode storeTMDBDecision(const EventContext &ctx)
ToolHandle< TileL2Builder > m_l2Builder
ServiceHandle< ITHistSvc > m_thistSvc
TileAANtuple(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< TileRawChannelContainer > m_wienerRawChannelContainerKey
Gaudi::Property< bool > m_bsInput
true if bytestream file is used
Gaudi::Property< int > m_DCSBranches
mask like 110101 - which DCS branches to fill
Gaudi::Property< int > m_skipEvents
Gaudi::Property< std::string > m_ntupleID
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.
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
Gaudi::Property< bool > m_useDspUnits
true if energy should be converted to units used in DSP
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
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
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
TileRawChannelUnit::UNIT get_unit() 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())