#include "AliESDACORDE.h"
#include "AliESDHLTDecision.h"
#include "AliCentrality.h"
+#ifdef MFT_UPGRADE
+#include "AliESDMFT.h"
+#endif
#include "AliEventplane.h"
+
ClassImp(AliESDEvent)
"PHOSCells",
"AliRawDataErrorLogs",
"AliESDACORDE",
- "AliTOFHeader"};
+ "AliTOFHeader"
+ #ifdef MFT_UPGRADE
+// , "AliESDMFT"
+ #endif
+ };
//______________________________________________________________________________
AliESDEvent::AliESDEvent():
fUseOwnList(kFALSE),
fTOFHeader(0),
fCentrality(0),
- fEventplane(0)
+ fEventplane(0),
+ fDetectorStatus(0xFFFFFFFF)
+ #ifdef MFT_UPGRADE
+// , fESDMFT(0)
+ #endif
{
}
//______________________________________________________________________________
fUseOwnList(esd.fUseOwnList),
fTOFHeader(new AliTOFHeader(*esd.fTOFHeader)),
fCentrality(new AliCentrality(*esd.fCentrality)),
- fEventplane(new AliEventplane(*esd.fEventplane))
+ fEventplane(new AliEventplane(*esd.fEventplane)),
+ fDetectorStatus(esd.fDetectorStatus)
+ #ifdef MFT_UPGRADE
+// , fESDMFT(new AliESDMFT(*esd.fESDMFT))
+ #endif
+
+
{
+ printf("copying ESD event...\n"); // AU
// CKB init in the constructor list and only add here ...
AddObject(fESDRun);
AddObject(fHeader);
AddObject(fErrorLogs);
AddObject(fESDACORDE);
AddObject(fTOFHeader);
-
+ #ifdef MFT_UPGRADE
+// AddObject(fESDMFT);
+ #endif
GetStdContent();
}
fConnected = source.fConnected;
fUseOwnList = source.fUseOwnList;
+
+ fDetectorStatus = source.fDetectorStatus;
return *this;
}
fTrdTrigger->~AliESDTrdTrigger();
new (fTrdTrigger) AliESDTrdTrigger();
}
+ #ifdef MFT_UPGRADE
+ //if(fESDMFT){
+// fESDMFT->~AliESDMFT();
+// new (fESDMFT) AliESDMFT();
+ // }
+ #endif
+
if(fPHOSTrigger)fPHOSTrigger->DeAllocate();
if(fEMCALTrigger)fEMCALTrigger->DeAllocate();
if(fSPDPileupVertices)fSPDPileupVertices->Delete();
if(fTrkPileupVertices)fTrkPileupVertices->Delete();
- if(fTracks)fTracks->Delete();
+ if(fTracks) fTracks->Clear("C"); // Delete();
if(fMuonTracks)fMuonTracks->Delete();
if(fPmdTracks)fPmdTracks->Delete();
if(fTrdTracks)fTrdTracks->Delete();
if(fTrdTracklets)fTrdTracklets->Delete();
- if(fV0s)fV0s->Delete();
- if(fCascades)fCascades->Delete();
- if(fKinks)fKinks->Delete();
+ if(fV0s)fV0s->Clear(); // not dynamic // Delete();
+ if(fCascades)fCascades->Clear(); // not dynamic // Delete();
+ if(fKinks)fKinks->Clear(); // not dynamyc //Delete();
if(fCaloClusters)fCaloClusters->Delete();
if(fPHOSCells)fPHOSCells->DeleteContainer();
if(fEMCALCells)fEMCALCells->DeleteContainer();
printf(" CaloClusters %d\n", GetNumberOfCaloClusters());
printf(" FMD %s\n", (fESDFMD ? "yes" : "no"));
printf(" VZERO %s\n", (fESDVZERO ? "yes" : "no"));
+ #ifdef MFT_UPGRADE
+ //printf(" MFT %s\n", (fESDMFT ? "yes" : "no"));
+ #endif
+
+
TObject* pHLTDecision=GetHLTTriggerDecision();
printf("HLT trigger decision: %s\n", pHLTDecision?pHLTDecision->GetOption():"not available");
if (pHLTDecision) pHLTDecision->Print("compact");
}
}
-
-
- //Replace the removed track with the last track
+ // Replace the removed track with the last track
TClonesArray &a=*fTracks;
delete a.RemoveAt(rm);
if (rm==last) return kTRUE;
+ // RS: Attention: semi-shalow copy is used: the new track will steal the dynamic content of old one
AliESDtrack *t=GetTrack(last);
t->SetID(rm);
- new (a[rm]) AliESDtrack(*t);
+ new (a[rm]) AliESDtrack(t, kTRUE); // detach dynamic content of the source
delete a.RemoveAt(last);
*fESDTZERO = *obj;
}
+#ifdef MFT_UPGRADE
+//void AliESDEvent::SetMFTData(AliESDMFT * obj)
+//{
+// if(fESDMFT)
+// *fESDMFT = *obj;
+//}
+#endif
+
void AliESDEvent::SetACORDEData(AliESDACORDE * obj)
{
if(fESDACORDE)
*fESDACORDE = *obj;
}
+void AliESDEvent::DetachFriends() const
+{
+ // clean friend track pointers of ESDtracks
+ Int_t ntrk=GetNumberOfTracks();
+ for (Int_t i=0; i<ntrk; i++) {
+ AliESDtrack *t=GetTrack(i);
+ t->ReleaseESDfriendTrackGently();
+ }
+}
void AliESDEvent::GetESDfriend(AliESDfriend *ev) const
{
for (Int_t i=0; i<ntrk; i++) {
AliESDtrack *t=GetTrack(i);
- const AliESDfriendTrack *f=t->GetFriendTrack();
- ev->AddTrack(f);
-
- t->ReleaseESDfriendTrack();// Not to have two copies of "friendTrack"
-
+ AliESDfriendTrack *f = (AliESDfriendTrack*)t->GetFriendTrack();
+ ev->AddTrackShallow(f);
+ t->ReleaseESDfriendTrackGently();// Not to have two copies of "friendTrack"
}
AliESDfriend *fr = (AliESDfriend*)(const_cast<AliESDEvent*>(this)->FindListObject("AliESDfriend"));
fErrorLogs = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kErrorLogs]);
fESDACORDE = (AliESDACORDE*)fESDObjects->FindObject(fgkESDListName[kESDACORDE]);
fTOFHeader = (AliTOFHeader*)fESDObjects->FindObject(fgkESDListName[kTOFHeader]);
+ #ifdef MFT_UPGRADE
+ // fESDMFT = (AliESDMFT*)fESDObjects->FindObject(fgkESDListName[kESDMFT]);
+ #endif
}
void AliESDEvent::SetStdNames(){
AddObject(new TClonesArray("AliRawDataErrorLog",0));
AddObject(new AliESDACORDE());
AddObject(new AliTOFHeader());
-
+ #ifdef MFT_UPGRADE
+ //AddObject(new AliESDMFT());
+ #endif
+
// check the order of the indices against enum...
// set names
TString branchname;
TIter next(fESDObjects);
const Int_t kSplitlevel = 99; // default value in TTree::Branch()
- const Int_t kBufsize = 32000; // default value in TTree::Branch()
+ const Int_t kBufsize = 32000/4; // default value in TTree::Branch()
TObject *obj = 0;
while ((obj = next())) {
for(int i = 0;i<fESDOld->GetNumberOfCaloClusters();i++){
AddCaloCluster(fESDOld->GetCaloCluster(i));
}
+
+ #ifdef MFT_UPGRADE
+ // MFT
+// if (fESDOld->GetMFTData()) SetMFTData(fESDOld->GetMFTData());
+ #endif
}// if fesdold
}
if (!fEventplane) fEventplane = new AliEventplane();
return fEventplane;
}
+
+Float_t AliESDEvent::GetVZEROEqMultiplicity(Int_t i) const
+{
+ // Get VZERO Multiplicity for channel i
+ // Themethod uses the equalization factors
+ // stored in the ESD-run object in order to
+ // get equal multiplicities within a VZERO rins (1/8 of VZERO)
+ if (!fESDVZERO || !fESDRun) return -1;
+
+ Int_t ring = i/8;
+ Float_t factorSum = 0;
+ for(Int_t j = 8*ring; j < (8*ring+8); ++j) {
+ factorSum += fESDRun->GetVZEROEqFactors(j);
+ }
+ Float_t factor = fESDRun->GetVZEROEqFactors(i)*8./factorSum;
+
+ return (fESDVZERO->GetMultiplicity(i)/factor);
+}