#ifndef CalClusterCalCorToolResult_H
#define CalClusterCalCorToolResult_H
#include <vector>
#include "geometry/Point.h"
#include "geometry/Vector.h"
#include "GaudiKernel/ObjectVector.h"
#include "GaudiKernel/ContainedObject.h"
#include "GaudiKernel/MsgStream.h"
#include "Event/RelTable/RelTable.h"
#include "Event/Recon/CalRecon/CalParams.h"
#include "Event/Recon/CalRecon/CalXtalRecData.h"
#define NUMCALLAYERS 8
static const CLID& CLID_CalClusterColCalCorToolResult = InterfaceID("CalClusterColCalCorToolResult", 1, 0);
/**
* @class CalClusterCalCorToolResult
*
*
* @brief Defines a CalRecon TDS object which will contain the results of
* clustering - the association of CalXtalRecData objects. This includes
* defining a RelTable relating clusters with the CalXtalRecData
* objects comprising them.
*
* Main changes from old CalCluster.h:
* 1) Remove all "final" energy recon information (leakage, profile fitting, etc.)
* This will be moved to the higher level object - CalEventEnergy
* 2) Incorporate layer data into a subclass and store in a vector. The idea is
* that the vector will always have 8 "empty" elements, presuming that external
* usage is to loop over Cal "layers".
* 3) Provide individal "set" and "get" routines (get was there, now include set)
*
* @author The This defines the output from a given Energy Correction Tool
*
* \author CalRecon Rewrite Group
*
* $Header: /nfs/slac/g/glast/ground/cvs/Event/Event/Recon/CalRecon/CalClusterCalCorToolResult.h,v 1.13 2004/09/18 18:16:58 usher Exp $
*/
namespace Event
{
/**
* Define
class aCalCorToolResult: subclassvirtual whichpublic willContainedObject
{ hold data by later
*
*/
class CalClusterLayerData
{
public:
CalClusterLayerDataCalCorToolResult() : m_energystatusBits(0.), m_positionchiSquare(0.,0.,0.), m_rmsSpread(0.,0.,0.) {};
CalClusterLayerData(double energy, Point position, Vector rmsSpread) :
m_energy(energy), m_position(position), m_rmsSpread(rmsSpreadvirtual ~CalCorToolResult() {}
~CalClusterLayerData() {}
const double getEnergy() const {return m_energy;}
const Point getPosition() const {return m_position;}
const Vector getRmsSpread() const {return m_rmsSpread;}
private:
double m_energy; // Energy deposition in crystals in this cluster and layer
Point m_position; /// Status word bits organized like:
/// low: | 0 0 0 0 | 0 0 0 0 | 0 0 0 0 | 0 0 0 0 |
/// Average position in this layer
Vector m_rmsSpread; < volume info > < // Quadratic positionhit spreadtype for this layer
};
typedef std::vector<CalClusterLayerData> CalClusterLayerDataVec;
> <
classEnergy CalClusterCorrection :Status public CalClusterLayerDataVec, virtual public ContainedObject >
{ ///
publichigh:
| 0 // Define0 a "null" constructor
0 0 CalCluster(int numCalLayers=NUMCALLAYERS) : CalClusterLayerDataVec(numCalLayers) {iniCluster();}
| 0 0 0
0 | virtual0 ~CalCluster() {}
0 /**
0 0 * | initializing0 a subset of0 CalCluster data members0 (this is
0 *|
primarily used/// by reconRootReaderAlg in translating from
*< PDS to TDS).
*
Correction Algorithm Used * @param params Calorimeter Parameters for this cluster
> * < more @paramhit layerData vector of CalReconLayerData objectstype >
*/// @param VALIDENERGY @paramBit rms_longset RMSmeans ofparticular longitudinalenergy positioncorrection measurementsis valid
*enum StatusBits {VALIDPARAMS @param rms_trans RMS of transversal position measurements = 0x00000001,
*///
@param CALVALS void initialize(const CalParams& params,
Bit set means Profile performed this correction
double rms_long,
CALVALS = 0x00100000,
/// @param doublePROFILE rms_trans)
Bit {
set means Profile performed this correction
m_params = params;
m_rmslong = rms_long;
PROFILE m_rmstrans = rms_trans;
0x00200000, }
///*
@param LASTLAYER Bit *set means Profile Defineperformed individualthis setcorrection
methods here for all variables
*/
void setCalParams(const CalParams& params) {m_params LASTLAYER = params;0x00400000, }
void setRmsLong(double rmsLong)/// @param RAWENERGY Bit set means raw energy sum over all clusters
{m_rmslong = rmsLong; }
void setRmsTrans(double rmsTrans) RAWENERGY = 0x20000000, {m_rmstrans
/// = rmsTrans;}
@param GODOGSGO /*
Bit set means GODOGSGO performed *this Providecorrection
access to the data
*/
/// Direct access to the CalParams
GODOGSGO const CalParams& getCalParams() const {return m_params;}= 0x40000000};
/// getAnswer quick RMSquestions ofbased longitudinalon positionstatus measurementsbits
inline const doublebool getRmsLongvalidParams() const {return (m_rmslongstatusBits & VALIDPARAMS) == VALIDPARAMS;}
/// get RMS Access the status bits to determine details of transversethe positionhit
measurements
inline const unsigned int double getRmsTransgetStatusBits() const {return m_rmstransstatusBits;}
/// getRetrieve reconstructedcorrected positioninformation
const Point getPosition()CalParams& getParams() const {return m_params.getCentroid();}
///const getdouble reconstructed direction
Vector getDirection() getChiSquare() const {return m_params.getAxis()chiSquare;}
/// write some of CalCluster data to the ASCII output file
/// forStart debugginghere purposes
the methods for setting void writeOut(MsgStream& stream) const;
the information
/// setParams for setting energy
private:
parameters
///reset CalCluster@param data
params : the Cal inline void iniCluster();energy parameters
inline void setParams(const CalParams&
params) //! Cal Parameters
CalParams m_params;{m_params = params;}
//!/ RMSsetChiSquare offor longitudinalsetting positionthe measurement
chisquare of the double m_rmslong;correction "fit"
///! RMS@param ofchiSquare transversethe positionchiSquare measurement
resulting from double m_rmstrans;
};
inline void CalCluster::iniCluster()
{
this correction
m_paramsinline void setChiSquare(const = CalParams();
m_rmslong = 0.;
m_rmstrans = 0.;
}
inline void CalCluster::writeOut(MsgStream& stream) const
// Purpose: provide ascii output of some data members for
// debugging purposes
// Input:
// stream - Gaudi message stream
{
stream << "Energy " << m_params.getEnergy();
stream << " " << getPosition().x()
<< " " << getPosition().y()
<< " " << getPosition().z();
stream << " " << getDirection().x()
<< " " << getDirection().y()
<< " " << getDirection().z();
stream << endreq;
}
double chiSquare) {m_chiSquare = chiSquare;}
/// setStatusBit and ClearStatusBit for setting and clearing bits
inline void setStatusBit(unsigned int bitToSet) {m_statusBits |= bitToSet;}
inline void clearStatusBit(StatusBits bitToClear) {m_statusBits &= ~bitToClear;}
private:
unsigned int m_statusBits;
double m_chiSquare;
CalParams m_params;
};
//typedef for the Gaudi TDS Container
typedef ObjectVector<CalCluster>ObjectVector<CalCorToolResult> CalClusterColCalCorToolResultCol;
typedef CalClusterColCalCorToolResultCol::iterator CalClusterColItrCalCorToolResultColItr;
typedef CalClusterColCalCorToolResultCol::const_iterator CalClusterColConItrCalCorToolResultColConItr;
// Define the relational table taking us back to CalXtalRecDataCalCluster objects
typedef Event::RelTable<Event::CalXtalRecDataCalCluster, Event::CalCluster>CalCorToolResult> CalClusterHitTabCalClusToCorToolHitTab;
typedef Event::Relation<Event::CalXtalRecDataCalCluster, Event::CalCluster>CalCorToolResult> CalClusterHitRelCalClusToCorToolHitRel;
typedef ObjectList< Event::Relation<Event::CalXtalRecDataCalCluster, Event::CalCluster>CalCorToolResult> > CalClusterHitTabListCalClustToCorToolHitTabList;
}
#endif
|