#include <TLorentzVector.h>
#include "AliAODCaloCluster.h"
ClassImp(AliAODCaloCluster)
AliAODCaloCluster::AliAODCaloCluster() :
AliAODCluster(),
fDistToBadChannel(-999.),
fDispersion(-1),
fM20(0.),
fM02(0.),
fEmcCpvDistance(-999.),
fTrackDx(-999),
fTrackDz(-999),
fNExMax(0),
fTOF(0.),
fCoreEnergy(0.),
fTracksMatched(),
fNCells(0),
fCellsAbsId(0x0),
fCellsAmpFraction(0x0)
{
}
AliAODCaloCluster::AliAODCaloCluster(Int_t id,
UInt_t nLabel,
Int_t *label,
Double_t energy,
Double_t x[3],
Double_t pid[13],
Char_t ttype,
UInt_t selectInfo) :
AliAODCluster(id, nLabel, label, energy, x, pid, ttype, selectInfo),
fDistToBadChannel(-999.),
fDispersion(-1),
fM20(0.),
fM02(0.),
fEmcCpvDistance(-999.),
fTrackDx(-999),
fTrackDz(-999),
fNExMax(0),
fTOF(0.),
fCoreEnergy(0.),
fTracksMatched(),
fNCells(0),
fCellsAbsId(0x0),
fCellsAmpFraction(0x0)
{
}
AliAODCaloCluster::AliAODCaloCluster(Int_t id,
UInt_t nLabel,
Int_t *label,
Float_t energy,
Float_t x[3],
Float_t pid[13],
Char_t ttype,
UInt_t selectInfo) :
AliAODCluster(id, nLabel, label, energy, x, pid, ttype, selectInfo),
fDistToBadChannel(-999.),
fDispersion(-1),
fM20(0.),
fM02(0.),
fEmcCpvDistance(-999.),
fTrackDx(-999),
fTrackDz(-999),
fNExMax(0),
fTOF(0.),
fCoreEnergy(0.),
fTracksMatched(),
fNCells(0),
fCellsAbsId(0x0),
fCellsAmpFraction(0x0)
{
}
AliAODCaloCluster::~AliAODCaloCluster()
{
if(fCellsAmpFraction) delete[] fCellsAmpFraction; fCellsAmpFraction=0;
if(fCellsAbsId) delete[] fCellsAbsId; fCellsAbsId = 0;
}
void AliAODCaloCluster::Clear(const Option_t*)
{
RemoveLabel();
if(fCellsAmpFraction) delete[] fCellsAmpFraction; fCellsAmpFraction=0;
if(fCellsAbsId) delete[] fCellsAbsId; fCellsAbsId = 0;
}
AliAODCaloCluster::AliAODCaloCluster(const AliAODCaloCluster& clus) :
AliAODCluster(clus),
fDistToBadChannel(clus.fDistToBadChannel),
fDispersion(clus.fDispersion),
fM20(clus.fM20),
fM02(clus.fM02),
fEmcCpvDistance(clus.fEmcCpvDistance),
fTrackDx(clus.fTrackDx),
fTrackDz(clus.fTrackDz),
fNExMax(clus.fNExMax),
fTOF(clus.fTOF),
fCoreEnergy(clus.fCoreEnergy),
fTracksMatched(clus.fTracksMatched),
fNCells(clus.fNCells),
fCellsAbsId(0x0),
fCellsAmpFraction(0x0)
{
if (clus.fNCells > 0) {
if(clus.fCellsAbsId){
fCellsAbsId = new UShort_t[clus.fNCells];
for (Int_t i=0; i<clus.fNCells; i++)
fCellsAbsId[i]=clus.fCellsAbsId[i];
}
if(clus.fCellsAmpFraction){
fCellsAmpFraction = new Double32_t[clus.fNCells];
for (Int_t i=0; i<clus.fNCells; i++)
fCellsAmpFraction[i]=clus.fCellsAmpFraction[i];
}
}
}
AliAODCaloCluster& AliAODCaloCluster::operator=(const AliAODCaloCluster& clus)
{
if(this!=&clus) {
AliAODCluster::operator=(clus);
fDistToBadChannel = clus.fDistToBadChannel;
fDispersion = clus.fDispersion;
fM20 = clus.fM20;
fM02 = clus.fM02;
fEmcCpvDistance = clus.fEmcCpvDistance;
fTrackDx=clus.fTrackDx;
fTrackDz=clus.fTrackDz;
fNExMax = clus.fNExMax;
fTOF = clus.fTOF;
fCoreEnergy = clus.fCoreEnergy;
fTracksMatched = clus.fTracksMatched;
fNCells= clus. fNCells;
if(fCellsAbsId)delete [] fCellsAbsId;
if(fCellsAmpFraction)delete [] fCellsAmpFraction;
if (clus.fNCells > 0) {
if(clus.fCellsAbsId){
fCellsAbsId = new UShort_t[clus.fNCells];
for (Int_t i=0; i<clus.fNCells; i++)
fCellsAbsId[i]=clus.fCellsAbsId[i];
}
if(clus.fCellsAmpFraction){
fCellsAmpFraction = new Double32_t[clus.fNCells];
for (Int_t i=0; i<clus.fNCells; i++)
fCellsAmpFraction[i]=clus.fCellsAmpFraction[i];
}
}
}
return *this;
}
Bool_t AliAODCaloCluster::HasTrackMatched(TObject *trk) const
{
TRefArrayIter iter(&fTracksMatched);
while (TObject *track = iter.Next()) {
if (trk == track) return kTRUE;
}
return kFALSE;
}
void AliAODCaloCluster::GetMomentum(TLorentzVector& p, Double_t *vertex ) const {
Double32_t energy = E();
Float_t pos[3];
GetPosition(pos);
if(vertex){
pos[0]-=vertex[0];
pos[1]-=vertex[1];
pos[2]-=vertex[2];
}
Double_t r = TMath::Sqrt(pos[0]*pos[0]+
pos[1]*pos[1]+
pos[2]*pos[2] ) ;
p.SetPxPyPzE( energy*pos[0]/r, energy*pos[1]/r, energy*pos[2]/r, energy) ;
}
void AliAODCaloCluster::SetCellsAbsId(UShort_t *array)
{
if (fNCells) {
if(!fCellsAbsId)fCellsAbsId = new UShort_t[fNCells];
for (Int_t i = 0; i < fNCells; i++) fCellsAbsId[i] = array[i];
}
}
void AliAODCaloCluster::SetCellsAmplitudeFraction(Double32_t *array)
{
if (fNCells) {
if(!fCellsAmpFraction)fCellsAmpFraction = new Double32_t[fNCells];
for (Int_t i = 0; i < fNCells; i++) fCellsAmpFraction[i] = array[i];
}
}
AliAODCaloCluster.cxx:100 AliAODCaloCluster.cxx:101 AliAODCaloCluster.cxx:102 AliAODCaloCluster.cxx:103 AliAODCaloCluster.cxx:104 AliAODCaloCluster.cxx:105 AliAODCaloCluster.cxx:106 AliAODCaloCluster.cxx:107 AliAODCaloCluster.cxx:108 AliAODCaloCluster.cxx:109 AliAODCaloCluster.cxx:110 AliAODCaloCluster.cxx:111 AliAODCaloCluster.cxx:112 AliAODCaloCluster.cxx:113 AliAODCaloCluster.cxx:114 AliAODCaloCluster.cxx:115 AliAODCaloCluster.cxx:116 AliAODCaloCluster.cxx:117 AliAODCaloCluster.cxx:118 AliAODCaloCluster.cxx:119 AliAODCaloCluster.cxx:120 AliAODCaloCluster.cxx:121 AliAODCaloCluster.cxx:122 AliAODCaloCluster.cxx:123 AliAODCaloCluster.cxx:124 AliAODCaloCluster.cxx:125 AliAODCaloCluster.cxx:126 AliAODCaloCluster.cxx:127 AliAODCaloCluster.cxx:128 AliAODCaloCluster.cxx:129 AliAODCaloCluster.cxx:130 AliAODCaloCluster.cxx:131 AliAODCaloCluster.cxx:132 AliAODCaloCluster.cxx:133 AliAODCaloCluster.cxx:134 AliAODCaloCluster.cxx:135 AliAODCaloCluster.cxx:136 AliAODCaloCluster.cxx:137 AliAODCaloCluster.cxx:138 AliAODCaloCluster.cxx:139 AliAODCaloCluster.cxx:140 AliAODCaloCluster.cxx:141 AliAODCaloCluster.cxx:142 AliAODCaloCluster.cxx:143 AliAODCaloCluster.cxx:144 AliAODCaloCluster.cxx:145 AliAODCaloCluster.cxx:146 AliAODCaloCluster.cxx:147 AliAODCaloCluster.cxx:148 AliAODCaloCluster.cxx:149 AliAODCaloCluster.cxx:150 AliAODCaloCluster.cxx:151 AliAODCaloCluster.cxx:152 AliAODCaloCluster.cxx:153 AliAODCaloCluster.cxx:154 AliAODCaloCluster.cxx:155 AliAODCaloCluster.cxx:156 AliAODCaloCluster.cxx:157 AliAODCaloCluster.cxx:158 AliAODCaloCluster.cxx:159 AliAODCaloCluster.cxx:160 AliAODCaloCluster.cxx:161 AliAODCaloCluster.cxx:162 AliAODCaloCluster.cxx:163 AliAODCaloCluster.cxx:164 AliAODCaloCluster.cxx:165 AliAODCaloCluster.cxx:166 AliAODCaloCluster.cxx:167 AliAODCaloCluster.cxx:168 AliAODCaloCluster.cxx:169 AliAODCaloCluster.cxx:170 AliAODCaloCluster.cxx:171 AliAODCaloCluster.cxx:172 AliAODCaloCluster.cxx:173 AliAODCaloCluster.cxx:174 AliAODCaloCluster.cxx:175 AliAODCaloCluster.cxx:176 AliAODCaloCluster.cxx:177 AliAODCaloCluster.cxx:178 AliAODCaloCluster.cxx:179 AliAODCaloCluster.cxx:180 AliAODCaloCluster.cxx:181 AliAODCaloCluster.cxx:182 AliAODCaloCluster.cxx:183 AliAODCaloCluster.cxx:184 AliAODCaloCluster.cxx:185 AliAODCaloCluster.cxx:186 AliAODCaloCluster.cxx:187 AliAODCaloCluster.cxx:188 AliAODCaloCluster.cxx:189 AliAODCaloCluster.cxx:190 AliAODCaloCluster.cxx:191 AliAODCaloCluster.cxx:192 AliAODCaloCluster.cxx:193 AliAODCaloCluster.cxx:194 AliAODCaloCluster.cxx:195 AliAODCaloCluster.cxx:196 AliAODCaloCluster.cxx:197 AliAODCaloCluster.cxx:198 AliAODCaloCluster.cxx:199 AliAODCaloCluster.cxx:200 AliAODCaloCluster.cxx:201 AliAODCaloCluster.cxx:202 AliAODCaloCluster.cxx:203 AliAODCaloCluster.cxx:204 AliAODCaloCluster.cxx:205 AliAODCaloCluster.cxx:206 AliAODCaloCluster.cxx:207 AliAODCaloCluster.cxx:208 AliAODCaloCluster.cxx:209 AliAODCaloCluster.cxx:210 AliAODCaloCluster.cxx:211 AliAODCaloCluster.cxx:212 AliAODCaloCluster.cxx:213 AliAODCaloCluster.cxx:214 AliAODCaloCluster.cxx:215 AliAODCaloCluster.cxx:216 AliAODCaloCluster.cxx:217 AliAODCaloCluster.cxx:218 AliAODCaloCluster.cxx:219 AliAODCaloCluster.cxx:220 AliAODCaloCluster.cxx:221 AliAODCaloCluster.cxx:222 AliAODCaloCluster.cxx:223 AliAODCaloCluster.cxx:224 AliAODCaloCluster.cxx:225 AliAODCaloCluster.cxx:226 AliAODCaloCluster.cxx:227 AliAODCaloCluster.cxx:228 AliAODCaloCluster.cxx:229 AliAODCaloCluster.cxx:230 AliAODCaloCluster.cxx:231 AliAODCaloCluster.cxx:232 AliAODCaloCluster.cxx:233 AliAODCaloCluster.cxx:234 AliAODCaloCluster.cxx:235 AliAODCaloCluster.cxx:236 AliAODCaloCluster.cxx:237 AliAODCaloCluster.cxx:238 AliAODCaloCluster.cxx:239 AliAODCaloCluster.cxx:240 AliAODCaloCluster.cxx:241 AliAODCaloCluster.cxx:242 AliAODCaloCluster.cxx:243 AliAODCaloCluster.cxx:244 AliAODCaloCluster.cxx:245 AliAODCaloCluster.cxx:246 AliAODCaloCluster.cxx:247 AliAODCaloCluster.cxx:248 AliAODCaloCluster.cxx:249 AliAODCaloCluster.cxx:250 AliAODCaloCluster.cxx:251 AliAODCaloCluster.cxx:252 AliAODCaloCluster.cxx:253 AliAODCaloCluster.cxx:254 AliAODCaloCluster.cxx:255 AliAODCaloCluster.cxx:256 AliAODCaloCluster.cxx:257 AliAODCaloCluster.cxx:258 AliAODCaloCluster.cxx:259 AliAODCaloCluster.cxx:260 AliAODCaloCluster.cxx:261 AliAODCaloCluster.cxx:262 AliAODCaloCluster.cxx:263