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 T0. 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 "AliT0MisAligner.h"
28 : #include "AliGeomManager.h"
29 : #include "TClonesArray.h"
30 : #include "TRandom.h"
31 : #include "AliAlignObjParams.h"
32 : #include "AliLog.h"
33 :
34 20 : ClassImp(AliT0MisAligner)
35 :
36 : //_______________________________________________________________________________________
37 0 : AliT0MisAligner::AliT0MisAligner() : AliMisAligner()
38 0 : {
39 : //
40 : // dummy constructor
41 : //
42 0 : }
43 :
44 : //_______________________________________________________________________________________
45 : TClonesArray* AliT0MisAligner::MakeAlObjsArray() {
46 : // builds and returns the array of alignment objects
47 : // according to the spcified misalignment scenario
48 : // ("ideal", "residual" or "full").
49 : //
50 0 : TClonesArray *array = new TClonesArray("AliAlignObjParams",4);
51 : TClonesArray &alobj = *array;
52 :
53 : Double_t dx,dy,dz,dpsi,dtheta,dphi;
54 0 : gRandom->SetSeed(4321);
55 : Double_t sigmatr = 0.006; // sigma for shifts in cm
56 : Double_t sigmarot = 0.001; // sigma for tilts in degrees
57 :
58 0 : TString symName[2] = {"/ALIC_1/0STR_1","/ALIC_1/0STL_1"};
59 :
60 : Int_t iIndex=0;
61 : AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
62 0 : UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
63 :
64 0 : if(TString(GetMisalType())=="ideal")
65 : {
66 : dx=0., dy=0., dz=0.;
67 : dpsi=0., dtheta=0., dphi=0.;
68 0 : for (Int_t imod=0; imod<2; imod++)
69 : {
70 0 : new(alobj[imod]) AliAlignObjParams(symName[imod].Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
71 : }
72 0 : }else if(TString(GetMisalType())=="residual" || TString(GetMisalType())=="full")
73 : {
74 :
75 0 : for (Int_t imod=0; imod<2; imod++)
76 : {
77 0 : dx = gRandom->Gaus(0.,sigmatr);
78 0 : dy = gRandom->Gaus(0.,sigmatr);
79 0 : dz = gRandom->Gaus(0.,sigmatr);
80 0 : dpsi = gRandom->Gaus(0.,sigmarot);
81 0 : dtheta = gRandom->Gaus(0.,sigmarot);
82 0 : dphi = gRandom->Gaus(0.,sigmarot);
83 0 : new(alobj[imod]) AliAlignObjParams(symName[imod].Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
84 : }
85 :
86 : }else{
87 0 : AliError(Form("\"%s\" is not a valid identifier for misalignment types. Exiting ...",GetMisalType()));
88 0 : return 0;
89 : }
90 :
91 0 : return array;
92 0 : }
93 :
94 : //_______________________________________________________________________________________
95 : AliCDBMetaData* AliT0MisAligner::GetCDBMetaData() const {
96 : // Returns the comment and responsible for the
97 : // AliCDBMetaData to be associated with the OCDB entry
98 : // containing the T0 array of misalignment objects
99 : //
100 0 : AliCDBMetaData* md = new AliCDBMetaData();
101 0 : md->SetResponsible("Tomasz Malkiewicz");
102 :
103 0 : if(TString(GetMisalType())=="ideal")
104 0 : md->SetComment("Alignment objects for T0 ideal misalignment");
105 0 : if(TString(GetMisalType())=="residual")
106 0 : md->SetComment("Alignment objects for T0 residual misalignment");
107 0 : if(TString(GetMisalType())=="full")
108 0 : md->SetComment("Alignment objects for T0 full misalignment");
109 :
110 0 : return md;
111 0 : }
|