18 #define EVTCOLLECTION_WRITE_CPP
40 NTuplePtr nt( m_evtTupleSvc.get(),
"/NTUPLES/EvtColl/Dir1/Dir2/Dir3/Collection" );
42 nt = m_evtTupleSvc->book(
"/NTUPLES/EvtColl/Dir1/Dir2/Dir3/Collection", CLID_ColumnWiseTuple,
"Hello World" );
45 status = nt->addItem(
"Ntrack", m_ntrkColl, 0, 5000 );
46 status = nt->addItem(
"Energy", m_eneColl );
47 status = nt->addItem(
"Track", m_trackItem );
48 status = nt->addItem(
"Addr", m_evtAddrColl );
49 status = nt->addItem(
"TrkMom", m_ntrkColl, m_trkMom );
50 status = nt->addItem(
"TrkMomFix", 100, m_trkMomFixed );
51 status = nt->addItem(
"Address", m_evtAddrCollEx );
56 status = nt->item(
"Ntrack", m_ntrkColl );
57 status = nt->item(
"Energy", m_eneColl );
58 status = nt->item(
"TrkMom", m_trkMom );
59 status = nt->item(
"Track", m_trackItem );
60 status = nt->item(
"TrkMomFix", m_trkMomFixed );
61 status = nt->item(
"Addr", m_evtAddrColl );
62 status = nt->item(
"Address", m_evtAddrCollEx );
70 auto&
log = msgStream();
74 int evt_num =
evt->event();
81 m_ntrkColl = trkCont->
size();
84 for (
size_t j = 0;
j < 100; ++
j ) { m_trkMomFixed[
j] = 0; }
86 for (
const auto& i : *trkCont ) {
87 float p =
sqrt( i->px() * i->px() + i->py() * i->py() + i->pz() * i->pz() );
88 if ( cnt < 5000 ) m_trkMom[cnt] = p;
89 if ( cnt < 5 ) m_trkMomFixed[cnt] = p;
93 m_trackItem = ( 0 == m_ntrkColl ) ? 0 : ( *trkCont->begin() );
94 if ( evt_num < 10 || evt_num % 500 == 0 ) {
97 <<
" ====== N(Track)=" << m_ntrkColl;
98 if ( m_ntrkColl < m_nMCcut.value() ) {
99 log <<
" FAILED selection (<" << m_nMCcut.value() <<
") ============" <<
endmsg;
101 log <<
" PASSED selection (>=" << m_nMCcut.value() <<
") ============" <<
endmsg;
102 return m_evtTupleSvc->writeRecord(
"/NTUPLES/EvtColl/Dir1/Dir2/Dir3/Collection" );
108 error() <<
"Unable to retrieve Event Header object" <<
endmsg;