]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ACORDE/AliACORDEReconstructor.cxx
end-of-line normalization
[u/mrichter/AliRoot.git] / ACORDE / AliACORDEReconstructor.cxx
index 5afe80f91601619a26f18facbd1bcb83a9d617ee..c7a33649fdda2397697f656209c6b458b5731a0c 100644 (file)
-/**************************************************************************\r
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r
- *                                                                        *\r
- * Author: The ALICE Off-line Project.                                    *\r
- * Contributors are mentioned in the code where appropriate.              *\r
- *                                                                        *\r
- * Permission to use, copy, modify and distribute this software and its   *\r
- * documentation strictly for non-commercial purposes is hereby granted   *\r
- * without fee, provided that the above copyright notice appears in all   *\r
- * copies and that both the copyright notice and this permission notice   *\r
- * appear in the supporting documentation. The authors make no claims     *\r
- * about the suitability of this software for any purpose. It is          *\r
- * provided "as is" without express or implied warranty.                  *\r
- **************************************************************************/\r
-\r
-/* $Id: AliACORDEReconstructor.cxx 20956 2007-09-26 14:22:18Z mrodrigu $ */\r
-//////////////////////////////////////////////////////////////////////////////\r
-//                                                                          //\r
-//  Class for ACORDE reconstruction                                         //\r
-//////////////////////////////////////////////////////////////////////////////\r
-\r
-#include "AliRawReader.h"\r
-\r
-#include "AliACORDEReconstructor.h"\r
-#include "AliACORDERawStream.h"\r
-#include "AliESDEvent.h"\r
-#include "AliACORDEdigit.h"\r
-#include "AliACORDERecoParam.h"\r
-\r
-ClassImp(AliACORDEReconstructor)\r
-\r
-AliACORDEReconstructor:: AliACORDEReconstructor():\r
-  AliReconstructor(),\r
-  fESDACORDE(0x0),\r
-  fAcordeRecoParam(0x0),\r
-  fCalibData(0x0),\r
-  fDigitsArray(0)\r
-{\r
-  // Default constructor  \r
-  // Get calibration data\r
-\r
-  fCalibData = GetCalibData();\r
-  fAcordeRecoParam = GetRecoParam();\r
-}\r
-\r
-//_______________________________________________________________________\r
-AliACORDECalibData *AliACORDEReconstructor::GetCalibData() const\r
-{\r
-  return 0x0;\r
-}\r
-//____________________________________________________________________________\r
-AliACORDERecoParam *AliACORDEReconstructor::GetRecoParam() const\r
-{\r
-  return 0x0;\r
-}\r
-//_____________________________________________________________________________\r
-AliACORDEReconstructor& AliACORDEReconstructor::operator = \r
-  (const AliACORDEReconstructor& /*reconstructor*/)\r
-{\r
-// assignment operator\r
-\r
-  Fatal("operator =", "assignment operator not implemented");\r
-  return *this;\r
-}\r
-\r
-//_____________________________________________________________________________\r
-AliACORDEReconstructor::~AliACORDEReconstructor()\r
-{\r
-// destructor\r
-  delete fESDACORDE;\r
-  delete fDigitsArray;\r
-}\r
-\r
-//_____________________________________________________________________________\r
-void AliACORDEReconstructor::Init()\r
-{\r
-// initializer\r
-    fESDACORDE  = new AliESDACORDE;\r
-}\r
-\r
-void AliACORDEReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const\r
-{\r
-\r
-  if (!digitsTree) {\r
-    AliError("No digits tree!");\r
-    return;\r
-  }\r
-\r
-  if (!fDigitsArray)\r
-    fDigitsArray = new TClonesArray("AliACORDEdigit", 60);\r
-\r
-  digitsTree->Branch("ACORDEdigit", &fDigitsArray);\r
-\r
-  rawReader->Reset();\r
-  AliACORDERawStream rawStream(rawReader);\r
-  if (rawStream.Next()) {\r
-    for(Int_t iChannel = 0; iChannel < 60; iChannel++) {\r
-      Int_t  index = iChannel / 30;\r
-      Int_t  bit   = iChannel % 30;\r
-      if (rawStream.GetWord(index) & (1 << bit))\r
-        new ((*fDigitsArray)[fDigitsArray->GetEntriesFast()]) AliACORDEdigit(iChannel,0);\r
-    }\r
-  }\r
-\r
-  digitsTree->Fill();\r
-\r
-  fDigitsArray->Clear();\r
-}\r
-\r
-void AliACORDEReconstructor::FillESD(TTree* digitsTree, TTree* /*clustersTree*/,AliESDEvent* esd) const\r
-{\r
-\r
-  // fills ESD with ACORDE Digits\r
-\r
-  if (!digitsTree)\r
-    {\r
-      AliError("No digits tree!");\r
-      return;\r
-    }\r
-\r
-  TBranch* digitBranch = digitsTree->GetBranch("ACORDEdigit");\r
-  if (!digitBranch) {\r
-    AliError("No ACORDE digits branch found!");\r
-    return;\r
-  }\r
-  digitBranch->SetAddress(&fDigitsArray);\r
-\r
-  digitsTree->GetEvent(0);\r
-\r
-  Bool_t AcoHitSingle[60],AcoHitMulti[60];\r
-  for(Int_t i = 0; i < 60; i++) { AcoHitSingle[i] = AcoHitMulti[i] = kFALSE; }\r
-\r
-  Int_t nDigits = fDigitsArray->GetEntriesFast();\r
-    \r
-  for (Int_t d=0; d<nDigits; d++) {    \r
-    AliACORDEdigit* digit = (AliACORDEdigit*) fDigitsArray->At(d);\r
-    Int_t module = digit->GetModule();\r
-\r
-    AcoHitSingle[module] = kTRUE;\r
-    AcoHitMulti[module] = kTRUE;\r
-  }  \r
-  if (!esd) {\r
-       AliError("NO ACORDE ESD branch found!");\r
-       return;\r
-}\r
-  TString ActiveTriggerDetector = esd->GetFiredTriggerClasses();\r
-  if (ActiveTriggerDetector.Contains("ASL")) fESDACORDE->SetACORDEBitPattern(AcoHitSingle);\r
-  else if (ActiveTriggerDetector.Contains("AMU")) fESDACORDE->SetACORDEBitPattern(AcoHitMulti);\r
-       else fESDACORDE->SetACORDEBitPattern(AcoHitSingle);\r
-\r
-  if (esd)\r
-    {\r
-      AliDebug(1, Form("Writing ACORDE data to ESD Tree"));\r
-      esd->SetACORDEData(fESDACORDE);\r
-    }\r
-\r
-  fDigitsArray->Clear();\r
-}\r
-\r
-\r
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id: AliACORDEReconstructor.cxx 20956 2007-09-26 14:22:18Z mrodrigu $ */
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+//  Class for ACORDE reconstruction                                         //
+//////////////////////////////////////////////////////////////////////////////
+
+#include "AliRawReader.h"
+
+#include "AliACORDEReconstructor.h"
+#include "AliACORDERawStream.h"
+#include "AliESDEvent.h"
+#include "AliACORDEdigit.h"
+#include "AliACORDERecoParam.h"
+
+ClassImp(AliACORDEReconstructor)
+
+AliACORDEReconstructor:: AliACORDEReconstructor():
+  AliReconstructor(),
+  fESDACORDE(0x0),
+  fAcordeRecoParam(0x0),
+  fCalibData(0x0),
+  fDigitsArray(0)
+{
+  // Default constructor  
+  // Get calibration data
+
+  fCalibData = GetCalibData();
+  fAcordeRecoParam = GetRecoParam();
+}
+
+//_______________________________________________________________________
+AliACORDECalibData *AliACORDEReconstructor::GetCalibData() const
+{
+  return 0x0;
+}
+//____________________________________________________________________________
+AliACORDERecoParam *AliACORDEReconstructor::GetRecoParam() const
+{
+  return 0x0;
+}
+//_____________________________________________________________________________
+AliACORDEReconstructor& AliACORDEReconstructor::operator = 
+  (const AliACORDEReconstructor& /*reconstructor*/)
+{
+// assignment operator
+
+  Fatal("operator =", "assignment operator not implemented");
+  return *this;
+}
+
+//_____________________________________________________________________________
+AliACORDEReconstructor::~AliACORDEReconstructor()
+{
+// destructor
+  delete fESDACORDE;
+  delete fDigitsArray;
+}
+
+//_____________________________________________________________________________
+void AliACORDEReconstructor::Init()
+{
+// initializer
+    fESDACORDE  = new AliESDACORDE;
+}
+
+void AliACORDEReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const
+{
+
+  if (!digitsTree) {
+    AliError("No digits tree!");
+    return;
+  }
+
+  if (!fDigitsArray)
+    fDigitsArray = new TClonesArray("AliACORDEdigit", 60);
+
+  digitsTree->Branch("ACORDEdigit", &fDigitsArray);
+
+  rawReader->Reset();
+  AliACORDERawStream rawStream(rawReader);
+  if (rawStream.Next()) {
+    for(Int_t iChannel = 0; iChannel < 60; iChannel++) {
+      Int_t  index = iChannel / 30;
+      Int_t  bit   = iChannel % 30;
+      if (rawStream.GetWord(index) & (1 << bit))
+        new ((*fDigitsArray)[fDigitsArray->GetEntriesFast()]) AliACORDEdigit(iChannel,0);
+    }
+  }
+
+  digitsTree->Fill();
+
+  fDigitsArray->Clear();
+}
+
+void AliACORDEReconstructor::FillESD(TTree* digitsTree, TTree* /*clustersTree*/,AliESDEvent* esd) const
+{
+
+  // fills ESD with ACORDE Digits
+
+  if (!digitsTree)
+    {
+      AliError("No digits tree!");
+      return;
+    }
+
+  TBranch* digitBranch = digitsTree->GetBranch("ACORDEdigit");
+  if (!digitBranch) {
+    AliError("No ACORDE digits branch found!");
+    return;
+  }
+  digitBranch->SetAddress(&fDigitsArray);
+
+  digitsTree->GetEvent(0);
+
+  Bool_t AcoHitSingle[60],AcoHitMulti[60];
+  for(Int_t i = 0; i < 60; i++) { AcoHitSingle[i] = AcoHitMulti[i] = kFALSE; }
+
+  Int_t nDigits = fDigitsArray->GetEntriesFast();
+    
+  for (Int_t d=0; d<nDigits; d++) {    
+    AliACORDEdigit* digit = (AliACORDEdigit*) fDigitsArray->At(d);
+    Int_t module = digit->GetModule();
+
+    AcoHitSingle[module] = kTRUE;
+    AcoHitMulti[module] = kTRUE;
+  }  
+  if (!esd) {
+       AliError("NO ACORDE ESD branch found!");
+       return;
+}
+  TString ActiveTriggerDetector = esd->GetFiredTriggerClasses();
+  if (ActiveTriggerDetector.Contains("ASL")) fESDACORDE->SetACORDEBitPattern(AcoHitSingle);
+  else if (ActiveTriggerDetector.Contains("AMU")) fESDACORDE->SetACORDEBitPattern(AcoHitMulti);
+       else fESDACORDE->SetACORDEBitPattern(AcoHitSingle);
+
+  if (esd)
+    {
+      AliDebug(1, Form("Writing ACORDE data to ESD Tree"));
+      esd->SetACORDEData(fESDACORDE);
+    }
+
+  fDigitsArray->Clear();
+}
+
+