* provided "as is" without express or implied warranty. *
**************************************************************************/
-/* $Id$ */
+/* $Id: AliESDEvent.cxx 64008 2013-08-28 13:09:59Z hristov $ */
//-----------------------------------------------------------------
// Implementation of the AliESDEvent class
#include "AliESDMuonTrack.h"
#include "AliESDMuonCluster.h"
#include "AliESDMuonPad.h"
+#include "AliESDMuonGlobalTrack.h" // AU
#include "AliESDPmdTrack.h"
#include "AliESDTrdTrack.h"
#include "AliESDVertex.h"
#include "AliRawDataErrorLog.h"
#include "AliLog.h"
#include "AliESDACORDE.h"
+#include "AliESDAD.h"
#include "AliESDHLTDecision.h"
#include "AliCentrality.h"
#include "AliESDCosmicTrack.h"
#include "AliTriggerConfiguration.h"
#include "AliTriggerClass.h"
#include "AliTriggerCluster.h"
-#ifdef MFT_UPGRADE
-#include "AliESDMFT.h"
-#endif
#include "AliEventplane.h"
-
ClassImp(AliESDEvent)
-
-
// here we define the names, some classes are no TNamed, therefore the classnames
// are the Names
const char* AliESDEvent::fgkESDListName[kESDListN] = {"AliESDRun",
"MuonTracks",
"MuonClusters",
"MuonPads",
+ "MuonGlobalTracks", // AU
"PmdTracks",
"AliESDTrdTrigger",
"TrdTracks",
"PHOSCells",
"AliRawDataErrorLogs",
"AliESDACORDE",
+ "AliESDAD",
"AliTOFHeader",
- "CosmicTracks"
- #ifdef MFT_UPGRADE
-// , "AliESDMFT"
- #endif
- };
+ "CosmicTracks",
+ "AliESDTOFCluster",
+ "AliESDTOFHit",
+ "AliESDTOFMatch"};
+
//______________________________________________________________________________
AliESDEvent::AliESDEvent():
fPHOSTrigger(0),
fEMCALTrigger(0),
fESDACORDE(0),
+ fESDAD(0),
fTrdTrigger(0),
fSPDPileupVertices(0),
fTrkPileupVertices(0),
fMuonTracks(0),
fMuonClusters(0),
fMuonPads(0),
+ fMuonGlobalTracks(0), // AU
fPmdTracks(0),
fTrdTracks(0),
fTrdTracklets(0),
fCaloClusters(0),
fEMCALCells(0), fPHOSCells(0),
fCosmicTracks(0),
+ fESDTOFClusters(0),
+ fESDTOFHits(0),
+ fESDTOFMatches(0),
fErrorLogs(0),
fOldMuonStructure(kFALSE),
fESDOld(0),
fESDFriendOld(0),
fConnected(kFALSE),
fUseOwnList(kFALSE),
+ fTracksConnected(kFALSE),
fTOFHeader(0),
fCentrality(0),
fEventplane(0),
- fDetectorStatus(0xFFFFFFFF)
- #ifdef MFT_UPGRADE
-// , fESDMFT(0)
- #endif
+ fDetectorStatus(0xFFFFFFFF),
+ fDAQDetectorPattern(0xFFFF),
+ fDAQAttributes(0xFFFF)
{
}
//______________________________________________________________________________
fPHOSTrigger(new AliESDCaloTrigger(*esd.fPHOSTrigger)),
fEMCALTrigger(new AliESDCaloTrigger(*esd.fEMCALTrigger)),
fESDACORDE(new AliESDACORDE(*esd.fESDACORDE)),
+ fESDAD(new AliESDAD(*esd.fESDAD)),
fTrdTrigger(new AliESDTrdTrigger(*esd.fTrdTrigger)),
fSPDPileupVertices(new TClonesArray(*esd.fSPDPileupVertices)),
fTrkPileupVertices(new TClonesArray(*esd.fTrkPileupVertices)),
fMuonTracks(new TClonesArray(*esd.fMuonTracks)),
fMuonClusters(new TClonesArray(*esd.fMuonClusters)),
fMuonPads(new TClonesArray(*esd.fMuonPads)),
+ fMuonGlobalTracks(new TClonesArray(*esd.fMuonGlobalTracks)), // AU
fPmdTracks(new TClonesArray(*esd.fPmdTracks)),
fTrdTracks(new TClonesArray(*esd.fTrdTracks)),
fTrdTracklets(new TClonesArray(*esd.fTrdTracklets)),
fEMCALCells(new AliESDCaloCells(*esd.fEMCALCells)),
fPHOSCells(new AliESDCaloCells(*esd.fPHOSCells)),
fCosmicTracks(new TClonesArray(*esd.fCosmicTracks)),
+ fESDTOFClusters(esd.fESDTOFClusters ? new TClonesArray(*esd.fESDTOFClusters) : 0),
+ fESDTOFHits(esd.fESDTOFHits ? new TClonesArray(*esd.fESDTOFHits) : 0),
+ fESDTOFMatches(esd.fESDTOFMatches ? new TClonesArray(*esd.fESDTOFMatches) : 0),
fErrorLogs(new TClonesArray(*esd.fErrorLogs)),
fOldMuonStructure(esd.fOldMuonStructure),
fESDOld(esd.fESDOld ? new AliESD(*esd.fESDOld) : 0),
fESDFriendOld(esd.fESDFriendOld ? new AliESDfriend(*esd.fESDFriendOld) : 0),
fConnected(esd.fConnected),
fUseOwnList(esd.fUseOwnList),
+ fTracksConnected(kFALSE),
fTOFHeader(new AliTOFHeader(*esd.fTOFHeader)),
fCentrality(new AliCentrality(*esd.fCentrality)),
fEventplane(new AliEventplane(*esd.fEventplane)),
- fDetectorStatus(esd.fDetectorStatus)
- #ifdef MFT_UPGRADE
-// , fESDMFT(new AliESDMFT(*esd.fESDMFT))
- #endif
-
-
+ fDetectorStatus(esd.fDetectorStatus),
+ fDAQDetectorPattern(esd.fDAQDetectorPattern),
+ fDAQAttributes(esd.fDAQAttributes)
{
printf("copying ESD event...\n"); // AU
// CKB init in the constructor list and only add here ...
AddObject(fTrkPileupVertices);
AddObject(fTracks);
AddObject(fMuonTracks);
+ AddObject(fMuonGlobalTracks); // AU
AddObject(fPmdTracks);
AddObject(fTrdTracks);
AddObject(fTrdTracklets);
AddObject(fEMCALCells);
AddObject(fPHOSCells);
AddObject(fCosmicTracks);
+ AddObject(fESDTOFClusters);
+ AddObject(fESDTOFHits);
+ AddObject(fESDTOFMatches);
AddObject(fErrorLogs);
AddObject(fESDACORDE);
+ AddObject(fESDAD);
AddObject(fTOFHeader);
AddObject(fMuonClusters);
AddObject(fMuonPads);
- #ifdef MFT_UPGRADE
-// AddObject(fESDMFT);
- #endif
GetStdContent();
+ ConnectTracks();
}
AliESDEvent & AliESDEvent::operator=(const AliESDEvent& source) {
// Assignment operator
-
+ printf("operator = ESD\n");
if(&source == this) return *this;
AliVEvent::operator=(source);
fConnected = source.fConnected;
fUseOwnList = source.fUseOwnList;
-
+
fDetectorStatus = source.fDetectorStatus;
+ fDAQDetectorPattern = source.fDAQDetectorPattern;
+ fDAQAttributes = source.fDAQAttributes;
+ fTracksConnected = kFALSE;
+ ConnectTracks();
return *this;
}
if (fCentrality) delete fCentrality;
if (fEventplane) delete fEventplane;
+
}
void AliESDEvent::Copy(TObject &obj) const {
// Reset the standard contents
ResetStdContent();
fDetectorStatus = 0xFFFFFFFF;
-
+ fDAQDetectorPattern = 0xFFFF;
+ fDAQAttributes = 0xFFFF;
// reset for the old data without AliESDEvent...
if(fESDOld)fESDOld->Reset();
if(fESDFriendOld){
}
+//______________________________________________________________________________
Bool_t AliESDEvent::ResetWithPlacementNew(TObject *pObject){
//
// funtion to reset using the already allocated space
return kTRUE;
}
+//______________________________________________________________________________
void AliESDEvent::ResetStdContent()
{
// Reset the standard contents
fESDACORDE->~AliESDACORDE();
new (fESDACORDE) AliESDACORDE();
}
+
+ if(fESDAD){
+ fESDAD->~AliESDAD();
+ new (fESDAD) AliESDAD();
+ }
+
+
if(fESDTZERO) fESDTZERO->Reset();
// CKB no clear/reset implemented
if(fTPCVertex){
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();
+ fTracksConnected = kFALSE;
if(fTracks)fTracks->Delete();
if(fMuonTracks)fMuonTracks->Clear("C");
if(fMuonClusters)fMuonClusters->Clear("C");
if(fMuonPads)fMuonPads->Clear("C");
+ if(fMuonGlobalTracks)fMuonGlobalTracks->Clear("C"); // AU
if(fPmdTracks)fPmdTracks->Delete();
if(fTrdTracks)fTrdTracks->Delete();
if(fTrdTracklets)fTrdTracklets->Delete();
if(fPHOSCells)fPHOSCells->DeleteContainer();
if(fEMCALCells)fEMCALCells->DeleteContainer();
if(fCosmicTracks)fCosmicTracks->Delete();
+ if(fESDTOFClusters)fESDTOFClusters->Clear();
+ if(fESDTOFHits)fESDTOFHits->Clear();
+ if(fESDTOFMatches)fESDTOFMatches->Clear();
if(fErrorLogs) fErrorLogs->Delete();
// don't reset fconnected fConnected and the list
}
+//______________________________________________________________________________
Int_t AliESDEvent::AddV0(const AliESDv0 *v) {
//
// Add V0
// Check if a given detector was read-out in the analyzed event
const TObjArray& classesArray=trigConf->GetClasses();
ULong64_t trigMask=GetTriggerMask();
+ ULong64_t trigMaskNext50=GetTriggerMaskNext50();
Int_t nclasses = classesArray.GetEntriesFast();
for(Int_t iclass=0; iclass < nclasses; iclass++ ) {
AliTriggerClass* trclass = (AliTriggerClass*)classesArray.At(iclass);
- Int_t classMask=trclass->GetMask();
+ ULong64_t classMask=trclass->GetMask();
+ ULong64_t classMaskNext50=trclass->GetMaskNext50();
if(trigMask & classMask){
TString detList=trclass->GetCluster()->GetDetectorsInCluster();
if(detList.Contains(detector.Data())){
return kTRUE;
}
}
+ if(trigMaskNext50 & classMaskNext50){
+ TString detList=trclass->GetCluster()->GetDetectorsInCluster();
+ if(detList.Contains(detector.Data())){
+ return kTRUE;
+ }
+ }
}
return kFALSE;
}
// Print header information of the event
//
printf("ESD run information\n");
- printf("Event # in file %d Bunch crossing # %d Orbit # %d Period # %d Run # %d Trigger %lld Magnetic field %f \n",
+ printf("Event # in file %d Bunch crossing # %d Orbit # %d Period # %d Run # %d Trigger %lld %lld Magnetic field %f \n",
GetEventNumberInFile(),
GetBunchCrossNumber(),
GetOrbitNumber(),
GetPeriodNumber(),
GetRunNumber(),
GetTriggerMask(),
+ GetTriggerMaskNext50(),
GetMagneticField() );
if (fPrimaryVertex)
printf("Vertex: (%.4f +- %.4f, %.4f +- %.4f, %.4f +- %.4f) cm\n",
- fPrimaryVertex->GetXv(), fPrimaryVertex->GetXRes(),
- fPrimaryVertex->GetYv(), fPrimaryVertex->GetYRes(),
- fPrimaryVertex->GetZv(), fPrimaryVertex->GetZRes());
+ fPrimaryVertex->GetX(), fPrimaryVertex->GetXRes(),
+ fPrimaryVertex->GetY(), fPrimaryVertex->GetYRes(),
+ fPrimaryVertex->GetZ(), fPrimaryVertex->GetZRes());
printf("Mean vertex in RUN: X=%.4f Y=%.4f Z=%.4f cm\n",
GetDiamondX(),GetDiamondY(),GetDiamondZ());
if(fSPDMult)
printf("Number of tracks: \n");
printf(" charged %d\n", GetNumberOfTracks());
printf(" muon %d\n", GetNumberOfMuonTracks());
+ printf(" glob muon %d\n", GetNumberOfMuonGlobalTracks()); // AU
printf(" pmd %d\n", GetNumberOfPmdTracks());
printf(" trd %d\n", GetNumberOfTrdTracks());
printf(" trd trkl %d\n", GetNumberOfTrdTracklets());
printf(" muClusters %d\n", fMuonClusters ? fMuonClusters->GetEntriesFast() : 0);
printf(" muPad %d\n", fMuonPads ? fMuonPads->GetEntriesFast() : 0);
if (fCosmicTracks) printf(" Cosmics %d\n", GetNumberOfCosmicTracks());
- #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");
return;
}
-void AliESDEvent::SetESDfriend(const AliESDfriend *ev) const {
- //
- // Attaches the complementary info to the ESD
- //
+//______________________________________________________________________________
+void AliESDEvent::SetESDfriend(const AliESDfriend *ev) const
+{
+//
+// Attaches the complementary info to the ESD
+//
if (!ev) return;
// to be sure that we set the tracks also
}
}
-Bool_t AliESDEvent::RemoveKink(Int_t rm) const {
- // ---------------------------------------------------------
- // Remove a kink candidate and references to it from ESD,
- // if this candidate does not come from a reconstructed decay
- // Not yet implemented...
- // ---------------------------------------------------------
+//______________________________________________________________________________
+Bool_t AliESDEvent::RemoveKink(Int_t rm) const
+{
+// ---------------------------------------------------------
+// Remove a kink candidate and references to it from ESD,
+// if this candidate does not come from a reconstructed decay
+// Not yet implemented...
+// ---------------------------------------------------------
Int_t last=GetNumberOfKinks()-1;
if ((rm<0)||(rm>last)) return kFALSE;
return kTRUE;
}
-Bool_t AliESDEvent::RemoveV0(Int_t rm) const {
- // ---------------------------------------------------------
- // Remove a V0 candidate and references to it from ESD,
- // if this candidate does not come from a reconstructed decay
- // ---------------------------------------------------------
+//______________________________________________________________________________
+Bool_t AliESDEvent::RemoveV0(Int_t rm) const
+{
+// ---------------------------------------------------------
+// Remove a V0 candidate and references to it from ESD,
+// if this candidate does not come from a reconstructed decay
+// ---------------------------------------------------------
Int_t last=GetNumberOfV0s()-1;
if ((rm<0)||(rm>last)) return kFALSE;
return kTRUE;
}
-Bool_t AliESDEvent::RemoveTrack(Int_t rm) const {
- // ---------------------------------------------------------
- // Remove a track and references to it from ESD,
- // if this track does not come from a reconstructed decay
- // ---------------------------------------------------------
+//______________________________________________________________________________
+Bool_t AliESDEvent::RemoveTrack(Int_t rm) const
+{
+// ---------------------------------------------------------
+// Remove a track and references to it from ESD,
+// if this track does not come from a reconstructed decay
+// ---------------------------------------------------------
Int_t last=GetNumberOfTracks()-1;
if ((rm<0)||(rm>last)) return kFALSE;
}
}
-
-
+ // from here on we remove the track
+ //
//Replace the removed track with the last track
TClonesArray &a=*fTracks;
+ AliESDtrack* trm = GetTrack(rm);
+ trm->SuppressTOFMatches(); // remove reference to this track from stored TOF clusters
delete a.RemoveAt(rm);
-
+ //
if (rm==last) return kTRUE;
AliESDtrack *t=GetTrack(last);
new (a[rm]) AliESDtrack(*t);
delete a.RemoveAt(last);
-
if (!used) return kTRUE;
return kTRUE;
}
-
-Bool_t AliESDEvent::Clean(Float_t *cleanPars) {
+//______________________________________________________________________________
+Bool_t AliESDEvent::Clean(Float_t *cleanPars)
+{
//
// Remove the data which are not needed for the physics analysis.
//
return rc;
}
+//______________________________________________________________________________
Char_t AliESDEvent::AddPileupVertexSPD(const AliESDVertex *vtx)
{
// Add a pileup primary vertex reconstructed with SPD
return n;
}
+//______________________________________________________________________________
Char_t AliESDEvent::AddPileupVertexTracks(const AliESDVertex *vtx)
{
// Add a pileup primary vertex reconstructed with SPD
return n;
}
+//______________________________________________________________________________
Int_t AliESDEvent::AddTrack(const AliESDtrack *t)
{
// Add track
TClonesArray &ftr = *fTracks;
AliESDtrack * track = new(ftr[fTracks->GetEntriesFast()])AliESDtrack(*t);
track->SetID(fTracks->GetEntriesFast()-1);
+ track->SetESDEvent(this);
return track->GetID();
}
+//______________________________________________________________________________
AliESDtrack* AliESDEvent::NewTrack()
{
// Add a new track
TClonesArray &ftr = *fTracks;
AliESDtrack * track = new(ftr[fTracks->GetEntriesFast()])AliESDtrack();
track->SetID(fTracks->GetEntriesFast()-1);
+ track->SetESDEvent(this);
return track;
}
return track;
}
+//______________________________________________________________________________
+AliESDMuonGlobalTrack* AliESDEvent::GetMuonGlobalTrack(Int_t i) // AU
+{
+ // get the MUON+MFT track at the position i in the internal array of track
+ if (!fMuonGlobalTracks) return 0x0;
+ AliESDMuonGlobalTrack *track = (AliESDMuonGlobalTrack*) fMuonGlobalTracks->UncheckedAt(i);
+ track->SetESDEvent(this);
+ return track;
+}
+
//______________________________________________________________________________
void AliESDEvent::AddMuonTrack(const AliESDMuonTrack *t)
{
}
//______________________________________________________________________________
+void AliESDEvent::AddMuonGlobalTrack(const AliESDMuonGlobalTrack *t) // AU
+{
+ // add a MUON+MFT track
+ TClonesArray &fmu = *fMuonGlobalTracks;
+ new (fmu[fMuonGlobalTracks->GetEntriesFast()]) AliESDMuonGlobalTrack(*t);
+}
+
+//______________________________________________________________________________
+
AliESDMuonTrack* AliESDEvent::NewMuonTrack()
{
// create a new MUON track at the end of the internal array of track
return new(fmu[fMuonTracks->GetEntriesFast()]) AliESDMuonTrack();
}
+//______________________________________________________________________________
+AliESDMuonGlobalTrack* AliESDEvent::NewMuonGlobalTrack() // AU
+{
+ // create a new MUON+MFT track at the end of the internal array of track
+ TClonesArray &fmu = *fMuonGlobalTracks;
+ return new(fmu[fMuonGlobalTracks->GetEntriesFast()]) AliESDMuonGlobalTrack();
+}
+
//______________________________________________________________________________
Int_t AliESDEvent::GetNumberOfMuonClusters()
{
return new(fmu[fMuonPads->GetEntriesFast()]) AliESDMuonPad();
}
+//______________________________________________________________________________
void AliESDEvent::AddPmdTrack(const AliESDPmdTrack *t)
{
TClonesArray &fpmd = *fPmdTracks;
new(fpmd[fPmdTracks->GetEntriesFast()]) AliESDPmdTrack(*t);
}
+//______________________________________________________________________________
void AliESDEvent::SetTrdTrigger(const AliESDTrdTrigger *t)
{
*fTrdTrigger = *t;
}
+//______________________________________________________________________________
void AliESDEvent::AddTrdTrack(const AliESDTrdTrack *t)
{
TClonesArray &ftrd = *fTrdTracks;
new(ftrd[fTrdTracks->GetEntriesFast()]) AliESDTrdTrack(*t);
}
+//______________________________________________________________________________
void AliESDEvent::AddTrdTracklet(const AliESDTrdTracklet *trkl)
{
new ((*fTrdTracklets)[fTrdTracklets->GetEntriesFast()]) AliESDTrdTracklet(*trkl);
}
+//______________________________________________________________________________
+void AliESDEvent::AddTrdTracklet(UInt_t trackletWord, Short_t hcid, Int_t label)
+{
+ new ((*fTrdTracklets)[fTrdTracklets->GetEntriesFast()]) AliESDTrdTracklet(trackletWord, hcid, label);
+}
+
+//______________________________________________________________________________
Int_t AliESDEvent::AddKink(const AliESDkink *c)
{
- // Add kink
- TClonesArray &fk = *fKinks;
- AliESDkink * kink = new(fk[fKinks->GetEntriesFast()]) AliESDkink(*c);
- kink->SetID(fKinks->GetEntriesFast()); // CKB different from the other imps..
- return fKinks->GetEntriesFast()-1;
+ // Add kink
+ TClonesArray &fk = *fKinks;
+ AliESDkink * kink = new(fk[fKinks->GetEntriesFast()]) AliESDkink(*c);
+ kink->SetID(fKinks->GetEntriesFast()); // CKB different from the other imps..
+ return fKinks->GetEntriesFast()-1;
}
+//______________________________________________________________________________
void AliESDEvent::AddCascade(const AliESDcascade *c)
{
TClonesArray &fc = *fCascades;
new(fc[fCascades->GetEntriesFast()]) AliESDcascade(*c);
}
+//______________________________________________________________________________
void AliESDEvent::AddCosmicTrack(const AliESDCosmicTrack *t)
{
TClonesArray &ft = *fCosmicTracks;
}
+//______________________________________________________________________________
Int_t AliESDEvent::AddCaloCluster(const AliESDCaloCluster *c)
{
- // Add calocluster
- TClonesArray &fc = *fCaloClusters;
- AliESDCaloCluster *clus = new(fc[fCaloClusters->GetEntriesFast()]) AliESDCaloCluster(*c);
- clus->SetID(fCaloClusters->GetEntriesFast()-1);
- return fCaloClusters->GetEntriesFast()-1;
- }
+ // Add calocluster
+ TClonesArray &fc = *fCaloClusters;
+ AliESDCaloCluster *clus = new(fc[fCaloClusters->GetEntriesFast()]) AliESDCaloCluster(*c);
+ clus->SetID(fCaloClusters->GetEntriesFast()-1);
+ return fCaloClusters->GetEntriesFast()-1;
+}
+//______________________________________________________________________________
void AliESDEvent::AddRawDataErrorLog(const AliRawDataErrorLog *log) const {
TClonesArray &errlogs = *fErrorLogs;
new(errlogs[errlogs.GetEntriesFast()]) AliRawDataErrorLog(*log);
}
+//______________________________________________________________________________
void AliESDEvent::SetZDCData(const AliESDZDC * obj)
{
// use already allocated space
*fESDZDC = *obj;
}
+//______________________________________________________________________________
void AliESDEvent::SetPrimaryVertexTPC(const AliESDVertex *vertex)
{
// Set the TPC vertex
}
}
+//______________________________________________________________________________
void AliESDEvent::SetPrimaryVertexSPD(const AliESDVertex *vertex)
{
// Set the SPD vertex
}
}
+//______________________________________________________________________________
void AliESDEvent::SetPrimaryVertexTracks(const AliESDVertex *vertex)
{
// Set the primary vertex reconstructed using he ESD tracks.
}
}
+//______________________________________________________________________________
const AliESDVertex * AliESDEvent::GetPrimaryVertex() const
{
//
return fSPDVertex;
}
+//______________________________________________________________________________
AliESDVertex * AliESDEvent::PrimaryVertexTracksUnconstrained() const
{
//
return vertex;
}
+//______________________________________________________________________________
void AliESDEvent::SetMultiplicity(const AliMultiplicity *mul)
{
// Set the SPD Multiplicity
}
+//______________________________________________________________________________
void AliESDEvent::SetFMDData(AliESDFMD * obj)
{
// use already allocated space
}
}
+//______________________________________________________________________________
void AliESDEvent::SetVZEROData(const AliESDVZERO * obj)
{
// use already allocated space
*fESDVZERO = *obj;
}
+//______________________________________________________________________________
void AliESDEvent::SetTZEROData(const AliESDTZERO * obj)
{
// use already allocated space
*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::SetADData(AliESDAD * obj)
+{
+ if(fESDAD)
+ *fESDAD = *obj;
+}
+//______________________________________________________________________________
void AliESDEvent::GetESDfriend(AliESDfriend *ev) const
{
//
}
- AliESDfriend *fr = (AliESDfriend*)(const_cast<AliESDEvent*>(this)->FindListObject("AliESDfriend"));
+ AliESDfriend *fr = (AliESDfriend*)(const_cast<AliESDEvent*>(this)->FindFriend());
if (fr) ev->SetVZEROfriend(fr->GetVZEROfriend());
}
+//______________________________________________________________________________
void AliESDEvent::AddObject(TObject* obj)
{
// Add an object to the list of object.
fESDObjects->AddLast(obj);
}
-
+//______________________________________________________________________________
void AliESDEvent::GetStdContent()
{
// set pointers for standard content
fMuonTracks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kMuonTracks]);
fMuonClusters = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kMuonClusters]);
fMuonPads = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kMuonPads]);
+ fMuonGlobalTracks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kMuonGlobalTracks]); // AU
fPmdTracks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kPmdTracks]);
fTrdTrigger = (AliESDTrdTrigger*)fESDObjects->FindObject(fgkESDListName[kTrdTrigger]);
fTrdTracks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kTrdTracks]);
fPHOSCells = (AliESDCaloCells*)fESDObjects->FindObject(fgkESDListName[kPHOSCells]);
fErrorLogs = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kErrorLogs]);
fESDACORDE = (AliESDACORDE*)fESDObjects->FindObject(fgkESDListName[kESDACORDE]);
+ fESDAD = (AliESDAD*)fESDObjects->FindObject(fgkESDListName[kESDAD]);
fTOFHeader = (AliTOFHeader*)fESDObjects->FindObject(fgkESDListName[kTOFHeader]);
fCosmicTracks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kCosmicTracks]);
- #ifdef MFT_UPGRADE
- // fESDMFT = (AliESDMFT*)fESDObjects->FindObject(fgkESDListName[kESDMFT]);
- #endif
+ fESDTOFClusters = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kTOFclusters]);
+ fESDTOFHits = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kTOFhit]);
+ fESDTOFMatches = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kTOFmatch]);
}
+//______________________________________________________________________________
void AliESDEvent::SetStdNames(){
// Set the names of the standard contents
//
}
}
-
+//______________________________________________________________________________
void AliESDEvent::CreateStdContent(Bool_t bUseThisList){
fUseOwnList = bUseThisList;
CreateStdContent();
}
+//______________________________________________________________________________
void AliESDEvent::CreateStdContent()
{
// create the standard AOD content and set pointers
AddObject(new TClonesArray("AliESDMuonTrack",0));
AddObject(new TClonesArray("AliESDMuonCluster",0));
AddObject(new TClonesArray("AliESDMuonPad",0));
+ AddObject(new TClonesArray("AliESDMuonGlobalTrack",0)); // AU
AddObject(new TClonesArray("AliESDPmdTrack",0));
AddObject(new AliESDTrdTrigger());
AddObject(new TClonesArray("AliESDTrdTrack",0));
AddObject(new AliESDCaloCells());
AddObject(new TClonesArray("AliRawDataErrorLog",0));
AddObject(new AliESDACORDE());
+ AddObject(new AliESDAD());
AddObject(new AliTOFHeader());
AddObject(new TClonesArray("AliESDCosmicTrack",0));
- #ifdef MFT_UPGRADE
- //AddObject(new AliESDMFT());
- #endif
+ AddObject(new TClonesArray("AliESDTOFCluster",0));
+ AddObject(new TClonesArray("AliESDTOFHit",0));
+ AddObject(new TClonesArray("AliESDTOFMatch",0));
// check the order of the indices against enum...
GetStdContent();
}
+//______________________________________________________________________________
void AliESDEvent::CompleteStdContent()
{
// Create missing standard objects and add them to the TList of objects
}
}
+//______________________________________________________________________________
TObject* AliESDEvent::FindListObject(const char *name) const {
//
// Find object with name "name" in the list of branches
return 0;
}
+//______________________________________________________________________________
Int_t AliESDEvent::GetPHOSClusters(TRefArray *clusters) const
{
// fills the provided TRefArray with all found phos clusters
return clusters->GetEntriesFast();
}
+//______________________________________________________________________________
Int_t AliESDEvent::GetEMCALClusters(TRefArray *clusters) const
{
// fills the provided TRefArray with all found emcal clusters
return clusters->GetEntriesFast();
}
+//______________________________________________________________________________
void AliESDEvent::WriteToTree(TTree* tree) const {
// Book the branches as in TTree::Branch(TCollection*)
// but add a "." at the end of top level branches which are
tree->Bronch(branchname, obj->ClassName(), fESDObjects->GetObjectRef(obj),kBufsize, splitLevel);
}
}
+
tree->Branch("fDetectorStatus",(void*)&fDetectorStatus,"fDetectorStatus/l");
+ tree->Branch("fDAQDetectorPattern",(void*)&fDAQDetectorPattern,"fDAQDetectorPattern/i");
+ tree->Branch("fDAQAttributes",(void*)&fDAQAttributes,"fDAQAttributes/i");
}
-
+//______________________________________________________________________________
void AliESDEvent::ReadFromTree(TTree *tree, Option_t* opt){
//
// Connect the ESDEvent to a tree
fESDObjects->Delete();
fESDObjects = connectedList;
tree->SetBranchAddress("fDetectorStatus",&fDetectorStatus); //PH probably redundant
+ tree->SetBranchAddress("fDAQDetectorPattern",&fDAQDetectorPattern);
+ tree->SetBranchAddress("fDAQAttributes",&fDAQAttributes);
GetStdContent();
fOldMuonStructure = fESDObjects->TestBit(BIT(23));
fConnected = true;
}
}
tree->SetBranchAddress("fDetectorStatus",&fDetectorStatus);
+ tree->SetBranchAddress("fDAQDetectorPattern",&fDAQDetectorPattern);
+ tree->SetBranchAddress("fDAQAttributes",&fDAQAttributes);
+
GetStdContent();
// when reading back we are not owner of the list
// must not delete it
}
}
tree->SetBranchAddress("fDetectorStatus",&fDetectorStatus);
+ tree->SetBranchAddress("fDAQDetectorPattern",&fDAQDetectorPattern);
+ tree->SetBranchAddress("fDAQAttributes",&fDAQAttributes);
+
GetStdContent();
// when reading back we are not owner of the list
// must not delete it
}
}
-
+//______________________________________________________________________________
void AliESDEvent::CopyFromOldESD()
{
// Method which copies over everthing from the old esd structure to the
AddCaloCluster(fESDOld->GetCaloCluster(i));
}
- #ifdef MFT_UPGRADE
- // MFT
-// if (fESDOld->GetMFTData()) SetMFTData(fESDOld->GetMFTData());
- #endif
-
}// if fesdold
}
+//______________________________________________________________________________
Bool_t AliESDEvent::IsEventSelected(const char *trigExpr) const
{
// Check if the event satisfies the trigger
// trigExpr can be any logical expression
// of the trigger classes defined in AliESDRun
// In case of wrong syntax return kTRUE.
+ // Modified by rl for 100 classes - to be tested
TString expr(trigExpr);
if (expr.IsNull()) return kTRUE;
ULong64_t mask = GetTriggerMask();
- for(Int_t itrig = 0; itrig < AliESDRun::kNTriggerClasses; itrig++) {
+ for(Int_t itrig = 0; itrig < AliESDRun::kNTriggerClasses/2; itrig++) {
if (mask & (1ull << itrig)) {
expr.ReplaceAll(GetESDRun()->GetTriggerClass(itrig),"1");
}
expr.ReplaceAll(GetESDRun()->GetTriggerClass(itrig),"0");
}
}
+ ULong64_t maskNext50 = GetTriggerMaskNext50();
+ for(Int_t itrig = 0; itrig < AliESDRun::kNTriggerClasses/2; itrig++) {
+ if (maskNext50 & (1ull << itrig)) {
+ expr.ReplaceAll(GetESDRun()->GetTriggerClass(itrig+50),"1");
+ }
+ else {
+ expr.ReplaceAll(GetESDRun()->GetTriggerClass(itrig+50),"0");
+ }
+ }
Int_t error;
if ((gROOT->ProcessLineFast(expr.Data(),&error) == 0) &&
}
+//______________________________________________________________________________
TObject* AliESDEvent::GetHLTTriggerDecision() const
{
// get the HLT trigger decission object
return description;
}
+//______________________________________________________________________________
Bool_t AliESDEvent::IsHLTTriggerFired(const char* name) const
{
// get the HLT trigger decission description
//
}
+//______________________________________________________________________________
Bool_t AliESDEvent::IsPileupFromSPDInMultBins() const {
Int_t nTracklets=GetMultiplicity()->GetNumberOfTracklets();
if(nTracklets<20) return IsPileupFromSPD(3,0.8);
else return IsPileupFromSPD(5,0.8);
}
+//______________________________________________________________________________
void AliESDEvent::SetTOFHeader(const AliTOFHeader *header)
{
//
}
+//______________________________________________________________________________
AliCentrality* AliESDEvent::GetCentrality()
{
if (!fCentrality) fCentrality = new AliCentrality();
return fCentrality;
}
+//______________________________________________________________________________
AliEventplane* AliESDEvent::GetEventplane()
{
if (!fEventplane) fEventplane = new AliEventplane();
return fEventplane;
}
+//______________________________________________________________________________
Float_t AliESDEvent::GetVZEROEqMultiplicity(Int_t i) const
{
// Get VZERO Multiplicity for channel i
return (fESDVZERO->GetMultiplicity(i)/factor);
}
+
+//______________________________________________________________________________
+void AliESDEvent::SetTOFcluster(Int_t ntofclusters,AliESDTOFCluster *cluster,Int_t *mapping)
+{
+ // Reset TClonesArray of TOF clusters
+ if (!fESDTOFClusters) {
+ AliError("fESDTOFClusters is not initialized");
+ return;
+ }
+ fESDTOFClusters->Clear();
+
+ Int_t goodhit[20000];
+ if(mapping){
+ for(Int_t i=0;i < 20000;i++){
+ goodhit[i] = 0;
+ }
+ }
+
+ for(Int_t i=0;i < ntofclusters;i++){
+
+ if(cluster[i].GetNMatchableTracks() || !mapping){
+ if(mapping)
+ mapping[i] = fESDTOFClusters->GetEntriesFast();
+
+ // update TClonesArray
+ TClonesArray &ftr = *fESDTOFClusters;
+ AliESDTOFCluster *clusterTBW = new(ftr[fESDTOFClusters->GetEntriesFast()])AliESDTOFCluster(cluster[i]);
+
+ if(mapping){
+ // loop over hit in the cluster
+ for(Int_t k=0;k < clusterTBW->GetNTOFhits();k++){
+ Int_t ipos = clusterTBW->GetHitIndex(k);
+ goodhit[ipos] = 1; // hit should be kept
+ }
+ }
+ }
+ }
+
+ if(mapping){
+ AliInfo(Form("TOF cluster before of matching = %i , after = %i\n",ntofclusters,fESDTOFClusters->GetEntriesFast()));
+ Int_t hitnewpos[20000]={0};
+ Int_t nhitOriginal = fESDTOFHits->GetEntries();
+ for(Int_t i=0;i < fESDTOFHits->GetEntries();i++){
+ if(goodhit[i]){
+ hitnewpos[i] = i;
+ }
+ else{ // remove hit and decrease the hit array
+ TClonesArray &a=*fESDTOFHits;
+ Int_t lastpos = fESDTOFHits->GetEntries()-1;
+
+ if(i == lastpos)
+ delete a.RemoveAt(i);
+ else{
+ Int_t nhitBefore = fESDTOFHits->GetEntries();
+ for(Int_t k=nhitBefore-1;k>i;k--){ // find the last good track
+ if(!goodhit[k]){ // remove track
+ delete a.RemoveAt(k);
+ if(k-i==1) delete a.RemoveAt(i);
+ }
+ else{ // replace last one to the "i"
+ AliESDTOFHit *last = (AliESDTOFHit *) fESDTOFHits->At(k);
+ delete a.RemoveAt(i);
+ new (a[i]) AliESDTOFHit(*last);
+ delete a.RemoveAt(k);
+ hitnewpos[k] = i;
+ k = 0;
+ }
+ }
+ }
+ }
+ }
+
+ // remap cluster to hits
+ for(Int_t i=0;i < fESDTOFClusters->GetEntries();i++){
+ AliESDTOFCluster *cl = (AliESDTOFCluster *) fESDTOFClusters->At(i);
+ // loop over hit in the cluster
+ for(Int_t k=0;k < cl->GetNTOFhits();k++){
+ cl->SetHitIndex(k,hitnewpos[cl->GetHitIndex(k)]);
+ }
+ }
+ AliInfo(Form("TOF hit before of matching = %i , after = %i\n",nhitOriginal,fESDTOFHits->GetEntriesFast()));
+ } // end mapping
+
+}
+
+//______________________________________________________________________________
+void AliESDEvent::SetTOFcluster(Int_t ntofclusters,AliESDTOFCluster *cluster[],Int_t *mapping)
+{
+ // Reset TClonesArray of TOF clusters
+ if(fESDTOFClusters)fESDTOFClusters->Delete();
+
+ Int_t goodhit[20000];
+ if(mapping){
+ for(Int_t i=0;i < 20000;i++){
+ goodhit[i] = 0;
+ }
+ }
+
+ for(Int_t i=0;i < ntofclusters;i++){
+
+ if(cluster[i]->GetNMatchableTracks() || !mapping){
+ if(mapping)
+ mapping[i] = fESDTOFClusters->GetEntriesFast();
+
+ // update TClonesArray
+ TClonesArray &ftr = *fESDTOFClusters;
+ AliESDTOFCluster *clusterTBW = new(ftr[fESDTOFClusters->GetEntriesFast()])AliESDTOFCluster(*(cluster[i]));
+
+ if(mapping){
+ // loop over hit in the cluster
+ for(Int_t k=0;k < clusterTBW->GetNTOFhits();k++){
+ Int_t ipos = clusterTBW->GetHitIndex(k);
+ goodhit[ipos] = 1; // hit should be kept
+ }
+ }
+ }
+ }
+
+ if(mapping){
+ AliInfo(Form("TOF cluster before of matching = %i , after = %i\n",ntofclusters,fESDTOFClusters->GetEntriesFast()));
+ Int_t hitnewpos[20000]={0};
+ Int_t nhitOriginal = fESDTOFHits->GetEntries();
+ for(Int_t i=0;i < fESDTOFHits->GetEntries();i++){
+ if(goodhit[i]){
+ hitnewpos[i] = i;
+ }
+ else{ // remove hit and decrease the hit array
+ TClonesArray &a=*fESDTOFHits;
+ Int_t lastpos = fESDTOFHits->GetEntries()-1;
+
+ if(i == lastpos)
+ delete a.RemoveAt(i);
+ else{
+ Int_t nhitBefore = fESDTOFHits->GetEntries();
+ for(Int_t k=nhitBefore-1;k>i;k--){ // find the last good track
+ if(!goodhit[k]){ // remove track
+ delete a.RemoveAt(k);
+ if(k-i==1) delete a.RemoveAt(i);
+ }
+ else{ // replace last one to the "i"
+ AliESDTOFHit *last = (AliESDTOFHit *) fESDTOFHits->At(k);
+ delete a.RemoveAt(i);
+ new (a[i]) AliESDTOFHit(*last);
+ delete a.RemoveAt(k);
+ hitnewpos[k] = i;
+ k = 0;
+ }
+ }
+ }
+ }
+ }
+
+ // remap cluster to hits
+ for(Int_t i=0;i < fESDTOFClusters->GetEntries();i++){
+ AliESDTOFCluster *cl = (AliESDTOFCluster *) fESDTOFClusters->At(i);
+ // loop over hit in the cluster
+ for(Int_t k=0;k < cl->GetNTOFhits();k++){
+ cl->SetHitIndex(k,hitnewpos[cl->GetHitIndex(k)]);
+ }
+ }
+ AliInfo(Form("TOF hit before of matching = %i , after = %i\n",nhitOriginal,fESDTOFHits->GetEntriesFast()));
+ } // end mapping
+
+}
+
+//______________________________________________________________________________
+void AliESDEvent::ConnectTracks() {
+// Connect tracks to this event
+ if (fTracksConnected || !fTracks || !fTracks->GetEntriesFast()) return;
+ AliESDtrack *track;
+ TIter next(fTracks);
+ while ((track=(AliESDtrack*)next())) track->SetESDEvent(this);
+ //
+ // The same for TOF clusters
+ if (fESDTOFClusters) {
+ AliESDTOFCluster *clus;
+ TIter nextTOF(fESDTOFClusters);
+ while ((clus=(AliESDTOFCluster*)nextTOF())) clus->SetEvent((AliVEvent *) this);
+ }
+ fTracksConnected = kTRUE;
+ //
+}
+
+//______________________________________________________________________________
+AliESDfriend* AliESDEvent::FindFriend() const
+{
+ return static_cast<AliESDfriend*>(FindListObject("AliESDfriend"));
+}
+
+AliVEvent::EDataLayoutType AliESDEvent::GetDataLayoutType() const {return AliVEvent::kESD;}
+