From: aszostak Date: Thu, 10 Jun 2010 09:28:36 +0000 (+0000) Subject: Bug fix for full tracker, filling in track parameters properly. X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;ds=sidebyside;h=fa41da55e4c547afe71bf1cec641b6a1021265c8;p=u%2Fmrichter%2FAliRoot.git Bug fix for full tracker, filling in track parameters properly. Also adding option to write ESDs in Rootifier component. (Indra) --- diff --git a/HLT/MUON/OfflineInterface/AliHLTMUONRootifierComponent.cxx b/HLT/MUON/OfflineInterface/AliHLTMUONRootifierComponent.cxx index 31a17d5ea4d..7155bcfde27 100644 --- a/HLT/MUON/OfflineInterface/AliHLTMUONRootifierComponent.cxx +++ b/HLT/MUON/OfflineInterface/AliHLTMUONRootifierComponent.cxx @@ -24,6 +24,9 @@ /// /// Implements a component to convert dHLT raw data into TObjects. +#include "AliHLTMessage.h" +#include "TString.h" +#include "AliESDEvent.h" #include "AliHLTMUONRootifierComponent.h" #include "AliHLTMUONEvent.h" #include "AliHLTMUONConstants.h" @@ -207,7 +210,20 @@ int AliHLTMUONRootifierComponent::DoEvent( i, DataType2Text(block->fDataType).c_str(), block->fPtr, block->fSize ); - if (block->fDataType == AliHLTMUONConstants::RecHitsBlockDataType()) + if (block->fDataType == AliHLTMUONConstants::ESDDataType()) + { + AliHLTMessage *fMessage = new AliHLTMessage( block->fPtr, block->fSize ); + // -- Check if TMessage payload is TObject + if ( fMessage->What() == kMESS_OBJECT ) + { + TString fClassName = fMessage->GetClass()->GetName(); + AliESDEvent* esd = reinterpret_cast(fMessage->ReadObject( fMessage->GetClass() )); + esd->GetStdContent(); + event.Add(esd); + } + fMessage->Reset(); + } + else if (block->fDataType == AliHLTMUONConstants::RecHitsBlockDataType()) { specification |= block->fSpecification; AliHLTMUONRecHitsBlockReader inblock(block->fPtr, block->fSize); diff --git a/HLT/MUON/OnlineAnalysis/AliHLTMUONFullTracker.cxx b/HLT/MUON/OnlineAnalysis/AliHLTMUONFullTracker.cxx index 2db9fc38982..2c333d432c7 100644 --- a/HLT/MUON/OnlineAnalysis/AliHLTMUONFullTracker.cxx +++ b/HLT/MUON/OnlineAnalysis/AliHLTMUONFullTracker.cxx @@ -716,7 +716,7 @@ Bool_t AliHLTMUONFullTracker::FillOutData(AliHLTMUONTrackStruct *track, AliHLTUI || not TMath::Finite(fHalfTrack[ibackTrackSeg].fPz)) continue; #ifdef PRINT_OUTPUT - HLTImportant("\nsize : %d, itrack : %04d, sign : %2d, Pt : %8.3f, (Px,Py,Pz) : (%8.3f,%8.3f,%8.3f)\n", + HLTImportant("\nhalftrack : size : %d, itrack : %04d, sign : %2d, Pt : %8.3f, (Px,Py,Pz) : (%8.3f,%8.3f,%8.3f)\n", size,ibackTrackSeg,Int_t(TMath::Sign(1.,fTrackParam[ibackTrackSeg].GetInverseBendingMomentum())), TMath::Sqrt(fHalfTrack[ibackTrackSeg].fPx*fHalfTrack[ibackTrackSeg].fPx + fHalfTrack[ibackTrackSeg].fPy*fHalfTrack[ibackTrackSeg].fPy), @@ -733,27 +733,47 @@ Bool_t AliHLTMUONFullTracker::FillOutData(AliHLTMUONTrackStruct *track, AliHLTUI track->fPz = fHalfTrack[ibackTrackSeg].fPz; track->fChi2 = 0; + + track->fThetaY = TMath::ATan2(track->fPy, track->fPz); + track->fThetaX = TMath::ATan2(track->fPx, track->fPz); - + track->fZ = 0.0; + track->fY = 0.0; + track->fX = 0.0; for( Int_t ipoint=15;ipoint>=0;ipoint--){ track->fHit[ipoint] = AliHLTMUONConstants::NilRecHitStruct(); hitset[ipoint] = false; + } + + for( Int_t ipoint=9;ipoint>=6;ipoint--){ - if(ipoint<=9 and ipoint>=6 and fBackTrackSeg[ibackTrackSeg].fIndex[ipoint-6]!=-1 ){ + if(fBackTrackSeg[ibackTrackSeg].fIndex[ipoint-6]!=-1 ){ track->fHit[ipoint] = *(fChPoint[ipoint][fBackTrackSeg[ibackTrackSeg].fIndex[ipoint-6]]); hitset[ipoint] = true; #ifdef PRINT_OUTPUT AliHLTUInt8_t chamber; AliHLTUInt16_t detElemID; AliHLTMUONUtils::UnpackRecHitFlags((track->fHit[ipoint]).fFlags,chamber,detElemID); - HLTImportant("(X,Y,Z) : (%lf,%lf,%lf)",(track->fHit[ipoint]).fX,(track->fHit[ipoint]).fY,(track->fHit[ipoint]).fZ); + HLTImportant("halftrack : (X,Y,Z) : (%lf,%lf,%lf)",(track->fHit[ipoint]).fX,(track->fHit[ipoint]).fY,(track->fHit[ipoint]).fZ); #endif } } AliHLTMUONParticleSign sign = AliHLTMUONParticleSign(fHalfTrack[ibackTrackSeg].fCharge); - track->fFlags = AliHLTMUONUtils::PackMansoTrackFlags(sign,hitset); - + track->fFlags = AliHLTMUONUtils::PackTrackFlags(sign,hitset); + TVector3 mom(track->fPx, track->fPy, track->fPz); + double signVal = 0; + switch (sign) + { + case kSignMinus: signVal = +1.; break; + case kSignUnknown: signVal = 0.; break; + case kSignPlus: signVal = -1.; break; + } + if (mom.Mag() != 0) + track->fInverseBendingMomentum = signVal/mom.Mag(); + else + track->fInverseBendingMomentum = 0 ; + track++; fNofTracks++; diff --git a/HLT/MUON/macros/RunChain.C b/HLT/MUON/macros/RunChain.C index b96ca6b9fa7..52407cb7f39 100644 --- a/HLT/MUON/macros/RunChain.C +++ b/HLT/MUON/macros/RunChain.C @@ -183,6 +183,7 @@ void RunChain( bool useRootWriter = false; bool makeTracksOnly = false; bool buildDecisionComp = false; + bool buildESDComp = false; // Parse the chainType, output, dataSource and logLevel option strings: TString outOpt = output; @@ -216,6 +217,7 @@ void RunChain( buildDDLRecoComps = true; buildTrackerComp = true; buildDecisionComp = true; + buildESDComp = true; TString dataOpt = dataSource; if (dataOpt.CompareTo("file", TString::kIgnoreCase) == 0) @@ -238,6 +240,7 @@ void RunChain( buildDDLRecoComps = true; buildFullTrackerComp = true; buildDecisionComp = true; + buildESDComp = true; TString dataOpt = dataSource; if (dataOpt.CompareTo("file", TString::kIgnoreCase) == 0) @@ -259,6 +262,7 @@ void RunChain( { buildDDLRecoComps = true; buildDecisionComp = false; + buildESDComp = false; TString dataOpt = dataSource; if (dataOpt.CompareTo("file", TString::kIgnoreCase) == 0) @@ -280,6 +284,7 @@ void RunChain( { buildTrackerComp = true; buildDecisionComp = true; + buildESDComp = true; TString dataOpt = dataSource; if (dataOpt.CompareTo("sim", TString::kIgnoreCase) == 0) @@ -621,6 +626,12 @@ void RunChain( if (buildFullTrackerComp) decisionSource = "tracker-full"; AliHLTConfiguration decision("decision", "MUONDecisionComponent", decisionSource, ""); } + if (buildESDComp) + { + const char* ESDSource = "tracker recDDL21 recDDL22 "; + if (buildFullTrackerComp) ESDSource = "tracker-full recDDL21 recDDL22 "; + AliHLTConfiguration ESD("ESD", AliHLTMUONConstants::ESDMakerId(), ESDSource, " -make_minimal_esd"); + } // Build the data sink to subscribe only to what has been created and // to the data source we actaully want. @@ -641,6 +652,10 @@ void RunChain( // Add the trigger decision component if it was enabled. sources += " decision"; } + if (buildESDComp) + { + sources += " ESD "; + } // Build the data checker component if so requested. if (checkData)