From 3d598e88d49e8e7a847a21273a1c86f5974ebc8d Mon Sep 17 00:00:00 2001 From: mtadel Date: Sun, 25 Mar 2007 17:49:17 +0000 Subject: [PATCH] Introduce new class ITSModuleSelection to define ITSModule selection conditions; this structure is used in ITSDigitsInfo::GetModuleIDs(). --- EVE/Alieve/ITSDigitsInfo.cxx | 64 ++++++++++++++++++++++++++++++++++++ EVE/Alieve/ITSDigitsInfo.h | 25 +++++++++++++- 2 files changed, 88 insertions(+), 1 deletion(-) diff --git a/EVE/Alieve/ITSDigitsInfo.cxx b/EVE/Alieve/ITSDigitsInfo.cxx index ac09707fe87..c3d616fbe8a 100644 --- a/EVE/Alieve/ITSDigitsInfo.cxx +++ b/EVE/Alieve/ITSDigitsInfo.cxx @@ -4,18 +4,35 @@ // ITSDigitsInfo // // +#include +#include #include +#include #include "ITSDigitsInfo.h" #include #include #include + 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& 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; idGetModuleId(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()fMaxPhi && v.Phi()>sel->fMinPhi && + v.Theta()fMaxTheta && v.Theta()>sel->fMinTheta ) + ids.push_back(id); + } + } +} /**************************************************************************/ diff --git a/EVE/Alieve/ITSDigitsInfo.h b/EVE/Alieve/ITSDigitsInfo.h index 4b556669004..d7015af06f4 100644 --- a/EVE/Alieve/ITSDigitsInfo.h +++ b/EVE/Alieve/ITSDigitsInfo.h @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -19,7 +20,27 @@ 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& ids); + virtual void Print(Option_t* opt="") const; ClassDef(ITSDigitsInfo, 1); -- 2.43.0