AliRoot Core  v5-06-30 (35d6c57)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONSurveyDetElem.cxx
Go to the documentation of this file.
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 //-----------------------------------------------------------------------------
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 
35 
37  : AliMUONSurveyObj()
38  , fDetElemId(lDetElemId)
39  , fSurveyChamber(0x0)
40 {
42 }
43 
45  : AliMUONSurveyObj()
46  , fDetElemId(lDetElemId)
47  , fSurveyChamber(lSurveyChamber)
48 {
50 }
51 
54 }
55 
56 Int_t AliMUONSurveyDetElem::AddStickerTargets(TObjArray *pArray, TString stBaseName, Int_t lTargetMax) {
58  return AliMUONSurveyObj::AddStickerTargets(pArray, stBaseName, lTargetMax);
59 }
60 
61 Int_t AliMUONSurveyDetElem::AddStickerTargets(TString stBaseName, Int_t lTargetMax) {
63  if (!fSurveyChamber) {
64  AliError("Pointer to mother chamber has not been set!");
65  return 0;
66  }
67  if (!fSurveyChamber->GetSurveyObj() || !fSurveyChamber->GetSurveyObj()->GetData()) {
68  AliError("Survey data is missing!");
69  return 0;
70  }
71  return AddStickerTargets(fSurveyChamber->GetSurveyObj()->GetData(),stBaseName,lTargetMax);
72 }
73 
74 Int_t AliMUONSurveyDetElem::AddGButtonTargets(TObjArray *pArray, TString stBaseName, Int_t lTargetMax) {
76  return AliMUONSurveyObj::AddGButtonTargets(pArray, stBaseName, lTargetMax);
77 }
78 
79 Int_t AliMUONSurveyDetElem::AddGButtonTargets(TString stBaseName, Int_t lTargetMax) {
81  if (!fSurveyChamber) {
82  AliError("Pointer to mother chamber has not been set!");
83  return 0;
84  }
85  if (!fSurveyChamber->GetSurveyObj() || !fSurveyChamber->GetSurveyObj()->GetData()) {
86  AliError("Survey data is missing!");
87  return 0;
88  }
89  return AddGButtonTargets(fSurveyChamber->GetSurveyObj()->GetData(),stBaseName,lTargetMax);
90 }
91 
92 void AliMUONSurveyDetElem::SetLocalTransformation(TGeoCombiTrans *localTrf, Bool_t ownerLocalTrf) {
94  AliMUONSurveyObj::SetLocalTransformation(localTrf,ownerLocalTrf);
95  if (!fSurveyChamber) {
96  AliWarning("Pointer to mother chamber has not been set!");
97  AliMUONSurveyObj::SetBaseTransformation(localTrf,ownerLocalTrf);
98  } else {
100  if (fSurveyChamber->GetAlignTrf()){
101  AliMUONSurveyObj::SetBaseTransformation(new TGeoCombiTrans((*(fSurveyChamber->GetLocalTrf()))*(*(fSurveyChamber->GetAlignTrf()))*(*localTrf)),kTRUE);
102  } else {
103  AliWarning("Mother chamber has not been aligned yet!");
104  AliMUONSurveyObj::SetBaseTransformation(new TGeoCombiTrans((*(fSurveyChamber->GetLocalTrf()))*(*localTrf)),kTRUE);
105  }
106  } else {
107  AliWarning("Mother chamber has no local transformation");
108  AliMUONSurveyObj::SetBaseTransformation(localTrf,ownerLocalTrf);
109  }
110  }
111 }
112 
115  printf("DetElem%d Th",fDetElemId);
117 }
118 
121  printf("DetElem%d d",fDetElemId);
123 }
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
virtual void PrintAlignTrf()
Int_t fDetElemId
Detection element id.
virtual Int_t AddGButtonTargets(TObjArray *pArray, TString btBaseName, Int_t lTargetMax=9)
#define TObjArray
Class for survey of detection elements of the muon spectrometer.
AliMUONSurveyChamber * fSurveyChamber
Pointer to mother survey chamber object.
virtual void SetLocalTransformation(TGeoCombiTrans *localTrf, Bool_t ownerLocalTrf=kFALSE)
Set local transformation of geometrical element.
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
Class for survey of chambers (frames) of the muon spectrometer.
void SetBaseTransformation(TGeoCombiTrans *baseTrf, Bool_t ownerBaseTrf=kFALSE)
Set transformation of geoemtrical element.
virtual Int_t AddStickerTargets(TObjArray *pArray, TString stBaseName, Int_t lTargetMax=9)
virtual Int_t AddGButtonTargets(TString btBaseName, Int_t lTargetMax=9)
To be implemented in a concrete Chamber or DetElem class.
AliSurveyObj * GetSurveyObj() const
Returns the internal AliSurveyObj.
TGeoCombiTrans * GetAlignTrf() const
Returns the alignment transformation.
virtual void PrintLocalTrf()
AliMUONSurveyDetElem(Int_t lDetElemId)
virtual void SetLocalTransformation(TGeoCombiTrans *localTrf, Bool_t ownerLocalTrf=kFALSE)
Set local transformation of geometrical element.
virtual Int_t AddStickerTargets(TString stBaseName, Int_t lTargetMax=9)
To be implemented in a concrete Chamber or DetElem class.
Base class for survey of muon spectrometer.
TGeoCombiTrans * GetLocalTrf() const
Returns the local transformation.