In reconstruction:
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 30 Jun 2010 08:59:48 +0000 (08:59 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 30 Jun 2010 08:59:48 +0000 (08:59 +0000)
Removed option for creating trigger digits in AliMUONReconstructor,
as they are needed in AliMUONTrackHitPattern; this avoids re-creating
digit store with each event and fixes the problem report #69261
(improper use of TClonesArray).
(Diego)

MUON/AliMUONReconstructor.cxx
MUON/AliMUONTrackHitPattern.cxx
MUON/AliMUONTrackHitPattern.h
MUON/AliMUONTracker.cxx
MUON/AliMUONTracker.h

index 05ef314..1c45f8e 100644 (file)
@@ -276,10 +276,11 @@ AliMUONReconstructor::CreateDigitMaker() const
 
   fDigitMaker = new AliMUONDigitMaker(enableErrorLogging);
   option.ToUpper();
-  if ( option.Contains("SAVEDIGITS" ))
-    {
-      fDigitMaker->SetMakeTriggerDigits(kTRUE);
-    }
+
+  // Always make trigger digits
+  // (needed when calculating trigger chamber efficiency)
+  fDigitMaker->SetMakeTriggerDigits(kTRUE);
+
   if ( GetRecoParam()->TryRecover() )
   {
     fDigitMaker->SetTryRecover(kTRUE);
@@ -310,7 +311,6 @@ AliMUONReconstructor::CreateTracker() const
   /// Create the MUONTracker object
   
   CreateTriggerCircuit();
-  CreateDigitMaker();
   CreateClusterServer();
 
   AliMUONTracker* tracker(0x0);
@@ -320,7 +320,6 @@ AliMUONReconstructor::CreateTracker() const
     tracker = new AliMUONTracker(GetRecoParam(),
                                 0x0,
                                  *DigitStore(),
-                                 fDigitMaker,
                                  fTransformer,
                                  fTriggerCircuit);
   }
@@ -329,7 +328,6 @@ AliMUONReconstructor::CreateTracker() const
     tracker = new AliMUONTracker(GetRecoParam(),
                                 fClusterServer,
                                  *DigitStore(),
-                                 fDigitMaker,
                                  fTransformer,
                                  fTriggerCircuit);
   }
index 3370532..ac3c015 100644 (file)
@@ -35,8 +35,7 @@
 
 #include "AliMUONConstants.h"
 #include "AliMUONVDigit.h"
-#include "AliMUONDigitMaker.h"
-#include "AliMUONDigitStoreV1.h"
+#include "AliMUONVDigitStore.h"
 #include "AliMUONGeometryTransformer.h"
 #include "AliMUONLocalTrigger.h"
 #include "AliMUONLocalTriggerBoard.h"
@@ -81,11 +80,11 @@ ClassImp(AliMUONTrackHitPattern) // Class implementation in ROOT context
 //______________________________________________________________________________
 AliMUONTrackHitPattern::AliMUONTrackHitPattern(const AliMUONRecoParam* recoParam,
                                                const AliMUONGeometryTransformer& transformer,
-                                               const AliMUONDigitMaker& digitMaker)
+                                               const AliMUONVDigitStore& digitStore)
 : TObject(),
 fkRecoParam(recoParam),
 fkTransformer(transformer),
