// $Id$
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
- * Timm Steinbeck <timm@kip.uni-heidelberg.de> *
- * for The ALICE Off-line Project. *
- * *
- * 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. *
- **************************************************************************/
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project *
+//* ALICE Experiment at CERN, All rights reserved. *
+//* *
+//* Primary Authors: *
+//* for The ALICE HLT Project. *
+//* *
+//* 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 AliHLTTRDClusterizerComponent.cxx
- @author Timm Steinbeck, Matthias Richter
+ @author
@date
- @brief A TRDClusterizer processing component for the HLT. */
+ @brief A TRDClusterizer processing component for the HLT.
+*/
// see header file for class documentation //
// or //
#include <cerrno>
#include <string>
+#include "AliTRDrawStream.h"
+#include "AliTRDrawFastStream.h"
+
ClassImp(AliHLTTRDClusterizerComponent)
-AliHLTTRDClusterizerComponent::AliHLTTRDClusterizerComponent():
- AliHLTProcessor(),
+AliHLTTRDClusterizerComponent::AliHLTTRDClusterizerComponent()
+: AliHLTProcessor(),
fOutputPercentage(500),
fOutputConst(0),
fClusterizer(NULL),
fyPosMethod(1),
fgeometryFileName(""),
fProcessTracklets(kFALSE),
- fOfflineMode(kFALSE),
- fHLTstreamer(kFALSE)
+ fHLTstreamer(kTRUE)
{
// Default constructor
{
// Get the list of input data
list.clear(); // We do not have any requirements for our input data type(s).
- list.push_back( (kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTRD) );
+ list.push_back(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTRD);
}
-AliHLTComponent_DataType AliHLTTRDClusterizerComponent::GetOutputDataType()
+AliHLTComponentDataType AliHLTTRDClusterizerComponent::GetOutputDataType()
{
// Get the output data type
return kAliHLTMultipleDataType;
return -1;
}
+ if(iResult<0) return iResult;
+
fMemReader = new AliRawReaderMemory;
fClusterizer->SetReconstructor(fReconstructor);
fClusterizer->SetUseLabels(kFALSE);
if(fReconstructor->IsProcessingTracklets())
fOutputConst = fClusterizer->GetTrMemBlockSize();
- return 0;
+
+ AliTRDrawStream::SetSubtractBaseline(10);
+ AliTRDrawFastStream::SetSubtractBaseline(10);
+
+ return iResult;
}
int AliHLTTRDClusterizerComponent::DoDeinit()
block.fSize);
}
- // fMemReader->Reset();
+#ifndef NDEBUG
+ unsigned long constBase;
+ double inputMultiplier;
+ GetOutputDataSize(constBase,inputMultiplier);
+ if(size<(constBase+block.fSize*inputMultiplier)){
+ HLTWarning("Memory Block given might be too small: %i < %i; Event %Lu", size, constBase+block.fSize*inputMultiplier, evtData.fEventID);
+ }
+#endif
+
+ // fMemReader->Reset();
fMemReader->SetMemory((UChar_t*) block.fPtr, block.fSize);
AliHLTUInt32_t spec = block.fSpecification;
fMemReader->SetEquipmentID( id );
fClusterizer->SetMemBlock(outputPtr+offset);
- Bool_t iclustered = fClusterizer->Raw2ClustersChamber(fMemReader);
- if (iclustered == kTRUE)
+ Bool_t bclustered = fClusterizer->Raw2ClustersChamber(fMemReader);
+ if(bclustered)
{
- HLTDebug( "Clustered successfully");
+ HLTDebug("Clustered successfully");
}
else
{
return -1;
}
- // put the tree into output
- //fcTree->Print();
-
AliHLTUInt32_t addedSize;
if(fReconstructor->IsProcessingTracklets()){
addedSize = fClusterizer->GetAddedTrSize();
FillBlockData( bd );
bd.fOffset = offset;
bd.fSize = addedSize;
- //bd.fSpecification = spec;
- bd.fSpecification = gkAliEventTypeData;
+ bd.fSpecification = block.fSpecification;
bd.fDataType = AliHLTTRDDefinitions::fgkMCMtrackletDataType;
outputBlocks.push_back( bd );
- HLTDebug( "BD fPtr 0x%x, fOffset %i, size %i, dataType %s, spec 0x%x ", bd.fPtr, bd.fOffset, bd.fSize, DataType2Text(bd.fDataType).c_str(), spec);
+ HLTDebug( "BD ptr 0x%x, offset %i, size %i, dataType %s, spec 0x%x ", bd.fPtr, bd.fOffset, bd.fSize, DataType2Text(bd.fDataType).c_str(), spec);
}
offset = totalSize;
}
addedSize = fClusterizer->GetAddedClSize();
if (addedSize > 0){
- // Using low-level interface
- // with interface classes
+
+ Int_t* nTimeBins = (Int_t*)(outputPtr+offset+fClusterizer->GetAddedClSize());
+ *nTimeBins = fClusterizer->GetNTimeBins();
+ addedSize += sizeof(*nTimeBins);
+
totalSize += addedSize;
if ( totalSize > size )
{
totalSize, size );
return EMSGSIZE;
}
-
+
// Fill block
AliHLTComponentBlockData bd;
FillBlockData( bd );
bd.fOffset = offset;
bd.fSize = addedSize;
- //bd.fSpecification = spec;
- bd.fSpecification = gkAliEventTypeData;
+ bd.fSpecification = block.fSpecification;
bd.fDataType = AliHLTTRDDefinitions::fgkClusterDataType;
outputBlocks.push_back( bd );
- HLTDebug( "BD fPtr 0x%x, fOffset %i, size %i, dataType %s, spec 0x%x ", bd.fPtr, bd.fOffset, bd.fSize, DataType2Text(bd.fDataType).c_str(), spec);
+ HLTDebug( "BD ptr 0x%x, offset %i, size %i, dataType %s, spec 0x%x ", bd.fPtr, bd.fOffset, bd.fSize, DataType2Text(bd.fDataType).c_str(), spec);
offset = totalSize;
-
}
- else
+ else{
HLTDebug("Array of clusters is empty!");
+ }
}
fReconstructor->SetClusters(0x0);
argument=((TObjString*)pTokens->At(i))->GetString();
if (argument.IsNull()) continue;
- if (argument.CompareTo("-OFFLINE")==0) {
- fOfflineMode = kTRUE;
- HLTFatal("You have selected OFFLINE mode!");
- HLTFatal("This program shall NOT run on the HLT cluster like this!");
- continue;
- }
- else if (argument.CompareTo("output_percentage")==0) {
+ if (argument.CompareTo("output_percentage")==0) {
if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
HLTInfo("Setting output percentage to: %s", ((TObjString*)pTokens->At(i))->GetString().Data());
fOutputPercentage=((TObjString*)pTokens->At(i))->GetString().Atoi();
fgeometryFileName=((TObjString*)pTokens->At(i))->GetString();
continue;
}
- if (argument.CompareTo("-lowflux")==0) {
+ else if (argument.CompareTo("-lowflux")==0) {
fRecoParamType = 0;
HLTInfo("Low flux reconstruction selected");
continue;
}
- if (argument.CompareTo("-highflux")==0) {
+ else if (argument.CompareTo("-highflux")==0) {
fRecoParamType = 1;
HLTInfo("High flux reconstruction selected");
continue;
}
- if (argument.CompareTo("-cosmics")==0) {
+ else if (argument.CompareTo("-cosmics")==0) {
fRecoParamType = 2;
HLTInfo("Cosmics reconstruction selected");
continue;
}
- if (argument.CompareTo("-simulation")==0) {
+ else if (argument.CompareTo("-simulation")==0) {
fRecoDataType = 0;
HLTInfo("Awaiting simulated data");
continue;
}
- if (argument.CompareTo("-experiment")==0) {
+ else if (argument.CompareTo("-experiment")==0) {
fRecoDataType = 1;
HLTInfo("Awaiting real data");
continue;
}
- if (argument.CompareTo("-processTracklets")==0) {
+ else if (argument.CompareTo("-processTracklets")==0) {
fProcessTracklets = kTRUE;
- HLTInfo("Processing L1 Tracklets");
+ HLTInfo("Writing L1 tracklets to output");
continue;
}
- if (argument.CompareTo("-noZS")==0) {
+ else if (argument.CompareTo("-noZS")==0) {
fOutputPercentage = 100;
HLTInfo("Awaiting non zero surpressed data");
continue;
}
- if (argument.CompareTo("-faststreamer")==0) {
+ else if (argument.CompareTo("-faststreamer")==0) {
fHLTstreamer = kTRUE;
HLTInfo("Useing fast raw streamer");
continue;
}
+ else if (argument.CompareTo("-nofaststreamer")==0) {
+ fHLTstreamer = kFALSE;
+ HLTInfo("Don't use fast raw streamer");
+ continue;
+ }
else if (argument.CompareTo("-rawver")==0) {
if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
HLTInfo("Raw data version is: %s", ((TObjString*)pTokens->At(i))->GetString().Data());
break;
}
continue;
- }
+ }
else {
HLTError("unknown argument: %s", argument.Data());
iResult=-EINVAL;
}
if(iResult>=0){
- if(fOfflineMode)SetOfflineParams();
iResult=SetParams();
}
return iResult;
{
Int_t iResult=0;
if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
- HLTError("DefaultStorage is not Set in CDBManager");
+ HLTError("DefaultStorage is not set in CDBManager");
return -EINVAL;
}
if(AliCDBManager::Instance()->GetRun()<0){
AliGeomManager::LoadGeometry(fgeometryFileName.Data());
}
if(!AliGeomManager::GetGeometry()){
- HLTError("Cannot load geometry");
+ HLTError("Could not load geometry");
return -EINVAL;
}
}
return -EINVAL;
}
+ fRecoParam->SetStreamLevel(AliTRDrecoParam::kClusterizer, 0);
fReconstructor->SetRecoParam(fRecoParam);
- fReconstructor->SetStreamLevel(0, AliTRDReconstructor::kClusterizer);
HLTDebug("Reconstructor options are: %s",recoOptions.Data());
fReconstructor->SetOption(recoOptions.Data());
return iResult;
}
-void AliHLTTRDClusterizerComponent::SetOfflineParams(){
- HLTFatal("You have entered the OFFLINE configuration!");
- if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
- HLTFatal("You are resetting the Default Storage of the CDBManager!");
- HLTFatal("Let's hope that this program is NOT running on the HLT cluster!");
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
- }else{
- HLTError("DefaultStorage was already set!");
- }
- if(AliCDBManager::Instance()->GetRun()<0){
- HLTFatal("You are resetting the CDB run number to 0!");
- HLTFatal("Let's hope that this program is NOT running on the HLT cluster!");
- AliCDBManager::Instance()->SetRun(0);
- }else{
- HLTError("Run Number was already set!");
- }
-}
-
int AliHLTTRDClusterizerComponent::Reconfigure(const char* cdbEntry, const char* chainId)
{
// see header file for class documentation