]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliESDEvent.cxx
Bumping the version number
[u/mrichter/AliRoot.git] / STEER / AliESDEvent.cxx
index e0c2cf6d4a5bdb7bed70c23ca5749ff990167e38..4f8f55e05bf1d8623a796461780557a4dd3613f3 100644 (file)
@@ -132,11 +132,7 @@ AliESDEvent::AliESDEvent():
   fESDOld(0),
   fESDFriendOld(0),
   fConnected(kFALSE),
-  fUseOwnList(kFALSE),
-  fEMCALClusters(0), 
-  fFirstEMCALCluster(-1),
-  fPHOSClusters(0), 
-  fFirstPHOSCluster(-1)
+  fUseOwnList(kFALSE)
 {
 }
 //______________________________________________________________________________
@@ -172,11 +168,7 @@ AliESDEvent::AliESDEvent(const AliESDEvent& esd):
   fESDOld(esd.fESDOld ? new AliESD(*esd.fESDOld) : 0),
   fESDFriendOld(esd.fESDFriendOld ? new AliESDfriend(*esd.fESDFriendOld) : 0),
   fConnected(esd.fConnected),
-  fUseOwnList(esd.fUseOwnList),
-  fEMCALClusters(esd.fEMCALClusters), 
-  fFirstEMCALCluster(esd.fFirstEMCALCluster),
-  fPHOSClusters(esd.fPHOSClusters), 
-  fFirstPHOSCluster(esd.fFirstPHOSCluster)
+  fUseOwnList(esd.fUseOwnList)
 
 {
   // CKB init in the constructor list and only add here ...
@@ -297,11 +289,6 @@ AliESDEvent & AliESDEvent::operator=(const AliESDEvent& source) {
 
   fConnected = source.fConnected;
   fUseOwnList = source.fUseOwnList;
-  fEMCALClusters = source.fEMCALClusters;
-  fFirstEMCALCluster = source.fFirstEMCALCluster;
-  fPHOSClusters = source.fPHOSClusters;
-  fFirstPHOSCluster = source.fFirstPHOSCluster;
-
 
   return *this;
 
@@ -448,10 +435,6 @@ void AliESDEvent::ResetStdContent()
 
   // don't reset fconnected fConnected and the list
 
-  fEMCALClusters=0; 
-  fFirstEMCALCluster=-1; 
-  fPHOSClusters=0; 
-  fFirstPHOSCluster=-1; 
 }
 
 
@@ -480,18 +463,20 @@ void AliESDEvent::Print(Option_t *) const
         GetRunNumber(),
         GetTriggerMask(),
         GetMagneticField() );
-  printf("Vertex: (%.4f +- %.4f, %.4f +- %.4f, %.4f +- %.4f) cm\n",
+  if (fPrimaryVertex)
+    printf("Vertex: (%.4f +- %.4f, %.4f +- %.4f, %.4f +- %.4f) cm\n",
           fPrimaryVertex->GetXv(), fPrimaryVertex->GetXRes(),
           fPrimaryVertex->GetYv(), fPrimaryVertex->GetYRes(),
           fPrimaryVertex->GetZv(), fPrimaryVertex->GetZRes());
-    printf("Mean vertex in RUN: X=%.4f Y=%.4f cm\n",
-          GetDiamondX(),GetDiamondY());
+  printf("Mean vertex in RUN: X=%.4f Y=%.4f Z=%.4f cm\n",
+        GetDiamondX(),GetDiamondY(),GetDiamondZ());
+  if(fSPDMult)
     printf("SPD Multiplicity. Number of tracklets %d \n",
            fSPDMult->GetNumberOfTracklets());
   printf("Number of pileup primary vertices reconstructed with SPD %d\n", 
-        GetNumberOfPileupVerticesSPD());
+        GetNumberOfPileupVerticesSPD());
   printf("Number of pileup primary vertices reconstructed using the tracks %d\n",
-        GetNumberOfPileupVerticesTracks());
+        GetNumberOfPileupVerticesTracks());
   printf("Number of tracks: \n");
   printf("                 charged   %d\n", GetNumberOfTracks());
   printf("                 muon      %d\n", GetNumberOfMuonTracks());
@@ -505,8 +490,6 @@ void AliESDEvent::Print(Option_t *) const
   if(fEMCALCells)printf("                 EMCALCells %d\n", fEMCALCells->GetNumberOfCells());
   else printf("                 EMCALCells not in the Event\n");
   printf("                 CaloClusters %d\n", GetNumberOfCaloClusters());
-  printf("                 phos      %d\n", GetNumberOfPHOSClusters());
-  printf("                 emcal     %d\n", GetNumberOfEMCALClusters());
   printf("                 FMD       %s\n", (fESDFMD ? "yes" : "no"));
   printf("                 VZERO     %s\n", (fESDVZERO ? "yes" : "no"));
   TObject* pHLTDecision=GetHLTTriggerDecision();
@@ -1188,7 +1171,7 @@ void AliESDEvent::CreateStdContent()
   GetStdContent();
 }
 
