]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSurveyDetElem.cxx
Adding the array of the recosntruction parameters (Marian)
[u/mrichter/AliRoot.git] / MUON / AliMUONSurveyDetElem.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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 
18 ///
19 /// This object provides the methods specific to the detection elements
20 ///
21 /// \author Javier Castillo
22 //-----------------------------------------------------------------------------
23
24 #include "TGeoMatrix.h"
25
26 #include "AliLog.h"
27 #include "AliSurveyObj.h"
28
29 #include "AliMUONSurveyChamber.h"
30 #include "AliMUONSurveyDetElem.h"
31
32 /// \cond CLASSIMP
33 ClassImp(AliMUONSurveyDetElem)
34 /// \endcond
35
36 AliMUONSurveyDetElem::AliMUONSurveyDetElem(Int_t lDetElemId) 
37   : AliMUONSurveyObj() 
38   , fDetElemId(lDetElemId)
39   , fSurveyChamber(0x0)
40 {
41 /// Constructor with detection element id
42 }
43
44 AliMUONSurveyDetElem::AliMUONSurveyDetElem(Int_t lDetElemId, AliMUONSurveyChamber *lSurveyChamber) 
45   : AliMUONSurveyObj() /// Constructor with mother chamber provided
46   , fDetElemId(lDetElemId)
47   , fSurveyChamber(lSurveyChamber)
48 {
49 /// Constructor with mother chamber provided
50 }
51
52 AliMUONSurveyDetElem::~AliMUONSurveyDetElem() {
53   /// Destructor
54 }
55
56 Int_t AliMUONSurveyDetElem::AddStickerTargets(TObjArray *pArray, TString stBaseName, Int_t lTargetMax) {
57   return AliMUONSurveyObj::AddStickerTargets(pArray, stBaseName, lTargetMax);
58 }
59
60 Int_t AliMUONSurveyDetElem::AddStickerTargets(TString stBaseName, Int_t lTargetMax) {
61   if (!fSurveyChamber) {
62     AliError("Pointer to mother chamber has not been set!");
63     return 0;
64   }
65   if (!fSurveyChamber->GetSurveyObj() || !fSurveyChamber->GetSurveyObj()->GetData()) {
66     AliError("Survey data is missing!");
67     return 0;    
68   }
69   return AddStickerTargets(fSurveyChamber->GetSurveyObj()->GetData(),stBaseName,lTargetMax);
70 }
71
72 Int_t AliMUONSurveyDetElem::AddGButtonTargets(TObjArray *pArray, TString stBaseName, Int_t lTargetMax) {
73   return AliMUONSurveyObj::AddGButtonTargets(pArray, stBaseName, lTargetMax);
74 }
75
76 Int_t AliMUONSurveyDetElem::AddGButtonTargets(TString stBaseName, Int_t lTargetMax) {
77   if (!fSurveyChamber) {
78     AliError("Pointer to mother chamber has not been set!");
79     return 0;
80   }
81   if (!fSurveyChamber->GetSurveyObj() || !fSurveyChamber->GetSurveyObj()->GetData()) {
82     AliError("Survey data is missing!");
83     return 0;    
84   }
85   return AddGButtonTargets(fSurveyChamber->GetSurveyObj()->GetData(),stBaseName,lTargetMax);
86 }
87
88 void AliMUONSurveyDetElem::SetLocalTransformation(TGeoCombiTrans *localTrf, Bool_t ownerLocalTrf) {
89   AliMUONSurveyObj::SetLocalTransformation(localTrf,ownerLocalTrf);
90   if (!fSurveyChamber) {
91     AliWarning("Pointer to mother chamber has not been set!");
92     AliMUONSurveyObj::SetBaseTransformation(localTrf,ownerLocalTrf);
93   } else {
94     if (fSurveyChamber->GetLocalTrf()){
95       if (fSurveyChamber->GetAlignTrf()){
96         AliMUONSurveyObj::SetBaseTransformation(new TGeoCombiTrans((*(fSurveyChamber->GetLocalTrf()))*(*(fSurveyChamber->GetAlignTrf()))*(*localTrf)),kTRUE);
97       } else {
98         AliWarning("Mother chamber has not been aligned yet!");
99         AliMUONSurveyObj::SetBaseTransformation(new TGeoCombiTrans((*(fSurveyChamber->GetLocalTrf()))*(*localTrf)),kTRUE);
100       }
101     } else {
102       AliWarning("Mother chamber has no local transformation");
103       AliMUONSurveyObj::SetBaseTransformation(localTrf,ownerLocalTrf);      
104     }
105   }
106 }
107
108 void AliMUONSurveyDetElem::PrintLocalTrf() {
109   printf("DetElem%d Th",fDetElemId);
110   AliMUONSurveyObj::PrintLocalTrf();
111 }
112
113 void AliMUONSurveyDetElem::PrintAlignTrf() {
114   printf("DetElem%d d",fDetElemId);
115   AliMUONSurveyObj::PrintAlignTrf();
116 }