Also adding option to write ESDs in Rootifier component.
(Indra)
///
/// Implements a component to convert dHLT raw data into TObjects.
///
/// 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"
#include "AliHLTMUONRootifierComponent.h"
#include "AliHLTMUONEvent.h"
#include "AliHLTMUONConstants.h"
i, DataType2Text(block->fDataType).c_str(), block->fPtr, block->fSize
);
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<AliESDEvent*>(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);
{
specification |= block->fSpecification;
AliHLTMUONRecHitsBlockReader inblock(block->fPtr, block->fSize);
|| not TMath::Finite(fHalfTrack[ibackTrackSeg].fPz)) continue;
#ifdef PRINT_OUTPUT
|| 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),
size,ibackTrackSeg,Int_t(TMath::Sign(1.,fTrackParam[ibackTrackSeg].GetInverseBendingMomentum())),
TMath::Sqrt(fHalfTrack[ibackTrackSeg].fPx*fHalfTrack[ibackTrackSeg].fPx +
fHalfTrack[ibackTrackSeg].fPy*fHalfTrack[ibackTrackSeg].fPy),
track->fPz = fHalfTrack[ibackTrackSeg].fPz;
track->fChi2 = 0;
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=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);
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);
#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 ;
+
bool useRootWriter = false;
bool makeTracksOnly = false;
bool buildDecisionComp = false;
bool useRootWriter = false;
bool makeTracksOnly = false;
bool buildDecisionComp = false;
+ bool buildESDComp = false;
// Parse the chainType, output, dataSource and logLevel option strings:
TString outOpt = output;
// Parse the chainType, output, dataSource and logLevel option strings:
TString outOpt = output;
buildDDLRecoComps = true;
buildTrackerComp = true;
buildDecisionComp = true;
buildDDLRecoComps = true;
buildTrackerComp = true;
buildDecisionComp = true;
TString dataOpt = dataSource;
if (dataOpt.CompareTo("file", TString::kIgnoreCase) == 0)
TString dataOpt = dataSource;
if (dataOpt.CompareTo("file", TString::kIgnoreCase) == 0)
buildDDLRecoComps = true;
buildFullTrackerComp = true;
buildDecisionComp = true;
buildDDLRecoComps = true;
buildFullTrackerComp = true;
buildDecisionComp = true;
TString dataOpt = dataSource;
if (dataOpt.CompareTo("file", TString::kIgnoreCase) == 0)
TString dataOpt = dataSource;
if (dataOpt.CompareTo("file", TString::kIgnoreCase) == 0)
{
buildDDLRecoComps = true;
buildDecisionComp = false;
{
buildDDLRecoComps = true;
buildDecisionComp = false;
TString dataOpt = dataSource;
if (dataOpt.CompareTo("file", TString::kIgnoreCase) == 0)
TString dataOpt = dataSource;
if (dataOpt.CompareTo("file", TString::kIgnoreCase) == 0)
{
buildTrackerComp = true;
buildDecisionComp = true;
{
buildTrackerComp = true;
buildDecisionComp = true;
TString dataOpt = dataSource;
if (dataOpt.CompareTo("sim", TString::kIgnoreCase) == 0)
TString dataOpt = dataSource;
if (dataOpt.CompareTo("sim", TString::kIgnoreCase) == 0)
if (buildFullTrackerComp) decisionSource = "tracker-full";
AliHLTConfiguration decision("decision", "MUONDecisionComponent", decisionSource, "");
}
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.
// Build the data sink to subscribe only to what has been created and
// to the data source we actaully want.
// Add the trigger decision component if it was enabled.
sources += " decision";
}
// 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)
// Build the data checker component if so requested.
if (checkData)