| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

RawData2Tree Class Reference

#include <RawData2Tree.h>

Inheritance diagram for RawData2Tree:

[legend]
Collaboration diagram for RawData2Tree:
[legend]
List of all members.

Public Member Functions

 RawData2Tree (const std::string &name, ISvcLocator *svcloc)
 Constructor has to be in this form.
virtual ~RawData2Tree ()
StatusCode initialize ()
 Three mandatory member functions of any algorithm.
StatusCode execute ()
StatusCode finalize ()
virtual StatusCode sysExecute ()
void put (IDataProviderSvc *svc, DataObject *object, const std::string &address, const bool useRootInTES=true) const
void put (DataObject *object, const std::string &address, const bool useRootInTES=true) const
Gaudi::Utils::GetData< TYPE
>::return_type 
get (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
Gaudi::Utils::GetData< TYPE
>::return_type 
get (const std::string &location, const bool useRootInTES=true) const
TYPE * getDet (IDataProviderSvc *svc, const std::string &location) const
TYPE * getDet (const std::string &location) const
bool exist (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
bool exist (const std::string &location, const bool useRootInTES=true) const
bool existDet (IDataProviderSvc *svc, const std::string &location) const
bool existDet (const std::string &location) const
TYPE * getOrCreate (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
TYPE * getOrCreate (const std::string &location, const bool useRootInTES=true) const
bool registerContext () const
INTupleSvcevtColSvc () const
IAlgContextSvccontextSvc () const
TOOL * tool (const std::string &type, const std::string &name, const IInterface *parent=0, bool create=true) const
TOOL * tool (const std::string &type, const IInterface *parent=0, bool create=true) const
SERVICE * svc (const std::string &name, const bool create=true) const
IUpdateManagerSvcupdMgrSvc () const
IDataProviderSvcfastContainersSvc () const
StatusCode Error (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
StatusCode Warning (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
StatusCode Print (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const MSG::Level lev=MSG::INFO) const
StatusCode Assert (const bool ok, const std::string &message="", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
StatusCode Assert (const bool ok, const char *message, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
StatusCode Exception (const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
StatusCode Exception (const std::string &msg, const std::exception &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
StatusCode Exception (const std::string &msg="no message", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
MsgStreammsgStream (const MSG::Level level) const
MsgStreamalways () const
MsgStreamfatal () const
MsgStreamerr () const
MsgStreamerror () const
MsgStreamwarning () const
MsgStreaminfo () const
MsgStreamdebug () const
MsgStreamverbose () const
MsgStreammsg () const
const Statisticscounters () const
StatEntitycounter (const std::string &tag) const
MSG::Level msgLevel () const
bool msgLevel (const MSG::Level level) const
void resetMsgStream () const
bool typePrint () const
bool propsPrint () const
bool statPrint () const
bool errorsPrint () const
long printStat (const MSG::Level level=MSG::ALWAYS) const
long printErrors (const MSG::Level level=MSG::ALWAYS) const
long printProps (const MSG::Level level=MSG::ALWAYS) const
void registerCondition (const std::string &condition, StatusCode(CallerClass::*mf)()=NULL)
void registerCondition (const std::string &condition, CondType *&condPtrDest, StatusCode(CallerClass::*mf)()=NULL)
void registerCondition (char *condition, StatusCode(CallerClass::*mf)()=NULL)
void registerCondition (TargetClass *condition, StatusCode(CallerClass::*mf)()=NULL)
StatusCode runUpdate ()
TransientFastContainer< T > * getFastContainer (const std::string &location, typename TransientFastContainer< T >::size_type initial=0)
StatusCode release (const IInterface *interface) const
unsigned long release ()
const std::string & context () const
const std::string & rootInTES () const
double globalTimeOffset () const
virtual StatusCode sysStart ()
virtual StatusCode sysInitialize ()
virtual StatusCode sysReinitialize ()
virtual StatusCode sysRestart ()
virtual StatusCode sysStop ()
virtual StatusCode sysFinalize ()
virtual StatusCode sysBeginRun ()
virtual StatusCode sysEndRun ()
virtual const std::string & name () const
virtual const std::string & version () const
virtual StatusCode configure ()
virtual StatusCode terminate ()
virtual StatusCode start ()
virtual StatusCode stop ()
virtual StatusCode reinitialize ()
virtual StatusCode restart ()
virtual bool isExecuted () const
virtual void setExecuted (bool state)
virtual void resetExecuted ()
virtual StatusCode beginRun ()
virtual StatusCode endRun ()
virtual Gaudi::StateMachine::State FSMState () const
virtual Gaudi::StateMachine::State targetFSMState () const
virtual bool isEnabled () const
virtual bool filterPassed () const
virtual void setFilterPassed (bool state)
StatusCode service (const std::string &name, T *&psvc, bool createIf=true) const
StatusCode service (const std::string &svcType, const std::string &svcName, T *&psvc) const
void setOutputLevel (int level)
IAuditorSvcauditorSvc () const
IChronoStatSvcchronoSvc () const
IChronoStatSvcchronoStatService () const
IDataProviderSvcdetSvc () const
IDataProviderSvcdetDataService () const
IConversionSvcdetCnvSvc () const
IConversionSvcdetDataCnvService () const
IDataProviderSvceventSvc () const
IDataProviderSvcevtSvc () const
IDataProviderSvceventDataService () const
IConversionSvceventCnvSvc () const
IConversionSvceventDataCnvService () const
IHistogramSvchistoSvc () const
IHistogramSvchistogramDataService () const
IMessageSvcmsgSvc () const
IMessageSvcmessageService () const
INTupleSvcntupleSvc () const
INTupleSvcntupleService () const
IRndmGenSvcrandSvc () const
IToolSvctoolSvc () const
IExceptionSvcexceptionSvc () const
ISvcLocatorserviceLocator () const
ISvcLocatorsvcLoc () const
StatusCode createSubAlgorithm (const std::string &type, const std::string &name, Algorithm *&pSubAlg)
std::vector< Algorithm * > * subAlgorithms () const
virtual StatusCode setProperty (const Property &p)
virtual StatusCode setProperty (const std::string &s)
virtual StatusCode setProperty (const std::string &n, const std::string &v)
StatusCode setProperty (const std::string &name, const TYPE &value)
virtual StatusCode getProperty (Property *p) const
virtual const PropertygetProperty (const std::string &name) const
virtual StatusCode getProperty (const std::string &n, std::string &v) const
virtual const std::vector<
Property * > & 
getProperties () const
StatusCode setProperties ()
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
IMonitorSvcmonitorSvc () const
void declareInfo (const std::string &name, const T &var, const std::string &desc) const
void declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const
unsigned long addRef ()
StatusCode queryInterface (const InterfaceID &riid, void **)

Static Public Member Functions

static const InterfaceIDinterfaceID ()
static const InterfaceIDinterfaceID ()
static const InterfaceIDinterfaceID ()

Public Attributes

 SUCCESS
 NO_INTERFACE
 VERSMISMATCH
 LAST_ERROR

Protected Types

typedef std::map< std::string,
StatEntity
Statistics
typedef std::map< std::string,
unsigned int > 
Counter
typedef std::vector< IAlgTool * > AlgTools
typedef std::pair< IInterface *,
std::string > 
ServiceEntry
typedef std::vector< ServiceEntryServices

Protected Member Functions

StatusCode releaseTool (const IAlgTool *tool) const
StatusCode releaseSvc (const IInterface *svc) const
bool isInitialized () const
bool isFinalized () const
int outputLevel () const
IntegerPropertyoutputLevelProperty ()
void initOutputLevel (Property &prop)

Static Protected Attributes

static const bool IgnoreRootInTES
static const bool UseRootInTES

Private Member Functions

StatusCode bookNtuple ()
void processPmtCrate (const DayaBay::ReadoutHeader *roh, const DayaBay::DaqCrate *daqCrate)
void processReadout (const DayaBay::ReadoutHeader *roh)

Private Attributes

int m_printFreq
int m_execNum
bool m_checkGen
bool m_checkReadout
NTuple::Tuplem_ntuple0
NTuple::Item< long > m_eventType
NTuple::Item< long > m_nVertex
NTuple::Array< float > m_verX0
NTuple::Array< float > m_verY0
NTuple::Array< float > m_verZ0
NTuple::Item< long > m_nParticle
NTuple::Array< float > m_verPx
NTuple::Array< float > m_verPy
NTuple::Array< float > m_verPz
NTuple::Tuplem_ntuple1
NTuple::Item< long > m_run
NTuple::Item< long > m_event
NTuple::Item< long > m_det
NTuple::Item< long > m_trigNum
NTuple::Item< long > m_trigSecond
NTuple::Item< long > m_trigNanoSec
NTuple::Item< long > m_trigType
NTuple::Item< long > m_nHit
NTuple::Item< long > m_nChannel
NTuple::Item< long > m_nTrigger
NTuple::Array< long > m_board
NTuple::Array< long > m_channel
NTuple::Array< long > m_ring
NTuple::Array< long > m_column
NTuple::Array< long > m_wall
NTuple::Array< long > m_spot
NTuple::Array< long > m_inout
NTuple::Array< long > m_adc
NTuple::Array< long > m_tdc
NTuple::Array< long > m_cycle
NTuple::Array< long > m_preAdc
NTuple::Array< long > m_range
NTuple::Array< long > m_hitCount
NTuple::Array< long > m_multiTdc
NTuple::Array< long > m_triggerSec
NTuple::Array< long > m_triggerNano
NTuple::Array< long > m_triggerType
NTuple::Array< long > m_triggerHSum
NTuple::Array< long > m_triggerESumComp
NTuple::Array< long > m_triggerESumAdc
std::string m_cableSvcName
ICableSvcm_cableSvc
std::string m_pmtGeomSvcName
IPmtGeomInfoSvcm_pmtGeomSvc

Detailed Description

Definition at line 16 of file RawData2Tree.h.


Constructor & Destructor Documentation

RawData2Tree::RawData2Tree ( const std::string &  name,
ISvcLocator svcloc 
)

Constructor has to be in this form.

RawData2Tree::~RawData2Tree (  )  [virtual]

Definition at line 41 of file RawData2Tree.cc.

00042 {
00043 }


Member Function Documentation

StatusCode RawData2Tree::initialize (  )  [virtual]

Three mandatory member functions of any algorithm.

Reimplemented from GaudiAlgorithm.

Definition at line 45 of file RawData2Tree.cc.

00046 {
00047   debug() << "initialize()" << endreq;
00048 
00049   // Get Cable Service
00050   m_cableSvc = svc<ICableSvc>(m_cableSvcName, true);
00051 
00052   // Get PmtGeomInfo Service
00053   m_pmtGeomSvc = svc<IPmtGeomInfoSvc>(m_pmtGeomSvcName, true);
00054 
00055   // Book Ntuple
00056   StatusCode sc = bookNtuple();
00057   if(sc!=StatusCode::SUCCESS) {
00058     error() << "Can't book ntuple!" << endreq;
00059   }
00060 
00061   return sc;
00062 }

StatusCode RawData2Tree::execute (  )  [virtual]

Reimplemented from GaudiAlgorithm.

Definition at line 64 of file RawData2Tree.cc.

00065 {
00066   debug() << "execute() ______________________________ start" << endreq;
00067 
00068   if(m_printFreq>0 && m_execNum%m_printFreq==0) cout << "---------- " << m_execNum << endl;
00069 
00070   //----------------------------------------------------------------------------------------
00071   //GenHeader
00072 
00073   if(m_checkGen) {
00074 
00075     GenHeader* gh = get<GenHeader>("/Event/Gen/GenHeader");
00076 
00077     if (gh == 0) {
00078       error() << " =======> Requested Object can not be accessable." << endreq;
00079       return StatusCode::FAILURE;
00080     }
00081 
00082     if (m_printFreq > 0 && m_execNum % m_printFreq == 0) {
00083       //m_log << MSG::INFO << "Gen Header: " << *gh << endreq;
00084       info() << "execNumber: " << gh->execNumber() << endreq;
00085       //gh->event()->print();
00086       info() << "signal_process_id= " << gh->event()->signal_process_id() << endreq;
00087       info() << "vertices_size= " << gh->event()->vertices_size() << endreq;
00088     }
00089 
00090     m_eventType = gh->event()->signal_process_id();
00091     m_nVertex = gh->event()->vertices_size();
00092     m_nParticle = gh->event()->particles_size();
00093 
00094     unsigned int iVertex = 0;
00095     for(HepMC::GenEvent::vertex_const_iterator it = gh->event()->vertices_begin();
00096         it != gh->event()->vertices_end();
00097         it++ ) {
00098       if(m_printFreq > 0 && m_execNum % m_printFreq == 0) {
00099         info() << "vertex= " << (*it)->position().x() 
00100               <<","<< (*it)->position().y()<<","<<(*it)->position().z()
00101               << endreq;
00102       }
00103       m_verX0[iVertex] = (*it)->position().x();
00104       m_verY0[iVertex] = (*it)->position().y();
00105       m_verZ0[iVertex] = (*it)->position().z();
00106       iVertex++;
00107     }
00108 
00109     unsigned int iParticle = 0;
00110     for(HepMC::GenEvent::particle_const_iterator it = gh->event()->particles_begin();
00111         it != gh->event()->particles_end();
00112         it++ ) {
00113       if(m_printFreq > 0 && m_execNum % m_printFreq == 0) {
00114         info() << "particle momentum= " 
00115               << (*it)->momentum().x() <<","
00116               << (*it)->momentum().y() <<","
00117               << (*it)->momentum().z() 
00118               << endreq;
00119       }
00120       m_verPx[iParticle] = (*it)->momentum().x();
00121       m_verPy[iParticle] = (*it)->momentum().y();
00122       m_verPz[iParticle] = (*it)->momentum().z();
00123       iParticle++;
00124     }
00125 
00126     m_ntuple0->write();
00127 
00128   }//GenHeader
00129 
00130   //----------------------------------------------------------------------------------------
00131   //ReadoutHeader
00132 
00133   if(m_checkReadout) {
00134 
00135     ReadoutHeader* roh = get<ReadoutHeader>("/Event/Readout/ReadoutHeader");
00136     if (roh == 0) {
00137       error() << " =======> Requested Object can not be accessable." << endreq;
00138       return StatusCode::FAILURE;
00139     }
00140 
00141     const DaqCrate* daqCrate = roh->daqCrate();
00142     if(!daqCrate){
00143       error() << "Failed to get DAQ crate from header" << endreq;
00144       return StatusCode::FAILURE;
00145     } 
00146 
00147     if(daqCrate) {
00148       const Detector& detector = daqCrate->detector();
00149       info() << "Detector = " << detector << endreq;
00150 
00151       if(detector.isAD() || detector.isWaterShield()) {
00152         processPmtCrate(roh,daqCrate);
00153       }
00154     } else if(roh->readout()) {
00155       processReadout(roh);
00156     } else {
00157       error() << "Failed to get DAQ crate or Readout from header" << endreq;
00158       return StatusCode::FAILURE;
00159     }
00160 
00161   }//ReadoutHeader
00162 
00163   m_execNum++;
00164   debug() << "execute() ______________________________ end" << endreq;
00165   return StatusCode::SUCCESS;
00166 }

StatusCode RawData2Tree::finalize (  )  [virtual]

Reimplemented from GaudiAlgorithm.

Definition at line 168 of file RawData2Tree.cc.

00169 {
00170   debug() << "finalize()" << endreq;
00171   return StatusCode::SUCCESS;
00172 }

StatusCode RawData2Tree::bookNtuple (  )  [private]

Definition at line 173 of file RawData2Tree.cc.

00174 {
00175   //  Book NTuple 0
00176   if(m_checkGen) {
00177     NTuplePtr nt0(ntupleSvc(), "FILE1/Gen");
00178     if ( nt0 ) m_ntuple0 = nt0;
00179     else {
00180       m_ntuple0 = ntupleSvc()->book("FILE1/Gen", CLID_ColumnWiseTuple, "Gen");
00181       if ( m_ntuple0 )    {
00182         m_ntuple0->addItem ("EventType",      m_eventType);
00183         m_ntuple0->addItem ("VertexSize",     m_nVertex, 0, 30);
00184         m_ntuple0->addItem ("ver_x0",  m_nVertex, m_verX0);
00185         m_ntuple0->addItem ("ver_y0",  m_nVertex, m_verY0);
00186         m_ntuple0->addItem ("ver_z0",  m_nVertex, m_verZ0);
00187         m_ntuple0->addItem ("ParticleSize",   m_nParticle, 0, 30);
00188         m_ntuple0->addItem ("ver_px",  m_nParticle, m_verPx);
00189         m_ntuple0->addItem ("ver_py",  m_nParticle, m_verPy);
00190         m_ntuple0->addItem ("ver_pz",  m_nParticle, m_verPz);
00191       }
00192       else { // Did not manage to book the NTuple....
00193         error() << "Can not book NTuple:" << long(m_ntuple0) << endreq;
00194         return StatusCode::FAILURE;
00195       }
00196     }
00197   }
00198 
00199   //  Book NTuple 1
00200   if(m_checkReadout) {
00201     NTuplePtr nt1(ntupleSvc(), "FILE1/Readout");
00202     if ( nt1 ) m_ntuple1 = nt1;
00203     else {
00204       m_ntuple1 = ntupleSvc()->book("FILE1/Readout", CLID_ColumnWiseTuple, "Readout");
00205       if ( m_ntuple1 )    {
00206         info() << "Start m_ntuple1 addItem successful!" << endreq;
00207         // Trigger number serial
00208         m_ntuple1->addItem("Run",m_run);
00209         m_ntuple1->addItem("Event",m_event);
00210         m_ntuple1->addItem("Det",m_det);
00211         m_ntuple1->addItem("TrigNum",m_trigNum);
00212         m_ntuple1->addItem("TrigSeconde",m_trigSecond);
00213         m_ntuple1->addItem("TrigNanoSec",m_trigNanoSec);
00214         m_ntuple1->addItem("TrigType",  m_trigType);
00215         m_ntuple1->addItem("NChannel",m_nChannel);
00216         m_ntuple1->addItem("NHit",m_nHit,0,1000);
00217         m_ntuple1->addItem("Board",m_nHit,m_board);
00218         m_ntuple1->addItem("Channel",m_nHit,m_channel);
00219         m_ntuple1->addItem("Ring",m_nHit,m_ring);
00220         m_ntuple1->addItem("Column",m_nHit,m_column);
00221         m_ntuple1->addItem("Wall",m_nHit,m_wall);
00222         m_ntuple1->addItem("Spot",m_nHit,m_spot);
00223         m_ntuple1->addItem("Inout",m_nHit,m_inout);
00224         m_ntuple1->addItem("Adc",m_nHit,m_adc);
00225         m_ntuple1->addItem("Tdc",m_nHit,m_tdc);
00226         m_ntuple1->addItem("Cycle",m_nHit,m_cycle);
00227         m_ntuple1->addItem("PreAdc",m_nHit,m_preAdc);
00228         m_ntuple1->addItem("Range",m_nHit,m_range);
00229         m_ntuple1->addItem("HitCount",m_nHit,m_hitCount);
00230         m_ntuple1->addItem("MultiTdc",m_nHit,m_multiTdc);
00231         m_ntuple1->addItem("NTrigger",m_nTrigger,0,20);
00232         m_ntuple1->addItem("TriggerSec",m_nTrigger,m_triggerSec);
00233         m_ntuple1->addItem("TriggerNano",m_nTrigger,m_triggerNano);
00234         m_ntuple1->addItem("TriggerHSum",m_nTrigger,m_triggerHSum);
00235         m_ntuple1->addItem("TriggerESumComp",m_nTrigger,m_triggerESumComp);
00236         m_ntuple1->addItem("TriggerESumADC",m_nTrigger,m_triggerESumAdc);
00237       }
00238       else { // Did not manage to book the NTuple....
00239         error() << "Can not book NTuple:" << long(m_ntuple1) << endmsg;
00240         return StatusCode::FAILURE;
00241       }
00242     }
00243   }
00244 
00245   return StatusCode::SUCCESS;
00246 }

void RawData2Tree::processPmtCrate ( const DayaBay::ReadoutHeader roh,
const DayaBay::DaqCrate daqCrate 
) [private]

Definition at line 248 of file RawData2Tree.cc.

00249 {
00250   info() << "processPmtCrate"  << endl;
00251   ServiceMode svcMode( roh->context(),0 );
00252 
00253   // Convert to PMT crate readout
00254   const DaqPmtCrate* pmtCrate = daqCrate->asPmtCrate();
00255   if(!pmtCrate){
00256     error() << "Can't find pmt crate for AD or Water Shield" << endreq;
00257   } 
00258 
00259   m_run = pmtCrate->runNumber();
00260   m_event = pmtCrate->eventNumber();
00261   m_det = pmtCrate->detector().fullPackedData();
00262   m_trigNum = pmtCrate->localTriggerNumber();
00263   m_trigSecond = pmtCrate->triggerTime().GetSec();
00264   m_trigNanoSec = pmtCrate->triggerTime().GetNanoSec();
00265   m_trigType = pmtCrate->triggerType();
00266 
00267   const DaqPmtCrate::PmtChannelPtrList& channels
00268     = pmtCrate->channelReadouts();
00269 
00270   m_nChannel= channels.size();
00271   DaqPmtCrate::PmtChannelPtrList::const_iterator channelIter,
00272     channelEnd = channels.end();
00273 
00274   // Calculate number of hits in this readout
00275   int nHit = 0;
00276   for(channelIter = channels.begin(); channelIter!=channelEnd; channelIter++) {
00277     const DaqPmtChannel& channel = *(*channelIter);
00278     nHit += channel.hitCount();
00279   }
00280   m_nHit = nHit;
00281   info() << "Number of channel: " << channels.size() 
00282     << ", Number of hit: " << nHit << endreq;
00283 
00284   int index = -1;
00285   for(channelIter = channels.begin(); channelIter!=channelEnd; channelIter++) {
00286     const DaqPmtChannel& channel = *(*channelIter);
00287 
00288     int board = channel.channelId().board(); 
00289     int connector = channel.channelId().connector();
00290     int ring = -1;
00291     int clmn = -1;
00292     int wall = -1;
00293     int spot = -1;
00294     bool inout = false;
00295     if( pmtCrate->detector().isAD() ) {
00296       AdPmtSensor pmtId = m_cableSvc->adPmtSensor( channel.channelId(), svcMode );
00297       ring = pmtId.ring();
00298       clmn = pmtId.column();
00299     } else if( pmtCrate->detector().isWaterShield() ) {
00300       PoolPmtSensor pmtId = m_cableSvc->poolPmtSensor( channel.channelId(), svcMode );
00301       wall = pmtId.wallNumber();
00302       spot = pmtId.wallSpot();
00303       inout = pmtId.inwardFacing();
00304     }
00305     debug() << "(board,connector) = (" << board << "," << connector << "), " 
00306       << "(ring,column) = (" << ring << "," << clmn << ")" << endreq;
00307 
00308     unsigned int hitSize = channel.hitCount();
00309     for(unsigned int i=0; i<hitSize; i++) {
00310       index++;
00311       m_board[index] = board;
00312       m_channel[index] = connector;
00313       m_ring[index] = ring;
00314       m_column[index] = clmn;
00315       m_wall[index] = wall;
00316       m_spot[index] = spot;
00317       m_inout[index] = inout ? 1 : 0;
00318       m_adc[index] = channel.adc(i);
00319       m_tdc[index] = channel.tdc(i);
00320       m_cycle[index] = channel.peakCycle(i);
00321       m_preAdc[index] = channel.preAdcRaw(i);
00322       m_range[index] = channel.isHighGainAdc(i) ? 1 : 2;
00323       m_hitCount[index] = i;
00324       m_multiTdc[index] = hitSize;
00325       debug() << "tdc=" << m_tdc[index] << ", adc=" << m_adc[index] << endreq;
00326     }
00327   }
00328 
00329   const DaqLtb &ltb = pmtCrate->localTriggerBoard();
00330   //const LtbFramePtrList frames = ltb.frames();
00331   const vector<DayaBay::DaqLtbFrame*> &frames = ltb.frames();
00332   if(frames.size()>20) {
00333     warning() << "Two many trigger frames: " << frames.size() << endreq;
00334   }
00335 
00336   for(unsigned int i=0; i<frames.size(); i++) {
00337     m_triggerSec[i] = frames[i]->triggerTime().GetSec();
00338     m_triggerNano[i] = frames[i]->triggerTime().GetNanoSec();
00339     m_triggerHSum[i] = frames[i]->hitSum();
00340     m_triggerESumComp[i] = frames[i]->energySum();
00341     m_triggerESumAdc[i] = frames[i]->energySum();
00342   }
00343 
00344   m_ntuple1->write();
00345 }

void RawData2Tree::processReadout ( const DayaBay::ReadoutHeader roh  )  [private]

Definition at line 347 of file RawData2Tree.cc.

00348 {
00349   info() << "processReadout"  << endl;
00350   ServiceMode svcMode( roh->context(),0 );
00351 
00352   Readout* readout = const_cast<Readout*>(roh->readout());
00353 
00354   ReadoutPmtCrate* pmtCrate = dynamic_cast<DayaBay::ReadoutPmtCrate* > ( readout );
00355 
00357   Detector det = pmtCrate->detector();
00358 
00359   m_det = det.fullPackedData();
00360   m_trigNum = readout->triggerNumber();
00361   m_trigSecond = readout->triggerTime().GetSec();
00362   m_trigNanoSec= readout->triggerTime().GetNanoSec();
00363   m_trigType = readout->triggerType();
00364 
00366   const ReadoutPmtCrate::PmtChannelReadouts &channels = pmtCrate->channelReadout();
00367   m_nChannel = channels.size();
00368   ReadoutPmtCrate::PmtChannelReadouts::const_iterator ci, ci_end = channels.end();
00369   
00370   // Calculate number of hits in this readout
00371   int nHit = 0;
00372   for(ci = channels.begin(); ci!=ci_end; ci++) {
00373     nHit += ci->second.size();
00374   }
00375   m_nHit = nHit;
00376   info() << "Number of channel: " << channels.size() 
00377     << ", Number of hit: " << m_nHit << endreq;
00378 
00379   int index = -1;
00380   for(ci = channels.begin(); ci!=ci_end; ci++) {
00381 
00382     const ReadoutPmtChannel &channel = ci->second;
00383 
00384     int board = channel.channelId().board(); 
00385     int connector = channel.channelId().connector();
00386     int ring = -1;
00387     int clmn = -1;
00388     int wall = -1;
00389     int spot = -1;
00390     bool inout = false;
00391     if( readout->detector().isAD() ) {
00392       AdPmtSensor pmtId = m_cableSvc->adPmtSensor( channel.channelId(), svcMode );
00393       ring = pmtId.ring();
00394       clmn = pmtId.column();
00395     } else if( readout->detector().isWaterShield() ) {
00396       PoolPmtSensor pmtId = m_cableSvc->poolPmtSensor( channel.channelId(), svcMode );
00397       wall = pmtId.wallNumber();
00398       spot = pmtId.wallSpot();
00399       inout = pmtId.inwardFacing();
00400     }
00401     debug() << "(board,connector) = (" << board << "," << connector << "), " 
00402       << "(ring,column) = (" << ring << "," << clmn << ")" << endreq;
00403 
00404     unsigned int hitSize = channel.size();
00405     for(unsigned int i = 0; i<hitSize; i++) {
00406       index++;
00407       m_board[index] = board;
00408       m_channel[index] = connector;
00409       m_ring[index] = ring;
00410       m_column[index] = clmn;
00411       m_wall[index] = wall;
00412       m_spot[index] = spot;
00413       m_inout[index] = inout ? 1 : 0;
00414       m_adc[index] = channel.adc(i);
00415       m_tdc[index] = channel.tdc(i);
00416       m_cycle[index] = channel.adcCycle(i);
00417       m_preAdc[index] = channel.pedestal(i);
00418       m_range[index] = channel.adcRange(i);
00419       m_hitCount[index] = channel.tdcHitCount(i);
00420       m_multiTdc[index] = hitSize;
00421       debug() << "index=" << index << ", tdc=" << m_tdc[index] << ", adc=" << m_adc[index] << endreq;
00422     }
00423   } // end of channels
00424 
00425   m_ntuple1->write();
00426 }


Member Data Documentation

int RawData2Tree::m_printFreq [private]

Definition at line 35 of file RawData2Tree.h.

int RawData2Tree::m_execNum [private]

Definition at line 36 of file RawData2Tree.h.

bool RawData2Tree::m_checkGen [private]

Definition at line 37 of file RawData2Tree.h.

bool RawData2Tree::m_checkReadout [private]

Definition at line 38 of file RawData2Tree.h.

NTuple::Tuple* RawData2Tree::m_ntuple0 [private]

Definition at line 41 of file RawData2Tree.h.

NTuple::Item<long> RawData2Tree::m_eventType [private]

Definition at line 42 of file RawData2Tree.h.

NTuple::Item<long> RawData2Tree::m_nVertex [private]

Definition at line 43 of file RawData2Tree.h.

NTuple::Array<float> RawData2Tree::m_verX0 [private]

Definition at line 44 of file RawData2Tree.h.

NTuple::Array<float> RawData2Tree::m_verY0 [private]

Definition at line 45 of file RawData2Tree.h.

NTuple::Array<float> RawData2Tree::m_verZ0 [private]

Definition at line 46 of file RawData2Tree.h.

NTuple::Item<long> RawData2Tree::m_nParticle [private]

Definition at line 47 of file RawData2Tree.h.

NTuple::Array<float> RawData2Tree::m_verPx [private]

Definition at line 48 of file RawData2Tree.h.

NTuple::Array<float> RawData2Tree::m_verPy [private]

Definition at line 49 of file RawData2Tree.h.

NTuple::Array<float> RawData2Tree::m_verPz [private]

Definition at line 50 of file RawData2Tree.h.

NTuple::Tuple* RawData2Tree::m_ntuple1 [private]

Definition at line 52 of file RawData2Tree.h.

NTuple::Item<long> RawData2Tree::m_run [private]

Definition at line 53 of file RawData2Tree.h.

NTuple::Item<long> RawData2Tree::m_event [private]

Definition at line 54 of file RawData2Tree.h.

NTuple::Item<long> RawData2Tree::m_det [private]

Definition at line 55 of file RawData2Tree.h.

NTuple::Item<long> RawData2Tree::m_trigNum [private]

Definition at line 56 of file RawData2Tree.h.

NTuple::Item<long> RawData2Tree::m_trigSecond [private]

Definition at line 57 of file RawData2Tree.h.

NTuple::Item<long> RawData2Tree::m_trigNanoSec [private]

Definition at line 58 of file RawData2Tree.h.

NTuple::Item<long> RawData2Tree::m_trigType [private]

Definition at line 59 of file RawData2Tree.h.

NTuple::Item<long> RawData2Tree::m_nHit [private]

Definition at line 60 of file RawData2Tree.h.

NTuple::Item<long> RawData2Tree::m_nChannel [private]

Definition at line 61 of file RawData2Tree.h.

NTuple::Item<long> RawData2Tree::m_nTrigger [private]

Definition at line 62 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_board [private]

Definition at line 63 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_channel [private]

Definition at line 64 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_ring [private]

Definition at line 65 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_column [private]

Definition at line 66 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_wall [private]

Definition at line 67 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_spot [private]

Definition at line 68 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_inout [private]

Definition at line 69 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_adc [private]

Definition at line 69 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_tdc [private]

Definition at line 71 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_cycle [private]

Definition at line 72 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_preAdc [private]

Definition at line 73 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_range [private]

Definition at line 74 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_hitCount [private]

Definition at line 75 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_multiTdc [private]

Definition at line 76 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_triggerSec [private]

Definition at line 77 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_triggerNano [private]

Definition at line 78 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_triggerType [private]

Definition at line 79 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_triggerHSum [private]

Definition at line 80 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_triggerESumComp [private]

Definition at line 81 of file RawData2Tree.h.

NTuple::Array<long> RawData2Tree::m_triggerESumAdc [private]

Definition at line 82 of file RawData2Tree.h.

std::string RawData2Tree::m_cableSvcName [private]

Definition at line 86 of file RawData2Tree.h.

ICableSvc* RawData2Tree::m_cableSvc [private]

Definition at line 89 of file RawData2Tree.h.

std::string RawData2Tree::m_pmtGeomSvcName [private]

Definition at line 92 of file RawData2Tree.h.

IPmtGeomInfoSvc* RawData2Tree::m_pmtGeomSvc [private]

Definition at line 95 of file RawData2Tree.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:34:07 2011 for AnalysesEx by doxygen 1.4.7