#include "AliMUONGeometryModule.h"
#include "AliMUONGeometryModuleTransformer.h"
#include "AliMUONGeometryEnvelope.h"
#include "AliMUONGeometryEnvelopeStore.h"
#include "AliMUONGeometryDetElement.h"
#include "AliMUONStringIntMap.h"
#include "AliLog.h"
#include <TVirtualMC.h>
#include <TGeoMatrix.h>
#include <TObjArray.h>
#include <TArrayI.h>
#include <Riostream.h>
ClassImp(AliMUONGeometryModule)
AliMUONGeometryModule::AliMUONGeometryModule(Int_t moduleId)
: TObject(),
fIsVirtual(true),
fNofSVs(0),
fSVVolumeIds(0),
fEnvelopes(0),
fSVMap(0),
fTransformer(0)
{
fSVVolumeIds = new TArrayI(20);
fSVMap = new AliMUONStringIntMap();
fTransformer = new AliMUONGeometryModuleTransformer(moduleId);
fEnvelopes = new AliMUONGeometryEnvelopeStore(
fTransformer->GetDetElementStore());
}
AliMUONGeometryModule::AliMUONGeometryModule()
: TObject(),
fIsVirtual(true),
fNofSVs(0),
fSVVolumeIds(0),
fEnvelopes(0),
fSVMap(0),
fTransformer(0)
{
}
AliMUONGeometryModule::~AliMUONGeometryModule()
{
delete fSVVolumeIds;
delete fEnvelopes;
delete fSVMap;
delete fTransformer;
}
Int_t AliMUONGeometryModule::GetSVIndex(Int_t svVolId) const
{
for (Int_t i=0; i<fNofSVs; i++) {
if (fSVVolumeIds->At(i) == svVolId) return i;
}
return -1;
}
void AliMUONGeometryModule::SetTransformation(const TGeoCombiTrans& transform)
{
fTransformer->SetTransformation(transform);
}
void AliMUONGeometryModule::SetVolumePath(const TString& volumePath)
{
fTransformer->SetVolumePath(volumePath);
}
void AliMUONGeometryModule::SetSensitiveVolume(Int_t svVolId)
{
if (fSVVolumeIds->GetSize() == fNofSVs) fSVVolumeIds->Set(2*fNofSVs);
fSVVolumeIds->AddAt(svVolId, fNofSVs++);
}
void AliMUONGeometryModule::SetSensitiveVolume(const TString& volName)
{
SetSensitiveVolume(TVirtualMC::GetMC()->VolId(volName));
}
void AliMUONGeometryModule::SetAlign(Bool_t align)
{
fEnvelopes->SetAlign(align);
}
AliMUONGeometryDetElement*
AliMUONGeometryModule::FindBySensitiveVolume(const TString& sensVolume) const
{
Int_t detElemId = fSVMap->Get(sensVolume);
if (!detElemId) return 0;
return fTransformer->GetDetElement(detElemId);
}
Bool_t AliMUONGeometryModule::IsSensitiveVolume(Int_t volId) const
{
for (Int_t i=0; i<fNofSVs; i++) {
if (fSVVolumeIds->At(i) == volId) return kTRUE;
}
return kFALSE;
}
Bool_t AliMUONGeometryModule::IsSensitiveVolume(const TString& volName) const
{
return IsSensitiveVolume(TVirtualMC::GetMC()->VolId(volName));
}
AliMUONGeometryModule.cxx:1 AliMUONGeometryModule.cxx:2 AliMUONGeometryModule.cxx:3 AliMUONGeometryModule.cxx:4 AliMUONGeometryModule.cxx:5 AliMUONGeometryModule.cxx:6 AliMUONGeometryModule.cxx:7 AliMUONGeometryModule.cxx:8 AliMUONGeometryModule.cxx:9 AliMUONGeometryModule.cxx:10 AliMUONGeometryModule.cxx:11 AliMUONGeometryModule.cxx:12 AliMUONGeometryModule.cxx:13 AliMUONGeometryModule.cxx:14 AliMUONGeometryModule.cxx:15 AliMUONGeometryModule.cxx:16 AliMUONGeometryModule.cxx:17 AliMUONGeometryModule.cxx:18 AliMUONGeometryModule.cxx:19 AliMUONGeometryModule.cxx:20 AliMUONGeometryModule.cxx:21 AliMUONGeometryModule.cxx:22 AliMUONGeometryModule.cxx:23 AliMUONGeometryModule.cxx:24 AliMUONGeometryModule.cxx:25 AliMUONGeometryModule.cxx:26 AliMUONGeometryModule.cxx:27 AliMUONGeometryModule.cxx:28 AliMUONGeometryModule.cxx:29 AliMUONGeometryModule.cxx:30 AliMUONGeometryModule.cxx:31 AliMUONGeometryModule.cxx:32 AliMUONGeometryModule.cxx:33 AliMUONGeometryModule.cxx:34 AliMUONGeometryModule.cxx:35 AliMUONGeometryModule.cxx:36 AliMUONGeometryModule.cxx:37 AliMUONGeometryModule.cxx:38 AliMUONGeometryModule.cxx:39 AliMUONGeometryModule.cxx:40 AliMUONGeometryModule.cxx:41 AliMUONGeometryModule.cxx:42 AliMUONGeometryModule.cxx:43 AliMUONGeometryModule.cxx:44 AliMUONGeometryModule.cxx:45 AliMUONGeometryModule.cxx:46 AliMUONGeometryModule.cxx:47 AliMUONGeometryModule.cxx:48 AliMUONGeometryModule.cxx:49 AliMUONGeometryModule.cxx:50 AliMUONGeometryModule.cxx:51 AliMUONGeometryModule.cxx:52 AliMUONGeometryModule.cxx:53 AliMUONGeometryModule.cxx:54 AliMUONGeometryModule.cxx:55 AliMUONGeometryModule.cxx:56 AliMUONGeometryModule.cxx:57 AliMUONGeometryModule.cxx:58 AliMUONGeometryModule.cxx:59 AliMUONGeometryModule.cxx:60 AliMUONGeometryModule.cxx:61 AliMUONGeometryModule.cxx:62 AliMUONGeometryModule.cxx:63 AliMUONGeometryModule.cxx:64 AliMUONGeometryModule.cxx:65 AliMUONGeometryModule.cxx:66 AliMUONGeometryModule.cxx:67 AliMUONGeometryModule.cxx:68 AliMUONGeometryModule.cxx:69 AliMUONGeometryModule.cxx:70 AliMUONGeometryModule.cxx:71 AliMUONGeometryModule.cxx:72 AliMUONGeometryModule.cxx:73 AliMUONGeometryModule.cxx:74 AliMUONGeometryModule.cxx:75 AliMUONGeometryModule.cxx:76 AliMUONGeometryModule.cxx:77 AliMUONGeometryModule.cxx:78 AliMUONGeometryModule.cxx:79 AliMUONGeometryModule.cxx:80 AliMUONGeometryModule.cxx:81 AliMUONGeometryModule.cxx:82 AliMUONGeometryModule.cxx:83 AliMUONGeometryModule.cxx:84 AliMUONGeometryModule.cxx:85 AliMUONGeometryModule.cxx:86 AliMUONGeometryModule.cxx:87 AliMUONGeometryModule.cxx:88 AliMUONGeometryModule.cxx:89 AliMUONGeometryModule.cxx:90 AliMUONGeometryModule.cxx:91 AliMUONGeometryModule.cxx:92 AliMUONGeometryModule.cxx:93 AliMUONGeometryModule.cxx:94 AliMUONGeometryModule.cxx:95 AliMUONGeometryModule.cxx:96 AliMUONGeometryModule.cxx:97 AliMUONGeometryModule.cxx:98 AliMUONGeometryModule.cxx:99 AliMUONGeometryModule.cxx:100 AliMUONGeometryModule.cxx:101 AliMUONGeometryModule.cxx:102 AliMUONGeometryModule.cxx:103 AliMUONGeometryModule.cxx:104 AliMUONGeometryModule.cxx:105 AliMUONGeometryModule.cxx:106 AliMUONGeometryModule.cxx:107 AliMUONGeometryModule.cxx:108 AliMUONGeometryModule.cxx:109 AliMUONGeometryModule.cxx:110 AliMUONGeometryModule.cxx:111 AliMUONGeometryModule.cxx:112 AliMUONGeometryModule.cxx:113 AliMUONGeometryModule.cxx:114 AliMUONGeometryModule.cxx:115 AliMUONGeometryModule.cxx:116 AliMUONGeometryModule.cxx:117 AliMUONGeometryModule.cxx:118 AliMUONGeometryModule.cxx:119 AliMUONGeometryModule.cxx:120 AliMUONGeometryModule.cxx:121 AliMUONGeometryModule.cxx:122 AliMUONGeometryModule.cxx:123 AliMUONGeometryModule.cxx:124 AliMUONGeometryModule.cxx:125 AliMUONGeometryModule.cxx:126 AliMUONGeometryModule.cxx:127 AliMUONGeometryModule.cxx:128 AliMUONGeometryModule.cxx:129 AliMUONGeometryModule.cxx:130 AliMUONGeometryModule.cxx:131 AliMUONGeometryModule.cxx:132 AliMUONGeometryModule.cxx:133 AliMUONGeometryModule.cxx:134 AliMUONGeometryModule.cxx:135 AliMUONGeometryModule.cxx:136 AliMUONGeometryModule.cxx:137 AliMUONGeometryModule.cxx:138 AliMUONGeometryModule.cxx:139 AliMUONGeometryModule.cxx:140 AliMUONGeometryModule.cxx:141 AliMUONGeometryModule.cxx:142 AliMUONGeometryModule.cxx:143 AliMUONGeometryModule.cxx:144 AliMUONGeometryModule.cxx:145 AliMUONGeometryModule.cxx:146 AliMUONGeometryModule.cxx:147 AliMUONGeometryModule.cxx:148 AliMUONGeometryModule.cxx:149 AliMUONGeometryModule.cxx:150 AliMUONGeometryModule.cxx:151 AliMUONGeometryModule.cxx:152 AliMUONGeometryModule.cxx:153 AliMUONGeometryModule.cxx:154 AliMUONGeometryModule.cxx:155 AliMUONGeometryModule.cxx:156 AliMUONGeometryModule.cxx:157 AliMUONGeometryModule.cxx:158 AliMUONGeometryModule.cxx:159 AliMUONGeometryModule.cxx:160 AliMUONGeometryModule.cxx:161 AliMUONGeometryModule.cxx:162 AliMUONGeometryModule.cxx:163 AliMUONGeometryModule.cxx:164 AliMUONGeometryModule.cxx:165 AliMUONGeometryModule.cxx:166 AliMUONGeometryModule.cxx:167 AliMUONGeometryModule.cxx:168 AliMUONGeometryModule.cxx:169 AliMUONGeometryModule.cxx:170 AliMUONGeometryModule.cxx:171 AliMUONGeometryModule.cxx:172 AliMUONGeometryModule.cxx:173 AliMUONGeometryModule.cxx:174 AliMUONGeometryModule.cxx:175 AliMUONGeometryModule.cxx:176 AliMUONGeometryModule.cxx:177 AliMUONGeometryModule.cxx:178 AliMUONGeometryModule.cxx:179 AliMUONGeometryModule.cxx:180 AliMUONGeometryModule.cxx:181 AliMUONGeometryModule.cxx:182 AliMUONGeometryModule.cxx:183 AliMUONGeometryModule.cxx:184 AliMUONGeometryModule.cxx:185 AliMUONGeometryModule.cxx:186 AliMUONGeometryModule.cxx:187 AliMUONGeometryModule.cxx:188 AliMUONGeometryModule.cxx:189 AliMUONGeometryModule.cxx:190 AliMUONGeometryModule.cxx:191 AliMUONGeometryModule.cxx:192 AliMUONGeometryModule.cxx:193 AliMUONGeometryModule.cxx:194 AliMUONGeometryModule.cxx:195 AliMUONGeometryModule.cxx:196 AliMUONGeometryModule.cxx:197