-fkDigitMaker(digitMaker),
+fkDigitStore(digitStore),
 fkMaxDistance(99999.)
 {
     /// Default constructor
@@ -121,14 +120,11 @@ void AliMUONTrackHitPattern::ExecuteValidation(const AliMUONVTrackStore& trackSt
   /// and searches for matching trigger tracks and digits
   //
 
-  AliMUONDigitStoreV1 digitStore;
-  fkDigitMaker.TriggerToDigitsStore(triggerStore,digitStore);
-
   // Get the hit pattern for all trigger tracks
   AliMUONTriggerTrack* triggerTrack;
   TIter itTriggerTrack(triggerTrackStore.CreateIterator());
   while ( ( triggerTrack = static_cast<AliMUONTriggerTrack*>(itTriggerTrack() ) ) ){
-    UShort_t pattern = GetHitPattern(triggerTrack, digitStore);
+    UShort_t pattern = GetHitPattern(triggerTrack);
     triggerTrack->SetHitsPatternInTrigCh(pattern);
     AliDebug(1, Form("Hit pattern: hits 0x%x  slat %2i  board %3i  effFlag %i",
                     pattern & 0xFF, AliESDMuonTrack::GetSlatOrInfo(pattern),
@@ -155,7 +151,7 @@ void AliMUONTrackHitPattern::ExecuteValidation(const AliMUONVTrackStore& trackSt
     // the obtained pattern is good for check, but not good for efficiency determination.
     UShort_t pattern = matchedTriggerTrack ?
       matchedTriggerTrack->GetHitsPatternInTrigCh() : 
-      GetHitPattern(&trackParam, digitStore);
+      GetHitPattern(&trackParam);
 
     track->SetHitsPatternInTrigCh(pattern);
   }
@@ -293,21 +289,19 @@ AliMUONTrackHitPattern::MatchTriggerTrack(AliMUONTrack* track,
 
 
 //______________________________________________________________________________
-UShort_t AliMUONTrackHitPattern::GetHitPattern(AliMUONTriggerTrack* matchedTriggerTrack,
-                                              AliMUONVDigitStore& digitStore) const
+UShort_t AliMUONTrackHitPattern::GetHitPattern(AliMUONTriggerTrack* matchedTriggerTrack) const
 {
   //
   /// Get hit pattern on trigger chambers for the current trigger track
   //
   UShort_t pattern = 0;
-  PerformTrigTrackMatch(pattern, matchedTriggerTrack, digitStore);
+  PerformTrigTrackMatch(pattern, matchedTriggerTrack);
   return pattern;
 }
 
 
 //______________________________________________________________________________
-UShort_t AliMUONTrackHitPattern::GetHitPattern(AliMUONTrackParam* trackParam,
-                                              AliMUONVDigitStore& digitStore) const
+UShort_t AliMUONTrackHitPattern::GetHitPattern(AliMUONTrackParam* trackParam) const
 {
   //
   /// Get hit pattern on trigger chambers for the current tracker track
@@ -320,7 +314,7 @@ UShort_t AliMUONTrackHitPattern::GetHitPattern(AliMUONTrackParam* trackParam,
   {
     Int_t iChamber = kNTrackingCh+ch;
     AliMUONTrackExtrap::ExtrapToZCov(trackParam, AliMUONConstants::DefaultChamberZ(iChamber));
-    FindPadMatchingTrack(digitStore, *trackParam, isMatch, iChamber);
+    FindPadMatchingTrack(*trackParam, isMatch, iChamber);
     for(Int_t cath=0; cath<2; ++cath)
     {
       if(isMatch[cath]) AliESDMuonTrack::SetFiredChamber(pattern, cath, ch);
@@ -354,8 +348,7 @@ AliMUONTrackHitPattern::ApplyMCSCorrections(AliMUONTrackParam& trackParam) const
 
 //______________________________________________________________________________
 void 
-AliMUONTrackHitPattern::FindPadMatchingTrack(const AliMUONVDigitStore& digitStore,
-                                             const AliMUONTrackParam& trackParam,
+AliMUONTrackHitPattern::FindPadMatchingTrack(const AliMUONTrackParam& trackParam,
                                              Bool_t isMatch[2], Int_t iChamber) const
 {
     //
@@ -370,7 +363,7 @@ AliMUONTrackHitPattern::FindPadMatchingTrack(const AliMUONVDigitStore& digitStor
       minMatchDist[cath]=fkMaxDistance/10.;
     }
 
-    TIter next(digitStore.CreateIterator());
+    TIter next(fkDigitStore.CreateTriggerIterator());
     AliMUONVDigit* mDigit;
 
     while ( ( mDigit = static_cast<AliMUONVDigit*>(next()) ) )
@@ -438,7 +431,7 @@ AliMUONTrackHitPattern::MinDistanceFromPad(Float_t xPad, Float_t yPad, Float_t z
 
 
 //_____________________________________________________________________________
-Int_t AliMUONTrackHitPattern::FindPadMatchingTrig(const AliMUONVDigitStore& digitStore, Int_t &detElemId,
+Int_t AliMUONTrackHitPattern::FindPadMatchingTrig(Int_t &detElemId,
                                                  Float_t coor[2], Bool_t isMatch[2],
                                                  TArrayI nboard[2], TArrayF &zRealMatch, Float_t y11) const
 {
@@ -466,7 +459,7 @@ Int_t AliMUONTrackHitPattern::FindPadMatchingTrig(const AliMUONVDigitStore& digi
     Float_t foundZmatch=999.;
     Float_t yCoorAtPadZ=999.;
 
-    TIter next(digitStore.CreateIterator());
+    TIter next(fkDigitStore.CreateTriggerIterator());
     AliMUONVDigit* mDigit;
     Int_t idigit=0;
     
@@ -660,8 +653,7 @@ void AliMUONTrackHitPattern::LocalBoardFromPos(Float_t x, Float_t y,
 
 //_____________________________________________________________________________
 Bool_t AliMUONTrackHitPattern::PerformTrigTrackMatch(UShort_t &pattern,
-                                                    const AliMUONTriggerTrack* matchedTrigTrack,
-                                                    AliMUONVDigitStore& digitStore) const
+                                                    const AliMUONTriggerTrack* matchedTrigTrack) const
 {
   //
   /// It searches for matching digits around the trigger track.
@@ -749,7 +741,7 @@ Bool_t AliMUONTrackHitPattern::PerformTrigTrackMatch(UShort_t &pattern,
       continue;
     }
                
-    triggeredDigits[currCh] = FindPadMatchingTrig(digitStore, detElemIdFromTrack, trackIntersectCh[currCh], isMatch, nboard, zRealMatch, y11);
+    triggeredDigits[currCh] = FindPadMatchingTrig(detElemIdFromTrack, trackIntersectCh[currCh], isMatch, nboard, zRealMatch, y11);
 
     // if FindPadMatchingTrig = -500 => too many digits matching pad =>
     //                               => Event not clear => Do not use for efficiency calculation
index 1cd9367..04db940 100644 (file)
@@ -20,7 +20,6 @@ class AliMUONVTrackStore;
 class AliMUONVTriggerStore;
 class AliMUONVTriggerTrackStore;
 class AliMUONTrackParam;
-class AliMUONDigitMaker;
 class AliMUONGeometryTransformer;
 class AliMUONVDigitStore;
 class AliMUONTriggerTrack;
@@ -33,7 +32,7 @@ public:
 
   AliMUONTrackHitPattern(const AliMUONRecoParam* recoParam,
                          const AliMUONGeometryTransformer& transformer,
-                         const AliMUONDigitMaker& digitMaker);
+                         const AliMUONVDigitStore& digitStore);
   virtual ~AliMUONTrackHitPattern(); // Destructor
 
   void ExecuteValidation(const AliMUONVTrackStore& trackStore,
@@ -45,18 +44,15 @@ public:
                                         const AliMUONVTriggerTrackStore& triggerTrackStore,
                                         const AliMUONVTriggerStore& triggerStore) const;
 
-  UShort_t GetHitPattern(AliMUONTriggerTrack* matchedTriggerTrack,
-                        AliMUONVDigitStore& digitStore) const;
+  UShort_t GetHitPattern(AliMUONTriggerTrack* matchedTriggerTrack) const;
   
-  UShort_t GetHitPattern(AliMUONTrackParam* trackParam,
-                        AliMUONVDigitStore& digitStore) const;
+  UShort_t GetHitPattern(AliMUONTrackParam* trackParam) const;
 
 protected:
   void ApplyMCSCorrections(AliMUONTrackParam& trackParam) const;
   
   // Methods for hit pattern from tracker track
-  void FindPadMatchingTrack(const AliMUONVDigitStore& digitStore,
-                           const AliMUONTrackParam& trackParam,
+  void FindPadMatchingTrack(const AliMUONTrackParam& trackParam,
                            Bool_t isMatch[2], Int_t iChamber) const;
 
   Float_t MinDistanceFromPad(Float_t xPad, Float_t yPad, Float_t zPad,
@@ -65,10 +61,9 @@ protected:
 
   // Methods for hit pattern from matched trigger track
   Bool_t PerformTrigTrackMatch(UShort_t &pattern,
-                              const AliMUONTriggerTrack* matchedTrigTrack,
-                              AliMUONVDigitStore& digitStore) const;
+                              const AliMUONTriggerTrack* matchedTrigTrack) const;
   
-  Int_t FindPadMatchingTrig(const AliMUONVDigitStore& digitStore, Int_t &detElemId, Float_t coor[2],
+  Int_t FindPadMatchingTrig(Int_t &detElemId, Float_t coor[2],
                            Bool_t isMatch[2], TArrayI nboard[2],
                            TArrayF &zRealMatch, Float_t y11) const;
   
@@ -93,7 +88,7 @@ private:
 
   const AliMUONRecoParam* fkRecoParam; //!< pointer to reco parameters
   const AliMUONGeometryTransformer& fkTransformer; //!< geometry transformer
-  const AliMUONDigitMaker& fkDigitMaker; //!< pointer to digit maker
+  const AliMUONVDigitStore& fkDigitStore; //!< digitStore
 
   const Float_t fkMaxDistance; //!< Maximum distance for reference
   static const Int_t fgkNcathodes=2; //!<Number of cathodes
index 8f833d5..382bae8 100644 (file)
@@ -54,7 +54,6 @@
 #include "AliMUONVClusterServer.h"
 #include "AliMUONVDigitStore.h"
 #include "AliMUONVTriggerStore.h"
-#include "AliMUONDigitMaker.h"
 #include <Riostream.h>
 #include <TRandom.h>
 #include <TTree.h>
@@ -68,11 +67,9 @@ ClassImp(AliMUONTracker)
 AliMUONTracker::AliMUONTracker(const AliMUONRecoParam* recoParam,
                                AliMUONVClusterServer* clusterServer,
                                AliMUONVDigitStore& digitStore,
-                               const AliMUONDigitMaker* digitMaker,
                                const AliMUONGeometryTransformer* transformer,
                                const AliMUONTriggerCircuit* triggerCircuit)
 : AliTracker(),
-fkDigitMaker(digitMaker), // not owner
 fkTransformer(transformer), // not owner
 fkTriggerCircuit(triggerCircuit), // not owner
 fTrackHitPatternMaker(0x0),
@@ -87,8 +84,8 @@ fTriggerTrackStore(0x0),
 fkRecoParam(recoParam)
 {
   /// constructor
-  if (fkTransformer && fkDigitMaker)
-    fTrackHitPatternMaker = new AliMUONTrackHitPattern(recoParam,*fkTransformer,*fkDigitMaker);
+  if (fkTransformer)
+    fTrackHitPatternMaker = new AliMUONTrackHitPattern(recoParam,*fkTransformer,fkDigitStore);
   
   if (!fClusterServer)
   {
index 5a4c9c6..0339951 100644 (file)
@@ -15,7 +15,6 @@
 
 class AliCluster;
 class AliESDEvent;
-class AliMUONDigitMaker;
 class AliMUONGeometryTransformer;
 class AliMUONRecoParam;
 class AliMUONTrackHitPattern;
@@ -35,7 +34,6 @@ class AliMUONTracker : public AliTracker
   AliMUONTracker(const AliMUONRecoParam* recoParam,
                  AliMUONVClusterServer* clusterServer,
                  AliMUONVDigitStore& digitStore,
-                 const AliMUONDigitMaker* digitMaker=0,
                  const AliMUONGeometryTransformer* transformer=0,
                  const AliMUONTriggerCircuit* triggerCircuit=0);
   virtual ~AliMUONTracker();
@@ -73,7 +71,6 @@ private:
   void SetupClusterServer(AliMUONVClusterServer& clusterServer);
   
 private:
-  const AliMUONDigitMaker* fkDigitMaker; //!< digit maker (not owner)
   const AliMUONGeometryTransformer* fkTransformer; //!< geometry transformer (not owner)
   const AliMUONTriggerCircuit* fkTriggerCircuit; //!< trigger circuit (not owner)
   AliMUONTrackHitPattern* fTrackHitPatternMaker; //!< trigger hit pattern maker