Possibility to keep in ESD several (pileup) primary vertices reconstructed with SPD...
authorbelikov <belikov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Mar 2009 16:54:20 +0000 (16:54 +0000)
committerbelikov <belikov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 18 Mar 2009 16:54:20 +0000 (16:54 +0000)
STEER/AliESDEvent.cxx
STEER/AliESDEvent.h

index 2324baf..1ead29b 100644 (file)
@@ -80,6 +80,8 @@ ClassImp(AliESDEvent)
                                                       "AliMultiplicity",
                                                       "PHOSTrigger",
                                                       "EMCALTrigger",
+                                                      "SPDPileupVertices",
+                                                      "TrkPileupVertices",
                                                       "Tracks",
                                                       "MuonTracks",
                                                       "PmdTracks",
@@ -110,6 +112,8 @@ AliESDEvent::AliESDEvent():
   fPHOSTrigger(0),
   fEMCALTrigger(0),
   fESDACORDE(0),
+  fSPDPileupVertices(0),
+  fTrkPileupVertices(0),
   fTracks(0),
   fMuonTracks(0),
   fPmdTracks(0),
@@ -147,6 +151,8 @@ AliESDEvent::AliESDEvent(const AliESDEvent& esd):
   fPHOSTrigger(new AliESDCaloTrigger(*esd.fPHOSTrigger)),
   fEMCALTrigger(new AliESDCaloTrigger(*esd.fEMCALTrigger)),
   fESDACORDE(new AliESDACORDE(*esd.fESDACORDE)),
+  fSPDPileupVertices(new TClonesArray(*esd.fSPDPileupVertices)),
+  fTrkPileupVertices(new TClonesArray(*esd.fTrkPileupVertices)),
   fTracks(new TClonesArray(*esd.fTracks)),
   fMuonTracks(new TClonesArray(*esd.fMuonTracks)),
   fPmdTracks(new TClonesArray(*esd.fPmdTracks)),
@@ -181,6 +187,8 @@ AliESDEvent::AliESDEvent(const AliESDEvent& esd):
   AddObject(fSPDMult);
   AddObject(fPHOSTrigger);
   AddObject(fEMCALTrigger);
+  AddObject(fSPDPileupVertices);
+  AddObject(fTrkPileupVertices);
   AddObject(fTracks);
   AddObject(fMuonTracks);
   AddObject(fPmdTracks);
@@ -419,6 +427,8 @@ void AliESDEvent::ResetStdContent()
   }
   if(fPHOSTrigger)fPHOSTrigger->Reset(); 
   if(fEMCALTrigger)fEMCALTrigger->Reset(); 
+  if(fSPDPileupVertices)fSPDPileupVertices->Delete();
+  if(fTrkPileupVertices)fTrkPileupVertices->Delete();
   if(fTracks)fTracks->Delete();
   if(fMuonTracks)fMuonTracks->Delete();
   if(fPmdTracks)fPmdTracks->Delete();
@@ -473,6 +483,10 @@ void AliESDEvent::Print(Option_t *) const
           GetDiamondX(),GetDiamondY());
     printf("SPD Multiplicity. Number of tracklets %d \n",
            fSPDMult->GetNumberOfTracklets());
+  printf("Number of pileup primary vertices reconstructed with SPD %d\n", 
+        GetNumberOfPileupVerticesSPD());
+  printf("Number of pileup primary vertices reconstructed using the tracks %d\n",
+        GetNumberOfPileupVerticesTracks());
   printf("Number of tracks: \n");
   printf("                 charged   %d\n", GetNumberOfTracks());
   printf("                 muon      %d\n", GetNumberOfMuonTracks());
@@ -850,6 +864,20 @@ Bool_t AliESDEvent::Clean(Float_t *cleanPars) {
   return rc;
 }
 
