add a flag to reconstruct from clusters instead of digits
authorppillot <pillot@subatech.in2p3.fr>
Tue, 11 Feb 2014 16:04:59 +0000 (17:04 +0100)
committerlaphecet <laurent.aphecetche@subatech.in2p3.fr>
Tue, 25 Nov 2014 12:40:59 +0000 (13:40 +0100)
MUON/MUONRefit.C

index 7b94be6..3db9728 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 ------ //
     //----------------------------------------------//