//--------------------------------------------------------------------------
// $Id: EmcMiniBumpK.cc,v 1.15 2004/02/20 18:34:39 brownd Exp $
//
// Environment:
// Software developed for the BaBar Detector at the SLAC B-Factory.
//
// Author: L.Wilden, J. Tinslay, D. Brown
// Leif Wilden (new root version)
// Adapted from EmcMiniCandCompositeP by
// Jane Tinslay - University of Edinburgh
// Dave Brown - LBNL
//
// Description:
// Persistent class for EmcBump in the mini.
//
// The EmcBumpI interface requires the following functions:
//
// UInt_t nDigis() const // Total number of digis
// UInt_t nSharedDigis() const // Number of digis shared with other bumps
// const EmcDigiI* sharedDigi(UInt_t i) const // Return a shared digi by index
// Double_t weight(UInt_t i) const // Return a shared digi weight by index
// UInt_t nUnSharedDigis() const // Number of unshared digis
// const EmcDigiI* unSharedDigi(UInt_t i) const // Return an unshared digi by index
// const EmcClusterI* cluster() const // The cluster this bump is part of
//
// Persistent Location:
// Aod::"Emc_Bumps"
// Esd::"Emc_Bumps"
//
// Persistent Size: 16 + 4*nDigi + 2*nSharedDigi bytes
//
// Persistent Structure:
// mutable KanObjectRefVector<EmcDigiI> _digis; //! References to EmcDigs...
// KanReferenceVector _digisVal; // ... and the actual data
// mutable KanObjectRefVector<EmcDigiI> _sharedDigis; //! References to EmcDigs...
// KanReferenceVector _sharedDigisVal; // ... and the actual data
// mutable KanObjectRef<EmcClusterI> _cluster; //! Reference to EmcCluster bump is in...
// KanReferenceVector _clusterVal; // ... and the actual data
// KanVector_Short _weights; // The Digi Weights (Flat from 0.-1.)
//
//----------------
// Babar header --
//----------------
#include "BaBar/BaBar.hh"
//-----------------------
// This Class's Header --
//-----------------------
#include "EmcDataK/EmcMiniBumpK.hh"
//---------------
// C++ Headers --
//---------------
#include <assert.h>
#include <string>
//-------------------------------
// Collaborating Class Headers --
//-------------------------------
#include "KanBase/KanEventReader.hh"
#include "KanBase/KanEventWriter.hh"
#include "EmcData/EmcBump.hh"
#include "EmcData/EmcSharedDigi.hh"
#include "EmcData/EmcWeightData.hh"
#include "EmcDataK/EmcMiniCandCompositeK.hh"
#include "ErrLogger/ErrLog.hh"
#include "CLHEP/Alist/AList.h"
//-----------------------------------------------------------------------
// Local Macros, Typedefs, Structures, Unions and Forward Declarations --
//-----------------------------------------------------------------------
ClassImp(EmcMiniBumpK)
//----------------
// Constructors --
//----------------
EmcMiniBumpK::EmcMiniBumpK() :
EmcBumpI(),
_digis(_digisVal,*this,Dna::Event),
_sharedDigis(_sharedDigisVal,*this,Dna::Event),
_cluster(_clusterVal,*this,Dna::Event){
}
//--------------
// Destructor --
//--------------
EmcMiniBumpK::~EmcMiniBumpK() {}
//--------------
// Operations --
//--------------
void EmcMiniBumpK::loadFrom( const EmcBump* bump, KanEventWriter & eW ) {
assert("ThisClassIsObsoleteAndShouldNotBePersisted" == 0);
}
EmcBump* EmcMiniBumpK::buildTransient( KanEventReader& eR ) {
UInt_t nS = _sharedDigis.size();
UInt_t nD = _digis.size();
EmcBump* bump = new EmcBump(nD + nS,0);
// load shared digis (w/ weights)
for ( UInt_t iS(0); iS < nS; ++iS ) {
const EmcDigi* digi= _sharedDigis.getObj(iS,eR);
Double_t weight = EmcWeightData((UShort_t)(_weights.getVal(iS))).weight();
assert(digi != 0);
EmcDigi* myDigi = new EmcSharedDigi(*digi, weight);
bump->addDigi(myDigi);
}
// load rest of digis
for ( UInt_t iD(0); iD < nD; ++iD ) {
const EmcDigi* digi= _digis.getObj(iD,eR);
assert(digi != 0);
EmcDigi* myDigi = new EmcSharedDigi(*digi, 1.);
bump->addDigi(myDigi);
}
EmcCluster* cluster = _cluster.getObj(0,eR);
assert(cluster!=0);
bump->madeFrom(cluster);
bump->setNBumps(1);
return bump;
}
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.
|