AliPMDhit removed from AliPMD
authorbnandi <bnandi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 6 Dec 2003 03:45:10 +0000 (03:45 +0000)
committerbnandi <bnandi@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 6 Dec 2003 03:45:10 +0000 (03:45 +0000)
PMD/AliPMD.cxx
PMD/AliPMD.h
PMD/AliPMDhit.cxx [new file with mode: 0644]
PMD/AliPMDhit.h [new file with mode: 0644]

index de70e52..83c1453 100644 (file)
 
 #include "AliConst.h" 
 #include "AliLoader.h" 
+#include "AliPMDLoader.h" 
 #include "AliPMD.h"
 #include "AliPMDRecPoint.h"
 #include "AliRun.h"
 #include "AliMC.h"
 #include "AliPMDDigitizer.h"
+#include "AliPMDhit.h"
   
 ClassImp(AliPMD)
  
@@ -107,20 +109,20 @@ AliPMD::AliPMD(const char *name, const char *title)
 
 AliLoader* AliPMD::MakeLoader(const char* topfoldername)
 {
- cout<<"AliPMD::MakeLoader ";
+  // Makes PMD Loader
  
- fLoader = new AliPMDLoader(GetName(),topfoldername);
+  fLoader = new AliPMDLoader(GetName(),topfoldername);
  
- if (fLoader)
-  {
-   cout<<"Success"<<endl;
-  }
- else
-  {
-   cout<<"Failure"<<endl;
-  }
+  if (fLoader)
+    {
+      cout<<"Success"<<endl;
+    }
+  else
+    {
+      cout<<"Failure"<<endl;
+    }
 
- return fLoader;
+  return fLoader;
 }
 
 AliPMD::~AliPMD()
@@ -169,22 +171,22 @@ void AliPMD::BuildGeometry()
   // Build simple ROOT TNode geometry for event display
   //
 
-  TNode *Node, *Top;
+  TNode *node, *top;
   const int kColorPMD  = kRed;
 
   //
-  Top=gAlice->GetGeometry()->GetNode("alice");
+  top=gAlice->GetGeometry()->GetNode("alice");
 
   // PMD
   new TBRIK("S_PMD","PMD box","void",300,300,5);
-  Top->cd();
-  Node = new TNode("PMD","PMD","S_PMD",0,0,-600,"");
-  Node->SetLineColor(kColorPMD);
-  fNodes->Add(Node);
+  top->cd();
+  node = new TNode("PMD","PMD","S_PMD",0,0,-600,"");
+  node->SetLineColor(kColorPMD);
+  fNodes->Add(node);
 }
 
 //_____________________________________________________________________________
-Int_t AliPMD::DistancetoPrimitive(Int_t , Int_t )
+Int_t AliPMD::DistancetoPrimitive(Int_t , Int_t ) const
 {
   //
   // Distance from mouse to detector on the screen
@@ -319,39 +321,6 @@ void AliPMD::ResetHits()
     fNRecPoints   = 0;
     if (fRecPoints)   fRecPoints->Clear();
 }
