]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Cleanup of documentation and code.
authoraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 May 2008 17:19:07 +0000 (17:19 +0000)
committeraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 May 2008 17:19:07 +0000 (17:19 +0000)
Splitting AliHLTMUONEvent from AliHLTMUONRootifierComponent.cxx file. The AliHLTMUONEvent class was a temporary solution, but it works so well we are making it permanent.
Adding the dHLT trigger decision component that actually calculates the dHLT trigger scalars from the reconstructed tracks.
Also added the corresponding ROOT AliHLTMUONDecision object for testing.
AliHLTMUONRootifierComponent now generates the AliHLTMUONDecision from raw dHLT internal data.

20 files changed:
HLT/MUON/AliHLTMUONConstants.cxx
HLT/MUON/AliHLTMUONConstants.h
HLT/MUON/AliHLTMUONDecision.cxx [new file with mode: 0644]
HLT/MUON/AliHLTMUONDecision.h [new file with mode: 0644]
HLT/MUON/AliHLTMUONEvent.cxx [new file with mode: 0644]
HLT/MUON/AliHLTMUONEvent.h [new file with mode: 0644]
HLT/MUON/AliHLTMUONMansoTrack.cxx
HLT/MUON/AliHLTMUONMansoTrack.h
HLT/MUON/AliHLTMUONRecHit.cxx
HLT/MUON/AliHLTMUONRecHit.h
HLT/MUON/AliHLTMUONTriggerRecord.cxx
HLT/MUON/AliHLTMUONTriggerRecord.h
HLT/MUON/HLTMUONLinkDef.h
HLT/MUON/OfflineInterface/AliHLTMUONRootifierComponent.cxx
HLT/MUON/OfflineInterface/AliHLTMUONRootifierComponent.h
HLT/MUON/OnlineAnalysis/AliHLTMUONDecisionComponent.cxx
HLT/MUON/OnlineAnalysis/AliHLTMUONHitReconstructorComponent.cxx
HLT/MUON/OnlineAnalysis/AliHLTMUONMansoTrackerFSMComponent.cxx
HLT/MUON/OnlineAnalysis/AliHLTMUONTriggerReconstructorComponent.cxx
HLT/libAliHLTMUON.pkg

index c49e3f55667e5838164582ff4f88024614c8f293..b7e35ef260d8df730a732df0fa2a715b8e20f581 100644 (file)
@@ -92,7 +92,7 @@ AliHLTMUONConstants::fgkNilMansoCandidateStruct = {
 };
 
 const AliHLTMUONTrackDecisionStruct
-AliHLTMUONConstants::fgkNilTrackDecisionStruct = {0, 0};
+AliHLTMUONConstants::fgkNilTrackDecisionStruct = {0, 0, 0};
 
 const AliHLTMUONPairDecisionStruct
 AliHLTMUONConstants::fgkNilPairDecisionStruct = {0, 0, 0, 0};
@@ -178,8 +178,7 @@ const char* AliHLTMUONConstants::fgkTriggerReconstructorId = "MUONTriggerReconst
 const char* AliHLTMUONConstants::fgkHitReconstructorId = "MUONHitReconstructor";
 const char* AliHLTMUONConstants::fgkMansoTrackerFSMId = "MUONMansoTrackerFSM";
 const char* AliHLTMUONConstants::fgkDecisionComponentId = "MUONDecisionComponent";
-const char* AliHLTMUONConstants::fgkTriggerCalibratorId = "MUONTriggerCalibrator";
-const char* AliHLTMUONConstants::fgkTrackerCalibratorId = "MUONTrackerCalibrator";
+const char* AliHLTMUONConstants::fgkRootifierComponentId = "MUONRootifier";
 const char* AliHLTMUONConstants::fgkEmptyEventFilterComponentId = "MUONEmptyEventFilterComponent";
 
 const char* AliHLTMUONConstants::fgkDecisionComponentCDBPath = "HLT/ConfigMUON/DecisionComponent";
index d0a19a5811bda7064ba58d5cb2fac70a418d6a99..51db0fbadfbca2826e12fdebf8da7ea06ea29333 100644 (file)
@@ -202,14 +202,9 @@ public:
                return fgkDecisionComponentId;
        }
        
-       static const char* TriggerCalibratorId()
+       static const char* RootifierComponentId()
        {
-               return fgkTriggerCalibratorId;
-       }
-       
-       static const char* TrackerCalibratorId()
-       {
-               return fgkTrackerCalibratorId;
+               return fgkRootifierComponentId;
        }
        
        static const char* EmptyEventFilterComponentId()
@@ -264,8 +259,7 @@ private:
        static const char* fgkHitReconstructorId; // Centre of gravity cluster finder component name.
        static const char* fgkMansoTrackerFSMId; // Manso tracker FSM implementation component name.
        static const char* fgkDecisionComponentId; // dHLT decision component name.
-       static const char* fgkTriggerCalibratorId; // Trigger calibration component name.
-       static const char* fgkTrackerCalibratorId; // Tracking stations calibration component name.
+       static const char* fgkRootifierComponentId; // The name of the event filter debugging component.
        static const char* fgkEmptyEventFilterComponentId; // The name of the event filter debugging component.
        
        // CDB path entries to configuration information.
