00001 #ifndef CALOCLUSTERVARIABLES_H
00002 #define CALOCLUSTERVARIABLES_H
00003
00004 #include <vector>
00005 #ifndef XAOD_ANALYSIS
00006 #include "CaloUtils/CaloVertexedCluster.h"
00007 typedef xAOD::CaloVertexedCluster CaloVertexedClusterType;
00008 #else
00009 #include "xAODCaloEvent/CaloVertexedTopoCluster.h"
00010 typedef xAOD::CaloVertexedTopoCluster CaloVertexedClusterType;
00011 #endif
00012
00013 #include "CxxUtils/fpcompare.h"
00014 #include "xAODTau/TauJet.h"
00015
00016 #include "TLorentzVector.h"
00017 #include "xAODCaloEvent/CaloVertexedTopoCluster.h"
00018
00019
00021 class CaloClusterVariables {
00022 public:
00023
00024 static const double DEFAULT;
00025
00026 CaloClusterVariables();
00027
00028 ~CaloClusterVariables() {
00029 }
00030
00031 bool update(const xAOD::TauJet& pTau, bool inAODmode=false);
00032
00033 void setVertexCorrection(bool flag) {m_doVertexCorrection=flag;}
00034
00035
00036 unsigned int numConstituents() { return (unsigned int) m_numConstit; }
00037
00038 double totalMass() { return m_totMass; }
00039 double effectiveMass() { return m_effMass; }
00040
00041 double effectiveNumConstituents() { return m_effNumConstit; }
00042 int effectiveNumConstituents_int() { return m_effNumConstit_int; }
00043
00044 double averageEffectiveRadius() { return m_aveEffRadius; }
00045 double averageRadius() { return m_aveRadius; }
00046
00047
00048 double totalEnergy() { return m_totEnergy; }
00049 double effectiveEnergy() { return m_effEnergy; }
00050
00051
00052 unsigned int numCells() { return m_numCells; }
00053
00054 private:
00055 int m_numConstit;
00056 int m_effNumConstit_int;
00057 double m_effNumConstit;
00058 double m_aveRadius;
00059 double m_aveEffRadius;
00060 double m_totMass;
00061 double m_effMass;
00062 double m_totEnergy;
00063 double m_effEnergy;
00064 unsigned int m_numCells;
00065
00067 TLorentzVector calculateTauCentroid(int nConst, const std::vector<CaloVertexedClusterType>& constituents);
00068
00073 bool m_doVertexCorrection;
00074 };
00075
00076
00078
00079 struct CaloClusterCompare {
00080 bool operator()(const CaloVertexedClusterType& left, const CaloVertexedClusterType& right) {
00081
00082
00083 return CxxUtils::fpcompare::greater (left.e(),right.e());
00084 }
00085 };
00086
00087 struct DefCaloClusterCompare {
00088 bool operator()(const xAOD::CaloCluster* left, const xAOD::CaloCluster* right) {
00089
00090
00091 return CxxUtils::fpcompare::greater (left->e(),right->e());
00092 }
00093 };
00094
00095 #endif