Iolated mip trigger for PHOS HLT
authorphille <phille@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 15 Oct 2007 20:30:53 +0000 (20:30 +0000)
committerphille <phille@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 15 Oct 2007 20:30:53 +0000 (20:30 +0000)
15 files changed:
HLT/PHOS/ana/IMT/AliHLTPHOSIsolatedMipTrigger.cxx [new file with mode: 0644]
HLT/PHOS/ana/IMT/AliHLTPHOSIsolatedMipTrigger.h [new file with mode: 0644]
HLT/PHOS/ana/IMT/AliHLTPHOSMipCluster.cxx [new file with mode: 0644]
HLT/PHOS/ana/IMT/AliHLTPHOSMipCluster.h [new file with mode: 0644]
HLT/PHOS/ana/IMT/AliHLTPHOSMipClusterManager.cxx [new file with mode: 0644]
HLT/PHOS/ana/IMT/AliHLTPHOSMipClusterManager.h [new file with mode: 0644]
HLT/PHOS/ana/IMT/AliHLTPHOSModuleXCoordinate.cxx [new file with mode: 0644]
HLT/PHOS/ana/IMT/AliHLTPHOSModuleXCoordinate.h [new file with mode: 0644]
HLT/PHOS/ana/IMT/AliHLTPHOSModuleZCoordinate.cxx [new file with mode: 0644]
HLT/PHOS/ana/IMT/AliHLTPHOSModuleZCoordinate.h [new file with mode: 0644]
HLT/PHOS/ana/IMT/AliHLTPHOSModuleZXCoordinate.cxx [new file with mode: 0644]
HLT/PHOS/ana/IMT/AliHLTPHOSModuleZXCoordinate.h [new file with mode: 0644]
HLT/PHOS/ana/IMT/class.sh [new file with mode: 0755]
HLT/PHOS/ana/IMT/main.cxx [new file with mode: 0644]
HLT/PHOS/ana/IMT/makefilelist.sh [new file with mode: 0755]

