From 2b727effca236371937d9f18d5898bba0c2a972d Mon Sep 17 00:00:00 2001 From: kkanaki Date: Wed, 22 Jul 2009 18:34:28 +0000 Subject: [PATCH] - divide charge of the FCF due to gain correction and implement correct error calculation - add warning for the galice.root file in the respective macro --- .../AliHLTTPCHWClusterTransformComponent.cxx | 41 ++++++++++++------- HLT/TPCLib/macros/transformHWCLtoSWCF.C | 29 +++++++++---- 2 files changed, 47 insertions(+), 23 deletions(-) diff --git a/HLT/TPCLib/AliHLTTPCHWClusterTransformComponent.cxx b/HLT/TPCLib/AliHLTTPCHWClusterTransformComponent.cxx index 95dae9cf6eb..fdad5f9a61d 100644 --- a/HLT/TPCLib/AliHLTTPCHWClusterTransformComponent.cxx +++ b/HLT/TPCLib/AliHLTTPCHWClusterTransformComponent.cxx @@ -34,6 +34,7 @@ using namespace std; #include "AliTPCcalibDB.h" #include "AliTPCTransform.h" +#include "TMath.h" #include #include #include @@ -242,13 +243,22 @@ int AliHLTTPCHWClusterTransformComponent::DoEvent(const AliHLTComponentEventData rowPtr+=3; // this is to run for little endian architecture, the word is read from right to left cluster.fPadRow = (UChar_t)((*rowPtr)&0x3f); - cluster.fCharge = (UInt_t)rowCharge&0xFFFFFF; //24-bit mask to get out the charge - cluster.fSigmaY2 = (Float_t)buffer[nWords+3]; + cluster.fCharge = ((UInt_t)rowCharge&0xFFFFFF)>>6; //24-bit mask to get out the charge and division with 64(>>6) for the gain correction + cluster.fSigmaY2 = (Float_t)buffer[nWords+3]; cluster.fSigmaZ2 = (Float_t)buffer[nWords+4]; - + + // correct expressions for the error calculation + + //cluster.fSigmaY2 = TMath::Sqrt( (Float_t)buffer[nWords+3] - (Float_t)buffer[nWords+1]*(Float_t)buffer[nWords+1] ); + //cluster.fSigmaY2 = TMath::Sqrt( (Float_t)buffer[nWords+3] - (Float_t)buffer[nWords+1]*(Float_t)buffer[nWords+1] ); + + + + HLTInfo("padrow: %d, charge: %f, pad: %d, time: %d", cluster.fPadRow, (Float_t)cluster.fCharge, (Float_t)buffer[nWords+1], (Float_t)buffer[nWords+2]); + Float_t xyz[3]; xyz[0] = xyz[1] = xyz[2] = -99.; - if(fOfflineTransform == NULL){ + // if(fOfflineTransform == NULL){ cluster.fPadRow += AliHLTTPCTransform::GetFirstRow(minPartition); AliHLTTPCTransform::Slice2Sector(minSlice, cluster.fPadRow, sector, thisrow); AliHLTTPCTransform::Raw2Local(xyz, sector, thisrow, (Float_t)buffer[nWords+1], (Float_t)buffer[nWords+2]); @@ -256,21 +266,24 @@ int AliHLTTPCHWClusterTransformComponent::DoEvent(const AliHLTComponentEventData cluster.fX = xyz[0]; cluster.fY = xyz[1]; cluster.fZ = xyz[2]; - - } else { - Double_t x[3] = {thisrow, (Float_t)buffer[nWords+1]+.5, (Float_t)buffer[nWords+2]}; - Int_t iSector[1]= {sector}; - fOfflineTransform->Transform(x,iSector,0,1); - cluster.fX = x[0]; - cluster.fY = x[1]; - cluster.fZ = x[2]; - } +// } else { +// +// HLTInfo("padrow: %d, pad: %d", cluster.fPadRow, buffer[nWords+1]); +// +// Double_t x[3] = {thisrow, (Float_t)buffer[nWords+1]+.5, (Float_t)buffer[nWords+2]}; +// Int_t iSector[1]= {sector}; +// fOfflineTransform->Transform(x,iSector,0,1); +// cluster.fX = x[0]; +// cluster.fY = x[1]; +// cluster.fZ = x[2]; +// +// } // cluster.fX = xyz[0]; // cluster.fY = xyz[1]; // cluster.fZ = xyz[2]; - HLTDebug("X: %f, Y: %f, Z: %f, Charge: %d", cluster.fX,cluster.fY,cluster.fZ, cluster.fCharge); + //HLTInfo("X: %f, Y: %f, Z: %f, Charge: %d", cluster.fX,cluster.fY,cluster.fZ, cluster.fCharge); spacePoints[nAddedClusters] = cluster; diff --git a/HLT/TPCLib/macros/transformHWCLtoSWCF.C b/HLT/TPCLib/macros/transformHWCLtoSWCF.C index 34e3fcb490e..b53d64ba46b 100644 --- a/HLT/TPCLib/macros/transformHWCLtoSWCF.C +++ b/HLT/TPCLib/macros/transformHWCLtoSWCF.C @@ -37,7 +37,13 @@ */ void transformHWCLtoSWCF(const char* input="./"){ - + + + if(!gSystem->AccessPathName("galice.root")){ + cerr << "Please delete file galice.root or run at a different place." << endl; + return; + } + if (!input) { cerr << "please specify input or run without arguments" << endl; return; @@ -61,14 +67,19 @@ void transformHWCLtoSWCF(const char* input="./"){ int iMinPart = 0; int iMaxPart = 0; - TString argument; - - argument.Form("-datatype 'HWCLUST1' 'TPC ' -datafile /scratch/FCF/PulserData_Limit_0xFF.fcf -dataspec 0x%02x%02x%02x%02x", iMinSlice, iMaxSlice, iMinPart, iMaxPart); - - AliHLTConfiguration pubconf("FP", "FilePublisher", NULL, argument.Data()); - - AliHLTConfiguration hwconf("FCF", "TPCHWClusterTransform", "FP", ""); + TString FCFInput; + //for(int slice=iMinSlice; slice<=iMaxSlice; slice++){ + // for(int part=iMinPart; slice<=iMaxPart; part++){ + TString argument; + argument.Form("-datatype 'HWCLUST1' 'TPC ' -datafile ~/FCF/Cluster.fcf -dataspec 0x%02x%02x%02x%02x", iMinSlice, iMaxSlice, iMinPart, iMaxPart); + AliHLTConfiguration pubconf("FP", "FilePublisher", NULL, argument.Data()); + if(FCFInput.Length()>0) FCFInput+=" "; + FCFInput+="FP"; + // } + // } + + AliHLTConfiguration hwconf("FCF", "TPCHWClusterTransform", FCFInput.Data(), ""); AliHLTConfiguration clusDumpconf("sink1", "TPCClusterDump", "FCF", "-directory ClusterDump"); @@ -85,7 +96,7 @@ void transformHWCLtoSWCF(const char* input="./"){ rec.SetLoadAlignFromCDB(0); rec.SetRunQA(":"); rec.SetFillESD(""); - rec.SetFillTriggerESD(false); + //rec.SetFillTriggerESD(false); rec.SetOption("HLT", "libAliHLTTPC.so loglevel=0x7c chains=sink1"); rec.Run(); } -- 2.43.0