BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
ValidRecExtTrackAlg Class Reference

#include <ValidRecExtTrackAlg.h>

Inheritance diagram for ValidRecExtTrackAlg:

Public Member Functions

 ValidRecExtTrackAlg (const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize ()
StatusCode execute ()
StatusCode finalize ()

Detailed Description

Definition at line 13 of file ValidRecExtTrackAlg.h.

Constructor & Destructor Documentation

◆ ValidRecExtTrackAlg()

ValidRecExtTrackAlg::ValidRecExtTrackAlg ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 9 of file ValidRecExtTrackAlg.cxx.

10 : Algorithm( name, pSvcLocator ) {
11
12 m_tuple1 = 0;
13}

Referenced by ValidRecExtTrackAlg().

Member Function Documentation

◆ execute()

StatusCode ValidRecExtTrackAlg::execute ( )

Definition at line 53 of file ValidRecExtTrackAlg.cxx.

53 {
54 MsgStream log( msgSvc(), name() );
55 SmartDataPtr<RecExtTrackCol> extTracks( eventSvc(), "/Event/Recon/RecExtTrackCol" );
56 if ( !extTracks )
57 {
58 log << MSG::ERROR << "Unable to retrieve RecExtTrackCol" << endmsg;
59 return StatusCode::FAILURE;
60 }
61 else
62 {
63 log << MSG::DEBUG << "RecExtTrackCol retrieved of size " << extTracks->size() << endmsg;
64 for ( RecExtTrackCol::iterator it = extTracks->begin(); it != extTracks->end(); it++ )
65 {
66
67 m_tof1 = ( *it )->tof1();
68 m_tof1Path = ( *it )->tof1Path();
69 m_tof1PosSigmaAlongX = ( *it )->tof1PosSigmaAlongX();
70 m_xTof1Pos = ( *it )->tof1Position().x();
71 m_yTof1Pos = ( *it )->tof1Position().y();
72 m_zTof1Pos = ( *it )->tof1Position().z();
73 m_emTof1_11 = ( *it )->tof1ErrorMatrix().fast( 1, 1 );
74 m_emTof1_33 = ( *it )->tof1ErrorMatrix().fast( 3, 3 );
75 m_emTof1_55 = ( *it )->tof1ErrorMatrix().fast( 5, 5 );
76 m_emTof1_66 = ( *it )->tof1ErrorMatrix().fast( 6, 6 );
77 m_emTof1_23 = ( *it )->tof1ErrorMatrix().fast( 2, 3 );
78 m_emTof1_35 = ( *it )->tof1ErrorMatrix().fast( 3, 5 );
79
80 StatusCode status1 = m_tuple1->write();
81 if ( status1.isFailure() ) { log << MSG::ERROR << "Cannot fill Ntuple1" << endmsg; }
82 }
83 }
84 return StatusCode::SUCCESS;
85}
IMessageSvc * msgSvc()

◆ finalize()

StatusCode ValidRecExtTrackAlg::finalize ( )

Definition at line 87 of file ValidRecExtTrackAlg.cxx.

87 {
88
89 MsgStream log( msgSvc(), name() );
90 log << MSG::INFO << "Finalizing..." << endmsg;
91 return StatusCode::SUCCESS;
92}

◆ initialize()

StatusCode ValidRecExtTrackAlg::initialize ( )

Definition at line 15 of file ValidRecExtTrackAlg.cxx.

15 {
16
17 StatusCode status;
18 MsgStream log( msgSvc(), name() );
19 log << MSG::INFO << "Booking Histograms" << endmsg;
20
21 // Book N-tuple 1
22 NTuplePtr nt1( ntupleSvc(), "FILE208/ExtTrk" );
23 if ( nt1 ) m_tuple1 = nt1;
24 else
25 {
26 m_tuple1 = ntupleSvc()->book( "FILE208/ExtTrk", CLID_RowWiseTuple, "ExtTrack parameter" );
27 if ( m_tuple1 )
28 {
29 status = m_tuple1->addItem( "tof1", m_tof1 );
30 status = m_tuple1->addItem( "tof1Path", m_tof1Path );
31 status = m_tuple1->addItem( "tof1PosSigmaAlongX", m_tof1PosSigmaAlongX );
32 status = m_tuple1->addItem( "xTof1Pos", m_xTof1Pos );
33 status = m_tuple1->addItem( "yTof1Pos", m_yTof1Pos );
34 status = m_tuple1->addItem( "zTof1Pos", m_zTof1Pos );
35 status = m_tuple1->addItem( "emTof1_11", m_emTof1_11 );
36 status = m_tuple1->addItem( "emTof1_33", m_emTof1_33 );
37 status = m_tuple1->addItem( "emTof1_55", m_emTof1_55 );
38 status = m_tuple1->addItem( "emTof1_66", m_emTof1_66 );
39 status = m_tuple1->addItem( "emTof1_23", m_emTof1_23 );
40 status = m_tuple1->addItem( "emTof1_35", m_emTof1_35 );
41 }
42 else
43 { // did not manage to book the N tuple....
44 log << MSG::ERROR << " Cannot book N-tuple:" << long( m_tuple1 ) << endmsg;
45 // return StatusCode::FAILURE;
46 }
47 }
48 log << MSG::INFO << "Finished booking NTuples" << endmsg;
49
50 return StatusCode::SUCCESS;
51}
INTupleSvc * ntupleSvc()

The documentation for this class was generated from the following files: