From: richterm Date: Wed, 25 Jun 2008 10:56:53 +0000 (+0000) Subject: work on the TPC offline wrappers (Jacek) X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=e642ae9940d9e138cf2f5acb3bd61de586e943e9;p=u%2Fmrichter%2FAliRoot.git work on the TPC offline wrappers (Jacek) - added AliHLTTPCOfflineCalibrationComponent and corresponding macro - geometry initialization of TPCOfflineTracker - minor code cleanup - calculated output data specification from input blocks - added ESDfriend to TPCOfflineTracker output - added TPCcalib library to dependency list --- diff --git a/HLT/TPCLib/AliHLTTPCAgent.cxx b/HLT/TPCLib/AliHLTTPCAgent.cxx index bda180f6205..bb6a7e6d521 100644 --- a/HLT/TPCLib/AliHLTTPCAgent.cxx +++ b/HLT/TPCLib/AliHLTTPCAgent.cxx @@ -55,6 +55,7 @@ AliHLTTPCAgent gAliHLTTPCAgent; #include "AliHLTTPCEsdWriterComponent.h" #include "AliHLTTPCOfflineClustererComponent.h" #include "AliHLTTPCOfflineTrackerComponent.h" +#include "AliHLTTPCOfflineCalibrationComponent.h" #include "AliHLTTPCClusterHistoComponent.h" /** ROOT macro for the implementation of ROOT specific class methods */ @@ -186,6 +187,7 @@ int AliHLTTPCAgent::RegisterComponents(AliHLTComponentHandler* pHandler) const pHandler->AddComponent(new AliHLTTPCEsdWriterComponent::AliConverter); pHandler->AddComponent(new AliHLTTPCOfflineClustererComponent); pHandler->AddComponent(new AliHLTTPCOfflineTrackerComponent); + pHandler->AddComponent(new AliHLTTPCOfflineCalibrationComponent); pHandler->AddComponent(new AliHLTTPCClusterHistoComponent); return 0; diff --git a/HLT/TPCLib/AliHLTTPCDefinitions.cxx b/HLT/TPCLib/AliHLTTPCDefinitions.cxx index e84180053fd..543919f0cda 100644 --- a/HLT/TPCLib/AliHLTTPCDefinitions.cxx +++ b/HLT/TPCLib/AliHLTTPCDefinitions.cxx @@ -63,6 +63,17 @@ const AliHLTComponentDataType AliHLTTPCDefinitions::fgkCalibPulserDataType = const AliHLTComponentDataType AliHLTTPCDefinitions::fgkCalibCEDataType = (AliHLTComponentDataType){sizeof(AliHLTComponentDataType), {'C','A','L','_','C','E',' ',' '}, kAliHLTDataOriginAny} | kAliHLTDataOriginTPC; +const AliHLTComponentDataType AliHLTTPCDefinitions::fgkOfflineCalibAlignDataType = + + (AliHLTComponentDataType){sizeof(AliHLTComponentDataType), {'C','A','L','A','L','I','G','N'}, kAliHLTDataOriginAny} | kAliHLTDataOriginTPC; + +const AliHLTComponentDataType AliHLTTPCDefinitions::fgkOfflineCalibTracksDataType = + (AliHLTComponentDataType){sizeof(AliHLTComponentDataType), {'C','A','L','T','R','A','C','K'}, kAliHLTDataOriginAny} | kAliHLTDataOriginTPC; + +const AliHLTComponentDataType AliHLTTPCDefinitions::fgkOfflineCalibTracksGainDataType = + (AliHLTComponentDataType){sizeof(AliHLTComponentDataType), {'C','A','L','G','A','I','N',' '}, kAliHLTDataOriginAny} | kAliHLTDataOriginTPC; + + AliHLTTPCDefinitions::AliHLTTPCDefinitions() { // see header file for class documentation diff --git a/HLT/TPCLib/AliHLTTPCDefinitions.h b/HLT/TPCLib/AliHLTTPCDefinitions.h index a013181eb75..9b6d7df8c46 100644 --- a/HLT/TPCLib/AliHLTTPCDefinitions.h +++ b/HLT/TPCLib/AliHLTTPCDefinitions.h @@ -98,6 +98,15 @@ public: /** central electrode calibration data */ static const AliHLTComponentDataType fgkCalibCEDataType; // see above + // offline calbration components + + /** alignment calibration data */ + static const AliHLTComponentDataType fgkOfflineCalibAlignDataType; // see above + /** track calibration data */ + static const AliHLTComponentDataType fgkOfflineCalibTracksDataType; // see above + /** gain calibration data */ + static const AliHLTComponentDataType fgkOfflineCalibTracksGainDataType; // see above + ClassDef(AliHLTTPCDefinitions, 2) }; diff --git a/HLT/TPCLib/macros/cal-hlt-tpc-offline.C b/HLT/TPCLib/macros/cal-hlt-tpc-offline.C new file mode 100644 index 00000000000..d887b98debf --- /dev/null +++ b/HLT/TPCLib/macros/cal-hlt-tpc-offline.C @@ -0,0 +1,154 @@ +// $Id$ +/** + * @file cal-hlt-tpc-offline.C + * @brief Test macro for the HLT TPC offline calibration. + * + * The macro runs an HLT chain of TPC analysis, using the offline + * algorithms and appropriate wrappers. The final output is + * processed by the TPCOfflineCalibration component. + * + * Usage: + *
+ *   aliroot -b -q cal-hlt-tpc-offline.C | tee cal-hlt-tpc-offline.log
+ * 
+ * + * The chain to be run is defined by the macro given to the parameter + * 'config=' + * + * The macro asumes raw data to be available in the rawx folders, either + * simulated or real data. A different input can be specified as parameter + *
+ *   aliroot -b -q cal-hlt-tpc-offline.C'("input.root")'
+ * 
+ * + * In the first section, an analysis chain is defined. The scale of the + * chain can be defined by choosing the range of sectors and partitions. + * + * The reconstruction is steered by the AliReconstruction object in the + * usual way. + * + * @ingroup alihlt_tpc + * @author Jacek Otwinowski , Matthias.Richter@ift.uib.no + */ +void cal_hlt_tpc_offline(const char* input="./") +{ + if (!input) { + cerr << "please specify input or run without arguments" << endl; + return; + } + + /////////////////////////////////////////////////////////////////////////////////////////////////// + // + // init the HLT system in order to define the analysis chain below + // + gSystem->Load("libHLTrec.so"); + AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance(); + + //gHLT.SwitchAliLog(0); + + /////////////////////////////////////////////////////////////////////////////////////////////////// + // + // define the analysis chain to be run + // + + bool sectorClusterer=true; // run clusterer on sector or DDL level + // check if the AliRawReaderMemory supports multiple buffers + TClass* info=TClass::GetClass("AliRawReaderMemory"); + TList* methods=info->GetListOfAllPublicMethods(); + if (sectorClusterer && !methods->FindObject("AddBuffer")) { + cerr << "warning: AliRawReaderMemory does not support multiple buffers, falling back to run clusterer on DDL level" << endl; + sectorClusterer=false; + } + + int iMinSlice=0; + int iMaxSlice=17; + int iMinPart=0; + int iMaxPart=5; + + int DDLNoFromSlicePatch(int, int); + + TString writerInput; + TString trackerInput; + TString calibratorInput; + + for (int slice=iMinSlice; slice<=iMaxSlice; slice++) { + TString arg, clustererInput; + for (int part=iMinPart; part<=iMaxPart; part++) { + TString publisher, cf; + + // raw data publisher components + int ddlno=DDLNoFromSlicePatch(slice, part); + arg.Form("-minid %d -datatype 'DDL_RAW ' 'TPC ' -dataspec 0x%02x%02x%02x%02x", ddlno, slice, slice, part, part); + publisher.Form("DP_%02d_%d", slice, part); + AliHLTConfiguration pubconf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data()); + + if (!sectorClusterer) { + // cluster finder components + cf.Form("CF_%02d_%d", slice, part); + AliHLTConfiguration cfconf(cf.Data(), "TPCOfflineClusterer", publisher.Data(), ""); + + if (trackerInput.Length()>0) trackerInput+=" "; + trackerInput+=cf; + //if (writerInput.Length()>0) writerInput+=" "; + //writerInput+=cf; + } else { + if (clustererInput.Length()>0) clustererInput+=" "; + clustererInput+=publisher; + } + } + if (sectorClusterer) { + // cluster finder components + cf.Form("CF_%02d", slice); + AliHLTConfiguration cfconf(cf.Data(), "TPCOfflineClusterer", clustererInput.Data(), ""); + + if (trackerInput.Length()>0) trackerInput+=" "; + trackerInput+=cf; + } + } + + // one global tracker component + TString tracker; + tracker.Form("Global_TR"); + AliHLTConfiguration trackerconf(tracker.Data(), "TPCOfflineTracker", trackerInput.Data(), ""); + if (writerInput.Length()>0) writerInput+=" "; + calibratorInput+=tracker; + + // one global calibration component + TString calibrator; + calibrator.Form("Global_Calib"); + AliHLTConfiguration calibconf(calibrator.Data(), "TPCOfflineCalibration", calibratorInput.Data(), ""); + if (writerInput.Length()>0) writerInput+=" "; + writerInput+=calibrator; + + // the writer configuration + AliHLTConfiguration rootfwconf("sink1", "ROOTFileWriter", writerInput.Data(), "-specfmt=_%d -subdir=out_%d -idfmt=_0x%08x"); + //AliHLTConfiguration esdwconf("sink1", "EsdCollector" , writerInput.Data(), "-directory hlt-tpc-offline"); + + /////////////////////////////////////////////////////////////////////////////////////////////////// + // + // Init and run the reconstruction + // All but HLT reconstructio is switched off + // + AliReconstruction rec; + rec.SetInput(input); + rec.SetRunVertexFinder(kFALSE); + rec.SetRunLocalReconstruction("HLT"); + rec.SetRunTracking(""); + rec.SetLoadAlignFromCDB(0); + rec.SetFillESD(""); + rec.SetRunQA(kFALSE); + AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG); + AliTracker::SetFieldMap(field,kTRUE); + rec.SetFillTriggerESD(kFALSE); + rec.SetOption("HLT", "libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so loglevel=0x7c chains=sink1"); + rec.Run(); +} + +int DDLNoFromSlicePatch(int slice, int part) +{ + int ddlno=768; + if (part>1) ddlno+=72+4*slice+(part-2); + else ddlno+=2*slice+part; + + return ddlno; +} diff --git a/HLT/TPCLib/macros/rec-hlt-tpc-offline.C b/HLT/TPCLib/macros/rec-hlt-tpc-offline.C index ec2eea0b598..608a0c57328 100644 --- a/HLT/TPCLib/macros/rec-hlt-tpc-offline.C +++ b/HLT/TPCLib/macros/rec-hlt-tpc-offline.C @@ -14,8 +14,11 @@ * The chain to be run is defined by the macro given to the parameter * 'config=' * - * The makro asumes that raw data is available in the rawx folders, either - * simulated or real data. + * The macro asumes raw data to be available in the rawx folders, either + * simulated or real data. A different input can be specified as parameter + *
+ *   aliroot -b -q cal-hlt-tpc-offline.C'("input.root")'
+ * 
* * In the first section, an analysis chain is defined. The scale of the * chain can be defined by choosing the range of sectors and partitions. @@ -23,10 +26,15 @@ * The reconstruction is steered by the AliReconstruction object in the * usual way. * - * Matthias.Richter@ift.uib.no + * @ingroup alihlt_tpc + * @author Matthias.Richter@ift.uib.no */ -void rec_hlt_tpc_offline() +void rec_hlt_tpc_offline(const char* input="./") { + if (!input) { + cerr << "please specify input or run without arguments" << endl; + return; + } /////////////////////////////////////////////////////////////////////////////////////////////////// // // init the HLT system in order to define the analysis chain below @@ -110,7 +118,7 @@ void rec_hlt_tpc_offline() // All but HLT reconstructio is switched off // AliReconstruction rec; - rec.SetInput("./"); + rec.SetInput(input); rec.SetRunVertexFinder(kFALSE); rec.SetRunLocalReconstruction("HLT"); rec.SetRunTracking(""); diff --git a/HLT/TPCLib/offline/AliHLTTPCOfflineCalibrationComponent.cxx b/HLT/TPCLib/offline/AliHLTTPCOfflineCalibrationComponent.cxx new file mode 100644 index 00000000000..5bb2dbf1d04 --- /dev/null +++ b/HLT/TPCLib/offline/AliHLTTPCOfflineCalibrationComponent.cxx @@ -0,0 +1,315 @@ +// $Id$ + +//************************************************************************** +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* * +//* Primary Authors: Jacek Otwinowski * +//* * +//* Permission to use, copy, modify and distribute this software and its * +//* documentation strictly for non-commercial purposes is hereby granted * +//* without fee, provided that the above copyright notice appears in all * +//* copies and that both the copyright notice and this permission notice * +//* appear in the supporting documentation. The authors make no claims * +//* about the suitability of this software for any purpose. It is * +//* provided "as is" without express or implied warranty. * +//************************************************************************** + +/** @file AliHLTTPCOfflineCalibrationComponent.cxx + @author Jacek Otwinowski + @date + @brief TPC calibration component +*/ + +#include "AliHLTTPCOfflineCalibrationComponent.h" +#include "TString.h" +#include "TObjArray.h" +#include "TObjString.h" +#include "AliTPCcalibAlign.h" +#include "AliTPCcalibTracksGain.h" +#include "AliTPCcalibTracks.h" +#include "AliESDEvent.h" +#include "AliESDfriend.h" +#include "AliCDBManager.h" +#include "AliTPCcalibDB.h" +#include "AliTPCClusterParam.h" +#include "AliTPCcalibTracksCuts.h" +#include "AliTPCseed.h" +#include "AliTPCcalibTracksCuts.h" +#include "AliTPCClusterParam.h" +#include "AliHLTTPCDefinitions.h" + +/** ROOT macro for the implementation of ROOT specific class methods */ +ClassImp(AliHLTTPCOfflineCalibrationComponent) + +AliHLTTPCOfflineCalibrationComponent::AliHLTTPCOfflineCalibrationComponent() : AliHLTCalibrationProcessor(), +fEnableAnalysis(kTRUE), +fClustParam(0), +fTrackCuts(0), +fTPCcalibAlign(0), +fTPCcalibTracksGain(0), +fTPCcalibTracks(0) +{ + // see header file for class documentation + // or + // refer to README to build package + // or + // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt +} + +AliHLTTPCOfflineCalibrationComponent::~AliHLTTPCOfflineCalibrationComponent() +{ + // see header file for class documentation +} + +const char* AliHLTTPCOfflineCalibrationComponent::GetComponentID() +{ + // see header file for class documentation + return "TPCOfflineCalibration"; +} + +void AliHLTTPCOfflineCalibrationComponent::GetInputDataTypes( vector& list) +{ + // get input data type + list.clear(); + list.push_back(kAliHLTDataTypeESDObject|kAliHLTDataOriginTPC/*AliHLTTPCDefinitions::fgkOfflineClustersDataType*/); +} + +AliHLTComponentDataType AliHLTTPCOfflineCalibrationComponent::GetOutputDataType() +{ + // return ouput data type + return kAliHLTMultipleDataType; +} + + +int AliHLTTPCOfflineCalibrationComponent::GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList) +{ + // create output data type + tgtList.clear(); + tgtList.push_back(AliHLTTPCDefinitions::fgkOfflineCalibAlignDataType); + tgtList.push_back(AliHLTTPCDefinitions::fgkOfflineCalibTracksDataType); + tgtList.push_back(AliHLTTPCDefinitions::fgkOfflineCalibTracksGainDataType); + + return tgtList.size(); +} + +void AliHLTTPCOfflineCalibrationComponent::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier) +{ + // get output data size + constBase = 30000000; + inputMultiplier = 1; +} + +AliHLTComponent* AliHLTTPCOfflineCalibrationComponent::Spawn() +{ + // create instance of the component + return new AliHLTTPCOfflineCalibrationComponent; +} + +int AliHLTTPCOfflineCalibrationComponent::InitCalibration() +{ + // init configuration + + HLTInfo("init calibration component"); + int iResult=0; + + // + // initialisation + // + + // Init parameters and cuts + fClustParam = AliTPCcalibDB::Instance()->GetClusterParam(); + fTrackCuts = new AliTPCcalibTracksCuts(20, 0.4, 0.5, 0.13, 0.018); + + // Init calibration componenets + fTPCcalibAlign = new AliTPCcalibAlign("TPCcalibAlign","TPCcalibAlign"); + fTPCcalibTracksGain = new AliTPCcalibTracksGain("TPCcalibTracksGain","TPCcalibTracksGain",fTrackCuts); + fTPCcalibTracks = new AliTPCcalibTracks("TPCcalibTracks","TPCcalibTracks",fClustParam,fTrackCuts); + + if (!fTrackCuts || !fClustParam || !fTPCcalibAlign || !fTPCcalibTracksGain || !fTPCcalibTracks) { + HLTError("failed creating internal objects"); + iResult=-ENOMEM; + } + + return iResult; +} + +Int_t AliHLTTPCOfflineCalibrationComponent::DeinitCalibration() +{ + // deinit configuration + if(fClustParam) delete fClustParam; fClustParam = 0; + if(fTrackCuts) delete fTrackCuts; fTrackCuts = 0; + + if(fTPCcalibAlign) delete fTPCcalibAlign; fTPCcalibAlign = 0; + if(fTPCcalibTracksGain) delete fTPCcalibTracksGain; fTPCcalibTracksGain = 0; + if(fTPCcalibTracks) delete fTPCcalibTracks; fTPCcalibTracks = 0; + + return 0; +} + +Int_t AliHLTTPCOfflineCalibrationComponent::ScanArgument(Int_t argc, const char** argv) +{ + int iResult = 0; + + TString argument=""; + TString configuration=""; + int bMissingParam=0; + for (int i=0; i=0; i++) { + argument=argv[i]; + if (argument.IsNull()) continue; + + } + if (bMissingParam) { + HLTError("missing parameter for argument %s", argument.Data()); + iResult=-EINVAL; + } + + if (iResult>=0 && !configuration.IsNull()) { + iResult=Configure(configuration.Data()); + } else { + iResult=Reconfigure(NULL, NULL); + } + + return iResult; +} + +int AliHLTTPCOfflineCalibrationComponent::ProcessCalibration(const AliHLTComponentEventData& /*evtData*/, AliHLTComponentTriggerData& /*trigData*/) +{ + // calibration function + HLTInfo("ProcessCalibration processing data"); + + int iResult=0; + AliESDEvent *pESD =0; + AliESDfriend* pESDfriend=0; + int slice, patch; + + // calculate specification + const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeESDObject|kAliHLTDataOriginTPC); + if(!pBlock) { + HLTError("Cannot get first data block 0x%08x ",pBlock); + iResult=-ENOMEM; return iResult; + } + int minSlice=AliHLTTPCDefinitions::GetMinSliceNr(pBlock->fSpecification); + int maxSlice=AliHLTTPCDefinitions::GetMaxSliceNr(pBlock->fSpecification); + int minPatch=AliHLTTPCDefinitions::GetMinPatchNr(pBlock->fSpecification); + int maxPatch=AliHLTTPCDefinitions::GetMaxPatchNr(pBlock->fSpecification); + + if (fTPCcalibAlign && fTPCcalibTracksGain && fTPCcalibTracks) + { + // loop over input data blocks: ESD events + for (TObject *pObj = (TObject *)GetFirstInputObject(kAliHLTDataTypeESDObject|kAliHLTDataOriginTPC,"ESD",0); + pObj !=0 && iResult>=0; + pObj = (TObject *)GetNextInputObject(0)) { + pESD = dynamic_cast(pObj); + if (!pESD) continue; + pESD->GetStdContent(); + + //HLTInfo("load %d esd tracks from block %s 0x%08x", pESD->GetNumberOfTracks(), DataType2Text(GetDataType(pObj)).c_str(), GetSpecification(pObj)); + + slice=AliHLTTPCDefinitions::GetMinSliceNr(GetSpecification(pObj)); + patch=AliHLTTPCDefinitions::GetMinPatchNr(GetSpecification(pObj)); + + if(slice < minSlice) minSlice=slice; + if(slice > maxSlice) maxSlice=slice; + if(patch < minPatch) minPatch=patch; + if(patch > maxPatch) maxPatch=patch; + + // get ESD fiends + pESDfriend=static_cast(pESD->FindListObject("AliESDfriend")); + if (!pESDfriend) { + HLTError("Cannot load ESD friends 0x%08x", pESDfriend); + iResult=-ENOMEM; + return iResult; + } + + // get TPC seeds + Int_t n=pESD->GetNumberOfTracks(); + for (Int_t i=0;iGetTrack(i); + if(!friendTrack) continue; + + TObject *calibObject=0; + AliTPCseed *seed=0; + for (Int_t j=0;(calibObject=friendTrack->GetCalibObject(j));++j) + if ((seed=dynamic_cast(calibObject)) !=0) break; + if (seed) { + fTPCcalibAlign->Process(seed); + fTPCcalibTracksGain->Process(seed); + fTPCcalibTracks->Process(seed); + } + } + + // calculate specification from the specification of input data blocks + AliHLTUInt32_t iSpecification = AliHLTTPCDefinitions::EncodeDataSpecification(minSlice, maxSlice, minPatch, maxPatch); + + // send data + PushBack((TObject*)fTPCcalibAlign,AliHLTTPCDefinitions::fgkOfflineCalibAlignDataType,iSpecification); + PushBack((TObject*)fTPCcalibTracksGain,AliHLTTPCDefinitions::fgkOfflineCalibTracksGainDataType,iSpecification); + PushBack((TObject*)fTPCcalibTracks,AliHLTTPCDefinitions::fgkOfflineCalibTracksDataType,iSpecification); + + }// end loop over input objects + + } else { + HLTError("component not initialized"); + iResult=-ENOMEM; + } + + return iResult; +} + +Int_t AliHLTTPCOfflineCalibrationComponent::ShipDataToFXS( const AliHLTComponentEventData& /*evtData*/, + AliHLTComponentTriggerData& /*trigData*/ ) { +// see header file for class documentation + if( fEnableAnalysis ) + { + fTPCcalibAlign->Analyze(); + fTPCcalibTracksGain->Analyze(); + fTPCcalibTracks->Analyze(); + } + PushToFXS((TObject*)fTPCcalibAlign, "TPC", "TPCcalibAlign") ; + PushToFXS((TObject*)fTPCcalibTracksGain, "TPC", "TPCcalibTracksGain") ; + PushToFXS((TObject*)fTPCcalibTracks, "TPC", "TPCcalibTracks") ; + +return 0; +} + +int AliHLTTPCOfflineCalibrationComponent::Configure(const char* arguments) +{ + // see header file for class documentation + int iResult=0; + if (!arguments) return iResult; + + TString allArgs=arguments; + TString argument; + int bMissingParam=0; + + TObjArray* pTokens=allArgs.Tokenize(" "); + if (pTokens) { + for (int i=0; iGetEntries() && iResult>=0; i++) { + argument=((TObjString*)pTokens->At(i))->GetString(); + if (argument.IsNull()) continue; + + if (argument.CompareTo("-something")==0) { + if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; + + } else { + HLTError("unknown argument %s", argument.Data()); + iResult=-EINVAL; + break; + } + } + delete pTokens; + } + if (bMissingParam) { + HLTError("missing parameter for argument %s", argument.Data()); + iResult=-EINVAL; + } + return iResult; +} + +int AliHLTTPCOfflineCalibrationComponent::Reconfigure(const char* /*cdbEntry*/, const char* /*chainId*/) +{ + // see header file for class documentation + int iResult=0; + return iResult; +} diff --git a/HLT/TPCLib/offline/AliHLTTPCOfflineCalibrationComponent.h b/HLT/TPCLib/offline/AliHLTTPCOfflineCalibrationComponent.h new file mode 100644 index 00000000000..3d8079e2eec --- /dev/null +++ b/HLT/TPCLib/offline/AliHLTTPCOfflineCalibrationComponent.h @@ -0,0 +1,127 @@ +//-*- Mode: C++ -*- +// $Id$ +#ifndef ALIHLTTPCOFFLINECALIBRATIONCOMPONENT_H +#define ALIHLTTPCOFFLINECALIBRATIONCOMPONENT_H + +//* This file is property of and copyright by the ALICE HLT Project * +//* ALICE Experiment at CERN, All rights reserved. * +//* See cxx source for full Copyright notice * + +/** @file AliHLTTPCOfflineCalibrationComponent.h + @author Jacek Otwinowski + @date + @brief TPC calibration component +*/ + +#include "AliHLTCalibrationProcessor.h" + +/** + * @class AliHLTTPCOfflineCalibrationComponent + * TPC calibration component + * + * The component interfaces of the TPC offline calibration components + * to the online HLT. The component expects a full AliESD event containing the + * TPCseed track information. The outputs are calibration components. + * + *

General properties:

+ * + * Component ID: \b TPCOfflineCalibration
+ * Library: \b libAliHLTTPC.so
+ * Input Data Types: @ref kAliHLTDataTypeESDTree|kAliHLTDataOriginTPC
+ * Output Data Types: @ref AliHLTTPCDefinitions::fgkOfflineCalibAlignDataType|kAliHLTDataOriginTPC
+ * Output Data Types: @ref AliHLTTPCDefinitions::fgkOfflineCalibTracksDataType|kAliHLTDataOriginTPC
+ * Output Data Types: @ref AliHLTTPCDefinitions::fgkOfflineCalibTracksGainDataType|kAliHLTDataOriginTPC
+ * + *

Mandatory arguments:

+ * + * + *

Optional arguments:

+ * + * + *

Configuration:

+ * + * + *

Default CDB entries:

+ * - loads magnetic field value from HLT/ConfigHLT/SolenoidBz. + * + *

Performance:

+ * To be determined. + * + *

Memory consumption:

+ * To be determined. + * + *

Output size:

+ * To be determined. + * + */ + +class AliTPCClusterParam; +class AliTPCcalibTracksCuts; + +class AliTPCcalibAlign; +class AliTPCcalibTracksGain; +class AliTPCcalibTracks; + +class AliHLTTPCOfflineCalibrationComponent : public AliHLTCalibrationProcessor { +public: + AliHLTTPCOfflineCalibrationComponent(); + virtual ~AliHLTTPCOfflineCalibrationComponent(); + + // AliHLTComponent interface functions + const char* GetComponentID(); + void GetInputDataTypes(vector& list); + AliHLTComponentDataType GetOutputDataType(); + int GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList); + void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier); + + // Spawn function, return new class instance + AliHLTComponent* Spawn(); + +protected: + // AliHLTComponent interface functions + + + /** Initialize the calibration component. */ + Int_t InitCalibration(); + + /** Scan commandline arguments of the calibration component. */ + Int_t ScanArgument( Int_t argc, const char** argv ); + + /** DeInitialize the calibration component. */ + Int_t DeinitCalibration(); + + /** Process the data in the calibration component. */ + Int_t ProcessCalibration( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData ); + + /** Ship the data to the FXS at end of run or eventmodulo. */ + Int_t ShipDataToFXS( const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData ); + + using AliHLTCalibrationProcessor::ProcessCalibration; + using AliHLTCalibrationProcessor::ShipDataToFXS; + +private: + /** copy constructor prohibited */ + AliHLTTPCOfflineCalibrationComponent(const AliHLTTPCOfflineCalibrationComponent&); + /** assignment operator prohibited */ + AliHLTTPCOfflineCalibrationComponent& operator=(const AliHLTTPCOfflineCalibrationComponent&); + + Bool_t fEnableAnalysis; //! enable component analysis + + AliTPCClusterParam * fClustParam; //! TPC cluster parameters + AliTPCcalibTracksCuts* fTrackCuts; //! TPC track cuts + + AliTPCcalibAlign *fTPCcalibAlign; //! TPC geometry params + AliTPCcalibTracksGain *fTPCcalibTracksGain; //! TPC tracker + AliTPCcalibTracks *fTPCcalibTracks; //! AliESDEvent needed by TPC tracker + + /** + * Configure the component. + * Parse a string for the configuration arguments and set the component + * properties. + */ + int Configure(const char* arguments); + int Reconfigure(const char* /*cdbEntry*/, const char* /*chainId*/); + + ClassDef(AliHLTTPCOfflineCalibrationComponent, 0) +}; +#endif diff --git a/HLT/TPCLib/offline/AliHLTTPCOfflineClustererComponent.cxx b/HLT/TPCLib/offline/AliHLTTPCOfflineClustererComponent.cxx index 1dc3a65e8c2..0d82eccdf72 100644 --- a/HLT/TPCLib/offline/AliHLTTPCOfflineClustererComponent.cxx +++ b/HLT/TPCLib/offline/AliHLTTPCOfflineClustererComponent.cxx @@ -49,8 +49,7 @@ fGeometryFileName(""), fTPCRecoParam(0), fTPCGeomParam(0), fRawReader(0), -fClusterer(0), -fMagField(0) +fClusterer(0) { // Default constructor fGeometryFileName = getenv("ALICE_ROOT"); @@ -146,7 +145,6 @@ int AliHLTTPCOfflineClustererComponent::DoInit( int argc, const char** argv ) // initialisation // - /* // Load geometry HLTInfo("Geometry file %s",fGeometryFileName.c_str()); @@ -156,12 +154,6 @@ int AliHLTTPCOfflineClustererComponent::DoInit( int argc, const char** argv ) iResult=-EINVAL; } - // Magnetic field - fMagField = new AliMagFMaps("Maps","Maps", 2, 1.0, 10., 2); - AliTracker::SetFieldMap(fMagField,kFALSE); - - */ - // Raw Reader fRawReader = new AliRawReaderMemory; @@ -194,7 +186,6 @@ int AliHLTTPCOfflineClustererComponent::DoDeinit() if (fTPCGeomParam) delete fTPCGeomParam; fTPCGeomParam=0; if (fRawReader) delete fRawReader; fRawReader=0; if (fClusterer) delete fClusterer; fClusterer=0; - if (fMagField) delete fMagField; fMagField=0; return 0; } diff --git a/HLT/TPCLib/offline/AliHLTTPCOfflineClustererComponent.h b/HLT/TPCLib/offline/AliHLTTPCOfflineClustererComponent.h index 89af4be1b84..1a646c83df5 100644 --- a/HLT/TPCLib/offline/AliHLTTPCOfflineClustererComponent.h +++ b/HLT/TPCLib/offline/AliHLTTPCOfflineClustererComponent.h @@ -18,7 +18,6 @@ class AliTPCRecoParam; class AliTPCParam; class AliTPCclustererMI; class AliRawReaderMemory; -class AliMagFMaps; /** * @class AliHLTTPCOfflineClustererComponent @@ -108,7 +107,6 @@ private: AliRawReaderMemory *fRawReader; //! Memory reader AliTPCclustererMI *fClusterer; //! TPC clusterer - AliMagFMaps *fMagField; //! Magnetic field map ClassDef(AliHLTTPCOfflineClustererComponent, 1) }; diff --git a/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerComponent.cxx b/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerComponent.cxx index 3b796ac68fb..414fb33e24f 100644 --- a/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerComponent.cxx +++ b/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerComponent.cxx @@ -25,29 +25,32 @@ #include "TString.h" #include "TObjArray.h" #include "TObjString.h" +#include "AliVParticle.h" +#include "AliCDBManager.h" +#include "AliCDBEntry.h" +#include "AliGeomManager.h" +#include "AliMagFMaps.h" #include "AliTPCParam.h" #include "AliTPCParamSR.h" #include "AliTPCtrackerMI.h" #include "AliTPCClustersRow.h" #include "AliESDEvent.h" +#include "AliESDfriend.h" #include "AliHLTTPCDefinitions.h" -#include "AliTracker.h" -#include "AliMagFMaps.h" /** ROOT macro for the implementation of ROOT specific class methods */ ClassImp(AliHLTTPCOfflineTrackerComponent) AliHLTTPCOfflineTrackerComponent::AliHLTTPCOfflineTrackerComponent() : AliHLTProcessor(), -fOutputPercentage(100), +fGeometryFileName(""), fTPCGeomParam(0), fTracker(0), -fESD(0) +fESD(0), +fESDfriend(0) { - // see header file for class documentation - // or - // refer to README to build package - // or - // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt + // Default constructor + fGeometryFileName = getenv("ALICE_ROOT"); + fGeometryFileName += "/HLT/TPCLib/offline/geometry.root"; } AliHLTTPCOfflineTrackerComponent::~AliHLTTPCOfflineTrackerComponent() @@ -77,7 +80,7 @@ void AliHLTTPCOfflineTrackerComponent::GetOutputDataSize(unsigned long& constBas { // get output data size constBase = 2000000; - inputMultiplier = ((double)fOutputPercentage)/100.0; + inputMultiplier = 1; } AliHLTComponent* AliHLTTPCOfflineTrackerComponent::Spawn() @@ -99,11 +102,26 @@ int AliHLTTPCOfflineTrackerComponent::DoInit( int argc, const char** argv ) TString argument=""; TString configuration=""; int bMissingParam=0; + + // loop over input parameters for (int i=0; i=0; i++) { argument=argv[i]; if (argument.IsNull()) continue; - } + if (argument.CompareTo("-geometry")==0) { + if ((bMissingParam=(++i>=argc))) break; + + HLTInfo("got \'-geometry\' argument: %s", argv[i]); + fGeometryFileName = argv[i]; + HLTInfo("Geometry file is: %s", fGeometryFileName.c_str()); + + // the remaining arguments are treated as configuration + } else { + if (!configuration.IsNull()) configuration+=" "; + configuration+=argument; + } + } // end loop + if (bMissingParam) { HLTError("missing parameter for argument %s", argument.Data()); iResult=-EINVAL; @@ -115,13 +133,25 @@ int AliHLTTPCOfflineTrackerComponent::DoInit( int argc, const char** argv ) iResult=Reconfigure(NULL, NULL); } + // + // initialisation + // + + // Load geometry + HLTInfo("Geometry file %s",fGeometryFileName.c_str()); + AliGeomManager::LoadGeometry(fGeometryFileName.c_str()); + if((AliGeomManager::GetGeometry()) == 0) { + HLTError("Cannot load geometry from file %s",fGeometryFileName.c_str()); + iResult=-EINVAL; + } + // TPC geometry parameters fTPCGeomParam = new AliTPCParamSR; if (fTPCGeomParam) { fTPCGeomParam->ReadGeoMatrices(); } - // Init clusterer + // Init tracker fTracker = new AliTPCtrackerMI(fTPCGeomParam); // AliESDEvent event needed by AliTPCtrackerMI @@ -129,18 +159,10 @@ int AliHLTTPCOfflineTrackerComponent::DoInit( int argc, const char** argv ) fESD = new AliESDEvent(); if (fESD) { fESD->CreateStdContent(); - } - // TODO: set the magnetic field correctly - // the tracker needs the field map correctly initialized in AliTracker. - // init from HLT/ConfigHLT/SolenoidBz or other appropriate CDB entry. - // temporarily set to 5kG - if (!AliTracker::GetFieldMap()) { - // this instance must never be deleted, the AliRoot framework and the design - // of AliTracker just does not support this. That's why we do not keep the - // pointer. The memory leak is relativly small. - AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., AliMagFMaps::k5kG); - AliTracker::SetFieldMap(field,kTRUE); + // add ESD friend + fESDfriend = new AliESDfriend(); + if(fESDfriend) fESD->AddObject(fESDfriend); } if (!fTracker || !fESD || !fTPCGeomParam) { @@ -148,6 +170,11 @@ int AliHLTTPCOfflineTrackerComponent::DoInit( int argc, const char** argv ) iResult=-ENOMEM; } + if (iResult>=0) { + // read the default CDB entries + iResult=Reconfigure(NULL, NULL); + } + return iResult; } @@ -158,6 +185,7 @@ int AliHLTTPCOfflineTrackerComponent::DoDeinit() if(fTPCGeomParam) delete fTPCGeomParam; fTPCGeomParam = 0; if(fTracker) delete fTracker; fTracker = 0; if(fESD) delete fESD; fESD = 0; + //Note: fESD is owner of fESDfriends return 0; } @@ -167,27 +195,36 @@ int AliHLTTPCOfflineTrackerComponent::DoEvent( const AliHLTComponentEventData& / // tracker function HLTInfo("DoEvent processing data"); -// Logging(kHLTLogDebug, "AliHLTTPCOfflineTrackerComponent::DoEvent", "Trigger data received", -// "Struct size %d Data size %d Data location 0x%x", trigData.fStructSize, trigData.fDataSize, (UInt_t*)trigData.fData); - - TObjArray *clusterArray = 0; - int iResult=0; + TObjArray *clusterArray=0; + int slice, patch; + + const AliHLTComponentBlockData* pBlock=GetFirstInputBlock(kAliHLTDataTypeTObjArray|kAliHLTDataOriginTPC); + if(!pBlock) { + HLTError("Cannot get first data block 0x%08x ",pBlock); + iResult=-ENOMEM; return iResult; + } + int minSlice=AliHLTTPCDefinitions::GetMinSliceNr(pBlock->fSpecification); + int maxSlice=AliHLTTPCDefinitions::GetMaxSliceNr(pBlock->fSpecification); + int minPatch=AliHLTTPCDefinitions::GetMinPatchNr(pBlock->fSpecification); + int maxPatch=AliHLTTPCDefinitions::GetMaxPatchNr(pBlock->fSpecification); if (fTracker && fESD) { - // loop over input data blocks: TObjArrays of clusters - for (TObject *pObj = (TObject *)GetFirstInputObject(kAliHLTDataTypeTObjArray|kAliHLTDataOriginTPC/*AliHLTTPCDefinitions::fgkOfflineClustersDataType*/,"TObjArray",0); + // loop over input data blocks: TObjArrays of clusters + for (TObject *pObj = (TObject *)GetFirstInputObject(kAliHLTDataTypeTObjArray|kAliHLTDataOriginTPC/*AliHLTTPCDefinitions::fgkOfflineClustersDataType*/,"TObjArray",0); pObj !=0 && iResult>=0; pObj = (TObject *)GetNextInputObject(0)) { clusterArray = dynamic_cast(pObj); if (!clusterArray) continue; -// int lower=clusterArray->LowerBound(); -// int entries=clusterArray->GetEntries(); -// if (entries<=lower) continue; -// if (clusterArray->At(lower)==NULL) continue; -// if (dynamic_cast(clusterArray->At(lower))==NULL) continue; HLTInfo("load %d cluster rows from block %s 0x%08x", clusterArray->GetEntries(), DataType2Text(GetDataType(pObj)).c_str(), GetSpecification(pObj)); + slice=AliHLTTPCDefinitions::GetMinSliceNr(GetSpecification(pObj)); + patch=AliHLTTPCDefinitions::GetMinPatchNr(GetSpecification(pObj)); + + if(slice < minSlice) minSlice=slice; + if(slice > maxSlice) maxSlice=slice; + if(patch < minPatch) minPatch=patch; + if(patch > maxPatch) maxPatch=patch; #ifndef HAVE_NOT_TPCOFFLINE_REC fTracker->LoadClusters(clusterArray); #endif //HAVE_NOT_TPCOFFLINE_REC @@ -204,23 +241,16 @@ int AliHLTTPCOfflineTrackerComponent::DoEvent( const AliHLTComponentEventData& / Int_t nTracks = fESD->GetNumberOfTracks(); HLTInfo("Number of tracks %d", nTracks); - // TODO: calculate specification from the specification of input data blocks - PushBack(fESD, kAliHLTDataTypeESDObject|kAliHLTDataOriginTPC, 0); - - // Alternatively: Push back tracks -// for (Int_t it = 0; it < nTracks; it++) { -// AliESDtrack* track = fESD->GetTrack(it); -// PushBack(track, AliHLTTPCDefinitions::fgkOfflineTrackSegmentsDataType, 0); -// } + // calculate specification from the specification of input data blocks + AliHLTUInt32_t iSpecification = AliHLTTPCDefinitions::EncodeDataSpecification( minSlice, maxSlice, minPatch, maxPatch ); + HLTInfo("minSlice %d, maxSlice %d, minPatch %d, maxPatch %d", minSlice, maxSlice, minPatch, maxPatch); - // is this necessary? If yes, we have to keep all the created TObjArrays - // from the loop above - // clear clusters - //clusterArray->Clear(); - //clusterArray->Delete(); + // send data + PushBack(fESD, kAliHLTDataTypeESDObject|kAliHLTDataOriginTPC, iSpecification); // reset ESDs fESD->Reset(); + } else { HLTError("component not initialized"); iResult=-ENOMEM; @@ -245,9 +275,35 @@ int AliHLTTPCOfflineTrackerComponent::Configure(const char* arguments) argument=((TObjString*)pTokens->At(i))->GetString(); if (argument.IsNull()) continue; - if (argument.CompareTo("-something")==0) { + if (argument.CompareTo("-solenoidBz")==0) { if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; - + // TODO: check if there is common functionality in the AliMagF* classes + float SolenoidBz=((TObjString*)pTokens->At(i))->GetString().Atof(); + if (SolenoidBz=3. && SolenoidBz<4.5) { + map=AliMagFMaps::k4kG; + factor=SolenoidBz/4; + } else { + map=AliMagFMaps::k5kG; + factor=SolenoidBz/5; + } + // the magnetic field map is not supposed to change + // field initialization should be done once in the beginning + // TODO: does the factor need adjustment? + const AliMagF* currentMap=AliTracker::GetFieldMap(); + if (!currentMap) { + AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., map); + AliTracker::SetFieldMap(field,kTRUE); + HLTInfo("Solenoid Field set to: %f map %d", SolenoidBz, map); + } else if (currentMap->Map()!=map) { + HLTWarning("omitting request to override field map %s with %s", currentMap->Map(), map); + } + continue; } else { HLTError("unknown argument %s", argument.Data()); iResult=-EINVAL; @@ -263,9 +319,31 @@ int AliHLTTPCOfflineTrackerComponent::Configure(const char* arguments) return iResult; } -int AliHLTTPCOfflineTrackerComponent::Reconfigure(const char* /*cdbEntry*/, const char* /*chainId*/) +int AliHLTTPCOfflineTrackerComponent::Reconfigure(const char* cdbEntry, const char* chainId) { // see header file for class documentation int iResult=0; + const char* path=kAliHLTCDBSolenoidBz; + const char* defaultNotify=""; + if (cdbEntry) { + path=cdbEntry; + defaultNotify=" (default)"; + } + if (path) { + HLTDebug("reconfigure from entry %s%s, chain id %s", path, defaultNotify,(chainId!=NULL && chainId[0]!=0)?chainId:""); + AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path/*,GetRunNo()*/); + if (pEntry) { + TObjString* pString=dynamic_cast(pEntry->GetObject()); + if (pString) { + HLTDebug("received configuration object string: \'%s\'", pString->GetString().Data()); + iResult=Configure(pString->GetString().Data()); + } else { + HLTError("configuration object \"%s\" has wrong type, required TObjString", path); + } + } else { + HLTError("can not fetch object \"%s\" from CDB", path); + } + } + return iResult; } diff --git a/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerComponent.h b/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerComponent.h index 2252a6a2d90..ffcc5ff169a 100644 --- a/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerComponent.h +++ b/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerComponent.h @@ -57,6 +57,7 @@ class AliTPCParam; class AliTPCtrackerMI; class AliESDEvent; +class AliESDfriend; class AliHLTTPCOfflineTrackerComponent : public AliHLTProcessor { public: @@ -87,10 +88,12 @@ private: /** assignment operator prohibited */ AliHLTTPCOfflineTrackerComponent& operator=(const AliHLTTPCOfflineTrackerComponent&); - Double_t fOutputPercentage; // percentage of output data - AliTPCParam *fTPCGeomParam; // TPC geometry params - AliTPCtrackerMI *fTracker; // TPC tracker - AliESDEvent *fESD; // AliESDEvent needed by TPC tracker + string fGeometryFileName; //! Geometry file with full path + AliTPCParam *fTPCGeomParam; //! TPC geometry params + + AliTPCtrackerMI *fTracker; //! TPC tracker + AliESDEvent *fESD; //! AliESDEvent needed by TPC tracker + AliESDfriend *fESDfriend; //! AliESDEvent needed by TPC calibration component /** * Configure the component. @@ -99,6 +102,6 @@ private: */ int Configure(const char* arguments); - ClassDef(AliHLTTPCOfflineTrackerComponent, 0) + ClassDef(AliHLTTPCOfflineTrackerComponent, 1) }; #endif diff --git a/HLT/configure.ac b/HLT/configure.ac index 45c57f927ca..5a81a451311 100644 --- a/HLT/configure.ac +++ b/HLT/configure.ac @@ -282,77 +282,6 @@ if test ! "x$have_aliroot" = "xno" ; then dnl dnl required header files and libraries for modules dnl - if test ! "x$have_aliroot" = "xno" ; then - # the HLTTPCLib needs to link agains TPCbase and TPCrec - # TPC library for AliTPCParam and AliSimDigits used in - # AliHLTTPCFileHandler.h and AliHLTTPCDisplay.cxx - # from May 07 TPCbase depends on libGui.so - CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/TPC" - have_alitpc=yes - AC_MSG_CHECKING(for required classes in TPC libraries) - if test ! "x$have_alitpc" = "xno" ; then - ALITPC_LIBS="-lGui -lTPCbase -lTPCrec" - LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALITPC_LIBS" - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include - #include - #include - #include - #include - #include - #include ], - [AliSimDigits dig; - AliTPCParam param; - AliTPCParamSR paramsr; - AliTPCDigitsArray digarray; - AliTPCClustersArray clustarray; - AliTPCcluster clust; - AliTPCClustersRow row])], - [AC_DEFINE(HAVE_ALITPC)], - [have_alitpc=no - ALITPC_LIBS= ]) - fi - AC_MSG_RESULT([$have_alitpc]) - - dnl - dnl Check for functionality in the TPC reconstruction required for online - dnl processing - dnl - have_tpc_hltoffline_rec=no - AC_MSG_CHECKING(for on-line features of TPC offline reconstruction) - ALITPC_LIBS="-lGui -lTPCbase -lTPCrec" - LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALITPC_LIBS" - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include - #include - #include ], - [AliTPCtrackerMI tracker; - TObjArray* array=NULL; - tracker.LoadClusters(array); - AliTPCclustererMI cl(NULL, NULL); - cl.GetOutputArray();])], - [have_tpc_hltoffline_rec=yes], - [AC_DEFINE(HAVE_NOT_TPCOFFLINE_REC)]) - AC_MSG_RESULT([$have_tpc_hltoffline_rec]) - - fi - AC_CHECK_HEADER([AliTPCCalibPulser.h], [], [AC_DEFINE(HAVE_NOT_ALITPCCALIBPULSER)]) - AC_CHECK_HEADER([AliTPCCalibPedestal.h], [], [AC_DEFINE(HAVE_NOT_ALITPCCALIBPEDESTAL)]) - - have_tpc_mapping=no - if test ! "x$have_aliroot" = "xno" ; then - # the TPCLib/AliHLTTPCRawReader needs the actual Pad layout of the TPC - # which is stored in the TPC/mapping/Patchx.data files from - # AliRoot version v4-04-Release (May 2006) - AH_TEMPLATE([HAVE_TPC_MAPPING],[TPC pad mapping available]) - TPC_PAD_MAPPING_PATH=$have_aliroot/TPC/mapping - AC_CHECK_FILE( [$TPC_PAD_MAPPING_PATH/Patch0.data], - [have_tpc_mapping=yes - AC_SUBST(TPC_PAD_MAPPING_PATH) - AC_DEFINE(HAVE_TPC_MAPPING)], - []) - - fi - AC_MSG_CHECKING([for TPC mapping layout]) - AC_MSG_RESULT([$have_tpc_mapping]) dnl dnl Check for the interface of AliExternalTrackParam which has been changed @@ -566,19 +495,17 @@ AC_MSG_RESULT([$enable_util]) dnl ------------------------------------------------------------------ AH_TEMPLATE([HLT_TPC],[hlt tpc library]) +ALITPC_LIBS= CHECK_HLTMODULE([tpc], [AliTPCRawStream.h], [$ALIROOT_CPPFLAGS -I$ALICE_ROOT/TPC], - [], [-L$ROOTLIBDIR], [$ROOTLIBS $ADD_ROOTLIBS], - [], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], + [Gui ANALYSIS], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS], + [TPCbase TPCrec TPCcalib], [-L$ROOTLIBDIR $ALIROOT_LDFLAGS], [$ROOTLIBS $ADD_ROOTLIBS $ALIROOT_LIBS]) if test "x$enable_module" = "xmissheader"; then enable_module="no...missing.headers" enable_tpc="no...missing.headers" -elif test "x$have_alitpc" = "xno" ; then - enable_module="no...requires.AliRoot.TPC.libraries" - enable_tpc="no...requires.AliRoot.TPC.libraries" elif test "x$enable_module" = "xforce"; then enable_tpc="yes" else @@ -586,7 +513,52 @@ else fi if test "x$enable_tpc" = "xyes" ; then + AC_LANG_PUSH(C++) AC_DEFINE(HLT_TPC) + echo $ALIHLTMODULE_LIBS + ALITPC_LIBS=$ALIHLTMODULE_LIBS + dnl + dnl Check for functionality in the TPC reconstruction required for online + dnl processing + dnl + have_tpc_hltoffline_rec=no + AC_MSG_CHECKING(for on-line features of TPC offline reconstruction) + CPPFLAGS="$save_CPPFLAGS $ALIROOT_CPPFLAGS -I${ALICE_ROOT}/TPC" + LDFLAGS="$save_LDFLAGS -L${ROOTLIBDIR} $ALIROOT_LDFLAGS" + LIBS="$save_LIBS $ROOTLIBS $ALIROOT_LIBS $ALITPC_LIBS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include + #include + #include ], + [AliTPCtrackerMI tracker; + TObjArray* array=NULL; + tracker.LoadClusters(array); + AliTPCclustererMI cl(NULL, NULL); + cl.GetOutputArray();])], + [have_tpc_hltoffline_rec=yes], + [AC_DEFINE(HAVE_NOT_TPCOFFLINE_REC)]) + AC_MSG_RESULT([$have_tpc_hltoffline_rec]) + + AC_CHECK_HEADER([AliTPCCalibPulser.h], [], [AC_DEFINE(HAVE_NOT_ALITPCCALIBPULSER)]) + AC_CHECK_HEADER([AliTPCCalibPedestal.h], [], [AC_DEFINE(HAVE_NOT_ALITPCCALIBPEDESTAL)]) + + have_tpc_mapping=no + if test ! "x$have_aliroot" = "xno" ; then + # the TPCLib/AliHLTTPCRawReader needs the actual Pad layout of the TPC + # which is stored in the TPC/mapping/Patchx.data files from + # AliRoot version v4-04-Release (May 2006) + AH_TEMPLATE([HAVE_TPC_MAPPING],[TPC pad mapping available]) + TPC_PAD_MAPPING_PATH=$have_aliroot/TPC/mapping + AC_CHECK_FILE( [$TPC_PAD_MAPPING_PATH/Patch0.data], + [have_tpc_mapping=yes + AC_SUBST(TPC_PAD_MAPPING_PATH) + AC_DEFINE(HAVE_TPC_MAPPING)], + []) + + fi + AC_MSG_CHECKING([for TPC mapping layout]) + AC_MSG_RESULT([$have_tpc_mapping]) + AC_LANG_POP(C++) + else enable_module=$enable_tpc fi @@ -608,9 +580,6 @@ CHECK_HLTMODULE([rcu], if test "x$enable_module" = "xmissheader"; then enable_module="no...missing.headers" enable_rcu="no...missing.headers" -elif test "x$have_alircu" = "xno" ; then - enable_module="no...requires.AliRoot.RAW.libraries" - enable_rcu="no...requires.AliRoot.RAW.libraries" elif test "x$enable_module" = "xforce"; then enable_rcu="yes" else diff --git a/HLT/libAliHLTTPC.pkg b/HLT/libAliHLTTPC.pkg index 60a5dce9735..c92dfec1e14 100644 --- a/HLT/libAliHLTTPC.pkg +++ b/HLT/libAliHLTTPC.pkg @@ -25,6 +25,7 @@ CLASS_HDRS:= AliHLTTPCTransform.h \ offline/AliHLTTPCDigitPublisherComponent.h \ offline/AliHLTTPCOfflineClustererComponent.h \ offline/AliHLTTPCOfflineTrackerComponent.h \ + offline/AliHLTTPCOfflineCalibrationComponent.h \ offline/AliHLTTPCOfflineCluster.h \ AliHLTTPCClusters.h \ AliHLTTPCConfMapFit.h \