-
-///////////////////////////////////////////////////////////////////////////////
-//                                                                           //
-//  Photon Multiplicity Detector Version 1                                   //
-//                                                                           //
-//Begin_Html
-/*
-<img src="picts/AliPMDv1Class.gif">
-*/
-//End_Html
-//                                                                           //
-///////////////////////////////////////////////////////////////////////////////
-
-
-
-ClassImp(AliPMDhit)
-  
-//_____________________________________________________________________________
-AliPMDhit::AliPMDhit(Int_t shunt,Int_t track, Int_t *vol, Float_t *hits):
-  AliHit(shunt, track)
-{
-  //
-  // Add a PMD hit
-  //
-  Int_t i;
-  for (i=0;i<8;i++) fVolume[i] = vol[i];
-  fX=hits[0];
-  fY=hits[1];
-  fZ=hits[2];
-  fEnergy=hits[3];
-}
-  
-
 //____________________________________________________________________________
 void AliPMD::Hits2SDigits()  
 { 
index 1936632..3b00efe 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef PMD_H
-#define PMD_H
+#ifndef ALIPMD_H
+#define ALIPMD_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
 ////////////////////////////////////////////////
  
 #include "AliDetector.h"
-#include "AliHit.h"
-#include "AliPMDLoader.h"
+#include "AliLoader.h"
 
 class TClonesArray;
 class TFile;
 class AliPMDRecPoint;
+class AliPMDLoader;
+class AliPMDhit;
 
 class AliPMD : public AliDetector {
-  
-protected:
-  Float_t fPar[4];           // pmdin, pmdout, thgas, thcell
-  Float_t fIn[5];            // thmin, thmax, zdist, thlow, thhigh
-  Float_t fGeo[3];           // wafer, edge, numqu
-  Float_t fPadSize[4];       // size of the pads
-  Int_t   fNumPads[4];       // number of the pads
+
 public:
   AliPMD();
   AliPMD(const char *name, const char *title);
@@ -32,16 +27,16 @@ public:
   virtual AliLoader* MakeLoader(const char* topfoldername);
 
   virtual      ~AliPMD();
-  virtual void  AddHit(Int_t, Int_t*, Float_t*);
+  virtual void  AddHit(Int_t track, Int_t* vol, Float_t* hits);
   virtual void  BuildGeometry();
   virtual void  CreateGeometry() {}
   virtual void  CreateMaterials() {}
-  Int_t         DistancetoPrimitive(Int_t, Int_t);
+  Int_t         DistancetoPrimitive(Int_t, Int_t) const;
   virtual Int_t IsVersion() const =0;
-  virtual void  SetPAR(Float_t, Float_t, Float_t, Float_t);
-  virtual void  SetIN(Float_t, Float_t, Float_t, Float_t, Float_t);
-  virtual void  SetGEO(Float_t, Float_t, Float_t);
-  virtual void  SetPadSize(Float_t, Float_t, Float_t, Float_t);
+  virtual void  SetPAR(Float_t p1, Float_t p2, Float_t p3, Float_t p4);
+  virtual void  SetIN(Float_t p1, Float_t p2, Float_t p3, Float_t p4, Float_t p5);
+  virtual void  SetGEO(Float_t p1, Float_t p2, Float_t p3);
+  virtual void  SetPadSize(Float_t p1, Float_t p2, Float_t p3, Float_t p4);
   virtual void  StepManager();
   virtual void  AddRecPoint(const AliPMDRecPoint &p);
   virtual void  MakeBranch(Option_t* option);
@@ -50,44 +45,19 @@ public:
   
   virtual void  Hits2SDigits();
 
- private:
-  TClonesArray* fRecPoints;   //! List of reconstructed hits
-  Int_t         fNRecPoints;  // Number of reconstructed hits
   
-  ClassDef(AliPMD,2)  // Base Class for Photon Multiplicity Detector
-};
+ protected:
+  Float_t fPar[4];           // pmdin, pmdout, thgas, thcell
+  Float_t fIn[5];            // thmin, thmax, zdist, thlow, thhigh
+  Float_t fGeo[3];           // wafer, edge, numqu
+  Float_t fPadSize[4];       // size of the pads
+  Int_t   fNumPads[4];       // number of the pads
 
-//___________________________________________
-class AliPMDhit : public AliHit {
-public:
-  Int_t      fVolume[8];  //array of volumes
-  Float_t    fEnergy;     //Total energy deposited in eV
-public:
-  AliPMDhit() {}
-  AliPMDhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
-  AliPMDhit(AliPMDhit* oldhit) {*this=*oldhit;}
-  virtual ~AliPMDhit() {}
-  inline virtual Int_t GetVolume(Int_t i) {return fVolume[i];}
-  inline virtual Float_t GetEnergy() {return fEnergy;}
-  inline int operator == (AliPMDhit &cell) {
-    Int_t i;
-    if(fTrack!=cell.GetTrack()) return 0;
-    for (i=0; i<8; i++) if(fVolume[i]!=cell.GetVolume(i)) return 0;
-    return 1;
-  }
-  inline virtual AliPMDhit& operator + (AliPMDhit &cell) {
-    fEnergy+=cell.GetEnergy();
-    return *this;
-  }
-  virtual void Print(Option_t *) {
-    printf("PMD Cell %d %d %d %d\n   Primary %d -   Energy %f\n",
-          fVolume[0],fVolume[1],fVolume[2],fVolume[3],fTrack,fEnergy);
-  }
 
+ private:
+  TClonesArray* fRecPoints;   //! List of reconstructed hits
+  Int_t         fNRecPoints;  // Number of reconstructed hits
   
-  ClassDef(AliPMDhit,1)  //Hits object for set:PMD
+  ClassDef(AliPMD,3)  // Base Class for Photon Multiplicity Detector
 };
 #endif
diff --git a/PMD/AliPMDhit.cxx b/PMD/AliPMDhit.cxx
new file mode 100644 (file)
index 0000000..635e557
--- /dev/null
@@ -0,0 +1,44 @@
+/**************************************************************************
+ * 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.                  *
+ **************************************************************************/
+
+#include "AliPMDhit.h"
+#include <TClonesArray.h>
+#include "Riostream.h"
+#include "Rtypes.h"
+
+ClassImp(AliPMDhit)
+  
+//_____________________________________________________________________________
+AliPMDhit::AliPMDhit(Int_t shunt,Int_t track, Int_t *vol, Float_t *hits):
+  AliHit(shunt, track)
+{
+  //
+  // Add a PMD hit
+  //
+  Int_t i;
+  for (i=0;i<8;i++) fVolume[i] = vol[i];
+  fX=hits[0];
+  fY=hits[1];
+  fZ=hits[2];
+  fEnergy=hits[3];
+}
+//_____________________________________________________________________________
+int AliPMDhit::operator == (AliPMDhit &cell) const
+{
+  Int_t i;
+  if(fTrack!=cell.GetTrack()) return 0;
+  for (i=0; i<8; i++) if(fVolume[i]!=cell.GetVolume(i)) return 0;
+  return 1;
+}
diff --git a/PMD/AliPMDhit.h b/PMD/AliPMDhit.h
new file mode 100644 (file)
index 0000000..4e929e5
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef ALIPMDHIT_H
+#define ALIPMDHIT_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+////////////////////////////////////////////////
+//              hits classes for set:PMD      //
+////////////////////////////////////////////////
+#include "AliHit.h"
+#include "Riostream.h"
+
+class TClonesArray;
+
+class AliPMDhit : public AliHit {
+
+ public:
+  AliPMDhit() {}
+  AliPMDhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
+  AliPMDhit(AliPMDhit* oldhit) {*this=*oldhit;}
+  virtual ~AliPMDhit() {}
+  virtual Int_t GetVolume(Int_t i) const {return fVolume[i];}
+  virtual Float_t GetEnergy() const {return fEnergy;}
+  int operator == (AliPMDhit &cell) const;
+  virtual AliPMDhit& operator + (AliPMDhit &cell) {
+    fEnergy+=cell.GetEnergy();
+    return *this;
+  }
+  virtual void Print(Option_t *) {
+    printf("PMD Cell %d %d %d %d\n   Primary %d -   Energy %f\n",
+          fVolume[0],fVolume[1],fVolume[2],fVolume[3],fTrack,fEnergy);
+  }
+  
+ protected:
+  Int_t      fVolume[8];  //array of volumes
+  Float_t    fEnergy;     //Total energy deposited in eV
+  
+  ClassDef(AliPMDhit,2)  //Hits object for set:PMD
+};
+#endif