From c1cd4fce8031d5ee983cf80ef8fb304b297fe4ce Mon Sep 17 00:00:00 2001 From: shahoian Date: Mon, 22 Sep 2014 17:57:50 +0200 Subject: [PATCH] integration of ITS SAP tracker to HLT chain --- HLT/BASE/AliHLTDataTypes.cxx | 3 + HLT/BASE/AliHLTDataTypes.h | 5 ++ HLT/CMakelibAliHLTITS.pkg | 2 +- HLT/ITS/AliHLTITSAgent.cxx | 11 +++ HLT/ITS/AliHLTITSVertexerSPDComponent.cxx | 6 +- HLT/ITS/AliHLTSAPTrackerData.h | 35 ++++++++ .../AliHLTITSSAPTrackerComponent.cxx | 82 ++++++++++++------- HLT/ITS/trackingSAP/README | 5 ++ HLT/ITS/trackingSAP/TestHLTITSSAP.C | 44 ++++++++++ 9 files changed, 159 insertions(+), 34 deletions(-) create mode 100644 HLT/ITS/AliHLTSAPTrackerData.h create mode 100644 HLT/ITS/trackingSAP/TestHLTITSSAP.C diff --git a/HLT/BASE/AliHLTDataTypes.cxx b/HLT/BASE/AliHLTDataTypes.cxx index 79e7906fe3b..fdd92071f8f 100644 --- a/HLT/BASE/AliHLTDataTypes.cxx +++ b/HLT/BASE/AliHLTDataTypes.cxx @@ -229,6 +229,9 @@ const AliHLTComponentDataType kAliHLTDataTypeJet = AliHLTComponentDataTypeInitia /** Container of HLT ITS tracks */ const AliHLTComponentDataType fgkITSTracksDataType = AliHLTComponentDataTypeInitializer( "ITSTRACK", kAliHLTDataOriginITS ); +/** Container of HLT ITS SAP tracker data */ +const AliHLTComponentDataType kAliHLTDataTypeITSSAPData = AliHLTComponentDataTypeInitializer( "SAPTRACK", kAliHLTDataOriginITS ); + /** Container of HLT calorimeter clusters */ const AliHLTComponentDataType kAliHLTDataTypeCaloCluster = AliHLTComponentDataTypeInitializer( "CALOCLUS", kAliHLTDataOriginAny ); diff --git a/HLT/BASE/AliHLTDataTypes.h b/HLT/BASE/AliHLTDataTypes.h index e7a70fb318e..69f8820715d 100644 --- a/HLT/BASE/AliHLTDataTypes.h +++ b/HLT/BASE/AliHLTDataTypes.h @@ -1294,6 +1294,11 @@ extern "C" { */ extern const AliHLTComponentDataType fgkITSTracksDataType; + /** Container of ITS SAP tracker data + * @ingroup alihlt_component_datatypes + */ + extern const AliHLTComponentDataType kAliHLTDataTypeITSSAPData; + /** Container of calorimeter clusters * @ingroup alihlt_component_datatypes */ diff --git a/HLT/CMakelibAliHLTITS.pkg b/HLT/CMakelibAliHLTITS.pkg index 47f42f57c64..a8febf33500 100644 --- a/HLT/CMakelibAliHLTITS.pkg +++ b/HLT/CMakelibAliHLTITS.pkg @@ -59,7 +59,7 @@ set ( MODULE_HDRS ${CLASS_HDRS} AliHLTITSSpacePointData.h AliHLTITSClusterData set ( MODULE_DHDR ) -set ( EINCLUDE HLT/BASE HLT/BASE/util HLT/ITS HLT/TPCLib HLT/ITS/tracking HLT/ITS/clusterfinders ITS RAW STEER/STEER STEER/ESD STEER/STEERBase) +set ( EINCLUDE HLT/BASE HLT/BASE/util HLT/ITS HLT/TPCLib HLT/ITS/tracking HLT/ITS/trackingSAP HLT/ITS/clusterfinders ITS RAW STEER/STEER STEER/ESD STEER/STEERBase) set ( ELIBS "HLTbase AliHLTUtil RAWDatarec RAWDatabase ITSrec ITSbase ESD STEER STEERBase -lEG") diff --git a/HLT/ITS/AliHLTITSAgent.cxx b/HLT/ITS/AliHLTITSAgent.cxx index edf67d31513..ff648d169bb 100644 --- a/HLT/ITS/AliHLTITSAgent.cxx +++ b/HLT/ITS/AliHLTITSAgent.cxx @@ -34,6 +34,7 @@ #include "AliHLTITSClusterFinderComponent.h" #include "AliHLTITSClusterHistoComponent.h" #include "AliHLTITSTrackerComponent.h" +#include "AliHLTITSSAPTrackerComponent.h" #include "AliHLTITSVertexerSPDComponent.h" #include "AliHLTITSDigitPublisherComponent.h" @@ -78,6 +79,7 @@ int AliHLTITSAgent::CreateConfigurations(AliHLTConfigurationHandler* handler, // to run on digits, a digit publisher needs to be implemented TString trackerInput=""; + TString trackerSAPInput=""; TString vertexerSPDInput=""; if (rawReader || !runloader) { // AliSimulation: use the AliRawReaderPublisher if the raw reader is available @@ -113,6 +115,7 @@ int AliHLTITSAgent::CreateConfigurations(AliHLTConfigurationHandler* handler, // define the ITS tracker input // trackerInput="ITS-SPD-CF ITS-SDD-CF ITS-SSD-CF"; + trackerSAPInput="ITS-SPD-CF ITS-SDD-CF ITS-SSD-CF"; } else if (runloader && !rawReader) { // indicates AliSimulation with no RawReader available -> run on digits @@ -140,6 +143,8 @@ int AliHLTITSAgent::CreateConfigurations(AliHLTConfigurationHandler* handler, // Currently there is a seg fault in the TTree access from the DigitClusterFinder // needs first to be investigated trackerInput="DigitClusterFinder"; + trackerSAPInput="DigitClusterFinder"; + vertexerSPDInput="DigitClusterFinder"; } /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -165,6 +170,11 @@ int AliHLTITSAgent::CreateConfigurations(AliHLTConfigurationHandler* handler, } handler->CreateConfiguration("ITS-tracker","ITSTracker",trackerInput.Data(),""); } + + if( !trackerSAPInput.IsNull() ) trackerSAPInput+=" "; + trackerSAPInput+="ITS-SPD-vertexer"; + + handler->CreateConfiguration("ITS-SAPtracker","ITSSAPTracker",trackerSAPInput.Data(),""); return iResult; } @@ -206,6 +216,7 @@ int AliHLTITSAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const pHandler->AddComponent(new AliHLTITSClusterFinderComponent(AliHLTITSClusterFinderComponent::kClusterFinderDigits)); pHandler->AddComponent(new AliHLTITSClusterHistoComponent); pHandler->AddComponent(new AliHLTITSTrackerComponent); + pHandler->AddComponent(new AliHLTITSSAPTrackerComponent); pHandler->AddComponent(new AliHLTITSVertexerSPDComponent); pHandler->AddComponent(new AliHLTITSDigitPublisherComponent); diff --git a/HLT/ITS/AliHLTITSVertexerSPDComponent.cxx b/HLT/ITS/AliHLTITSVertexerSPDComponent.cxx index 9f3a52a83b5..3cac629c5ee 100644 --- a/HLT/ITS/AliHLTITSVertexerSPDComponent.cxx +++ b/HLT/ITS/AliHLTITSVertexerSPDComponent.cxx @@ -135,6 +135,7 @@ void AliHLTITSVertexerSPDComponent::GetInputDataTypes( vectorfDataType == (kAliHLTDataTypeClusters|kAliHLTDataOriginITSSPD) ){ + if ( ( iter->fDataType == (kAliHLTDataTypeClusters|kAliHLTDataOriginITSSPD) ) || + ( iter->fDataType == (kAliHLTDataTypeClusters|kAliHLTDataOriginITS) ) ) { AliHLTITSClusterData *inPtr=reinterpret_cast( iter->fPtr ); int nClusters = inPtr->fSpacePointCnt; @@ -664,7 +666,7 @@ int AliHLTITSVertexerSPDComponent::DoEvent double s = 400.E-4; double cov[6] = {s*s,0,s*s,0,0,s*s}; AliESDVertex v(pos, cov, 0, fSumN[bestBin]); - PushBack( (TObject*) &v, kAliHLTDataTypeESDVertex|kAliHLTDataOriginITS,0 ); + PushBack( (TObject*) &v, kAliHLTDataTypeESDVertex|kAliHLTDataOriginITSSPD,0 ); //cout<<"ITSVertexerSPD: vtx found "< using namespace std; @@ -100,7 +101,7 @@ AliHLTITSSAPTrackerComponent::~AliHLTITSSAPTrackerComponent() const char* AliHLTITSSAPTrackerComponent::GetComponentID() { // see header file for class documentation - return "ITSTracker"; + return "ITSSAPTracker"; } void AliHLTITSSAPTrackerComponent::GetInputDataTypes( vector& list ) @@ -323,13 +324,13 @@ int AliHLTITSSAPTrackerComponent::DoEvent const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& /*trigData*/, - AliHLTUInt8_t* /*outputPtr*/, + AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, - vector& /*outputBlocks*/ ) + vector& outputBlocks ) { //* process event - // AliHLTUInt32_t maxBufferSize = size; + AliHLTUInt32_t maxBufferSize = size; size = 0; // output size if (!IsDataEvent()) return 0; @@ -351,7 +352,7 @@ int AliHLTITSSAPTrackerComponent::DoEvent const AliESDVertex *vertexSPD = 0; { - const TObject *iter = GetFirstInputObject(kAliHLTDataTypeESDVertex|kAliHLTDataOriginITS); + const TObject *iter = GetFirstInputObject(kAliHLTDataTypeESDVertex|kAliHLTDataOriginITSSPD); if( iter != NULL ) { if( !( vertexSPD = dynamic_cast(const_cast( iter ) ) ) ){ HLTError("ITS SPD vertex object is corrupted"); @@ -407,36 +408,55 @@ int AliHLTITSSAPTrackerComponent::DoEvent // Fill output tracks - - // RS??: HERE I AM NOT SURE WHAT TO DO - int nFoundTracks = fTracker->GetNTracks(); int nAddedTracks = 0; - for (int itr=0;itrGetTrack(itr); - // the track is just a struct of 2 AliExternalTrackParams (params at vertex and at the outer ITS layer) - // + some extra info, see "struct ITStrack" in the AliITSSAPTracker.h - if ( track.paramOut.TestBit(AliITSSAPTracker::kInvalidBit) || - track.paramInw.TestBit(AliITSSAPTracker::kInvalidBit)) continue; - // use only those tracks whose both inward and outward params are OK. - - nAddedTracks++; - // RS??: - - // I don't know if it should be passes as it is or converted to ESDtrack? + { + int nFoundTracks = fTracker->GetNTracks(); + AliHLTUInt32_t blockSize = sizeof(AliHLTITSSAPTrackerDataContainer) + nFoundTracks*sizeof(AliHLTITSSAPTrackerData); + if( size + blockSize > maxBufferSize ){ + HLTWarning( "Output buffer size exceed (buffer size %d, current size %d), %d tracks are not stored", + maxBufferSize, size + blockSize, nFoundTracks); + iResult = -ENOSPC; + } + if( iResult>=0 ){ + blockSize = sizeof(AliHLTITSSAPTrackerDataContainer); + AliHLTITSSAPTrackerDataContainer *data = reinterpret_cast(outputPtr); + data->fCount=0; + for (int itr=0;itrGetTrack(itr); + // the track is just a struct of 2 AliExternalTrackParams (params at vertex and at the outer ITS layer) + // + some extra info, see "struct ITStrack" in the AliITSSAPTracker.h + if ( track.paramOut.TestBit(AliITSSAPTracker::kInvalidBit) || + track.paramInw.TestBit(AliITSSAPTracker::kInvalidBit)) continue; + // use only those tracks whose both inward and outward params are OK. + AliHLTITSSAPTrackerData &trcHLT = data->fTracks[data->fCount]; + trcHLT.paramOut.SetExternalTrackParam(&track.paramOut); + trcHLT.paramInw.SetExternalTrackParam(&track.paramInw); + trcHLT.chi2 = track.chi2; + trcHLT.ncl = track.ncl; + trcHLT.label = track.label; + data->fCount++; + blockSize += sizeof(AliHLTITSSAPTrackerData); + nAddedTracks++; + } + + AliHLTComponentBlockData resultData; + FillBlockData( resultData ); + resultData.fOffset = size; + resultData.fSize = blockSize; + resultData.fDataType = kAliHLTDataTypeITSSAPData|kAliHLTDataOriginITS; + fBenchmark.AddOutput(resultData.fSize); + outputBlocks.push_back( resultData ); + size += resultData.fSize; + } } - // Fill output vertexTracks - - // RS: HERE I AM NOT SURE WHAT TO DO - Bool_t vtxOK = kFALSE; - AliESDVertex& vtxTracks = fTracker->GetTrackVertex(); - if (vtxTracks.GetStatus()==1) { - // here we should add the vertex to the output - - // RS??: ADD TO THE OUTPUT - PushBack( (TObject*) &vtxTracks, kAliHLTDataTypeESDVertex|kAliHLTDataOriginOut,0 ); - vtxOK = kTRUE; + { // Fill output vertexTracks + AliESDVertex& vtxTracks = fTracker->GetTrackVertex(); + if (vtxTracks.GetStatus()==1) { + PushBack( (TObject*) &vtxTracks, kAliHLTDataTypeESDVertex|kAliHLTDataOriginITS,0 ); + vtxOK = kTRUE; + } } // fTracker->Clear(); diff --git a/HLT/ITS/trackingSAP/README b/HLT/ITS/trackingSAP/README index 7373a5f3d03..35235d65345 100644 --- a/HLT/ITS/trackingSAP/README +++ b/HLT/ITS/trackingSAP/README @@ -3,3 +3,8 @@ macro as aliroot 'TestITSSAP.C()' where the is the directory cotaining the output of the standard reconstruction, including the ITS.RecPoints.root file + + +To test tracker in the HLT simulation, generate some MC (e.g. ppbench), +copy the macro TestHLTITSSAP.C to the generation directory and run +aliroot TestHLTITSSAP.C diff --git a/HLT/ITS/trackingSAP/TestHLTITSSAP.C b/HLT/ITS/trackingSAP/TestHLTITSSAP.C new file mode 100644 index 00000000000..e8070c97e17 --- /dev/null +++ b/HLT/ITS/trackingSAP/TestHLTITSSAP.C @@ -0,0 +1,44 @@ +void TestHLTITSSAP() { + + gSystem->Load("liblhapdf"); + gSystem->Load("libEGPythia6"); + gSystem->Load("libpythia6"); + gSystem->Load("libAliPythia6"); + gSystem->Load("libhijing"); + gSystem->Load("libTHijing"); + gSystem->Load("libgeant321"); + + if (gSystem->Getenv("EVENT")) + nev = atoi(gSystem->Getenv("EVENT")) ; + + AliSimulation simulator; + simulator.SetRunGeneration(0); + simulator.SetRunSimulation(0); + simulator.SetMakeDigits(""); + simulator.SetMakeSDigits(""); + simulator.SetMakeDigitsFromHits(""); + //simulator.SetWriteRawData("ALL","raw.root",kTRUE); + + simulator.SetDefaultStorage("local://$ALICE_ROOT/OCDB"); + simulator.SetSpecificStorage("GRP/GRP/Data", + Form("local://%s",gSystem->pwd())); + simulator.SetSpecificStorage("ITS/Align/Data", + "alien://folder=/alice/simulation/2008/v4-15-Release/Ideal"); + + simulator.SetRunQA(":") ; + + AliHLTConfigurationHandler::CreateHandler(); + AliHLTConfigurationHandler *handler = AliHLTConfigurationHandler::Instance(); + + handler->CreateConfiguration("ITS-SAPtracker1","ITSSAPTracker","DigitClusterFinder ITS-SPD-vertexer", + ""); + + + simulator.SetRunHLT("chains=ITS-SAPtracker1"); + + TStopwatch timer; + timer.Start(); + simulator.Run(); + timer.Stop(); + timer.Print(); +} -- 2.43.0