From: richterm Date: Tue, 15 Feb 2011 11:21:22 +0000 (+0000) Subject: implementing pid hypothesis in track loop, and configuration from OCDB object (Timur) X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=bf0b4a592b533125d8eee5aafeaeb2f94b503501;p=u%2Fmrichter%2FAliRoot.git implementing pid hypothesis in track loop, and configuration from OCDB object (Timur) --- diff --git a/HLT/global/AliHLTPrimaryVertexFinderComponent.cxx b/HLT/global/AliHLTPrimaryVertexFinderComponent.cxx index c41e70b937c..e1c0fcbc544 100644 --- a/HLT/global/AliHLTPrimaryVertexFinderComponent.cxx +++ b/HLT/global/AliHLTPrimaryVertexFinderComponent.cxx @@ -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"); diff --git a/HLT/global/AliHLTV0FinderComponent.cxx b/HLT/global/AliHLTV0FinderComponent.cxx index 31a21b01501..c28fe4a788e 100644 --- a/HLT/global/AliHLTV0FinderComponent.cxx +++ b/HLT/global/AliHLTV0FinderComponent.cxx @@ -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; diff --git a/HLT/global/AliHLTVertexFinderBase.cxx b/HLT/global/AliHLTVertexFinderBase.cxx index 313f30762dc..7dfe7fe3964 100644 --- a/HLT/global/AliHLTVertexFinderBase.cxx +++ b/HLT/global/AliHLTVertexFinderBase.cxx @@ -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; diff --git a/HLT/global/AliHLTVertexFinderBase.h b/HLT/global/AliHLTVertexFinderBase.h index d4fdadd883b..c43ae48dae6 100644 --- a/HLT/global/AliHLTVertexFinderBase.h +++ b/HLT/global/AliHLTVertexFinderBase.h @@ -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.