diff --git a/HLT/MUON/AliHLTMUONDecision.cxx b/HLT/MUON/AliHLTMUONDecision.cxx
new file mode 100644 (file)
index 0000000..0b6e6e7
--- /dev/null
@@ -0,0 +1,605 @@
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project        * 
+ * All rights reserved.                                                   *
+ *                                                                        *
+ * Primary Authors:                                                       *
+ *   Artur Szostak <artursz@iafrica.com>                                  *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+
+/* $Id: $ */
+
+///
+/// @file   AliHLTMUONDecision.cxx
+/// @author Artur Szostak <artursz@iafrica.com>
+/// @date   12 May 2008
+/// @brief  Implementation of the AliHLTMUONDecision class.
+///
+/// The class is used to store the dHLT decision in a more convenient ROOT
+/// object format for testing and analysis.
+///
+
+#include "AliHLTMUONDecision.h"
+#include "AliHLTMUONMansoTrack.h"
+#include "AliLog.h"
+#include <cstring>
+#include <iostream>
+#include <iomanip>
+
+ClassImp(AliHLTMUONDecision);
+ClassImp(AliHLTMUONDecision::AliTrackDecision);
+ClassImp(AliHLTMUONDecision::AliPairDecision);
+
+
+std::ostream& operator << (
+               std::ostream& stream,
+               const AliHLTMUONDecision& decision
+       )
+{
+/// Stream operator for std::ostream classes.
+/// \param stream  The output stream object being written to.
+/// \param track  The dHLT decision object to print to the stream.
+/// \returns  Returns 'stream'.
+
+       stream  << "No. low/high pT: [" << decision.fNlowPt
+               << ", " << decision.fNhighPt
+               << "]; No. any/low/high unlike: [" << decision.fNunlikeAnyPt
+               << ", " << decision.fNunlikeLowPt
+               << ", " << decision.fNunlikeHighPt
+               << "]; No. any/low/high like = " << decision.fNlikeAnyPt
+               << ", " << decision.fNlikeLowPt
+               << ", " << decision.fNlikeHighPt
+               << "]; No. any/low/high mass = " << decision.fNmassAny
+               << ", " << decision.fNmassLow
+               << ", " << decision.fNmassHigh
+               << "]";
+       return stream;
+}
+
+
+AliHLTMUONDecision::AliHLTMUONDecision(
+               UInt_t nLowPt, UInt_t nHiPt,
+               UInt_t nUnlikeAnyPt, UInt_t nUnlikeLowPt, UInt_t nUnlikeHighPt,
+               UInt_t nLikeAnyPt, UInt_t nLikeLowPt, UInt_t nLikeHighPt,
+               UInt_t nMassAny, UInt_t nMassLow, UInt_t nMassHigh
+       ) :
+       TObject(),
+       fNlowPt(nLowPt),
+       fNhighPt(nHiPt),
+       fNunlikeAnyPt(nUnlikeAnyPt),
+       fNunlikeLowPt(nUnlikeLowPt),
+       fNunlikeHighPt(nUnlikeHighPt),
+       fNlikeAnyPt(nLikeAnyPt),
+       fNlikeLowPt(nLikeLowPt),
+       fNlikeHighPt(nLikeHighPt),
+       fNmassAny(nMassAny),
+       fNmassLow(nMassLow),
+       fNmassHigh(nMassHigh),
+       fTrackDecisions("AliHLTMUONDecision::AliTrackDecision"),
+       fPairDecisions("AliHLTMUONDecision::AliPairDecision")
+{
+/// Constructor for creating a dHLT decision object.
+/// \param nLowPt  Number of tracks above low pT cut.
+/// \param nHiPt   Number of tracks above high pT cut.
+/// \param nUnlikeAnyPt  Number of track pairs with unlike sign.
+/// \param nUnlikeLowPt  Number of unlike sign track pairs with pT > low cut.
+/// \param nUnlikeHighPt Number of unlike sign track pairs with pT > high cut.
+/// \param nLikeAnyPt   Number of track pairs with like sign.
+/// \param nLikeLowPt   Number of like sign track pairs with pT > low cut.
+/// \param nLikeHighPt  Number of like sign track pairs with pT > high cut.
+/// \param nMassAny   Number of unlike sign track pairs with invariant mass > low cut.
+/// \param nMassLow   Number of unlike sign track pairs with invariant mass > low mass cut and pT > low pT cut.
+/// \param nMassHigh  Number of unlike sign track pairs with invariant mass > high mass cut and pT > high pT cut.
+}
+
+
+void AliHLTMUONDecision::AddDecision(
+               Float_t pt, Bool_t passedLowCut, Bool_t passedHighCut,
+               const AliHLTMUONMansoTrack* track
+       )
+{
+/// Add a single track decision to the dHLT trigger.
+/// \param pt  The calculated pT value used for the trigger decision.
+/// \param passedLowCut  Flag indicating if the track passed the low pT cut.
+/// \param passedHighCut  Flag indicating if the track passed the high pT cut.
+/// \param track  Pointer to the associated track object.
+
+       new (fTrackDecisions[fTrackDecisions.GetEntriesFast()])
+               AliTrackDecision(
+                       pt, passedLowCut, passedHighCut, track
+               );
+}
+
+
+void AliHLTMUONDecision::AddDecision(const AliTrackDecision* decision)
+{
+/// Add a single track decision to the dHLT trigger.
+
+       new (fTrackDecisions[fTrackDecisions.GetEntriesFast()])
+               AliTrackDecision(*decision);
+}
+
+
+void AliHLTMUONDecision::AddDecision(
+               Float_t mass, Bool_t passedLowCut,
+               Bool_t passedHighCut, Bool_t unlike,
+               UChar_t lowPtCount, UChar_t highPtCount,
+               const AliHLTMUONMansoTrack* trackA,
+               const AliHLTMUONMansoTrack* trackB
+       )
+{
+/// Add a track pair decision to the dHLT trigger.
+/// \param mass   The invariant mass of the track pair.
+/// \param passedLowCut  Indicates if the pair passed the low mass cut.
+/// \param passedHighCut  Indicates if the pair passed the high mass cut.
+/// \param unlike   Indicates if the tracks have opposite sign.
+/// \param lowPtCount  The number of tracks in the pair that passed the low pT cut.
+///            Should be in the range [0..2].
+/// \param highPtCount  The number of tracks in the pair that passed the high pT cut.
+///            Should be in the range [0..2].
+/// \param trackA  Pointer to the first associated track object.
+/// \param trackB  Pointer to the second associated track object.
+
+       new (fPairDecisions[fPairDecisions.GetEntriesFast()])
+               AliPairDecision(
+                       mass, passedLowCut, passedHighCut, unlike,
+                       lowPtCount, highPtCount, trackA, trackB
+               );
+}
+
+
+void AliHLTMUONDecision::AddDecision(const AliPairDecision* decision)
+{
+/// Add a track pair decision to the dHLT trigger.
+
+       new (fPairDecisions[fPairDecisions.GetEntriesFast()])
+               AliPairDecision(*decision);
+}
+
+
+void AliHLTMUONDecision::Print(Option_t* option) const
+{
+/// Prints the trigger decision information to standard output (screen).
+/// \param option  Can be one of the following:
+///      - "compact" - prints in a compact format.
+///      - "detail" - prints trigger information in a more detailed format.
+///      - "all" - prints a full dump of the trigger object.
+
+       using namespace std;
+       
+       if (option == NULL or strcmp(option, "") == 0 or
+           strcmp(option, "compact") == 0
+          )
+       {
+               cout << *this << endl;
+       }
+       else if (strcmp(option, "detail") == 0)
+       {
+               cout << "dHLT trigger decision scalars:" << endl;
+               cout << "No. tracks passed pT cut," << endl;
+               cout << "  low = " << fNlowPt << endl;
+               cout << " high = " << fNhighPt << endl;
+               cout << "No. unlike sign pairs," << endl;
+               cout << "          total = " << fNunlikeAnyPt << endl;
+               cout << "   pT > low cut = " << fNunlikeLowPt << endl;
+               cout << "  pT > high cut = " << fNunlikeHighPt << endl;
+               cout << "No. like sign pairs," << endl;
+               cout << "          total = " << fNlikeAnyPt << endl;
+               cout << "   pT > low cut = " << fNlikeLowPt << endl;
+               cout << "  pT > high cut = " << fNlikeHighPt << endl;
+               cout << "No. pairs with," << endl;
+               cout << "          invariant mass > low cut = " << fNmassAny << endl;
+               cout << "   invariant mass and pT > low cut = " << fNmassLow << endl;
+               cout << "  invariant mass and pT > high cut = " << fNmassHigh << endl;
+               
+               streamsize w = cout.width();
+               ios::fmtflags f = cout.flags();
+               cout << "Triggers for single tracks:" << endl;
+               cout << setw(10) << "" << setw(12) << "pT  " << setw(15) << "Passed pT cut" << endl;
+               cout    << setw(10) << "Track" << setw(12) << "(GeV/c)" << setw(6) << "low "
+                       << setw(3) << " | " << setw(6) << "high" << endl;
+               for (Int_t i = 0; i < NumberOfTracks(); i++)
+               {
+                       const AliTrackDecision* decision = SingleTrackDecision(i);
+                       if (decision == NULL) continue;
+                       
+                       if (decision->Track() == NULL)
+                       {
+                               cout << setw(10) << "-";
+                       }
+                       else
+                       {
+                               cout << setw(10) << decision->Track()->Id();
+                       }
+                       
+                       cout    << setw(12) << decision->Pt()
+                               << setw(6) << (decision->PassedLowPtCut() ? "yes" : "no")
+                               << setw(3) << "   "
+                               << setw(6) << (decision->PassedHighPtCut() ? "yes" : "no")
+                               << endl;
+               }
+               cout << "Triggers for track pairs:" << endl;
+               cout    << setw(20) << "Track pair" << setw(6) << "Like" << setw(12) << "mass  "
+                       << setw(17) << "Passed mass cut"
+                       << setw(20) << "No. with pT > than" << endl;
+               cout    << setw(10) << "track A" << setw(10) << "track B"
+                       << setw(6) << "sign" << setw(12) << "(GeV/c^2)"
+                       << setw(8) << "low " << setw(3) << " | " << setw(6) << "high"
+                       << setw(11) << "low " << setw(3) << " | " << setw(6) << "high" << endl;
+               for (Int_t j = 0; j < NumberOfPairs(); j++)
+               {
+                       const AliPairDecision* decision = TrackPairDecision(j);
+                       if (decision == NULL) continue;
+                       
+                       if (decision->TrackA() == NULL)
+                       {
+                               cout << setw(10) << "-";
+                       }
+                       else
+                       {
+                               cout << setw(10) << decision->TrackA()->Id();
+                       }
+                       
+                       if (decision->TrackB() == NULL)
+                       {
+                               cout << setw(10) << "-";
+                       }
+                       else
+                       {
+                               cout << setw(10) << decision->TrackB()->Id();
+                       }
+                       
+                       cout    << setw(6) << (decision->LikeSign() ? "yes" : "no")
+                               << setw(12) << decision->Mass()
+                               << setw(8) << (decision->PassedLowMassCut() ? "yes" : "no")
+                               << setw(3) << "   "
+                               << setw(6) << (decision->PassedHighMassCut() ? "yes" : "no")
+                               << setw(11) << Int_t(decision->NumberPassedLowPtCut())
+                               << setw(3) << "   "
+                               << setw(6) << Int_t(decision->NumberPassedHighPtCut())
+                               << endl;
+               }
+               cout.width(w); // reset the field width to previous value.
+               cout.flags(f); // reset the flags to previous values.
+       }
+       else if (strcmp(option, "all") == 0)
+       {
+               cout << "dHLT trigger decision scalars:" << endl;
+               cout << "No. tracks passed pT cut," << endl;
+               cout << "  low = " << fNlowPt << endl;
+               cout << " high = " << fNhighPt << endl;
+               cout << "No. unlike sign pairs," << endl;
+               cout << "          total = " << fNunlikeAnyPt << endl;
+               cout << "   pT > low cut = " << fNunlikeLowPt << endl;
+               cout << "  pT > high cut = " << fNunlikeHighPt << endl;
+               cout << "No. like sign pairs," << endl;
+               cout << "          total = " << fNlikeAnyPt << endl;
+               cout << "   pT > low cut = " << fNlikeLowPt << endl;
+               cout << "  pT > high cut = " << fNlikeHighPt << endl;
+               cout << "No. pairs with," << endl;
+               cout << "          invariant mass > low cut = " << fNmassAny << endl;
+               cout << "   invariant mass and pT > low cut = " << fNmassLow << endl;
+               cout << "  invariant mass and pT > high cut = " << fNmassHigh << endl;
+               
+               cout << "===============================================" << endl;
+               cout << "========== Triggers for single tracks: ========" << endl;
+               for (Int_t i = 0; i < NumberOfTracks(); i++)
+               {
+                       const AliTrackDecision* decision = SingleTrackDecision(i);
+                       if (decision == NULL) continue;
+                       decision->Print("all");
+               }
+               cout << "===============================================" << endl;
+               cout << "========== Triggers for track pairs: ==========" << endl;
+               for (Int_t j = 0; j < NumberOfPairs(); j++)
+               {
+                       const AliPairDecision* decision = TrackPairDecision(j);
+                       if (decision == NULL) continue;
+                       decision->Print("all");
+               }
+       }
+       else
+       {
+               AliError("Unknown option specified. Can only be one of 'compact',"
+                       " 'detail' or 'all'."
+               );
+       }
+}
+
+
+Int_t AliHLTMUONDecision::Compare(const TObject* obj) const
+{
+/// We compare this object with 'obj' first by the trigger scalars and then
+/// by the signle track and track pair decision lists.
+/// \param obj  This is the object to compare to. It must be of type AliHLTMUONDecision.
+/// \returns  -1 if 'this' is smaller than 'obj', 1 if greater and zero if both
+///      objects are the same.
+
+       if (obj->IsA() == AliHLTMUONDecision::Class())
+       {
+               const AliHLTMUONDecision* d =
+                       static_cast<const AliHLTMUONDecision*>(obj);
+               if (fNlowPt < d->fNlowPt) return -1;
+               if (fNlowPt > d->fNlowPt) return 1;
+               if (fNhighPt < d->fNhighPt) return -1;
+               if (fNhighPt > d->fNhighPt) return 1;
+               if (fNunlikeAnyPt < d->fNunlikeAnyPt) return -1;
+               if (fNunlikeAnyPt > d->fNunlikeAnyPt) return 1;
+               if (fNunlikeLowPt < d->fNunlikeLowPt) return -1;
+               if (fNunlikeLowPt > d->fNunlikeLowPt) return 1;
+               if (fNunlikeHighPt < d->fNunlikeHighPt) return -1;
+               if (fNunlikeHighPt > d->fNunlikeHighPt) return 1;
+               if (fNlikeAnyPt < d->fNlikeAnyPt) return -1;
+               if (fNlikeAnyPt > d->fNlikeAnyPt) return 1;
+               if (fNlikeLowPt < d->fNlikeLowPt) return -1;
+               if (fNlikeLowPt > d->fNlikeLowPt) return 1;
+               if (fNlikeHighPt < d->fNlikeHighPt) return -1;
+               if (fNlikeHighPt > d->fNlikeHighPt) return 1;
+               if (fNmassAny < d->fNmassAny) return -1;
+               if (fNmassAny > d->fNmassAny) return 1;
+               if (fNmassLow < d->fNmassLow) return -1;
+               if (fNmassLow > d->fNmassLow) return 1;
+               if (fNmassHigh < d->fNmassHigh) return -1;
+               if (fNmassHigh > d->fNmassHigh) return 1;
+               
+               // Now check the track decision arrays.
+               if (NumberOfTracks() < d->NumberOfTracks()) return -1;
+               if (NumberOfTracks() > d->NumberOfTracks()) return 1;
+               for (Int_t i = 0; i < NumberOfTracks(); i++)
+               {
+                       Int_t result = SingleTrackDecision(i)->Compare( d->SingleTrackDecision(i) );
+                       if (result != 0) return result;
+               }
+               if (NumberOfPairs() < d->NumberOfPairs()) return -1;
+               if (NumberOfPairs() > d->NumberOfPairs()) return 1;
+               for (Int_t j = 0; j < NumberOfPairs(); j++)
+               {
+                       Int_t result = TrackPairDecision(j)->Compare( d->TrackPairDecision(j) );
+                       if (result != 0) return result;
+               }
+               
+               // At this point everything was equal so return 0 to indicate this fact.
+               return 0;
+       }
+       else
+       {
+               AliError(Form("Do not know how to compare %s to %s.",
+                       this->ClassName(),
+                       obj->ClassName()
+               ));
+               return -999;
+       }
+}
+
+
+bool AliHLTMUONDecision::operator == (const AliHLTMUONDecision& decision) const
+{
+/// Comparison operator just compares if the scalars are the same.
+/// \param decision  The trigger decision object to compare to.
+/// \returns  true if 'this' object has the same scalars as 'decision', else false.
+
+       return  fNlowPt == decision.fNlowPt
+               and fNhighPt == decision.fNhighPt
+               and fNunlikeAnyPt == decision.fNunlikeAnyPt
+               and fNunlikeLowPt == decision.fNunlikeLowPt
+               and fNunlikeHighPt == decision.fNunlikeHighPt
+               and fNlikeAnyPt == decision.fNlikeAnyPt
+               and fNlikeLowPt == decision.fNlikeLowPt
+               and fNlikeHighPt == decision.fNlikeHighPt
+               and fNmassAny == decision.fNmassAny
+               and fNmassLow == decision.fNmassLow
+               and fNmassHigh == decision.fNmassHigh;
+}
+
+
+std::ostream& operator << (
+               std::ostream& stream,
+               const AliHLTMUONDecision::AliTrackDecision& decision
+       )
+{
+/// Stream operator for std::ostream classes.
+/// \param stream  The output stream object being written to.
+/// \param track  The dHLT decision object to print to the stream.
+/// \returns  Returns 'stream'.
+
+       stream  << "Passed low/high pT cut: [" << (decision.fPassedLowCut ? "yes" : "no")
+               << ", " << (decision.fPassedHighCut ? "yes" : "no")
+               << "]; with pT = " << decision.fPt;
+       return stream;
+}
+
+
+void AliHLTMUONDecision::AliTrackDecision::Print(Option_t* option) const
+{
+/// Prints the trigger decision to standard output (screen).
+/// \param option  Can be one of the following:
+///      - "compact" - prints in a compact format.
+///      - "detail" - prints trigger information in a more detailed format.
+///      - "all" - prints a full dump of the trigger object.
+
+       using namespace std;
+       
+       if (option == NULL or strcmp(option, "") == 0 or
+           strcmp(option, "compact") == 0
+          )
+       {
+               cout << *this << endl;
+       }
+       else if (strcmp(option, "detail") == 0)
+       {
+               cout << "Trigger decision for track: " << fTrack->Id() << endl;
+               cout << "pT = " << fPt << " GeV/c" << endl;
+               cout << "pT cut | passed" << endl;
+               cout << "-------+--------" << endl;
+               cout << "  low  |  " << (fPassedLowCut ? "yes" : "no") << endl;
+               cout << " high  |  " << (fPassedHighCut ? "yes" : "no") << endl;
+       }
+       else if (strcmp(option, "all") == 0)
+       {
+               cout << "Trigger decision for track: " << fTrack->Id() << endl;
+               cout << "pT = " << fPt << " GeV/c" << endl;
+               cout << "pT cut | passed" << endl;
+               cout << "-------+--------" << endl;
+               cout << "  low  |  " << (fPassedLowCut ? "yes" : "no") << endl;
+               cout << " high  |  " << (fPassedHighCut ? "yes" : "no") << endl;
+               cout << "===== Track details =====" << endl;
+               fTrack->Print("all");
+       }
+       else
+       {
+               AliError("Unknown option specified. Can only be one of 'compact',"
+                       " 'detail' or 'all'."
+               );
+       }
+}
+
+
+Int_t AliHLTMUONDecision::AliTrackDecision::Compare(const TObject* obj) const
+{
+/// We compare this object with 'obj' field by field.
+/// \param obj  This is the object to compare to. It must be of type
+///      AliHLTMUONDecision::AliTrackDecision.
+/// \returns  -1 if 'this' is smaller than 'obj', 1 if greater and zero if both
+///      objects are the same.
+
+       if (obj->IsA() == AliHLTMUONDecision::Class())
+       {
+               const AliHLTMUONDecision::AliTrackDecision* d =
+                       static_cast<const AliHLTMUONDecision::AliTrackDecision*>(obj);
+               if (fPt < d->fPt) return -1;
+               if (fPt > d->fPt) return 1;
+               if (fPassedLowCut < d->fPassedLowCut) return -1;
+               if (fPassedLowCut > d->fPassedLowCut) return 1;
+               if (fPassedHighCut < d->fPassedHighCut) return -1;
+               if (fPassedHighCut > d->fPassedHighCut) return 1;
+               return fTrack->Compare(d->fTrack);
+       }
+       else
+       {
+               AliError(Form("Do not know how to compare %s to %s.",
+                       this->ClassName(),
+                       obj->ClassName()
+               ));
+               return -999;
+       }
+}
+
+
+std::ostream& operator << (
+               std::ostream& stream,
+               const AliHLTMUONDecision::AliPairDecision& decision
+       )
+{
+/// Stream operator for std::ostream classes.
+/// \param stream  The output stream object being written to.
+/// \param track  The dHLT decision object to print to the stream.
+/// \returns  Returns 'stream'.
+
+       stream  << (decision.fUnlike ? "Unlike" : "Like")
+               << " sign pair passed low/high mass cut: [" << (decision.fPassedLowCut ? "yes" : "no")
+               << ", " << (decision.fPassedHighCut ? "yes" : "no")
+               << "]; with mass = " << decision.fMass;
+       return stream;
+}
+
+
+void AliHLTMUONDecision::AliPairDecision::Print(Option_t* option) const
+{
+/// Prints the trigger decision to standard output (screen).
+/// \param option  Can be one of the following:
+///      - "compact" - prints in a compact format.
+///      - "detail" - prints trigger information in a more detailed format.
+///      - "all" - prints a full dump of the trigger object.
+
+       using namespace std;
+       
+       if (option == NULL or strcmp(option, "") == 0 or
+           strcmp(option, "compact") == 0
+          )
+       {
+               cout << *this << endl;
+       }
+       else if (strcmp(option, "detail") == 0)
+       {
+               cout    << "Trigger decision for track pair: {" << fTrackA->Id()
+                       << ", " << fTrackB->Id() << "}" << endl;
+               cout << "Invariant mass = " << fMass << " GeV/c^2" << endl;
+               cout << "mass cut | passed" << endl;
+               cout << "---------+--------" << endl;
+               cout << "   low   |  " << (fPassedLowCut ? "yes" : "no") << endl;
+               cout << "  high   |  " << (fPassedHighCut ? "yes" : "no") << endl;
+               cout << "Number of tracks in pair that passed," << endl;
+               cout << "   low pT cut = " << Int_t(fLowPtCount) << endl;
+               cout << "  high pT cut = " << Int_t(fHighPtCount) << endl;
+       }
+       else if (strcmp(option, "all") == 0)
+       {
+               cout    << "Trigger decision for track pair: {" << fTrackA->Id()
+                       << ", " << fTrackB->Id() << "}" << endl;
+               cout << "Invariant mass = " << fMass << " GeV/c^2" << endl;
+               cout << "mass cut | passed" << endl;
+               cout << "---------+--------" << endl;
+               cout << "   low   |  " << (fPassedLowCut ? "yes" : "no") << endl;
+               cout << "  high   |  " << (fPassedHighCut ? "yes" : "no") << endl;
+               cout << "Number of tracks in pair that passed," << endl;
+               cout << "   low pT cut = " << Int_t(fLowPtCount) << endl;
+               cout << "  high pT cut = " << Int_t(fHighPtCount) << endl;
+               cout << "===== First track details =====" << endl;
+               fTrackA->Print("all");
+               cout << "===== Second track details =====" << endl;
+               fTrackB->Print("all");
+       }
+       else
+       {
+               AliError("Unknown option specified. Can only be one of 'compact',"
+                       " 'detail' or 'all'."
+               );
+       }
+}
+
+
+Int_t AliHLTMUONDecision::AliPairDecision::Compare(const TObject* obj) const
+{
+/// We compare this object with 'obj' field by field.
+/// \param obj  This is the object to compare to. It must be of type
+///      AliHLTMUONDecision::AliPairDecision.
+/// \returns  -1 if 'this' is smaller than 'obj', 1 if greater and zero if both
+///      objects are the same.
+
+       if (obj->IsA() == AliHLTMUONDecision::Class())
+       {
+               const AliHLTMUONDecision::AliPairDecision* d =
+                       static_cast<const AliHLTMUONDecision::AliPairDecision*>(obj);
+               if (fMass < d->fMass) return -1;
+               if (fMass > d->fMass) return 1;
+               if (fPassedLowCut < d->fPassedLowCut) return -1;
+               if (fPassedLowCut > d->fPassedLowCut) return 1;
+               if (fPassedHighCut < d->fPassedHighCut) return -1;
+               if (fPassedHighCut > d->fPassedHighCut) return 1;
+               if (fUnlike < d->fUnlike) return -1;
+               if (fUnlike > d->fUnlike) return 1;
+               if (fLowPtCount < d->fLowPtCount) return -1;
+               if (fLowPtCount > d->fLowPtCount) return 1;
+               if (fHighPtCount < d->fHighPtCount) return -1;
+               if (fHighPtCount > d->fHighPtCount) return 1;
+               Int_t result = fTrackA->Compare(d->fTrackA);
+               if (result != 0) return result;
+               return fTrackB->Compare(d->fTrackB);
+       }
+       else
+       {
+               AliError(Form("Do not know how to compare %s to %s.",
+                       this->ClassName(),
+                       obj->ClassName()
+               ));
+               return -999;
+       }
+}
+
diff --git a/HLT/MUON/AliHLTMUONDecision.h b/HLT/MUON/AliHLTMUONDecision.h
new file mode 100644 (file)
index 0000000..a09481f
--- /dev/null
@@ -0,0 +1,498 @@
+#ifndef ALIHLTMUONDECISION_H
+#define ALIHLTMUONDECISION_H
+/* This file is property of and copyright by the ALICE HLT Project        *
+ * ALICE Experiment at CERN, All rights reserved.                         *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id: $ */
+
+///
+/// @file   AliHLTMUONDecision.h
+/// @author Artur Szostak <artursz@iafrica.com>
+/// @date   12 May 2008
+/// @brief  Declaration of a dHLT decision object in ROOT object format.
+///
+
+#include "TObject.h"
+#include "TClonesArray.h"
+
+class AliHLTMUONMansoTrack;
+
+/**
+ * AliHLTMUONDecision stores converted dHLT raw trigger decision data as a ROOT object.
+ * Both AliHLTMUONSinglesDecisionBlockStruct and AliHLTMUONPairsDecisionBlockStruct
+ * data blocks are converted into this class by the AliHLTMUONRootifierComponent.
+ * This class is mainly for testing or as a helper object for dHLT specific analysis,
+ * since it is sometimes easier to store and handle ROOT objects.
+ */
+class AliHLTMUONDecision : public TObject
+{
+       /**
+        * Stream operator for usage with std::ostream classes.
+        * Allows usage such as:
+        *   AliHLTMUONDecision t; std::cout << t;
+        */
+       friend std::ostream& operator << (
+                       std::ostream& stream,
+                       const AliHLTMUONDecision& decision
+               );
+
+public:
+
+       /**
+        * The AliTrackDecision class stores per track trigger information.
+        */
+       class AliTrackDecision : public TObject
+       {
+               /**
+                * Stream operator for usage with std::ostream classes.
+                */
+               friend std::ostream& operator << (std::ostream& stream, const AliTrackDecision& decision);
+       
+       public:
+               
+               /**
+                * Constructor for new single track trigger decision object.
+                * \param pt  The calculated pT value used for the trigger decision.
+                * \param passedLowCut  Flag indicating if the track passed the low pT cut.
+                * \param passedHighCut  Flag indicating if the track passed the high pT cut.
+                * \param track  Pointer to the associated track object.
+                */
+               AliTrackDecision(
+                               Float_t pt = -1,
+                               Bool_t passedLowCut = kFALSE,
+                               Bool_t passedHighCut = kFALSE,
+                               const AliHLTMUONMansoTrack* track = NULL
+                       ) :
+                       TObject(), fTrack(track), fPt(pt),
+                       fPassedLowCut(passedLowCut), fPassedHighCut(passedHighCut)
+               {}
+               
+               /**
+                * Copy constructor performs shallow copy of object since we
+                * do not take ownership of the track object.
+                */
+               AliTrackDecision(const AliTrackDecision& obj) :
+                       TObject(), fTrack(obj.fTrack), fPt(obj.fPt),
+                       fPassedLowCut(obj.fPassedLowCut), fPassedHighCut(obj.fPassedHighCut)
+               {}
+               
+               /**
+                * Asignment operators performs shallow copy of object since we
+                * do not take ownership of the track object.
+                */
+               const AliTrackDecision& operator = (const AliTrackDecision& obj)
+               {
+                       memcpy(this, &obj, sizeof(AliTrackDecision));
+                       return *this;
+               }
+               
+               /**
+                * Default destructor.
+                */
+               virtual ~AliTrackDecision() {}
+               
+               /**
+                * Returns the track associated with the trigger decision or NULL if none found.
+                */
+               const AliHLTMUONMansoTrack* Track() const { return fTrack; }
+               
+               /**
+                * Returns the calculated pT value used for the trigger decision.
+                */
+               Float_t Pt() const { return fPt; }
+               
+               /**
+                * Returns kTRUE if the track passed the low pT cut, else kFALSE.
+                */
+               Bool_t PassedLowPtCut() const { return fPassedLowCut; }
+               
+               /**
+                * Returns kTRUE if the track passed the high pT cut, else kFALSE.
+                */
+               Bool_t PassedHighPtCut() const { return fPassedHighCut; }
+               
+               /// Print method inherited from TObject.
+               virtual void Print(Option_t* option = NULL) const;
+       
+               // Methods inherited from TObject
+               virtual Bool_t IsSortable() const { return kTRUE; }
+               Int_t Compare(const TObject* obj) const;
+
+               // Implement comparison operators.
+               bool operator == (const AliTrackDecision& d) const
+               {
+                       return fTrack == d.fTrack and fPt == d.fPt
+                               and fPassedLowCut == d.fPassedLowCut
+                               and fPassedHighCut == d.fPassedHighCut;
+               }
+
+               bool operator != (const AliTrackDecision& d) const
+               {
+                       return not this->operator == (d);
+               }
+       
+       private:
+               
+               const AliHLTMUONMansoTrack* fTrack; ///< Track associated with this decision.
+               Float_t fPt; ///< Calculated pT value used for decision (GeV/c).
+               Bool_t fPassedLowCut; ///< Indicates if the track passed the low pT cut.
+               Bool_t fPassedHighCut; ///< Indicates if the track passed the high pT cut.
+               
+               ClassDef(AliHLTMUONDecision::AliTrackDecision, 2); // A single track dHLT trigger decision object.
+       };
+       
+       /**
+        * The AliPairDecision class stores trigger information about a track pair.
+        */
+       class AliPairDecision : public TObject
+       {
+               /**
+                * Stream operator for usage with std::ostream classes.
+                */
+               friend std::ostream& operator << (std::ostream& stream, const AliPairDecision& decision);
+       
+       public:
+               
+               /**
+                * Constructor for new track pair trigger decision object.
+                * \param mass   The invariant mass of the track pair.
+                * \param passedLowCut  Indicates if the pair passed the low mass cut.
+                * \param passedHighCut  Indicates if the pair passed the high mass cut.
+                * \param unlike   Indicates if the tracks have opposite sign.
+                * \param lowPtCount  The number of tracks in the pair that passed the low pT cut.
+                *            Should be in the range [0..2].
+                * \param highPtCount  The number of tracks in the pair that passed the high pT cut.
+                *            Should be in the range [0..2].
+                * \param trackA  Pointer to the first associated track object.
+                * \param trackB  Pointer to the second associated track object.
+                */
+               AliPairDecision(
+                               Float_t mass = -1, Bool_t passedLowCut = kFALSE,
+                               Bool_t passedHighCut = kFALSE, Bool_t unlike = kFALSE,
+                               UChar_t lowPtCount = 0, UChar_t highPtCount = 0,
+                               const AliHLTMUONMansoTrack* trackA = NULL,
+                               const AliHLTMUONMansoTrack* trackB = NULL
+                       ) :
+                       TObject(), fTrackA(trackA), fTrackB(trackB), fMass(mass),
+                       fPassedLowCut(passedLowCut), fPassedHighCut(passedHighCut),
+                       fUnlike(unlike), fLowPtCount(lowPtCount), fHighPtCount(highPtCount)
+               {}
+               
+               /**
+                * Copy constructor performs shallow copy of object since we
+                * do not take ownership of the track objects.
+                */
+               AliPairDecision(const AliPairDecision& obj) :
+                       TObject(), fTrackA(obj.fTrackA), fTrackB(obj.fTrackB), fMass(obj.fMass),
+                       fPassedLowCut(obj.fPassedLowCut), fPassedHighCut(obj.fPassedHighCut),
+                       fUnlike(obj.fUnlike), fLowPtCount(obj.fLowPtCount), fHighPtCount(obj.fHighPtCount)
+               {}
+               
+               /**
+                * Asignment operators performs shallow copy of object since we
+                * do not take ownership of the track objects.
+                */
+               const AliPairDecision& operator = (const AliPairDecision& obj)
+               {
+                       memcpy(this, &obj, sizeof(AliPairDecision));
+                       return *this;
+               }
+               
+               /**
+                * Default destructor.
+                */
+               virtual ~AliPairDecision() {}
+               
+               /**
+                * Returns the first track associated with the track pair trigger decision
+                * or NULL if none found.
+                */
+               const AliHLTMUONMansoTrack* TrackA() const { return fTrackA; }
+               
+               /**
+                * Returns the second track associated with the track pair trigger decision
+                * or NULL if none found.
+                */
+               const AliHLTMUONMansoTrack* TrackB() const { return fTrackB; }
+               
+               /**
+                * Returns the calculated invariant mass value used for the trigger decision.
+                */
+               Float_t Mass() const { return fMass; }
+               
+               /**
+                * Returns kTRUE if the track pair passed the low invariant mass cut, else kFALSE.
+                */
+               Bool_t PassedLowMassCut() const { return fPassedLowCut; }
+               
+               /**
+                * Returns kTRUE if the track pair passed the high invariant mass cut, else kFALSE.
+                */
+               Bool_t PassedHighMassCut() const { return fPassedHighCut; }
+               
+               /**
+                * Returns kTRUE if the track pair has unlike sign, else kFALSE.
+                */
+               Bool_t UnlikeSign() const { return fUnlike; }
+               
+               /**
+                * Returns kTRUE if the track pair has like sign, else kFALSE.
+                */
+               Bool_t LikeSign() const { return not fUnlike; }
+               
+               /**
+                * Returns the number of tracks in the pair that passed the low pT cut.
+                * Can be one of 0, 1 or 2.
+                */
+               UChar_t NumberPassedLowPtCut() const { return fLowPtCount; }
+               
+               /**
+                * Returns the number of tracks in the pair that passed the high pT cut.
+                * Can be one of 0, 1 or 2.
+                */
+               UChar_t NumberPassedHighPtCut() const { return fHighPtCount; }
+               
+               /**
+                * Returns kTRUE if both tracks passed the low pT cut, else kFALSE.
+                */
+               Bool_t BothPassedLowPtCut() const { return NumberPassedLowPtCut() == 2; }
+               
+               /**
+                * Returns kTRUE if both tracks passed the high pT cut, else kFALSE.
+                */
+               Bool_t BothPassedHighPtCut() const { return NumberPassedHighPtCut() == 2; }
+               
+               /// Print method inherited from TObject.
+               virtual void Print(Option_t* option = NULL) const;
+       
+               // Methods inherited from TObject
+               virtual Bool_t IsSortable() const { return kTRUE; }
+               Int_t Compare(const TObject* obj) const;
+
+               // Implement comparison operators.
+               bool operator == (const AliPairDecision& d) const
+               {
+                       return fTrackA == d.fTrackA and fTrackB == d.fTrackB and fMass == d.fMass
+                               and fPassedLowCut == d.fPassedLowCut and fPassedHighCut == d.fPassedHighCut
+                               and fUnlike == d.fUnlike and fLowPtCount == d.fLowPtCount and fHighPtCount == d.fHighPtCount;
+               }
+
+               bool operator != (const AliPairDecision& d) const
+               {
+                       return not this->operator == (d);
+               }
+       
+       private:
+               
+               const AliHLTMUONMansoTrack* fTrackA; ///< The first track associated with this pair decision.
+               const AliHLTMUONMansoTrack* fTrackB; ///< The second track associated with this pair decision.
+               Float_t fMass;  ///< The invariant mass used for the trigger decision. (GeV/c^2)
+               Bool_t fPassedLowCut; ///< Indicates if the track passed the low mass cut.
+               Bool_t fPassedHighCut; ///< Indicates if the track passed the high mass cut.
+               Bool_t fUnlike; ///< Indicates if the track pair has unlike sign.
+               UChar_t fLowPtCount; ///< The number of tracks in the pair that passed the low pT cut.
+               UChar_t fHighPtCount; ///< The number of tracks in the pair that passed the high pT cut.
+               
+               ClassDef(AliHLTMUONDecision::AliPairDecision, 2); // A track pair dHLT trigger decision object.
+       };
+
+       /**
+        * Constructor for creating a dHLT decision object.
+        * \param nLowPt  Number of tracks above low pT cut.
+        * \param nHiPt   Number of tracks above high pT cut.
+        * \param nUnlikeAnyPt  Number of track pairs with unlike sign.
+        * \param nUnlikeLowPt  Number of unlike sign track pairs with pT > low cut.
+        * \param nUnlikeHighPt Number of unlike sign track pairs with pT > high cut.
+        * \param nLikeAnyPt   Number of track pairs with like sign.
+        * \param nLikeLowPt   Number of like sign track pairs with pT > low cut.
+        * \param nLikeHighPt  Number of like sign track pairs with pT > high cut.
+        * \param nMassAny   Number of unlike sign track pairs with invariant mass > low cut.
+        * \param nMassLow   Number of unlike sign track pairs with invariant mass > low mass cut and pT > low pT cut.
+        * \param nMassHigh  Number of unlike sign track pairs with invariant mass > high mass cut and pT > high pT cut.
+        */
+       AliHLTMUONDecision(
+                       UInt_t nLowPt = 0, UInt_t nHiPt = 0,
+                       UInt_t nUnlikeAnyPt = 0, UInt_t nUnlikeLowPt = 0, UInt_t nUnlikeHighPt = 0,
+                       UInt_t nLikeAnyPt = 0, UInt_t nLikeLowPt = 0, UInt_t nLikeHighPt = 0,
+                       UInt_t nMassAny = 0, UInt_t nMassLow = 0, UInt_t nMassHigh = 0
+               );
+       
+       /**
+        * Default destructor.
+        */
+       virtual ~AliHLTMUONDecision() {}
+
+       /**
+        * Returns the number of single low pT triggers.
+        */
+       UInt_t NumberOfLowPtTriggers() const { return fNlowPt; }
+
+       /**
+        * Returns the number of single high pT triggers.
+        */
+       UInt_t NumberOfHighPtTriggers() const { return fNhighPt; }
+       
+       /**
+        * Returns the number of unlike sign pt triggers.
+        */
+       UInt_t NumberOfUnlikePairs() const { return fNunlikeAnyPt; }
+       
+       /**
+        * Returns the number of unlike sign pT triggers, where both tracks have pT > low cut.
+        */
+       UInt_t NumberOfUnlikeLowPtPairs() const { return fNunlikeLowPt; }
+       
+       /**
+        * Returns the number of unlike sign pT triggers, where both tracks have pT > high cut.
+        */
+       UInt_t NumberOfUnlikeHighPtPairs() const { return fNunlikeHighPt; }
+       
+       /**
+        * Returns the number of like sign pt triggers.
+        */
+       UInt_t NumberOfLikePairs() const { return fNlikeAnyPt; }
+       
+       /**
+        * Returns the number of like sign pT triggers, where both tracks have pT > low cut.
+        */
+       UInt_t NumberOfLikeLowPtPairs() const { return fNlikeLowPt; }
+       
+       /**
+        * Returns the number of like sign pT triggers, where both tracks have pT > high cut.
+        */
+       UInt_t NumberOfLikeHighPtPairs() const { return fNlikeHighPt; }
+       
+       /**
+        * Returns the number of invariant mass triggers.
+        */
+       UInt_t NumberOfMassTriggers() const { return fNmassAny; }
+       
+       /**
+        * Returns the number of invariant mass triggers,
+        * where invariant mass > low cut and both tracks have pT > low cut.
+        */
+       UInt_t NumberOfLowMassTriggers() const { return fNmassLow; }
+       
+       /**
+        * Returns the number of invariant mass triggers,
+        * where invariant mass > high cut and both tracks have pT > high cut.
+        */
+       UInt_t NumberOfHighMassTriggers() const { return fNmassHigh; }
+       
+       /**
+        * Returns the total number of single tracks that formed part of this trigger decision.
+        */
+       Int_t NumberOfTracks() const { return fTrackDecisions.GetEntriesFast(); }
+       
+       /**
+        * Returns the i'th trigger decision for a single track.
+        * \param i  Should be in the range [0 .. NumberOfTracks()-1]
+        */
+       const AliTrackDecision* SingleTrackDecision(Int_t i) const
+       {
+               return static_cast<const AliTrackDecision*>(fTrackDecisions.At(i));
+       }
+       
+       /**
+        * Returns the total number of track pairs that formed part of this trigger decision.
+        */
+       Int_t NumberOfPairs() const { return fPairDecisions.GetEntriesFast(); }
+       
+       /**
+        * Returns the i'th trigger decision for a track pair.
+        * \param i  Should be in the range [0 .. NumberOfPairs()-1]
+        */
+       const AliPairDecision* TrackPairDecision(Int_t i) const
+       {
+               return static_cast<const AliPairDecision*>(fPairDecisions.At(i));
+       }
+       
+       /// Add a single track decision to the dHLT trigger.
+       void AddDecision(const AliTrackDecision* decision);
+       
+       /// Add a single track decision to the dHLT trigger.
+       void AddDecision(
+                       Float_t pt, Bool_t passedLowCut, Bool_t passedHighCut,
+                       const AliHLTMUONMansoTrack* track
+               );
+       
+       /// Add a track pair decision to the dHLT trigger.
+       void AddDecision(const AliPairDecision* decision);
+       
+       /// Add a track pair decision to the dHLT trigger.
+       void AddDecision(
+                       Float_t mass, Bool_t passedLowCut,
+                       Bool_t passedHighCut, Bool_t unlike,
+                       UChar_t lowPtCount, UChar_t highPtCount,
+                       const AliHLTMUONMansoTrack* trackA,
+                       const AliHLTMUONMansoTrack* trackB
+               );
+       
+       /**
+        * Prints the details of the dHLT decision to screen.
+        * @param option  A case sensitive string that can contain one of the
+        *     following strings:
+        *       "compact" - Prints just the trigger scalars.
+        *       "detail" - Prints also the track decision list in a compact format.
+        *       "all" - Prints all decision information and also the track decision details.
+        *     If the string contains an empty option or NULL then the default is
+        *     to print compactly.
+        */
+       virtual void Print(Option_t* option = NULL) const;
+       
+       // Methods inherited from TObject
+       virtual Bool_t IsSortable() const { return kTRUE; }
+       Int_t Compare(const TObject* obj) const;
+
+       // Implement comparison operators.
+       bool operator == (const AliHLTMUONDecision& track) const;
+
+       bool operator != (const AliHLTMUONDecision& track) const
+       {
+               return not this->operator == (track);
+       }
+
+private:
+
+       // Do not allow copying of this class.
+       AliHLTMUONDecision(const AliHLTMUONDecision& track);
+       AliHLTMUONDecision& operator = (const AliHLTMUONDecision& track);
+       
+       UInt_t fNlowPt;  ///< Number of low pt triggers.
+       UInt_t fNhighPt; ///< Number of high pt triggers.
+       
+       /// Number of unlike sign pt triggers for both tracks having any pt.
+       UInt_t fNunlikeAnyPt;
+       
+       /// Number of unlike sign low pt triggers where both tracks have pt > low cut.
+       UInt_t fNunlikeLowPt;
+       
+       /// Number of unlike sign high pt triggers where both tracks have pt > high cut.
+       UInt_t fNunlikeHighPt;
+       
+       /// Number of like sign pt triggers where both tracks have any pt.
+       UInt_t fNlikeAnyPt;
+       
+       /// Number of like sign low pt triggers where both tracks have pt > low cut.
+       UInt_t fNlikeLowPt;
+       
+       /// Number of like sign high pt triggers where both tracks have pt > high cut.
+       UInt_t fNlikeHighPt;
+       
+       /// Number of pairs that have invariant mass > low mass cut, any pt and unlike sign.
+       UInt_t fNmassAny;
+       
+       /// Number of pairs that have invariant mass > low mass cut, pt > low pt cut and unlike sign.
+       UInt_t fNmassLow;
+       
+       /// Number of pairs that have invariant mass > high mass cut, pt > high pt cut and unlike sign.
+       UInt_t fNmassHigh;
+       
+       TClonesArray fTrackDecisions;  ///< Array of single track decision objects.
+       TClonesArray fPairDecisions;  ///< Array of track pair decision objects.
+
+       ClassDef(AliHLTMUONDecision, 2); // Decision object containing data converted from raw internal dHLT data structures.
+};
+
+#endif // ALIHLTMUONDECISION_H
diff --git a/HLT/MUON/AliHLTMUONEvent.cxx b/HLT/MUON/AliHLTMUONEvent.cxx
new file mode 100644 (file)
index 0000000..a614455
--- /dev/null
@@ -0,0 +1,66 @@
+/**************************************************************************
+ * This file is property of and copyright by the ALICE HLT Project        * 
+ * All rights reserved.                                                   *
+ *                                                                        *
+ * Primary Authors:                                                       *
+ *   Artur Szostak <artursz@iafrica.com>                                  *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+
+/* $Id: $ */
+
+///
+/// @file   AliHLTMUONEvent.cxx
+/// @author Artur Szostak <artursz@iafrica.com>
+/// @date   29 Sep 2007
+/// @brief  Implementation of the AliHLTMUONEvent class.
+///
+/// The class is used to store all ROOTified data objects from the dHLT chain
+/// for a single event together.
+
+#include "AliHLTMUONEvent.h"
+#include "AliHLTMUONDecision.h"
+#include <iostream>
+
+ClassImp(AliHLTMUONEvent);
+
+
+const AliHLTMUONDecision* AliHLTMUONEvent::FindDecision() const
+{
+       /// Finds the decision object in the event from the list of dHLT objects.
+       /// There should only be one such object in the event. If not, then only
+       /// the first object found is returned. You will need to manually search
+       /// for the other objects.
+       /// \returns  The AliHLTMUONDecision object in the event or NULL if none exists.
+       
+       for (Int_t i = 0; i < fArray.GetEntriesFast(); i++)
+       {
+               if (fArray[i]->IsA() == AliHLTMUONDecision::Class())
+               {
+                       return static_cast<const AliHLTMUONDecision*>(fArray[i]);
+               }
+       }
+       
+       return NULL;
+}
+
+
+void AliHLTMUONEvent::Print(Option_t* option) const
+{
+       ///
+       /// Inherited from TObject. Prints the contents of the event objects in fArray.
+       /// \param option  This is an option string that is just passed on to individual
+       ///     objects in the event's fArray list of objects.
+       ///
+       
+       std::cout << "################## EVENT: " << fEventId << " ##################" << std::endl;
+       for (Int_t i = 0; i < fArray.GetEntriesFast(); i++)
+               if (fArray[i] != NULL) fArray[i]->Print(option);
+}
diff --git a/HLT/MUON/AliHLTMUONEvent.h b/HLT/MUON/AliHLTMUONEvent.h
new file mode 100644 (file)
index 0000000..11402c2
--- /dev/null
@@ -0,0 +1,64 @@
+#ifndef ALIHLTMUONEVENT_H
+#define ALIHLTMUONEVENT_H
+/* This file is property of and copyright by the ALICE HLT Project        *
+ * ALICE Experiment at CERN, All rights reserved.                         *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id: $ */
+
+///
+/// @file   AliHLTMUONRootifierComponent.h
+/// @author Artur Szostak <artursz@iafrica.com>
+/// @date   9 May 2008
+/// @brief  Declaration of class for storing ROOTified data objects for one event.
+///
+
+#include "TObjArray.h"
+#include "AliHLTMUONDataTypes.h"
+
+class AliHLTMUONDecision;
+
+
+class AliHLTMUONEvent : public TObject
+{
+public:
+
+       /// AliHLTMUONEvent class contructor.
+       /// \param eventId  The event identifier number for this event. Set to -1 by default.
+       AliHLTMUONEvent(AliHLTEventID_t eventId = AliHLTEventID_t(-1))
+         : fEventId(eventId), fArray()
+       {
+               fArray.SetOwner(kTRUE);
+       }
+       
+       /// Default destructor.
+       virtual ~AliHLTMUONEvent() {}
+       
+       /// Returns the corresponding event ID for the data objects.
+       AliHLTEventID_t EventID() const { return fEventId; }
+       
+       /// Returns the array of data objects for this event.
+       const TObjArray& Array() const { return fArray; }
+       
+       /// Returns the array of data objects for this event.
+       const TObjArray& DataObjects() const { return fArray; }
+       
+       /// Finds the decision object in the array of dHLT objects.
+       const AliHLTMUONDecision* FindDecision() const;
+       
+       /// Adds an object to the event.
+       /// \note This method takes ownership of the object.
+       void Add(TObject* obj) { fArray.Add(obj); }
+       
+       /// Inherited method for printing information about all objects in the event.
+       virtual void Print(Option_t* option = NULL) const;
+
+private:
+
+       AliHLTEventID_t fEventId;  ///< The event ID.
+       TObjArray fArray;          ///< Array of event objects.
+       
+       ClassDef(AliHLTMUONEvent, 2); // Container class for dHLT event results.
+};
+
+#endif // ALIHLTMUONEVENT_H
index f9e6d2653f861218c90899e9dc172d444329a811..ab54fdb824b89488d6c63d25dc6ebdf9223e58d1 100644 (file)
 
 /* $Id$ */
 
