1 /**************************************************************************
2 * Copyright(c) 2007-2010, 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 **************************************************************************/
16 //========================================================================
18 // This class generates misalignment for T0. In particular it defines
19 // the misalignment in the three canonical scenarios: "ideal", "residual"
21 // It is meant to be run standalone or from the steering macro
22 // $ALICE_ROOT/macros/MakeAlignmentObjs.C
23 // looping on the detectors.
25 //========================================================================
27 #include "AliT0MisAligner.h"
28 #include "AliGeomManager.h"
29 #include "TClonesArray.h"
31 #include "AliAlignObjParams.h"
34 ClassImp(AliT0MisAligner)
36 //_______________________________________________________________________________________
37 AliT0MisAligner::AliT0MisAligner() : AliMisAligner()
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").
50 TClonesArray *array = new TClonesArray("AliAlignObjParams",4);
51 TClonesArray &alobj = *array;
53 Double_t dx,dy,dz,dpsi,dtheta,dphi;
54 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
58 TString symName[2] = {"/ALIC_1/0STR_1","/ALIC_1/0STL_1"};
61 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
62 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
64 if(TString(GetMisalType())=="ideal")
67 dpsi=0., dtheta=0., dphi=0.;
68 for (Int_t imod=0; imod<2; imod++)
70 new(alobj[imod]) AliAlignObjParams(symName[imod].Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
72 }else if(TString(GetMisalType())=="residual" || TString(GetMisalType())=="full")
75 for (Int_t imod=0; imod<2; imod++)
77 dx = gRandom->Gaus(0.,sigmatr);
78 dy = gRandom->Gaus(0.,sigmatr);
79 dz = gRandom->Gaus(0.,sigmatr);
80 dpsi = gRandom->Gaus(0.,sigmarot);
81 dtheta = gRandom->Gaus(0.,sigmarot);
82 dphi = gRandom->Gaus(0.,sigmarot);
83 new(alobj[imod]) AliAlignObjParams(symName[imod].Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
87 AliError(Form("\"%s\" is not a valid identifier for misalignment types. Exiting ...",GetMisalType()));
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
100 AliCDBMetaData* md = new AliCDBMetaData();
101 md->SetResponsible("Tomasz Malkiewicz");
103 if(TString(GetMisalType())=="ideal")
104 md->SetComment("Alignment objects for T0 ideal misalignment");
105 if(TString(GetMisalType())=="residual")
106 md->SetComment("Alignment objects for T0 residual misalignment");
107 if(TString(GetMisalType())=="full")
108 md->SetComment("Alignment objects for T0 full misalignment");