]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/MUON/AliHLTMUONUtils.h
Using common loading methods for CDB entries that take care of missing subversion...
[u/mrichter/AliRoot.git] / HLT / MUON / AliHLTMUONUtils.h
index 6f18626a57b2d547640996187fd5fe8241a26012..48cf384020d52c88400f3e318985084a0e64031f 100644 (file)
@@ -32,6 +32,8 @@ struct AliHLTMUONMansoTrackStruct;
 struct AliHLTMUONMansoTracksBlockStruct;
 struct AliHLTMUONMansoCandidateStruct;
 struct AliHLTMUONMansoCandidatesBlockStruct;
+struct AliHLTMUONTrackStruct;
+struct AliHLTMUONTracksBlockStruct;
 struct AliHLTMUONTrackDecisionStruct;
 struct AliHLTMUONSinglesDecisionBlockStruct;
 struct AliHLTMUONPairDecisionStruct;
@@ -97,6 +99,15 @@ public:
                        AliHLTUInt16_t& detElemId // [out]
                );
 
+       /**
+        * Returns the detector element ID from the flags bits.
+        * [in]  @param flags  The flags from an AliHLTMUONRecHitStruct structure.
+        */
+       static AliHLTUInt16_t GetDetElemIdFromFlags(AliHLTUInt32_t flags)
+       {
+               return flags & 0xFFF;
+       }
+
        /**
         * This packs the given parameters into the bits of a word appropriate
         * for AliHLTMUONMansoTrackStruct::fFlags.
@@ -128,6 +139,32 @@ public:
        {
                UnpackTriggerRecordFlags(flags, sign, hitset);
        }
+
+       /**
+        * This packs the given parameters into the bits of a word appropriate
+        * for AliHLTMUONTrackStruct::fFlags.
+        * @param sign    The particle sign.
+        * @param hitset  Flags to indicate if the corresponding fHits[i] elements
+        *                was set/filled.
+        * @return  Returns the 32 bit packed word.
+        */
+       static AliHLTUInt32_t PackTrackFlags(
+                       AliHLTMUONParticleSign sign, const bool hitset[16]
+               );
+
+       /**
+        * This unpacks the AliHLTMUONTrackStruct::fFlags bits into
+        * its component fields.
+        * @param flags  The flags from an AliHLTMUONTrackStruct structure.
+        * @param sign    Sets this to the particle sign.
+        * @param hitset  Sets the array elements to indicate if the corresponding
+        *                fHits[i] element was set/filled.
+        */
+       static void UnpackTrackFlags(
+                       AliHLTUInt32_t flags, // [in]
+                       AliHLTMUONParticleSign& sign, // [out]
+                       bool hitset[16] // [out]
+               );
        
        /**
         * This packs the given parameters into the bits of a word appropriate
@@ -372,6 +409,8 @@ public:
                kDataWordDifferent, ///< The raw data word is different from the unpacked values.
                kChiSquareInvalid,  ///< The chi squared value must be a positive value or -1 indicating a fitting error.
                kMomentumVectorNotZero, ///< The chi sqaured value is set to -1, but momentum vector not zero.
+               kMomentumParamsNotZero, ///< The chi sqaured value is set to -1, but fitted momentum parameters are not zero.
+               kDCAVertexNotZero, ///< The chi sqaured value is set to -1, but DCA vertex is not zero.
                kRoiRadiusInvalid, ///< The region of interest radius is invalid.
                kHitNotWithinRoi, ///< A tracks hit is not within the corresponding region of interest.
                kPtValueNotValid,  ///< The pT value is not positive nor -1 indicating an invalid value.
@@ -521,6 +560,24 @@ public:
                return HeaderOk(block, reason, count);
        }
        
+       /**
+        * Method used to check if the header information corresponds to the
+        * supposed type of the tracks data block given.
+        * This method will return either kHeaderContainsWrongType or
+        * kHeaderContainsWrongRecordWidth as the reason code.
+        * [in]  \param block  The data block to check.
+        * [out] \param reason  If this is not NULL, then the variable pointed to
+        *      by this pointer will be filled with the reason code describing why
+        *      the header is not valid, if and only if a problem is found with
+        *      the data.
+        * \returns  true if there is no problem with the header and false otherwise.
+        */
+       static bool HeaderOk(const AliHLTMUONTracksBlockStruct& block, WhyNotValid* reason = NULL)
+       {
+               AliHLTUInt32_t count = 1;
+               return HeaderOk(block, reason, count);
+       }
+       
        /**
         * Method used to check if the header information corresponds to the
         * supposed type of the single tracks dHLT trigger decision data block.
@@ -601,6 +658,11 @@ public:
                        WhyNotValid* reason, AliHLTUInt32_t& reasonCount
                );
        
+       static bool HeaderOk(
+                       const AliHLTMUONTracksBlockStruct& block,
+                       WhyNotValid* reason, AliHLTUInt32_t& reasonCount
+               );
+       
        static bool HeaderOk(
                        const AliHLTMUONSinglesDecisionBlockStruct& block,
                        WhyNotValid* reason, AliHLTUInt32_t& reasonCount
@@ -891,6 +953,46 @@ public:
                return IntegrityOk(block, reason, recordNum, count);
        }
        
+       /**
+        * This method is used to check more extensively if the integrity of the
+        * full track structure is OK and returns true in that case.
+        * [in] \param track  The track structure to check.
+        * [out] \param reason  If this is not NULL, then it will be filled with
+        *      the reason code describing why the structure is not valid, if and
+        *      only if a problem is found with the data.
+        * \returns  true if there is no problem with the structure and false otherwise.
+        */
+       static bool IntegrityOk(
+                       const AliHLTMUONTrackStruct& track,
+                       WhyNotValid* reason = NULL
+               )
+       {
+               AliHLTUInt32_t count = 1;
+               return IntegrityOk(track, reason, count);
+       }
+       
+       /**
+        * This method is used to check more extensively if the integrity of the
+        * dHLT raw internal data block is OK and returns true in that case.
+        * [in] \param block  The track data block to check.
+        * [out] \param reason  If this is not NULL, then it will be filled with
+        *      the reason code describing why the data block is not valid, if and
+        *      only if a problem is found with the data.
+        * [out] \param recordNum  If this is not NULL, then it will be filled with
+        *      the number of the Manso track structure that had a problem.
+        *      This value will only contain a valid value if the method
+        *      RecordNumberWasSet(*reason) returns true. Thus, 'reason' must be set.
+        * \returns  true if there is no problem with the data and false otherwise.
+        */
+       static bool IntegrityOk(
+                       const AliHLTMUONTracksBlockStruct& block,
+                       WhyNotValid* reason = NULL, AliHLTUInt32_t* recordNum = NULL
+               )
+       {
+               AliHLTUInt32_t count = 1;
+               return IntegrityOk(block, reason, recordNum, count);
+       }
+       
        /**
         * This method is used to check more extensively if the integrity of the
         * single track trigger decision structure is OK and returns true in that case.
@@ -1055,6 +1157,17 @@ public:
                        AliHLTUInt32_t& reasonCount
                );
        
+       static bool IntegrityOk(
+                       const AliHLTMUONTrackStruct& track,
+                       WhyNotValid* reason, AliHLTUInt32_t& reasonCount
+               );
+       
+       static bool IntegrityOk(
+                       const AliHLTMUONTracksBlockStruct& block,
+                       WhyNotValid* reason, AliHLTUInt32_t* recordNum,
+                       AliHLTUInt32_t& reasonCount
+               );
+       
        static bool IntegrityOk(
                        const AliHLTMUONTrackDecisionStruct& decision,
                        WhyNotValid* reason, AliHLTUInt32_t& reasonCount