+void  AliESDEvent::AddPileupVertexSPD(const AliESDVertex *vtx) 
+{
+    // Add a pileup primary vertex reconstructed with SPD
+    TClonesArray &ftr = *fSPDPileupVertices;
+    new(ftr[fSPDPileupVertices->GetEntriesFast()]) AliESDVertex(*vtx);
+}
+
+void  AliESDEvent::AddPileupVertexTracks(const AliESDVertex *vtx) 
+{
+    // Add a pileup primary vertex reconstructed with SPD
+    TClonesArray &ftr = *fTrkPileupVertices;
+    new(ftr[fTrkPileupVertices->GetEntriesFast()]) AliESDVertex(*vtx);
+}
+
 Int_t  AliESDEvent::AddTrack(const AliESDtrack *t) 
 {
     // Add track
@@ -1039,6 +1067,8 @@ void AliESDEvent::GetStdContent()
   fSPDMult =       (AliMultiplicity*)fESDObjects->FindObject(fgkESDListName[kSPDMult]);
   fPHOSTrigger = (AliESDCaloTrigger*)fESDObjects->FindObject(fgkESDListName[kPHOSTrigger]);
   fEMCALTrigger = (AliESDCaloTrigger*)fESDObjects->FindObject(fgkESDListName[kEMCALTrigger]);
+  fSPDPileupVertices = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kSPDPileupVertices]);
+  fTrkPileupVertices = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kTrkPileupVertices]);
   fTracks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kTracks]);
   fMuonTracks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kMuonTracks]);
   fPmdTracks = (TClonesArray*)fESDObjects->FindObject(fgkESDListName[kPmdTracks]);
@@ -1096,6 +1126,8 @@ void AliESDEvent::CreateStdContent()
   AddObject(new AliMultiplicity());
   AddObject(new AliESDCaloTrigger());
   AddObject(new AliESDCaloTrigger());
+  AddObject(new TClonesArray("AliESDVertex",0));
+  AddObject(new TClonesArray("AliESDVertex",0));
   AddObject(new TClonesArray("AliESDtrack",0));
   AddObject(new TClonesArray("AliESDMuonTrack",0));
   AddObject(new TClonesArray("AliESDPmdTrack",0));
index e3663b4..a2b9e1c 100644 (file)
@@ -73,6 +73,8 @@ public:
                       kSPDMult,
                       kPHOSTrigger,
                       kEMCALTrigger,
+                      kSPDPileupVertices,
+                      kTrkPileupVertices,
                       kTracks,
                       kMuonTracks,
                       kPmdTracks,
@@ -210,6 +212,16 @@ public:
   Bool_t RemoveV0(Int_t i)     const;
   Bool_t RemoveTrack(Int_t i)  const;
 
+  const AliESDVertex *GetPileupVertexSPD(Int_t i) const {
+    return (const AliESDVertex *)fSPDPileupVertices->UncheckedAt(i);
+  }
+  void  AddPileupVertexSPD(const AliESDVertex *vtx);
+
+  const AliESDVertex *GetPileupVertexTracks(Int_t i) const {
+    return (const AliESDVertex *)fTrkPileupVertices->UncheckedAt(i);
+  }
+  void  AddPileupVertexTracks(const AliESDVertex *vtx);
+
   AliESDtrack *GetTrack(Int_t i) const {
     return (AliESDtrack *)fTracks->UncheckedAt(i);
   }
@@ -295,6 +307,12 @@ public:
   void AddEMCALTriggerPosition(TArrayF array)  { fEMCALTrigger->AddTriggerPosition(array); }
   void AddEMCALTriggerAmplitudes(TArrayF array){ fEMCALTrigger->AddTriggerAmplitudes(array); }
 
+  Int_t GetNumberOfPileupVerticesSPD() const {
+     return fSPDPileupVertices->GetEntriesFast();
+  }
+  Int_t GetNumberOfPileupVerticesTracks() const {
+     return fTrkPileupVertices->GetEntriesFast();
+  }
   Int_t GetNumberOfTracks()     const {return fTracks->GetEntriesFast();}
   Int_t GetNumberOfHLTConfMapTracks()     const {return 0;} 
   // fHLTConfMapTracks->GetEntriesFast();}
@@ -372,6 +390,8 @@ protected:
   AliESDCaloTrigger* fEMCALTrigger;    //! PHOS Trigger information
   AliESDACORDE    *fESDACORDE;        //! ACORDE ESD object caontaining bit pattern
 
+  TClonesArray *fSPDPileupVertices;//! Pileup primary vertices reconstructed by SPD 
+  TClonesArray *fTrkPileupVertices;//! Pileup primary vertices reconstructed using the tracks 
   TClonesArray *fTracks;           //! ESD tracks 
   TClonesArray *fMuonTracks;       //! MUON ESD tracks
   TClonesArray *fPmdTracks;        //! PMD ESD tracks
@@ -400,7 +420,7 @@ protected:
   Int_t        fPHOSClusters;     // Number of PHOS clusters (subset of caloclusters)
   Int_t        fFirstPHOSCluster; // First PHOS cluster in the fCaloClusters list 
 
-  ClassDef(AliESDEvent,9)  //ESDEvent class 
+  ClassDef(AliESDEvent,10)  //ESDEvent class 
 };
 #endif