]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/MUONRefit.C
Fixes for object target dependencies
[u/mrichter/AliRoot.git] / MUON / MUONRefit.C
index 7b94be63193683a5a212e96fd75d24f992ffe722..3db97280060f6440d8cad50fb6d82698cc58ec83 100644 (file)
@@ -49,6 +49,7 @@
 #endif
 
 const Int_t printLevel = 1;
+const Bool_t reconstructFromDigits = kTRUE; // kFALSE = reconstruct from clusters
 
 TTree* GetESDTree(TFile *esdFile);
 
@@ -140,18 +141,28 @@ void MUONRefit(Int_t nevents = -1, const char* esdFileNameIn = "AliESDs.root", c
     esd->FindListObject("MuonClusters")->Clear("C");
     esd->FindListObject("MuonPads")->Clear("C");
     
-    // loop over digits to modify their charge
-    AliMUONVDigit *digit;
-    TIter next(esdInterface.CreateDigitIterator());
-    while ((digit = static_cast<AliMUONVDigit*>(next()))) {
-      digit->SetCharge(digit->ADC());
-      digit->Calibrated(kFALSE);
+    AliMUONVTrackStore* newTrackStore = 0x0;
+    if (reconstructFromDigits) {
+      
+      // loop over digits to modify their charge
+      AliMUONVDigit *digit;
+      TIter next(esdInterface.CreateDigitIterator());
+      while ((digit = static_cast<AliMUONVDigit*>(next()))) {
+        digit->SetCharge(digit->ADC());
+        digit->Calibrated(kFALSE);
+      }
+      
+      // refit the tracks from digits
+      refitter.SetFirstClusterIndex(0);
+      newTrackStore = refitter.ReconstructFromDigits();
+      
+    } else {
+      
+      // refit the tracks from clusters
+      newTrackStore = refitter.ReconstructFromClusters();
+      
     }
     
-    // refit the tracks from digits
-    refitter.SetFirstClusterIndex(0);
-    AliMUONVTrackStore* newTrackStore = refitter.ReconstructFromDigits();
-    
     //----------------------------------------------//
     // ------ fill new ESD and print results ------ //
     //----------------------------------------------//