Class that performs Hits2SDigits, SDigits2Digits and Hits2Digits in split file or...
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 31 May 2002 16:29:42 +0000 (16:29 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 31 May 2002 16:29:42 +0000 (16:29 +0000)
both PHOS and EMCAL

PHOS/Reconstruct.C [new file with mode: 0644]

diff --git a/PHOS/Reconstruct.C b/PHOS/Reconstruct.C
new file mode 100644 (file)
index 0000000..2cf436e
--- /dev/null
@@ -0,0 +1,83 @@
+// YS Subatech Mai 2002
+
+//Root
+#include "TString.h"
+
+//AliRoot
+#include "PHOS/AliPHOSSDigitizer.h"
+#include "PHOS/AliPHOSDigitizer.h"
+#include "EMCAL/AliEMCALSDigitizer.h"
+#include "EMCAL/AliEMCALDigitizer.h"
+
+void Hits2SDigits( Bool_t split=kFALSE, TString fileName = "galice.root") {
+
+  // usage : 
+  // 1. write SDigits in the same file as Hits --------------- (OK)
+  //root [0] .L Reconstruct.C++
+  //root [1] SDigits2Digits()
+  // 2. write SDigits in a separate file, one per detector, from Hits --------------- (OK)
+  //root [0] .L Reconstruct.C++
+  //root [1] SDigits2Digits(kTRUE) // SDigits saved in [DET}.SDigits.root (DET=PHOS, EMCAL)
+
+  AliPHOSSDigitizer * sdp = new AliPHOSSDigitizer(fileName) ; 
+  if (split) 
+    sdp->SetSplitFile() ;
+  sdp->ExecuteTask("deb") ; 
+
+  AliEMCALSDigitizer * sde = new AliEMCALSDigitizer(fileName) ; 
+  if (split) 
+    sde->SetSplitFile() ;
+  sde->ExecuteTask("deb") ; 
+  delete sdp ;
+  delete sde ; 
+
+}
+
+//________________________________________________________________________
+void SDigits2Digits( Bool_t split=kFALSE, TString fileName = "galice.root") {
+  
+ // usage : 
+  // 1. write SDigits in the same file as Hits --------------- (OK)
+  //root [0] .L Reconstruct.C++
+  //root [1] Hits2Digits()
+  // 2. write SDigits in a separate file, one per detector, from Hits --------------- (OK)
+  //root [0] .L Reconstruct.C++
+  //root [1] Hits2Digits(kTRUE) // Digits saved in [DET}.Digits.root (DET=PHOS, EMCAL)
+
+  AliPHOSDigitizer * dp ; 
+  AliEMCALDigitizer * de ; 
+  if (split) {
+    dp = new AliPHOSDigitizer("PHOS.SDigits.root") ; 
+    dp->SetSplitFile() ; } 
+  else 
+    dp = new AliPHOSDigitizer(fileName) ; 
+  
+  dp->ExecuteTask("deb") ; 
+  
+  if (split) {
+    de = new AliEMCALDigitizer("EMCAL.SDigits.root") ;
+    de->SetSplitFile() ;
+  } else 
+    de = new AliEMCALDigitizer(fileName) ; 
+
+  de->ExecuteTask("deb") ; 
+
+ delete dp ;
+ delete de ; 
+}
+
+//________________________________________________________________________
+void Hits2Digits (Bool_t split=kFALSE, TString fileName = "galice.root") {
+  // usage : 
+  // 1. write (S)Digits in the same file as Hits --------------- (OK)
+  //root [0] .L Reconstruct.C++
+  //root [1] Hits2Digits()
+  // 2. write (S)Digits in a separate file, one per detector, from Hits --------------- (OK)
+  //root [0] .L Reconstruct.C++
+  //root [1] Hits2Digits(kTRUE) // SDigits saved in [DET}.SDigits.root (DET=PHOS, EMCAL)
+                                // Digits  saved in [DET}.Digits.root  (DET=PHOS, EMCAL)
+
+  Hits2SDigits(split, fileName) ; 
+  SDigits2Digits(split, fileName) ;
+}