diff --git a/HLT/PHOS/ana/IMT/AliHLTPHOSIsolatedMipTrigger.cxx b/HLT/PHOS/ana/IMT/AliHLTPHOSIsolatedMipTrigger.cxx
new file mode 100644 (file)
index 0000000..a617327
--- /dev/null
@@ -0,0 +1,277 @@
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear     *
+ * Physics Group, Dep. of Physics                                         *
+ * University of Oslo, Norway, 2007                                       *
+ *                                                                        *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate.              *
+ * Please report bugs to perthi@fys.uio.no                                *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+#include "AliHLTPHOSIsolatedMipTrigger.h"
+#include "stdio.h"
+#include "AliHLTPHOSDigit.h"
+#include "TTree.h"
+#include "TChain.h"
+#include "TClonesArray.h"
+#include "TH1F.h"
+#include "TFile.h"
+#include <iostream>
+#include "AliHLTPHOSMipCluster.h"
+#include "AliHLTPHOSMipClusterManager.h"
+
+
+#define Q_MIN 27
+#define Q_MAX 33
+
+#define XBIN_LOW  0
+#define XBIN_UP   1023
+#define N_BINS    1023
+
+AliHLTPHOSIsolatedMipTrigger::AliHLTPHOSIsolatedMipTrigger() :  fMipLowCut(3),  
+                                                               fMipHighCut(150),
+                                                               fModuleId(2)
+{
+  fClusterManager = new AliHLTPHOSMipClusterManager();
+  Init();
+}
+
+
+AliHLTPHOSIsolatedMipTrigger::~AliHLTPHOSIsolatedMipTrigger()
+{
+
+}
+
+/*
+void
+AliHLTPHOSIsolatedMipTrigger::SetFilePath(char *path)
+{
+  sprintf(fCurrentFilePath, "%s", path);
+  printf("\n AliHLTPHOSIsolatedMipTrigger::SetFilePath, filepath was set to %s \n", fCurrentFilePath);
+}
+*/
+
+void
+AliHLTPHOSIsolatedMipTrigger::SetMipLowCut(Float_t lCut)
+{
+  fMipLowCut = lCut;
+}
+
+void
+AliHLTPHOSIsolatedMipTrigger::SetMipHighCut(Float_t hCut)
+{
+  fMipHighCut = hCut;
+}
+
+
+int
+AliHLTPHOSIsolatedMipTrigger::ScanFileList()
+{
+  int iRet = 0;
+  FILE *fp = fopen("filelist.txt", "r");
+  
+  if(fp != 0)
+    {
+      fscanf(fp, "%d\n", &fNFiles);
+      cout << "there are " << fNFiles << "  files " <<endl;
+      for(int i=0; i< fNFiles; i++)
+       {
+         fscanf(fp, "%s\n"  ,fFileList[i]);
+       }
+      
+      for(int i=0; i< fNFiles; i++)
+       {
+         cout << fFileList[i] << endl;
+       }
+    }
+  else
+    {
+      cout << "ERROR opening file, filelist.txt" << endl;
+      iRet = -1;
+    } 
+  
+  return iRet;
+}
+
+
+
+int
+AliHLTPHOSIsolatedMipTrigger::Analyze()
+{
+  //  TClonesArray *digArray = new TClonesArray("AliHLTPHOSDigit" , 500); 
+
+  ScanFileList();
+  cout << "AliHLTPHOSIsolatedMipTrigger::Analyze fNFiles = " << fNFiles  <<endl;
+
+  for(int file=0; file < fNFiles; file ++)
+    {
+     printf("\n AliHLTPHOSIsolatedMipTrigger::Analyze, analyzing file %s\n", fFileList[file]);   
+      
+      TFile *infile = infile->Open(fFileList[file],"read");
+      //      TFile *infile = infile->Open("/tmp/data2/digits151007/run8340_digitTree_5.root","read");
+
+      AliHLTPHOSDigit *tmpDigit = 0;  
+
+      if(infile == 0)
+       {
+         cout << "ERROR could not open file" << endl;
+       }
+      else
+       {
+         
+         infile->cd();
+         cout << "File successfully opened, creating" << endl;
+         TChain *cain= new TChain("digitTree");
+         TClonesArray *digArray = new TClonesArray("AliHLTPHOSDigit" , 100);
+
+         cain->Add(fFileList[file]);
+
+         int nThrees =  cain->GetEntries() ;
+         cout << "there are "  <<  nThrees  <<  " entries in this file" << endl;
+         cain->SetBranchAddress("Digit", &digArray);
+
+         for(int i=0; i< nThrees; i++)
+           {
+             fClusterManager->ResetMipManager(); 
+             cain->GetEntry(i);
+             int nArrays = digArray->GetEntriesFast();
+
+             if(i%100 == 0)
+               {
+                 cout << "processing event " << i << "  of file  " << fFileList[file] <<endl;
+               }
+             
+        
+             for(int j=0; j < nArrays; j++)
+               {
+
+                 tmpDigit = (AliHLTPHOSDigit*)digArray->At(j);
+                     
+                 if( IsMipCandidate(tmpDigit) == true)
+                   {
+                     fClusterManager->AddDigit(tmpDigit);
+                   }
+               }
+             
+             FillClusterHistograms();
+           }
+         delete digArray;
+         delete cain;
+         infile->Close(); 
+         delete infile;
+       }
+      
+      WriteHistograms();
+
+    }
+  return 0;
+}
+
+
+bool
+AliHLTPHOSIsolatedMipTrigger::IsMipCandidate(AliHLTPHOSDigit  *digit)
+{
+  bool ret = false;
+  Float_t amplitude = digit->GetAmplitude();
+  Int_t *data =  digit->GetRawData();
+  Float_t sum = 0;
+  Float_t q;
+
+  if( amplitude > fMipLowCut && amplitude < fMipHighCut)
+    {
+      int start = digit->GetPreSamples();
+      int end = digit->GetTotalSamples() - start;
+      for(int  i = start; i < end; i++)
+       {
+         sum+=data[i];
+       }
+      
+      q = ((Float_t)sum)/amplitude;
+
+      if( (q > Q_MIN) && (q < Q_MAX))
+       {
+         ret = true;
+       }
+    }
+  return ret;
+
+}
+
+
+
+void
+AliHLTPHOSIsolatedMipTrigger::Init()
+{
+  
+  char tmpHistoName[256];
+
+  for(int z = 0; z < N_ZROWS_MOD; z ++)
+    {
+      for(int x = 0; x < N_XCOLUMNS_MOD; x ++)
+       {
+         sprintf(tmpHistoName, "ClusterEnergies3x3_%d_%d_%d_%d",(int)fModuleId,  z, x, 1);
+         fClusterHistograms[z][x] = new TH1F( tmpHistoName, tmpHistoName, N_BINS, XBIN_LOW, XBIN_UP);
+       }
+    } 
+}
+
+
+
+void 
+AliHLTPHOSIsolatedMipTrigger::FillClusterHistograms()
+{
+  int cnt = 0;
+  AliHLTPHOSMipCluster* tmp;
+
+  for(int z = 0; z < N_ZROWS_MOD; z ++)
+    {
+      for(int x = 0; x < N_XCOLUMNS_MOD; x ++)
+       {
+         tmp = fClusterManager->GetCluster(z, x);
+         if(tmp != 0)
+           {
+             fClusterHistograms[z][x]->Fill(tmp->Get3x3Sum());
+             cnt ++;
+           }
+       }
+    } 
+  
+  //  cout << "filled  " << cnt <<"  clusters"  <<endl;
+}
+
+void
+AliHLTPHOSIsolatedMipTrigger::WriteHistograms()
+{
+  char tmpFileName[256];
+  sprintf(tmpFileName, "ClusterEnergies.root");
+
+  TFile *clusterFile =  new TFile(tmpFileName, "recreate");
+
+  for(int z = 0; z < N_ZROWS_MOD; z ++)
+    {
+      for(int x = 0; x < N_XCOLUMNS_MOD; x ++)
+       {
+         if(fClusterHistograms[z][x]->GetEntries() > 10 )
+           {
+             fClusterHistograms[z][x]->Write();
+           }
+       }
+    }  
+
+  clusterFile->Close();
+
+  delete clusterFile;
+}
diff --git a/HLT/PHOS/ana/IMT/AliHLTPHOSIsolatedMipTrigger.h b/HLT/PHOS/ana/IMT/AliHLTPHOSIsolatedMipTrigger.h
new file mode 100644 (file)
index 0000000..50c6e0d
--- /dev/null
@@ -0,0 +1,67 @@
+#ifndef ALIHLTPHOSISOLATEDMIPTRIGGER_H
+#define ALIHLTPHOSISOLATEDMIPTRIGGER_H
+
+
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear     *
+ * Physics Group, Dep. of Physics                                         *
+ * University of Oslo, Norway, 2007                                       *
+ *                                                                        *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate.              *
+ * Please report bugs to perthi@fys.uio.no                                *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+
+#include "AliHLTPHOSMipCluster.h"
+#include "AliHLTPHOSConstants.h"
+#include "Rtypes.h"
+#include "AliHLTPHOSMipClusterManager.h"
+#include "TH1.h"
+
+#define MAXFILES 1000
+
+using namespace PhosHLTConst;
+
+class  AliHLTPHOSDigit;
+
+class  AliHLTPHOSIsolatedMipTrigger
+{
+public:
+  AliHLTPHOSIsolatedMipTrigger();
+  virtual ~AliHLTPHOSIsolatedMipTrigger();
+  void SetFilePath(char *path);
+  int  Analyze();
+  void SetMipLowCut(Float_t lCut);
+  void SetMipHighCut(Float_t hCut); 
+  int  ScanFileList(); //scans the file filelist.txt, the files to analyze
+  void Init();
+  
+  void FillClusterHistograms();
+  TH1F *fClusterHistograms[N_ZROWS_MOD][N_XCOLUMNS_MOD];
+  void WriteHistograms(); 
+
+
+private:
+  // char **fFileList;
+  char fFileList[MAXFILES][256];
+  int fNFiles;
+  int fModuleId;
+
+  bool IsMipCandidate(AliHLTPHOSDigit *digit);
+  AliHLTPHOSMipClusterManager *fClusterManager;
+  //  char fCurrentFilePath[256];
+  Float_t fMipLowCut;
+  Float_t fMipHighCut;
+};
+
+#endif
+
diff --git a/HLT/PHOS/ana/IMT/AliHLTPHOSMipCluster.cxx b/HLT/PHOS/ana/IMT/AliHLTPHOSMipCluster.cxx
new file mode 100644 (file)
index 0000000..2baff8c
--- /dev/null
@@ -0,0 +1,299 @@
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear     *
+ * Physics Group, Dep. of Physics                                         *
+ * University of Oslo, Norway, 2007                                       *
+ *                                                                        *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate.              *
+ * Please report bugs to perthi@fys.uio.no                                *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+#include "AliHLTPHOSMipCluster.h"
+#include "AliHLTPHOSDigit.h"
+
+AliHLTPHOSMipCluster::AliHLTPHOSMipCluster() : fZ(0),
+                                              fX(0),
+                                              fEntries(0)
+{
+  for(int z=0; z <Z_RANGE; z++)
+    {
+      for(int x=0;  x < X_RANGE; x++)
+       {
+         fMipcluster[z][x]= new AliHLTPHOSDigit();
+       }
+    }
+}
+
+
+AliHLTPHOSMipCluster::~AliHLTPHOSMipCluster()
+{
+
+}
+
+
+int             
+AliHLTPHOSMipCluster::GetEntries()
+{
+  return fEntries;
+}
+
+
+void
+AliHLTPHOSMipCluster::ResetMipCluster()
+{
+   for(int i=0; i<5; i++)
+    {
+      for(int j=0; j<5; j++)
+       {
+         fMipcluster[i][j]->SetX(-1);
+         fMipcluster[i][j]->SetZ(-1);
+         fMipcluster[i][j]->SetAmplitude(-1); 
+         fMipcluster[i][j]->SetCrazyness(-1);
+         //      fMipcluster[i][j]->SetZ(0);
+         fMipcluster[i][j]->SetEnergy(-1);
+       }
+
+    } 
+   fEntries = 0;
+   fZ = 0;
+   fX = 0;
+}
+
+
+void
+AliHLTPHOSMipCluster::AddDigit(AliHLTPHOSDigit *digit)
+{
+  int relZ = digit->GetZ() -fZ +2; //Z corrdinate relative to the 5x5 clustertable
+  int relX = digit->GetX() -fX +2; //X corrdinate relative to the 5x5 clustertable
+  CopyDigit(digit, fMipcluster[relZ][relX]);
+  fEntries  ++;
+}
+
+
+void 
+AliHLTPHOSMipCluster::CopyDigit(AliHLTPHOSDigit *inDigit, AliHLTPHOSDigit *copiedDigit)
+{
+  if(inDigit == 0)
+    {
+      cout << "AliHLTPHOSMipCluster::CopyDigit, Fatal ERROR digit == NULL" << endl;
+    }
+
+  else if(copiedDigit == 0)
+    {
+      cout << "AliHLTPHOSMipCluster::CopyDigit, Fatal ERROR copydigit == NULL" << endl;
+    } 
+
+  else
+    {
+      copiedDigit->SetZ(inDigit->GetZ());
+      copiedDigit->SetX(inDigit->GetX());
+      copiedDigit->SetAmplitude(inDigit->GetAmplitude());
+      copiedDigit->SetCrazyness(inDigit->GetCrazyness());
+      copiedDigit->SetEnergy(inDigit->GetEnergy());
+      copiedDigit->SetGain(inDigit->GetGain());
+      copiedDigit->SetTime(inDigit->GetTime());
+      copiedDigit->SetRawData(inDigit->GetRawData());
+    }
+}
+
+
+void
+AliHLTPHOSMipCluster::Remap()
+{
+  AliHLTPHOSDigit *tmpmipcluster[Z_RANGE][X_RANGE]; 
+
+  for(int z=0; z < Z_RANGE; z++ )
+    {
+      for(int x=0; x < X_RANGE; x++ )
+       {
+         tmpmipcluster[z][x] = fMipcluster[z][x];  
+       }   
+    }
+  
+  for(int z=0; z < Z_RANGE; z++ )
+    {
+      for(int x=0; x < X_RANGE; x++ )
+       {
+         int relZ = tmpmipcluster[z][x]->GetZ() -fZ +2;
+         int relX = tmpmipcluster[z][x]->GetX() -fX +2;
+
+         if(relZ < 0 || relX <0)
+           {
+             if(  (tmpmipcluster[z][x]->GetZ() >= 0 )  &&  (tmpmipcluster[z][x]->GetX() >=0)  ) 
+               {
+
+                 /*
+                 cout << endl;
+                 cout << "INFO:  AliHLTPHOSMipCluster::Remap() (relZ, relX)           =  " <<"(" << relZ << ","<< relX << ")"<<endl;
+                 cout << "    :  AliHLTPHOSMipCluster::Remap() (clusterZ, clusterX)  =  " <<"(" <<  tmpmipcluster[z][x]->GetZ()  << ","<<  tmpmipcluster[z][x]->GetX() << ")"<<endl;
+                 cout << "    :  AliHLTPHOSMipCluster::Remap() (z, x)                 =  " <<"(" << z << ","<< x << ")"<<endl;
+                 cout << "    :  AliHLTPHOSMipCluster::Remap() (fZ, fX)               =  " <<"(" << fZ << ","<< fX << ")"<<endl;
+                 cout << endl;
+                 */
+               }
+           }
+
+
+         if( (relZ >= 0)   &&  (relZ < Z_RANGE) &&  (relX >= 0)  && (relX < X_RANGE)  &&    (z >= 0)  && (z < Z_RANGE) &&  (x >= 0)  && (x < X_RANGE))
+           {
+             if(  (relZ >= 0 )  &&   (relX >= 0)  )
+               {
+                 if((relZ < Z_RANGE)  && (relX < X_RANGE)  &&    (z >= 0)  && (z < Z_RANGE) &&  (x >= 0)  && (x < X_RANGE))
+                   {
+                  
+                     int relZ = tmpmipcluster[z][x]->GetZ() -fZ +2;
+                     int relX = tmpmipcluster[z][x]->GetX() -fX +2;   
+                   
+                     if( (relZ == 0) && (relX == 0) )
+                       {
+                         cout <<"AliHLTPHOSMipCluster::Remap(), ERROR,(z,x) ="<< "(" <<relZ << "," << relX <<")" <<endl;
+                       }
+                     
+
+                     AliHLTPHOSDigit *swap = fMipcluster[relZ][relX];
+                     fMipcluster[relZ][relX] = tmpmipcluster[z][x];
+                     fMipcluster[z][x] = swap;
+                   }  
+                 
+       
+                 else
+                   {
+                     /*
+                     cout << endl;
+                     cout <<"AliHLTPHOSMipCluster::Remap(), fatal ERROR in coordinates" << endl;
+                     cout << "AliHLTPHOSMipCluster::Remap(),  fZ ="<<  fZ  << endl;
+                     cout << "AliHLTPHOSMipCluster::Remap(),  fX ="<<  fX  << endl;      
+                     cout << "AliHLTPHOSMipCluster::Remap(),  tmpmipcluster[z][x]->GetZ() ="<<  tmpmipcluster[z][x]->GetZ()  << endl;
+                     cout << "AliHLTPHOSMipCluster::Remap(),  tmpmipcluster[z][x]->GetX() ="<<  tmpmipcluster[z][x]->GetX()  << endl;    
+                     cout << "AliHLTPHOSMipCluster::Remap(), relZ =  "  << relZ << endl;
+                     cout << "AliHLTPHOSMipCluster::Remap(), relX =  "  << relX << endl;       
+                     cout << endl;
+                     */
+                   }
+
+                 
+               }
+           }
+         
+       }   
+    }
+  //  cout << "AliHLTPHOSMipCluster::Remap(), clusters after remap ="  << endl;
+  //  PrintInfo();
+}
+
+void
+AliHLTPHOSMipCluster::ResetDigit(int z, int x)
+{
+  //  fMipcluster[z][x];
+}
+
+
+void
+AliHLTPHOSMipCluster::PrintInfo()
+{
+  cout << endl;
+  cout << "Printing amplitudes for cluster " << endl;
+  cout << "Z Center = " << fZ << endl;
+  cout << "X Center = " << fX << endl;
+
+  cout << "3x3 sum =" << Get3x3Sum() << endl;
+   
+  for(int z = 0; z< Z_RANGE; z ++)
+    {
+      for(int x = 0;  x < X_RANGE;  x ++)  
+       {
+         cout  << fMipcluster[z][x]  <<"\t";;
+       }
+
+      cout << endl;
+    } 
+  
+  
+  for(int z = 0; z< Z_RANGE; z ++)
+    {
+      for(int x = 0;  x < X_RANGE;  x ++)  
+       {
+         cout  << fMipcluster[z][x]->GetAmplitude()  <<"\t";;
+       }
+
+      cout << endl;
+    }
+
+  //  cout << endl;
+
+  for(int z = 0; z< Z_RANGE; z ++)
+    {
+      for(int x = 0;  x < X_RANGE;  x ++)  
+       {
+         
+         cout  << "("<< fMipcluster[z][x]->GetZ()  <<","<<fMipcluster[z][x]->GetX() << ")" <<"\t";
+       }
+      cout << endl;
+    }
+
+    cout << endl;
+}
+
+
+void
+AliHLTPHOSMipCluster:: SetCenterCoordinate(int z, int x)
+{
+  fZ = z;
+  fX = x;
+}
+
+
+Float_t
+AliHLTPHOSMipCluster::GetCenterAmplitude()
+{
+  return  fMipcluster[2][2]->GetAmplitude();
+}
+
+
+Int_t
+AliHLTPHOSMipCluster::GetZ()
+{
+  return fZ;
+}
+
+
+Int_t
+AliHLTPHOSMipCluster::GetX()
+{
+  return fX;
+}
+
+
+Float_t
+AliHLTPHOSMipCluster::Get3x3Sum()
+{
+  Float_t tmpSum = 0;
+  
+  Float_t tmpAmp = 0;
+
+  for(int z =1; z <= 3; z++)
+    {
+      for(int x =1; x <= 3; x++)
+       {
+         //      cout <<  "AliHLTPHOSMipCluster::Get3x3Sum(), z =" << z << "x=" << x << endl;
+
+         tmpAmp = fMipcluster[z][x]->GetAmplitude(); 
+
+         if(tmpAmp > 0)
+           {
+             tmpSum += tmpAmp;
+           }
+         
+       } 
+      
+    } 
+
+  return tmpSum;
+}
diff --git a/HLT/PHOS/ana/IMT/AliHLTPHOSMipCluster.h b/HLT/PHOS/ana/IMT/AliHLTPHOSMipCluster.h
new file mode 100644 (file)
index 0000000..388d748
--- /dev/null
@@ -0,0 +1,57 @@
+#ifndef ALIHLTPHOSMIPCLUSTER_H
+#define ALIHLTPHOSMIPCLUSTER_H
+
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear     *
+ * Physics Group, Dep. of Physics                                         *
+ * University of Oslo, Norway, 2007                                       *
+ *                                                                        *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate.              *
+ * Please report bugs to perthi@fys.uio.no                                *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+#include "AliHLTPHOSConstants.h"
+#include "Rtypes.h"
+
+using namespace PhosHLTConst;
+
+class AliHLTPHOSDigit;
+
+#define Z_RANGE 5
+#define X_RANGE 5
+
+class  AliHLTPHOSMipCluster
+{
+public:  
+  AliHLTPHOSMipCluster();
+  virtual ~AliHLTPHOSMipCluster();
+  void AddDigit(AliHLTPHOSDigit *digit);
+  Float_t GetCenterAmplitude();
+  void ResetMipCluster();
+  void SetCenterCoordinate(int z, int x);
+  Int_t GetZ();
+  Int_t GetX();
+  Int_t GetEntries();
+  Float_t Get3x3Sum();
+
+  void PrintInfo();
+  void Remap(); // maps the digits relative to the center corrdinate
+
+private:
+  void ResetDigit(int z, int x);
+  void CopyDigit(AliHLTPHOSDigit *inDigit, AliHLTPHOSDigit *copiedDigit);
+  int fZ;
+  int fX;
+  int fEntries;
+  AliHLTPHOSDigit *fMipcluster[Z_RANGE][X_RANGE];
+};
+
+#endif
diff --git a/HLT/PHOS/ana/IMT/AliHLTPHOSMipClusterManager.cxx b/HLT/PHOS/ana/IMT/AliHLTPHOSMipClusterManager.cxx
new file mode 100644 (file)
index 0000000..f0496ec
--- /dev/null
@@ -0,0 +1,302 @@
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear     *
+ * Physics Group, Dep. of Physics                                         *
+ * University of Oslo, Norway, 2007                                       *
+ *                                                                        *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate.              *
+ * Please report bugs to perthi@fys.uio.no                                *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+#include "AliHLTPHOSMipClusterManager.h"
+#include "AliHLTPHOSMipCluster.h"
+#include "AliHLTPHOSDigit.h"
+
+
+AliHLTPHOSMipClusterManager::AliHLTPHOSMipClusterManager()  
+{
+  
+  for(int z=0; z<N_ZROWS_MOD; z++)
+    {
+      for(int x =0; x <N_XCOLUMNS_MOD; x++)
+       {
+         fMipClusterFarm[z][x] = new  AliHLTPHOSMipCluster();
+         fMipClusterTable[z][x] = 0;
+         //      fMipClusterFarm[z][x]->PrintInfo();
+       }
+    }
+}
+
+
+
+AliHLTPHOSMipClusterManager::~AliHLTPHOSMipClusterManager()
+{
+
+}
+
+
+void
+AliHLTPHOSMipClusterManager::AddDigit(AliHLTPHOSDigit *inDigit)
+{
+  int tmpZ = inDigit->GetZ();
+  int tmpX = inDigit->GetX();
+
+  //  cout << "searching for neighbour ar Z =" << tmpZ << "  tmpX ="<< tmpX <<endl;
+
+  AliHLTPHOSMipCluster *mipCluster = GetNeighbour(Z_CENTER_RANGE, X_CENTER_RANGE, tmpZ, tmpX);
+                
+  if(mipCluster != 0)
+    {
+      if(mipCluster->GetCenterAmplitude() < inDigit->GetAmplitude())
+       {
+         int oldZ = mipCluster->GetZ();
+         int oldX = mipCluster->GetX();
+         AliHLTPHOSMipCluster *tmpCluster = MoveCluster(oldZ, oldX, tmpZ, tmpX);
+         tmpCluster->AddDigit(inDigit);
+       }
+      else
+       {
+         //      cout <<"adding digit to exsising cluster"<< endl;             
+         mipCluster->AddDigit(inDigit);
+       }
+    }
+                
+  else
+    {
+      //      cout <<"creating new  cluster"<< endl;  
+      NewMipTableEntry(inDigit, tmpZ, tmpX);
+      
+
+      //     cout << "fMipCnt   " << fMipCnt  <<endl;
+      fMipCnt ++;  
+    }
+}
+
+
+void
+AliHLTPHOSMipClusterManager::NewMipTableEntry(AliHLTPHOSDigit *digit, int z, int x)
+{
+  if(digit == 0)
+    {
+      cout << "AliHLTPHOSMipClusterManager::NewMipTableEntry, Error, digit = NULL" << endl;
+    }
+
+  else
+    {
+      //      fMipClusterTable[z][x] =  fMipClusterFarm[fMipCnt];
+      fMipClusterTable[z][x] =  fMipClusterFarm[z][x];
+      fMipClusterTable[z][x]->SetCenterCoordinate(z,  x); 
+      fMipClusterFarm[z][x]->AddDigit(digit); 
+    }
+
+}
+
+
+AliHLTPHOSMipCluster* 
+AliHLTPHOSMipClusterManager::MoveCluster(int zFrom, int xFrom, int zTo, int xTo )
+{
+  AliHLTPHOSMipCluster *swapTo   = fMipClusterFarm[zFrom][xFrom]; 
+  AliHLTPHOSMipCluster *swapFrom = fMipClusterFarm[zTo][xTo];   
+
+  //  fMipClusterFarm[zTo][xTo] = swapFrom; 
+  // fMipClusterFarm[zFrom][xFrom] = swapTo; 
+
+  fMipClusterFarm[zTo][xTo] = swapTo; 
+  fMipClusterFarm[zFrom][xFrom] = swapFrom; 
+
+  fMipClusterTable[zFrom][xFrom] = 0; 
+  fMipClusterTable[zTo][xTo] = fMipClusterFarm[zTo][xTo];
+
+  fMipClusterFarm[zFrom][xFrom]->SetCenterCoordinate(zFrom, xFrom);
+  fMipClusterFarm[zTo][xTo]->SetCenterCoordinate(zTo, xTo);
+
+
+  fMipClusterTable[zFrom][xFrom] = 0; 
+  fMipClusterTable[zTo][xTo] = fMipClusterFarm[zTo][xTo];
+
+  //  fMipClusterFarm[zFrom][xFrom]->Remap();
+  fMipClusterFarm[zFrom][xFrom]->ResetMipCluster();
+
+  fMipClusterFarm[zTo][xTo]->Remap();
+
+  return fMipClusterTable[zTo][xTo];
+}
+
+
+AliHLTPHOSMipCluster*
+AliHLTPHOSMipClusterManager::GetNeighbour(int zRange, int xRange, int zIn, int xIn)
+{
+  AliHLTPHOSMipCluster* tmp = 0;
+
+  if(fMipClusterTable[zIn][xIn] != 0)
+    {
+      //      cout  << "ERROR; table[" <<zIn << "]["<< xIn << "]" << "already filled for this event" << endl;
+    }
+  else
+    {
+      int tmpZmin = 0;
+      int tmpZmax = 0;    
+      int tmpXmin = 0;
+      int tmpXmax = 0;        
+
+      
+      if(zIn -zRange < 0)
+       {
+         tmpZmin = 0;
+       }
+      else
+       {
+         tmpZmin = zIn - zRange;
+       }
+     
+      if(zIn + zRange > N_ZROWS_MOD)
+       {
+        tmpZmax = N_ZROWS_MOD ;
+       }
+      else
+       {
+         tmpZmax = zIn + zRange;
+       }
+
+
+       if(xIn - xRange < 0)
+       {
+         tmpXmin = 0;
+       }
+      else
+       {
+         tmpXmin = xIn - xRange;
+       }
+     
+      if(xIn + xRange > N_XCOLUMNS_MOD)
+       {
+        tmpXmax = N_XCOLUMNS_MOD ;
+       } 
+      else
+       {
+         tmpXmax = xIn + xRange;
+       }
+      
+      for(int z = tmpZmin; z < tmpZmax; z ++)
+       {
+         for(int x = tmpXmin; x < tmpXmax; x ++) 
+           {
+             if( fMipClusterTable[z][x] != 0 )
+               {
+                 tmp = fMipClusterTable[z][x];
+               }
+           }
+       }
+    }
+  
+  return tmp;
+  
+}
+
+
+void 
+AliHLTPHOSMipClusterManager::AddToMipTable(AliHLTPHOSDigit *digit)
+{
+
+  int z = digit->GetZ();
+  int x = digit->GetX();
+  
+  if(fMipClusterTable[z][x] == 0)
+    {
+      fMipClusterTable[z][x] = fMipClusterFarm[z][x];
+    }
+}
+
+
+void
+AliHLTPHOSMipClusterManager::PrintDigitInfo(AliHLTPHOSDigit *digit)
+{
+  Int_t *data = digit->GetRawData();
+  //  cout << endl;
+  cout <<"Gain = " << digit->GetGain()  <<endl;
+  cout <<"Z = " << digit->GetZ()  <<endl;
+  cout <<"X = " << digit->GetX()  <<endl;
+  cout <<"amplitude = " << digit->GetAmplitude()  <<endl; 
+  cout <<"crazynes =  " << digit->GetCrazyness()  <<endl;
+  
+  for(int i=0; i< 70; i++)
+    {
+      cout  << data[i]<<"\t"; 
+    }
+   
+  void CopyDigit(AliHLTPHOSDigit *inDigit, AliHLTPHOSDigit *copiedDigit);
+  cout << endl;
+}
+
+
+void
+AliHLTPHOSMipClusterManager::ResetMipManager()
+{
+  ResetClusterFarm();
+
+  for(int z=0; z<N_ZROWS_MOD; z++)
+    {
+      for(int x =0; x <N_XCOLUMNS_MOD; x++)
+       {
+         //      if(fMipClusterTable[z][x] != 0)
+         //        {
+         //          ResetClusterFarm();
+         //        }
+         
+         fMipClusterTable[z][x] = 0;
+       }
+    }
+}
+
+
+void
+AliHLTPHOSMipClusterManager::ResetClusterFarm()
+{
+
+  for(int z=0;  z < N_ZROWS_MOD; z++ )
+    {
+      for(int x=0; x < N_XCOLUMNS_MOD; x ++)
+       {
+         fMipClusterFarm[z][x]->ResetMipCluster();
+       }
+    }
+}
+
+
+
+void
+AliHLTPHOSMipClusterManager::PrintClusters(int minEntries)
+{
+  for(int z=0; z<N_ZROWS_MOD; z++)
+    {
+      for(int x =0; x <N_XCOLUMNS_MOD; x++)
+       {
+         if(fMipClusterTable[z][x] != 0)
+           {
+             if( fMipClusterTable[z][x]->GetEntries() >= minEntries  )
+             {
+               cout << endl;
+               cout << "AliHLTPHOSIsolatedMipTrigger::PrintClusters, printing info for"  << endl;
+               cout << "mipClusterTable[" << z << "][" << x << "]";
+               fMipClusterTable[z][x]->PrintInfo();
+             }
+           }
+       }
+    }
+}
+
+
+AliHLTPHOSMipCluster*
+AliHLTPHOSMipClusterManager::GetCluster(int z, int x)
+{
+  return fMipClusterTable[z][x];
+}
+
+
diff --git a/HLT/PHOS/ana/IMT/AliHLTPHOSMipClusterManager.h b/HLT/PHOS/ana/IMT/AliHLTPHOSMipClusterManager.h
new file mode 100644 (file)
index 0000000..776487f
--- /dev/null
@@ -0,0 +1,66 @@
+#ifndef ALIHLTPHOSMIPCLUSTERMANAGER_H
+#define ALIHLTPHOSMIPCLUSTERMANAGER_H
+
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear     *
+ * Physics Group, Dep. of Physics                                         *
+ * University of Oslo, Norway, 2007                                       *
+ *                                                                        *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate.              *
+ * Please report bugs to perthi@fys.uio.no                                *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+#include "AliHLTPHOSConstants.h"
+#include "Rtypes.h"
+
+using namespace PhosHLTConst;
+
+#define maxMipsCandidates  5000
+#define Z_CENTER_RANGE 2   //center +/-2 (=5)
+#define X_CENTER_RANGE 2   //center +/-2 (=5)
+
+
+class AliHLTPHOSMipCluster;
+class AliHLTPHOSDigit;
+
+class  AliHLTPHOSMipClusterManager
+{
+public:
+  AliHLTPHOSMipClusterManager();
+  virtual ~AliHLTPHOSMipClusterManager();
+
+  void AddDigit(AliHLTPHOSDigit *digit);
+  void PrintDigitInfo(AliHLTPHOSDigit *digit);
+  void PrintClusters(int minEntries = 0);
+  void ResetMipManager(); 
+  AliHLTPHOSMipCluster* GetCluster(int z, int x);
+
+  
+private:
+  void ResetClusterFarm();
+  void AddToMipTable(AliHLTPHOSDigit *digit);
+  bool IsMipCandidate(AliHLTPHOSDigit *digit);
+  AliHLTPHOSMipCluster* MoveCluster(int zFrom, int xFrom, int zTo, int xTo );
+  void NewMipTableEntry(AliHLTPHOSDigit *digit, int z, int x); 
+  AliHLTPHOSMipCluster* GetNeighbour(int zRange, int xRange, int zIn, int xIn);
+  //  AliHLTPHOSMipCluster  *fMipClusterFarm[maxMipsCandidates];
+  AliHLTPHOSMipCluster *fMipClusterTable[N_ZROWS_MOD][N_XCOLUMNS_MOD];
+  AliHLTPHOSMipCluster *fMipClusterFarm[N_ZROWS_MOD][N_XCOLUMNS_MOD];
+  int fMipCnt;
+
+  bool fIsMoreClusters;
+  
+  
+
+};
+
+#endif
+
diff --git a/HLT/PHOS/ana/IMT/AliHLTPHOSModuleXCoordinate.cxx b/HLT/PHOS/ana/IMT/AliHLTPHOSModuleXCoordinate.cxx
new file mode 100644 (file)
index 0000000..efb171e
--- /dev/null
@@ -0,0 +1,67 @@
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear     *
+ * Physics Group, Dep. of Physics                                         *
+ * University of Oslo, Norway, 2007                                       *
+ *                                                                        *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate.              *
+ * Please report bugs to perthi@fys.uio.no                                *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+#include "AliHLTPHOSModuleXCoordinate.h"
+#include "AliHLTPHOSConstants.h"
+#include "Rtypes.h"
+#include <iostream>
+
+using namespace PhosHLTConst;
+using namespace std;
+
+AliHLTPHOSModuleXCoordinate::AliHLTPHOSModuleXCoordinate(int x) : fX(x)
+{
+  //  SetX(x);
+}
+
+
+AliHLTPHOSModuleXCoordinate::AliHLTPHOSModuleXCoordinate() : fX(0)
+{
+  //never to be called
+}
+
+
+
+AliHLTPHOSModuleXCoordinate::~AliHLTPHOSModuleXCoordinate()
+{
+
+}
+
+
+void
+AliHLTPHOSModuleXCoordinate::SetX(int x)
+{
+  if( (x >= 0)  && (x < N_XCOLUMNS_MOD) )
+    {
+      fX = x;
+    }
+  else
+    {
+      cout << "ERROR, x value out of range" << endl;
+      cout << "Attemt to set x to " << x <<endl;
+      cout << "Allowd arne is " << 0 << " to " << N_XCOLUMNS_MOD <<endl;
+    }
+
+}
+
+
+
+int
+AliHLTPHOSModuleXCoordinate::GetX()
+{
+  return fX;
+}
diff --git a/HLT/PHOS/ana/IMT/AliHLTPHOSModuleXCoordinate.h b/HLT/PHOS/ana/IMT/AliHLTPHOSModuleXCoordinate.h
new file mode 100644 (file)
index 0000000..58e7cbf
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef ALIHLTPHOSMODULEXCOORDINATE_H
+#define ALIHLTPHOSMODULEXCOORDINATE_H
+
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear     *
+ * Physics Group, Dep. of Physics                                         *
+ * University of Oslo, Norway, 2007                                       *
+ *                                                                        *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate.              *
+ * Please report bugs to perthi@fys.uio.no                                *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+
+
+
+class  AliHLTPHOSModuleXCoordinate
+{
+public: 
+  AliHLTPHOSModuleXCoordinate(int x);
+  AliHLTPHOSModuleXCoordinate();
+  virtual ~AliHLTPHOSModuleXCoordinate();
+  void SetX(int x);
+  int GetX();
+
+private:
+  int fX;
+
+};
+
+#endif
diff --git a/HLT/PHOS/ana/IMT/AliHLTPHOSModuleZCoordinate.cxx b/HLT/PHOS/ana/IMT/AliHLTPHOSModuleZCoordinate.cxx
new file mode 100644 (file)
index 0000000..369a0e4
--- /dev/null
@@ -0,0 +1,66 @@
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear     *
+ * Physics Group, Dep. of Physics                                         *
+ * University of Oslo, Norway, 2007                                       *
+ *                                                                        *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate.              *
+ * Please report bugs to perthi@fys.uio.no                                *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+#include "AliHLTPHOSModuleZCoordinate.h"
+#include "AliHLTPHOSConstants.h"
+#include "Rtypes.h"
+#include <iostream>
+
+//  const unsigned int N_ZROWS_MOD      =  56;                    /**<Number of rows per module*/       
+//  const unsigned int N_XCOLUMNS_MOD   =  64;  
+
+using namespace PhosHLTConst;
+using namespace std;
+
+
+AliHLTPHOSModuleZCoordinate::AliHLTPHOSModuleZCoordinate(int z) : fZ(0)
+{
+  SetZ(z);
+}
+
+
+AliHLTPHOSModuleZCoordinate::AliHLTPHOSModuleZCoordinate() : fZ(0)
+{
+  //never to be called
+}
+
+AliHLTPHOSModuleZCoordinate::~AliHLTPHOSModuleZCoordinate()
+{
+
+}
+
+void
+AliHLTPHOSModuleZCoordinate::SetZ(int z)
+{
+  if( (z >= 0)  && (z < N_ZROWS_MOD) )
+    {
+      fZ = z;
+    }
+  else
+    {
+      cout << "ERROR, x value out of range" << endl;
+      cout << "Attemt to set z to " << z <<endl;
+      cout << "Allowd arne is " << 0 << " to " << N_ZROWS_MOD <<endl;
+    }
+
+}
+
+int
+AliHLTPHOSModuleZCoordinate::GetZ()
+{
+  return fZ;
+}
diff --git a/HLT/PHOS/ana/IMT/AliHLTPHOSModuleZCoordinate.h b/HLT/PHOS/ana/IMT/AliHLTPHOSModuleZCoordinate.h
new file mode 100644 (file)
index 0000000..6e97288
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef ALIHLTPHOSMODULEZCOORDINATE_H
+#define ALIHLTPHOSMODULEZCOORDINATE_H
+
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear     *
+ * Physics Group, Dep. of Physics                                         *
+ * University of Oslo, Norway, 2007                                       *
+ *                                                                        *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate.              *
+ * Please report bugs to perthi@fys.uio.no                                *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+
+
+
+class  AliHLTPHOSModuleZCoordinate
+{
+public:
+  AliHLTPHOSModuleZCoordinate(int z);
+  AliHLTPHOSModuleZCoordinate(); 
+  virtual ~AliHLTPHOSModuleZCoordinate();
+  void SetZ(int z);
+  int GetZ();
+
+private:
+  int fZ;
+
+};
+
+#endif
diff --git a/HLT/PHOS/ana/IMT/AliHLTPHOSModuleZXCoordinate.cxx b/HLT/PHOS/ana/IMT/AliHLTPHOSModuleZXCoordinate.cxx
new file mode 100644 (file)
index 0000000..5fc9e2f
--- /dev/null
@@ -0,0 +1,74 @@
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear     *
+ * Physics Group, Dep. of Physics                                         *
+ * University of Oslo, Norway, 2007                                       *
+ *                                                                        *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate.              *
+ * Please report bugs to perthi@fys.uio.no                                *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+
+#include "AliHLTPHOSModuleZXCoordinate.h"
+#include "AliHLTPHOSModuleXCoordinate.h"
+#include "AliHLTPHOSModuleZCoordinate.h"
+
+AliHLTPHOSModuleZXCoordinate::AliHLTPHOSModuleZXCoordinate(AliHLTPHOSModuleZCoordinate& z, AliHLTPHOSModuleXCoordinate& x): fZ(0),             
+                                                                                                                           fX(0)
+{
+ SetZ(z); 
+ SetX(x);
+}
+
+
+
+AliHLTPHOSModuleZXCoordinate::AliHLTPHOSModuleZXCoordinate() : fZ(0), 
+                                                              fX(0)
+{
+  
+}
+
+AliHLTPHOSModuleZXCoordinate::~AliHLTPHOSModuleZXCoordinate()
+{
+
+}
+
+void 
+AliHLTPHOSModuleZXCoordinate::SetZXCoordinate(AliHLTPHOSModuleZCoordinate&  z, AliHLTPHOSModuleXCoordinate& x)
+{
+  SetZ(z); 
+  SetX(x);
+}
+
+AliHLTPHOSModuleXCoordinate
+AliHLTPHOSModuleZXCoordinate::GetX()
+{
+  return fX;
+}
+
+AliHLTPHOSModuleZCoordinate
+AliHLTPHOSModuleZXCoordinate::GetZ()
+{
+  return fZ;
+}
+
+
+void
+AliHLTPHOSModuleZXCoordinate::SetX(AliHLTPHOSModuleXCoordinate &x )
+{
+  fX = x;
+}
+
+void
+AliHLTPHOSModuleZXCoordinate::SetZ(AliHLTPHOSModuleZCoordinate &z )
+{
+  fZ = z; 
+}
diff --git a/HLT/PHOS/ana/IMT/AliHLTPHOSModuleZXCoordinate.h b/HLT/PHOS/ana/IMT/AliHLTPHOSModuleZXCoordinate.h
new file mode 100644 (file)
index 0000000..b621ecd
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef ALIHLTPHOSMODULEZXCOORDINATE_H
+#define ALIHLTPHOSMODULEZXCOORDINATE_H
+
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear     *
+ * Physics Group, Dep. of Physics                                         *
+ * University of Oslo, Norway, 2007                                       *
+ *                                                                        *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate.              *
+ * Please report bugs to perthi@fys.uio.no                                *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+
+#include "AliHLTPHOSModuleZCoordinate.h"
+#include "AliHLTPHOSModuleXCoordinate.h"
+
+
+//class  AliHLTPHOSModuleXCoordinate;
+//class  AliHLTPHOSModuleZCoordinate;
+
+class  AliHLTPHOSModuleZXCoordinate
+{
+public:
+  AliHLTPHOSModuleZXCoordinate(); 
+  AliHLTPHOSModuleZXCoordinate(AliHLTPHOSModuleZCoordinate& z,  AliHLTPHOSModuleXCoordinate& x);
+  virtual ~AliHLTPHOSModuleZXCoordinate();
+
+  AliHLTPHOSModuleXCoordinate   GetX();
+  AliHLTPHOSModuleZCoordinate   GetZ();
+
+
+  void SetZ(AliHLTPHOSModuleZCoordinate& z);
+  void SetX(AliHLTPHOSModuleXCoordinate& x);
+
+  void SetZXCoordinate(AliHLTPHOSModuleZCoordinate& z, AliHLTPHOSModuleXCoordinate& z);
+
+private:
+  AliHLTPHOSModuleZCoordinate fZ;
+  AliHLTPHOSModuleXCoordinate fX;
+};
+
+#endif
diff --git a/HLT/PHOS/ana/IMT/class.sh b/HLT/PHOS/ana/IMT/class.sh
new file mode 100755 (executable)
index 0000000..f20d59f
--- /dev/null
@@ -0,0 +1,67 @@
+classfilename=$1
+
+classfilename_h=$classfilename.h
+classfilename_cxx=$classfilename.cxx
+classname=$classfilename
+
+if [  -a $classfilename_h ] || [ -a $classfilename_cxx ];then
+    echo ERROR, $classfilename_h and $classfilename_cxx allready exist, delelte them or rename the class you want to make
+else 
+    echo creating new files   $classfilename_h and $classfilename_cxx
+    printf "#ifndef " > $classfilename_h
+    classguard=${classfilename_h/.h/_H}
+
+    echo $classguard | tr "[:lower:]" "[:upper:]"  >> $classfilename_h
+    printf "#define " >> $classfilename_h
+    echo $classguard | tr "[:lower:]" "[:upper:]"  >> $classfilename_h
+
+    printf "\n" >>$classfilename_h 
+
+    printf "/**************************************************************************\n"  >> $classfilename_h
+    printf " * This file is property of and copyright by the Experimental Nuclear     *\n"  >> $classfilename_h
+    printf " * Physics Group, Dep. of Physics                                         *\n"  >> $classfilename_h
+    printf " * University of Oslo, Norway, 2007                                       *\n"  >> $classfilename_h
+    printf " *                                                                        *\n"  >> $classfilename_h
+    printf " * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*\n"  >> $classfilename_h
+    printf " * Contributors are mentioned in the code where appropriate.              *\n"  >> $classfilename_h
+    printf " * Please report bugs to perthi@fys.uio.no                                *\n"  >> $classfilename_h 
+    printf " *                                                                        *\n"  >> $classfilename_h
+    printf " * Permission to use, copy, modify and distribute this software and its   *\n"  >> $classfilename_h
+    printf " * documentation strictly for non-commercial purposes is hereby granted   *\n"  >> $classfilename_h
+    printf " * without fee, provided that the above copyright notice appears in all   *\n"  >> $classfilename_h
+    printf " * copies and that both the copyright notice and this permission notice   *\n"  >> $classfilename_h
+    printf " * appear in the supporting documentation. The authors make no claims     *\n"  >> $classfilename_h
+    printf " * about the suitability of this software for any purpose. It is          *\n"  >> $classfilename_h
+    printf " * provided \"as is\" without express or implied warranty.                  *\n"  >> $classfilename_h
+    printf " **************************************************************************/\n"  >> $classfilename_h
+
+    printf "\n\n\n" >>$classfilename_h 
+    printf "class " >> $classfilename_h
+    printf " $classname\n{\n\t$classname();\n\tvirtual ~$classname();\n};\n\n#endif\n" >> $classfilename_h  
+
+    printf "/**************************************************************************\n"  >  $classfilename_cxx
+    printf " * This file is property of and copyright by the Experimental Nuclear     *\n"  >> $classfilename_cxx
+    printf " * Physics Group, Dep. of Physics                                         *\n"  >> $classfilename_cxx
+    printf " * University of Oslo, Norway, 2007                                       *\n"  >> $classfilename_cxx
+    printf " *                                                                        *\n"  >> $classfilename_cxx
+    printf " * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*\n"  >> $classfilename_cxx
+    printf " * Contributors are mentioned in the code where appropriate.              *\n"  >> $classfilename_cxx
+    printf " * Please report bugs to perthi@fys.uio.no                                *\n"  >> $classfilename_cxx 
+    printf " *                                                                        *\n"  >> $classfilename_cxx
+    printf " * Permission to use, copy, modify and distribute this software and its   *\n"  >> $classfilename_cxx
+    printf " * documentation strictly for non-commercial purposes is hereby granted   *\n"  >> $classfilename_cxx
+    printf " * without fee, provided that the above copyright notice appears in all   *\n"  >> $classfilename_cxx
+    printf " * copies and that both the copyright notice and this permission notice   *\n"  >> $classfilename_cxx
+    printf " * appear in the supporting documentation. The authors make no claims     *\n"  >> $classfilename_cxx
+    printf " * about the suitability of this software for any purpose. It is          *\n"  >> $classfilename_cxx
+    printf " * provided \"as is\" without express or implied warranty.                  *\n"  >> $classfilename_cxx
+    printf " **************************************************************************/\n"  >> $classfilename_cxx
+    printf "#include \"$classfilename_h\"\n\n" >>  $classfilename_cxx
+    printf "$classname::$classname()\n{\n\n}\n\n" >> $classfilename_cxx
+    printf "$classname::~$classname()\n{\n\n}\n\n" >> $classfilename_cxx
+
+    emacs $classfilename_h  &
+    emacs $classfilename_cxx  &
+
+fi
+
diff --git a/HLT/PHOS/ana/IMT/main.cxx b/HLT/PHOS/ana/IMT/main.cxx
new file mode 100644 (file)
index 0000000..a6f1f71
--- /dev/null
@@ -0,0 +1,39 @@
+/**************************************************************************
+ * This file is property of and copyright by the Experimental Nuclear     *
+ * Physics Group, Dep. of Physics                                         *
+ * University of Oslo, Norway, 2007                                       *
+ *                                                                        *
+ * Author: Per Thomas Hille <perthi@fys.uio.no> for the ALICE HLT Project.*
+ * Contributors are mentioned in the code where appropriate.              *
+ * Please report bugs to perthi@fys.uio.no                                *
+ *                                                                        *
+ * 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.                  *
+ **************************************************************************/
+#include  "AliHLTPHOSIsolatedMipTrigger.h"
+#include "stdio.h"
+
+int 
+main(int argc, char** argv)
+{
+  AliHLTPHOSIsolatedMipTrigger  *miptTrgPtr = new AliHLTPHOSIsolatedMipTrigger(); 
+
+  //  printf("\nargc = %d\n", argc);
+
+  //  for(int i=1; i < argc; i++)
+  //  {
+  //  miptTrgPtr->SetFilePath(argv[i]);
+
+  miptTrgPtr->Analyze();
+      //      printf("\n%s\n", argv[i]);
+      //   } 
+
+
+}
+
+
diff --git a/HLT/PHOS/ana/IMT/makefilelist.sh b/HLT/PHOS/ana/IMT/makefilelist.sh
new file mode 100755 (executable)
index 0000000..2c52942
--- /dev/null
@@ -0,0 +1,20 @@
+files=/tmp/data2/digits*/*root
+filecnt=0;
+
+rm  filelist.txt
+
+#for file in $files; do
+#    echo $file
+#    $((filecnt++))
+#    echo   $((filecnt))
+# done
+
+for file in $files; do
+    $((filecnt++))
+done
+
+echo $((filecnt)) > filelist.txt
+
+for file in $files; do
+    echo $file >> filelist.txt
+done
\ No newline at end of file