]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
implementing pid hypothesis in track loop, and configuration from OCDB object (Timur)
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Feb 2011 11:21:22 +0000 (11:21 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Feb 2011 11:21:22 +0000 (11:21 +0000)
HLT/global/AliHLTPrimaryVertexFinderComponent.cxx
HLT/global/AliHLTV0FinderComponent.cxx
HLT/global/AliHLTVertexFinderBase.cxx
HLT/global/AliHLTVertexFinderBase.h

index c41e70b937c7bee786ff293cc2eec1bd0290788a..e1c0fcbc544f15806a117fd45bfda59ebd5d4a1d 100644 (file)
@@ -183,13 +183,15 @@ int AliHLTPrimaryVertexFinderComponent::DoEvent(const AliHLTComponentEventData&
   //The logic, how vertex finder reads input tracks,
   //is taken from the original global vertexer.
   //First, try to read tracks from ESD event.
-  ReadESDTracks();
+  //Both positive and negative PID are 211 ("default").
+  //Other hypotesis are not possible here.
+  ReadESDTracks(211, 211);
   //If no good esd tracks or no esd at all:
   if (!fTrackInfos.size())
-    ReadHLTTracks(kAliHLTDataTypeTrack | kAliHLTDataOriginITS);
+    ReadHLTTracks(kAliHLTDataTypeTrack | kAliHLTDataOriginITS, 211, 211);
   //If no good its tracks:
   if (!fTrackInfos.size())
-    ReadHLTTracks(kAliHLTDataTypeTrack | kAliHLTDataOriginTPC);
+    ReadHLTTracks(kAliHLTDataTypeTrack | kAliHLTDataOriginTPC, 211, 211);
 
   if (!fTrackInfos.size()) {
     HLTWarning("No input tracks found");
index 31a21b0150128d5dea262db3e57e10ad5f227ce1..c28fe4a788e89d4b96c44478c92debb3e7972250 100644 (file)
@@ -115,7 +115,7 @@ AliHLTComponent* AliHLTV0FinderComponent::Spawn()
 }
 
 //________________________________________________________________________
-int AliHLTV0FinderComponent::DoInit(int /*argc*/, const char** /*argv*/)
+int AliHLTV0FinderComponent::DoInit(int argc, const char** argv)
 {
   //1. Default parameters.
   fDaughterPrimDeviation = fgDaughterPrimDeviation;
@@ -126,9 +126,6 @@ int AliHLTV0FinderComponent::DoInit(int /*argc*/, const char** /*argv*/)
   fNegPID = 211;
   fGammaFinder = false;
 
-  //Part with OCDB and command line arguments is commented
-  //until OCDB is updated.
-/*
   //2. Parameters from OCDB.
   TString cdbPath("HLT/ConfigHLT/");
   cdbPath += GetComponentID();
@@ -141,8 +138,7 @@ int AliHLTV0FinderComponent::DoInit(int /*argc*/, const char** /*argv*/)
   if (argc)
     res = ConfigureFromArgumentString(argc, argv);
 
-  return res;*/
-  return 0;
+  return res;
 }
 
 //________________________________________________________________________
@@ -269,21 +265,21 @@ bool AliHLTV0FinderComponent::ReadTracks()
   //The logic, how vertex finder reads input tracks,
   //is taken from the original global vertexer.
   //First, try to read tracks from ESD event.
-  ReadESDTracks();
+  ReadESDTracks(fPosPID, fNegPID);
   if (fTrackInfos.size()) {
     FindPrimaryDeviations();
     return true;
   }
 
   //No good esd tracks, try:
-  ReadHLTTracks(kAliHLTDataTypeTrack | kAliHLTDataOriginITS);
+  ReadHLTTracks(kAliHLTDataTypeTrack | kAliHLTDataOriginITS, fPosPID, fNegPID);
   if (fTrackInfos.size()) {
     FindPrimaryDeviations();
     return true;
   }
 
   //If no good its tracks, try:
-  ReadHLTTracks(kAliHLTDataTypeTrack | kAliHLTDataOriginTPC);
+  ReadHLTTracks(kAliHLTDataTypeTrack | kAliHLTDataOriginTPC, fPosPID, fNegPID);
   if (fTrackInfos.size()) {
     FindPrimaryDeviations();
     return true;
index 313f30762dc67e76e4e5d2fc41850013da515dfa..7dfe7fe39645e24e7c77a0a6c58f7c6caeed48d9 100644 (file)
@@ -62,7 +62,7 @@ bool AliHLTVertexFinderBase::AliHLTTrackInfo::IsKFFinite()const
 }
 
 //_________________________________________________________________
-void AliHLTVertexFinderBase::ReadESDTracks()
+void AliHLTVertexFinderBase::ReadESDTracks(int posPID, int negPID)
 {
   //Try to read input tracks from AliESDEvent.
   //Use esd track's index as "track id" (fID).
@@ -76,37 +76,48 @@ void AliHLTVertexFinderBase::ReadESDTracks()
     if (!esd)//From original code. Not sure, if this is possible at all.
       continue;
 
-    esd->GetStdContent();
+    ReadESDTracks(esd, negPID, posPID);
+    //Only one esd event is taken.
+    break;
+  }
+}
 
