]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ACORDE/AliACORDEReconstructor.cxx
possibility to exclude events with SDD clusters plus a fix on the histogram filling...
[u/mrichter/AliRoot.git] / ACORDE / AliACORDEReconstructor.cxx
index 692da258492269959a719c95e80302a8182969f9..5afe80f91601619a26f18facbd1bcb83a9d617ee 100644 (file)
-/**************************************************************************
- * 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"
-
-ClassImp(AliACORDEReconstructor)
-
-AliACORDEReconstructor:: AliACORDEReconstructor():
-  AliReconstructor(),
-  fESDACORDE(0x0),
-  fCalibData(0x0)
-{
-  // Default constructor  
-  // Get calibration data
-
-  fCalibData = GetCalibData(); 
-}
-
-//FALTA IMPLEMENTAR_______________________________________________________________________
-AliACORDECalibData *AliACORDEReconstructor::GetCalibData() const
-{
-  // TO BE IMPLEMENTED !!
-  return 0x0;
-}
-//_____________________________________________________________________________
-AliACORDEReconstructor& AliACORDEReconstructor::operator = 
-  (const AliACORDEReconstructor& /*reconstructor*/)
-{
-// assignment operator
-
-  Fatal("operator =", "assignment operator not implemented");
-  return *this;
-}
-
-//_____________________________________________________________________________
-AliACORDEReconstructor::~AliACORDEReconstructor()
-{
-// destructor
-//NECESITAS esta clase
-  delete fESDACORDE; 
-}
-
-//_____________________________________________________________________________
-void AliACORDEReconstructor::Init()
-{
-// initializer
-//NECESITAS esta clase
-    fESDACORDE  = new AliESDACORDE;
-}
-
-void AliACORDEReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const
-{
-
-  if (!digitsTree) {
-    AliError("No digits tree!");
-    return;
-  }
-
-  TClonesArray* digitsArray = new TClonesArray("AliACORDEdigit");
-  digitsTree->Branch("ACORDEdigit", &digitsArray);
-
-  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 ((*digitsArray)[digitsArray->GetEntriesFast()]) AliACORDEdigit(iChannel+1,0);
-    }
-  }
-
-  digitsTree->Fill();
-                       
-}
-
-void AliACORDEReconstructor::FillESD(TTree* digitsTree, TTree* /*clustersTree*/,AliESDEvent* esd) const
-{
-
-  // fills ESD with ACORDE Digits
-
-  if (!digitsTree)
-    {
-      AliError("No digits tree!");
-      return;
-    }
-
-  TClonesArray* digitsArray = NULL;
-  TBranch* digitBranch = digitsTree->GetBranch("ACORDEdigit");
-  if (!digitBranch) {
-    AliError("No ACORDE digits branch found!");
-    return;
-  }
-  digitBranch->SetAddress(&digitsArray);
-
-  digitsTree->GetEvent(0);
-
-  Bool_t AcoADCSingle[60],AcoADCMulti[60];
-  for(Int_t i = 0; i < 60; i++) { AcoADCSingle[i] = AcoADCMulti[i] = kFALSE; }
-
-  Int_t nDigits = digitsArray->GetEntriesFast();
-    
-  for (Int_t d=0; d<nDigits; d++) {    
-    AliACORDEdigit* digit = (AliACORDEdigit*)digitsArray->At(d);
-    Int_t module = digit->GetModule();
-
-    AcoADCSingle[module-1] = kTRUE;
-    AcoADCMulti[module-1] = kTRUE;
-  }
-       
-  fESDACORDE->SetACORDESingleMuon(AcoADCSingle);
-  fESDACORDE->SetACORDEMultiMuon(AcoADCMulti);
-
-  if (esd)
-    {
-      AliDebug(1, Form("Writing ACORDE data to ESD Tree"));
-      esd->SetACORDEData(fESDACORDE);
-    }  
-}
-
-
+/**************************************************************************\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