//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");
}
//________________________________________________________________________
-int AliHLTV0FinderComponent::DoInit(int /*argc*/, const char** /*argv*/)
+int AliHLTV0FinderComponent::DoInit(int argc, const char** argv)
{
//1. Default parameters.
fDaughterPrimDeviation = fgDaughterPrimDeviation;
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();
if (argc)
res = ConfigureFromArgumentString(argc, argv);
- return res;*/
- return 0;
+ return res;
}
//________________________________________________________________________
//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;
}
//_________________________________________________________________
-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).
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,
//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;
//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.