-    const int nTracks = esd->GetNumberOfTracks();
-    if (nTracks)
-      fTrackInfos.reserve(nTracks + fTrackInfos.size());
+//_________________________________________________________________
+void AliHLTVertexFinderBase::ReadESDTracks(AliESDEvent* esd, int posPID, int negPID)
+{
+  //Try to read input tracks from AliESDEvent.
+  //Use esd track's index as "track id" (fID).
+  //IMPORTANT: fTrackInfos is _NOT_ cleared here,
+  //must be done externally (if you need to).
+  esd->GetStdContent();
 
-    for (int i = 0; i < nTracks; ++i) {
-      AliESDtrack* pTrack = esd->GetTrack(i);
-      //This checks of track parameters are
-      //from the original global vertexer.
-      if (!pTrack)
-        continue;
-      if (pTrack->GetKinkIndex(0) > 0)
-        continue;
-      if (!(pTrack->GetStatus() & AliESDtrack::kTPCin))
-        continue;
+  const int nTracks = esd->GetNumberOfTracks();
+  if (nTracks)
+    fTrackInfos.reserve(nTracks + fTrackInfos.size());
 
-      //i: track id, 211: pid, false: not used in primary, 0.: prim. deviation.
-      AliHLTTrackInfo newTrackInfo(i, *pTrack, 211, false, 0.);
-      if (!newTrackInfo.IsKFFinite())
-        continue;
+  for (int i = 0; i < nTracks; ++i) {
+    AliESDtrack* pTrack = esd->GetTrack(i);
+    //This checks of track parameters are
+    //from the original global vertexer.
+    if (!pTrack)
+      continue;
+    if (pTrack->GetKinkIndex(0) > 0)
+      continue;
+    if (!(pTrack->GetStatus() & AliESDtrack::kTPCin))
+      continue;
 
-      fTrackInfos.push_back(newTrackInfo);
-    }
-    //Only one esd event is taken.
-    break;
+    //i: track id, 211: pid, false: not used in primary, 0.: prim. deviation.
+    AliHLTTrackInfo newTrackInfo(i, *pTrack, pTrack->Charge() > 0 ? posPID : negPID, false, 0.);
+    if (!newTrackInfo.IsKFFinite())
+      continue;
+
+    fTrackInfos.push_back(newTrackInfo);
   }
 }
 
 //________________________________________________________________________
-void AliHLTVertexFinderBase::ReadHLTTracks(const AliHLTComponentDataType& blockType)
+void AliHLTVertexFinderBase::ReadHLTTracks(const AliHLTComponentDataType& blockType,
+                                           int posPID, int negPID)
 {
   //Read HLT tracks as input.
   //IMPORTANT: fTrackInfos is _NOT_ cleared here,
@@ -126,7 +137,8 @@ void AliHLTVertexFinderBase::ReadHLTTracks(const AliHLTComponentDataType& blockT
       //and to AliKFParitcle then, to be changed later.
       AliHLTGlobalBarrelTrack tmpTrk(*hltTrk);
 
-      AliHLTTrackInfo newTrackInfo(hltTrk->fTrackID, tmpTrk, 211, false, 0.);
+      AliHLTTrackInfo newTrackInfo(hltTrk->fTrackID, tmpTrk,
+                                   tmpTrk.Charge() > 0 ? posPID : negPID, false, 0.);
       if (!newTrackInfo.IsKFFinite())
         continue;
 
index d4fdadd883bc267980c264b575e605e88a1d959c..c43ae48dae6cee839e19af171bddab8d441e7756 100644 (file)
@@ -104,13 +104,14 @@ protected:
   //tracks are appended to the end.
   //A user (derived class)
   //has to clear it, if needed.
-  void ReadESDTracks();
+  void ReadESDTracks(int posPID, int negPID);
+  void ReadESDTracks(AliESDEvent* esd, int posPID, int negPID);
   //Read HLT tracks produced by ITS
   //or TPC (somewhere else?).
   //IMPORTANT: fTrackInfos is not
   //cleared here before filling,
   //tracks are appended to the end.
-  void ReadHLTTracks(const AliHLTComponentDataType& blockType);
+  void ReadHLTTracks(const AliHLTComponentDataType& blockType, int posPID, int negPID);
 
 public:
   //Produce output for ESD collector from primary and v0 finders' outputs.