1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15 //-----------------------------------------------------------------------------
16 /// \class AliMUONSurveyDetElem
17 /// Class for the survey processing of the ALICE DiMuon spectrometer
19 /// This object provides the methods specific to the detection elements
21 /// \author Javier Castillo
22 //-----------------------------------------------------------------------------
24 #include "TGeoMatrix.h"
27 #include "AliSurveyObj.h"
29 #include "AliMUONSurveyChamber.h"
30 #include "AliMUONSurveyDetElem.h"
33 ClassImp(AliMUONSurveyDetElem)
36 AliMUONSurveyDetElem::AliMUONSurveyDetElem(Int_t lDetElemId)
38 , fDetElemId(lDetElemId)
41 /// Constructor with detection element id
44 AliMUONSurveyDetElem::AliMUONSurveyDetElem(Int_t lDetElemId, AliMUONSurveyChamber *lSurveyChamber)
45 : AliMUONSurveyObj() /// Constructor with mother chamber provided
46 , fDetElemId(lDetElemId)
47 , fSurveyChamber(lSurveyChamber)
49 /// Constructor with mother chamber provided
52 AliMUONSurveyDetElem::~AliMUONSurveyDetElem() {
56 Int_t AliMUONSurveyDetElem::AddStickerTargets(TObjArray *pArray, TString stBaseName, Int_t lTargetMax) {
57 return AliMUONSurveyObj::AddStickerTargets(pArray, stBaseName, lTargetMax);
60 Int_t AliMUONSurveyDetElem::AddStickerTargets(TString stBaseName, Int_t lTargetMax) {
61 /// Add a maximum of lTargetMax sticker targets with stBaseName from internal SurveyObj
62 if (!fSurveyChamber) {
63 AliError("Pointer to mother chamber has not been set!");
66 if (!fSurveyChamber->GetSurveyObj() || !fSurveyChamber->GetSurveyObj()->GetData()) {
67 AliError("Survey data is missing!");
70 return AddStickerTargets(fSurveyChamber->GetSurveyObj()->GetData(),stBaseName,lTargetMax);
73 Int_t AliMUONSurveyDetElem::AddGButtonTargets(TObjArray *pArray, TString stBaseName, Int_t lTargetMax) {
74 return AliMUONSurveyObj::AddGButtonTargets(pArray, stBaseName, lTargetMax);
77 Int_t AliMUONSurveyDetElem::AddGButtonTargets(TString stBaseName, Int_t lTargetMax) {
78 /// Add a maximum of lTargetMax sticker targets with stBaseName from internal SurveyObj
79 if (!fSurveyChamber) {
80 AliError("Pointer to mother chamber has not been set!");
83 if (!fSurveyChamber->GetSurveyObj() || !fSurveyChamber->GetSurveyObj()->GetData()) {
84 AliError("Survey data is missing!");
87 return AddGButtonTargets(fSurveyChamber->GetSurveyObj()->GetData(),stBaseName,lTargetMax);
90 void AliMUONSurveyDetElem::SetLocalTransformation(TGeoCombiTrans *localTrf, Bool_t ownerLocalTrf) {
91 /// Set the geometry transformation of this detection element
92 AliMUONSurveyObj::SetLocalTransformation(localTrf,ownerLocalTrf);
93 if (!fSurveyChamber) {
94 AliWarning("Pointer to mother chamber has not been set!");
95 AliMUONSurveyObj::SetBaseTransformation(localTrf,ownerLocalTrf);
97 if (fSurveyChamber->GetLocalTrf()){
98 if (fSurveyChamber->GetAlignTrf()){
99 AliMUONSurveyObj::SetBaseTransformation(new TGeoCombiTrans((*(fSurveyChamber->GetLocalTrf()))*(*(fSurveyChamber->GetAlignTrf()))*(*localTrf)),kTRUE);
101 AliWarning("Mother chamber has not been aligned yet!");
102 AliMUONSurveyObj::SetBaseTransformation(new TGeoCombiTrans((*(fSurveyChamber->GetLocalTrf()))*(*localTrf)),kTRUE);
105 AliWarning("Mother chamber has no local transformation");
106 AliMUONSurveyObj::SetBaseTransformation(localTrf,ownerLocalTrf);
111 void AliMUONSurveyDetElem::PrintLocalTrf() {
112 printf("DetElem%d Th",fDetElemId);
113 AliMUONSurveyObj::PrintLocalTrf();
116 void AliMUONSurveyDetElem::PrintAlignTrf() {
117 printf("DetElem%d d",fDetElemId);
118 AliMUONSurveyObj::PrintAlignTrf();