-/**
- * @file   AliHLTMUONMansoTrack.cxx
- * @author Artur Szostak <artursz@iafrica.com>
- * @date   
- * @brief  Implementation of the AliHLTMUONMansoTrack class.
- */
+///
+/// @file   AliHLTMUONMansoTrack.cxx
+/// @author Artur Szostak <artursz@iafrica.com>
+/// @date   29 Sep 2007
+/// @brief  Implementation of the AliHLTMUONMansoTrack class.
+///
+/// The Manso track class is used to store converted track data from dHLT raw
+/// internal data blocks.
+///
 
 #include "AliHLTMUONMansoTrack.h"
+#include "AliHLTMUONRecHit.h"
+#include "AliHLTMUONTriggerRecord.h"
 #include "AliLog.h"
 #include "mapping/AliMpDEManager.h"
 #include <cstring>
 #include <iostream>
 #include <iomanip>
-using namespace std;
 
 ClassImp(AliHLTMUONMansoTrack);
 
@@ -39,7 +43,10 @@ std::ostream& operator << (
                const AliHLTMUONMansoTrack& track
        )
 {
-// Stream operator.
+/// Stream operator for std::ostream classes.
+/// \param stream  The output stream object being written to.
+/// \param track  The track object to print to the stream.
+/// \returns  Returns 'stream'.
 
        stream  << "ID: " << track.fId
                << "; sign: " << track.fSign
@@ -65,6 +72,24 @@ AliHLTMUONMansoTrack::AliHLTMUONMansoTrack(
        fId(id), fSign(sign), fMomentum(px, py, pz),
        fChi2(chi2), fTrigRec(trigrec), fZmiddle(zf), fQBL(qbl)
 {
+/// Default constructor.
+/// @param id       The track ID number which must be unique for any event.
+/// @param sign     The particle's sign: -1, 1 or 0 if unknown.
+/// @param px       X component of the particle's momentum (GeV/c).
+/// @param py       Y component of the particle's momentum (GeV/c).
+/// @param pz       Z component of the particle's momentum (GeV/c).
+/// @param chi2     The chi squared of the track fit.
+/// @param trigrec  Corresponding trigger record used as a seed to find
+///                 this track.
+/// @param hit7     Hit on chamber 7, tracking station 4.
+/// @param hit8     Hit on chamber 8, tracking station 4.
+/// @param hit9     Hit on chamber 9, tracking station 5.
+/// @param hit10    Hit on chamber 10, tracking station 5.
+/// @param zf    The Z coordinate of the middle of the magnetic field assumed
+///              during momentum calculation.
+/// @param qbl   The integrated magnetic field strength assumed during momentum
+///              calculation.
+
        if (sign < -1 or 1 < sign)
        {
                AliError(Form("Trying to set the sign to %d. This is outside the"
@@ -82,7 +107,9 @@ AliHLTMUONMansoTrack::AliHLTMUONMansoTrack(
 
 const AliHLTMUONRecHit* AliHLTMUONMansoTrack::Hit(Int_t chamber) const
 {
-// Returns the hit on the specified chamber.
+/// Returns the hit on the specified chamber.
+/// \param chamber  The chamber to return the hit for. Must be a value in the range [7..10].
+/// \returns  A pointer to the hit object else NULL if it does not exist.
 
        if (7 <= chamber and chamber <= 10) return fHit[chamber - 7];
        
@@ -96,8 +123,14 @@ const AliHLTMUONRecHit* AliHLTMUONMansoTrack::Hit(Int_t chamber) const
 
 void AliHLTMUONMansoTrack::Print(Option_t* option) const
 {
-// Prints the track information to standard output (screen).
+/// Prints the track information to standard output (screen).
+/// \param option  Can be one of the following:
+///           - "compact" - prints in a compact format.
+///           - "detail" - prints track information in a more detailed format.
+///           - "all" - prints a full dump of the track object.
 
+       using namespace std;
+       
        if (    option == NULL or strcmp(option, "") == 0 or
                strcmp(option, "compact") == 0
           )
@@ -184,8 +217,11 @@ void AliHLTMUONMansoTrack::Print(Option_t* option) const
 
 Int_t AliHLTMUONMansoTrack::Compare(const TObject* obj) const
 {
-// We compare this object with 'obj' first by track ID, then by sign, then
-// by momentum and finally by chi2.
+/// We compare this object with 'obj' first by track ID, then by sign, then
+/// by momentum and finally by chi2.
+/// \param obj  This is the object to compare to. It must be of type AliHLTMUONMansoTrack.
+/// \returns  -1 if 'this' is smaller than 'obj', 1 if greater and zero if both
+///      objects are the same.
 
        if (obj->IsA() == AliHLTMUONMansoTrack::Class())
        {
@@ -218,6 +254,10 @@ Int_t AliHLTMUONMansoTrack::Compare(const TObject* obj) const
 
 bool AliHLTMUONMansoTrack::operator == (const AliHLTMUONMansoTrack& track) const
 {
+/// Comparison operator.
+/// \param track  The track object to compare to.
+/// \returns  true if 'this' object is identical to 'track' else false.
+
        return  fId == track.fId and fSign == track.fSign
                and fMomentum == track.fMomentum
                and fChi2 == track.fChi2 and fTrigRec == track.fTrigRec
index f357e6073880cdf308a5409b90ce4976e39ac8aa..69bc68ce08a7fbf856e126dde2ae04400f2aad78 100644 (file)
@@ -6,19 +6,23 @@
 
 /* $Id$ */
 
-/**
- * @file   AliHLTMUONMansoTrack.h
- * @author Artur Szostak <artursz@iafrica.com>
- * @date   
- * @brief  Declaration of the Manso track class used to store converted track
- *         data from dHLT raw internal data blocks.
- */
+///
+/// @file   AliHLTMUONMansoTrack.h
+/// @author Artur Szostak <artursz@iafrica.com>
+/// @date   29 Sep 2007
+/// @brief  Declaration of the Manso track class used to store converted track data.
+///
+
+#include "TObject.h"
+#include "TVector3.h"
 
-#include "AliHLTMUONRecHit.h"
-#include "AliHLTMUONTriggerRecord.h"
+class AliHLTMUONTriggerRecord;
+class AliHLTMUONRecHit;
 
 /**
  * AliHLTMUONMansoTrack stores converted dHLT raw track data as a ROOT object.
+ * This class is mainly for testing or as a helper object for dHLT specific analysis,
+ * since it is sometimes easier to store and handle ROOT objects.
  */
 class AliHLTMUONMansoTrack : public TObject
 {
@@ -67,6 +71,9 @@ public:
                        Float_t zf = 0, Float_t qbl = 0
                );
        
+       /**
+        * Default destructor.
+        */
        virtual ~AliHLTMUONMansoTrack() {}
 
        /**
@@ -170,21 +177,21 @@ private:
        AliHLTMUONMansoTrack(const AliHLTMUONMansoTrack& track);
        AliHLTMUONMansoTrack& operator = (const AliHLTMUONMansoTrack& track);
        
-       Int_t fId; // Track ID number which is unique for a particular event.
-       Int_t fSign;  // The sign of the particle.
-       TVector3 fMomentum; // Momentum vector of the particle in GeV/c.
-       Float_t fChi2; // Chi squared of fit.
-       const AliHLTMUONTriggerRecord* fTrigRec;  // Corresponding trigger record.
-       const AliHLTMUONRecHit* fHit[4];   // Particle hits on tracking chambers 7 to 10.
+       Int_t fId; ///< Track ID number which is unique for a particular event.
+       Int_t fSign;  ///< The sign of the particle.
+       TVector3 fMomentum; ///< Momentum vector of the particle in GeV/c.
+       Float_t fChi2; ///< Chi squared of fit.
+       const AliHLTMUONTriggerRecord* fTrigRec;  ///< Corresponding trigger record.
+       const AliHLTMUONRecHit* fHit[4];   ///< Particle hits on tracking chambers 7 to 10.
        
        // The following is debugging information and may not be filled if the
        // dHLT components were not set to produce this information.
        
        // Parameters used in momentum estimation:
-       Float_t fZmiddle; // Particle momentum X component in GeV/c.
-       Float_t fQBL;     // The integrated magnetic field times charge in (T.m) tesla metres.
+       Float_t fZmiddle; ///< Particle momentum X component in GeV/c.
+       Float_t fQBL;     ///< The integrated magnetic field times charge in (T.m) tesla metres.
 
-       ClassDef(AliHLTMUONMansoTrack, 1); // Manso track object containing data converted from a dHLT internal track structure.
+       ClassDef(AliHLTMUONMansoTrack, 2); // Manso track object containing data converted from a dHLT internal track structure.
 };
 
 #endif // ALIHLTMUONMANSOTRACK_H
index ba787c9a5be11c6c0ef66539e2f8ef32fd63f3ee..361ac6df8328d1c3fb34d484109179dc50ae2c8d 100644 (file)
 
 /* $Id$ */
 
-/**
- * @file   AliHLTMUONRecHit.cxx
- * @author Artur Szostak <artursz@iafrica.com>
- * @date   
- * @brief  Implementation of the AliHLTMUONRecHit class.
- */
+///
+/// @file   AliHLTMUONRecHit.cxx
+/// @author Artur Szostak <artursz@iafrica.com>
+/// @date   29 Sep 2007
+/// @brief  Implementation of the AliHLTMUONRecHit class.
+///
+/// The AliHLTMUONRecHit object is used to store 3D hit coordinates translated
+/// from dHLT raw data.
+///
 
 #include "AliHLTMUONRecHit.h"
 #include "AliLog.h"
 #include <cstring>
 #include <iostream>
 #include <iomanip>
-using namespace std;
 
 ClassImp(AliHLTMUONRecHit);
-ClassImp(AliHLTMUONRecHit::Channel);
+ClassImp(AliHLTMUONRecHit::AliChannel);
 
 
 std::ostream& operator << (std::ostream& stream, const AliHLTMUONRecHit& hit)
 {
-// Stream operator for std::ostream classes.
+/// Stream operator for std::ostream classes.
+/// \param stream  The output stream object being written to.
+/// \param track  The hit object to print to the stream.
+/// \returns  Returns 'stream'.
 
        stream << "(" << hit.X() << ", " << hit.Y() << ", " << hit.Z() << ")";
        return stream;
@@ -48,7 +53,11 @@ void AliHLTMUONRecHit::SetDebugInfo(
                Int_t detElemId, Int_t clusterId, UInt_t nChExp, Int_t sourceDDL
        )
 {
-// Sets the debugging information.
+/// Sets the debugging information.
+/// @param detElemId  The detector element ID.
+/// @param clusterId  Cluster ID of the hit's cluster.
+/// @param nChExp     Number of expected channels forming the cluster.
+/// @param sourceDDL  The source DDL of this hit.
 
        fSourceDDL = sourceDDL;
        fDetElemId = detElemId;
@@ -59,7 +68,9 @@ void AliHLTMUONRecHit::SetDebugInfo(
 
 Int_t AliHLTMUONRecHit::Chamber(bool warn) const
 {
-// Returns the chamber ID for this hit.
+/// Returns the chamber ID for this hit.
+/// \param warn  Indicates if any warning should be printed in case of problems.
+/// \returns The chamber number of this hit in the range [1..14] or -1 if not known.
 
        if (fSourceDDL != -1)
        {
@@ -91,16 +102,26 @@ void AliHLTMUONRecHit::AddChannel(
                UInt_t rawDataWord
        )
 {
-// Adds a new channel to the channels list forming this hit's cluster.
+/// Adds a new channel to the channels list forming this hit's cluster.
+/// @param manu    The MANU number
+/// @param channel The MANU channel address.
+/// @param signal  The ADC signal value measured on the channel.
+/// @param rawDataWord This is the raw data word as read from the DDL.
 
        Int_t index = fChannels.GetEntriesFast();
-       new (fChannels[index]) Channel(manu, channel, signal, rawDataWord);
+       new (fChannels[index]) AliChannel(manu, channel, signal, rawDataWord);
 }
 
 
 void AliHLTMUONRecHit::Print(Option_t* option) const
 {
-// Prints the coordinates of this hit to standard output (screen).
+/// Prints the coordinates of this hit to standard output (screen).
+/// \param option  Can be one of the following:
+///           - "compact" - prints in a compact format.
+///           - "detail" - prints hit information in a more detailed format.
+///           - "all" - prints a full dump of the hit object.
+
+       using namespace std;
 
        if (    option == NULL or strcmp(option, "") == 0 or
                strcmp(option, "compact") == 0
@@ -140,8 +161,8 @@ void AliHLTMUONRecHit::Print(Option_t* option) const
                        cout << showbase;
                        for (Int_t i = 0; i < fChannels.GetEntriesFast(); i++)
                        {
-                               const AliHLTMUONRecHit::Channel* c =
-                                       static_cast<const AliHLTMUONRecHit::Channel*>(fChannels[i]);
+                               const AliHLTMUONRecHit::AliChannel* c =
+                                       static_cast<const AliHLTMUONRecHit::AliChannel*>(fChannels[i]);
                                cout << dec << setw(12) << c->Manu()
                                        << setw(12) << c->Address()
                                        << setw(12) << c->Signal()
@@ -165,7 +186,10 @@ void AliHLTMUONRecHit::Print(Option_t* option) const
 
 Int_t AliHLTMUONRecHit::Compare(const TObject* obj) const
 {
-// We compare this object with 'obj' first by X, then Y, then Z.
+/// We compare this object with 'obj' first by X, then Y, then Z.
+/// \param obj  This is the object to compare to. It must be of type AliHLTMUONRecHit.
+/// \returns  -1 if 'this' is smaller than 'obj', 1 if greater and zero if both
+///      objects are the same.
 
        if (obj->IsA() == AliHLTMUONRecHit::Class())
        {
@@ -189,9 +213,12 @@ Int_t AliHLTMUONRecHit::Compare(const TObject* obj) const
 }
 
 
-std::ostream& operator << (std::ostream& stream, const AliHLTMUONRecHit::Channel& c)
+std::ostream& operator << (std::ostream& stream, const AliHLTMUONRecHit::AliChannel& c)
 {
-// Stream operator for std::ostream classes.
+/// Stream operator for std::ostream classes.
+/// \param stream  The output stream object being written to.
+/// \param c  The channel object to print to the stream.
+/// \returns  Returns 'stream'.
 
        stream << "Channel: " << c.fManu << " , " << c.fAddress
                << "; ADC: " << c.fSignal;
@@ -199,10 +226,15 @@ std::ostream& operator << (std::ostream& stream, const AliHLTMUONRecHit::Channel
 }
 
 
-void AliHLTMUONRecHit::Channel::Print(Option_t* option) const
+void AliHLTMUONRecHit::AliChannel::Print(Option_t* option) const
 {
-// Prints the details of this channel to standard output (screen).
+/// Prints the details of this channel to standard output (screen).
+/// \param option  Can be one of the following:
+///           - "compact" - prints in a compact format.
+///           - "detail" - prints channel information in a more detailed format.
 
+       using namespace std;
+       
        if (    option == NULL or strcmp(option, "") == 0 or
                strcmp(option, "compact") == 0
           )
@@ -231,14 +263,17 @@ void AliHLTMUONRecHit::Channel::Print(Option_t* option) const
 }
 
 
-Int_t AliHLTMUONRecHit::Channel::Compare(const TObject* obj) const
+Int_t AliHLTMUONRecHit::AliChannel::Compare(const TObject* obj) const
 {
-// We compare this object with 'obj' first by MANU number, then by MANU channel
-// address, then ADC signal.
+/// We compare this object with 'obj' first by MANU number, then by MANU channel
+/// address, then ADC signal.
+/// \param obj  This is the object to compare to. It must be of type AliHLTMUONRecHit::Channel.
+/// \returns  -1 if 'this' is smaller than 'obj', 1 if greater and zero if both
+///      objects are the same.
 
-       if (obj->IsA() == Channel::Class())
+       if (obj->IsA() == AliChannel::Class())
        {
-               const Channel* c = static_cast<const Channel*>(obj);
+               const AliChannel* c = static_cast<const AliChannel*>(obj);
                if (fManu < c->Manu()) return -1;
                if (fManu > c->Manu()) return 1;
                if (fAddress < c->Address()) return -1;
index c613e2cb021f7f107b28dd394a0bb59535a0b58a..e73bbab77e7b769aa7d766663d26e978afdfbe9a 100644 (file)
@@ -6,13 +6,12 @@
 
 /* $Id$ */
 
-/**
- * @file   AliHLTMUONRecHit.h
- * @author Artur Szostak <artursz@iafrica.com>
- * @date   
- * @brief  Declaration of a reconstructed hit ROOT object to store 3D hit
- *         coordinates translated from dHLT raw data.
- */
+///
+/// @file   AliHLTMUONRecHit.h
+/// @author Artur Szostak <artursz@iafrica.com>
+/// @date   29 Sep 2007
+/// @brief  Declaration of a reconstructed hit ROOT object to store 3D hit coordinates.
+///
 
 #include "TObject.h"
 #include "TClonesArray.h"
@@ -24,6 +23,8 @@
  * the dHLT. These objects store information translated into ROOT format from
  * dHLT raw data. Reconstructed hit values of (0, 0, 0) indicate an invalid or
  * nil hit.
+ * This class is mainly for testing or as a helper object for dHLT specific analysis,
+ * since it is sometimes easier to store and handle ROOT objects.
  */
 class AliHLTMUONRecHit : public TObject
 {
@@ -37,20 +38,27 @@ class AliHLTMUONRecHit : public TObject
 public:
 
        /**
-        * The Channel class stores extra debugging information about the channels
+        * The AliChannel class stores extra debugging information about the channels
         * and raw data words that were considered during reconstruction of a hit
         * by the dHLT hit reconstructor component.
         */
-       class Channel : public TObject
+       class AliChannel : public TObject
        {
                /**
                 * Stream operator for usage with std::ostream classes.
                 */
-               friend std::ostream& operator << (std::ostream& stream, const Channel& c);
+               friend std::ostream& operator << (std::ostream& stream, const AliChannel& c);
        
        public:
                
-               Channel(
+               /**
+                * Constructor.
+                * \param manu  The MANU ID of the channel as found in the raw data word.
+                * \param channel  The MANU channel ID as found in the raw data word.
+                * \param signal  The ADC signal value as found in the raw data word.
+                * \param rawDataWord  The actual raw data word.
+                */
+               AliChannel(
                                Short_t manu = -1,
                                Short_t channel = -1,
                                Short_t signal = -1,
@@ -61,7 +69,10 @@ public:
                        fRawDataWord(rawDataWord)
                {}
                
-               virtual ~Channel() {}
+               /**
+                * Default destructor.
+                */
+               virtual ~AliChannel() {}
                
                /**
                 * Returns the MANU address.
@@ -90,26 +101,26 @@ public:
                Int_t Compare(const TObject* obj) const;
 
                // Implement comparison operators.
-               bool operator == (const Channel& c) const
+               bool operator == (const AliChannel& c) const
                {
                        return fManu == c.fManu and fAddress == c.fAddress 
                                and fSignal == c.fSignal
                                and fRawDataWord == c.fRawDataWord;
                }
 
-               bool operator != (const Channel& hit) const
+               bool operator != (const AliChannel& c) const
                {
-                       return not this->operator == (hit);
+                       return not this->operator == (c);
                }
        
        private:
        
-               Short_t fManu;       // The MANU address on the electronics.
-               Short_t fAddress;    // The channel address on the electronics.
-               Short_t fSignal;     // ADC value of signal.
-               UInt_t fRawDataWord; // The raw data word as found in the DDL stream.
+               Short_t fManu;       ///< The MANU address on the electronics.
+               Short_t fAddress;    ///< The channel address on the electronics.
+               Short_t fSignal;     ///< ADC value of signal.
+               UInt_t fRawDataWord; ///< The raw data word as found in the DDL stream.
                
-               ClassDef(AliHLTMUONRecHit::Channel, 1); // A MANU channel forming part of a cluster that was considered during hit reconstruction in dHLT.
+               ClassDef(AliHLTMUONRecHit::AliChannel, 2); // A MANU channel forming part of a cluster that was considered during hit reconstruction in dHLT.
        };
 
        /**
@@ -134,9 +145,12 @@ public:
                ) :
                fCoordinate(x, y, z), fSourceDDL(sourceDDL),
                fDetElemId(detElemId), fClusterId(clusterId), fNchExp(nChExp),
-               fChannels("AliHLTMUONRecHit::Channel", 6)
+               fChannels("AliHLTMUONRecHit::AliChannel", 6)
        {}
        
+       /**
+        * Default destructor.
+        */
        virtual ~AliHLTMUONRecHit() {}
 
        /**
@@ -220,9 +234,9 @@ public:
         * Returns the i'th channel associated with this hit.
         * @param i  Should be a number in the range [0..n), where n = Nchannels().
         */
-       const Channel* GetChannel(Int_t i) const
+       const AliChannel* GetChannel(Int_t i) const
        {
-               return static_cast<const Channel*>(fChannels[i]);
+               return static_cast<const AliChannel*>(fChannels[i]);
        }
        
        /**
@@ -267,17 +281,17 @@ public:
 
 private:
 
-       TVector3 fCoordinate; // The 3D coordinate of the hit in AliRoot global coordinates (cm).
+       TVector3 fCoordinate; ///< The 3D coordinate of the hit in AliRoot global coordinates (cm).
        
        // The following is debugging information and may not be filled if the
        // dHLT components were not set to produce this information.
-       Int_t fSourceDDL;  // The DDL from which this hit originates.
-       Int_t fDetElemId;  // Detector element ID number.
-       Int_t fClusterId;  // The cluster ID number used to relate all the channels to each other.
-       UInt_t fNchExp;    // The number of channels that were supposed to be found.
-       TClonesArray fChannels; // The channels forming part of the cluster from which this hit was reconstructed.
+       Int_t fSourceDDL;  ///< The DDL from which this hit originates.
+       Int_t fDetElemId;  ///< Detector element ID number.
+       Int_t fClusterId;  ///< The cluster ID number used to relate all the channels to each other.
+       UInt_t fNchExp;    ///< The number of channels that were supposed to be found.
+       TClonesArray fChannels; ///< The channels forming part of the cluster from which this hit was reconstructed.
 
-       ClassDef(AliHLTMUONRecHit, 1); // A reconstructed hit translated from dHLT raw data into ROOT format.
+       ClassDef(AliHLTMUONRecHit, 2); // A reconstructed hit translated from dHLT raw data into ROOT format.
 };
 
 #endif // ALIHLTMUONRECHIT_H
index f6a20ec006adf39605b42dc1c82100deb3fa618e..6eb8c6ec511b17572d49920026bf66168133b008 100644 (file)
 
 /* $Id$ */
 
-/**
- * @file   AliHLTMUONTriggerRecord.cxx
- * @author Artur Szostak <artursz@iafrica.com>
- * @date   
- * @brief  Implementation of the AliHLTMUONTriggerRecord class.
- */
+///
+/// @file   AliHLTMUONTriggerRecord.cxx
+/// @author Artur Szostak <artursz@iafrica.com>
+/// @date   29 Sep 2007
+/// @brief  Implementation of the AliHLTMUONTriggerRecord class.
+///
+/// Code for the trigger record structure containing data corresponding to the
+/// L0 trigger local board output.
+///
 
 #include "AliHLTMUONTriggerRecord.h"
 #include "AliLog.h"
@@ -39,7 +42,10 @@ std::ostream& operator << (
                const AliHLTMUONTriggerRecord& trigrec
        )
 {
-// Stream operator.
+/// Stream operator for std::ostream classes.
+/// \param stream  The output stream object being written to.
+/// \param trigrec  The trigger record object to print to the stream.
+/// \returns  Returns 'stream'.
 
        stream  << "ID: " << trigrec.fId
                << "; sign: " << trigrec.fSign
@@ -59,6 +65,18 @@ AliHLTMUONTriggerRecord::AliHLTMUONTriggerRecord(
        fId(id), fSign(sign), fMomentum(px, py, pz), fSourceDDL(sourceDDL),
        fZmiddle(zf), fQBL(qbl)
 {
+/// Constructor for creating a new trigger record.
+/// @param id    The trigger record ID number unique for an event.
+/// @param sign  The particle's sign. Must be -1, 1 or 0 if the sign is unknown.
+/// @param px    X component of the particle's momentum.
+/// @param py    Y component of the particle's momentum.
+/// @param pz    Z component of the particle's momentum.
+/// @param sourceDDL  The DDL from which this trigger record originates.
+/// @param zf    The Z coordinate of the middle of the magnetic field assumed
+///              during momentum calculation.
+/// @param qbl   The integrated magnetic field strength assumed during momentum
+///              calculation.
+       
        if (sign < -1 or 1 < sign)
        {
                AliError(Form("Trying to set the sign to %d. This is outside the"
@@ -79,7 +97,10 @@ AliHLTMUONTriggerRecord::AliHLTMUONTriggerRecord(
 
 const TVector3& AliHLTMUONTriggerRecord::Hit(Int_t chamber) const
 {
-// Returns the hit on the specified chamber.
+/// Returns the hit on the specified chamber.
+/// \param chamber  The chamber for which to fetch the hit. Valid values
+///                 are in the range [11..14].
+/// \returns  The 3D corrdinate of the hit.
 
        if (11 <= chamber and chamber <= 14) return fHit[chamber - 11];
        
@@ -93,8 +114,11 @@ const TVector3& AliHLTMUONTriggerRecord::Hit(Int_t chamber) const
 
 Int_t AliHLTMUONTriggerRecord::DetElemId(Int_t chamber) const
 {
-// Returns the detector element ID for the specified chamber associated
-// to the hit on that chamber.
+/// Returns the detector element ID for the specified chamber associated
+/// to the hit on that chamber.
+/// @param chamber  The chamber for which to fetch the detector element ID.
+///                Valid values are in the range [11..14].
+/// \returns  The detector element ID or -1 if not known.
 
        if (11 <= chamber and chamber <= 14) return fDetElemId[chamber - 11];
        
@@ -108,7 +132,10 @@ Int_t AliHLTMUONTriggerRecord::DetElemId(Int_t chamber) const
 
 Int_t AliHLTMUONTriggerRecord::PatternX(Int_t chamber) const
 {
-// Returns the raw data X pattern of the hit on the specified chamber.
+/// Returns the raw data X pattern of the hit on the specified chamber.
+/// \param chamber  The chamber for which to fetch the bit pattern.
+///                 Valid values are in the range [11..14].
+/// \returns X bit pattern of the hit.
 
        if (11 <= chamber and chamber <= 14) return fPatternX[chamber - 11];
        
@@ -122,7 +149,10 @@ Int_t AliHLTMUONTriggerRecord::PatternX(Int_t chamber) const
 
 Int_t AliHLTMUONTriggerRecord::PatternY(Int_t chamber) const
 {
-// Returns the raw data Y pattern of the hit on the specified chamber.
+/// Returns the raw data Y pattern of the hit on the specified chamber.
+/// \param chamber  The chamber for which to fetch the bit pattern.
+///                 Valid values are in the range [11..14].
+/// \returns Y bit pattern of the hit.
 
        if (11 <= chamber and chamber <= 14) return fPatternY[chamber - 11];
        
@@ -136,7 +166,12 @@ Int_t AliHLTMUONTriggerRecord::PatternY(Int_t chamber) const
 
 void AliHLTMUONTriggerRecord::SetHit(Int_t chamber, Float_t x, Float_t y, Float_t z)
 {
-// Fills the hit coordinate on the specified chamber.
+/// Fills the hit coordinate on the specified chamber.
+/// @param chamber  The chamber for which to set the hit. Valid values
+///                 are in the range [11..14].
+/// @param x  The X coordinate of the hit in centimetres.
+/// @param y  The Y coordinate of the hit in centimetres.
+/// @param z  The Z coordinate of the hit in centimetres.
 
        if (11 <= chamber and chamber <= 14)
        {
@@ -157,7 +192,13 @@ void AliHLTMUONTriggerRecord::SetHitDebugInfo(
                Int_t detElemId, UShort_t patternX, UShort_t patternY
        )
 {
-// Fills the debugging information corresponding to the hit on the specified chamber.
+/// Fills the debugging information corresponding to the hit on the specified chamber.
+/// Sets the debugging information for the hit on the specified chamber.
+/// @param chamber  The chamber for which to set the debugging information.
+///                Valid values are in the range [11..14].
+/// @param detElemId  The detector element ID.
+/// @param patterX    The X bit pattern from the local board.
+/// @param patterY    The Y bit pattern from the local board.
 
        if (11 <= chamber and chamber <= 14)
        {
@@ -177,8 +218,14 @@ void AliHLTMUONTriggerRecord::SetHitDebugInfo(
 
 void AliHLTMUONTriggerRecord::Print(Option_t* option) const
 {
-// Prints the trigger record to standard output (screen).
+/// Prints the trigger record to standard output (screen).
+/// \param option  Can be one of the following:
+///           - "compact" - prints in a compact format.
+///           - "detail" - prints track information in a more detailed format.
+///           - "all" - prints a full dump of the track object.
 
+       using namespace std;
+       
        if (    option == NULL or strcmp(option, "") == 0 or
                strcmp(option, "compact") == 0
           )
@@ -267,8 +314,11 @@ void AliHLTMUONTriggerRecord::Print(Option_t* option) const
 
 Int_t AliHLTMUONTriggerRecord::Compare(const TObject* obj) const
 {
-// We compare this object with 'obj' first by trigger record ID, then
-// by sign and finally by momentum.
+/// We compare this object with 'obj' first by trigger record ID, then
+/// by sign and finally by momentum.
+/// \param obj  This is the object to compare to. It must be of type AliHLTMUONTriggerRecord.
+/// \returns  -1 if 'this' is smaller than 'obj', 1 if greater and zero if both
+///      objects are the same.
 
        if (obj->IsA() == AliHLTMUONTriggerRecord::Class())
        {
@@ -299,7 +349,9 @@ Int_t AliHLTMUONTriggerRecord::Compare(const TObject* obj) const
 
 bool AliHLTMUONTriggerRecord::operator == (const AliHLTMUONTriggerRecord& trigrec) const
 {
-// Compares the trigger record 'trigrec' to this one.
+/// Compares the trigger record 'trigrec' to this one.
+/// \param trigrec  The trigger record object to compare to.
+/// \returns  true if 'this' object is identical to 'trigrec' else false.
 
        return  fId == trigrec.fId and fSign == trigrec.fSign
                and fMomentum == trigrec.fMomentum
index b1ea7b855924b226ceb7d48a4528aa37c0eb5ae3..20c63757cfc68d863d46da825330c9770e439d8c 100644 (file)
@@ -6,13 +6,12 @@
 
 /* $Id$ */
 
-/**
- * @file   AliHLTMUONTriggerRecord.h
- * @author Artur Szostak <artursz@iafrica.com>
- * @date   
- * @brief  Declaration of the trigger record structure containing data
- *         corresponding to the L0 trigger local board output.
- */
+///
+/// @file   AliHLTMUONTriggerRecord.h
+/// @author Artur Szostak <artursz@iafrica.com>
+/// @date   29 Sep 2007
+/// @brief  Declaration of the trigger record structure in ROOT object format for dHLT.
+///
 
 #include "TObject.h"
 #include "TVector3.h"
@@ -20,7 +19,9 @@
 
 /**
  * Trigger record class containing information about a dimuon L0 trigger
- * local board decision.
+ * local board decision in a ROOT object.
+ * This class is mainly for testing or as a helper object for dHLT specific analysis,
+ * since it is sometimes easier to store and handle ROOT objects.
  */
 class AliHLTMUONTriggerRecord : public TObject
 {
@@ -59,7 +60,10 @@ public:
                        Float_t zf = 0,
                        Float_t qbl = 0
                );
-               
+       
+       /**
+        * Default destructor.
+        */
        virtual ~AliHLTMUONTriggerRecord() {}
 
        /**
@@ -122,22 +126,22 @@ public:
 
        /**
         * Returns the X coordinate of the reconstructed hit in centimetres.
-        * @param chamber  The chamber for which to fetch the hit. Valid values
-        *                 are in the range [11..14].
+        * @param chamber  The chamber for which to fetch the X coordinate.
+        *                 Valid values are in the range [11..14].
         */
        Double_t X(Int_t chamber) const { return Hit(chamber).X(); }
 
        /**
         * Returns the Y coordinate of the reconstructed hit in centimetres.
-        * @param chamber  The chamber for which to fetch the hit. Valid values
-        *                 are in the range [11..14].
+        * @param chamber  The chamber for which to fetch the Y coordinate.
+        *                 Valid values are in the range [11..14].
         */
        Double_t Y(Int_t chamber) const { return Hit(chamber).Y(); }
 
        /**
         * Returns the Z coordinate of the reconstructed hit in centimetres.
-        * @param chamber  The chamber for which to fetch the hit. Valid values
-        *                 are in the range [11..14].
+        * @param chamber  The chamber for which to fetch the Z coordinate.
+        *                 Valid values are in the range [11..14].
         */
        Double_t Z(Int_t chamber) const { return Hit(chamber).Z(); }
        
@@ -150,24 +154,24 @@ public:
        /**
         * Returns the detector element ID number for the hit on the specified
         * chamber. -1 is returned if this information was not set.
-        * @param chamber  The chamber for which to fetch the hit. Valid values
-        *                 are in the range [11..14].
+        * @param chamber  The chamber for which to fetch the detector element ID.
+        *                 Valid values are in the range [11..14].
         */
        Int_t DetElemId(Int_t chamber) const;
        
        /**
         * Returns the 16 bit X pattern from the local board.
         * -1 is returned if this information was not set.
-        * @param chamber  The chamber for which to fetch the hit. Valid values
-        *                 are in the range [11..14].
+        * @param chamber  The chamber for which to fetch the bit pattern.
+        *                 Valid values are in the range [11..14].
         */
        Int_t PatternX(Int_t chamber) const;
        
        /**
         * Returns the 16 bit Y pattern from the local board.
         * -1 is returned if this information was not set.
-        * @param chamber  The chamber for which to fetch the hit. Valid values
-        *                 are in the range [11..14].
+        * @param chamber  The chamber for which to fetch the bit pattern.
+        *                Valid values are in the range [11..14].
         */
        Int_t PatternY(Int_t chamber) const;
        
@@ -186,7 +190,7 @@ public:
        /**
         * Sets the hit coordinate (in AliRoot global coordinates) on the
         * given chamber.
-        * @param chamber  The chamber for which to fetch the hit. Valid values
+        * @param chamber  The chamber for which to set the hit. Valid values
         *                 are in the range [11..14].
         * @param x  The X coordinate of the hit in centimetres.
         * @param y  The Y coordinate of the hit in centimetres.
@@ -196,8 +200,8 @@ public:
        
        /**
         * Sets the debugging information for the hit on the specified chamber.
-        * @param chamber  The chamber for which to fetch the hit. Valid values
-        *                 are in the range [11..14].
+        * @param chamber  The chamber for which to set the debugging information.
+        *                Valid values are in the range [11..14].
         * @param detElemId  The detector element ID.
         * @param patterX    The X bit pattern from the local board.
         * @param patterY    The Y bit pattern from the local board.
@@ -234,23 +238,23 @@ public:
 
 private:
 
-       Int_t fId; // Each trigger record should have an ID number unique for a given event.
-       Int_t fSign;  // The sign of the particle: -1 or 1. 0 indicates unknown value.
-       TVector3 fMomentum; // Momentum vector of the particle in GeV/c.
-       TVector3 fHit[4];   // hit coordinates on trigger chambers 11 to 14.
+       Int_t fId; ///< Each trigger record should have an ID number unique for a given event.
+       Int_t fSign;  ///< The sign of the particle: -1 or 1. 0 indicates unknown value.
+       TVector3 fMomentum; ///< Momentum vector of the particle in GeV/c.
+       TVector3 fHit[4];   ///< hit coordinates on trigger chambers 11 to 14.
        
        // The following is debugging information and may not be filled if the
        // dHLT components were not set to produce this information.
-       Int_t fSourceDDL;  // The DDL from which this trigger record originates.
-       Int_t fDetElemId[4]; // The detector element ID for the hit on each chamber 11 to 14.
-       Int_t fPatternX[4];  // The X pattern from the local board structure for chambers 11 to 14. -1 if invalid.
-       Int_t fPatternY[4];  // The Y pattern from the local board structure for chambers 11 to 14. -1 if invalid.
+       Int_t fSourceDDL;  ///< The DDL from which this trigger record originates.
+       Int_t fDetElemId[4]; ///< The detector element ID for the hit on each chamber 11 to 14.
+       Int_t fPatternX[4];  ///< The X pattern from the local board structure for chambers 11 to 14. -1 if invalid.
+       Int_t fPatternY[4];  ///< The Y pattern from the local board structure for chambers 11 to 14. -1 if invalid.
        
        // Parameters used in momentum estimation:
-       Float_t fZmiddle; // Particle momentum X component in GeV/c.
-       Float_t fQBL;     // The integrated magnetic field times charge in (T.m) tesla metres.
+       Float_t fZmiddle; ///< Particle momentum X component in GeV/c.
+       Float_t fQBL;     ///< The integrated magnetic field times charge in (T.m) tesla metres.
                
-       ClassDef(AliHLTMUONTriggerRecord, 1);  // Trigger record object translated from dHLT internal raw data.
+       ClassDef(AliHLTMUONTriggerRecord, 2);  // Trigger record object translated from dHLT internal raw data.
 };
 
 #endif // ALIHLTMUONTRIGGERRECORD_H
index 52105f743a686bdfe2ad7b25b05ed15a0a853d91..c11eb7e557126ad586a8e4191c923b9548bb2b6d 100644 (file)
@@ -19,7 +19,7 @@
 ///
 /// @file   HLTMUONLinkDef.h
 /// @author Artur Szostak <artursz@iafrica.com>
-/// @date   
+/// @date   29 May 2007
 /// @brief  The linkdef file for rootcint to build a ROOT dictionary of
 ///         the dimuon HLT classes exposed to AliRoot.
 ///
 #pragma link C++ class AliHLTMUONMansoTrackerFSMComponent+;
 #pragma link C++ class AliHLTMUONDecisionComponent+;
 #pragma link C++ class AliHLTMUONRecHit+;
-#pragma link C++ class AliHLTMUONRecHit::Channel+;
+#pragma link C++ class AliHLTMUONRecHit::AliChannel+;
 #pragma link C++ class AliHLTMUONTriggerRecord+;
 #pragma link C++ class AliHLTMUONMansoTrack+;
+#pragma link C++ class AliHLTMUONDecision+;
+#pragma link C++ class AliHLTMUONDecision::AliTrackDecision+;
+#pragma link C++ class AliHLTMUONDecision::AliPairDecision+;
+#pragma link C++ class AliHLTMUONEvent+;
 #pragma link C++ class AliHLTMUONRootifierComponent+;
 #pragma link C++ class AliHLTMUONEmptyEventFilterComponent+;
 
-//TODO: The following is temporary.
-#pragma link C++ class AliHLTMUONEvent+;
-
 #endif // __CINT__
index c26d1e706919b7cf647d9d0931b042a111ae1ec3..c3de236a0aaabd76d504409c873fc9d6b0820bfb 100644 (file)
 ///
 /// @file   AliHLTMUONRootifierComponent.cxx
 /// @author Artur Szostak <artursz@iafrica.com>
-/// @date   
+/// @date   29 Sep 2007
 /// @brief  Implementation of the AliHLTMUONRootifierComponent component.
 ///
 
 #include "AliHLTMUONRootifierComponent.h"
+#include "AliHLTMUONEvent.h"
 #include "AliHLTMUONConstants.h"
 #include "AliHLTMUONUtils.h"
 #include "AliHLTMUONDataBlockReader.h"
 #include "AliHLTMUONRecHit.h"
 #include "AliHLTMUONTriggerRecord.h"
 #include "AliHLTMUONMansoTrack.h"
+#include "AliHLTMUONDecision.h"
+#include "TClonesArray.h"
 #include <cassert>
 
-ClassImp(AliHLTMUONEvent);
 ClassImp(AliHLTMUONRootifierComponent);
 
 
 AliHLTMUONRootifierComponent::AliHLTMUONRootifierComponent() :
-       AliHLTProcessor()
+       AliHLTProcessor(),
+       fWarnForUnexpecedBlock(false)
 {
        ///
        /// Default constructor.
@@ -53,13 +56,29 @@ AliHLTMUONRootifierComponent::~AliHLTMUONRootifierComponent()
 }
 
 
-int AliHLTMUONRootifierComponent::DoInit(int /*argc*/, const char** /*argv*/)
+int AliHLTMUONRootifierComponent::DoInit(int argc, const char** argv)
 {
        ///
        /// Inherited from AliHLTComponent.
        /// Parses the command line parameters and initialises the component.
        ///
        
+       HLTInfo("Initialising dHLT rootifier component.");
+       
+       fWarnForUnexpecedBlock = false;
+       
+       for (int i = 0; i < argc; i++)
+       {
+               if (strcmp(argv[i], "-warn_on_unexpected_block") == 0)
+               {
+                       fWarnForUnexpecedBlock = true;
+                       continue;
+               }
+
+               HLTError("Unknown option '%s'.", argv[i]);
+               return -EINVAL;
+       }
+       
        return 0;
 }
 
@@ -70,6 +89,7 @@ int AliHLTMUONRootifierComponent::DoDeinit()
        /// Inherited from AliHLTComponent. Performs a cleanup of the component.
        ///
        
+       HLTInfo("Deinitialising dHLT rootifier component.");
        return 0;
 }
 
@@ -80,7 +100,7 @@ const char* AliHLTMUONRootifierComponent::GetComponentID()
        /// Inherited from AliHLTComponent. Returns the component ID.
        ///
        
-       return "MUONRootifier";
+       return AliHLTMUONConstants::RootifierComponentId();
 }
 
 
@@ -147,12 +167,18 @@ int AliHLTMUONRootifierComponent::DoEvent(
        ///
        
        AliHLTMUONEvent event(evtData.fEventID);
+       const AliHLTComponentBlockData* block = NULL;
 
        // First process the blocks of reconstructed hits and trigger records.
        for (int i = 0; i < GetNumberOfInputBlocks(); i++)
        {
-               const AliHLTComponentBlockData* block = GetInputBlock(i);
+               block = GetInputBlock(i);
                assert( block != NULL );
+               
+               HLTDebug("Handling block: %u, with fDataType = '%s', fPtr = %p and fSize = %u bytes.",
+                       n, DataType2Text(block->fDataType).c_str(), block->fPtr, block->fSize
+               );
+               
                if (block->fDataType == AliHLTMUONConstants::RecHitsBlockDataType())
                {
                        AliHLTUInt8_t* ptr = reinterpret_cast<AliHLTUInt8_t*>(block->fPtr);
@@ -221,8 +247,6 @@ int AliHLTMUONRootifierComponent::DoEvent(
                        for (AliHLTUInt32_t n = 0; n < inblock.Nentries(); n++)
                        {
                                const AliHLTMUONRecHitStruct& h = inblock[n];
-                               //AliHLTMUONRecHit rh(h.fX, h.fY, h.fZ, sourceDDL);
-                               //PushBack(&rh, "ROOTHITS", "MUON");
                                event.Add(new AliHLTMUONRecHit(h.fX, h.fY, h.fZ, sourceDDL));
                        }
                }
@@ -311,165 +335,375 @@ int AliHLTMUONRootifierComponent::DoEvent(
                }
                else
                {
-                       // TODO: ignore for now, but should log an optional message.
+                       if (block->fDataType != AliHLTMUONConstants::MansoTracksBlockDataType() and
+                           block->fDataType != AliHLTMUONConstants::SinglesDecisionBlockDataType() and
+                           block->fDataType != AliHLTMUONConstants::PairsDecisionBlockDataType()
+                          )
+                       {
+                               // Log a message indicating that we got a data block that we
+                               // do not know how to handle.
+                               if (fWarnForUnexpecedBlock)
+                                       HLTWarning("Received a data block of a type we cannot handle: '%s', spec: 0x%X",
+                                               DataType2Text(block->fDataType).c_str(), block->fSpecification
+                                       );
+                               else
+                                       HLTDebug("Received a data block of a type we cannot handle: '%s', spec: 0x%X",
+                                               DataType2Text(block->fDataType).c_str(), block->fSpecification
+                                       );
+                       }
                }
        }
        
        // Now we can look for tracks to add. We needed the ROOT trigger records
        // and reco hits created before we can create track objects.
-       for (int i = 0; i < GetNumberOfInputBlocks(); i++)
+       for (block = GetFirstInputBlock(AliHLTMUONConstants::MansoTracksBlockDataType());
+            block != NULL;
+            block = GetNextInputBlock()
+           )
        {
-               const AliHLTComponentBlockData* block = GetInputBlock(i);
-               assert( block != NULL );
-               if (block->fDataType == AliHLTMUONConstants::MansoTracksBlockDataType())
+               AliHLTUInt8_t* ptr = reinterpret_cast<AliHLTUInt8_t*>(block->fPtr);
+               ptr += block->fOffset;
+               AliHLTMUONMansoTracksBlockReader inblock(ptr, block->fSize);
+               if (not inblock.BufferSizeOk())
                {
-                       AliHLTUInt8_t* ptr = reinterpret_cast<AliHLTUInt8_t*>(block->fPtr);
-                       ptr += block->fOffset;
-                       AliHLTMUONMansoTracksBlockReader inblock(ptr, block->fSize);
-                       if (not inblock.BufferSizeOk())
+                       size_t headerSize = sizeof(AliHLTMUONMansoTracksBlockReader::HeaderType);
+                       if (block->fSize < headerSize)
                        {
-                               size_t headerSize = sizeof(AliHLTMUONMansoTracksBlockReader::HeaderType);
-                               if (block->fSize < headerSize)
-                               {
-                                       HLTError("Received a Manso tracks data block with a size of %d bytes,"
-                                               " which is smaller than the minimum valid header size of %d bytes."
-                                               " The block must be corrupt.",
-                                               block->fSize, headerSize
-                                       );
-                                       continue;
-                               }
-                               
-                               size_t expectedWidth = sizeof(AliHLTMUONMansoTracksBlockReader::ElementType);
-                               if (inblock.CommonBlockHeader().fRecordWidth != expectedWidth)
-                               {
-                                       HLTError("Received a Manso tracks data block with a record"
-                                               " width of %d bytes, but the expected value is %d bytes."
-                                               " The block might be corrupt.",
-                                               block->fSize, headerSize
-                                       );
-                                       continue;
-                               }
-                               
                                HLTError("Received a Manso tracks data block with a size of %d bytes,"
-                                       " but the block header claims the block should be %d bytes."
+                                       " which is smaller than the minimum valid header size of %d bytes."
+                                       " The block must be corrupt.",
+                                       block->fSize, headerSize
+                               );
+                               continue;
+                       }
+                       
+                       size_t expectedWidth = sizeof(AliHLTMUONMansoTracksBlockReader::ElementType);
+                       if (inblock.CommonBlockHeader().fRecordWidth != expectedWidth)
+                       {
+                               HLTError("Received a Manso tracks data block with a record"
+                                       " width of %d bytes, but the expected value is %d bytes."
                                        " The block might be corrupt.",
-                                       block->fSize, inblock.BytesUsed()
+                                       block->fSize, headerSize
                                );
                                continue;
                        }
                        
-                       for (AliHLTUInt32_t n = 0; n < inblock.Nentries(); n++)
+                       HLTError("Received a Manso tracks data block with a size of %d bytes,"
+                               " but the block header claims the block should be %d bytes."
+                               " The block might be corrupt.",
+                               block->fSize, inblock.BytesUsed()
+                       );
+                       continue;
+               }
+               
+               for (AliHLTUInt32_t n = 0; n < inblock.Nentries(); n++)
+               {
+                       const AliHLTMUONMansoTrackStruct& t = inblock[n];
+                       
+                       AliHLTMUONParticleSign sign;
+                       bool hitset[4];
+                       AliHLTMUONUtils::UnpackMansoTrackFlags(
+                                       t.fFlags, sign, hitset
+                               );
+                       
+                       // Try find the trigger record in 'event'.
+                       const AliHLTMUONTriggerRecord* trigrec = NULL;
+                       for (Int_t k = 0; k < event.Array().GetEntriesFast(); k++)
                        {
-                               const AliHLTMUONMansoTrackStruct& t = inblock[n];
-                               
-                               AliHLTMUONParticleSign sign;
-                               bool hitset[4];
-                               AliHLTMUONUtils::UnpackMansoTrackFlags(
-                                               t.fFlags, sign, hitset
-                                       );
-                               
-                               // Try find the trigger record in 'event'.
-                               const AliHLTMUONTriggerRecord* trigrec = NULL;
-                               for (Int_t k = 0; k < event.Array().GetEntriesFast(); k++)
+                               if (event.Array()[k]->IsA() != AliHLTMUONTriggerRecord::Class())
+                                       continue;
+                               const AliHLTMUONTriggerRecord* tk =
+                                       static_cast<const AliHLTMUONTriggerRecord*>(event.Array()[k]);
+                               if (tk->Id() == t.fTrigRec)
                                {
-                                       if (event.Array()[k]->IsA() != AliHLTMUONTriggerRecord::Class())
-                                               continue;
-                                       const AliHLTMUONTriggerRecord* tk =
-                                               static_cast<const AliHLTMUONTriggerRecord*>(event.Array()[k]);
-                                       if (tk->Id() == t.fTrigRec)
-                                       {
-                                               trigrec = tk;
-                                               break;
-                                       }
+                                       trigrec = tk;
+                                       break;
                                }
+                       }
+                       
+                       // Now try find the hits in 'event'.
+                       // If they cannot be found then create new ones.
+                       const AliHLTMUONRecHit* hit7 = NULL;
+                       const AliHLTMUONRecHit* hit8 = NULL;
+                       const AliHLTMUONRecHit* hit9 = NULL;
+                       const AliHLTMUONRecHit* hit10 = NULL;
+                       for (Int_t k = 0; k < event.Array().GetEntriesFast(); k++)
+                       {
+                               if (event.Array()[k]->IsA() != AliHLTMUONRecHit::Class())
+                                       continue;
+                               const AliHLTMUONRecHit* h =
+                                       static_cast<const AliHLTMUONRecHit*>(event.Array()[k]);
                                
-                               // Now try find the hits in 'event'.
-                               // If they cannot be found then create new ones.
-                               const AliHLTMUONRecHit* hit7 = NULL;
-                               const AliHLTMUONRecHit* hit8 = NULL;
-                               const AliHLTMUONRecHit* hit9 = NULL;
-                               const AliHLTMUONRecHit* hit10 = NULL;
-                               for (Int_t k = 0; k < event.Array().GetEntriesFast(); k++)
+                               if (hitset[0] and h->X() == t.fHit[0].fX and h->Y() == t.fHit[0].fY
+                                       and h->Z() == t.fHit[0].fZ)
                                {
-                                       if (event.Array()[k]->IsA() != AliHLTMUONRecHit::Class())
-                                               continue;
-                                       const AliHLTMUONRecHit* h =
-                                               static_cast<const AliHLTMUONRecHit*>(event.Array()[k]);
-                                       
-                                       if (hitset[0] and h->X() == t.fHit[0].fX and h->Y() == t.fHit[0].fY
-                                           and h->Z() == t.fHit[0].fZ)
-                                       {
-                                               hit7 = h;
-                                       }
-                                       if (hitset[1] and h->X() == t.fHit[1].fX and h->Y() == t.fHit[1].fY
-                                           and h->Z() == t.fHit[1].fZ)
-                                       {
-                                               hit8 = h;
-                                       }
-                                       if (hitset[2] and h->X() == t.fHit[2].fX and h->Y() == t.fHit[2].fY
-                                           and h->Z() == t.fHit[2].fZ)
-                                       {
-                                               hit9 = h;
-                                       }
-                                       if (hitset[3] and h->X() == t.fHit[3].fX and h->Y() == t.fHit[3].fY
-                                           and h->Z() == t.fHit[3].fZ)
-                                       {
-                                               hit10 = h;
-                                       }
+                                       hit7 = h;
                                }
-                               AliHLTMUONRecHit* newhit;
-                               if (hitset[0] and hit7 == NULL)
+                               if (hitset[1] and h->X() == t.fHit[1].fX and h->Y() == t.fHit[1].fY
+                                       and h->Z() == t.fHit[1].fZ)
                                {
-                                       newhit = new AliHLTMUONRecHit(t.fHit[0].fX, t.fHit[0].fY, t.fHit[0].fZ);
-                                       event.Add(newhit);
-                                       hit7 = newhit;
+                                       hit8 = h;
                                }
-                               if (hitset[1] and hit8 == NULL)
+                               if (hitset[2] and h->X() == t.fHit[2].fX and h->Y() == t.fHit[2].fY
+                                       and h->Z() == t.fHit[2].fZ)
                                {
-                                       newhit = new AliHLTMUONRecHit(t.fHit[1].fX, t.fHit[1].fY, t.fHit[1].fZ);
-                                       event.Add(newhit);
-                                       hit8 = newhit;
+                                       hit9 = h;
                                }
-                               if (hitset[2] and hit9 == NULL)
+                               if (hitset[3] and h->X() == t.fHit[3].fX and h->Y() == t.fHit[3].fY
+                                       and h->Z() == t.fHit[3].fZ)
                                {
-                                       newhit = new AliHLTMUONRecHit(t.fHit[2].fX, t.fHit[2].fY, t.fHit[2].fZ);
-                                       event.Add(newhit);
-                                       hit9 = newhit;
+                                       hit10 = h;
                                }
-                               if (hitset[3] and hit10 == NULL)
+                       }
+                       AliHLTMUONRecHit* newhit;
+                       if (hitset[0] and hit7 == NULL)
+                       {
+                               newhit = new AliHLTMUONRecHit(t.fHit[0].fX, t.fHit[0].fY, t.fHit[0].fZ);
+                               event.Add(newhit);
+                               hit7 = newhit;
+                       }
+                       if (hitset[1] and hit8 == NULL)
+                       {
+                               newhit = new AliHLTMUONRecHit(t.fHit[1].fX, t.fHit[1].fY, t.fHit[1].fZ);
+                               event.Add(newhit);
+                               hit8 = newhit;
+                       }
+                       if (hitset[2] and hit9 == NULL)
+                       {
+                               newhit = new AliHLTMUONRecHit(t.fHit[2].fX, t.fHit[2].fY, t.fHit[2].fZ);
+                               event.Add(newhit);
+                               hit9 = newhit;
+                       }
+                       if (hitset[3] and hit10 == NULL)
+                       {
+                               newhit = new AliHLTMUONRecHit(t.fHit[3].fX, t.fHit[3].fY, t.fHit[3].fZ);
+                               event.Add(newhit);
+                               hit10 = newhit;
+                       }
+               
+                       AliHLTMUONMansoTrack* tr = new AliHLTMUONMansoTrack(
+                                       t.fId, sign, t.fPx, t.fPy, t.fPz, t.fChi2,
+                                       trigrec, hit7, hit8, hit9, hit10
+                               );
+                       event.Add(tr);
+               }
+       }
+       
+       UInt_t numLowPt = 0;
+       UInt_t numHighPt = 0;
+       TClonesArray singlesDecisions("AliHLTMUONDecision::AliTrackDecision");
+       
+       // Find the single tracks decision blocks and add their information.
+       // We just sum the trigger scalars and single decisions.
+       for (block = GetFirstInputBlock(AliHLTMUONConstants::SinglesDecisionBlockDataType());
+            block != NULL;
+            block = GetNextInputBlock()
+           )
+       {
+               AliHLTUInt8_t* ptr = reinterpret_cast<AliHLTUInt8_t*>(block->fPtr);
+               ptr += block->fOffset;
+               AliHLTMUONSinglesDecisionBlockReader inblock(ptr, block->fSize);
+               if (not inblock.BufferSizeOk())
+               {
+                       size_t headerSize = sizeof(AliHLTMUONSinglesDecisionBlockReader::HeaderType);
+                       if (block->fSize < headerSize)
+                       {
+                               HLTError("Received a single tracks trigger decision data block with a size of %d bytes,"
+                                       " which is smaller than the minimum valid header size of %d bytes."
+                                       " The block must be corrupt.",
+                                       block->fSize, headerSize
+                               );
+                               continue;
+                       }
+                       
+                       size_t expectedWidth = sizeof(AliHLTMUONSinglesDecisionBlockReader::ElementType);
+                       if (inblock.CommonBlockHeader().fRecordWidth != expectedWidth)
+                       {
+                               HLTError("Received a single tracks trigger decision data block with a record"
+                                       " width of %d bytes, but the expected value is %d bytes."
+                                       " The block might be corrupt.",
+                                       block->fSize, headerSize
+                               );
+                               continue;
+                       }
+                       
+                       HLTError("Received a single tracks trigger decision data block with a size of %d bytes,"
+                               " but the block header claims the block should be %d bytes."
+                               " The block might be corrupt.",
+                               block->fSize, inblock.BytesUsed()
+                       );
+                       continue;
+               }
+               
+               numLowPt += inblock.BlockHeader().fNlowPt;
+               numHighPt += inblock.BlockHeader().fNhighPt;
+               
+               for (AliHLTUInt32_t n = 0; n < inblock.Nentries(); n++)
+               {
+                       const AliHLTMUONTrackDecisionStruct& t = inblock[n];
+                       
+                       bool highPt, lowPt;
+                       AliHLTMUONUtils::UnpackTrackDecisionBits(t.fTriggerBits, highPt, lowPt);
+                       
+                       // Try find the corresponding track in the 'event'.
+                       const AliHLTMUONMansoTrack* track = NULL;
+                       for (Int_t k = 0; k < event.Array().GetEntriesFast(); k++)
+                       {
+                               if (event.Array()[k]->IsA() != AliHLTMUONMansoTrack::Class())
+                                       continue;
+                               const AliHLTMUONMansoTrack* tk =
+                                       static_cast<const AliHLTMUONMansoTrack*>(event.Array()[k]);
+                               if (tk->Id() == t.fTrackId)
                                {
-                                       newhit = new AliHLTMUONRecHit(t.fHit[3].fX, t.fHit[3].fY, t.fHit[3].fZ);
-                                       event.Add(newhit);
-                                       hit10 = newhit;
+                                       track = tk;
+                                       break;
                                }
+                       }
                        
-                               AliHLTMUONMansoTrack* tr = new AliHLTMUONMansoTrack(
-                                               t.fId, sign, t.fPx, t.fPy, t.fPz, t.fChi2,
-                                               trigrec, hit7, hit8, hit9, hit10
-                                       );
+                       // If the track was not found then create a dummy one.
+                       if (track == NULL)
+                       {
+                               AliHLTMUONMansoTrack* tr = new AliHLTMUONMansoTrack(t.fTrackId);
                                event.Add(tr);
+                               track = tr;
                        }
+                       
+                       new (singlesDecisions[singlesDecisions.GetEntriesFast()])
+                               AliHLTMUONDecision::AliTrackDecision(t.fPt, lowPt, highPt, track);
                }
-               else
+       }
+       
+       UInt_t numUnlikeAnyPt = 0;
+       UInt_t numUnlikeLowPt = 0;
+       UInt_t numUnlikeHighPt = 0;
+       UInt_t numLikeAnyPt = 0;
+       UInt_t numLikeLowPt = 0;
+       UInt_t numLikeHighPt = 0;
+       UInt_t numAnyMass = 0;
+       UInt_t numLowMass = 0;
+       UInt_t numHighMass = 0;
+       TClonesArray pairsDecisions("AliHLTMUONDecision::AliPairDecision");
+       
+       // Find the track pairs decision blocks and add their information.
+       // We just sum the trigger scalars and track pair decisions.
+       for (block = GetFirstInputBlock(AliHLTMUONConstants::PairsDecisionBlockDataType());
+            block != NULL;
+            block = GetNextInputBlock()
+           )
+       {
+               AliHLTUInt8_t* ptr = reinterpret_cast<AliHLTUInt8_t*>(block->fPtr);
+               ptr += block->fOffset;
+               AliHLTMUONPairsDecisionBlockReader inblock(ptr, block->fSize);
+               if (not inblock.BufferSizeOk())
                {
-                       // TODO: ignore for now, but should log an optional message.
+                       size_t headerSize = sizeof(AliHLTMUONPairsDecisionBlockReader::HeaderType);
+                       if (block->fSize < headerSize)
+                       {
+                               HLTError("Received a track pairs trigger decision data block with a size of %d bytes,"
+                                       " which is smaller than the minimum valid header size of %d bytes."
+                                       " The block must be corrupt.",
+                                       block->fSize, headerSize
+                               );
+                               continue;
+                       }
+                       
+                       size_t expectedWidth = sizeof(AliHLTMUONPairsDecisionBlockReader::ElementType);
+                       if (inblock.CommonBlockHeader().fRecordWidth != expectedWidth)
+                       {
+                               HLTError("Received a track pairs trigger decision data block with a record"
+                                       " width of %d bytes, but the expected value is %d bytes."
+                                       " The block might be corrupt.",
+                                       block->fSize, headerSize
+                               );
+                               continue;
+                       }
+                       
+                       HLTError("Received a track pairs trigger decision data block with a size of %d bytes,"
+                               " but the block header claims the block should be %d bytes."
+                               " The block might be corrupt.",
+                               block->fSize, inblock.BytesUsed()
+                       );
+                       continue;
                }
+               
+               numUnlikeAnyPt += inblock.BlockHeader().fNunlikeAnyPt;
+               numUnlikeLowPt += inblock.BlockHeader().fNunlikeLowPt;
+               numUnlikeHighPt += inblock.BlockHeader().fNunlikeHighPt;
+               numLikeAnyPt += inblock.BlockHeader().fNlikeAnyPt;
+               numLikeLowPt += inblock.BlockHeader().fNlikeLowPt;
+               numLikeHighPt += inblock.BlockHeader().fNlikeHighPt;
+               numAnyMass += inblock.BlockHeader().fNmassAny;
+               numLowMass += inblock.BlockHeader().fNmassLow;
+               numHighMass += inblock.BlockHeader().fNmassHigh;
+               
+               for (AliHLTUInt32_t n = 0; n < inblock.Nentries(); n++)
+               {
+                       const AliHLTMUONPairDecisionStruct& t = inblock[n];
+                       
+                       bool highMass, lowMass, unlike;
+                       AliHLTUInt8_t highPtCount, lowPtCount;
+                       AliHLTMUONUtils::UnpackPairDecisionBits(
+                                       t.fTriggerBits, highMass, lowMass, unlike,
+                                       highPtCount, lowPtCount
+                               );
+                       
+                       // Try find the corresponding tracks in the 'event'.
+                       const AliHLTMUONMansoTrack* trackA = NULL;
+                       const AliHLTMUONMansoTrack* trackB = NULL;
+                       for (Int_t k = 0; k < event.Array().GetEntriesFast(); k++)
+                       {
+                               if (event.Array()[k]->IsA() != AliHLTMUONMansoTrack::Class())
+                                       continue;
+                               const AliHLTMUONMansoTrack* tk =
+                                       static_cast<const AliHLTMUONMansoTrack*>(event.Array()[k]);
+                               if (tk->Id() == t.fTrackAId) trackA = tk;
+                               if (tk->Id() == t.fTrackBId) trackB = tk;
+                               if (trackA != NULL and trackB != NULL) break;
+                       }
+                       
+                       // If either of the tracks was not found then create a dummy one.
+                       if (trackA == NULL)
+                       {
+                               AliHLTMUONMansoTrack* tr = new AliHLTMUONMansoTrack(t.fTrackAId);
+                               event.Add(tr);
+                               trackA = tr;
+                       }
+                       if (trackB == NULL)
+                       {
+                               AliHLTMUONMansoTrack* tr = new AliHLTMUONMansoTrack(t.fTrackBId);
+                               event.Add(tr);
+                               trackB = tr;
+                       }
+                       
+                       new (pairsDecisions[pairsDecisions.GetEntriesFast()])
+                               AliHLTMUONDecision::AliPairDecision(
+                                       t.fInvMass, lowMass, highMass, unlike,
+                                       lowPtCount, highPtCount, trackA, trackB
+                               );
+               }
+       }
+       
+       AliHLTMUONDecision* triggerDecision = new AliHLTMUONDecision(
+                       numLowPt, numHighPt, numUnlikeAnyPt, numUnlikeLowPt,
+                       numUnlikeHighPt, numLikeAnyPt, numLikeLowPt,
+                       numLikeHighPt, numAnyMass, numLowMass, numHighMass
+               );
+       for (Int_t i = 0; i < singlesDecisions.GetEntriesFast(); i++)
+       {
+               AliHLTMUONDecision::AliTrackDecision* decision =
+                       static_cast<AliHLTMUONDecision::AliTrackDecision*>( singlesDecisions[i] );
+               triggerDecision->AddDecision(decision);
        }
+       for (Int_t j = 0; j < pairsDecisions.GetEntriesFast(); j++)
+       {
+               AliHLTMUONDecision::AliPairDecision* decision =
+                       static_cast<AliHLTMUONDecision::AliPairDecision*>( pairsDecisions[j] );
+               triggerDecision->AddDecision(decision);
+       }
+       event.Add(triggerDecision);
        
        PushBack(&event, "ROOTEVNT", "MUON");
        
        return 0;
 }
 
-
-void AliHLTMUONEvent::Print(Option_t* option) const
-{
-       ///
-       /// Inherited from TObject. Prints the contents of the event objects in fArray.
-       ///
-       
-       cout << "################## EVENT: " << fEventId << " ##################" << endl;
-       for (Int_t i = 0; i < fArray.GetEntriesFast(); i++)
-               if (fArray[i] != NULL) fArray[i]->Print(option);
-}
-
index 0206cc3ef669369d1ec77bcc1f32a64d8d96ce05..7cb884eac31d2513663ad1dc7f3b9c17e6e5b1ec 100644 (file)
@@ -9,44 +9,12 @@
 ///
 /// @file   AliHLTMUONRootifierComponent.h
 /// @author Artur Szostak <artursz@iafrica.com>
-/// @date   
+/// @date   29 Sep 2007
 /// @brief  Component for converting dHLT raw data into ROOT objects.
 ///
 
 #include "AliHLTProcessor.h"
 
-// Temporary solution for grouping together objects for the same event.
-#include "TObjArray.h"
-
-class AliHLTMUONEvent : public TObject
-{
-public:
-
-       AliHLTMUONEvent(AliHLTEventID_t eventId = AliHLTEventID_t(-1))
-         : fEventId(eventId), fArray()
-       {
-               fArray.SetOwner(kTRUE);
-       }
-       
-       virtual ~AliHLTMUONEvent() {}
-       
-       AliHLTEventID_t EventID() const { return fEventId; }
-       const TObjArray& Array() const { return fArray; }
-       
-       // Takes ownership of the object.
-       void Add(TObject* obj) { fArray.Add(obj); }
-       
-       virtual void Print(Option_t* option = NULL) const;
-
-private:
-
-       AliHLTEventID_t fEventId;  // The event ID.
-       TObjArray fArray;          // Array of event objects.
-       
-       ClassDef(AliHLTMUONEvent, 1); // Container class for dHLT event results.
-};
-
-
 /**
  * Converts dHLT raw data blocks into ROOT objects.
  */
@@ -78,6 +46,8 @@ private:
        // Prevent copying of these objects.
        AliHLTMUONRootifierComponent(const AliHLTMUONRootifierComponent& /*object*/);
        AliHLTMUONRootifierComponent& operator = (const AliHLTMUONRootifierComponent& /*object*/);
+       
+       bool fWarnForUnexpecedBlock;  /// Flag indicating if we should log a warning if we got a block of an unexpected type.
 
        ClassDef(AliHLTMUONRootifierComponent, 0); // Converter component of dHLT raw data.
 };
index a18e37a491d7989003de2ece6840a2f85168da36..fc928e8d0da6228e6bb1c95611a20892e1e62ee5 100644 (file)
@@ -331,6 +331,10 @@ int AliHLTMUONDecisionComponent::DoEvent(
        fTrackCount = 0; // reset number of tracks in array.
        for (AliHLTUInt32_t n = 0; n < evtData.fBlockCnt; n++)
        {
+               HLTDebug("Handling block: %u, with fDataType = '%s', fPtr = %p and fSize = %u bytes.",
+                       n, DataType2Text(blocks[n].fDataType).c_str(), blocks[n].fPtr, blocks[n].fSize
+               );
+               
                if (blocks[n].fDataType == AliHLTMUONConstants::MansoTracksBlockDataType())
                {
                        // Build up the specification which indicates what DDLs
@@ -380,26 +384,17 @@ int AliHLTMUONDecisionComponent::DoEvent(
                                }
                        }
                }
-               else if (blocks[n].fDataType != AliHLTMUONConstants::MansoTracksBlockDataType())
+               else
                {
                        // Log a message indicating that we got a data block that we
                        // do not know how to handle.
-                       char id[kAliHLTComponentDataTypefIDsize+1];
-                       for (int i = 0; i < kAliHLTComponentDataTypefIDsize; i++)
-                               id[i] = blocks[n].fDataType.fID[i];
-                       id[kAliHLTComponentDataTypefIDsize] = '\0';
-                       char origin[kAliHLTComponentDataTypefOriginSize+1];
-                       for (int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++)
-                               origin[i] = blocks[n].fDataType.fOrigin[i];
-                       origin[kAliHLTComponentDataTypefOriginSize] = '\0';
-                       
                        if (fWarnForUnexpecedBlock)
-                               HLTWarning("Received a data block of a type we cannot handle: %s origin: %s",
-                                       static_cast<char*>(id), static_cast<char*>(origin)
+                               HLTWarning("Received a data block of a type we cannot handle: '%s', spec: 0x%X",
+                                       DataType2Text(blocks[n].fDataType).c_str(), blocks[n].fSpecification
                                );
                        else
-                               HLTDebug("Received a data block of a type we cannot handle: %s origin: %s",
-                                       static_cast<char*>(id), static_cast<char*>(origin)
+                               HLTDebug("Received a data block of a type we cannot handle: '%s', spec: 0x%X",
+                                       DataType2Text(blocks[n].fDataType).c_str(), blocks[n].fSpecification
                                );
                }
        }
index c8e05ac47b357387b99384448872ae67101cfc54..500b32a94830a8702c338f8e9cf820a3089bfdc2 100644 (file)
@@ -347,22 +347,10 @@ int AliHLTMUONHitReconstructorComponent::DoEvent(
        );
 
        // Loop over all input blocks in the event
-       for ( unsigned long n = 0; n < evtData.fBlockCnt; n++ )
-       {
-#ifdef __DEBUG
-               char id[kAliHLTComponentDataTypefIDsize+1];
-               for (int i = 0; i < kAliHLTComponentDataTypefIDsize; i++)
-                       id[i] = blocks[n].fDataType.fID[i];
-               id[kAliHLTComponentDataTypefIDsize] = '\0';
-               char origin[kAliHLTComponentDataTypefOriginSize+1];
-               for (int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++)
-                       origin[i] = blocks[n].fDataType.fOrigin[i];
-               origin[kAliHLTComponentDataTypefOriginSize] = '\0';
-#endif // __DEBUG
-               HLTDebug("Handling block: %u, with fDataType.fID = '%s',"
-                         " fDataType.fID = '%s', fPtr = %p and fSize = %u bytes.",
-                       n, static_cast<char*>(id), static_cast<char*>(origin),
-                       blocks[n].fPtr, blocks[n].fSize
+       for (AliHLTUInt32_t n = 0; n < evtData.fBlockCnt; n++)
+       {
+               HLTDebug("Handling block: %u, with fDataType = '%s', fPtr = %p and fSize = %u bytes.",
+                       n, DataType2Text(blocks[n].fDataType).c_str(), blocks[n].fPtr, blocks[n].fSize
                );
 
                if (blocks[n].fDataType != AliHLTMUONConstants::DDLRawDataType()
@@ -371,22 +359,13 @@ int AliHLTMUONHitReconstructorComponent::DoEvent(
                {
                        // Log a message indicating that we got a data block that we
                        // do not know how to handle.
-                       char id[kAliHLTComponentDataTypefIDsize+1];
-                       for (int i = 0; i < kAliHLTComponentDataTypefIDsize; i++)
-                               id[i] = blocks[n].fDataType.fID[i];
-                       id[kAliHLTComponentDataTypefIDsize] = '\0';
-                       char origin[kAliHLTComponentDataTypefOriginSize+1];
-                       for (int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++)
-                               origin[i] = blocks[n].fDataType.fOrigin[i];
-                       origin[kAliHLTComponentDataTypefOriginSize] = '\0';
-                       
                        if (fWarnForUnexpecedBlock)
-                               HLTWarning("Received a data block of a type we cannot handle: '%s' origin: '%s' spec: 0x%X",
-                                       static_cast<char*>(id), static_cast<char*>(origin), blocks[n].fSpecification
+                               HLTWarning("Received a data block of a type we cannot handle: '%s', spec: 0x%X",
+                                       DataType2Text(blocks[n].fDataType).c_str(), blocks[n].fSpecification
                                );
                        else
-                               HLTDebug("Received a data block of a type we cannot handle: '%s' origin: '%s' spec: 0x%X",
-                                       static_cast<char*>(id), static_cast<char*>(origin), blocks[n].fSpecification
+                               HLTDebug("Received a data block of a type we cannot handle: '%s', spec: 0x%X",
+                                       DataType2Text(blocks[n].fDataType).c_str(), blocks[n].fSpecification
                                );
                        
                        continue;
index 5d6f607247f7a990eba0cd940d53d29ea0b30c55..86df660b5a2f96b6c1c8b4fc6e6ac3caead7d2f2 100644 (file)
@@ -291,6 +291,10 @@ int AliHLTMUONMansoTrackerFSMComponent::DoEvent(
        // records are ignored for now and will be processed later.
        for (AliHLTUInt32_t n = 0; n < evtData.fBlockCnt; n++)
        {
+               HLTDebug("Handling block: %u, with fDataType = '%s', fPtr = %p and fSize = %u bytes.",
+                       n, DataType2Text(blocks[n].fDataType).c_str(), blocks[n].fPtr, blocks[n].fSize
+               );
+               
                if (blocks[n].fDataType == AliHLTMUONConstants::RecHitsBlockDataType())
                {
                        specification |= blocks[n].fSpecification;
@@ -343,22 +347,13 @@ int AliHLTMUONMansoTrackerFSMComponent::DoEvent(
                {
                        // Log a message indicating that we got a data block that we
                        // do not know how to handle.
-                       char id[kAliHLTComponentDataTypefIDsize+1];
-                       for (int i = 0; i < kAliHLTComponentDataTypefIDsize; i++)
-                               id[i] = blocks[n].fDataType.fID[i];
-                       id[kAliHLTComponentDataTypefIDsize] = '\0';
-                       char origin[kAliHLTComponentDataTypefOriginSize+1];
-                       for (int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++)
-                               origin[i] = blocks[n].fDataType.fOrigin[i];
-                       origin[kAliHLTComponentDataTypefOriginSize] = '\0';
-                       
                        if (fWarnForUnexpecedBlock)
-                               HLTWarning("Received a data block of a type we cannot handle: %s origin: %s",
-                                       static_cast<char*>(id), static_cast<char*>(origin)
+                               HLTWarning("Received a data block of a type we cannot handle: '%s', spec: 0x%X",
+                                       DataType2Text(blocks[n].fDataType).c_str(), blocks[n].fSpecification
                                );
                        else
-                               HLTDebug("Received a data block of a type we cannot handle: %s origin: %s",
-                                       static_cast<char*>(id), static_cast<char*>(origin)
+                               HLTDebug("Received a data block of a type we cannot handle: '%s', spec: 0x%X",
+                                       DataType2Text(blocks[n].fDataType).c_str(), blocks[n].fSpecification
                                );
                }
        }
index 3730af0e815f6d830eae370ac794a5d1a312ccf5..2a70a3ef444e5abbe3332a2a48c385c01f3cf752 100644 (file)
@@ -366,20 +366,8 @@ int AliHLTMUONTriggerReconstructorComponent::DoEvent(
        // reconstruction algorithm on the raw data.
        for (AliHLTUInt32_t n = 0; n < evtData.fBlockCnt; n++)
        {
-#ifdef __DEBUG
-               char id[kAliHLTComponentDataTypefIDsize+1];
-               for (int i = 0; i < kAliHLTComponentDataTypefIDsize; i++)
-                       id[i] = blocks[n].fDataType.fID[i];
-               id[kAliHLTComponentDataTypefIDsize] = '\0';
-               char origin[kAliHLTComponentDataTypefOriginSize+1];
-               for (int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++)
-                       origin[i] = blocks[n].fDataType.fOrigin[i];
-               origin[kAliHLTComponentDataTypefOriginSize] = '\0';
-#endif // __DEBUG
-               HLTDebug("Handling block: %u, with fDataType.fID = '%s',"
-                         " fDataType.fID = '%s', fPtr = %p and fSize = %u bytes.",
-                       n, static_cast<char*>(id), static_cast<char*>(origin),
-                       blocks[n].fPtr, blocks[n].fSize
+               HLTDebug("Handling block: %u, with fDataType = '%s', fPtr = %p and fSize = %u bytes.",
+                       n, DataType2Text(blocks[n].fDataType).c_str(), blocks[n].fPtr, blocks[n].fSize
                );
 
                if (blocks[n].fDataType != AliHLTMUONConstants::DDLRawDataType()
@@ -388,22 +376,13 @@ int AliHLTMUONTriggerReconstructorComponent::DoEvent(
                {
                        // Log a message indicating that we got a data block that we
                        // do not know how to handle.
-                       char id[kAliHLTComponentDataTypefIDsize+1];
-                       for (int i = 0; i < kAliHLTComponentDataTypefIDsize; i++)
-                               id[i] = blocks[n].fDataType.fID[i];
-                       id[kAliHLTComponentDataTypefIDsize] = '\0';
-                       char origin[kAliHLTComponentDataTypefOriginSize+1];
-                       for (int i = 0; i < kAliHLTComponentDataTypefOriginSize; i++)
-                               origin[i] = blocks[n].fDataType.fOrigin[i];
-                       origin[kAliHLTComponentDataTypefOriginSize] = '\0';
-                       
                        if (fWarnForUnexpecedBlock)
-                               HLTWarning("Received a data block of a type we cannot handle: '%s' origin: '%s' spec: 0x%X",
-                                       static_cast<char*>(id), static_cast<char*>(origin), blocks[n].fSpecification
+                               HLTWarning("Received a data block of a type we cannot handle: '%s', spec: 0x%X",
+                                       DataType2Text(blocks[n].fDataType).c_str(), blocks[n].fSpecification
                                );
                        else
-                               HLTDebug("Received a data block of a type we cannot handle: '%s' origin: '%s' spec: 0x%X",
-                                       static_cast<char*>(id), static_cast<char*>(origin), blocks[n].fSpecification
+                               HLTDebug("Received a data block of a type we cannot handle: '%s', spec: 0x%X",
+                                       DataType2Text(blocks[n].fDataType).c_str(), blocks[n].fSpecification
                                );
                        
                        continue;
index 214d7be25a72ec1d14b8ecec2902d587f28409f1..36b60071758e3b978e05203c1325ed9d0255c328 100644 (file)
@@ -14,7 +14,9 @@ CLASS_HDRS :=         OfflineInterface/AliHLTMUONAgent.h \
                utils/AliHLTMUONEmptyEventFilterComponent.h \
                AliHLTMUONRecHit.h \
                AliHLTMUONTriggerRecord.h \
-               AliHLTMUONMansoTrack.h
+               AliHLTMUONMansoTrack.h \
+               AliHLTMUONDecision.h \
+               AliHLTMUONEvent.h
 
 # Sources that are not ROOT classes:
 MODULE_SRCS := $(CLASS_HDRS:.h=.cxx) \