Line data Source code
1 : /**************************************************************************
2 : * Copyright(c) 2007-2010, 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 : //========================================================================
17 : //
18 : // This class generates misalignment for TPC. In particular it defines
19 : // the misalignment in the three canonical scenarios: "ideal", "residual"
20 : // and "full".
21 : // It is meant to be run standalone or from the steering macro
22 : // $ALICE_ROOT/macros/MakeAlignmentObjs.C
23 : // looping on the detectors.
24 : //
25 : //========================================================================
26 :
27 : #include "AliTPCMisAligner.h"
28 : #include "AliGeomManager.h"
29 : #include "TClonesArray.h"
30 : #include "TGeoManager.h"
31 : #include "TRandom.h"
32 : #include "AliAlignObjParams.h"
33 : #include "AliLog.h"
34 :
35 6 : ClassImp(AliTPCMisAligner)
36 :
37 : //_______________________________________________________________________________________
38 0 : AliTPCMisAligner::AliTPCMisAligner() : AliMisAligner()
39 0 : {
40 : //
41 : // dummy constructor
42 : //
43 0 : }
44 :
45 : //_______________________________________________________________________________________
46 : TClonesArray* AliTPCMisAligner::MakeAlObjsArray() {
47 : // builds and returns the array of alignment objects
48 : // according to the spcified misalignment scenario
49 : // ("ideal", "residual" or "full").
50 : //
51 0 : if(!AliGeomManager::GetGeometry())
52 : {
53 0 : AliError("No geometry loaded into AliGeomManager! Returning null pointer!");
54 0 : return 0;
55 : }
56 :
57 0 : TClonesArray *array = new TClonesArray("AliAlignObjParams",73);
58 : TClonesArray &alobj = *array;
59 :
60 0 : gRandom->SetSeed(4357);
61 : Int_t j = 0;
62 : // misalignment of the whole TPC according to survey
63 : Double_t dx=-0.159, dy=-0.05, dz=0.034, dpsi=-0.00183, dtheta=0.01835, dphi=0.02865;
64 0 : new(alobj[j++]) AliAlignObjParams("ALIC_1/TPC_M_1", 0, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
65 0 : AliAlignObjParams* alObjTPC = (AliAlignObjParams*) array->UncheckedAt(0);
66 0 : alObjTPC->ApplyToGeometry();
67 :
68 0 : if(TString(GetMisalType())=="ideal")
69 : {
70 :
71 : dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
72 0 : for (Int_t iLayer = AliGeomManager::kTPC1; iLayer <= AliGeomManager::kTPC2; iLayer++) {
73 0 : for (Int_t iModule = 0; iModule < AliGeomManager::LayerSize(iLayer); iModule++) {
74 :
75 0 : UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iModule);
76 0 : const char *symname = AliGeomManager::SymName(volid);
77 0 : new(alobj[j++]) AliAlignObjParams(symname, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
78 : }
79 : }
80 :
81 0 : }else if(TString(GetMisalType())=="residual" || TString(GetMisalType())=="full"){
82 : // sigma translation = 0.1 mm
83 : // sigma rotation = 0.1 mrad
84 : // RS = local
85 :
86 : Double_t sigmatr=0.01;
87 : Double_t sigmarot = 0.006;
88 :
89 0 : for (Int_t iLayer = AliGeomManager::kTPC1; iLayer <= AliGeomManager::kTPC2; iLayer++) {
90 0 : for (Int_t iModule = 0; iModule < AliGeomManager::LayerSize(iLayer); iModule++) {
91 :
92 0 : dx = gRandom->Gaus(0,sigmatr);
93 0 : dy = gRandom->Gaus(0,sigmatr);
94 0 : dz = gRandom->Gaus(0,sigmatr);
95 0 : dpsi = gRandom->Gaus(0,sigmarot);
96 0 : dtheta = gRandom->Gaus(0,sigmarot);
97 0 : dphi = gRandom->Gaus(0,sigmarot);
98 :
99 0 : UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iModule);
100 0 : const char *symname = AliGeomManager::SymName(volid);
101 0 : new(alobj[j++]) AliAlignObjParams(symname, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
102 : }
103 : }
104 : }else{
105 0 : AliError(Form("\"%s\" is not a valid identifier for misalignment types. Exiting ...",GetMisalType()));
106 0 : return 0;
107 : }
108 :
109 0 : return array;
110 0 : }
111 :
112 : //_______________________________________________________________________________________
113 : AliCDBMetaData* AliTPCMisAligner::GetCDBMetaData() const {
114 : // Returns the comment and responsible for the
115 : // AliCDBMetaData to be associated with the OCDB entry
116 : // containing the TPC array of misalignment objects
117 : //
118 0 : AliCDBMetaData* md = new AliCDBMetaData();
119 0 : md->SetResponsible("");
120 :
121 0 : if(TString(GetMisalType())=="ideal")
122 0 : md->SetComment("Alignment objects for TPC ideal misalignment");
123 0 : if(TString(GetMisalType())=="residual")
124 0 : md->SetComment("Alignment objects for TPC residual misalignment");
125 0 : if(TString(GetMisalType())=="full")
126 0 : md->SetComment("Alignment objects for TPC full misalignment");
127 :
128 0 : return md;
129 0 : }
|