-TObject* AliESDEvent::FindListObject(const char *name){
+TObject* AliESDEvent::FindListObject(const char *name) const {
 //
 // Find object with name "name" in the list of branches
 //
@@ -1255,8 +1238,10 @@ void AliESDEvent::WriteToTree(TTree* tree) const {
       if(!branchname.EndsWith("."))branchname += ".";
     }
     if (!tree->FindBranch(branchname)) {
-      tree->Bronch(branchname, obj->ClassName(), fESDObjects->GetObjectRef(obj),
-                  kBufsize, kSplitlevel - 1);
+      // For the custom streamer to be called splitlevel
+      // has to be negative, only needed for HLT
+      Int_t splitLevel = (TString(obj->ClassName()) == "AliHLTGlobalTriggerDecision") ? -1 : kSplitlevel - 1;
+      tree->Bronch(branchname, obj->ClassName(), fESDObjects->GetObjectRef(obj),kBufsize, splitLevel);
     }
   }
 }
@@ -1364,7 +1349,7 @@ void AliESDEvent::ReadFromTree(TTree *tree, Option_t* opt){
 
     // Connect to tree
     // prevent a memory leak when reading back the TList
-    if (!(strcmp(opt, "reconnect"))) fESDObjects->Delete();
+    // if (!(strcmp(opt, "reconnect"))) fESDObjects->Delete();
     
     if(!fUseOwnList){
       // create a new TList from the UserInfo TList... 
@@ -1618,7 +1603,7 @@ Bool_t    AliESDEvent::IsHLTTriggerFired(const char* name) const
   return kTRUE;
 }
 
-Bool_t  AliESDEvent::IsPileupFromSPD(Int_t ncont, Double_t nSigmaDeltaZ, Double_t nSigmaXY, Int_t option) const {
+Bool_t  AliESDEvent::IsPileupFromSPD(Int_t ncont, Double_t distz, Double_t nSigmaDeltaZ, Double_t nSigmaXY, Int_t option) const {
   //
   // This function checks if there was a pile up
   // reconstructed with SPD
@@ -1666,7 +1651,7 @@ Bool_t  AliESDEvent::IsPileupFromSPD(Int_t ncont, Double_t nSigmaDeltaZ, Double_
       errxDist=TMath::Sqrt(ex2*ex2+sigmax*sigmax); 
       erryDist=TMath::Sqrt(ey2*ey2+sigmay*sigmay); 
     
-      if(nc2>=ncont && distanceZ>nSigmaDeltaZ*errzDist && distanceX<nSigmaXY*errxDist && distanceY<nSigmaXY*erryDist)
+      if(nc2>=ncont && distanceZ>nSigmaDeltaZ*errzDist && distanceX<nSigmaXY*errxDist && distanceY<nSigmaXY*erryDist && distanceZ>distz)
        
        return kTRUE;
   }
@@ -1677,5 +1662,37 @@ Bool_t  AliESDEvent::IsPileupFromSPD(Int_t ncont, Double_t nSigmaDeltaZ, Double_
   }
 
 
-
-
+//______________________________________________________________________________
+void AliESDEvent::EstimateMultiplicity(Int_t &tracklets, Int_t &trITSTPC, Int_t &trITSSApure, Double_t eta, Bool_t useDCAFlag,Bool_t useV0Flag) const
+{
+  //
+  // calculates 3 estimators for the multiplicity in the -eta:eta range
+  // tracklets   : using SPD tracklets only
+  // trITSTPC    : using TPC/ITS + complementary ITS SA tracks + tracklets from clusters not used by tracks
+  // trITSSApure : using ITS standalone tracks + tracklets from clusters not used by tracks
+  // if useDCAFlag is true: account for the ESDtrack flag marking the tracks with large DCA
+  // if useV0Flag  is true: account for the ESDtrack flag marking conversion and K0's V0s
+  tracklets = trITSSApure = trITSTPC = 0;
+  int ntr = fSPDMult ? fSPDMult->GetNumberOfTracklets() : 0;
+  //
+  // count tracklets
+  for (int itr=ntr;itr--;) { 
+    if (TMath::Abs(fSPDMult->GetEta(itr))>eta) continue;
+    tracklets++;
+    if (fSPDMult->FreeClustersTracklet(itr,0)) trITSTPC++;    // not used in ITS/TPC or ITS_SA track
+    if (fSPDMult->FreeClustersTracklet(itr,1)) trITSSApure++; // not used in ITS_SA_Pure track
+  }
+  //
+  // count real tracks
+  ntr = GetNumberOfTracks();
+  for (int itr=ntr;itr--;) {
+    AliESDtrack *t = GetTrack(itr);
+    if (TMath::Abs(t->Eta())>eta) continue;
+    if (!t->IsOn(AliESDtrack::kITSin)) continue;
+    if (useDCAFlag && t->IsOn(AliESDtrack::kMultSec))  continue;
+    if (useV0Flag  && t->IsOn(AliESDtrack::kMultInV0)) continue;    
+    if (t->IsOn(AliESDtrack::kITSpureSA)) trITSSApure++;
+    else                                  trITSTPC++;
+  }
+  //
+}