//**************************************************************************
/** @file AliHLTTRDClusterizerComponent.cxx
- @author
+ @author Theodor Rascanu
@date
@brief A TRDClusterizer processing component for the HLT.
*/
// or //
// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt //
-#if __GNUC__ >= 3
-using namespace std;
-#endif
-
#include "TTree.h"
#include "TFile.h"
#include "TBranch.h"
#include "AliHLTTRDClusterizerComponent.h"
#include "AliHLTTRDDefinitions.h"
-#include "AliHLTTRDCluster.h"
+#include "AliHLTTRDClusterizer.h"
+#include "AliHLTTRDUtils.h"
#include "AliGeomManager.h"
#include "AliTRDReconstructor.h"
#include "AliCDBManager.h"
#include "AliCDBStorage.h"
#include "AliCDBEntry.h"
-#include "AliHLTTRDClusterizer.h"
#include "AliTRDrecoParam.h"
-#include "AliTRDrawStreamBase.h"
+#include "AliTRDrawStream.h"
#include "AliTRDcluster.h"
#include "AliRawReaderMemory.h"
#ifdef HAVE_VALGRIND_CALLGRIND_H
#include <valgrind/callgrind.h>
#else
-#define CALLGRIND_START_INSTRUMENTATION do { } while (0)
-#define CALLGRIND_STOP_INSTRUMENTATION do { } while (0)
+#define CALLGRIND_START_INSTRUMENTATION (void)0
+#define CALLGRIND_STOP_INSTRUMENTATION (void)0
#endif
#include <cstdlib>
#include <cerrno>
#include <string>
-#include "AliTRDrawStream.h"
-#include "AliTRDrawFastStream.h"
+using namespace std;
ClassImp(AliHLTTRDClusterizerComponent)
AliHLTTRDClusterizerComponent::AliHLTTRDClusterizerComponent()
: AliHLTProcessor(),
- fOutputPercentage(500),
+ fOutputPercentage(100),
fOutputConst(0),
fClusterizer(NULL),
fRecoParam(NULL),
fyPosMethod(1),
fgeometryFileName(""),
fProcessTracklets(kFALSE),
- fHLTstreamer(kTRUE)
+ fHLTstreamer(kTRUE),
+ fTC(kFALSE),
+ fHLTflag(kTRUE),
+ fHighLevelOutput(kFALSE),
+ fEmulateHLTClusters(kFALSE)
{
// Default constructor
{
// Get the output data size
constBase = fOutputConst;
- inputMultiplier = ((double)fOutputPercentage)/100.0;
+ inputMultiplier = ((double)fOutputPercentage)*4/100.0;
}
AliHLTComponent* AliHLTTRDClusterizerComponent::Spawn()
delete fClusterizer;
fClusterizer = 0;
- fReconstructor->SetClusters(0x0);
+ //fReconstructor->SetClusters(0x0);
delete fReconstructor;
fReconstructor = 0x0;
- return 0;
if (fRecoParam)
{
delete fRecoParam;
fRecoParam = 0;
}
+
+ return 0;
}
int AliHLTTRDClusterizerComponent::DoEvent( const AliHLTComponentEventData& evtData,
{
// Process an event
- if (evtData.fEventID == 1)
+#ifdef HAVE_VALGRIND_CALLGRIND_H
+ if (evtData.fEventID == 10)
CALLGRIND_START_INSTRUMENTATION;
+ if(GetFirstInputBlock(kAliHLTDataTypeEOR))
+ CALLGRIND_STOP_INSTRUMENTATION;
+#endif
+
+ if(!IsDataEvent())return 0;
+
HLTDebug( "NofBlocks %i", evtData.fBlockCnt );
// Process an event
AliHLTUInt32_t totalSize = 0, offset = 0;
AliHLTUInt32_t spec = block.fSpecification;
- Int_t id = 1024;
-
- for ( Int_t ii = 0; ii < 18 ; ii++ ) {
- if ( spec & 0x1 ) {
- id += ii;
- break;
- }
- spec = spec >> 1 ;
- }
+ Int_t id = AliHLTTRDUtils::GetSM(spec) + 1024;
- fMemReader->SetEquipmentID( id );
+ fMemReader->SetEquipmentID(id);
fClusterizer->SetMemBlock(outputPtr+offset);
Bool_t bclustered = fClusterizer->Raw2ClustersChamber(fMemReader);
HLTDebug("Array of clusters is empty!");
}
}
- fReconstructor->SetClusters(0x0);
+ //fReconstructor->SetClusters(0x0);
size = totalSize;
HLTDebug("Event is done. size written to the output is %i", size);
return 0;
}
-void AliHLTTRDClusterizerComponent::PrintObject( TClonesArray* inClustersArray)
+void AliHLTTRDClusterizerComponent::PrintObject(
+#ifdef __DEBUG
+ TClonesArray* inClustersArray
+#else
+ TClonesArray*
+#endif
+ )
{
+#ifdef __DEBUG
AliTRDcluster* cluster=0x0;
for (Int_t i=0; i < inClustersArray->GetEntriesFast(); i++){
HLTDebug(" Detector = %i, Amplitude = %f, Center = %f", cluster->GetDetector(), cluster->GetQ(), cluster->GetCenter());
HLTDebug(" LocalTimeBin = %i; NPads = %i; maskedPosition: %s, status: %s", cluster->GetLocalTimeBin(), cluster->GetNPads(),cluster->GetPadMaskedPosition(),cluster->GetPadMaskedPosition());
}
-
+#endif
}
int AliHLTTRDClusterizerComponent::Configure(const char* arguments){
continue;
}
else if (argument.CompareTo("-noZS")==0) {
- fOutputPercentage = 100;
+ fOutputPercentage = 10;
HLTInfo("Awaiting non zero surpressed data");
continue;
}
+ else if (argument.CompareTo("-HLTflag")==0) {
+ if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
+ TString toCompareTo=((TObjString*)pTokens->At(i))->GetString();
+ if (toCompareTo.CompareTo("yes")==0){
+ HLTInfo("Setting HLTflag to: %s", toCompareTo.Data());
+ fHLTflag=kTRUE;
+ }
+ else if (toCompareTo.CompareTo("no")==0){
+ HLTInfo("Setting HLTflag to: %s", toCompareTo.Data());
+ fHLTflag=kFALSE;
+ }
+ else {
+ HLTError("unknown argument for HLTflag: %s", toCompareTo.Data());
+ iResult=-EINVAL;
+ break;
+ }
+ continue;
+ }
else if (argument.CompareTo("-faststreamer")==0) {
fHLTstreamer = kTRUE;
HLTInfo("Useing fast raw streamer");
HLTInfo("Don't use fast raw streamer");
continue;
}
+ else if (argument.CompareTo("-tailcancellation")==0) {
+ fTC = kTRUE;
+ HLTInfo("Useing tailcancellation");
+ 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());
fRawDataVersion=((TObjString*)pTokens->At(i))->GetString().Atoi();
continue;
}
+ else if (argument.CompareTo("-highLevelOutput")==0) {
+ if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
+ TString toCompareTo=((TObjString*)pTokens->At(i))->GetString();
+ if (toCompareTo.CompareTo("yes")==0){
+ HLTWarning("Setting highLevelOutput to: %s", toCompareTo.Data());
+ fHighLevelOutput=kTRUE;
+ }
+ else if (toCompareTo.CompareTo("no")==0){
+ HLTInfo("Setting highLevelOutput to: %s", toCompareTo.Data());
+ fHighLevelOutput=kFALSE;
+ }
+ else {
+ HLTError("unknown argument for highLevelOutput: %s", toCompareTo.Data());
+ iResult=-EINVAL;
+ break;
+ }
+ continue;
+ }
+ else if (argument.CompareTo("-emulateHLToutput")==0) {
+ if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
+ TString toCompareTo=((TObjString*)pTokens->At(i))->GetString();
+ if (toCompareTo.CompareTo("yes")==0){
+ HLTWarning("Setting emulateHLToutput to: %s", toCompareTo.Data());
+ fEmulateHLTClusters=kTRUE;
+ }
+ else if (toCompareTo.CompareTo("no")==0){
+ HLTInfo("Setting emulateHLToutput to: %s", toCompareTo.Data());
+ fEmulateHLTClusters=kFALSE;
+ }
+ else {
+ HLTError("unknown argument for emulateHLToutput: %s", toCompareTo.Data());
+ iResult=-EINVAL;
+ break;
+ }
+ continue;
+ }
else if (argument.CompareTo("-yPosMethod")==0) {
if ((bMissingParam=(++i>=pTokens->GetEntries()))) break;
TString toCompareTo=((TObjString*)pTokens->At(i))->GetString();
HLTError("Could not load geometry");
return -EINVAL;
}
+ HLTInfo("Applying Alignment from CDB object");
+ AliGeomManager::ApplyAlignObjsFromCDB("TRD");
}
else{
HLTInfo("Geometry Already Loaded!");
}
- if (fRecoParamType == 0)
- {
- HLTDebug("Low flux params init.");
- fRecoParam = AliTRDrecoParam::GetLowFluxParam();
+ if(fReconstructor->GetRecoParam()){
+ fRecoParam = new AliTRDrecoParam(*fReconstructor->GetRecoParam());
+ HLTInfo("RecoParam already set!");
+ }else{
+ if(fRecoParamType == 0){
+#ifndef HAVE_NOT_ALITRD_RECOPARAM_r41621
+ if(fHLTflag){
+ HLTInfo("Low flux HLT params init.");
+ fRecoParam = AliTRDrecoParam::GetLowFluxHLTParam();
+ }else
+#endif
+ {
+ HLTInfo("Low flux params init.");
+ fRecoParam = AliTRDrecoParam::GetLowFluxParam();
+ }
}
-
- if (fRecoParamType == 1)
- {
- HLTDebug("High flux params init.");
- fRecoParam = AliTRDrecoParam::GetHighFluxParam();
+ if(fRecoParamType == 1){
+#ifndef HAVE_NOT_ALITRD_RECOPARAM_r41621
+ if(fHLTflag){
+ HLTInfo("High flux HLT params init.");
+ fRecoParam = AliTRDrecoParam::GetHighFluxHLTParam();
+ }else
+#endif
+ {
+ HLTInfo("High flux params init.");
+ fRecoParam = AliTRDrecoParam::GetHighFluxParam();
+ }
}
-
- if (fRecoParamType == 2)
- {
- HLTDebug("Cosmic Test params init.");
+ if(fRecoParamType == 2){
+ HLTInfo("Cosmic Test params init.");
fRecoParam = AliTRDrecoParam::GetCosmicTestParam();
}
+ }
- if (fRecoParam == 0)
+ if (!fRecoParam)
{
HLTError("No reco params initialized. Sniffing big trouble!");
return -EINVAL;
}
- // backward compatibility to AliTRDrecoParam < r34995
-# ifndef HAVE_NOT_ALITRDRECOPARAM_r34995
-# define AliTRDRecoParamSetTailCancelation(b) fRecoParam->SetTailCancelation(b)
-# define AliTRDRecoParamSetGAUS(b) fRecoParam->SetGAUS(b)
-# define AliTRDRecoParamSetLUT(b) fRecoParam->SetLUT(b)
-# else
-# define AliTRDRecoParamSetTailCancelation(b) fRecoParam->SetTailCancelation()
-# define AliTRDRecoParamSetGAUS(b) fRecoParam->SetGAUS()
-# define AliTRDRecoParamSetLUT(b) fRecoParam->SetLUT()
-# endif
-
- switch(fRecoDataType){
- case 0: AliTRDRecoParamSetTailCancelation(kTRUE); HLTDebug("Enableing Tail Cancelation"); break;
- case 1: AliTRDRecoParamSetTailCancelation(kFALSE); HLTDebug("Enableing Tail Cancelation"); break;
- }
+ if(fTC){fRecoParam->SetTailCancelation(kTRUE); HLTDebug("Enableing Tail Cancelation"); }
+ else{fRecoParam->SetTailCancelation(kFALSE); HLTDebug("Disableing Tail Cancelation"); }
+
switch(fyPosMethod){
- case 0: AliTRDRecoParamSetGAUS(kFALSE); AliTRDRecoParamSetLUT(kFALSE); break;
- case 1: AliTRDRecoParamSetGAUS(kFALSE); AliTRDRecoParamSetLUT(kTRUE); break;
- case 2: AliTRDRecoParamSetGAUS(kTRUE); AliTRDRecoParamSetLUT(kFALSE); break;
+ case 0: fRecoParam->SetGAUS(kFALSE); fRecoParam->SetLUT(kFALSE); break;
+ case 1: fRecoParam->SetGAUS(kFALSE); fRecoParam->SetLUT(kTRUE); break;
+ case 2: fRecoParam->SetGAUS(kTRUE); fRecoParam->SetLUT(kFALSE); break;
}
fRecoParam->SetStreamLevel(AliTRDrecoParam::kClusterizer, 0);
fReconstructor->SetRecoParam(fRecoParam);
- TString recoOptions="hlt,!cw";
+ if(!fClusterizer){
+ fClusterizer = new AliHLTTRDClusterizer("TRDCclusterizer", "TRDCclusterizer");
+ HLTDebug("TRDClusterizer at 0x%x", fClusterizer);
+ }
+
+ TString recoOptions="!cw";
+ if(fHLTflag){
+ recoOptions += ",hlt";
+
+ // we transfer clusters that do no contain the XYZ coodrinates (AliHLTTRDCluster),
+ // thus this coordinate transformation ist useless
+#ifndef HAVE_NOT_ALITRD_CLUSTERIZER_r42837
+ fClusterizer->SetSkipTransform();
+#endif
+ }
if(fProcessTracklets) recoOptions += ",tp";
else recoOptions += ",!tp";
if (fRecoDataType == 0)
{
- AliTRDrawStreamBase::SetRawStreamVersion(AliTRDrawStreamBase::kTRDsimStream);
HLTDebug("Data type expected is SIMULATION!");
}
if (fRecoDataType == 1)
{
- AliTRDrawStreamBase::SetRawStreamVersion(AliTRDrawStreamBase::kTRDrealStream);
HLTDebug("Data type expected is EXPERIMENT!");
}
- if (fHLTstreamer)
- {
- AliTRDrawStreamBase::SetRawStreamVersion("FAST");
- HLTDebug("fast rawstreamer used");
- }
-
- if(!fClusterizer){
- fClusterizer = new AliHLTTRDClusterizer("TRDCclusterizer", "TRDCclusterizer");
- HLTDebug("TRDClusterizer at 0x%x", fClusterizer);
- }
-
fClusterizer->SetRawVersion(fRawDataVersion);
return iResult;
return iResult;
}
+
+void AliHLTTRDClusterizerComponent::GetOCDBObjectDescription(TMap* const targetMap){
+ // Get a list of OCDB object description needed for the particular component
+ if (!targetMap) return;
+ targetMap->Add(new TObjString("HLT/ConfigTRD/ClusterizerComponent"), new TObjString("component arguments"));
+ targetMap->Add(new TObjString("TRD/Calib/ChamberGainFactor"), new TObjString("gain factor of chambers"));
+ targetMap->Add(new TObjString("TRD/Calib/ChamberT0"), new TObjString("T0 of chambers"));
+ targetMap->Add(new TObjString("TRD/Calib/ChamberVdrift"), new TObjString("drift velocity of chambers"));
+ targetMap->Add(new TObjString("TRD/Calib/DetNoise"), new TObjString("noise of chambers"));
+ targetMap->Add(new TObjString("TRD/Calib/LocalGainFactor"), new TObjString("per pad gain factor"));
+ targetMap->Add(new TObjString("TRD/Calib/LocalT0"), new TObjString("per pad T0"));
+ targetMap->Add(new TObjString("TRD/Calib/LocalVdrift"), new TObjString("per pad drift velocity"));
+ targetMap->Add(new TObjString("TRD/Calib/PadNoise"), new TObjString("per pad noise"));
+ targetMap->Add(new TObjString("TRD/Calib/PadStatus"), new TObjString("pad status"));
+ targetMap->Add(new TObjString("TRD/Calib/PRFWidth"), new TObjString("pad response function"));
+}