]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Introduce new class ITSModuleSelection to define ITSModule selection conditions;...
authormtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 25 Mar 2007 17:49:17 +0000 (17:49 +0000)
committermtadel <mtadel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 25 Mar 2007 17:49:17 +0000 (17:49 +0000)
EVE/Alieve/ITSDigitsInfo.cxx
EVE/Alieve/ITSDigitsInfo.h

index ac09707fe87ca0f40a858cddf89489dd1b33c7d8..c3d616fbe8adfe5bec9fb883131d23028a018950 100644 (file)
@@ -4,18 +4,35 @@
 // ITSDigitsInfo
 //
 //
+#include <TMath.h>
+#include <TVector3.h>
 
 #include <Reve/TTreeTools.h>
+#include <Reve/ZTrans.h>
 
 #include "ITSDigitsInfo.h"
 #include <AliITSCalibrationSDD.h>
 #include <AliITSdigit.h>
 #include <AliITSdigitSPD.h>
 
+
 using namespace Reve;
 using namespace Alieve;
 using namespace std;
 
+
+ClassImp(ITSModuleSelection)
+
+ITSModuleSelection::ITSModuleSelection():
+  fType(-1),
+  fLayer(-1),
+  fMinPhi(0),
+  fMaxPhi(2*TMath::Pi()),
+  fMinTheta(0),
+  fMaxTheta(2*TMath::Pi())
+{
+}
+
 ClassImp(ITSDigitsInfo)
 
 /**************************************************************************/
@@ -210,6 +227,53 @@ TClonesArray* ITSDigitsInfo::GetDigits(Int_t mod, Int_t subdet)
   return 0;
 }
 
+/**************************************************************************/
+void ITSDigitsInfo::GetModuleIDs(ITSModuleSelection* sel, std::vector<UInt_t>& ids)
+{
+  // loop SPD
+  Int_t idx0 = 0, idx1 = 0;
+  switch(sel->fType)
+  {
+    case 0:
+      idx0 = 0;
+      idx1 = fGeom->GetLastSPD();
+      break;
+    case 1:
+      idx0 = fGeom->GetLastSPD();
+      idx1 = fGeom->GetLastSDD();
+      break;
+    case 2:
+      idx0 = fGeom->GetLastSDD();
+      idx1 = fGeom->GetLastSSD();
+      break;
+    default:
+      idx1 = 0;
+      idx1 = fGeom->GetLastSSD();
+  }
+
+  TVector3 v;
+  Double_t x[9];
+  Int_t lay, lad, det;
+  ZTrans mx;
+  for(Int_t id = idx0; id<idx1; id++){
+    fGeom->GetModuleId(id, lay, lad, det);
+    if(sel->fLayer==lay || sel->fLayer==-1)
+    {
+      // check data from matrix
+      mx.UnitTrans();
+      fGeom->GetRotMatrix(id, x);
+      mx.SetBaseVec(1, x[0], x[3], x[6]);
+      mx.SetBaseVec(2, x[1], x[4], x[7]);
+      mx.SetBaseVec(3, x[2], x[5], x[8]);
+      fGeom->GetTrans(id, x);  
+      mx.SetBaseVec(4, x);
+      mx.GetPos(v);
+      if(v.Phi()<sel->fMaxPhi && v.Phi()>sel->fMinPhi &&
+         v.Theta()<sel->fMaxTheta && v.Theta()>sel->fMinTheta )
+       ids.push_back(id);
+    }
+  }
+}
 
 /**************************************************************************/
 
index 4b556669004edd6ddfac7b6e91e0515a81909ac2..d7015af06f415d3f8bc09c48c30a49b893c48a84 100644 (file)
@@ -6,6 +6,7 @@
 #include <Reve/Reve.h>
 
 #include <map>
+#include <vector>
 
 #include <TObject.h>
 #include <TClonesArray.h>
 
 
 namespace Alieve {
-
+/**************************************************************************/
+// ITSModuleSelection
+/**************************************************************************/
+class ITSModuleSelection
+{
+public:
+  Int_t    fType;
+  Int_t    fLayer;
+  Float_t  fMinPhi;
+  Float_t  fMaxPhi;
+  Float_t  fMinTheta;
+  Float_t  fMaxTheta; 
+  
+  ITSModuleSelection();
+
+  ClassDef(ITSModuleSelection, 1);
+};
+
+/**************************************************************************/
+// ITSDigitsInfo
+/**************************************************************************/
 class ITSDigitsInfo : public TObject, public Reve::ReferenceCount
 {
   ITSDigitsInfo(const ITSDigitsInfo&);            // Not implemented
@@ -70,6 +91,8 @@ public:
 
   void GetSPDLocalZ(Int_t j, Float_t& z);
 
+  void GetModuleIDs(ITSModuleSelection* sel, std::vector<UInt_t>& ids);
+
   virtual void Print(Option_t* opt="") const;
 
   ClassDef(ITSDigitsInfo, 1);