]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCclusterKr.cxx
Adding new selection criteria for filtering of fake
[u/mrichter/AliRoot.git] / TPC / AliTPCclusterKr.cxx
index b3691e8cbece3f5504ba4d965b44fa3fbf784666..0aaf5504e22a5c41e14a596c4fddb54285b698fb 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: AliTPCclusterKr.cxx,v 1.7 2008/01/22 17:24:53 matyja Exp $ */
-
-//-----------------------------------------------------------------
-//           Implementation of the TPC Kr cluster class
-//
-// Origin: Adam Matyja, INP PAN, adam.matyja@ifj.edu.pl
-//-----------------------------------------------------------------
-
-#include "AliTPCclusterKr.h"
-#include "AliCluster.h"
-#include "AliTPCvtpr.h"
-#include "TObjArray.h"
-
-ClassImp(AliTPCclusterKr)
-
-
-AliTPCclusterKr::AliTPCclusterKr()
-:AliCluster(),
- fMax(),
- fADCcluster(0),
- fSec(0),
- fNPads(0),
- fNRows(0),
- fSize(0),
- fCenterX(0),
- fCenterY(0),
- fCenterT(0),
- fCluster(0)
-{
-//
-// default constructor
-//
-  fCluster=new TObjArray();
-}
-
-AliTPCclusterKr::AliTPCclusterKr(const AliTPCclusterKr &param)
-:AliCluster(param),
- fMax(),
- fADCcluster(0),
- fSec(0),
- fNPads(0),
- fNRows(0),
- fSize(0),
- fCenterX(0),
- fCenterY(0),
- fCenterT(0),
- fCluster(0)
-{
-//
-// copy constructor
-//
-  fADCcluster = param.fADCcluster;
-  fSec  = param.fSec ;
-  fNPads = param.fNPads;
-  fNRows = param.fNRows;
-  fMax = param.fMax;
-  //  fCluster = param.fCluster;
-  fCenterX = param.fCenterX;
-  fCenterY = param.fCenterY;
-  fCenterT = param.fCenterT;
-  fCluster=new TObjArray(*(param.fCluster));
-  fSize = param.fSize;
-} 
-
-AliTPCclusterKr &AliTPCclusterKr::operator = (const AliTPCclusterKr & param)
-{
-  //
-  // assignment operator
-  // 
-  (AliCluster&)(*this) = (AliCluster&)param;
-  fADCcluster = param.fADCcluster;
-  fSec  = param.fSec ;
-  fNPads = param.fNPads;
-  fNRows = param.fNRows;
-  fMax = param.fMax;
-  //  fCluster=param.fCluster;
-  fCenterX = param.fCenterX;
-  fCenterY = param.fCenterY;
-  fCenterT = param.fCenterT;
-  delete fCluster;
-  fCluster=new TObjArray(*(param.fCluster));
-  fSize=param.fSize;
-  return (*this);
-}
-
-AliTPCclusterKr::~AliTPCclusterKr()
-{
-  //
-  // destructor
-  //
-  if(fCluster)delete fCluster;
-  fCluster=0;
-}
-
-////____________________________________________________________________________
-void AliTPCclusterKr::SetCenter(){
-  //
-  // calculate geometrical center of the cluster
-  //
-  Double_t rX=0;
-  Double_t rY=0;
-  Double_t rT=0;
-
-  Short_t adc;
-  fADCcluster=0;
-  for(Int_t iter = 0; iter < fCluster->GetEntriesFast(); ++iter) {
-    AliTPCvtpr *iclus=(AliTPCvtpr *)fCluster->At(iter);
-
-    //for( std::vector<AliTPCvtpr*>::iterator iclus  = fCluster.begin();
-    //iclus != fCluster.end(); ++iclus ) {
-    adc = (iclus)->GetAdc();
-    fADCcluster+=adc;
-    rX += ((iclus)->GetX() * adc);
-    rY += ((iclus)->GetY() * adc);
-    rT += ((iclus)->GetTime() * adc);
-  }
-  fCenterX=rX/fADCcluster;
-  fCenterY=rY/fADCcluster;
-  fCenterT=rT/fADCcluster;
-
-  return;
-}
+/**************************************************************************\r\r
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *\r\r
+ *                                                                        *\r\r
+ * Author: The ALICE Off-line Project.                                    *\r\r
+ * Contributors are mentioned in the code where appropriate.              *\r\r
+ *                                                                        *\r\r
+ * Permission to use, copy, modify and distribute this software and its   *\r\r
+ * documentation strictly for non-commercial purposes is hereby granted   *\r\r
+ * without fee, provided that the above copyright notice appears in all   *\r\r
+ * copies and that both the copyright notice and this permission notice   *\r\r
+ * appear in the supporting documentation. The authors make no claims     *\r\r
+ * about the suitability of this software for any purpose. It is          *\r\r
+ * provided "as is" without express or implied warranty.                  *\r\r
+ **************************************************************************/\r\r
+\r\r
+/* $Id: AliTPCclusterKr.cxx,v 1.7 2008/01/22 17:24:53 matyja Exp $ */\r\r
+\r\r
+//-----------------------------------------------------------------\r\r
+//           Implementation of the TPC Kr cluster class\r\r
+//\r\r
+// Origin: Adam Matyja, INP PAN, adam.matyja@ifj.edu.pl\r\r
+//-----------------------------------------------------------------\r\r
+\r\r
+#include "AliTPCclusterKr.h"\r\r
+#include "AliCluster.h"\r\r
+#include "AliTPCvtpr.h"\r\r
+#include "TObjArray.h"\r\r
+//#include "TH1F.h"\r\r
+#include "TMath.h"\r\r
+#include "TArrayI.h"\r\r
+\r\r
+ClassImp(AliTPCclusterKr)\r\r
+\r\r
+\r\r
+AliTPCclusterKr::AliTPCclusterKr()\r\r
+:AliCluster(),\r\r
+ fMax(),\r\r
+ fADCcluster(0),\r\r
+ fSec(0),\r\r
+ fNPads(0),\r\r
+ fNRows(0),\r\r
+ fTimebins1D(0),\r\r
+ fPads1D(0),\r\r
+ fPadRMS(0),\r\r
+ fRowRMS(0),\r\r
+ fTimebinRMS(0),\r\r
+ fSize(0),\r\r
+ fCenterX(0),\r\r
+ fCenterY(0),\r\r
+ fCenterT(0),\r\r
+ fCluster(0),\r\r
+ fTimeStamp(0)\r\r
+{\r\r
+//\r\r
+// default constructor\r\r
+//\r\r
+  fCluster=new TObjArray();\r\r
+}\r\r
+\r\r
+AliTPCclusterKr::AliTPCclusterKr(const AliTPCclusterKr &param)\r\r
+:AliCluster(param),\r\r
+ fMax(),\r\r
+ fADCcluster(0),\r\r
+ fSec(0),\r\r
+ fNPads(0),\r\r
+ fNRows(0),\r\r
+ fTimebins1D(0),\r\r
+ fPads1D(0),\r\r
+ fPadRMS(0),\r\r
+ fRowRMS(0),\r\r
+ fTimebinRMS(0),\r\r
+ fSize(0),\r\r
+ fCenterX(0),\r\r
+ fCenterY(0),\r\r
+ fCenterT(0),\r\r
+ fCluster(0),\r\r
+ fTimeStamp(0)\r\r
+{\r\r
+//\r\r
+// copy constructor\r\r
+//\r\r
+  fADCcluster = param.fADCcluster;\r\r
+  fSec  = param.fSec ;\r\r
+  fNPads = param.fNPads;\r\r
+  fNRows = param.fNRows;\r\r
+  fMax = param.fMax;\r\r
+  //  fCluster = param.fCluster;\r\r
+  fCenterX = param.fCenterX;\r\r
+  fCenterY = param.fCenterY;\r\r
+  fCenterT = param.fCenterT;\r\r
+  fCluster=new TObjArray(*(param.fCluster));\r\r
+  fSize = param.fSize;\r\r
+  fTimebins1D = param.fTimebins1D;\r\r
+  fPads1D = param.fPads1D;\r\r
+  fPadRMS = param.fPadRMS;\r\r
+  fRowRMS = param.fRowRMS;\r\r
+  fTimebinRMS = param.fTimebinRMS;\r\r
+  fTimeStamp = param.fTimeStamp;\r\r
+} \r\r
+\r\r
+AliTPCclusterKr &AliTPCclusterKr::operator = (const AliTPCclusterKr & param)\r\r
+{\r\r
+  //\r\r
+  // assignment operator\r\r
+  // \r\r
+  (AliCluster&)(*this) = (AliCluster&)param;\r\r
+  fADCcluster = param.fADCcluster;\r\r
+  fSec  = param.fSec ;\r\r
+  fNPads = param.fNPads;\r\r
+  fNRows = param.fNRows;\r\r
+  fMax = param.fMax;\r\r
+  //  fCluster=param.fCluster;\r\r
+  fCenterX = param.fCenterX;\r\r
+  fCenterY = param.fCenterY;\r\r
+  fCenterT = param.fCenterT;\r\r
+  delete fCluster;\r\r
+  fCluster=new TObjArray(*(param.fCluster));\r\r
+  fSize=param.fSize;\r\r
+  fTimebins1D = param.fTimebins1D;\r\r
+  fPads1D = param.fPads1D;\r\r
+  fPadRMS = param.fPadRMS;\r\r
+  fRowRMS = param.fRowRMS;\r\r
+  fTimebinRMS = param.fTimebinRMS;\r\r
+  fTimeStamp = param.fTimeStamp;\r\r
+  return (*this);\r\r
+}\r\r
+\r\r
+AliTPCclusterKr::~AliTPCclusterKr()\r\r
+{\r\r
+  //\r\r
+  // destructor\r\r
+  //\r\r
+  if(fCluster) {\r\r
+    fCluster->SetOwner(kTRUE);\r\r
+    fCluster->Delete();\r\r
+    delete fCluster;\r\r
+  }\r\r
+  fCluster=0;\r\r
+}\r\r
+\r\r
+////____________________________________________________________________________\r\r
+void AliTPCclusterKr::SetCenter(){\r\r
+  //\r\r
+  // calculate geometrical center of the cluster\r\r
+  //\r\r
+  Double_t rX=0;\r\r
+  Double_t rY=0;\r\r
+  Double_t rT=0;\r\r
+\r\r
+  Short_t adc;\r\r
+  fADCcluster=0;\r\r
+  for(Int_t iter = 0; iter < fCluster->GetEntriesFast(); ++iter) {\r\r
+    AliTPCvtpr *iclus=(AliTPCvtpr *)fCluster->At(iter);\r\r
+\r\r
+    //for( std::vector<AliTPCvtpr*>::iterator iclus  = fCluster.begin();\r\r
+    //iclus != fCluster.end(); ++iclus ) {\r\r
+    adc = (iclus)->GetAdc();\r\r
+    fADCcluster+=adc;\r\r
+    rX += ((iclus)->GetX() * adc);\r\r
+    rY += ((iclus)->GetY() * adc);\r\r
+    rT += ((iclus)->GetT() * adc);\r\r
+  }\r\r
+  fCenterX=rX/fADCcluster;\r\r
+  fCenterY=rY/fADCcluster;\r\r
+  fCenterT=rT/fADCcluster;\r\r
+\r\r
+  return;\r\r
+}\r\r
+\r\r
+void AliTPCclusterKr::SetPadRMS(){\r\r
+  //\r\r
+  // calculate RMS in pad direction\r\r
+  //\r\r
+  //  TH1F *histo= new TH1F("","",200,0,200);\r\r
+  TArrayI *array= new TArrayI(fCluster->GetEntriesFast());\r\r
+  for(Int_t i=0;i<fCluster->GetEntriesFast();i++)\r\r
+    {\r\r
+      array->SetAt(((AliTPCvtpr *)(fCluster->At(i)))->GetPad(),i);\r\r
+      //histo->Fill( ((AliTPCvtpr *)(fCluster->At(i)))->GetPad() );\r\r
+    }\r\r
+  //  fPadRMS=histo->GetRMS();\r\r
+  fPadRMS=TMath::RMS(array->GetSize(),array->GetArray());\r\r
+  //  delete histo;\r\r
+  delete array;\r\r
+  return;\r\r
+}\r\r
+\r\r
+void AliTPCclusterKr::SetRowRMS(){\r\r
+  //\r\r
+  // calculate RMS in row direction\r\r
+  //\r\r
+  TArrayI *array= new TArrayI(fCluster->GetEntriesFast());\r\r
+  //  TH1F *histo= new TH1F("","",120,0,120);\r\r
+  for(Int_t i=0;i<fCluster->GetEntriesFast();i++)\r\r
+    {\r\r
+      array->SetAt(((AliTPCvtpr *)(fCluster->At(i)))->GetRow(),i);\r\r
+      //      histo->Fill( ((AliTPCvtpr *)(fCluster->At(i)))->GetRow() );\r\r
+    }\r\r
+  //  fRowRMS=histo->GetRMS();\r\r
+  fRowRMS=TMath::RMS(array->GetSize(),array->GetArray());\r\r
+  //  delete histo;\r\r
+  delete array;\r\r
+  return;\r\r
+}\r\r
+\r\r
+void AliTPCclusterKr::SetTimebinRMS(){\r\r
+  //\r\r
+  // calculate RMS in timebin direction\r\r
+  //\r\r
+  TArrayI *array= new TArrayI(fCluster->GetEntriesFast());\r\r
+  //  TH1F *histo= new TH1F("","",1000,0,1000);\r\r
+  for(Int_t i=0;i<fCluster->GetEntriesFast();i++)\r\r
+    {\r\r
+      array->SetAt(((AliTPCvtpr *)(fCluster->At(i)))->GetTime(),i);\r\r
+      //      histo->Fill( ((AliTPCvtpr *)(fCluster->At(i)))->GetTime() );\r\r
+    }\r\r
+  fTimebinRMS=TMath::RMS(array->GetSize(),array->GetArray());\r\r
+  //histo->GetRMS();\r\r
+  //  delete histo;\r\r
+  delete array;\r\r
+  return;\r\r
+}\r\r
+\r\r
+void AliTPCclusterKr::SetRMS(){\r\r
+  //\r\r
+  // calculate RMS in pad,row,timebin direction\r\r
+  //\r\r
+  TArrayI *arrayPad = new TArrayI(fCluster->GetEntriesFast());\r\r
+  TArrayI *arrayRow = new TArrayI(fCluster->GetEntriesFast());\r\r
+  TArrayI *arrayTime= new TArrayI(fCluster->GetEntriesFast());\r\r
+  //  TH1F *histoPad= new TH1F("p","p",200,0,200);\r\r
+  //  TH1F *histoRow= new TH1F("r","r",120,0,120);\r\r
+  //  TH1F *histoTime= new TH1F("t","t",1000,0,1000);\r\r
+  for(Int_t i=0;i<fCluster->GetEntriesFast();i++)\r\r
+    {\r\r
+      arrayPad->SetAt(((AliTPCvtpr *)(fCluster->At(i)))->GetPad(),i);\r\r
+      arrayRow->SetAt(((AliTPCvtpr *)(fCluster->At(i)))->GetRow(),i);\r\r
+      arrayTime->SetAt(((AliTPCvtpr *)(fCluster->At(i)))->GetTime(),i);\r\r
+\r\r
+      //histoPad->Fill( ((AliTPCvtpr *)(fCluster->At(i)))->GetPad() );\r\r
+      //histoRow->Fill( ((AliTPCvtpr *)(fCluster->At(i)))->GetRow() );\r\r
+      //histoTime->Fill( ((AliTPCvtpr *)(fCluster->At(i)))->GetTime() );\r\r
+    }\r\r
+  //  fPadRMS=histoPad->GetRMS();\r\r
+  fPadRMS=TMath::RMS(arrayPad->GetSize(),arrayPad->GetArray());\r\r
+  fRowRMS=TMath::RMS(arrayRow->GetSize(),arrayRow->GetArray());\r\r
+    //histoRow->GetRMS();\r\r
+  fTimebinRMS=TMath::RMS(arrayTime->GetSize(),arrayTime->GetArray());\r\r
+    //histoTime->GetRMS();\r\r
+\r\r
+  delete arrayPad;\r\r
+  delete arrayRow;\r\r
+  delete arrayTime;\r\r
+  //  delete histoPad;\r\r
+  //  delete histoRow;\r\r
+  //  delete histoTime;\r\r
+\r\r
+  return;\r\r
+}\r\r
+\r\r
+\r\r
+void AliTPCclusterKr::Set1D(){\r\r
+  //\r\r
+  //\r\r
+  //\r\r
+  Short_t maxTime=0;\r\r
+  Short_t minTime=1000;\r\r
+  Short_t maxPad=0;\r\r
+  Short_t minPad=1000;\r\r
\r\r
+  for(Int_t i=0;i<fCluster->GetEntriesFast();i++)\r\r
+    {\r\r
+      if(((AliTPCvtpr *)(fCluster->At(i)))->GetPad()>maxPad)maxPad   =((AliTPCvtpr *)(fCluster->At(i)))->GetPad();\r\r
+      if(((AliTPCvtpr *)(fCluster->At(i)))->GetPad()<minPad)minPad   =((AliTPCvtpr *)(fCluster->At(i)))->GetPad();\r\r
+      if(((AliTPCvtpr *)(fCluster->At(i)))->GetTime()>maxTime)maxTime=((AliTPCvtpr *)(fCluster->At(i)))->GetTime();\r\r
+      if(((AliTPCvtpr *)(fCluster->At(i)))->GetTime()<minTime)minTime=((AliTPCvtpr *)(fCluster->At(i)))->GetTime();\r\r
+    }\r\r
+  fPads1D=maxPad-minPad+1;\r\r
+  fTimebins1D=maxTime-minTime+1;\r\r
+  return;\r\r
+}\r\r